AVideo-Encoder icon indicating copy to clipboard operation
AVideo-Encoder copied to clipboard

trying to install friends encoder getting cors error

Open JoshWho opened this issue 3 years ago • 103 comments

for some reason it is getting a cors error when it get to the install part.

https://encoder.corder.tv/install/index.php

when entering the info and everything click install it just hangs and inspect element show a cors error with https://corder.tv/login something like that.

Is there something I can add to his main site to say this domain is allowed? and where would that go if so?

error

JoshWho avatar May 23 '22 09:05 JoshWho

It is probably not a clean ubuntu installation and something is blocking access/requests from different domains.

may be some cors rules somewhere on the server installation

DanielnetoDotCom avatar May 23 '22 13:05 DanielnetoDotCom

It is a fresh install kinda I was going off old directions and it started to install another avideo. I deleted the other avideo should I just wipe it and do it again?

JoshWho avatar May 23 '22 16:05 JoshWho

I mean, the streamer site is blocking. it is something on his apache.

maybe a security module

DanielnetoDotCom avatar May 23 '22 18:05 DanielnetoDotCom

On the main website Is there a cors file or is this just something htaccess does? I do not remember doing anything special with mine

JoshWho avatar May 23 '22 18:05 JoshWho

I wonder if the ssl sets a cors

JoshWho avatar May 23 '22 18:05 JoshWho

by default, avideo leaves all cors rules open.

it is something specific on your web server installation (yes maybe the SSL)

DanielnetoDotCom avatar May 23 '22 19:05 DanielnetoDotCom

Is there a way to run the install without it needing to login to the main site?

JoshWho avatar May 23 '22 19:05 JoshWho

Yes but the problem will still persists

you must resolve the cors problem , otherwise the encoder will be useless

DanielnetoDotCom avatar May 23 '22 19:05 DanielnetoDotCom

only thing I can think is the ssl. Must be something letsencrypt changed.

JoshWho avatar May 23 '22 19:05 JoshWho

Access to XMLHttpRequest at 'https://corder.tv/login' from origin 'https://encoder.corder.tv' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'https://encoder.corder.tv, *', but only one is allowed.

JoshWho avatar May 23 '22 19:05 JoshWho

looks like a typo in the cors I think

JoshWho avatar May 23 '22 19:05 JoshWho

This is the ip http://162.210.100.119/ I do not understand this but will figure it out eventually

JoshWho avatar May 23 '22 21:05 JoshWho

Could you install it using the IP?

DanielnetoDotCom avatar May 23 '22 21:05 DanielnetoDotCom

So even just using the ip it still does the cors thing. Is there a different encoder for just a Standalone Encoder server. The only instructions I found shows how to install this with avideo.

https://www.linuxbabe.com/ubuntu/install-avideo-youphptube-ubuntu-20-04-server

JoshWho avatar May 23 '22 21:05 JoshWho

Remove any cord rule from Apache.conf

also make sure you did install Apache header module

DanielnetoDotCom avatar May 23 '22 21:05 DanielnetoDotCom

Remove any cord rule from Apache.conf

also make sure you did install Apache header module

what u mean by cord rule?

JoshWho avatar May 23 '22 21:05 JoshWho

I mean cors, it was a typo

DanielnetoDotCom avatar May 23 '22 21:05 DanielnetoDotCom

I mean cors, it was a typo

I do not see anything that has cors to it in the confs no header actions not really sure what this is.

JoshWho avatar May 23 '22 21:05 JoshWho

I think i found it it is the ssl includeSubDomains; was missing will test and write back

JoshWho avatar May 23 '22 21:05 JoshWho

I think it was the hsts on the domain messing with it. I have new dns settings taking effect fingers crossed will check back later.

JoshWho avatar May 23 '22 22:05 JoshWho

OK it might not be that at all either. It just won't let me install it no matter what I change

JoshWho avatar May 23 '22 23:05 JoshWho

Here is the weird part. No matter what I mod in the vhost or in a htaccess it never changes the headers and always shows.

access-control-allow-credentials: true access-control-allow-headers: Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, origin, x-requested-with, content-type access-control-allow-methods: GET,HEAD,OPTIONS,POST,PUT access-control-allow-origin: https://imasdk.googleapis.com, * cache-control: no-store, no-cache, must-revalidate, max-age=1, private, must-revalidate

Any clue why it shows access-control-allow-origin: https://imasdk.googleapis.com, *

because that is what the problem is. I can't find this anywhere to delete.

Restarted apache then rebooted the whole server still no change

JoshWho avatar May 24 '22 01:05 JoshWho

Is it because there is no videos uploaded yet so there really is no index to the main site that it is just redirecting and not truly doing the cors maybe?

JoshWho avatar May 24 '22 08:05 JoshWho

is very hard for me to guess, that is why I am asking you to remove all access-control rules from the apache.conf and other confs.

usually the AVideo access-control is enough

DanielnetoDotCom avatar May 24 '22 12:05 DanielnetoDotCom

http://162.210.100.119/

https://corder.tv/

https://encoder.corder.tv/install/index.php

Still wondering if this will change if I upload something

I sent credentials in a pm just in case u wanted to give it a peek

JoshWho avatar May 24 '22 22:05 JoshWho

Any clue what access control could be hiding that I am not seeing. I looked in every conf and even in the htaccess and still do not see anywhere why the Avido script is loading: access-control-allow-origin: https://imasdk.googleapis.com/, * in the header.

It is only the Avideo script reporting that. When I change the doc root directory to a empty folder that access-control-allow-origin: https://imasdk.googleapis.com/, * is no longer there so I know it is something Avideo is doing

JoshWho avatar May 25 '22 19:05 JoshWho

try to install the encoder using another streamer site.

then check if it still works and if you can log in to the original site.

if you are using Cloudflare, disable the Cloudflare proxy.

DanielnetoDotCom avatar May 25 '22 19:05 DanielnetoDotCom

It lets me try my site and your demo test site. When I try a brand new install it shows that access-control-allow-origin: https://imasdk.googleapis.com/, * in the header

JoshWho avatar May 25 '22 19:05 JoshWho

Go here and you can see the error https://cors-test.codehappy.dev/?url=https%3A%2F%2Fcorder.tv%2F&method=get

This is a fresh Ubuntu 20 and Fresh install of Avideo https://corder.tv/

JoshWho avatar May 25 '22 21:05 JoshWho

try to install the encoder using another streamer site.

then check if it still works and if you can log in to the original site.

if you are using Cloudflare, disable the Cloudflare proxy.

No cloudflare installed. It is all direct dns with the host. that is what is stumping me about this. Cloudflare I can just force the header to be whatever I want but I do not have that setup on there yet.

JoshWho avatar May 26 '22 03:05 JoshWho