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

Feature Request: Multi User Support #136

Closed
ggogel opened this issue Jun 2, 2022 · 6 comments
Closed

Feature Request: Multi User Support #136

ggogel opened this issue Jun 2, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@ggogel
Copy link

ggogel commented Jun 2, 2022

Hello,

I'm running emby and jellyfin side by side. I'm currently syncing watch states between them with the Trakt plugin but I want to move away from it since it's a 3rd party tool, slow, tedious to manage and prone to errors. I was about to implement my own solution but found this tool. I read in the FAQ that syncing multiple users is only possible by running multiple container instances. I currently have 20+ users and running one container for each user seems a bit overkill to me. Are there any plans to support multiple users in a single instance? It would help me and I guess many others a lot.

@arabcoders
Copy link
Owner

arabcoders commented Jun 2, 2022

Hi

It's possible to run one container for many users but the setup required is kinda complicated you have to switch WS_DATA_PATH for each user if you are just doing scheduled tasks, its gets more complicated for web hooks as you have to change context in http layer as well.

Right now I'm focusing on stabilizing the codebase once that done i will try to tackle this issue i know many users want this feature.

@arabcoders arabcoders added the enhancement New feature or request label Jun 2, 2022
@ggogel
Copy link
Author

ggogel commented Jun 3, 2022

Hi,

Thanks for your fast response. Syncing with the scheduled task is sufficient for me. The data doesn't need to be updated in real-time. Can you provide me with instructions on how to set a different WS_DATA_PATH for each user?

@arabcoders
Copy link
Owner

arabcoders commented Jun 3, 2022

On top of my head right now, You dont use docker-compose for multi-user instead rely on directly running the commands.

very rough and primitive way of doing it is the following create new directory lets say /home/user/watchstate inside that directory create new file called env. put the following environment keys

WS_DISABLE_HTTP=1
WS_DISABLE_CRON=1
WS_DISABLE_CACHE=1

inside the same directory create new user data path for each user. For example,

$ mkdir -p /home/user/watchstate/config/{user1,user2,user3} 

once that done, you need to create the actual config for each user, to do so run the following command, be mindful you need to change the -v /home/user/watchstate/config/user1 to match the user data path

docker run --env-file /home/user/watchstate/env -ti --rm -v /home/user/watchstate/config/user1:/config ghcr.io/arabcoders/watchstate:latest console servers:manage --add user1_plex

do that for each backend that the user is connected to, once you finished doing that for all of your users. it's time to create a very basic bash script that you will run via cronjob if you want or on demand.

$ touch run_jobs.sh && chmod +x run_jobs.sh

Then copy and repeat the following command for each user

docker run --env-file /home/user/watchstate/env -ti --rm -v /home/user/watchstate/config/user1:/config ghcr.io/arabcoders/watchstate:latest /bin/ash -c "console state:import -v && console state:export -v"

once that done save the file and run ./run_jobs.sh if you feel everything is fine, then you can add it to cronjobs.

@arabcoders arabcoders self-assigned this Jun 3, 2022
@arabcoders arabcoders mentioned this issue Jun 3, 2022
55 tasks
@arabcoders
Copy link
Owner

I'll update this issue when i have something to share regarding the multi user support.

@Splinter7914
Copy link

I see the multi user as a possible v2 option in the todo list, curious if we should expect it soon?

@arabcoders
Copy link
Owner

I see the multi user as a possible v2 option in the todo list, curious if we should expect it soon?

Hi, it is something i would like to support, But sadly, it's still unattainable via the method we use, and the work around i came up with is just too slow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants