aboutsummaryrefslogtreecommitdiff
path: root/systems/eldiron/websites/assets
diff options
context:
space:
mode:
Diffstat (limited to 'systems/eldiron/websites/assets')
-rw-r--r--systems/eldiron/websites/assets/default.nix98
-rw-r--r--systems/eldiron/websites/assets/static/favicon.pngbin0 -> 1734 bytes
-rw-r--r--systems/eldiron/websites/assets/static/logger.pngbin0 -> 3340 bytes
-rw-r--r--systems/eldiron/websites/assets/static/logger.txt3
-rw-r--r--systems/eldiron/websites/assets/static/logo.jpgbin0 -> 6931 bytes
-rw-r--r--systems/eldiron/websites/assets/static/logo.txt7
-rw-r--r--systems/eldiron/websites/assets/static/logo_big.jpgbin0 -> 16390 bytes
-rw-r--r--systems/eldiron/websites/assets/static/logo_big.txt7
-rw-r--r--systems/eldiron/websites/assets/static/logo_center.jpgbin0 -> 29509 bytes
-rw-r--r--systems/eldiron/websites/assets/static/logo_center.txt8
-rw-r--r--systems/eldiron/websites/assets/static/monitoring.pngbin0 -> 57395 bytes
-rw-r--r--systems/eldiron/websites/assets/static/monitoring.txt3
-rw-r--r--systems/eldiron/websites/assets/static/photos/ct.jpgbin0 -> 55914 bytes
-rw-r--r--systems/eldiron/websites/assets/static/photos/fretlink.jpgbin0 -> 1520106 bytes
-rw-r--r--systems/eldiron/websites/assets/static/photos/raton.jpgbin0 -> 17614 bytes
15 files changed, 126 insertions, 0 deletions
diff --git a/systems/eldiron/websites/assets/default.nix b/systems/eldiron/websites/assets/default.nix
new file mode 100644
index 0000000..02a4952
--- /dev/null
+++ b/systems/eldiron/websites/assets/default.nix
@@ -0,0 +1,98 @@
1{ lib, pkgs, config, ... }:
2let
3 cfg = config.myServices.websites.tools.assets;
4 fetchFont = v: pkgs.runCommand "fetch-font" {
5 outputHashAlgo = "sha256";
6 outputHashMode = "recursive";
7 outputHash = v.sha256;
8 } ''
9 mkdir -p $out
10 ${pkgs.curl}/bin/curl -k --output $out/font.css -H "User-Agent: Firefox/100.0" "${v.url}"
11 cat $out/font.css | grep -o "https://[^ )]*" | while read url; do
12 filename=$(echo "$url" | sed -e "s@.*/@@g")
13 ${pkgs.curl}/bin/curl -k --output "$out/$filename" "$url"
14 sed -i -e "s@$url@./$filename@" "$out/font.css"
15 done
16 '';
17 fetchTgz = v: pkgs.runCommand "fetch-tgz" {
18 outputHashAlgo = "sha256";
19 outputHashMode = "recursive";
20 outputHash = v.sha256;
21 } ''
22 mkdir -p $out
23 cd $out
24 ${pkgs.curl}/bin/curl -L -k "${v.url}" | tar -xz --strip-components=${builtins.toString v.tgzRemoveComponents}
25 '';
26 fetchAsset = v:
27 if v.assetType == "googleFont"
28 then fetchFont v
29 else if v.assetType == "tgz"
30 then fetchTgz v
31 else pkgs.fetchurl { url = v.url; sha256 = v.sha256; };
32 assets_urls = lib.mapAttrs (k: fetchAsset) config.myEnv.tools.assets;
33 assets = pkgs.runCommand "assets" {} (''
34 mkdir -p $out
35 cp -a ${./static}/* $out/
36 '' + builtins.concatStringsSep "\n"
37 (lib.mapAttrsToList (k: v: ''
38 if [ -d "${v}" ]; then
39 mkdir -p "$out/$(dirname "${k}")"
40 cp -a "${v}" "$out/${k}"
41 chmod -R u+rwX "$out/${k}"
42 else
43 install -D -m644 -T "${v}" "$out/${k}"
44 fi
45 '') assets_urls));
46in
47{
48 options.myServices.websites.tools.assets = {
49 enable = lib.mkEnableOption "Enable assets website";
50 };
51 config = lib.mkIf cfg.enable {
52 myServices.dns.zones."immae.eu".subdomains.assets =
53 with config.myServices.dns.helpers; ips servers.eldiron.ips.main;
54
55 services.websites.env.production.bindMounts."/run/imgproxy" = {};
56 security.acme.certs.eldiron.extraDomainNames = [ "assets.immae.eu" ];
57 services.websites.env.tools.vhostConfs.assets = {
58 certName = "eldiron";
59 hosts = [ "assets.immae.eu" ];
60 root = assets;
61 extraConfig = [
62 ''
63 Use Apaxy "${assets}" "title"
64 <Directory "${assets}">
65 Options Indexes FollowSymlinks
66 AllowOverride None
67 Require all granted
68 Header always set Last-Modified "Tue, 01 Jan 2020 00:00:00 GMT"
69 Header always set Cache-Control "public, max-age=31536000, immutable"
70 Header always set Access-Control-Allow-Origin "*"
71 Header always set Access-Control-Expose-Headers "*"
72 </Directory>
73
74 MergeSlashes OFF
75 <Location /p>
76 ProxyPass unix:///run/imgproxy/imgproxy.sock|http://assets.immae.eu
77 ProxyPassReverse unix:///run/imgproxy/imgproxy.sock|http://assets.immae.eu
78 </Location>
79 ''
80 ];
81 };
82 systemd.services.imgproxy = {
83 description = "IMG proxy";
84 wantedBy = [ "multi-user.target" ];
85
86 environment = {
87 IMGPROXY_NETWORK = "unix";
88 IMGPROXY_BIND = "%t/imgproxy/imgproxy.sock";
89 };
90 serviceConfig = {
91 User = "wwwrun";
92 Group = "wwwrun";
93 RuntimeDirectory = "imgproxy";
94 ExecStart = "${pkgs.imgproxy}/bin/imgproxy";
95 };
96 };
97 };
98}
diff --git a/systems/eldiron/websites/assets/static/favicon.png b/systems/eldiron/websites/assets/static/favicon.png
new file mode 100644
index 0000000..1caf5a4
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/favicon.png
Binary files differ
diff --git a/systems/eldiron/websites/assets/static/logger.png b/systems/eldiron/websites/assets/static/logger.png
new file mode 100644
index 0000000..d9579fb
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/logger.png
Binary files differ
diff --git a/systems/eldiron/websites/assets/static/logger.txt b/systems/eldiron/websites/assets/static/logger.txt
new file mode 100644
index 0000000..50dccc6
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/logger.txt
@@ -0,0 +1,3 @@
1Downloaded from https://commons.wikimedia.org/wiki/File:Ghost2.svg
2Licence Creative Commons Attribution-Share Alike 4.0 International
3https://creativecommons.org/licenses/by-sa/4.0/deed.en
diff --git a/systems/eldiron/websites/assets/static/logo.jpg b/systems/eldiron/websites/assets/static/logo.jpg
new file mode 100644
index 0000000..a89172d
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/logo.jpg
Binary files differ
diff --git a/systems/eldiron/websites/assets/static/logo.txt b/systems/eldiron/websites/assets/static/logo.txt
new file mode 100644
index 0000000..327e62a
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/logo.txt
@@ -0,0 +1,7 @@
1size: 2
2dpi: 72
3background: white
4plot_type: fullcolor
5center: "whole"
6whitespace: 0.5
7format: jpg
diff --git a/systems/eldiron/websites/assets/static/logo_big.jpg b/systems/eldiron/websites/assets/static/logo_big.jpg
new file mode 100644
index 0000000..45448f2
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/logo_big.jpg
Binary files differ
diff --git a/systems/eldiron/websites/assets/static/logo_big.txt b/systems/eldiron/websites/assets/static/logo_big.txt
new file mode 100644
index 0000000..ce92c09
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/logo_big.txt
@@ -0,0 +1,7 @@
1size: 4
2dpi: 72
3background: white
4plot_type: fullcolor
5center: "whole"
6whitespace: 0.5
7format: jpg
diff --git a/systems/eldiron/websites/assets/static/logo_center.jpg b/systems/eldiron/websites/assets/static/logo_center.jpg
new file mode 100644
index 0000000..6b177e0
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/logo_center.jpg
Binary files differ
diff --git a/systems/eldiron/websites/assets/static/logo_center.txt b/systems/eldiron/websites/assets/static/logo_center.txt
new file mode 100644
index 0000000..60a8f1c
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/logo_center.txt
@@ -0,0 +1,8 @@
1size: 4
2dpi: 72
3background: white
4plot_type: fullcolor
5center: "center"
6whitespace: 0.5
7format: jpg
8
diff --git a/systems/eldiron/websites/assets/static/monitoring.png b/systems/eldiron/websites/assets/static/monitoring.png
new file mode 100644
index 0000000..0024fee
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/monitoring.png
Binary files differ
diff --git a/systems/eldiron/websites/assets/static/monitoring.txt b/systems/eldiron/websites/assets/static/monitoring.txt
new file mode 100644
index 0000000..9f3e13a
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/monitoring.txt
@@ -0,0 +1,3 @@
1Downloaded from https://commons.wikimedia.org/wiki/File:Magnifying_Glass2.svg
2Licence Creative Commons CC0 1.0 Universal Public Domain Dedication
3https://creativecommons.org/publicdomain/zero/1.0/deed.en
diff --git a/systems/eldiron/websites/assets/static/photos/ct.jpg b/systems/eldiron/websites/assets/static/photos/ct.jpg
new file mode 100644
index 0000000..ab7876b
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/photos/ct.jpg
Binary files differ
diff --git a/systems/eldiron/websites/assets/static/photos/fretlink.jpg b/systems/eldiron/websites/assets/static/photos/fretlink.jpg
new file mode 100644
index 0000000..c941e1d
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/photos/fretlink.jpg
Binary files differ
diff --git a/systems/eldiron/websites/assets/static/photos/raton.jpg b/systems/eldiron/websites/assets/static/photos/raton.jpg
new file mode 100644
index 0000000..a859e1c
--- /dev/null
+++ b/systems/eldiron/websites/assets/static/photos/raton.jpg
Binary files differ