From ffa42deab1068d341d091274892b242b14932c2a Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 23 Aug 2020 07:15:11 -0300 Subject: Serve favicon from repo in cgit --- TODOs.org | 1 + favicons/git.ico | Bin 0 -> 6518 bytes nixos-switch.sh | 1 + vps-configuration.env.nix | 13 +++++++++---- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 favicons/git.ico diff --git a/TODOs.org b/TODOs.org index 97e2a96..d52ce20 100644 --- a/TODOs.org +++ b/TODOs.org @@ -45,6 +45,7 @@ resource "vultr_block_storage" "vps_storage" { ** TODO EteSync ** TODO Use =$SOMETHING_DOMAIN= instead of =$SOMETHING_TLD= ** TODO Create less certificates +** TODO Bundle favicons instead of separate rsync * Services - v2 ** DONE =cloud.$tld=: Nextcloud: storage, calendar, contacts, notes and talk CLOSED: [2020-08-14 ven. 09:29] diff --git a/favicons/git.ico b/favicons/git.ico new file mode 100644 index 0000000..145b4b0 Binary files /dev/null and b/favicons/git.ico differ diff --git a/nixos-switch.sh b/nixos-switch.sh index 2ef7533..12a7dfe 100755 --- a/nixos-switch.sh +++ b/nixos-switch.sh @@ -7,6 +7,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")" envsubst < vps-configuration.env.nix | ssh "$TLD" 'cat > /etc/nixos/configuration.nix' echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S nix-channel --add "https://nixos.org/channels/nixos-${SYSTEM_STATE_VERSION}" nixos echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S -i nixos-rebuild switch --upgrade +rsync -avzP favicons/ "${TLD}:${DATA_ROOT}/favicons/" # Ugly hack to change TLS certificates permissions echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S "\ diff --git a/vps-configuration.env.nix b/vps-configuration.env.nix index 56f2c56..3f99e1a 100644 --- a/vps-configuration.env.nix +++ b/vps-configuration.env.nix @@ -108,9 +108,14 @@ in { "${envsubstConfiguration.gitTLD}" = { forceSSL = true; enableACME = true; - locations."/" = { - proxyPass = "http://localhost:${envsubstConfiguration.gitPort}"; - }; + extraConfig = '' + location = /favicon.ico { + alias ${envsubstConfiguration.dataRoot}/favicons/git.ico; + } + location / { + proxy_pass http://localhost:${envsubstConfiguration.gitPort}; + } + ''; }; "${envsubstConfiguration.bonecoTLD}" = { forceSSL = true; @@ -125,11 +130,11 @@ in { "${envsubstConfiguration.songbooksDocumentationTLD}" = { forceSSL = true; enableACME = true; - root = "${envsubstConfiguration.staticRoot}/songbooks/"; extraConfig = '' location = / { return 301 master/; } + root = ${envsubstConfiguration.staticRoot}/songbooks/; ''; }; "${envsubstConfiguration.prosodyTLD}" = { -- cgit v1.2.3