aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-08-23 07:15:11 -0300
committerEuAndreh <eu@euandre.org>2020-08-23 07:15:11 -0300
commitffa42deab1068d341d091274892b242b14932c2a (patch)
treeb236d77890aa8f123e18b306277a661b17aed53d
parentRename data-folder-init systemd service (diff)
downloadserver-ffa42deab1068d341d091274892b242b14932c2a.tar.gz
server-ffa42deab1068d341d091274892b242b14932c2a.tar.xz
Serve favicon from repo in cgit
-rw-r--r--TODOs.org1
-rw-r--r--favicons/git.icobin0 -> 6518 bytes
-rwxr-xr-xnixos-switch.sh1
-rw-r--r--vps-configuration.env.nix13
4 files changed, 11 insertions, 4 deletions
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
--- /dev/null
+++ b/favicons/git.ico
Binary files 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}" = {