-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass secret as file path for security #415
Comments
Hi @V02460! I'd be more than happy to take a stab at this. I could have something working towards the end of the week: does that sound good? |
This will hopefully be introduced on PR #446! |
For more people coming across this and wish to have more security, I've come up with a clever workaround! I created a script I simply named #!/bin/sh
## Get environmental variables
# PostgreSQL authentication
psql_username=$(cat /config/secrets/postgresql_username)
psql_password=$(cat /config/secrets/postgresql_password)
export SYNCV3_DB="postgres://${psql_username}:${psql_password}@postgresql:5432/syncserver?sslmode=disable"
# Matrix sync proxy secret
export SYNCV3_SECRET=$(cat /config/secrets/.secret)
# Matrix sync proxy server name
export SYNCV3_SERVER="https://your.homeserver.here"
# Setting bind address
export SYNCV3_BINDADDR=":8009"
## Run sync server
env /usr/bin/syncv3 Then in the same directory I created a directory called
Then for the docker compose I did: sliding_sync:
image: ghcr.io/matrix-org/sliding-sync:latest
ports:
- 8009:8009
volumes:
- ./sliding-sync:/config
entrypoint: sh -c /config/run.sh # Runs the script instead of the usual entrypoint of the docker image. While this won't be as completely secure, it'll at least help a little. Hopefully a proper implementation comes soon! |
The sliding sync proxy currently only takes its secret via the environment variable SYNCV3_SECRET. When used with systemd this is not considered secure:
From https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#Environment
Please change the sliding sync proxy to accept the path to a secret file.
The text was updated successfully, but these errors were encountered: