nextcloud: update skeleton, add german version #297

Merged
teutat3s merged 9 commits from nextcloud-skeleton into main 2025-02-28 12:47:00 +00:00
8 changed files with 345 additions and 129 deletions
Showing only changes of commit df4444b015 - Show all commits

30
flake.lock generated
View file

@ -94,11 +94,11 @@
]
},
"locked": {
"lastModified": 1738765162,
"narHash": "sha256-3Z40qHaFScWUCVQrGc4Y+RdoPsh1R/wIh+AN4cTXP0I=",
"lastModified": 1739841949,
"narHash": "sha256-lSOXdgW/1zi/SSu7xp71v+55D5Egz8ACv0STkj7fhbs=",
"owner": "nix-community",
"repo": "disko",
"rev": "ff3568858c54bd306e9e1f2886f0f781df307dff",
"rev": "15dbf8cebd8e2655a883b74547108e089f051bf0",
"type": "github"
},
"original": {
@ -257,11 +257,11 @@
]
},
"locked": {
"lastModified": 1736373539,
"narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
"lastModified": 1739757849,
"narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
"rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe",
"type": "github"
},
"original": {
@ -320,11 +320,11 @@
]
},
"locked": {
"lastModified": 1739034224,
"narHash": "sha256-Mj/8jDzh1KNmUhWqEeVlW3hO9MZkxqioJGnmR7rivaE=",
"lastModified": 1739933872,
"narHash": "sha256-UhuvTR4OrWR+WBaRCZm4YMkvjJhZ1KZo/jRjE41m+Ek=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "0b6f96a6b9efcfa8d3cc8023008bcbcd1b9bc1a4",
"rev": "6ab392f626a19f1122d1955c401286e1b7cf6b53",
"type": "github"
},
"original": {
@ -336,11 +336,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1739055578,
"narHash": "sha256-2MhC2Bgd06uI1A0vkdNUyDYsMD0SLNGKtD8600mZ69A=",
"lastModified": 1739923778,
"narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a45fa362d887f4d4a7157d95c28ca9ce2899b70e",
"rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1",
"type": "github"
},
"original": {
@ -468,11 +468,11 @@
},
"unstable": {
"locked": {
"lastModified": 1739020877,
"narHash": "sha256-mIvECo/NNdJJ/bXjNqIh8yeoSjVLAuDuTUzAo7dzs8Y=",
"lastModified": 1739866667,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a79cfe0ebd24952b580b1cf08cd906354996d547",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
"type": "github"
},
"original": {

View file

@ -7,6 +7,7 @@
./networking.nix
./wireguard.nix
./forgejo-actions-runner.nix
#./backups.nix
];
}

View file

@ -0,0 +1,62 @@
{
config,
pkgs,
lib,
flake,
...
}:
let
hostname = config.networking.hostName;
in
{
age.secrets."forgejo-actions-runner-token.age" = {
file = "${flake.self}/secrets/trinkgenossin-forgejo-actions-runner-token.age";
owner = "gitea-runner";
mode = "440";
};
# Label configuration on gitea-actions-runner instance requires either docker or podman
virtualisation.docker.enable = true;
# Trust docker bridge interface traffic
# Needed for the docker runner to communicate with the act_runner cache
networking.firewall.trustedInterfaces = [ "br-+" ];
users.users.gitea-runner = {
home = "/var/lib/gitea-runner/${hostname}";
useDefaultShell = true;
group = "gitea-runner";
# Required to interact with nix daemon
extraGroups = [ "wheel" ];
isSystemUser = true;
};
users.groups.gitea-runner = { };
systemd.tmpfiles.rules = [ "d '/var/lib/gitea-runner' 0750 gitea-runner gitea-runner - -" ];
systemd.services."gitea-runner-${hostname}" = {
serviceConfig.DynamicUser = lib.mkForce false;
};
# forgejo actions runner
# https://forgejo.org/docs/latest/admin/actions/
# https://docs.gitea.com/usage/actions/quickstart
services.gitea-actions-runner = {
package = pkgs.forgejo-runner;
instances."${hostname}" = {
enable = true;
name = hostname;
url = "https://git.pub.solar";
tokenFile = config.age.secrets."forgejo-actions-runner-token.age".path;
labels = [
# provide a debian 12 bookworm base with Node.js for actions
"debian-latest:docker://git.pub.solar/pub-solar/actions-base-image:20-bookworm"
# fake the ubuntu name, commonly used in actions examples
"ubuntu-latest:docker://git.pub.solar/pub-solar/actions-base-image:20-bookworm"
# alpine with Node.js
"alpine-latest:docker://node:20-alpine"
];
};
};
}

