aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/web-apps
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/web-apps')
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/codimd.nix1
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/frab.nix1
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/gotify-server.nix49
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/limesurvey.nix5
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/matomo-doc.xml8
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/matomo.nix56
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/mediawiki.nix5
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/moinmoin.nix303
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/moodle.nix6
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/nextcloud.nix5
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/nexus.nix1
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/trac.nix79
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/virtlyst.nix1
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/wordpress.nix5
14 files changed, 478 insertions, 47 deletions
diff --git a/nixpkgs/nixos/modules/services/web-apps/codimd.nix b/nixpkgs/nixos/modules/services/web-apps/codimd.nix
index 7ae7cd9c52d..5f56f8ed5a0 100644
--- a/nixpkgs/nixos/modules/services/web-apps/codimd.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/codimd.nix
@@ -893,6 +893,7 @@ in
extraGroups = cfg.groups;
home = cfg.workDir;
createHome = true;
+ isSystemUser = true;
};
systemd.services.codimd = {
diff --git a/nixpkgs/nixos/modules/services/web-apps/frab.nix b/nixpkgs/nixos/modules/services/web-apps/frab.nix
index 7914e5cc0ee..a9a30b40922 100644
--- a/nixpkgs/nixos/modules/services/web-apps/frab.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/frab.nix
@@ -177,6 +177,7 @@ in
{ name = cfg.user;
group = cfg.group;
home = "${cfg.statePath}";
+ isSystemUser = true;
}
];
diff --git a/nixpkgs/nixos/modules/services/web-apps/gotify-server.nix b/nixpkgs/nixos/modules/services/web-apps/gotify-server.nix
new file mode 100644
index 00000000000..03e01f46a94
--- /dev/null
+++ b/nixpkgs/nixos/modules/services/web-apps/gotify-server.nix
@@ -0,0 +1,49 @@
+{ pkgs, lib, config, ... }:
+
+with lib;
+
+let
+ cfg = config.services.gotify;
+in {
+ options = {
+ services.gotify = {
+ enable = mkEnableOption "Gotify webserver";
+
+ port = mkOption {
+ type = types.port;
+ description = ''
+ Port the server listens to.
+ '';
+ };
+
+ stateDirectoryName = mkOption {
+ type = types.str;
+ default = "gotify-server";
+ description = ''
+ The name of the directory below <filename>/var/lib</filename> where
+ gotify stores its runtime data.
+ '';
+ };
+ };
+ };
+
+ config = mkIf cfg.enable {
+ systemd.services.gotify-server = {
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network.target" ];
+ description = "Simple server for sending and receiving messages";
+
+ environment = {
+ GOTIFY_SERVER_PORT = toString cfg.port;
+ };
+
+ serviceConfig = {
+ WorkingDirectory = "/var/lib/${cfg.stateDirectoryName}";
+ StateDirectory = cfg.stateDirectoryName;
+ Restart = "always";
+ DynamicUser = "yes";
+ ExecStart = "${pkgs.gotify-server}/bin/server";
+ };
+ };
+ };
+}
diff --git a/nixpkgs/nixos/modules/services/web-apps/limesurvey.nix b/nixpkgs/nixos/modules/services/web-apps/limesurvey.nix
index 68b57a9b90d..bd524524130 100644
--- a/nixpkgs/nixos/modules/services/web-apps/limesurvey.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/limesurvey.nix
@@ -277,7 +277,10 @@ in
systemd.services.httpd.after = optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service";
- users.users.${user}.group = group;
+ users.users.${user} = {
+ group = group;
+ isSystemUser = true;
+ };
};
}
diff --git a/nixpkgs/nixos/modules/services/web-apps/matomo-doc.xml b/nixpkgs/nixos/modules/services/web-apps/matomo-doc.xml
index 8485492c51c..69d1170e452 100644
--- a/nixpkgs/nixos/modules/services/web-apps/matomo-doc.xml
+++ b/nixpkgs/nixos/modules/services/web-apps/matomo-doc.xml
@@ -86,12 +86,6 @@ GRANT ALL PRIVILEGES ON matomo.* TO 'matomo'@'localhost';
<itemizedlist>
<listitem>
<para>
- Matomo's file integrity check will warn you. This is due to the patches
- necessary for NixOS, you can safely ignore this.
- </para>
- </listitem>
- <listitem>
- <para>
Matomo will warn you that the JavaScript tracker is not writable. This is
because it's located in the read-only nix store. You can safely ignore
this, unless you need a plugin that needs JavaScript tracker access.
@@ -105,7 +99,7 @@ GRANT ALL PRIVILEGES ON matomo.* TO 'matomo'@'localhost';
<para>
You can use other web servers by forwarding calls for
<filename>index.php</filename> and <filename>piwik.php</filename> to the
- <literal>/run/phpfpm-matomo.sock</literal> fastcgi unix socket. You can use
+ <literal><link linkend="opt-services.phpfpm.pools._name_.socket">services.phpfpm.pools.&lt;name&gt;.socket</link></literal> fastcgi unix socket. You can use
the nginx configuration in the module code as a reference to what else
should be configured.
</para>
diff --git a/nixpkgs/nixos/modules/services/web-apps/matomo.nix b/nixpkgs/nixos/modules/services/web-apps/matomo.nix
index 1e34aff8d17..352cc4c647b 100644
--- a/nixpkgs/nixos/modules/services/web-apps/matomo.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/matomo.nix
@@ -2,15 +2,13 @@
with lib;
let
cfg = config.services.matomo;
+ fpm = config.services.phpfpm.pools.${pool};
user = "matomo";
dataDir = "/var/lib/${user}";
deprecatedDataDir = "/var/lib/piwik";
pool = user;
- # it's not possible to use /run/phpfpm/${pool}.sock because /run/phpfpm/ is root:root 0770,
- # and therefore is not accessible by the web server.
- phpSocket = "/run/phpfpm-${pool}.sock";
phpExecutionUnit = "phpfpm-${pool}";
databaseService = "mysql.service";
@@ -50,7 +48,7 @@ in {
default = null;
example = "lighttpd";
description = ''
- Name of the web server user that forwards requests to the ${phpSocket} fastcgi socket for Matomo if the nginx
+ Name of the web server user that forwards requests to <option>services.phpfpm.pools.&lt;name&gt;.socket</option> the fastcgi socket for Matomo if the nginx
option is not used. Either this option or the nginx option is mandatory.
If you want to use another webserver than nginx, you need to set this to that server's user
and pass fastcgi requests to `index.php`, `matomo.php` and `piwik.php` (legacy name) to this socket.
@@ -71,25 +69,6 @@ in {
'';
};
- phpfpmProcessManagerConfig = mkOption {
- type = types.str;
- default = ''
- ; default phpfpm process manager settings
- pm = dynamic
- pm.max_children = 75
- pm.start_servers = 10
- pm.min_spare_servers = 5
- pm.max_spare_servers = 20
- pm.max_requests = 500
-
- ; log worker's stdout, but this has a performance hit
- catch_workers_output = yes
- '';
- description = ''
- Settings for phpfpm's process manager. You might need to change this depending on the load for Matomo.
- '';
- };
-
nginx = mkOption {
type = types.nullOr (types.submodule (
recursiveUpdate
@@ -233,15 +212,24 @@ in {
else if (cfg.webServerUser != null) then cfg.webServerUser else "";
in {
${pool} = {
- listen = phpSocket;
- extraConfig = ''
- listen.owner = ${socketOwner}
- listen.group = root
- listen.mode = 0600
- user = ${user}
- env[PIWIK_USER_PATH] = ${dataDir}
- ${cfg.phpfpmProcessManagerConfig}
+ inherit user;
+ phpOptions = ''
+ error_log = 'stderr'
+ log_errors = on
'';
+ settings = mapAttrs (name: mkDefault) {
+ "listen.owner" = socketOwner;
+ "listen.group" = "root";
+ "listen.mode" = "0660";
+ "pm" = "dynamic";
+ "pm.max_children" = 75;
+ "pm.start_servers" = 10;
+ "pm.min_spare_servers" = 5;
+ "pm.max_spare_servers" = 20;
+ "pm.max_requests" = 500;
+ "catch_workers_output" = true;
+ };
+ phpEnv.PIWIK_USER_PATH = dataDir;
};
};
@@ -264,15 +252,15 @@ in {
};
# allow index.php for webinterface
locations."= /index.php".extraConfig = ''
- fastcgi_pass unix:${phpSocket};
+ fastcgi_pass unix:${fpm.socket};
'';
# allow matomo.php for tracking
locations."= /matomo.php".extraConfig = ''
- fastcgi_pass unix:${phpSocket};
+ fastcgi_pass unix:${fpm.socket};
'';
# allow piwik.php for tracking (deprecated name)
locations."= /piwik.php".extraConfig = ''
- fastcgi_pass unix:${phpSocket};
+ fastcgi_pass unix:${fpm.socket};
'';
# Any other attempt to access any php files is forbidden
locations."~* ^.+\\.php$".extraConfig = ''
diff --git a/nixpkgs/nixos/modules/services/web-apps/mediawiki.nix b/nixpkgs/nixos/modules/services/web-apps/mediawiki.nix
index ec2568bf952..43edc04e1a4 100644
--- a/nixpkgs/nixos/modules/services/web-apps/mediawiki.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/mediawiki.nix
@@ -461,7 +461,10 @@ in
systemd.services.httpd.after = optional (cfg.database.createLocally && cfg.database.type == "mysql") "mysql.service";
- users.users.${user}.group = group;
+ users.users.${user} = {
+ group = group;
+ isSystemUser = true;
+ };
environment.systemPackages = [ mediawikiScripts ];
};
diff --git a/nixpkgs/nixos/modules/services/web-apps/moinmoin.nix b/nixpkgs/nixos/modules/services/web-apps/moinmoin.nix
new file mode 100644
index 00000000000..0fee64be0bb
--- /dev/null
+++ b/nixpkgs/nixos/modules/services/web-apps/moinmoin.nix
@@ -0,0 +1,303 @@
+{ config, lib, pkgs, ... }:
+with lib;
+
+let
+ cfg = config.services.moinmoin;
+ python = pkgs.python27;
+ pkg = python.pkgs.moinmoin;
+ dataDir = "/var/lib/moin";
+ usingGunicorn = cfg.webServer == "nginx-gunicorn" || cfg.webServer == "gunicorn";
+ usingNginx = cfg.webServer == "nginx-gunicorn";
+ user = "moin";
+ group = "moin";
+
+ uLit = s: ''u"${s}"'';
+ indentLines = n: str: concatMapStrings (line: "${fixedWidthString n " " " "}${line}\n") (splitString "\n" str);
+
+ moinCliWrapper = wikiIdent: pkgs.writeShellScriptBin "moin-${wikiIdent}" ''
+ ${pkgs.su}/bin/su -s ${pkgs.runtimeShell} -c "${pkg}/bin/moin --config-dir=/var/lib/moin/${wikiIdent}/config $*" ${user}
+ '';
+
+ wikiConfig = wikiIdent: w: ''
+ # -*- coding: utf-8 -*-
+
+ from MoinMoin.config import multiconfig, url_prefix_static
+
+ class Config(multiconfig.DefaultConfig):
+ ${optionalString (w.webLocation != "/") ''
+ url_prefix_static = '${w.webLocation}' + url_prefix_static
+ ''}
+
+ sitename = u'${w.siteName}'
+ page_front_page = u'${w.frontPage}'
+
+ data_dir = '${dataDir}/${wikiIdent}/data'
+ data_underlay_dir = '${dataDir}/${wikiIdent}/underlay'
+
+ language_default = u'${w.languageDefault}'
+ ${optionalString (w.superUsers != []) ''
+ superuser = [${concatMapStringsSep ", " uLit w.superUsers}]
+ ''}
+
+ ${indentLines 4 w.extraConfig}
+ '';
+ wikiConfigFile = name: wiki: pkgs.writeText "${name}.py" (wikiConfig name wiki);
+
+in
+{
+ options.services.moinmoin = with types; {
+ enable = mkEnableOption "MoinMoin Wiki Engine";
+
+ webServer = mkOption {
+ type = enum [ "nginx-gunicorn" "gunicorn" "none" ];
+ default = "nginx-gunicorn";
+ example = "none";
+ description = ''
+ Which web server to use to serve the wiki.
+ Use <literal>none</literal> if you want to configure this yourself.
+ '';
+ };
+
+ gunicorn.workers = mkOption {
+ type = ints.positive;
+ default = 3;
+ example = 10;
+ description = ''
+ The number of worker processes for handling requests.
+ '';
+ };
+
+ wikis = mkOption {
+ type = attrsOf (submodule ({ name, ... }: {
+ options = {
+ siteName = mkOption {
+ type = str;
+ default = "Untitled Wiki";
+ example = "ExampleWiki";
+ description = ''
+ Short description of your wiki site, displayed below the logo on each page, and
+ used in RSS documents as the channel title.
+ '';
+ };
+
+ webHost = mkOption {
+ type = str;
+ description = "Host part of the wiki URL. If undefined, the name of the attribute set will be used.";
+ example = "wiki.example.org";
+ };
+
+ webLocation = mkOption {
+ type = str;
+ default = "/";
+ example = "/moin";
+ description = "Location part of the wiki URL.";
+ };
+
+ frontPage = mkOption {
+ type = str;
+ default = "LanguageSetup";
+ example = "FrontPage";
+ description = ''
+ Front page name. Set this to something like <literal>FrontPage</literal> once languages are
+ configured.
+ '';
+ };
+
+ superUsers = mkOption {
+ type = listOf str;
+ default = [];
+ example = [ "elvis" ];
+ description = ''
+ List of trusted user names with wiki system administration super powers.
+
+ Please note that accounts for these users need to be created using the <command>moin</command> command-line utility, e.g.:
+ <command>moin-<replaceable>WIKINAME</replaceable> account create --name=<replaceable>NAME</replaceable> --email=<replaceable>EMAIL</replaceable> --password=<replaceable>PASSWORD</replaceable></command>.
+ '';
+ };
+
+ languageDefault = mkOption {
+ type = str;
+ default = "en";
+ example = "de";
+ description = "The ISO-639-1 name of the main wiki language. Languages that MoinMoin does not support are ignored.";
+ };
+
+ extraConfig = mkOption {
+ type = lines;
+ default = "";
+ example = ''
+ show_hosts = True
+ search_results_per_page = 100
+ acl_rights_default = u"Known:read,write,delete,revert All:read"
+ logo_string = u"<h2>\U0001f639</h2>"
+ theme_default = u"modernized"
+
+ user_checkbox_defaults = {'show_page_trail': 0, 'edit_on_doubleclick': 0}
+ navi_bar = [u'SomePage'] + multiconfig.DefaultConfig.navi_bar
+ actions_excluded = multiconfig.DefaultConfig.actions_excluded + ['newaccount']
+
+ mail_smarthost = "mail.example.org"
+ mail_from = u"Example.Org Wiki <wiki@example.org>"
+ '';
+ description = ''
+ Additional configuration to be appended verbatim to this wiki's config.
+
+ See <link xlink:href='http://moinmo.in/HelpOnConfiguration' /> for documentation.
+ '';
+ };
+
+ };
+ config = {
+ webHost = mkDefault name;
+ };
+ }));
+ example = literalExample ''
+ {
+ "mywiki" = {
+ siteName = "Example Wiki";
+ webHost = "wiki.example.org";
+ superUsers = [ "admin" ];
+ frontPage = "Index";
+ extraConfig = "page_category_regex = ur'(?P<all>(Category|Kategorie)(?P<key>(?!Template)\S+))'"
+ };
+ }
+ '';
+ description = ''
+ Configurations of the individual wikis. Attribute names must be valid Python
+ identifiers of the form <literal>[A-Za-z_][A-Za-z0-9_]*</literal>.
+
+ For every attribute <replaceable>WIKINAME</replaceable>, a helper script
+ moin-<replaceable>WIKINAME</replaceable> is created which runs the
+ <command>moin</command> command under the <literal>moin</literal> user (to avoid
+ file ownership issues) and with the right configuration directory passed to it.
+ '';
+ };
+ };
+
+ config = mkIf cfg.enable {
+ assertions = forEach (attrNames cfg.wikis) (wname:
+ { assertion = builtins.match "[A-Za-z_][A-Za-z0-9_]*" wname != null;
+ message = "${wname} is not valid Python identifier";
+ }
+ );
+
+ users.users = {
+ moin = {
+ description = "MoinMoin wiki";
+ home = dataDir;
+ group = group;
+ isSystemUser = true;
+ };
+ };
+
+ users.groups = {
+ moin = {
+ members = mkIf usingNginx [ config.services.nginx.user ];
+ };
+ };
+
+ environment.systemPackages = [ pkg ] ++ map moinCliWrapper (attrNames cfg.wikis);
+
+ systemd.services = mkIf usingGunicorn
+ (flip mapAttrs' cfg.wikis (wikiIdent: wiki:
+ nameValuePair "moin-${wikiIdent}"
+ {
+ description = "MoinMoin wiki ${wikiIdent} - gunicorn process";
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network.target" ];
+ restartIfChanged = true;
+ restartTriggers = [ (wikiConfigFile wikiIdent wiki) ];
+
+ environment = let
+ penv = python.buildEnv.override {
+ # setuptools: https://github.com/benoitc/gunicorn/issues/1716
+ extraLibs = [ python.pkgs.gevent python.pkgs.setuptools pkg ];
+ };
+ in {
+ PYTHONPATH = "${dataDir}/${wikiIdent}/config:${penv}/${python.sitePackages}";
+ };
+
+ preStart = ''
+ umask 0007
+ rm -rf ${dataDir}/${wikiIdent}/underlay
+ cp -r ${pkg}/share/moin/underlay ${dataDir}/${wikiIdent}/
+ chmod -R u+w ${dataDir}/${wikiIdent}/underlay
+ '';
+
+ serviceConfig = {
+ User = user;
+ Group = group;
+ WorkingDirectory = "${dataDir}/${wikiIdent}";
+ ExecStart = ''${python.pkgs.gunicorn}/bin/gunicorn moin_wsgi \
+ --name gunicorn-${wikiIdent} \
+ --workers ${toString cfg.gunicorn.workers} \
+ --worker-class gevent \
+ --bind unix:/run/moin/${wikiIdent}/gunicorn.sock
+ '';
+
+ Restart = "on-failure";
+ RestartSec = "2s";
+ StartLimitIntervalSec = "30s";
+
+ StateDirectory = "moin/${wikiIdent}";
+ StateDirectoryMode = "0750";
+ RuntimeDirectory = "moin/${wikiIdent}";
+ RuntimeDirectoryMode = "0750";
+
+ NoNewPrivileges = true;
+ ProtectSystem = "strict";
+ ProtectHome = true;
+ PrivateTmp = true;
+ PrivateDevices = true;
+ PrivateNetwork = true;
+ ProtectKernelTunables = true;
+ ProtectKernelModules = true;
+ ProtectControlGroups = true;
+ RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
+ RestrictNamespaces = true;
+ LockPersonality = true;
+ MemoryDenyWriteExecute = true;
+ RestrictRealtime = true;
+ };
+ }
+ ));
+
+ services.nginx = mkIf usingNginx {
+ enable = true;
+ virtualHosts = flip mapAttrs' cfg.wikis (name: w: nameValuePair w.webHost {
+ forceSSL = mkDefault true;
+ enableACME = mkDefault true;
+ locations."${w.webLocation}" = {
+ extraConfig = ''
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Forwarded-Host $host;
+ proxy_set_header X-Forwarded-Server $host;
+
+ proxy_pass http://unix:/run/moin/${name}/gunicorn.sock;
+ '';
+ };
+ });
+ };
+
+ systemd.tmpfiles.rules = [
+ "d /run/moin 0750 ${user} ${group} - -"
+ "d ${dataDir} 0550 ${user} ${group} - -"
+ ]
+ ++ (concatLists (flip mapAttrsToList cfg.wikis (wikiIdent: wiki: [
+ "d ${dataDir}/${wikiIdent} 0750 ${user} ${group} - -"
+ "d ${dataDir}/${wikiIdent}/config 0550 ${user} ${group} - -"
+ "L+ ${dataDir}/${wikiIdent}/config/wikiconfig.py - - - - ${wikiConfigFile wikiIdent wiki}"
+ # needed in order to pass module name to gunicorn
+ "L+ ${dataDir}/${wikiIdent}/config/moin_wsgi.py - - - - ${pkg}/share/moin/server/moin.wsgi"
+ # seed data files
+ "C ${dataDir}/${wikiIdent}/data 0770 ${user} ${group} - ${pkg}/share/moin/data"
+ # fix nix store permissions
+ "Z ${dataDir}/${wikiIdent}/data 0770 ${user} ${group} - -"
+ ])));
+ };
+
+ meta.maintainers = with lib.maintainers; [ b42 ];
+}
diff --git a/nixpkgs/nixos/modules/services/web-apps/moodle.nix b/nixpkgs/nixos/modules/services/web-apps/moodle.nix
index 211bc17ee19..ac59f9e0012 100644
--- a/nixpkgs/nixos/modules/services/web-apps/moodle.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/moodle.nix
@@ -309,7 +309,9 @@ in
systemd.services.httpd.after = optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service";
- users.users.${user}.group = group;
-
+ users.users.${user} = {
+ group = group;
+ isSystemUser = true;
+ };
};
}
diff --git a/nixpkgs/nixos/modules/services/web-apps/nextcloud.nix b/nixpkgs/nixos/modules/services/web-apps/nextcloud.nix
index db5dc915c89..b67f0880878 100644
--- a/nixpkgs/nixos/modules/services/web-apps/nextcloud.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/nextcloud.nix
@@ -390,6 +390,7 @@ in {
in {
wantedBy = [ "multi-user.target" ];
before = [ "phpfpm-nextcloud.service" ];
+ path = [ occ ];
script = ''
chmod og+x ${cfg.home}
ln -sf ${pkgs.nextcloud}/apps ${cfg.home}/
@@ -467,7 +468,7 @@ in {
};
"/" = {
priority = 200;
- extraConfig = "rewrite ^ /index.php$request_uri;";
+ extraConfig = "rewrite ^ /index.php;";
};
"~ ^/store-apps" = {
priority = 201;
@@ -494,6 +495,7 @@ in {
extraConfig = ''
include ${config.services.nginx.package}/conf/fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(\\/.*)$;
+ try_files $fastcgi_script_name =404;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS ${if cfg.https then "on" else "off"};
fastcgi_param modHeadersAvailable true;
@@ -531,6 +533,7 @@ in {
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Referrer-Policy no-referrer;
+ add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;
client_max_body_size ${cfg.maxUploadSize};
diff --git a/nixpkgs/nixos/modules/services/web-apps/nexus.nix b/nixpkgs/nixos/modules/services/web-apps/nexus.nix
index 3af97e146d0..d4d507362c9 100644
--- a/nixpkgs/nixos/modules/services/web-apps/nexus.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/nexus.nix
@@ -68,6 +68,7 @@ in
-Dkaraf.data=${cfg.home}/nexus3
-Djava.io.tmpdir=${cfg.home}/nexus3/tmp
-Dkaraf.startLocalConsole=false
+ -Djava.endorsed.dirs=${cfg.package}/lib/endorsed
'';
description = ''
diff --git a/nixpkgs/nixos/modules/services/web-apps/trac.nix b/nixpkgs/nixos/modules/services/web-apps/trac.nix
new file mode 100644
index 00000000000..207fb857438
--- /dev/null
+++ b/nixpkgs/nixos/modules/services/web-apps/trac.nix
@@ -0,0 +1,79 @@
+{ config, lib, pkgs, ... }:
+
+let
+ cfg = config.services.trac;
+
+ inherit (lib) mkEnableOption mkIf mkOption types;
+
+in {
+
+ options = {
+
+ services.trac = {
+ enable = mkEnableOption "Trac service";
+
+ listen = {
+ ip = mkOption {
+ type = types.str;
+ default = "0.0.0.0";
+ description = ''
+ IP address that Trac should listen on.
+ '';
+ };
+
+ port = mkOption {
+ type = types.port;
+ default = 8000;
+ description = ''
+ Listen port for Trac.
+ '';
+ };
+ };
+
+ dataDir = mkOption {
+ default = "/var/lib/trac";
+ type = types.path;
+ description = ''
+ The directory for storing the Trac data.
+ '';
+ };
+
+ openFirewall = mkOption {
+ type = types.bool;
+ default = false;
+ description = ''
+ Open ports in the firewall for Trac.
+ '';
+ };
+ };
+
+ };
+
+ config = mkIf cfg.enable {
+
+ systemd.services.trac = {
+ description = "Trac server";
+ wantedBy = [ "multi-user.target" ];
+ serviceConfig = {
+ DynamicUser = true;
+ StateDirectory = baseNameOf cfg.dataDir;
+ ExecStart = ''
+ ${pkgs.trac}/bin/tracd -s \
+ -b ${toString cfg.listen.ip} \
+ -p ${toString cfg.listen.port} \
+ ${cfg.dataDir}
+ '';
+ };
+ preStart = ''
+ if [ ! -e ${cfg.dataDir}/VERSION ]; then
+ ${pkgs.trac}/bin/trac-admin ${cfg.dataDir} initenv Trac "sqlite:db/trac.db"
+ fi
+ '';
+ };
+
+ networking.firewall = mkIf cfg.openFirewall {
+ allowedTCPPorts = [ cfg.listen.port ];
+ };
+
+ };
+}
diff --git a/nixpkgs/nixos/modules/services/web-apps/virtlyst.nix b/nixpkgs/nixos/modules/services/web-apps/virtlyst.nix
index e5c0bff2168..37bdbb0e3b4 100644
--- a/nixpkgs/nixos/modules/services/web-apps/virtlyst.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/virtlyst.nix
@@ -54,6 +54,7 @@ in
home = stateDir;
createHome = true;
group = mkIf config.virtualisation.libvirtd.enable "libvirtd";
+ isSystemUser = true;
};
systemd.services.virtlyst = {
diff --git a/nixpkgs/nixos/modules/services/web-apps/wordpress.nix b/nixpkgs/nixos/modules/services/web-apps/wordpress.nix
index e311dd917dd..f1370c2854b 100644
--- a/nixpkgs/nixos/modules/services/web-apps/wordpress.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/wordpress.nix
@@ -367,7 +367,10 @@ in
})
];
- users.users.${user}.group = group;
+ users.users.${user} = {
+ group = group;
+ isSystemUser = true;
+ };
};
}