Giter Club home page Giter Club logo

Comments (7)

DerXteMensch avatar DerXteMensch commented on September 22, 2024 1

Yes, that header is added.

I removed the whole folder .config/teams-for-linux. Then started teams-for-linux again. And now it works! Don't know what was the problem, but probably some old configuration...

from teams-for-linux.

RolandRosenfeld avatar RolandRosenfeld commented on September 22, 2024

For me 1.4.37 works with custom background, when I start

teams-for-linux --customBGServiceBaseUrl=https://my-server/baseurl --isCustomBackgroundEnabled=true --appLogLevels error,warn,info,debug

In the debug output I see the following relevant messages:

[DEBUG] Fetching custom background configuration from 'https://my-server/baseurl/config.json'
[DEBUG] Custom background service url is 'https://my-server/baseurl'
[...]
[DEBUG] Custom background service remote configuration stored at '/home/username/.config/teams-for-linux/custom_bg_remote.json'
[...]
[DEBUG] Forwarding 'https://statics.teams.cdn.office.net/evergreen-assets/backgroundimages/myimage.jpg' to 'https://my-server/baseurl/myinage.jpg'

The file /home/username/.config/teams-for-linux/custom_bg_remote.json is a stripped down (one-line) version of config.json.

Did you make sure, that your web server adds an "Access-Control-Allow-Origin: *" header to all responses? You can check this with

curl -I https://my-server/baseurl/config.json

from teams-for-linux.

derekatkins avatar derekatkins commented on September 22, 2024

Yes, I fixed the server to add that header (it was working just fine with teams v1).

curl -I https://my-server/baseurl/config.json

returns:

HTTP/1.1 200 OK
Date: Sat, 04 May 2024 17:11:36 GMT
Server: Apache/2.4.41 (Fedora) OpenSSL/1.1.1d mod_perl/2.0.11 Perl/v5.28.2
Last-Modified: Sat, 04 May 2024 13:58:53 GMT
ETag: "de-617a13c8aeeb4"
Accept-Ranges: bytes
Content-Length: 222
Access-Control-Allow-Origin: *
Content-Type: application/json

I think it DOES cache the config.json, because this time it DID pull it down (and it had done it about 30m before my testing for this bug report). HOWEVER, while it is pulling down the config.json correctly from my site, it does NOT pull down the images from my site. And indeed the webDebug still shows me that it is trying to GET from https://statics.teams.cdn.office.net:
image

My config.json reads:

{
    "videoBackgroundImages": [
	{
		"filetype": "jpg",
		"id": "Veridify_Office_F_2405",
		"name": "Veridify Office F 2024-05",
		"src": "/veridify_office_f.jpg",
		"thumb_src": "/veridify_office_f_thumb.jpg"
	}
    ]
}

So it is pulling the correct file name from the config, but it is not pulling the image from the custom URL location.

from teams-for-linux.

RolandRosenfeld avatar RolandRosenfeld commented on September 22, 2024

Now I see your fault: You have to prefix the src and thumb_src values with /evergreen-assets/backgroundimages
So this should be:

{
        "videoBackgroundImages": [
                {
                        "filetype": "jpg",
                        "id": "Custom_bg01",
                        "name": "Veridify Office F 2024-05",
                        "src": "/evergreen-assets/backgroundimages/veridify_office_f.jpg",
                        "thumb_src": "/evergreen-assets/backgroundimages/veridify_office_f_thumb.jpg"
                }
        ]
}

I'm not sure, whether a custom "id" field is allowed, so I used Custom_bg01 (counting up) there.

from teams-for-linux.

derekatkins avatar derekatkins commented on September 22, 2024

Now I see your fault: You have to prefix the src and thumb_src values with /evergreen-assets/backgroundimages

Ahh.. This was not at all clear from the documentation. I would recommend that this be explicitly stated, that the src and thumb_src MUST START with the explicit, static string `/evergreen-assets/backgroundimages', and everything after that is based on the custom URL.

Once I fixed that, it definitely made it further. I DO see this in my webDebug:

[Report Only] Refused to load the image 'https://my.server.name/veridify_office_f_thumb.jpg' because it violates the following Content Security Policy directive: "img-src 'self' blob: data: *.asm.skype.com *.asyncgw.teams.microsoft.com *.office.net *.giphy.com *.officeapps.live.com *.sharepoint-df.com *.sharepoint.com https://statics.teams.cdn.office.net bot-framework.azureedge.net connectoricons-prod.azureedge.net content.powerapps.com docs.botframework.com i.vimeocdn.com i.ytimg.com local.teams.office.com:* marketplacecdn.azureedge.net media.licdn.com outlook.office.com pbs.twimg.com raw.githubusercontent.com skypeteamsbotstorage.blob.core.windows.net statics.teams.microsoft.com substrate.office.com teams.microsoft.com urlp.sfbassets.com".

However the image preview appears to be working properly.

It may be unrelated, but the next line in the webDebug says:
image

from teams-for-linux.

DerXteMensch avatar DerXteMensch commented on September 22, 2024

I also have problems to get it working with Teams v2, using 1.4.37

The json looks like this:

{
	"videoBackgroundImages": [
		{
			"filetype": "jpg",
			"id": "Teamshintergrund",
			"name": "Teamshintergrund",
			"src": "/evergreen-assets/backgroundimages/Teamshintergrund.jpg",
			"thumb_src": "/evergreen-assets/backgroundimages/Teamshintergrund_thumb.jpg>"
		}
	]
}

I start teams with

teams-for-linux --isCustomBackgroundEnabled=true --optInTeamsV2=true --customBGServiceBaseUrl=http://localhost --appLogLevels error,warn,info,debug

In the debug output I get:

[DEBUG] Fetching custom background configuration from 'http://localhost/config.json'
[DEBUG] Custom background service url is 'http://localhost'
...
[ERROR] Fetched custom background remote configuration but failed to save at '/home/malte/.config/teams-for-linux/custom_bg_remote.json'. Unexpected non-whitespace character after JSON at position 168 (line 10 column 1)
...
[DEBUG] Forwarding 'https://statics.teams.cdn.office.net/evergreen-assets/backgroundimages/config.json?v=6' to 'http://localhost/config.json?v=6'

from teams-for-linux.

RolandRosenfeld avatar RolandRosenfeld commented on September 22, 2024

I tried out your setup and it works for me (after removing the ">" at the end of thumb_src). But also with this typo, it works for me, only the thumbnail of the background is broken (black), but the background itself does work as expected.

I cannot reproduce the "failed to save" error with your config.json (with and without the ">"). So there may be some invisible character in your config.json, that wasn't copied here.

Did you make sure, that your webserver adds the "Access-Control-Allow-Origin: *" header?

from teams-for-linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.