mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-05-20 21:41:12 +02:00
Compare commits
3 Commits
userweb-se
...
9c142fd56f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c142fd56f | ||
|
|
b98e8679e6 | ||
|
|
ea092ec0b3 |
@@ -134,9 +134,6 @@ in {
|
||||
ALLOW_FORK_INTO_SAME_OWNER = true;
|
||||
};
|
||||
picture = {
|
||||
DISABLE_GRAVATAR = true;
|
||||
ENABLE_FEDERATED_AVATAR = false;
|
||||
|
||||
AVATAR_MAX_FILE_SIZE = 1024 * 1024 * 5;
|
||||
# NOTE: go any bigger than this, and gitea will freeze your gif >:(
|
||||
AVATAR_MAX_ORIGIN_SIZE = 1024 * 1024 * 2;
|
||||
|
||||
@@ -4,6 +4,13 @@ let
|
||||
|
||||
homeLetters = [ "a" "b" "c" "d" "h" "i" "j" "k" "l" "m" "z" ];
|
||||
|
||||
phpOptions = lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "${k} = ${v}"){
|
||||
display_errors = "Off";
|
||||
display_startup_errors = "Off";
|
||||
post_max_size = "40M";
|
||||
upload_max_filesize = "40M";
|
||||
});
|
||||
|
||||
# https://nixos.org/manual/nixpkgs/stable/#ssec-php-user-guide-installing-with-extensions
|
||||
phpEnv = pkgs.php.buildEnv {
|
||||
extensions = { all, ... }: with all; [
|
||||
@@ -29,11 +36,7 @@ let
|
||||
pdo_sqlite
|
||||
];
|
||||
|
||||
extraConfig = ''
|
||||
display_errors=0
|
||||
post_max_size = 40M
|
||||
upload_max_filesize = 40M
|
||||
'';
|
||||
extraConfig = phpOptions;
|
||||
};
|
||||
|
||||
perlEnv = pkgs.perl.withPackages (ps: with ps; [
|
||||
@@ -70,9 +73,9 @@ let
|
||||
text = ''
|
||||
args=("$@")
|
||||
|
||||
if [[ "''${PWD:-}" =~ ^/home/pvv/[^/]+/([^/]+) ]] && [[ "''${BASH_REMATCH[1]}" != "pvv" ]]; then
|
||||
if [[ -z "$USERDIR_USER" ]] && [[ "$USERDIR_USER" != "pvv" ]]; then
|
||||
# Prepend -fusername to the argument list, so bounces go to the user
|
||||
args=("-f''${BASH_REMATCH[1]}" "''${args[@]}")
|
||||
args=("-f$USERDIR_USER" "''${args[@]}")
|
||||
fi
|
||||
|
||||
exec '${lib.getExe pkgs.system-sendmail}' "''${args[@]}"
|
||||
@@ -173,6 +176,7 @@ in
|
||||
|
||||
enablePHP = true;
|
||||
phpPackage = phpEnv;
|
||||
inherit phpOptions;
|
||||
|
||||
enablePerl = true;
|
||||
|
||||
@@ -209,6 +213,7 @@ in
|
||||
UserDir disabled root
|
||||
AddHandler cgi-script .cgi
|
||||
DirectoryIndex index.html index.html.var index.php index.php3 index.cgi index.phtml index.shtml meg.html
|
||||
SetEnvIf Request_URI "^/~([^/]+)" USERDIR_USER=$1
|
||||
|
||||
<Directory "/home/pvv/?/*/web-docs">
|
||||
Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI IncludesNoExec
|
||||
|
||||
Reference in New Issue
Block a user