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
nextcloud module: init #44994
nextcloud module: init #44994
Conversation
Success on aarch64-linux (full log) Attempted: nextcloud Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: nextcloud Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: nextcloud Partial log (click to expand)
|
I originally checked @fpletz's commit in July using our fork as base (mayflower@c6bc13c#commitcomment-29652614). I'll recheck with the NixOS fork and give feedback about this %) |
the test seems to fail as it's missing the following commit: mayflower@dc1158a The commit doesn't apply automatically onto NixOS master due to minor changes in the Nginx module. I rebased it in my fork and filed a PR here: mayflower#68 |
Locations need an order because nginx will try to match them in the order they appear in the config file. This reuses the sortProperties function that is also used by the module system for `mkOrder` uses.
@GrahamcOfBorg test nextcloud |
Success on x86_64-linux (full log) Attempted: tests.nextcloud Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: tests.nextcloud Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: nextcloud Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: nextcloud Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: nextcloud Partial log (click to expand)
|
There's also #44839, which seems to have similar functionality. Could you have a look? |
Closes NixOS#44839 Co-authored-by: Janne Heß <janne@hess.ooo>
Success on x86_64-darwin (full log) Attempted: nextcloud Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: nextcloud Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: nextcloud Partial log (click to expand)
|
Good to go, I'll close my PR once this is merged |
@globin I gave this a try, configured nginx to only serve nextcloud on Was able to get some nextcloud web interface, it however complains about "access through untrusted domain". According to nextclouds forum, trusted domains are something that can be set from configuration. Would it make sense to expose that as an option too, defaulting to
if unset? |
Looks like nextcloud writes its own list of trusted domains on first request to that configuration file. Does nextcloud necessary needs to be able to write that configuration on it's own, or is that something we could explicitly configure with Nix, too? Would look a bit cleaner to me if possible… |
We already write the autoconfig.php and override.config.php for that, and as you have noticed nextcloud modifies the config.php at various stages including initial config. IMHO how it is implemented now is the best we can get from combining static configuration from the nixos for overrides and initial config and the dynamic configuration approach nextcloud includes. |
If there aren't any further comments I'm going to merge this tomorrow if nobody else beats me to it. |
dbtableprefix = mkOption { | ||
type = types.str; | ||
default = ""; | ||
description = "Table Prefix in Nextlcoud Database"; |
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.
typo
@globin did you get it to work with mysql or postgresql database? I do get Also didn't test caching, webfinger and file uploads. |
I'm using it with similar config to this on two machines (redacted):
|
That's my config:
For some reason, The |
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 just started to set this up on my private server and I found some minor nitpicks worth considering. I wanted to discuss about this first, but if you agree with my comments I'd volunteer to implement it myself.
Furthermore I think that some documentation might be helpful (@globin's comment about how to setup nextcloud with postgres might have saved me some time). I'd volunteer for this as well, but I'd do this in a separate PR as I'd love to see this merged soon and for writing docs for the NixOS manual takes some time IMHO.
autoconfig = { | ||
dbtype = mkOption { | ||
type = types.str; | ||
default = "sqlite"; |
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 about using an enum here? This is especiall helpful when viewing the options in man configuration.nix
.
default = "nextcloud"; | ||
description = "Database User"; | ||
}; | ||
dbpass = 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.
How about adding another option passwordFile
(to avoid storing dbpass
in the nix store) and read the contents in the autoconfig.php
using file_get_contents
?
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.
Same for admin password.
phpPackage = pkgs.php71; | ||
pools.nextcloud = let | ||
phpAdminValues = concatStringsSep "\n" (flip mapAttrsToList phpOptions | ||
(k: v: "php_admin_value[${k}] = ${v}")); |
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.
Something weird is going on here:
[root@cloud:~]# cat /nix/store/jkqz260cfm0335fvpyflpvdhj1hgkqjp-nextcloud-occ/bin/nextcloud-occ
#! /nix/store/czx8vkrb9jdgjyz8qfksh10vrnqa723l-bash-4.4-p23/bin/bash
cd /nix/store/wni0plnr91xlcrz2lfwr4dzlxlmb058r-nextcloud-13.0.5
exec /nix/store/bgwy6ysr8wffmy74xn9pj978gxas4n7j-sudo-1.8.23/bin/sudo -u nextcloud \
NEXTCLOUD_CONFIG_DIR="/data/var/lib/nextcloud/config" \
/nix/store/bmwiwi69556177ndfdg0nc6pg0j84ky1-php-7.1.21/bin/php \
-c /nix/store/vlpanb3f5iigwkigr3ywg6zzryywkwng-php.ini\
occ $*
[root@cloud:~]# cat /nix/store/vlpanb3f5iigwkigr3ywg6zzryywkwng-php.ini
extension=/nix/store/vfkv108a0zya61b4gxxyym4jj9fr9pyk-php-apcu-5.1.11/lib/php/extensions/apcu.so
zend_extension = opcache.so
opcache.enable = 1
k = v
k = v
k = v
k = v
k = v
k = v
k = v
k = v
k = v
k = v
k = v
k = v
k = v
k = v
k = v
k = v
k = v
It could be related to this line?
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.
Actually, it's due the literal k = v
here: https://github.com/NixOS/nixpkgs/pull/44994/files#diff-fc6e7fa5e8f92a630f0738fa2fc4e9faR20 😅
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.
Whoops, nice find!
@globin Thanks for your efforts, I've been trying this on my server and it's good except for this one thing: https://github.com/NixOS/nixpkgs/pull/44994/files#r214568515 |
I'd really like to see this in 18.09. @globin do you have time to address the mentioned things in the coming days? Otherwise, I could also follow-up from here… |
@flokli sorry for not having time, would be great if you could finish it up! Ideally also just cherry-pick in the update to nextcloud 14! |
post_max_size = cfg.maxUploadSize; | ||
memory_limit = cfg.maxUploadSize; | ||
} // cfg.phpOptions; | ||
phpOptionsStr = phpOptionsExtensions + (concatStringsSep "\n" (mapAttrsToList (k: v: "k = v") phpOptions)); |
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.
- "k = v"
+ "${k} = ${v}"
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.
toKeyValue in lib/generators.nix might help.
Motivation for this change
Nextcloud module
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)