Question on sync for multiple accounts on the same Linux machine (if feasable) #365
-
Good day, This project is amazing - thank you so much. Is there a recommended way of running the sync system on the same machine (Linux, via Docker) for multiple accounts please? I have my own Peloton -> Garmin working fine using the UI. This is on an Ubuntu server. It works /really/ well. Just struggling to fathom how I might set-up a second instance (for my wife). I've pulled into a separate folder. I tried a few things in docker-compose.yaml. Namely something like ...
... where I've shifted up the port numbers. Generally - a little tinkering in there. I spin up the image and it reports all's fine ...
... and I can display the webui on port 8004. However, I get this message on the UI when I visit it @ port 8004 ...
... I guess because I've muddled up spinning up the API on 8081. I had tried pointing to the regular API on 8080 but I couldn't then get anything on port 8004. Thank you for any thoughts on how to achieve additional sync services. If that's possible. Maybe it's not possible and I need a 2nd machine? Brilliant project - why Peloton can't just sync to Garmin themselves is beyond me. But, hey ho. Thanks to the community there is a solution! Regards
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Great question, looking through your setup, I think the problem is you've got some Ports misconfigured and your WebUI config is still trying to talk to the wrong P2G Api container name. There are a couple different ways to organize your docker containers for multi-user P2G, but I prefer the below approach as it keeps things organized, segregated, and not overly complex. (this sounds like the approach you were already attempting to do 😃 ) Here is how I have mine setup, hosting for a few family members: folder structure
user1 docker-composep2g-api-user1:
container_name: p2g-api-user1
image: philosowaffle/peloton-to-garmin:api-stable
environment:
- TZ=America/Chicago
volumes:
- ./api.config.json:/app/configuration.local.json
- ./data:/app/data
- ./data:/app/output
p2g-web-user1:
container_name: p2g-web-user1
image: philosowaffle/peloton-to-garmin:webui-stable
ports:
- 8003:8080
environment:
- TZ=America/Chicago
volumes:
- ./webui.config.json:/app/configuration.local.json
depends_on:
- p2g-api-user1 user1 Api Config File{
"Api": {
"HostUrl": "http://*:8080"
},
.... truncated Observability section....
} user1 Web Config File"Api": {
"HostUrl": "http://p2g-api-user1:8080" <----- I think this is where you're having trouble right now, your second user needs to point to the right p2g api instance
},
"WebUI": {
"HostUrl": "http://*:8080"
},
.... truncated Observability section.... user2 docker-composeThis is identical to user1 with only two small changes:
p2g-api-user2:
container_name: p2g-api-user2
image: philosowaffle/peloton-to-garmin:api-stable
environment:
- TZ=America/Chicago
volumes:
- ./api.config.json:/app/configuration.local.json
- ./data:/app/data
- ./data:/app/output
p2g-web-user2:
container_name: p2g-web-user2
image: philosowaffle/peloton-to-garmin:webui-stable
ports:
- 8004:8080 # using 8004 now, since user1 is using 8003
environment:
- TZ=America/Chicago
volumes:
- ./webui.config.json:/app/configuration.local.json
depends_on:
- p2g-api-user2 user2 Api Config FileIdentical to user1 Api config, no changes. user2 Web Config File"Api": {
"HostUrl": "http://p2g-api-user2:8080" <----- make sure we're pointing to the user2 api, we're using the container name to ensure this
},
"WebUI": {
"HostUrl": "http://*:8080"
},
.... truncated Observability section.... ConclusionNow,
|
Beta Was this translation helpful? Give feedback.
-
Side note, it has been in the back of my mind to support multiple users on a single instance of P2G, but its just not something I've found time to tackle yet. |
Beta Was this translation helpful? Give feedback.
-
Side note, it has been in the back of my mind to support multiple users on a single instance of P2G, but its just not something I've found time to tackle yet. I can imagine that such wouldn't be an inconsequential task! In the meantime. hopefully this thread and your explanation above helps others in the future. Regards |
Beta Was this translation helpful? Give feedback.
-
Update: works a charm. Both accounts now syncing to Garmin. Thank you very much for your clear answer. Regards |
Beta Was this translation helpful? Give feedback.
Great question, looking through your setup, I think the problem is you've got some Ports misconfigured and your WebUI config is still trying to talk to the wrong P2G Api container name.
There are a couple different ways to organize your docker containers for multi-user P2G, but I prefer the below approach as it keeps things organized, segregated, and not overly complex. (this sounds like the approach you were already attempting to do 😃 )
Here is how I have mine setup, hosting for a few family members:
folder structure