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

Docker: users.json does not update in --detach mode #45

Open
ellidi opened this issue Sep 3, 2023 · 8 comments
Open

Docker: users.json does not update in --detach mode #45

ellidi opened this issue Sep 3, 2023 · 8 comments

Comments

@ellidi
Copy link

ellidi commented Sep 3, 2023

Running in docker.
Everything works as it should, but I cannot log in to my created admin account.
The "Login" button under "Accounts" in the settings pane does not do anything at all on 3 different browsers.
Am I missing something?

@RblSb
Copy link
Owner

RblSb commented Sep 3, 2023

If you created account and have user/users.json file, you can enter your registered admin name to login input, and then you should see password input, if your name is same and registered user exists. Otherwise you will be entered without password input and admin rights.

@ellidi
Copy link
Author

ellidi commented Sep 3, 2023

Oh, I see the problem, users.json is reset every time I restart the container. config.json persists, though.

@ellidi
Copy link
Author

ellidi commented Sep 4, 2023

After a few /addAdmin -> docker container restart attempts, it finally stuck.

@RblSb
Copy link
Owner

RblSb commented Sep 4, 2023

Are you runned it from cli, as in readme, or some other way?

@ellidi
Copy link
Author

ellidi commented Sep 5, 2023

docker run -d -it -p 4200:4200 -v /[...]

@ellidi
Copy link
Author

ellidi commented Sep 5, 2023

docker run --rm -it -p 4200:4200 -v /[...] makes the config stick.
The thing is that as soon as the /exit command is entered, the container shuts down.
I just want it to run in the background.
It seems the only way to get users.json to stick, is to do it this way,
then /exit, and then run again with -d

In any case, I appreciate your work on this project; It scratches an itch :)

@RblSb
Copy link
Owner

RblSb commented Sep 5, 2023

Thanks for info and words, will try to repro it later and check if there is some other docker flags to keep state on exit with detached mode. Maybe i write users file only on exit from memory, and exit signal is not sended in this corner case, hm.
I mostly use this project as screen -S synctube node build/server.js, so docker setup is not much tested, and was added by users initiative, but i want to keep it in good state, since containers is useful too.

@RblSb
Copy link
Owner

RblSb commented Sep 6, 2023

I tested it like this:

docker run -d --rm -it -p 4200:4200 -v ${PWD}/user:/usr/src/app/user synctube
docker attach active_container_id_here

And /exit after /addAdmin shows Saving state... in output and saves things correctly, is this same for you?
Or, if you got state.json/users.json removed on next container start, then it looks like problem with attached --volume folder.

@RblSb RblSb changed the title Cannot log in. Docker: users.json does not update in --detach mode Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants