Closed Buntelrus closed 1 year ago
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
The secret is probably not created correctly. See the docker docs to see how to create it properly: https://docs.docker.com/engine/swarm/secrets/#simple-example-get-started-with-secrets
@aptalca
I define my secret as follows:
secrets:
privatekey:
file: ./privatekey.key
password:
file: ./password.txt
regarding to the documentation this should be correct. Furthermore I can access the the correct password with docker compose exec transmission cat /run/secrets/password
but echo $PASS
is empty.
PASS is not the same as password. The name of the file dictates the name of the var
I have faced the same problem recently. I finally decided to set the pass as a plain environment variable. To reproduce the problem I have created a minimum configuration project. I hope this helps.
Thanks for your incredible work!
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
@aptalca @Roxedus could you reproduce this issue? I also put the comment by @kazbeel here:
To reproduce the problem I have created a minimum configuration project. I hope this helps.
Thanks for your incredible work!
What are the next steps? If you need more information or any help, please don't hesitate to reach out to me.
Thanks for your commitment!
Your secret files have trailing newlines. These are included in the variable. Aptalca hinted at this
They have not. For other containers I define my secrets the same way and there is no issue. Also within the container the secret can be accessed and has the correct value (/run/secrets/{your-secret})
There is in the repro repo.
Uhh - Sorry for that! Why is my System not showing them 🤔? Nevertheless this is not working. I've fixed the lines and improved test.sh from the contributed example (https://github.com/Buntelrus/linuxserver-transmission-with-secrets). But the ENVs are not set.
Works just fine when the compose is set up as the readme outlines.
index 978df47..2744fa8 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,8 +1,8 @@
secrets:
transmission_user:
- file: ./secrets/transmission_user
+ file: ${PWD}/secrets/transmission_user
transmission_pass:
- file: ./secrets/transmission_pass
+ file: ${PWD}/secrets/transmission_pass
services:
transmission:
@@ -10,8 +10,8 @@ services:
container_name: transmission
restart: unless-stopped
volumes:
- - ./docker/apps/transmission/config:/config
- - ./docker/apps/transmission/downloads:/downloads
+ - ${PWD}/tmp/config:/config
+ - ${PWD}/tmp/downloads:/downloads
secrets:
- transmission_user
- transmission_pass
@@ -19,9 +19,5 @@ services:
PUID: ${PUID}
PGID: ${PGID}
TZ: ${TZ}
- USER_FILE: /run/secrets/transmission_user
- PASS_FILE: /run/secrets/transmission_pass
- PEERPORT: 51413
- ports:
- - 51413:51413
- - 51413:51413/udp
+ FILE__USER: /run/secrets/transmission_user
+ FILE__PASS: /run/secrets/transmission_pass
✔ Container transmission Started
user-secret: user
pass-secret: pass
I will check that in the evening. Thank you!
One more thing, I wonder why the standard way of setting env vars from secrets does not work. I mean, the use of xxx_FILE
.
There is no "standard way", it's all down to the implementation in the image. For the example in the docs, its implemented in the image like this
Thanks for the clarification!
Is there an existing issue for this?
Current Behavior
When using FILE__PASS env in the container a proper PASS env with the correct password is created. But transmission is ignoring it and the password is just "".
Expected Behavior
Transmission password should equal to the content of the proper secret.
Steps To Reproduce
my conf:
Environment
CPU architecture
x86-64
Docker creation
Container logs