grocy = pkgs.callPackage ./grocy.nix {
inherit (pkgs.webapps) grocy;
};
+ phpbb = pkgs.callPackage ./phpbb.nix {
+ phpbb = (pkgs.webapps.phpbb.withLangs (l: [ l.fr ])).withExts (e: [
+ e.alfredoramos.markdown e.davidiq.mailinglist e.dmzx.mchat
+ e.empteintesduweb.monitoranswers e.lr94.autosubscribe
+ e.phpbbmodders.adduser ]);
+ };
webhooks = pkgs.callPackage ./webhooks.nix {
env = config.myEnv.tools.webhooks;
};
shaarli = shaarli.backups;
ttrss = ttrss.backups;
wallabag = wallabag.backups;
+ phpbb = phpbb.backups;
};
services.websites.env.tools.modules =
++ rompr.apache.modules
++ shaarli.apache.modules
++ dokuwiki.apache.modules
+ ++ phpbb.apache.modules
++ ldap.apache.modules
++ kanboard.apache.modules;
certName = "eldiron";
addToCerts = true;
hosts = ["tools.immae.eu" ];
- root = "/var/lib/ftp/tools.immae.eu";
+ root = landing;
extraConfig = [
''
RedirectMatch 301 ^/vpn(.*)$ https://vpn.immae.eu$1
RedirectMatch 301 ^/roundcube(.*)$ https://mail.immae.eu/roundcube$1
RedirectMatch 301 ^/jappix(.*)$ https://im.immae.fr/converse
- Alias /landing ${landing}
<Directory "${landing}">
DirectoryIndex index.html
AllowOverride None
SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost"
</FilesMatch>
</Directory>
-
- <Directory "/var/lib/ftp/tools.immae.eu">
- DirectoryIndex index.php index.htm index.html
- AllowOverride all
- Require all granted
- <FilesMatch "\.php$">
- SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost"
- </FilesMatch>
-
- RewriteEngine On
- RewriteCond ${landing}%{REQUEST_URI} -f
- RewriteRule ^(.*)$ /landing/$1 [L]
- RewriteRule ^$ /landing/ [L]
- </Directory>
''
(adminer.apache.vhostConf pcfg.adminer.socket)
ympd.apache.vhostConf
(ldap.apache.vhostConf pcfg.ldap.socket)
(kanboard.apache.vhostConf pcfg.kanboard.socket)
(grocy.apache.vhostConf pcfg.grocy.socket)
+ (phpbb.apache.vhostConf pcfg.phpbb.socket)
''
Alias /paste /var/lib/fiche
<Directory "/var/lib/fiche">
after = lib.mkAfter dokuwiki.phpFpm.serviceDeps;
wants = dokuwiki.phpFpm.serviceDeps;
};
+ phpfpm-phpbb = {
+ after = lib.mkAfter phpbb.phpFpm.serviceDeps;
+ wants = phpbb.phpFpm.serviceDeps;
+ };
phpfpm-kanboard = {
after = lib.mkAfter kanboard.phpFpm.serviceDeps;
wants = kanboard.phpFpm.serviceDeps;
# Needed to avoid clashes in browser cookies (same domain)
"php_value[session.name]" = "ToolsPHPSESSID";
"php_admin_value[open_basedir]" = builtins.concatStringsSep ":" [
- "/run/wrappers/bin/sendmail" "/var/lib/ftp/tools.immae.eu"
- landing "/tmp" "${config.secrets.location}/webapps/webhooks"
+ "/run/wrappers/bin/sendmail" landing "/tmp"
+ "${config.secrets.location}/webapps/webhooks"
];
};
phpEnv = {
group = "wwwrun";
settings = dokuwiki.phpFpm.pool;
};
+ phpbb = {
+ user = "wwwrun";
+ group = "wwwrun";
+ settings = phpbb.phpFpm.pool;
+ };
ldap = {
user = "wwwrun";
group = "wwwrun";
rompr = rompr.activationScript;
shaarli = shaarli.activationScript;
dokuwiki = dokuwiki.activationScript;
+ phpbb = phpbb.activationScript;
kanboard = kanboard.activationScript;
ldap = ldap.activationScript;
};
services.websites.webappDirs = {
_adminer = adminer.webRoot;
"${dokuwiki.apache.webappName}" = dokuwiki.webRoot;
+ "${phpbb.apache.webappName}" = phpbb.webRoot;
"${ldap.apache.webappName}" = "${ldap.webRoot}/htdocs";
"${rompr.apache.webappName}" = rompr.webRoot;
"${shaarli.apache.webappName}" = shaarli.webRoot;
--- /dev/null
+{ lib, phpbb, gnused }:
+rec {
+ backups = {
+ rootDir = varDir;
+ };
+ varDir = "/var/lib/phpbb";
+ activationScript = {
+ deps = [ "wrappers" ];
+ text = ''
+ if [ ! -d ${varDir} ]; then
+ install -m 0755 -o ${apache.user} -g ${apache.user} -d ${varDir}
+ cp -a ${phpbb}/vars/* ${varDir}
+ chown -R ${apache.user}:${apache.user} ${varDir}
+ fi
+ install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
+ '';
+ };
+ webRoot = phpbb;
+ apache = rec {
+ user = "wwwrun";
+ group = "wwwrun";
+ modules = [ "proxy_fcgi" ];
+ webappName = "tools_phpbb";
+ root = "/run/current-system/webapps/${webappName}";
+ vhostConf = socket: ''
+ Alias /forum "${root}"
+ <Directory "${root}">
+ DirectoryIndex index.php
+ <FilesMatch "\.php$">
+ SetHandler "proxy:unix:${socket}|fcgi://localhost"
+ </FilesMatch>
+
+ AllowOverride All
+ Options FollowSymlinks
+ Require all granted
+ </Directory>
+ # add instal to the list after install
+ <LocationMatch "^/(cache|files|install|store)>
+ Require all denied
+ </LocationMatch>
+ '';
+ };
+ phpFpm = rec {
+ serviceDeps = [ "postgresql.service" ];
+ basedir = builtins.concatStringsSep ":" [ "/run/wrappers/bin/sendmail" phpbb varDir ];
+ pool = {
+ "listen.owner" = apache.user;
+ "listen.group" = apache.group;
+ "pm" = "ondemand";
+ "pm.max_children" = "60";
+ "pm.process_idle_timeout" = "60";
+
+ # Needed to avoid clashes in browser cookies (same domain)
+ "php_value[session.name]" = "PhpBBPHPSESSID";
+ "php_admin_value[open_basedir]" = "${basedir}:/tmp";
+ "php_admin_value[session.save_path]" = "${varDir}/phpSessions";
+ };
+ };
+}
(name: callPackage (./nextcloud/apps + "/${name}.nix") { buildApp = nextcloud.buildApp; });
peertube = callPackage ./peertube { inherit mylibs; };
+ phpbb = callPackage ./phpbb {};
+
phpldapadmin = callPackage ./phpldapadmin {};
rompr = callPackage ./rompr { inherit mylibs; };
--- /dev/null
+{ stdenv, fetchurl, callPackage
+, varDir ? "/var/lib/phpbb"
+}:
+let
+ allExts = {
+ alfredoramos.markdown = callPackage ./extensions/markdown.nix {};
+ davidiq.mailinglist = callPackage ./extensions/mailinglist.nix {};
+ dmzx.mchat = callPackage ./extensions/mchat.nix {};
+ empteintesduweb.monitoranswers = callPackage ./extensions/monitoranswers.nix {};
+ lr94.autosubscribe = callPackage ./extensions/autosubscribe.nix {};
+ phpbbmodders.adduser = callPackage ./extensions/adduser.nix {};
+ };
+ allLangs = {
+ fr = callPackage ./langs/fr.nix {};
+ };
+ toPassthru = pkg: {
+ withLangs = withLangs pkg;
+ withExts = withExts pkg;
+ };
+ withExts = pkg: toExts:
+ let
+ exts = toExts allExts;
+ toInstallExt = ext: "cp -r ${ext}/* $out/ext/";
+ newPhpBB = pkg.overrideAttrs(old: {
+ installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallExt exts);
+ passthru = toPassthru newPhpBB;
+ });
+ in newPhpBB;
+ withLangs = pkg: toLangs:
+ let
+ langs = toLangs allLangs;
+ toInstallLang = lang: "cp -r ${lang}/*/ $out";
+ newPhpBB = pkg.overrideAttrs(old: {
+ installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallLang langs);
+ passthru = toPassthru newPhpBB;
+ });
+ in newPhpBB;
+ phpBB = stdenv.mkDerivation rec {
+ pname = "phpBB";
+ version = "3.3.0";
+
+ src = fetchurl {
+ url = "https://download.phpbb.com/pub/release/3.3/${version}/${pname}-${version}.tar.bz2";
+ sha256 = "a6234ac9dcf9086c025ece29a0a235f997a92bb9a994eff0ddcf8917e841262f";
+ };
+
+ phases = [ "unpackPhase" "installPhase" ];
+
+ installPhase = ''
+ cp -a . $out
+ mkdir -p $out/vars
+ mv $out/{cache,files,store,config.php} $out/vars
+ ln -s ${varDir}/{cache,files,store,config.php} $out/
+ echo -e "core:\n allow_install_dir: true" >> $out/config/production/config.yml
+ '';
+
+ passthru = toPassthru phpBB;
+ };
+in
+ phpBB
--- /dev/null
+{ stdenv, fetchurl, unzip }:
+stdenv.mkDerivation rec {
+ pname = "phpBB-extension-adduser";
+ version = "1.0.4";
+ src = fetchurl {
+ # https://www.phpbb.com/customise/db/extension/acp_add_user_2
+ url = "https://www.phpbb.com/customise/db/download/141601";
+ sha256 = "13m4anib74cinnv1ap3b1ncb8cxm3mzhhmlqhbrr9mlrqmwf4zg2";
+ };
+
+ buildInputs = [ unzip ];
+ phases = [ "unpackPhase" "installPhase" ];
+ unpackPhase = ''
+ mkdir src
+ cd src
+ unzip $src
+ '';
+ installPhase = ''
+ cp -a . $out
+ cp -a $out/phpbbmodders/adduser/language/en $out/phpbbmodders/adduser/language/fr
+ '';
+}
--- /dev/null
+{ stdenv, fetchurl, unzip }:
+stdenv.mkDerivation rec {
+ pname = "phpBB-extension-autosubscribe";
+ version = "1.1.0";
+ src = fetchurl {
+ # https://www.phpbb.com/customise/db/extension/autosubscribe
+ url = "https://www.phpbb.com/customise/db/download/146556";
+ sha256 = "0dsay463g4impw86w1nv307nslc195fkgkqmihfn5kc0hya0giv0";
+ };
+
+ buildInputs = [ unzip ];
+ phases = [ "unpackPhase" "installPhase" ];
+ unpackPhase = ''
+ mkdir src
+ cd src
+ unzip $src
+ '';
+ installPhase = "cp -a . $out";
+}
--- /dev/null
+{ stdenv, fetchurl, unzip }:
+stdenv.mkDerivation rec {
+ pname = "phpBB-extension-MailingList";
+ version = "2.0.0";
+ src = fetchurl {
+ url = "https://github.com/DavidIQ/MailingList/archive/${version}.tar.gz";
+ sha256 = "1ddg8bci85jwmvyakcwdn4yzqwz1rgy7ljf4nmfk9p2kvx2nhj62";
+ };
+
+ phases = [ "unpackPhase" "installPhase" ];
+ installPhase = ''
+ mkdir -p $out/davidiq/mailinglist
+ cp -a . $out/davidiq/mailinglist
+ # delete last two lines which contain EMAIL_SIG
+ sed -i -n -e :a -e '1,2!{P;N;D;};N;ba' $out/davidiq/mailinglist/language/en/email/*
+ '';
+}
+
--- /dev/null
+{ stdenv, fetchurl, unzip }:
+stdenv.mkDerivation rec {
+ pname = "phpBB-extension-markdown";
+ version = "1.2.0";
+ src = fetchurl {
+ # https://www.phpbb.com/customise/db/extension/markdown
+ name = "alfredoramos_markdown_${version}.zip";
+ url = "https://www.phpbb.com/customise/db/download/173626";
+ sha256 = "0bmgi8qr6azaaz8xnz8dkyf147dyawqvqr93r01qbm9s8bfkpzqx";
+ };
+
+ buildInputs = [ unzip ];
+ phases = [ "unpackPhase" "installPhase" ];
+ unpackPhase = ''
+ mkdir src
+ cd src
+ unzip $src
+ '';
+ installPhase = "cp -a . $out";
+}
--- /dev/null
+{ stdenv, fetchurl, unzip }:
+stdenv.mkDerivation rec {
+ pname = "phpBB-extension-mchat";
+ version = "2.1.3";
+ src = fetchurl {
+ # https://www.phpbb.com/customise/db/extension/mchat_extension
+ name = "dmzx_mchat_${version}.zip";
+ url = "https://www.phpbb.com/customise/db/download/168331";
+ sha256 = "0mcka02wamn899vg64m1c5d5k6f4qml18cshhzfvccrdc7a0m5p1";
+ };
+
+ buildInputs = [ unzip ];
+ phases = [ "unpackPhase" "installPhase" ];
+ unpackPhase = ''
+ mkdir src
+ cd src
+ unzip $src
+ '';
+ installPhase = "cp -a . $out";
+}
+
--- /dev/null
+{ stdenv, fetchurl, unzip }:
+stdenv.mkDerivation rec {
+ pname = "phpBB-extension-monitoranswers";
+ version = "1.0.0";
+ src = fetchurl {
+ # http://forums.phpbb-fr.com/extensions-developpement-en-cours/sujet208410.html
+ url = "https://www.empreintesduweb.com/dl/extension_empreintesduweb_monitoranswers_v100.zip";
+ sha256 = "0g5khzz7brkra9rnnjh8vsv11h8vf36pcw53b4wrkcjb66bfm20s";
+ };
+
+ buildInputs = [ unzip ];
+ phases = [ "unpackPhase" "installPhase" ];
+ unpackPhase = ''
+ mkdir src
+ cd src
+ unzip $src
+ '';
+ installPhase = "cp -a . $out";
+}
--- /dev/null
+{ stdenv, fetchurl }:
+stdenv.mkDerivation rec {
+ pname = "phpBB-language-fr";
+ version = "v4.0.0";
+ src = fetchurl {
+ url = "https://github.com/milescellar/phpbb-language-fr/archive/${version}.tar.gz";
+ sha256 = "0pkw55pb8ka4ayn1861hwvjwzs8vkq04yaxrs7zm9c8lh2g7y8z0";
+ };
+
+ phases = [ "unpackPhase" "installPhase" ];
+ installPhase = "cp -a . $out";
+}