-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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/archtika: init at 1.0.1 #365218
base: master
Are you sure you want to change the base?
nixos/archtika: init at 1.0.1 #365218
Conversation
Some improvements can be made, such as avoiding the I will look into this. |
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.
It's always great to see someone's first contribution is a massive NixOS module. Great work on this!
The following commits should be squashed:
archtika: fix allow-import-from-derivation error for npm
➜archtika: init at 1.0.1
nixos/manual: add archtika module to 25.05 release notes
➜nixos/archtika: init module
archtika: fix formatting, add module description, remove trailing whitespace
andarchtika: refactor package and module definitions
➜ Both the package and module commit, as appropriate.
c30931a
to
855e916
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-already-reviewed/2617/2167 |
855e916
to
02fdf87
Compare
I have also tested all the functionality again using the given steps and using a local setup in the repository, see https://github.com/archtika/archtika/blob/main/nix/module.nix |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-already-reviewed/2617/2188 |
I think what @SigmaSquadron was suggesting is that you pull all the pieces into individual derivations as /pkgs/by-name/ar/archtika/{package,service,api,webapp}.nix then import them into package.nix with As you approach the finish line, there's some git cleanup to do:
git checkout archtika-pkg
# Back out the merge
git reset --hard HEAD~1
# Rebase onto master, nixpkgs-style
git checkout master
git fetch upstream master
git checkout archtika-pkg
git rebase master
# Fix any merge conflicts before pushing
git push --force-with-lease
|
Thanks, yes, I can remove the last merge commit by force pushing, I just did that on GitHub to fix a merge conflict. As for the individual derivations suggested earlier, there could be two other files, I just wanted to mention this PR on Matrix again, as nothing has happened here for two weeks since I made the post in the already reviewed Discourse thread. And I think this should be ready to be merged. |
Reviews seem to be taking longer than usual lately. The automation we usually see doesn't seem to be working and that may be increasing reviewers' workload. Since you're on Discourse, try pinging Sandro with a PM. |
57730e0
to
fc6b4b4
Compare
description = "Group under which archtika runs."; | ||
}; | ||
|
||
databaseName = mkOption { |
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.
Since this must match the username connecting via the Unix socket this is not really configurable in most modules anymore and most likely requires an assertion
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.
I am not sure why the databaseName
should not be configurable, could you give an example here?
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.
see the description of https://search.nixos.org/options?channel=unstable&show=services.postgresql.ensureUsers.*.ensureDBOwnership&from=0&size=50&sort=relevance&type=packages&query=services.postgresql.ens and the other ensure options.
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.
So I looked again, and this should not be necessary for my module.
The default value for PostgreSQL's Unix socket auth-method
is peer
, which requires the system username to match the database username. In my module, however, the local auth-method
is set to trust
, which is not as secure, but should still be fine for local auth. See below for why this is necessary:
Since Unix sockets are now used, I was able to remove two of the lines.
This one is still needed though, because the default value of
peer
that PostgreSQL uses forauth-method
would prevent theauthenticator
user (which does not exist as a system user) from connecting, which PostgREST needs:The authenticator role is used to connect to the database and should be configured to have very limited access. It is a chameleon whose job is to "become" other users in order to serve authenticated HTTP requests.
authentication = pkgs.lib.mkOverride 11 '' #type database DBuser auth-method local all all trust '';
The database migration is run as the regular postgres
user, and the PostgREST API then uses the authenticator
role, which is required (see docs: https://docs.postgrest.org/en/v12/references/auth.html).
So most of this is in line with the PostgREST recommendations, which require this module setup.
What I think is a bit less ideal is that I enable this setting for all databases, I could adjust the rules so that this is only enforced for the database that archtika is using, something like this:
authentication = pkgs.lib.mkOverride 11 ''
#type database DBuser auth-method
local ${cfg.databaseName} all trust
'';
This way, any other modules someone may have enabled on their server will still default to their preferred settings, and this is only enforced for the archtika module because it is necessary. I would make this last change if you agree.
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.
I have now made the suggested change, which only affects what it should.
authentication = lib.mkOverride 11 ''
local postgres postgres trust
local ${cfg.databaseName} all trust
'';
archtika: fix allow-import-from-derivation error for npm archtika: fix package formatting archtika: refactor package archtika: update GitHub hash for version 1.0.1 archtika: add auto update script archtika: refactor package archtika: update version to 1.1.0 archtika: update GitHub hash to version 1.1.0 archtika: update version to 1.2.0
nixos/manual: add archtika module to 25.05 release notes nixos/archtika: fix module formatting, add description and remove trailing whitespace nixos/archtika: refactor module nixos/archtika: refactor module nixos/archtika: make SystemCallFilter addition for postgres systemd service nixos/archtika: refactor module nixos/archtika: grant only necessary authentication permissions to archtika db
This PR adds the archtika package and its NixOS module.
archtika is a modern Content Management System (CMS) designed for the creation and management of documentation and blog websites. It focuses on simplicity, performance and maintainability, while providing essential features for content creators, such as:
Homepage: https://archtika.com
Repository: https://github.com/archtika/archtika
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.