View file

@ -139,6 +139,10 @@ let
// https://www.mediawiki.org/wiki/Extension:PluggableAuth#Configuration
$wgPluggableAuth_EnableAutoLogin = false;
$wgPluggableAuth_ButtonLabel = 'Login with pub.solar ID';
// Avoid getting logged out after 30 minutes
// https://www.mediawiki.org/wiki/Topic:W4be4h6t63vf3y8p
// https://www.mediawiki.org/wiki/Manual:$wgRememberMe
$wgRememberMe = 'always';
// https://www.mediawiki.org/wiki/Extension:OpenID_Connect#Keycloak
$wgPluggableAuth_Config[] = [
@ -211,7 +215,7 @@ in
backend = "docker";
containers."mediawiki" = {
image = "git.pub.solar/pub-solar/mediawiki-oidc-docker:1.42.4";
image = "git.pub.solar/pub-solar/mediawiki-oidc-docker:1.43.0";
user = "1000:${builtins.toString gid}";
autoStart = true;

View file

@ -2,6 +2,7 @@
config,
pkgs,
flake,
lib,
...
}:
{
@ -22,123 +23,227 @@
forceSSL = true;
};
services.nextcloud = {
hostName = "cloud.${config.pub-solar-os.networking.domain}";
home = "/var/lib/nextcloud";
services.nextcloud =
let
exiftool_1270 = pkgs.perlPackages.buildPerlPackage rec {
# NOTE nextcloud-memories needs this specific version of exiftool
# https://github.com/NixOS/nixpkgs/issues/345267
pname = "Image-ExifTool";
version = "12.70";
src = pkgs.fetchFromGitHub {
owner = "exiftool";
repo = "exiftool";
rev = version;
hash = "sha256-YMWYPI2SDi3s4KCpSNwovemS5MDj5W9ai0sOkvMa8Zg=";
};
nativeBuildInputs = lib.optional pkgs.stdenv.hostPlatform.isDarwin pkgs.shortenPerlShebang;
postInstall = lib.optionalString pkgs.stdenv.hostPlatform.isDarwin ''
shortenPerlShebang $out/bin/exiftool
'';
};
in
{
hostName = "cloud.${config.pub-solar-os.networking.domain}";
home = "/var/lib/nextcloud";
enable = true;
# When updating package, remember to update nextcloud30Packages in
# services.nextcloud.extraApps
package = pkgs.nextcloud30;
https = true;
secretFile = config.age.secrets."nextcloud-secrets".path; # secret
maxUploadSize = "1G";
configureRedis = true;
notify_push = {
enable = true;
bendDomainToLocalhost = true;
# When updating package, remember to update nextcloud30Packages in
# services.nextcloud.extraApps
package = pkgs.nextcloud30;
https = true;
secretFile = config.age.secrets."nextcloud-secrets".path; # secret
maxUploadSize = "1G";
configureRedis = true;
notify_push = {
enable = true;
bendDomainToLocalhost = true;
};
config = {
adminuser = "admin";
adminpassFile = config.age.secrets."nextcloud-admin-pass".path;
dbuser = "nextcloud";
dbtype = "pgsql";
dbname = "nextcloud";
};
settings = {
overwrite.cli.url = "https://cloud.${config.pub-solar-os.networking.domain}";
overwriteprotocol = "https";
installed = true;
default_phone_region = "+49";
mail_sendmailmode = "smtp";
mail_from_address = "nextcloud";
mail_smtpmode = "smtp";
mail_smtpauthtype = "PLAIN";
mail_domain = "pub.solar";
mail_smtpname = "admins@pub.solar";
mail_smtpsecure = "ssl";
mail_smtpauth = true;
mail_smtphost = "mail.pub.solar";
mail_smtpport = "465";
# This is to allow connections to collabora and keycloak, among other services
# running on the same host
#
# https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=allow_local_remote_servers%20true
# https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/293
allow_local_remote_servers = true;
enable_previews = true;
jpeg_quality = 60;
enabledPreviewProviders = [
"OC\\Preview\\PNG"
"OC\\Preview\\JPEG"
"OC\\Preview\\GIF"
"OC\\Preview\\BMP"
"OC\\Preview\\HEIC"
"OC\\Preview\\TIFF"
"OC\\Preview\\XBitmap"
"OC\\Preview\\SVG"
"OC\\Preview\\WebP"
"OC\\Preview\\Font"
"OC\\Preview\\Movie"
"OC\\Preview\\ImaginaryPDF"
"OC\\Preview\\MP3"
"OC\\Preview\\OpenDocument"
"OC\\Preview\\Krita"
"OC\\Preview\\TXT"
"OC\\Preview\\MarkDown"
"OC\\Preview\\Imaginary"
];
preview_imaginary_url = "http://127.0.0.1:${toString config.services.imaginary.port}/";
preview_max_filesize_image = 128; # MB
preview_max_memory = 512; # MB
preview_max_x = 2048; # px
preview_max_y = 2048; # px
preview_max_scale_factor = 1;
"preview_ffmpeg_path" = lib.getExe pkgs.ffmpeg-headless;
"memories.exiftool_no_local" = false;
"memories.exiftool" = "${exiftool_1270}/bin/exiftool";
"memories.vod.ffmpeg" = lib.getExe pkgs.ffmpeg;
"memories.vod.ffprobe" = lib.getExe' pkgs.ffmpeg-headless "ffprobe";
auth.bruteforce.protection.enabled = true;
trashbin_retention_obligation = "auto,7";
skeletondirectory = "${pkgs.nextcloud-skeleton}/{lang}";
defaultapp = "file";
activity_expire_days = "14";
integrity.check.disabled = false;
updater.release.channel = "stable";
loglevel = 2;
debug = false;
maintenance_window_start = "1";
# maintenance = false;
app_install_overwrite = [
"pdfdraw"
"integration_whiteboard"
];
htaccess.RewriteBase = "/";
theme = "";
simpleSignUpLink.shown = false;
};
phpOptions = {
"opcache.interned_strings_buffer" = "32";
"opcache.max_accelerated_files" = "16229";
"opcache.memory_consumption" = "256";
# https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
"opcache.revalidate_freq" = "60";
# https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#:~:text=opcache.jit%20%3D%201255%20opcache.jit_buffer_size%20%3D%20128m
"opcache.jit" = "1255";
"opcache.jit_buffer_size" = "128M";
};
# Calculated with 4GiB RAM, 80MiB process size available on
# https://spot13.com/pmcalculator/
poolSettings = {
pm = "dynamic";
"pm.max_children" = "52";
"pm.max_requests" = "500";
"pm.max_spare_servers" = "39";
"pm.min_spare_servers" = "13";
"pm.start_servers" = "13";
};
caching.redis = true;
appstoreEnable = true;
autoUpdateApps.enable = true;
extraApps = {
inherit (pkgs.nextcloud30Packages.apps) memories previewgenerator recognize;
};
database.createLocally = true;
};
config = {
adminuser = "admin";
adminpassFile = config.age.secrets."nextcloud-admin-pass".path;
dbuser = "nextcloud";
dbtype = "pgsql";
dbname = "nextcloud";
# https://docs.nextcloud.com/server/30/admin_manual/installation/server_tuning.html#previews
services.imaginary = {
enable = true;
address = "127.0.0.1";
settings.return-size = true;
};
systemd = {
services =
let
occ = "/run/current-system/sw/bin/nextcloud-occ";
in
{
nextcloud-cron-preview-generator = {
environment.NEXTCLOUD_CONFIG_DIR = "${config.services.nextcloud.home}/config";
serviceConfig = {
ExecStart = "${occ} preview:pre-generate";
Type = "oneshot";
User = "nextcloud";
};
};
nextcloud-preview-generator-setup = {
wantedBy = [ "multi-user.target" ];
requires = [ "phpfpm-nextcloud.service" ];
after = [ "phpfpm-nextcloud.service" ];
environment.NEXTCLOUD_CONFIG_DIR = "${config.services.nextcloud.home}/config";
script = # bash
''
# check with:
# for size in squareSizes widthSizes heightSizes; do echo -n "$size: "; nextcloud-occ config:app:get previewgenerator $size; done
# extra commands run for preview generator:
# 32 icon file list
# 64 icon file list android app, photos app
# 96 nextcloud client VFS windows file preview
# 256 file app grid view, many requests
# 512 photos app tags
${occ} config:app:set --value="32 64 96 256 512" previewgenerator squareSizes
# 341 hover in maps app
# 1920 files/photos app when viewing picture
${occ} config:app:set --value="341 1920" previewgenerator widthSizes
# 256 hover in maps app
# 1080 files/photos app when viewing picture
${occ} config:app:set --value="256 1080" previewgenerator heightSizes
'';
serviceConfig = {
Type = "oneshot";
User = "nextcloud";
};
};
};
timers.nextcloud-cron-preview-generator = {
after = [ "nextcloud-setup.service" ];
timerConfig = {
OnCalendar = "*:0/10";
OnUnitActiveSec = "9m";
Persistent = true;
RandomizedDelaySec = 60;
Unit = "nextcloud-cron-preview-generator.service";
};
wantedBy = [ "timers.target" ];
};
settings = {
overwrite.cli.url = "http://cloud.${config.pub-solar-os.networking.domain}";
overwriteprotocol = "https";
installed = true;
default_phone_region = "+49";
mail_sendmailmode = "smtp";
mail_from_address = "nextcloud";
mail_smtpmode = "smtp";
mail_smtpauthtype = "PLAIN";
mail_domain = "pub.solar";
mail_smtpname = "admins@pub.solar";
mail_smtpsecure = "ssl";
mail_smtpauth = true;
mail_smtphost = "mail.pub.solar";
mail_smtpport = "465";
# This is to allow connections to collabora and keycloak, among other services
# running on the same host
#
# https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=allow_local_remote_servers%20true
# https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/293
allow_local_remote_servers = true;
enable_previews = true;
enabledPreviewProviders = [
"OC\\Preview\\PNG"
"OC\\Preview\\JPEG"
"OC\\Preview\\GIF"
"OC\\Preview\\BMP"
"OC\\Preview\\XBitmap"
"OC\\Preview\\Movie"
"OC\\Preview\\PDF"
"OC\\Preview\\MP3"
"OC\\Preview\\TXT"
"OC\\Preview\\MarkDown"
];
preview_max_x = "1024";
preview_max_y = "768";
preview_max_scale_factor = "1";
auth.bruteforce.protection.enabled = true;
trashbin_retention_obligation = "auto,7";
skeletondirectory = "${pkgs.nextcloud-skeleton}/{lang}";
defaultapp = "file";
activity_expire_days = "14";
integrity.check.disabled = false;
updater.release.channel = "stable";
loglevel = 2;
debug = false;
maintenance_window_start = "1";
# maintenance = false;
app_install_overwrite = [
"pdfdraw"
"integration_whiteboard"
];
htaccess.RewriteBase = "/";
theme = "";
simpleSignUpLink.shown = false;
};
phpOptions = {
"opcache.interned_strings_buffer" = "32";
"opcache.max_accelerated_files" = "16229";
"opcache.memory_consumption" = "256";
# https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
"opcache.revalidate_freq" = "60";
# https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#:~:text=opcache.jit%20%3D%201255%20opcache.jit_buffer_size%20%3D%20128m
"opcache.jit" = "1255";
"opcache.jit_buffer_size" = "128M";
};
# Calculated with 4GiB RAM, 80MiB process size available on
# https://spot13.com/pmcalculator/
poolSettings = {
pm = "dynamic";
"pm.max_children" = "52";
"pm.max_requests" = "500";
"pm.max_spare_servers" = "39";
"pm.min_spare_servers" = "13";
"pm.start_servers" = "13";
};
caching.redis = true;
appstoreEnable = true;
autoUpdateApps.enable = true;
extraApps = {
inherit (pkgs.nextcloud30Packages.apps) recognize;
};
database.createLocally = true;
};
services.restic.backups.nextcloud-storagebox = {

View file

@ -60,6 +60,7 @@ in
"keycloak-database-password.age".publicKeys = nachtigallKeys ++ adminKeys;
"tankstelle-forgejo-actions-runner-token.age".publicKeys = tankstelleKeys ++ adminKeys;
"trinkgenossin-forgejo-actions-runner-token.age".publicKeys = trinkgenossinKeys ++ adminKeys;
"forgejo-database-password.age".publicKeys = nachtigallKeys ++ adminKeys;
"forgejo-mailer-password.age".publicKeys = nachtigallKeys ++ adminKeys;
"forgejo-ssh-private-key.age".publicKeys = nachtigallKeys ++ adminKeys;

View file

@ -0,0 +1,43 @@
age-encryption.org/v1
-> ssh-ed25519 NID4eA +iD73cCN5j4zSi+6Pv8KblglzrIleayuzc+zXV1Dfn0
Jf7IwEqt/Zs7Vcnmr51Zpn0YKuPAASJ8iGSKV+Y5mnQ
-> ssh-ed25519 uYcDNw vVNfTtCO3LQJ4xCxsYFEAfM3eP3bqfawxm4JkW5xjU0
BGrReIXoR0R0Xs5weOvz4Kuf5OxoSjCJSlg5xDhqS54
-> ssh-rsa f5THog
UyeGX4ZC4T1j6a+cNUFN5Ly4LsDEybd4KAd+eZs/s4fQiFH3b1xZ1uAVwxUtCMem
ugpie2W1f/VrsviCSgdY+WZAEP6zmErak3NQ85VYQauKt4HibboTADGo0PBZxtmn
Nctq++tdJrg0LUf9SIGkwmOKJ3iRw77tlE2l+pLq6IVsGGuMVDZBXl+jLrelOEQP
1kXFI1VMJ44M8hQuKvplcDEy8clcHedWiK2eD9M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U8J4A9MQPmaX99UFV6FWMv3+H3QDjTWqFW/37bXmFl03l5h1n5xZ0Kc786KDv0
8tvy0csqW1MIvnzoyujghienP4OTfWwMPnCIqeAG0UA
-> piv-p256 vRzPNw A3wssMH6Nlh9cBTsipou44CwzCE++4TarqGjObd2/8Xd
+WsJqumP6xpJfjg7yEc6NRRz+D2ksTJpgVZXqXalM18
-> piv-p256 zqq/iw A3JV+cHOFLTBsfBDHM5K7k/lsUZsIvpkvx1rpUAjWPuU
CowRYCoRJ9x1PswAw7aLUbQpvDiggBJT84/likBAHPc
-> ssh-ed25519 YFSOsg +CaWUAu6+hp1xpVwKZZO9328d9E+bVIejGL5w8MuLF4
YvwVnv/8exOf6IpjUlQAVHUBgLET8uEYEO/nH9+P6Qc
-> ssh-ed25519 iHV63A didGnygsV/Dh+Ni6u+bCv83dTJakWe4lzZERHcpQ7Rg
Y07PZjU9i7VKrzW3+K0zJif6YBsp3T+JMDbeXxGWq40
-> ssh-ed25519 BVsyTA KENv1RVR11qe+MnytyJQHIcsUVBsXRwFDw344vGD53Q
mRqWR5QzBhgbzoofIygPhKkbSjzpKwbc4IFJhCjurrE
-> ssh-ed25519 +3V2lQ cocFFuJ/bErUGrE6jBvwzjCi7hyrUaZd6SMA0zuuqWU
068MLruYKztolTd4F7nmsUj+BDGGclxEe3xsgrt/964
--- IOwBL6PiBIiyFKMnwBrTBNqYPJONjpSHpuZX/QUjz1M
‰P)£i*ÿ? Zèœ4o»÷ZÅw‰*áåS„[gO:"EëÙ<C399>)#üUj™Ù À¨yÌ -B:2í½u`ì'7-l<y6péi¶¤<C2B6>1

View file

@ -56,7 +56,7 @@
nachtigall.succeed("ping test.pub.solar -c 2")
nachtigall.succeed("ping ca.test.pub.solar -c 2")
nachtigall.wait_for_unit("nginx.service")
nachtigall.wait_for_open_port(443)
nachtigall.wait_for_open_port(443, "test.pub.solar")
nachtigall.wait_until_succeeds("curl https://test.pub.solar/")
'';
}