-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
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. |
description = '' | ||
Path to mercurial repositories on disk. | ||
If changing the default, you must ensure that | ||
the hgsrht's user as read and write access to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the hgsrht's user has read and write access to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
retry=true | ||
while "$retry"; do | ||
retry=false; | ||
exec < <(exec nix -L build -f "$root" sourcehut.python.pkgs."$1" 2>&1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works on unstable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SuperSandro2000, could you elaborate please? What is failing? And does it have to be fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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=info
passed tocelery
instead of--loglevel INFO
).Fixes #126090
Things done
update.sh
to handle Go modules.metasrht-manager
intosystemPackages
.services
option to only serve as selecting what (local or remote) services are displayed, and use anenable
option for each local service ofsourcehut
.settings
.systemd
hardening of Sourcehut services.systemd
timers instead ofcron
.gitsrht-fcgiwrap.service
instead ofservices.fcgiwrap
.metasrht.service
has access to thestripe-secret-key
now.docker
when needed.mkEnableOption
.config.ini
.sshd
.nginx
,postfix
,postgresql
, andredis
is made optional.celery
calls by specifying--loglevel INFO
instead of--loglevel=info
.celery
to use theeventlet
concurrent networking library.celery
services 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
.sandbox
innix.conf
on 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
, andredis
services, 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:add
user webhooks will ultimately be phased out ofsourcehut
and authorized SSH public keys no longer cached into a Redis database.