teliotortayProd = ./websites/telio_tortay/production.nix;
# Tools
+ assetsTools = ./websites/tools/assets;
cloudTool = ./websites/tools/cloud;
commentoTool = ./websites/tools/commento;
davTool = ./websites/tools/dav;
type = submodule {
options = {
contact = mkOption { type = str; description = "Contact e-mail address"; };
+ assets = mkOption {
+ default = {};
+ type = attrsOf (submodule {
+ options = {
+ url = mkOption { type = str; description = "URL to fetch"; };
+ sha256 = mkOption { type = str; description = "Hash of the url"; };
+ };
+ });
+ description = "Assets to provide on assets.immae.eu";
+ };
davical = mkOption {
description = "Davical configuration";
type = submodule {
SLACK_CHANNEL="$1"
SLACK_USERNAME="Naemon"
SLACK_URL="$2"
-SLACK_USERICON="https://release.immae.eu/monitoring.png"
+SLACK_USERICON="https://assets.immae.eu/monitoring.png"
if [ "$SERVICESTATE" = "CRITICAL" ]; then
ICON=":exclamation:"
telio_tortay.production.enable = true;
+ tools.assets.enable = true;
tools.cloud.enable = true;
tools.commento.enable = true;
tools.dav.enable = true;
<head>
<title>Pause</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
- <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.bundle.min.js" integrity="sha256-TQq84xX6vkwR0Qs1qH5ADkP+MvH0W+9E7TdHJsoIQiM=" crossorigin="anonymous"></script>
- <script src="https://cdn.jsdelivr.net/npm/hammerjs@2.0.8"></script>
- <script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-zoom@0.7.7"></script>
+ <script src="https://assets.immae.eu/jquery/3.5.1/jquery.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
+ <script src="https://assets.immae.eu/chart.js/2.9.3/Chart.bundle.min.js" integrity="sha256-TQq84xX6vkwR0Qs1qH5ADkP+MvH0W+9E7TdHJsoIQiM=" crossorigin="anonymous"></script>
+ <script src="https://assets.immae.eu/hammerjs/2.0.8/hammer.min.js" integrity="sha256-eVNjHw5UeU0jUqPPpZHAkU1z4U+QFBBY488WvueTm88=" crossorigin="anonymous"></script>
+ <script src="https://assets.immae.eu/chartjs-plugin-zoom/0.7.7/chartjs-plugin-zoom.min.js" integrity="sha256-6S7w9Wue7EBvlJh/Li/cPecjTNN+yBm/AoCePQA9Xi8=" crossorigin="anonymous"></script>
<style>
body {
padding-left: 5px;
--- /dev/null
+{ lib, pkgs, config, ... }:
+let
+ cfg = config.myServices.websites.tools.assets;
+ assets_urls = lib.mapAttrs (k: v: pkgs.fetchurl v) config.myEnv.tools.assets;
+ assets = pkgs.runCommand "assets" {} (''
+ mkdir -p $out
+ cp -a ${./static}/* $out/
+ '' + builtins.concatStringsSep "\n"
+ (lib.mapAttrsToList (k: v: ''
+ install -D -m644 -T ${v} $out/${k}
+ '') assets_urls));
+in
+{
+ options.myServices.websites.tools.assets = {
+ enable = lib.mkEnableOption "Enable assets website";
+ };
+ config = lib.mkIf cfg.enable {
+ services.websites.env.tools.vhostConfs.assets = {
+ certName = "eldiron";
+ addToCerts = true;
+ hosts = [ "assets.immae.eu" ];
+ root = assets;
+ extraConfig = [
+ ''
+ Use Apaxy "${assets}" "title"
+ <Directory "${assets}">
+ Options Indexes FollowSymlinks
+ AllowOverride None
+ Require all granted
+ Header always set Last-Modified "Tue, 01 Jan 2020 00:00:00 GMT"
+ Header always set Cache-Control "public, max-age=31536000, immutable"
+ Header always set Access-Control-Allow-Origin "*"
+ Header always set Access-Control-Expose-Headers "*"
+ </Directory>
+ ''
+ ];
+ };
+ };
+}
</table>
</div>
- <script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script>
+ <script src="https://assets.immae.eu/vue/2.6.11/vue.min.js" integrity="sha256-ngFW3UnAN0Tnm76mDuu7uUtYEcG3G5H1+zioJw3t+68=" crossorigin="anonymous"></script>
<script src="app.js"></script>
</body>
<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" />
+<link rel="stylesheet" href="https://assets.immae.eu/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; }