Skip to content

svc-selkies: honor SELKIES_MODE env var in run script#152

Open
DL6ER wants to merge 1 commit intolinuxserver:masterfrom
DL6ER:fix/svc-selkies-honor-mode-env
Open

svc-selkies: honor SELKIES_MODE env var in run script#152
DL6ER wants to merge 1 commit intolinuxserver:masterfrom
DL6ER:fix/svc-selkies-honor-mode-env

Conversation

@DL6ER
Copy link
Copy Markdown

@DL6ER DL6ER commented Apr 25, 2026

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

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 mode setting with env_var: SELKIES_MODE (see src/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=webrtc on 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 websockets while -e SELKIES_MODE=webrtc actually 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?

docker run -d -e SELKIES_MODE=webrtc ... webtop:patched
docker exec <id> ps -o pid,cmd | grep selkies
> /lsiopy/bin/python3 /lsiopy/bin/selkies --addr=localhost --mode=webrtc

Without env var:

docker run -d ... webtop:patched
docker exec <id> ps -o pid,cmd | grep selkies
> /lsiopy/bin/python3 /lsiopy/bin/selkies --addr=localhost --mode=websockets

Default behaviour preserved.

Source / References:

  • Setting definition: selkies-project/selkies src/selkies/settings.py, field mode with env_var: SELKIES_MODE.
  • Affected file in this repo: root/etc/s6-overlay/s6-rc.d/svc-selkies/run.

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.
Copilot AI review requested due to automatic review settings April 25, 2026 15:57
@LinuxServer-CI LinuxServer-CI moved this to PRs Ready For Team Review in Issue & PR Tracker Apr 25, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 production exec launch path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@LinuxServer-CI
Copy link
Copy Markdown
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/selkies-base/debiantrixie-aa141909-pkg-aa141909-dev-bf75ba339e1336f269106f2443b9cd22d9fca37a-pr-152/index.html
https://ci-tests.linuxserver.io/lspipepr/selkies-base/debiantrixie-aa141909-pkg-aa141909-dev-bf75ba339e1336f269106f2443b9cd22d9fca37a-pr-152/shellcheck-result.xml

Tag Passed
amd64-debiantrixie-aa141909-pkg-aa141909-dev-bf75ba339e1336f269106f2443b9cd22d9fca37a-pr-152
arm64v8-debiantrixie-aa141909-pkg-aa141909-dev-bf75ba339e1336f269106f2443b9cd22d9fca37a-pr-152

@thelamer
Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: PRs Ready For Team Review

Development

Successfully merging this pull request may close these issues.

4 participants