-
Notifications
You must be signed in to change notification settings - Fork 15
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
What about docker ? #1
Comments
@justUmen: Yeah, at some point I do plan to add a Docker image. However the problem at the moment is that the source code is patched accordingly depending on the NixOS configuration. One example for this is that So while nixpkgs has tooling for building Docker images, you'd then still need Nix to build the Docker image if you don't want to end up with eg. a |
I see... |
@justUmen: Try |
Thank for the asnwer. Failed again on the 2Gb machine, out of memory.
I guess I'll be waiting patiently for the docker version. :) |
@justUmen: Ah, right, this is because Shabitica uses a patched MongoDB, so there are no binaries available and thus it's compiling from source. I probably should mention the binary cache (https://headcounter.org/hydra/) in the README. Compiling MongoDB takes a while and the linking process is quite memory hungry. So if you want to fetch the binaries instead, you could add
After that you can build with Apart from that... even with Docker, you'll still need Nix to build the Docker image because of the aforementioned reasons.
Waiting is probably a good idea anyway, because as mentioned: |
Just wanted to throw my hat in the ring for docker support. I'm going to attempt to get everything running as it currently is, but docker would make things much easier. |
@aszlig have you had any more time to consider a docker container for this? I'm not sure I can afford another server just to run Nix on and I would like to run this for my family. |
@nathan-sain: Unfortunately not yet, but you can also deploy build a NixOS VM with Nix (the package manager), like mentioned in a previous comment. If there would be an easy way to build a systemd-nspawn container or a VM with a production setup, would that also work for you? |
I'm currently running several services in docker containers on an Ubuntu 18.04 server with 4GB of RAM. This version of Ubuntu includes support for systemd-nspawn so I think the that would be the best way to proceed. |
Any updates? |
@jtagcat: Not yet, since at the moment I haven't even rebased against upstream since they made some fundamental changes that require more work to properly integrate (probably a full weekend or more), which I currently don't have :-/ |
Me neither, extremely low on time. Since I don't know about habitica's code and rn don't want to have anything new, would you accept a bounty? |
Well, same here, since I don't know what has changed since the last update. I'm also not sure whether a bounty would help a lot here. The rebase for the current upstream version is something that's still in my todo list, so eventually it will happen at some point anyway and a small bounty wouldn't make a difference in schedule. However, when it comes to supporting Docker, it's an entirely different thing. Just doing the initial work will not be enough because I'll be dogfooding only the NixOS service and would probably constantly break Docker. So for that I guess someone who's knows Nix, is using Docker and wants to maintain it long-term would be a better canidate. Until that, it's going to be on my todo list after the upstream update mentioned above. |
Hello, |
@TheEagle13: Essentially the database is the only thing that needs to be persistent, everything else is entirely disposable. There are some state files around migrations and the Armoire and secrets, but all those are disposable as well, because deleting them will just result in minor inconveniences (eg. users being logged out). From the long-running services standpoint, we have the main service exposing the API and it's proxied by nginx (of course only if The only communication that is allowed to happen from the main service is to MongoDB and to the mailer daemon (source code), the latter is essentially mimicking ther transactional mail API and glues together the local MTA with the main service. It also provides the email templates that are not included in the upstream source tree. Another service is the image proxy, which makes sure that images in markdown can't be used to track user behavour and alse to avoid mixed-content warnings. One noteworthy thing here is that the image proxy is patched to decode the Shabitica session to avoid another attack vector that'd make it possible to brute-force the MAC. The image proxy is also reverse-proxied via nginx and is sandboxed as all the other services and only reachable via Unix domain socket. The last essential service is the database update service, which is there to make sure that whenever there is a code update, the database is also migrated accordingly (after doing a backup of the database, as a fallback if things go south), because upstream is running migrations manually and you also have to follow development to figure out which migrations are needed. All of these services (except the latter, which is one-shot) are communicating solely via Unix domain sockets and use their own networking namespace so that the attack vector is pretty much only nginx, even for non-privileged local users. One point to note here is that the main service and the client are built from a common source package, which is configured via the NixOS options, so for example This is of course only a very rough overview and there is a lot more tooling involved, especially when it comes to testing, where we have dedicated E2E tests, migration tests and a few VM-based tests but also running the upstream tests. Apart from that, we also have miscellaneous tooling for maintenence, eg. database access and backup/restore utilities along with their services. |
Thoughts on throwing this or at least link of this issue to a .md (contributing, readme, wherever a contributor might see it)? |
I appreciate the idea and good luck with that !
But with a docker image, it will be so much better. ;)
You probably have your reasons to stick with nix, but it makes this project quite difficult to get into.
The text was updated successfully, but these errors were encountered: