-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Wordpress improvements #96910
Wordpress improvements #96910
Conversation
I haven't gotten a chance to look at this, but wordpress can actually be served mostly read-only, from the nix store. One component that comes in handy for that is this |
1926eb8
to
8222f08
Compare
@ajs124 Would it be possible for you to review my PR? I would really appreciate it. |
Sure, I'll try and give some useful feedback. The reason why we're using SVN is that with the setup they have there you can republish versions and people do. So the zip you download today does not necessarily have the same hash as the one you download tomorrow. As for this PR:
That said, this still looks like an overall improvement 👍 |
8222f08
to
a7db5db
Compare
@ajs124 Thanks a lot for the review.
I added an option to allow a mutable wp-content directory but I don't know if this is wanted. I usually use this for trying out new themes and plugins. I also added a mention to wp4nix if that is fine with you. I also added a basic phpmyadmin implementation. Maybe I should put it into another pull request? Honestly I assume that almost nobody seriously uses this service unmodified because theme updating is currently impossible without loosing settings. P.S. It would be great if you could add a license to https://git.helsinki.tools/helsinki-systems/wp4nix. Also hosting on github may be beneficial so contributions are possible (If you want to deal with them). I would appreciate it if you could do a second round of reviewing. Also I don't know how the stateVersion thing should be handled as I don't want to break unstable users' systems but it seems like this is the current way to go. I hope they are watching the repository closely. (I would need to change the stateVersion changes to 20.09 if this actually manages to get merged in the current release cycle, right?) |
Goes to show how much I know about the apache nixos module.
AFAIR mutable content is often needed, because that's also where uploaded images and other files are stored.
Yeah, that should probably go in a separate PR.
I kind of doubt anybody uses this, as well. wp4nix is now licensed under the EUPL-1.2, but given that all code is either by me or @SlothOfAnarchy, we can also re-license it if anyone would prefer to have it under any other license.
If you want to regenerate the json files from scratch, you probably need to create empty (aka containing
I haven't used |
You really would think no one uses this module... but I was shocked to learn that a number of people used the I only wrote this module to get rid of the |
@aanderse The changes itself would be backwards compatible if the thing with the stateVersion is discussed. I'm sorry but I won't rewrite this module. Also the better way would be to get a webserver-agnostic interface but I know it's gonna take a while until that's going to happen. I would still like to get this merged though. The only issue left is what do do with the stateVersion because I don't want to break the system of unstable users. How should I handle that? |
fe3ef48
to
8a3ce02
Compare
8a3ce02
to
323e591
Compare
323e591
to
24aba6c
Compare
24aba6c
to
b8e7b92
Compare
I have rebased and dropped some commits that are not necessary in my opinion. I haven't tested again though yet. The thing that really is necessary is 319e9b2. But the current migration is not a good way to manage this as this could prevent people from upgrading if they don't want to make these changes. I would propose adding some option like |
b8e7b92
to
0a3cdaa
Compare
@GrahamcOfBorg test wordpress |
0a3cdaa
to
0e3ae1c
Compare
@GrahamcOfBorg test wordpress |
@onny Would love to get a review from you. I removed the controversial change for now. I will try this in a separate PR. Other reviews are also greatly appreciated. |
@@ -483,7 +483,7 @@ in | |||
'' | |||
( echo "CREATE USER IF NOT EXISTS '${user.name}'@'localhost' IDENTIFIED WITH ${if isMariaDB then "unix_socket" else "auth_socket"};" | |||
${concatStringsSep "\n" (mapAttrsToList (database: permission: '' | |||
echo "GRANT ${permission} ON ${database} TO '${user.name}'@'localhost';" | |||
echo 'GRANT ${permission} ON ${database} TO `${user.name}`@`localhost`;' |
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 checked (code-wise) that this shouldn't break anything but somebody else should probably also check that. Also I would run some other modules that use this before merging.
@@ -168,7 +191,7 @@ let | |||
|
|||
name = mkOption { | |||
type = types.str; | |||
default = "wordpress"; | |||
default = if lib.versionAtLeast config.system.stateVersion "21.11" then "wordpress-${name}" else "wordpress"; |
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.
Maybe I should change this to
default = if lib.versionAtLeast config.system.stateVersion "21.11" then "wordpress-${name}" else "wordpress"; | |
default = if lib.versionAtLeast config.system.stateVersion "21.11" then "wordpress-${replaceStrings [ "." ] [ "_" ] name}" else "wordpress"; |
Superseded by #135966. Thank your to everyone who participated. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation for this change
Improve the wordpress service:
(edit: updated)
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)