-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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/dokuwiki: add support for multi-site, additional plugins and templates #83769
Conversation
Pinging @1000101 maintainer. |
371e4af
to
1d34444
Compare
54d7ca8
to
efe4248
Compare
@dadada Let me know when you're happy with the changes and I'll test it. |
Thanks for taking an interest. What's your opinion on the way the |
I made two more minor changes. efc9258c97355b4ea6e313c7ab9447d894dbcf34 adds a dokuwiki user that owns all the state directories and files. 07504a1 changes the behaviour of If |
I'll need to do a quick reword of the commit messages that change nixos/dokuwiki |
07504a1
to
5f2f935
Compare
I'm happy, go ahead. :-) |
@GrahamcOfBorg test dokuwiki |
You mean users.auth.php (i.e. Generally, I was trying to have as much options as I can immutable, with obvious ones mutable (https://github.com/NixOS/nixpkgs/pull/77830/files#r368233914 (resolved conversation) ). |
Ok, I might have misunderstood how
I made some changes so that the mutable files for |
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.
Other than that, works really great, awesome job!!!
{ | ||
# Enable encryption by default, | ||
options.forceSSL.default = true; | ||
options.enableACME.default = true; |
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 know I have introduced this option, but on a second thought, it is quite unnecessary to force these settings upon user. Wouldn't it be reasonable to drop it - along with forceSSL?
But in that case, I guess: fastcgi_param HTTPS on;
would have to go, too.
I'm open to discussion on this one :).
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 guess it would be wise to go with the default that works in most cases. ACME does not always work depending on restrictive DNS CA records or missing internet connection.
The default seems to be to disable ACME and not to force SSL. But it should be enabled in the example.
Regarding ninx fastcgi, if_not_empty should do the trick.
If the directive is specified with if_not_empty (1.1.11) then such a parameter will be passed to the server only if its value is not empty:
fastcgi_param HTTPS $https if_not_empty;
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.
Sounds about right, let's do it that way.
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 would be an independent change, so you could open a new MR for 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.
Sure, could do that, but since you did such a great job in refactoring a few things here and there, I though it would be a nice addition to the PR. But you're right, we can definitely keep it separated, it's just nice to have and not subject of this PR.
Oh, I actually meant to say that I think your approach is correct (much better than mine, for that matter) as these files stay outside of /nix/store (in datadir) and they don't need to be created by hand. I'm sorry I didn't make myself clear!!! I think you're right the whole time, or am I missing something? :))) |
Thanks, but there might be two aspects here:
I think the best would be to not create them, if |
On the other hand: If the file can't be created or has the wrong permissions, the service will fail at startup, which makes this kind-of dependent on the system and not 100% reproducible. I think the wireguard module does a similar thing with |
Sure, but what about leaving default value of |
I thought about it, but that would mean creating |
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.
How does one access aclUse
inside of the function. The way I tried it does not seem to work. I don't get how the function is called / which arguments are passed to it.
Ok, let's leave it be, it's just a minor nitpicking anyway. |
085f55d
to
6ffb27b
Compare
Now |
6ffb27b
to
cfbc0c4
Compare
@GrahamcOfBorg test dokuwiki |
cfbc0c4
to
adea2d1
Compare
Enables multi-site configurations. This break compatibility with prior configurations that expect options for a single dokuwiki instance in `services.dokuwiki`.
Adds support for additional plugins and templates similarly to how wordpress.nix does it. Plugins and templates need to be packaged as in the example.
If usersFile is not set, a file is created along the stateDir that can hold the users and supports dynamically adding users using the web GUI.
Use types.str instead of types.path to exclude private information from the derivation. Add a warinig about the contents of acl beeing included in the nix store.
`aclFile` and `usersFile` will be set to a default value if `aclUse` is specified and aclFile is not overriden by `acl`.
adea2d1
to
2d86cca
Compare
Rebased changes onto master and squashed fixup commits. |
Oh, and you managed to find a way to access config values, great job! I'll test and review it again. |
@GrahamcOfBorg test dokuwiki |
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.
- reviewed the diff and commit messages
- made sure ofBorg build succeeded for all applicable platforms
- ran nix-review without any failures
- ran and tested the service
@mmahut could you please help us check and merge if everything's fine by you? |
With the merge of [1], the `.enable` check for `config.services.dokuwiki` has been removed. [1]: NixOS/nixpkgs#83769
Motivation for this change
This MR introduces multi-site dokuwiki configurations (e.g. multiple nginx servers) using the <name?> option syntax. It also enables the use of additional plugins and templates similarly to how wordpress.nix does it.
So far everything seems to work fine, but marking as WIP since I'd like to do some manual testing first. I can split this up into two MRs if requested.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)