svc-selkies: honor SELKIES_MODE env var in run script#152
svc-selkies: honor SELKIES_MODE env var in run script#152DL6ER wants to merge 1 commit intolinuxserver:masterfrom
Conversation
Selkies's argument parser declares a `mode` setting with `env_var:
SELKIES_MODE` that selects between `websockets` (default) and `webrtc`.
The s6 run script for svc-selkies hardcodes `--mode="websockets"`
which overrides the env var and forces every container into
websocket-mode regardless of the user's `-e SELKIES_MODE=webrtc` setting.
Replace the hardcoded value with `${SELKIES_MODE:-websockets}` so the
existing default is preserved while the documented env var actually
takes effect.
Both the production exec and the DEV_MODE branch are updated for
consistency.
There was a problem hiding this comment.
Pull request overview
This PR updates the svc-selkies s6 run script so Selkies’ startup mode can be configured via the documented SELKIES_MODE environment variable instead of being overridden by a hardcoded CLI flag.
Changes:
- Replace hardcoded
--mode="websockets"with--mode="${SELKIES_MODE:-websockets}"in the DEV_MODE (nodemon) launch path. - Replace hardcoded
--mode="websockets"with--mode="${SELKIES_MODE:-websockets}"in the productionexeclaunch path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I am a bot, here are the test results for this PR:
|
|
See #154 (comment) Thanks for the PRs, just giving you the logic why this might not be merged for a bit and this target may change depending on live feedback. |
Description:
Replace the hardcoded
--mode="websockets"in the svc-selkies s6 run script with--mode="${SELKIES_MODE:-websockets}", in both the production exec and the DEV_MODE branch.Benefits of this PR and context:
Selkies declares a
modesetting withenv_var: SELKIES_MODE(seesrc/selkies/settings.py):{'name': 'mode', 'type': 'str', 'default': 'websockets', 'env_var': 'SELKIES_MODE', 'help': "Specify the mode: 'webrtc' or 'websockets'; defaults to websockets"}But because the run script passes
--mode="websockets"on the command line, the hardcoded value wins over the env var. Setting-e SELKIES_MODE=webrtcon the container has no effect; users have to either patch the run script at runtime or live-edit the compiled/run/service/svc-selkies/run.After this change, the env var works as documented: the default behaviour stays
websocketswhile-e SELKIES_MODE=webrtcactually selects WebRTC mode at startup. Combined with the dual-mode supervisor (separate PRs), this lets users choose the initial mode declaratively.How Has This Been Tested?
Without env var:
Default behaviour preserved.
Source / References:
selkies-project/selkiessrc/selkies/settings.py, fieldmodewithenv_var: SELKIES_MODE.root/etc/s6-overlay/s6-rc.d/svc-selkies/run.