nixos/sourcehut: updates, fixes, hardening#133984
Conversation
040fb51 to
749d922
Compare
|
This is amazing... it will take me a bit of time to review and test. |
There was a problem hiding this comment.
the hgsrht's user has read and write access to it.
There was a problem hiding this comment.
AFAICS the chowning done by systemd on StateDirectory= happens before BindPaths=are applied, hence if repos is changed from the default to some path outside StateDirectory= its ownership will be preserved.
There was a problem hiding this comment.
This only works on unstable.
There was a problem hiding this comment.
@SuperSandro2000, could you elaborate please? What is failing? And does it have to be fixed?
There was a problem hiding this comment.
nix build is a experimental feature behind the nix-command flag and does not work by default IIRC.
|
Should the restrictions allow the pre-start services to write to |
|
This might have been a problem with my own setup, but I had to wipe the entire previous installation, DB+state. Note: clear cookies after changing secrets. When pushing to git. Should check if the warnings/permissions for logs need to be fixed. Edit: I just read the sshsrht comment: https://github.com/NixOS/nixpkgs/pull/133984/files#diff-4a251309b594fdd697eb23c8e2d64191de7e00668e928df0247cdab24cb71dfeR693-R705 |
|
Result of 1 package failed to build:12 packages built successfully:
11 suggestions:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. Result of 1 package failed to build:12 packages built successfully:
11 suggestions:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. |
@tomberek, AFAICS |
|
I had to rebase with |
|
Pushed some more work on the |
|
Pushed some more work to fix and harden the integration of |
This reverts commit 1eba3869b4c4ee1f19ddc6fbb7f068756cf2e895. Those patches have been merged upstream.
This PR is still baking a bit, but is ready for testing and reviewing.
Motivation for this change
Be able to install and use latest https://sr.ht/~sircmpwn/sourcehut/ .
Beware, this is a huge change, and it may or may not cause troubles for people using the previous NixOS module. Which was no longer functional when I started this PR (due to a wrong
--loglevel=infopassed toceleryinstead of--loglevel INFO).Fixes #126090
Things done
update.shto handle Go modules.metasrht-managerintosystemPackages.servicesoption to only serve as selecting what (local or remote) services are displayed, and use anenableoption for each local service ofsourcehut.settings.systemdhardening of Sourcehut services.systemdtimers instead ofcron.gitsrht-fcgiwrap.serviceinstead ofservices.fcgiwrap.metasrht.servicehas access to thestripe-secret-keynow.dockerwhen needed.mkEnableOption.config.ini.sshd.nginx,postfix,postgresql, andredisis made optional.celerycalls by specifying--loglevel INFOinstead of--loglevel=info.celeryto use theeventletconcurrent networking library.celeryservices to share a single Redis database.buildssrht. I don't use it, but the service and the worker both run.dispatchsrht. I don't use it.gitsrht.hgsrht. I don't use it.hubsrht.listssrht.metasrht.mansrht.pagessrht. The service is running, but I don't know how I should put content in it.pastesrht.todosrht.meta.doc. But there may be more to do.maintainers.sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)Example of config:
Note that other settings are needed for enabling and properly configuring local
nginx,postfix,postgresql, andredisservices, but I don't have the energy to put a minimal example here right now.Beware that
origin=settings are recorded into the SQL databases and not updated if you later change them (eg. by switching from HTTP to HTTPS). See for instance:Note that AFAIK those
ssh-key:remove,ssh-key:adduser webhooks will ultimately be phased out ofsourcehutand authorized SSH public keys no longer cached into a Redis database.