ocf / projects

Overview of technical OCF projects
3 stars 0 forks source link

Syncthing service #67

Open yjp20 opened 2 years ago

yjp20 commented 2 years ago

Yesterday I was talking with @encadyma and came up with a basic design plan to provide syncthing, a dropbox-ish service to the UC Berkeley student body.

Syncthing is designed to have one hosted instance per user, so it will be probably easiest to use docker to spin up a new container per user. Each docker instance will then mount to each user via NFS and syncthing will be started based on that directory. I'm thinking that since the scale is going to be small, at least at the beginning, we can borrow a similar kind of approval process we have for application hosting and provide this service on a per-user basis. There is a web interface for each running syncthing instance which we can expose as <username>.syncthing.ocf.berkeley.edu or syncthing.ocf.berkeley.edu/<username> which ever is easier to implement.

Probably the project will consist of 1. the dockerfile, 2. creation of the approval script and 3. creation of a script to track the various containers and their status and 4. configuration of the domain

I'm still unclear what server could host the docker instances since I'm not too familiar with the infra.

Maybe we could migrate to k8s and terraform in the future if there is enough demand.

ethanhs commented 2 years ago

I think this could be really useful! We don't really have great infrastructure to run services like synthing long-term for users (We don't enable linger) but I think something like this could be done.

I think this would also be a great thing to integrate with Atlas (https://github.com/ocf/projects/issues/63), but we need to figure out what that will look like.

fawaf commented 2 years ago

what is linger?

ethanhs commented 2 years ago

Systemd will kill user daemons once the user logs out unless you loginctl enable-linger ...

https://github.com/systemd/systemd/blob/76153ad45f09b6ae45464f2e03d3afefbb4b2afe/NEWS#L274

fawaf commented 2 years ago

Systemd will kill user daemons once the user logs out unless you loginctl enable-linger ...

systemd/systemd@76153ad/NEWS#L274

neato TIL

ethanhs commented 2 years ago

@yjp20 I think the best way to provide this if you don't want to wait for kubernetes/atlas is to provide some automatic install of syncthing in apphosting. If you catch me in the lab I'm happy to hash out the design together a bit more in detail.