Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] FILE__varname is not parsed in the container #90

Closed
1 task done
brumik opened this issue Nov 4, 2024 · 3 comments
Closed
1 task done

[BUG] FILE__varname is not parsed in the container #90

brumik opened this issue Nov 4, 2024 · 3 comments

Comments

@brumik
Copy link

brumik commented Nov 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I set:

environment:
  FILE__PASS: /run/secrets/ddclient_password

I can see the evironment variable FILE__PASS set in the container to the path but the PASS is undefined.

Documentation about the feature

Expected Behavior

The PASS contains the contents of the /run/secrets/ddclient_password file.

Steps To Reproduce

  1. Create a secret in ./secrets/ddclient/password as a simple string xxxxxxx for example
secrets:
  ddclient_password:
    file: ./secrets/ddclient/password

services:
  ddclient:
    image: lscr.io/linuxserver/ddclient:latest
    container_name: ddclient
    environment:
      TZ: $TZ
      PUID: $PUID
      PGID: $PGID
      FILE__PASS: /run/secrets/ddclient_password
    secrets:
      - ddclient_password
    volumes:
      - ../appdata/ddclient:/config
    restart: unless-stopped
  1. After starting the container jump into it docker compose exec ddclient sh
  2. See that PASS variable is undefined

Environment

- OS: Ubutnu & NixOs
- How docker service was installed: official documetation / nixos config by virtualization

CPU architecture

x86-64

Docker creation

`docker compose up ddclient`

Container logs

If we set up the env variable to be used as password then following code:

# ddclient.conf
password_env=PASS

ddclient  | WARNING:  null password specified for host xxxxx
Copy link

github-actions bot commented Nov 4, 2024

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@thespad
Copy link
Member

thespad commented Nov 4, 2024

Please provide the full container log

@brumik
Copy link
Author

brumik commented Nov 5, 2024

I am sorry as I was doing the export I realized there is a trailing newline at the end of file. This newline did not show up anywhere (vim/vscode/gedit) and could not remove it with tr. I was able to remove it with truncate -s -1 <<file>>. Now the variable is set correctly.

Incredible how much time I spent on a simple issue like this. Thank you.

@brumik brumik closed this as completed Nov 5, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants