Umbrel: not allowd by CORS when logging in on public domain

Created on 5 Jan 2021  ·  15Comments  ·  Source: getumbrel/umbrel

For easier demoing to others I decided to host umbrel on a vps.
The vps itself is managed by plesk and is running centos.

I managed to setup and sucessfully run umbrel. I also connected to it via public address (umbrel.payserver.org)
When trying to login with a password I get the following error:

Not allowed by CORS
/v1/account/login
Error: Not allowed by CORS
    at origin (/app/middlewares/cors.js:14:23)
    at /app/node_modules/cors/lib/index.js:219:13
    at optionsCallback (/app/node_modules/cors/lib/index.js:199:9)
    at corsMiddleware (/app/node_modules/cors/lib/index.js:204:7)
    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
    at /app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at expressInit (/app/node_modules/express/lib/middleware/init.js:40:5)

Most helpful comment

Apologies for hijacking, but I had a similar issue where CORS would reject if nginx was configured to run on a different port. I configured mine listen on 81 instead of 80.

Adding http://${DEVICE_IP}:81 etc. to line 57 solved the problem.

Just posting in case anyone else runs in to trouble running on a different port.

All 15 comments

To run Umbrel on a custom domain, change Line 57 of scripts/start to include your custom domain

I did that.. I changed that to:
DEVICE_HOSTS="http://${DEVICE_IP},http://${DEVICE_HOSTNAME}.local,https://${DEVICE_HOSTNAME}.local,http://${DEVICE_HOSTNAME},https://${DEVICE_HOSTNAME}"

DEVICE_HOSTS="http://${DEVICE_IP},http://${DEVICE_HOSTNAME}.local,https://${DEVICE_HOSTNAME}.local,http://${DEVICE_HOSTNAME},https://${DEVICE_HOSTNAME},https//umbrel.payserver.org/,umbrel.payserver.org"

This is the ouput if I exec into docker container (umbrel manager)
http://95.111.230.23,http://vmi379479.contaboserver.net.local,https://vmi379479.contaboserver.net.local,http://vmi379479.contaboserver.net,https://vmi379479.contaboserver.net,https//umbrel.payserver.org,umbrel.payserver.org,http://iklh767cjiqpnnht5mlyyqbib6xhopu3dqf7zjdczsdfujy7t5njhjyd.onion

How could I debug or change to logic of cors funtion? without rebuilding a docker image and redeploying ?

I think you forgot the : in your domain: https://umbrel.payserver.org instead of https//umbrel.payserver.org.

Once you changed this, restart with:

sudo ./scripts/stop && sudo ./scripts/start

Also, are you planning to use https? You may need to setup a reverse proxy with nginx to use it, as Umbrel Dashboard is over HTTP.

Hello... yeah I just noticed this. I am so sorry for wasting your time..
I was already debugging the container and starting / restarting it... when I noticed the missing :...

Website is up and running :D can't wait to start using it And yeah I am serving it over https.

No worries 😁

Apologies for hijacking, but I had a similar issue where CORS would reject if nginx was configured to run on a different port. I configured mine listen on 81 instead of 80.

Adding http://${DEVICE_IP}:81 etc. to line 57 solved the problem.

Just posting in case anyone else runs in to trouble running on a different port.

sudo nano ~/umbrel/scripts/start

CTRL+_ > 57

I added this:
DEVICE_PORT=8000 (your desired nginx port you edited in docker-composer.yml, I know, its hardcoded and the team is already working on .env, it will be obsolete soon)

and edited the line underneath to this:
DEVICE_HOSTS="http://${DEVICE_IP}:{DEVICE_PORT},http://${DEVICE_HOSTNAME}.local:{DEVICE_PORT},https://${DEVICE_HOSTNAME}.local:{DEVICE_PORT},http://${DEVICE_HOSTNAME}:{DEVICE_PORT},https://${DEVICE_HOSTNAME}:{DEVICE_PORT}"

save, and stop & restart with sudo ./start

update for version 0.3.4.

sudo nano ~/umbrel/scripts/start

CTRL+_ > Line 57

CTRL+K to delete Line 57

paste this, i changed it to port 8000 also in '~/umbrel/docker-compose.yml' on line 33 '8000:80'

DEVICE_PORT="8000" DEVICE_HOSTS="http://${DEVICE_IP}:${DEVICE_PORT},http://${DEVICE_HOSTNAME}.local:${DEVICE_PORT},https://${DEVICE_HOSTNAME}.local:${DEVICE_PORT},http://${DEVICE_HOSTNAME}:${DEVICE_PORT},https://${DEVICE_HOSTNAME}:${DEVICE_PORT}"

can't get it working even with above workarounds

after update to 0.38 I can login at port :8000 (also in .env) but I can't get to show the details, the umbrel version number or tor address (there is only a false)

by connecting with onion address everything is fine. the node is working, its just the port change that's still buggy

I gave up, hardcoded umbrel.local in my hosts file & running it on port 80

Sent from my iPhone

On 30 Mar 2021, at 20:57, phenomeus @.*> wrote:


after update to 0.38 I can login at port :8000 (also in .env) but I can't get to show the details, the umbrel version number or tor address (there is only a false)

by connecting with onion address everything is fine. the node is working, its just the port change that's still buggy


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

Is it possible to have this configurable in the GUI, or at least setup in a way that I don't have to update it every time Umbrel updates?

I'll work on fix in the next couple of days @Minituff

that would be very helpful @louneskmt, thnx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukechilds picture lukechilds  ·  3Comments

snapo picture snapo  ·  9Comments

mayankchhabra picture mayankchhabra  ·  3Comments

junderw picture junderw  ·  3Comments

mayankchhabra picture mayankchhabra  ·  4Comments