Skip to content

[FEAT] Provide Additional Environment Variable for SSH Port #1026

Open
@a-priestley

Description

@a-priestley

Is this a new feature request?

  • I have searched the existing issues

Name of mod

jellyfin-rffmpeg

Wanted change

Expose a new environment variable for initial rffmpeg setup, appending to rffmpeg.yml:

---
...
rffmpeg:
  ...
  remote:
    ...
    args:
      ...
      - "-p"
      - "<port>"
...

Reason for change

Currently, if your target rffmpeg host exposes sshd on a port other than 22, rffmpeg.yml on the client must be modified after initial setup.
Adding a new variable for initial setup (I suggest RFFMPEG_PORT) to be captured and processed by init-mod-jellyfin-rffmpeg-setup/run would automate this step.

Proposed code change

I'm not too familiar with sed -- not sure if this is correct but I will test.

...
sed -i 's~#    - "/var/lib/jellyfin/id_rsa"~    - "/config/rffmpeg/.ssh/id_rsa"~' /config/rffmpeg/rffmpeg.yml
if [ ! -z "$RFFMPEG_PORT" ]; then
    sed -i 's~#    - "-p"~    - "-p"~' /config/rffmpeg/rffmpeg.yml
    sed -i "s~#    - $RFFMPEG_PORT~    - $RFFMPEG_PORT~" /config/rffmpeg/rffmpeg.yml
fi
...

We will likely also want to ensure that, if the service is reconfigured without the variable after previously including it, these lines are removed from the file:

...
else
    sed "args that remove the line with the port flag"
    sed "args that remove the line with the port value"
fi
...

Or we could default the variable to 22 and remove the check altogether.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions