Docker-transmission-openvpn: Transmission settings are not persistent across container restarts

Created on 10 Apr 2020  Â·  17Comments  Â·  Source: haugene/docker-transmission-openvpn

Describe the problem
Transmission settings changed at runtime (or written into settings.json) are overwritten by environment variables at container start time. The environment variables are baked into the Dockerfile, even if not set at start time (by e.g. docker-compose.yaml).

This is because:

  • The Dockerfiles have TRANSMISSION_* environment variables baked into the images
  • The openvpn/start.sh script calls dockerize -template /etc/transmission/environment-variables.tmpl:/etc/transmission/environment-variables.sh, which writes a script to export all these envvars ~(redundant, since they are already set by the Docker engine in the container)~
  • The transmission/start.sh script sources those variables ~(redundantly)~ and then overwrites settings.json with dockerize -template /etc/transmission/settings.tmpl:${TRANSMISSION_HOME}/settings.json

I understand there is some level of "feature, not a bug" involved in this, but I believe it to be a shortcoming. I have started a PR to address it, and will put it up as WIP for feedback while I test it.

Add your docker run command
Any

Logs
n/a

Host system:
Any

EDIT: Openvpn calls the script to start transmission without any envvars except its own, hence loading them from environment-variables.sh

enhancement inactivity

Most helpful comment

I see that the stale bot closed this, and that's fine I guess. Just an update from my last post.
Persistent settings are now on the dev branch and will be merged to master with the 3.0 release of this image.

The release has been slower than I hoped, but it seems things are pushing together for a release by the end of this month :crossed_fingers:

All 17 comments

I probably misunderstand this but when you configure it, like documented via env variables, everything is fine, right?

I probably misunderstand this but when you configure it, like documented via env variables, everything is fine, right?

The point here is that when you change settings in the GUI, currently, after a restart, they are reset back to what it was.. this PR aims to allow for persistent settings across restarts.. so if you change something in the GUI, it would update settings.json and be read at next startup, I believe

this PR aims to allow for persistent settings across restarts.. so if you change something in the GUI, it would update settings.json and be read at next startup, I believe

That is correct. There is an issue in the WIP PR I haven't had time to address, but that is the goal.

Is the latest code committed? I’d be interested to take a look :)

Since you asked, I put some time in :)

The PR now works to load a settings.json, but there is still an issue with persistence of settings changed at runtime. See https://github.com/haugene/docker-transmission-openvpn/pull/1131#issuecomment-616930830.

Let me know how testing goes for you!

Fixed that. Should persist settings changed at runtime now!

Had a quick look through the PR now and I think it looks good. This "feature, not a bug", started out as a well agreed upon best practice years ago. Over time I have also felt that it has gradually been perceived more and more as a bug.

There's just been too good weather in Norway the past week to dig deeper into it, but I think that's about to change 😄 I support making UI settings persist between restarts, thank you for getting the ball rolling!

I just had this problem and got around it by setting the settings.json to read only. I guess it breaks the ui settings but it fixes my problem while we wait for the PR :)

...
volumes:
  - "/docker/transmission/config:/data"
  - "/docker/transmission/config/settings.json:/data/transmission-home/settings.json:ro"
...

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Can someone please help me in making the settings.json read only? I "chmod 0444" the file on root and I still cannot change settings for the container. This is insane that no one thought of being unable to change the settings why is no one helping us fix this????

Dude, calm down.. there is a PR and plan to add this feature.. they want
really any need for this before for most, as this is just a container. If
you want to change something you can readily destroy and recreate with new
settings..
But it’s very seldom that settings are changed, in my case the container
has been up fine for many months without issue

On Sun, Aug 9, 2020 at 9:42 Hanyoro notifications@github.com wrote:

Can someone please help me in making the settings.json read only? I "chmod
0444" the file on root and I still cannot change settings for the
container. This is insane that no one thought of being unable to change the
settings why is no one helping us fix this????

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/haugene/docker-transmission-openvpn/issues/1130#issuecomment-670989488,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA7OFYVZETLQWX3CLAMX2UTR7XWH7ANCNFSM4MFFOBKQ
.

Yeah, this has been discussed for a while @Hanyoro. There are multiple issues on this over the years and you can read them if you're interested in the story. But the short version is that this was a design choice that was made based on server management and twelve-factor apps. Anyways, most people seems to want persistent settings and they are coming.

In a few days, or a week or two you should be able to test it yourself on the dev branch. And in the mean time this is an open source project that you are welcome to edit as you want it.

@Hanyoro i literally gave you the solution to making it read only just above... Just add :ro to your volume mapping!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Feel free to re-open this issue if you think it deserves another look.

I see that the stale bot closed this, and that's fine I guess. Just an update from my last post.
Persistent settings are now on the dev branch and will be merged to master with the 3.0 release of this image.

The release has been slower than I hoped, but it seems things are pushing together for a release by the end of this month :crossed_fingers:

Thank you sir!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PriamX picture PriamX  Â·  3Comments

garret picture garret  Â·  3Comments

holger8080 picture holger8080  Â·  4Comments

coulterj picture coulterj  Â·  4Comments

Esteidinger picture Esteidinger  Â·  3Comments