linuxserver / docker-firefox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Password variable not working

ekirchman opened this issue · comments

You can set any environment variable from a file by using a special prepend FILE__.

I use docker compose, and I have set a .password file. When I bring up the container the passsword does not change from it's default value of "abc". I know this because I am getting auto-logged in instead of being prompted for a password. I set up the .password like a .env file. Instead Host is a 2020 M1 mac mini using podman+docker-compose plugin. Image is the arm64 version.

Docker-compose.yml:

---
version: "2.1"
services:
  firefox:
    image: lscr.io/linuxserver/firefox:latest
    container_name: firefox
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Chicago
      - FILE__PASSWORD=./.password
    volumes:
      - ./config:/config
    ports:
      - 5800:3000
    shm_size: "2gb"
    restart: unless-stopped

.password file in the same dir as the docker-compose.
PASSWORD=password

firefox  | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
firefox  | [s6-init] ensuring user provided files have correct perms...exited 0.
firefox  | [fix-attrs.d] applying ownership & permissions fixes...
firefox  | [fix-attrs.d] done.
firefox  | [cont-init.d] executing container initialization scripts...
firefox  | [cont-init.d] 01-envfile: executing... 
firefox  | [env-init] cannot find secret in FILE__PASSWORD
firefox  | [cont-init.d] 01-envfile: exited 0.
firefox  | [cont-init.d] 01-migrations: executing... 
firefox  | [migrations] started
firefox  | [migrations] no migrations found
firefox  | [cont-init.d] 01-migrations: exited 0.
firefox  | [cont-init.d] 02-tamper-check: executing... 
firefox  | [cont-init.d] 02-tamper-check: exited 0.
firefox  | [cont-init.d] 10-adduser: executing... 
firefox  | 
firefox  | -------------------------------------
firefox  |           _         ()
firefox  |          | |  ___   _    __
firefox  |          | | / __| | |  /  \
firefox  |          | | \__ \ | | | () |
firefox  |          |_| |___/ |_|  \__/
firefox  | 
firefox  | 
firefox  | Brought to you by linuxserver.io
firefox  | -------------------------------------
firefox  | 
firefox  | To support LSIO projects visit:
firefox  | https://www.linuxserver.io/donate/
firefox  | -------------------------------------
firefox  | GID/UID
firefox  | -------------------------------------
firefox  | 
firefox  | User uid:    1000
firefox  | User gid:    1000
firefox  | -------------------------------------
firefox  | 
firefox  | [cont-init.d] 10-adduser: exited 0.
firefox  | [cont-init.d] 13-keygen: executing... 
firefox  | 
firefox  | Generating 2048 bit rsa key...
firefox  | 
firefox  | ssl_gen_key_xrdp1 ok
firefox  | 
firefox  | saving to rsakeys.ini
firefox  | 
firefox  | Generating a RSA private key
firefox  | ..............................................+++++
firefox  | ..................+++++
firefox  | writing new private key to '/etc/xrdp/key.pem'
firefox  | -----
firefox  | [cont-init.d] 13-keygen: exited 0.
firefox  | [cont-init.d] 30-config: executing... 
firefox  | [cont-init.d] 30-config: exited 1.
firefox  | [cont-init.d] 50-gid-video: executing... 
firefox  | [cont-init.d] 50-gid-video: exited 0.
firefox  | [cont-init.d] 55-autostart-config: executing... 
firefox  | [cont-init.d] 55-autostart-config: exited 0.
firefox  | [cont-init.d] 56-openboxcopy: executing... 
firefox  | [cont-init.d] 56-openboxcopy: exited 1.
firefox  | [cont-init.d] 90-custom-folders: executing... 
firefox  | [cont-init.d] 90-custom-folders: exited 0.
firefox  | [cont-init.d] 99-custom-files: executing... 
firefox  | [custom-init] no custom files found exiting...
firefox  | [cont-init.d] 99-custom-files: exited 0.
firefox  | [cont-init.d] done.
firefox  | [services.d] starting services
firefox  | guacd[419]: INFO:	Guacamole proxy daemon (guacd) version 1.1.0 started
firefox  | [guac-init] Auto start not set, application start on login
firefox  | guacd[419]: INFO:	Listening on host 0.0.0.0, port 4822
firefox  | [services.d] done.
firefox  | Starting guacamole-lite websocket server
firefox  | listening on *:3000

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

It should point to a path inside the container

I think I understand. I updated my docker-compose.yml to include
- ./password:/run/secrets/
under volumes and
- FILE__PASSWORD=/run/secrets/mysecretpassword instead of the old line.
In the file .password/mysecretpassword is simply the string password

When booting up the container, I see the prompt to login, but the username "abc" with password "password" fails. The logs for the container doesn't show anything either when failing to login

Make sure your file has no trailing new line

I'm using zsh, so the percentage means that there is no new line

❯ cat .password/mysecretpassword
password%

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.

Am trying to get this to work myself, but am struggling (am new to Linux and dockers). I have managed to add the -e FILE__PASSWORD=/run/secrets/mysecretpassword variable to the unraid docker, and it adds it when the docker is built. The logs show an error though:

[env-init] cannot find secret in FILE__PASSWORD

The app data for the docker is /mnt/user/appdata/firefox, and so I created the folders run/secrets in /mnt/user/appdata/firefox/run/secrets. I placed a text document in it called mysecretpassword with no extension that contains the word password.

When I run the docker, it still auto logs me in. Can anyone please help explain where I have gone wrong?

Thanks

The folder you defined in the volume mapping is an absolute path, not relative.

The folder you defined in the volume mapping is an absolute path, not relative.

Thanks for your reply, would you mind explaining a little more? I am guessing you mean I have my mappings wrong for FILE__PASSWORD=/run/secrets/mysecretpassword. The docker thinks the folder called firefox is where it lives, and is inside the container. I thought making the /run/secrets/ folders inside the firefox folder, means the container can see the folders as the path is internal to the docker. Obviously not, a little help would be much appreciated in getting this working.

/run/secrets/mysecretpassword that you defined is an absolute path, meaning it is not inside the config folder or a Firefox folder as you mentioned.

I suggest you read up on docker volume mapping and then define a location properly.

This is beyond the scope of GitHub issues as it's not a bug. You can use our forum or discord for further guidance and help.