]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Migrate manual scripts from tools.immae.eu
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 25 Apr 2020 01:01:39 +0000 (03:01 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 25 Apr 2020 01:01:39 +0000 (03:01 +0200)
Landing page
BIP39
ldap/myip scripts
webhooks

29 files changed:
modules/private/buildbot/projects/immaeEu/__init__.py
modules/private/environment.nix
modules/private/websites/tools/tools/default.nix
modules/private/websites/tools/tools/landing.nix [new file with mode: 0644]
modules/private/websites/tools/tools/landing/config.yml [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/adminer.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/buildbot.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/buildbot.svg [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/diaspora.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/dokuwiki.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/etherpad.ico [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/gitweb.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/grocy.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/kanboard.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/mantisbt.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/mastodon.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/mgoblin.ico [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/nextcloud.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/peertube.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/phpbb.ico [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/rainloop.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/rompr.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/roundcube.svg [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/shaarli.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/ttrss.png [new file with mode: 0644]
modules/private/websites/tools/tools/landing/icons/wallabag.svg [new file with mode: 0644]
modules/private/websites/tools/tools/landing/ldap_password.php [new file with mode: 0644]
modules/private/websites/tools/tools/landing/myip.php [new file with mode: 0644]
modules/private/websites/tools/tools/webhooks.nix [new file with mode: 0644]

index ce6cdb1e0b5573d900ccdd9f3d50b41116659ada..bb880e5329d5e31cdf5f12630ab32104dbc22aba 100644 (file)
@@ -15,6 +15,7 @@ class E():
     SSH_HOST_KEY  = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFbhFTl2A2RJn5L51yxJM4XfCS2ZaiSX/jo9jFSdghF"
     XMPP_RECIPIENTS = os.environ["BUILDBOT_XMPP_RECIPIENTS"].split(" ")
 
+    BIP39_GIT_URL      = "https://git.immae.eu/perso/Immae/Projets/Cryptomonnaies/BIP39.git"
     IMMAE_EU_GIT_URL   = "gitolite@git.immae.eu:perso/Immae/Sites/Blog"
     RECETTES_GIT_URL   = "gitolite@git.immae.eu:perso/Immae/Sites/Recettes"
     COURS_GIT_URL      = "gitolite@git.immae.eu:perso/Immae/Sites/Cours"
@@ -23,6 +24,7 @@ class E():
     COURS_RELEASE_PATH      = "/var/lib/buildbot/outputs/cours"
     COURS_TARBALL_PATH      = "/var/lib/ftp/release.immae.eu/cours"
     COURS_TARBALL_URL       = "https://release.immae.eu/cours"
+    BIP39_RELEASE_PATH      = "/var/lib/buildbot/outputs/bip39"
     IMMAE_EU_RELEASE_PATH   = "/var/lib/buildbot/outputs/immaeEu"
     RECETTES_RELEASE_PATH   = "/var/lib/buildbot/outputs/recettes"
     NORMALESUP_RELEASE_PATH = "/var/lib/buildbot/outputs/recherche"
@@ -66,10 +68,12 @@ def configure(c):
     c['schedulers'].append(hook_scheduler("Normalesup", timer=1))
     c['schedulers'].append(hook_scheduler("Cours", timer=1))
     c['schedulers'].append(hook_scheduler("Recettes", timer=1))
+    c['schedulers'].append(hook_scheduler("BIP39", timer=1))
     c['schedulers'].append(schedulers.Nightly(name="GSMCells-weekly",
         builderNames=["GSMCells_build"], dayOfWeek=6, hour=3))
     c['schedulers'].append(force_scheduler("force_immae_eu", [
-        "ImmaeEu_build", "Normalesup_build", "Cours_build", "Recettes_build"
+        "ImmaeEu_build", "Normalesup_build", "Cours_build",
+        "Recettes_build", "BIP39_build"
         ]))
     c['schedulers'].append(schedulers.ForceScheduler(
         name="GSMCells-force", label="Force build",
@@ -92,19 +96,20 @@ def configure(c):
     c['builders'].append(cours_factory())
     c['builders'].append(gsm_cells_factory())
     c['builders'].append(recettes_factory())
+    c['builders'].append(bip39_factory())
 
     c['services'].append(SlackStatusPush(
         name="slack_status_immae_eu_project",
         builders=[
             "ImmaeEu_build", "Normalesup_build", "Cours_build",
-            "GSMCells_build", "Recettes_build"
+            "GSMCells_build", "Recettes_build", "BIP39_build"
             ],
         serverUrl=open(E.SECRETS_FILE + "/slack_webhook", "r").read().rstrip()))
     c['services'].append(XMPPStatusPush(
         name="xmpp_status_immae_eu_project",
         builders=[
             "ImmaeEu_build", "Normalesup_build", "Cours_build",
-            "GSMCells_build", "Recettes_build"
+            "GSMCells_build", "Recettes_build", "BIP39_build"
             ],
         recipients=E.XMPP_RECIPIENTS,
         password=open(E.SECRETS_FILE + "/notify_xmpp_password", "r").read().rstrip()))
@@ -128,6 +133,23 @@ def recettes_factory():
 
     return util.BuilderConfig(name="Recettes_build", workernames=["generic-worker-immae-eu"], factory=factory)
 
+def bip39_factory():
+    path_env = {
+            "PATH": os.environ["BUILDBOT_PATH_BIP39"] + ":${PATH}"
+            }
+    factory = util.BuildFactory()
+    factory.addStep(steps.Git(logEnviron=False, repourl=E.BIP39_GIT_URL,
+        submodules=True, mode="full", method="copy"))
+    factory.addStep(steps.ShellCommand(name="build file",
+        logEnviron=False, haltOnFailure=True, workdir="source",
+        env=path_env, command=["python", "compile.py"]))
+    factory.addStep(steps.FileUpload(name="upload file", workersrc="bip39-standalone.html",
+        workdir="source", masterdest=E.BIP39_RELEASE_PATH + "/index.html",
+        url="https://tools.immae.eu/BIP39", mode=0o644))
+    factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.BIP39_RELEASE_PATH)))
+
+    return util.BuilderConfig(name="BIP39_build", workernames=["generic-worker-immae-eu"], factory=factory)
+
 def immae_eu_factory():
     path_env = {
             "PATH": os.environ["BUILDBOT_PATH_ImmaeEu"] + ":${PATH}"
index 01ab967bf53551d8cd7eae627c98dd6a1ca4e158..f7994a1e7894c28be410e9df70382b554f005f11 100644 (file)
@@ -799,6 +799,7 @@ in
       description = "Tools configurations";
       type = submodule {
         options = {
+          contact = mkOption { type = str; description = "Contact e-mail address"; };
           davical = mkOption {
             description = "Davical configuration";
             type = submodule {
@@ -1012,6 +1013,10 @@ in
               };
             };
           };
+          webhooks = mkOption {
+            type = attrsOf str;
+            description = "Mapping 'name'.php => script for webhooks";
+          };
           ympd = mkOption {
             description = "Ympd configuration";
             type = submodule {
index 2fe477592e580d38585d8a4c1bcb7cb78ff9e8dd..dbd65e63ffdb76fcaba36ea56a8368131c74d5b7 100644 (file)
@@ -38,6 +38,11 @@ let
   grocy = pkgs.callPackage ./grocy.nix {
     inherit (pkgs.webapps) grocy;
   };
+  webhooks = pkgs.callPackage ./webhooks.nix {
+    env = config.myEnv.tools.webhooks;
+  };
+
+  landing = pkgs.callPackage ./landing.nix {};
 
   cfg = config.myServices.websites.tools.tools;
   pcfg = config.services.phpfpm.pools;
@@ -53,7 +58,8 @@ in {
       ++ shaarli.keys
       ++ ttrss.keys
       ++ wallabag.keys
-      ++ yourls.keys;
+      ++ yourls.keys
+      ++ webhooks.keys;
 
     services.duplyBackup.profiles = {
       dokuwiki = dokuwiki.backups;
@@ -111,9 +117,16 @@ in {
           RedirectMatch 301 ^/roundcube(.*)$   https://mail.immae.eu/roundcube$1
           RedirectMatch 301 ^/jappix(.*)$      https://im.immae.fr/converse
 
-          RewriteEngine On
-          RewriteCond %{DOCUMENT_ROOT}/homer%{REQUEST_URI} -f
-          RewriteRule ^(.*)$ /homer$1 [QSA,L]
+          Alias /landing ${landing}
+          <Directory "${landing}">
+            DirectoryIndex index.html
+            AllowOverride None
+            Require all granted
+
+            <FilesMatch "\.php$">
+              SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost"
+            </FilesMatch>
+          </Directory>
 
           <Directory "/var/lib/ftp/tools.immae.eu">
             DirectoryIndex index.php index.htm index.html
@@ -122,6 +135,11 @@ in {
             <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)
@@ -143,6 +161,23 @@ in {
             Require all granted
             Options -Indexes
           </Directory>
+
+          Alias /BIP39 /var/lib/buildbot/outputs/bip39
+          <Directory "/var/lib/buildbot/outputs/bip39">
+            DirectoryIndex index.html
+            AllowOverride None
+            Require all granted
+          </Directory>
+
+          Alias /webhooks ${config.secrets.location}/webapps/webhooks
+          <Directory "${config.secrets.location}/webapps/webhooks">
+            Options -Indexes
+            Require all granted
+            AllowOverride None
+            <FilesMatch "\.php$">
+              SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost"
+            </FilesMatch>
+          </Directory>
         ''
       ];
     };
@@ -253,7 +288,13 @@ in {
 
           # Needed to avoid clashes in browser cookies (same domain)
           "php_value[session.name]" = "ToolsPHPSESSID";
-          "php_admin_value[open_basedir]" = "/run/wrappers/bin/sendmail:/var/lib/ftp/tools.immae.eu:/tmp";
+          "php_admin_value[open_basedir]" = builtins.concatStringsSep ":" [
+            "/run/wrappers/bin/sendmail" "/var/lib/ftp/tools.immae.eu"
+            landing "/tmp" "${config.secrets.location}/webapps/webhooks"
+          ];
+        };
+        phpEnv = {
+          CONTACT_EMAIL = config.myEnv.tools.contact;
         };
       };
       devtools = {
diff --git a/modules/private/websites/tools/tools/landing.nix b/modules/private/websites/tools/tools/landing.nix
new file mode 100644 (file)
index 0000000..ac5c3cf
--- /dev/null
@@ -0,0 +1,21 @@
+{ stdenv, fetchFromGitHub }:
+stdenv.mkDerivation rec {
+  pname = "homer";
+  version = "v1.0";
+  src = fetchFromGitHub {
+    owner = "bastienwirtz";
+    repo = "homer";
+    rev = version;
+    sha256 = "0pgpkbqdg4728c8xan5q3lfb8najq118wn2497mc3h0md7l09m63";
+  };
+
+  phases = ["unpackPhase" "installPhase"];
+
+  installPhase = ''
+    cp -a . $out
+    sed -i -e "s/vlayout: true,/vlayout: false,/" $out/app.js
+    cp ${./landing}/config.yml $out/
+    cp ${./landing}/*.php $out/
+    cp ${./landing}/icons/* $out/assets/tools/
+  '';
+}
diff --git a/modules/private/websites/tools/tools/landing/config.yml b/modules/private/websites/tools/tools/landing/config.yml
new file mode 100644 (file)
index 0000000..42ebcd1
--- /dev/null
@@ -0,0 +1,210 @@
+---
+# Homepage configuration
+# See https://fontawesome.com/icons for icons options
+
+title: "Websites dashboard"
+subtitle: "Immae"
+footer: false
+
+# Optional navbar
+# links: [] # Allows for navbar (dark mode, layout, and search) without any links
+links:
+  - name: "status"
+    icon: "fas fa-desktop"
+    url: "https://status.immae.eu"
+    target: '_blank' # optionnal html a tag target attribute
+  - name: "Change password"
+    url: "https://tools.immae.eu/ldap_password.php"
+    target: '_blank'
+  - name: "Get your IP"
+    url: "https://tools.immae.eu/myip.php"
+    target: '_blank'
+
+# Services
+# First level array represent a group.
+# Leave only a "items" key if not using group (group name, icon & tagstyle are optional, section separation will not be displayed).
+services:
+  - name: "Tools"
+    icon: "fas fa-tools"
+    items:
+      - name: "Nextcloud"
+        logo: "assets/tools/nextcloud.png"
+        url: "https://cloud.immae.eu"
+        target: '_blank'
+      - name: "Etherpad"
+        logo: "assets/tools/etherpad.ico"
+        url: "https://ether.immae.eu"
+        target: '_blank'
+      - name: "Taskweb"
+        icon: "fas fa-tasks"
+        url: "https://task.immae.eu/taskweb"
+        target: '_blank'
+      - name: "Agenda"
+        icon: "fas fa-calendar-alt"
+        url: "https://dav.immae.eu/caldavzap"
+        target: '_blank'
+      - name: "Contacts"
+        icon: "fas fa-address-book"
+        url: "https://dav.immae.eu/carddavmate"
+        target: '_blank'
+      - name: "Kanboard"
+        logo: "assets/tools/kanboard.png"
+        url: "https://tools.immae.eu/kanboard"
+        target: '_blank'
+      - name: "Dokuwiki"
+        logo: "assets/tools/dokuwiki.png"
+        url: "https://tools.immae.eu/dokuwiki"
+        target: '_blank'
+      - name: "RompR (MPD)"
+        logo: "assets/tools/rompr.png"
+        url: "https://tools.immae.eu/rompr"
+        target: '_blank'
+      - name: "Ympd (MPD)"
+        icon: "far fa-play-circle"
+        url: "https://tools.immae.eu/mpd"
+        target: '_blank'
+      - name: "Shaarli"
+        logo: "assets/tools/shaarli.png"
+        url: "https://tools.immae.eu/Shaarli"
+        target: '_blank'
+      - name: "TT-RSS"
+        logo: "assets/tools/ttrss.png"
+        url: "https://tools.immae.eu/ttrss"
+        target: '_blank'
+      - name: "Wallabag"
+        logo: "assets/tools/wallabag.svg"
+        url: "https://tools.immae.eu/wallabag"
+        target: '_blank'
+      - name: "Grocy"
+        logo: "assets/tools/grocy.png"
+        url: "https://tools.immae.eu/grocy"
+        target: '_blank'
+      - name: "BIP39"
+        icon: "fab fa-bitcoin"
+        url: "https://tools.immae.eu/BIP39"
+        target: '_blank'
+  - name: "Social"
+    icon: "fas fa-users"
+    items:
+      - name: "Diaspora"
+        logo: "assets/tools/diaspora.png"
+        url: "https://diaspora.immae.eu"
+        target: '_blank'
+      - name: "Mastodon"
+        logo: "assets/tools/mastodon.png"
+        url: "https://mastodon.immae.eu"
+        target: '_blank'
+      - name: "PhpBB"
+        logo: "assets/tools/phpbb.ico"
+        url: "https://tools.immae.eu/forum"
+        target: '_blank'
+      - name: "Instant messaging (converse)"
+        icon: "fas fa-comment"
+        url: "https://im.immae.fr/converse"
+        target: '_blank'
+      - name: "Mail (roundcube)"
+        logo: "assets/tools/roundcube.svg"
+        url: "https://mail.immae.eu/roundcube"
+        target: '_blank'
+      - name: "Mail (rainloop)"
+        logo: "assets/tools/rainloop.png"
+        url: "https://mail.immae.eu/rainloop"
+        target: '_blank'
+  - name: "Video"
+    icon: "fas fa-video"
+    items:
+      - name: "Peertube"
+        logo: "assets/tools/peertube.png"
+        url: "https://peertube.immae.eu"
+        target: '_blank'
+      - name: "Mediagoblin"
+        logo: "assets/tools/mgoblin.ico"
+        url: "https://mgoblin.immae.eu"
+        target: '_blank'
+  - name: "Development"
+    icon: "fas fa-code-branch"
+    items:
+      - name: "Gitweb"
+        logo: "assets/tools/gitweb.png"
+        url: "https://git.immae.eu"
+        target: '_blank'
+      - name: "Mantisbt"
+        logo: "assets/tools/mantisbt.png"
+        url: "https://git.immae.eu/mantisbt"
+        target: '_blank'
+      - name: "Buildbot"
+        logo: "assets/tools/buildbot.svg"
+        url: "https://git.immae.eu/buildbot/immaeEu/"
+        target: '_blank'
+      - name: "Adminer"
+        logo: "assets/tools/adminer.png"
+        url: "https://tools.immae.eu/adminer"
+        target: '_blank'
+      - name: "Release"
+        icon: "fas fa-running"
+        url: "https://release.immae.eu"
+        target: '_blank'
+  - name: "Immae"
+    icon: "fas fa-edit"
+    items:
+      - name: "Page principale"
+        icon: "fas fa-user"
+        url: "https://www.immae.eu"
+        target: '_blank'
+      - name: "Atelier d’écriture"
+        icon: "fas fa-pen"
+        url: "https://www.immae.eu/atelier"
+        target: '_blank'
+      - name: "Blog"
+        icon: "fas fa-blog"
+        url: "https://www.immae.eu/blog"
+        target: '_blank'
+      - name: "Recherche"
+        icon: "fas fa-search"
+        url: "https://www.immae.eu/recherche"
+        target: '_blank'
+      - name: "Cours"
+        icon: "fas fa-school"
+        url: "https://www.immae.eu/cours"
+        target: '_blank'
+      - name: "Recettes"
+        icon: "fas fa-utensils"
+        url: "https://www.immae.eu/recettes"
+        target: '_blank'
+      - name: "Chapeaux de Hamming"
+        icon: "fas fa-hat-cowboy-side"
+        url: "https://www.immae.eu/chapeaux"
+        target: '_blank'
+  - name: "Configuration"
+    icon: "fas fa-cog"
+    items:
+      - name: "Instant messaging"
+        url: "https://im.immae.fr"
+        target: '_blank'
+      - name: "E-mail"
+        url: "https://mail.immae.eu"
+        target: '_blank'
+      - name: "VPN"
+        url: "https://vpn.immae.eu"
+        target: '_blank'
+      - name: "Taskwarrior"
+        url: "https://task.immae.eu"
+        target: '_blank'
+      - name: "Dav"
+        url: "https://dav.immae.eu"
+        target: '_blank'
+      - name: "Dav acount"
+        url: "https://dav.immae.eu/davical"
+        target: '_blank'
+      - name: "Paste"
+        url: "https://tools.immae.eu/paste"
+        target: '_blank'
+      - name: "LDAP"
+        url: "https://tools.immae.eu/ldap"
+        target: '_blank'
+      - name: "Yourls"
+        url: "https://tools.immae.eu/url/admin/"
+        target: '_blank'
+      - name: "Change password"
+        url: "https://tools.immae.eu/ldap_password.php"
+        target: '_blank'
diff --git a/modules/private/websites/tools/tools/landing/icons/adminer.png b/modules/private/websites/tools/tools/landing/icons/adminer.png
new file mode 100644 (file)
index 0000000..f5923d8
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/adminer.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/buildbot.png b/modules/private/websites/tools/tools/landing/icons/buildbot.png
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/modules/private/websites/tools/tools/landing/icons/buildbot.svg b/modules/private/websites/tools/tools/landing/icons/buildbot.svg
new file mode 100644 (file)
index 0000000..4972a11
--- /dev/null
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" fill-rule="evenodd" aria-label="Nut" stroke-width="5" stroke="#000" stroke-linejoin="round">
+    <defs>
+        <linearGradient id="a" x1="61.3" x2="61.3" y1="31.7" y2="194.3" gradientTransform="matrix(1.28514 0 0 .76264 1.5 .5)" gradientUnits="userSpaceOnUse">
+            <stop offset="0%" stop-color="#8da6d8"/>
+            <stop offset="100%" stop-color="#2e5cb8"/>
+        </linearGradient>
+    </defs>
+    <path d="M10.7 205.4v-43l101.9 91.5v42.5z" fill="#24478f" stroke-width="4.9"/>
+    <path d="M112.7 254l139-33.7v43.2l-139 33.5v-43z" fill="#2e5cb8" stroke-width="4.9"/>
+    <path d="M251.8 220.3v43.2l37.2-125v-43z" fill="#193366" stroke-width="4.9"/>
+    <path d="M187.2 4L289 95.5l-37.2 124.8-139.2 33.5-101.8-91.4L48 37.5zm-3.5 72.6c32 16.7 43 53.6 24.4 82.5-18.4 28.8-59.6 38.7-91.8 22-32-16.5-43-53.6-24.4-82.4 18.3-28.9 59.4-38.9 91.7-22.2z" fill="#8da6d8" stroke-width="4.9"/>
+    <path d="M85.5 146a54.8 54.8 0 0 1 6-47.3c18.8-28.9 60-38.8 92-22 27.5 14.3 39.6 43.4 30.7 69.5a61.8 61.8 0 0 0-30.6-35c-32.2-16.6-73.4-6.7-92 22.2a57.4 57.4 0 0 0-6 12.8z" fill="url(#a)" stroke-width="4.9"/>
+</svg>
\ No newline at end of file
diff --git a/modules/private/websites/tools/tools/landing/icons/diaspora.png b/modules/private/websites/tools/tools/landing/icons/diaspora.png
new file mode 100644 (file)
index 0000000..7b23d5d
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/diaspora.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/dokuwiki.png b/modules/private/websites/tools/tools/landing/icons/dokuwiki.png
new file mode 100644 (file)
index 0000000..a1f4995
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/dokuwiki.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/etherpad.ico b/modules/private/websites/tools/tools/landing/icons/etherpad.ico
new file mode 100644 (file)
index 0000000..938e955
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/etherpad.ico differ
diff --git a/modules/private/websites/tools/tools/landing/icons/gitweb.png b/modules/private/websites/tools/tools/landing/icons/gitweb.png
new file mode 100644 (file)
index 0000000..4fa44bb
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/gitweb.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/grocy.png b/modules/private/websites/tools/tools/landing/icons/grocy.png
new file mode 100644 (file)
index 0000000..40be557
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/grocy.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/kanboard.png b/modules/private/websites/tools/tools/landing/icons/kanboard.png
new file mode 100644 (file)
index 0000000..51702e7
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/kanboard.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/mantisbt.png b/modules/private/websites/tools/tools/landing/icons/mantisbt.png
new file mode 100644 (file)
index 0000000..729e3ea
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/mantisbt.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/mastodon.png b/modules/private/websites/tools/tools/landing/icons/mastodon.png
new file mode 100644 (file)
index 0000000..b12aa55
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/mastodon.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/mgoblin.ico b/modules/private/websites/tools/tools/landing/icons/mgoblin.ico
new file mode 100644 (file)
index 0000000..ae5a1b1
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/mgoblin.ico differ
diff --git a/modules/private/websites/tools/tools/landing/icons/nextcloud.png b/modules/private/websites/tools/tools/landing/icons/nextcloud.png
new file mode 100644 (file)
index 0000000..6358068
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/nextcloud.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/peertube.png b/modules/private/websites/tools/tools/landing/icons/peertube.png
new file mode 100644 (file)
index 0000000..a42fce3
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/peertube.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/phpbb.ico b/modules/private/websites/tools/tools/landing/icons/phpbb.ico
new file mode 100644 (file)
index 0000000..bb61b89
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/phpbb.ico differ
diff --git a/modules/private/websites/tools/tools/landing/icons/rainloop.png b/modules/private/websites/tools/tools/landing/icons/rainloop.png
new file mode 100644 (file)
index 0000000..ce1dd1a
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/rainloop.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/rompr.png b/modules/private/websites/tools/tools/landing/icons/rompr.png
new file mode 100644 (file)
index 0000000..d7b63b1
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/rompr.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/roundcube.svg b/modules/private/websites/tools/tools/landing/icons/roundcube.svg
new file mode 100644 (file)
index 0000000..1f50dd8
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="9.14 141.8 573.65 573.65">
+<style type="text/css">
+.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#404F54;}
+.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#E5E5E5;}
+.st2{fill-rule:evenodd;clip-rule:evenodd;fill:#CCCCCC;}
+.st3{fill-rule:evenodd;clip-rule:evenodd;fill:#37BEFF;}
+</style>
+<polygon class="st3" points="582.79,549.77 295.96,384.1 295.96,207.27 582.79,372.95 "/>
+<polygon class="st0" points="9.14,549.77 295.96,384.1 295.96,207.27 9.14,372.95 "/>
+<path class="st2" d="M295.96,141.8c109.56,0,198.41,88.85,198.41,198.41c0,109.56-88.85,198.41-198.41,198.41 c-109.56,0-198.41-88.85-198.41-198.41C97.55,230.65,186.4,141.8,295.96,141.8"/>
+<path class="st1" d="M295.96,141.8c109.6,0,198.48,88.85,198.48,198.41c0,109.56-88.88,198.41-198.48,198.41      c-62.91-42.34-88.94-127.64-88.94-198.3S233.05,184.22,295.96,141.8"/>
+<polygon class="st3" points="582.79,372.95 295.96,538.62 295.96,715.45 582.79,549.77 "/>
+<polygon class="st0" points="9.14,372.95 295.96,538.62 295.96,715.45 9.14,549.77 "/>
+</svg>
diff --git a/modules/private/websites/tools/tools/landing/icons/shaarli.png b/modules/private/websites/tools/tools/landing/icons/shaarli.png
new file mode 100644 (file)
index 0000000..f29210c
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/shaarli.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/ttrss.png b/modules/private/websites/tools/tools/landing/icons/ttrss.png
new file mode 100644 (file)
index 0000000..97437d2
Binary files /dev/null and b/modules/private/websites/tools/tools/landing/icons/ttrss.png differ
diff --git a/modules/private/websites/tools/tools/landing/icons/wallabag.svg b/modules/private/websites/tools/tools/landing/icons/wallabag.svg
new file mode 100644 (file)
index 0000000..7b87fed
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path fill="none" d="M0 0h200v200H0z"/><path d="M75.899 72.438c1.597-.981 10.207-5.556 24.098.178 14.289 5.897 23.154.776 24.253.079-3.454-5.678-7.562-10.62-12.104-13.943.303-.083.612-.167.939-.263 6.023-1.742 7.553-6.842 7.875-11.21.364-4.954.616-5.03 1.692-9.487 1.032-4.281-.119-5.137-1.181-4.273-.572.465-5.552 1.616-8.505 3.919-4.768 3.72-7.707 10.794-9.039 14.706-.025.06-.205.604-.265.792-.621 1.498-1.857 1.494-1.857 1.494v.001c-.6-.065-1.202-.1-1.809-.1-.54 0-1.079.029-1.616.081-.012.002-.019 0-.031.001-1.581.233-2.45-1.697-2.632-2.157-1.847-5.304-6.816-15.763-17.984-18.577 0 0-2.028-1.554-1.41 1.074.588 2.511 1.804 5.049 1.534 8.741-.124 1.704-1.181 10.442 6.85 14.99.763.432 1.441.795 2.051 1.101-4.042 3.235-7.716 7.74-10.859 12.853zM128.626 152.353c-9.842-6.098-13.153-8.242-12.946-10.575 0 0 .002-.379.099-.957.239-1.236.995-3.348 3.407-4.552.079-.039.146-.084.208-.129 7.668-4.45 13.27-11.614 15.246-20.56-1.99 4.941-16.735 8.78-34.645 8.78-17.903 0-32.651-3.839-34.641-8.78.442 2.008 1.073 3.923 1.864 5.742.666 3.745 1.562 12.563-2.673 20.282-3.731 6.8-22.15 16.069-49.485 10.748 0 0-1.096-.766-1.428-.136-.491.932 1.517 1.685 3.583 2.229 19.031 5.04 47.756 2.989 56.777-4.443 4.116-3.388 5.704-7.953 6.107-12.865l.003.008s.11-1.287 1.719-.32c.461.277 2.125 1.36 2.39 2.585.232 1.743.248 3.883-.652 5.382-1.287 2.144-1.301 2.452.393 3.662 1.04.742 5.287 3.864 11.198 7.415.015.01.023.019.038.027 1.25.753 2.987 2.597 2.987 2.597 2.662 3.079 8.452 9.275 10.972 8.108 1.19-.551-.051-3.032-.051-3.032s1.98 2.571 3.043 1.694c.809-.668-.473-3.229-.473-3.229s1.729 1.499 2.757.944c1.258-.679-.187-4.614-10.079-10.627-9.896-6.018-12.578-6.94-12.814-9.626 0 0-.004-.135.004-.366.077-.593.414-1.847 1.852-1.712 2.141.346 4.348.531 6.608.531 2.587 0 5.107-.237 7.536-.69l.001.003s.127-.025.164-.031c.284-.036.838-.018.84.671-.09.873-.331 1.751-.845 2.519-1.447 2.168-.972 2.466.54 3.859.933.859 5.211 4.622 11.07 8.264.012.009.017.016.031.023 1.249.752 3.41 2.816 3.41 2.816v-.001c2.428 2.466 6.894 6.596 9.327 6.347 1.646-.168.306-3.002.306-3.002s2.078 2.006 3.099 1.416c1.142-.659-.474-2.755-.474-2.755s1.338.708 2.283.473c.948-.236 1.185-2.644-8.656-8.737z"/><path d="M117.631 83.452c-1.181 0-2.161.355-2.912 1.057-.76.71-1.144 1.531-1.144 2.438v16.056c0 2.154-.382 3.742-1.135 4.721-.728.946-1.892 1.406-3.556 1.406-1.703 0-2.863-.457-3.549-1.396-.716-.979-1.078-2.571-1.078-4.731V86.884c0-1.098-.5-1.996-1.448-2.596-1.289-.812-2.57-1.105-4.129-.587-.476.159-.924.366-1.333.615-.435.265-.802.597-1.093.985-.322.432-.486.901-.486 1.396v16.307c0 2.158-.363 3.75-1.079 4.73-.688.939-1.849 1.396-3.548 1.396-1.705 0-2.877-.459-3.584-1.401-.734-.979-1.107-2.57-1.107-4.726V86.947c0-.908-.384-1.728-1.145-2.438-.751-.702-1.751-1.057-2.973-1.057-1.258 0-2.296.352-3.085 1.045-.811.71-1.222 1.535-1.222 2.45v15.806c0 1.988.194 3.869.575 5.588.393 1.758 1.077 3.3 2.035 4.586.968 1.299 2.282 2.323 3.906 3.05 1.607.716 3.617 1.079 5.975 1.079 2.457 0 4.515-.455 6.115-1.354 1.342-.754 2.473-1.744 3.371-2.951.866 1.207 1.971 2.197 3.294 2.95 1.58.899 3.669 1.354 6.211 1.354 2.357 0 4.359-.364 5.947-1.081 1.601-.726 2.902-1.751 3.872-3.048.96-1.29 1.645-2.833 2.034-4.586.381-1.719.575-3.6.575-5.588V86.947c0-.911-.398-1.733-1.184-2.445-.767-.697-1.818-1.05-3.12-1.05z"/></svg>
diff --git a/modules/private/websites/tools/tools/landing/ldap_password.php b/modules/private/websites/tools/tools/landing/ldap_password.php
new file mode 100644 (file)
index 0000000..54448a4
--- /dev/null
@@ -0,0 +1,137 @@
+<?php
+
+/**
+ *   LDAP PHP Change Password Webpage
+ *   @author:   Matt Rude <http://mattrude.com>
+ *   @website:  http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
+ *
+ *
+ *              GNU GENERAL PUBLIC LICENSE
+ *                 Version 2, June 1991
+ *
+ * Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Everyone is permitted to copy and distribute verbatim copies
+ * of this license document, but changing it is not allowed.
+ */
+
+$message = array();
+$message_css = "";
+
+function changePassword($user,$oldPassword,$newPassword,$newPasswordCnf){
+  global $message;
+  global $message_css;
+
+  $server = "ldaps://ldap.immae.eu";
+
+  error_reporting(0);
+  $con = ldap_connect($server);
+  ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3);
+
+  $user_dn = "uid=$user,ou=users,dc=immae,dc=eu";
+
+  if (ldap_bind($con, $user_dn, $oldPassword) === false) {
+    $message[] = "Error E101 - Current Username or Password is wrong.";
+    return false;
+  }
+  if ($newPassword != $newPasswordCnf ) {
+    $message[] = "Error E102 - Your New passwords do not match!";
+    return false;
+  }
+  if (strlen($newPassword) < 6 ) {
+    $message[] = "Error E103 - Your new password is too short.<br/>Your password must be at least 6 characters long.";
+    return false;
+  }
+
+  $salt = substr(str_shuffle(str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',4)),0,4); 
+  $encoded_newPassword = "{SSHA}" . base64_encode(pack("H*", sha1($newPassword.$salt)).$salt);
+
+  $user_search = ldap_search($con,"dc=immae,dc=eu","(uid=$user)");
+  $auth_entry = ldap_first_entry($con, $user_search);
+
+  $mail_addresses = ldap_get_values($con, $auth_entry, "mail");
+  $given_names = ldap_get_values($con, $auth_entry, "givenName");
+  $mail_address = $mail_addresses[0];
+  $first_name = $given_names[0];
+
+  /* And Finally, Change the password */
+  $entry = array();
+  $entry["userPassword"] = "$encoded_newPassword";
+
+  if (ldap_modify($con,$user_dn,$entry) === false){
+    $error = ldap_error($con);
+    $errno = ldap_errno($con);
+    $message[] = "E201 - Your password cannot be changed, please contact the administrator.";
+    $message[] = "$errno - $error";
+  } else {
+    $message_css = "yes";
+    mail($mail_address,"Password change notice","Dear $first_name,
+Your password on https://tools.immae.eu/ldap_password.php for account $user was just changed.
+If you did not make this change, please contact me.
+If you were the one who changed your password, you may disregard this message.
+
+Thanks
+-- 
+Immae / Ismaël", "From: " . getenv("CONTACT_EMAIL"));
+    $message[] = "The password for $user has been changed.<br/>An informational email has been sent to $mail_address.<br/>Your new password is now fully active.";
+  }
+}
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>Password Change Page</title>
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css" integrity="sha256-2YQRJMXD7pIAPHiXr0s+vlRWA7GYJEK0ARns7k2sbHY=" crossorigin="anonymous" />
+<style type="text/css">
+  body { font-family: Verdana,Arial,Courier New; margin: auto; }
+
+  .msg_yes { margin: 0 auto; text-align: center; color: green; background: #D4EAD4; border: 1px solid green; border-radius: 10px; margin: 2px; }
+  .msg_no { margin: 0 auto; text-align: center; color: red; background: #FFF0F0; border: 1px solid red; border-radius: 10px; margin: 2px; }
+</style>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+</head>
+<body>
+<div class="container">
+<form action="<?php print $_SERVER['PHP_SELF']; ?>" name="passwordChange" method="post">
+<h3>Password Change Page</h3>
+<?php
+if (isset($_POST["submitted"])) {
+  echo '<div class="row">';
+  changePassword($_POST['username'],$_POST['oldPassword'],$_POST['newPassword1'],$_POST['newPassword2']);
+  global $message_css;
+  if ($message_css == "yes") {
+    echo '<div class="msg_yes">';
+  } else {
+    echo '<div class="msg_no">';
+    $message[] = "Your password was not changed.";
+  }
+  foreach ( $message as $one ) { echo "<p>$one</p>"; }
+  ?></div></div><?php
+} ?>
+  <div class="row">
+    <div class="one-third column"><label for="username">Username</label></div>
+    <div class="two-thirds column"><input id="username" name="username" type="text" autocomplete="off" /></div>
+  </div>
+  <div class="row">
+    <div class="one-third column"><label for="oldPassword">Current password</label></div>
+    <div class="two-thirds column"><input id="oldPassword" name="oldPassword" type="password" /></div>
+  </div>
+  <div class="row">
+    <div class="one-third column"><label for="newPassword1">New password</label></div>
+    <div class="two-thirds column"><input id="newPassword1" name="newPassword1" type="password" /></div>
+  </div>
+  <div class="row">
+    <div class="one-third column"><label for="newPassword2">New password (again)</label></div>
+    <div class="two-thirds column"><input id="newPassword2" name="newPassword2" type="password" /></div>
+  </div>
+  <div class="row">
+    <div class="column">
+      <input name="submitted" type="submit" value="Change Password"/>
+    </div>
+  </div>
+</form>
+</div>
+</body>
+</html>
diff --git a/modules/private/websites/tools/tools/landing/myip.php b/modules/private/websites/tools/tools/landing/myip.php
new file mode 100644 (file)
index 0000000..9ec1c6c
--- /dev/null
@@ -0,0 +1 @@
+<?php echo $_SERVER['REMOTE_ADDR']; ?>
diff --git a/modules/private/websites/tools/tools/webhooks.nix b/modules/private/websites/tools/tools/webhooks.nix
new file mode 100644 (file)
index 0000000..885b68b
--- /dev/null
@@ -0,0 +1,10 @@
+{ lib, env }:
+{
+  keys = lib.attrsets.mapAttrsToList (k: v: {
+    dest = "webapps/webhooks/${k}.php";
+    user = "wwwrun";
+    group = "wwwrun";
+    permissions = "0400";
+    text = v;
+  }) env;
+}