Closed insanity67 closed 1 month ago
I even tried enclosing AUTHENTICATION_USERS value in "" but did not change the error message.
+1 Same problem here. I suspect that this could be related to middleware , which reverse proxy are you using ? I'm using Cloudflare tunnels and I supose it's not supported.
which reverse proxy are you using ?
Im using nginx proxy manager with default settings:
@CorentinTh am I right, that some reverse proxy are not supported yet ?
@Bartrpc hmm... but how to self host this with ssl without some kind of reverse proxy? 🤔
it must work behind reverse proxy, there is a pop-up with info that if you're using Enclosed with HTTP you will not be able to create notes. I dunno what to do. For now I'm stopping the container and waiting for developer response ;)
Hi @insanity67 and @Bartrpc
When passing environment variables in the Docker CLI using the -e
flag, you need to escape the $
sign (i.e., replace $
with \$
). This is because the $
sign is interpreted by bash.
For example, with your command:
docker run --name enclosed --restart unless-stopped -p 8787:8787 -e PUBLIC_IS_AUTHENTICATION_REQUIRED="true" -e AUTHENTICATION_JWT_SECRET="cff8d041963fcd1330xxxxxxxxxxxxe36b4677663651afa52eca9855" -e AUTHENTICATION_USERS="myuser@mydomain.com:\$2a\$10\$yMW8mF.L2Na68/xnAoqrXej219jrYcU89dWfe/tfKbtyOZLZ.B1sa" -e SERVER_CORS_ORIGINS="https://enc.mydomain.com/" -v enclosed_data:/app/.data corentinth/enclosed
Alternatively, you can use the --env-file
option to load environment variables from a file without needing to escape the content
I'll also consider adding an option to pass this variable as base64 in the future, which would eliminate the need to escape special characters.
Let me know if it solved the issue
@CorentinTh Wow, thanks for your quick reply! I escaped the "$", now everything works as expected 😍
I'll add a warning on the variable generator page
@CorentinTh good idea, thank you! Really love that project, was looking for such a solution since ever.
Ok, now works, thank You.
It turns out that in env_file I had to do it with "" and \ and it's working :)
.env -> AUTHENTICATION_USERS="user@proton.me:\$2a\$10\$8M4JjO8YP6pkDCqtFolzUOSb25ptxA3qqVCoa7ne50SfmrzUWQN5C
"
I'm using docker-compose.yml and dockge for deploy :)
You've to escape $ in .env file :) It's mandatory :)
Thank You @CorentinTh - fantastic idea with that project :)
Describe the bug
I installed enclosed, everything works perfectly without authentication.
I deleted the conatiner and volume, and recreated with following docker line:
docker run --name enclosed --restart unless-stopped -p 8787:8787 -e PUBLIC_IS_AUTHENTICATION_REQUIRED="true" -e AUTHENTICATION_JWT_SECRET="cff8d041963fcd1330xxxxxxxxxxxxe36b4677663651afa52eca9855" -e AUTHENTICATION_USERS=myuser@mydomain.com:$2a$10$yMW8mF.L2Na68/xnAoqrXej219jrYcU89dWfe/tfKbtyOZLZ.B1sa -e SERVER_CORS_ORIGINS="https://enc.mydomain.com" -v enclosed_data:/app/.data corentinth/enclosed
The AUTHENTICATION_USERS string was generated with: https://docs.enclosed.cc/self-hosting/users-authentication-key-generator
But I cannot login, tells me everytime "wrong username/password".
This logs did I get from docker:
What happened?
I expected to log in with my created username/password.
System information
Docker version 27.2.1, build 9e34c9b on Debian 12 Behind nginx proxy manager, running on the same docker instance.
Where did you encounter the bug?
Other (installations, docker, etc.)