mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-16 07:57:01 +05:30
Decomission stats.msfjarvis.dev
This will always be inaccurate due to Cloudflare caching and hence not actually doing origin pulls Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
943b398f14
commit
bacb70c38f
5 changed files with 1 additions and 74 deletions
13
Caddyfile
13
Caddyfile
|
@ -120,16 +120,3 @@ https://staging.msfjarvis.dev {
|
||||||
404 404.html
|
404 404.html
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
https://stats.msfjarvis.dev {
|
|
||||||
import base_config
|
|
||||||
import compression_config
|
|
||||||
root /var/www/stats.msfjarvis.dev/
|
|
||||||
}
|
|
||||||
|
|
||||||
https://stats.msfjarvis.dev/ws {
|
|
||||||
import base_config
|
|
||||||
proxy / localhost:7890 {
|
|
||||||
websocket
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ Configuration files for various parts of my webserver
|
||||||
- [Caddyfile](Caddyfile): Configuration file for [caddyserver](https://caddyserver.com) instance that powers everything on my webserver.
|
- [Caddyfile](Caddyfile): Configuration file for [caddyserver](https://caddyserver.com) instance that powers everything on my webserver.
|
||||||
- [systemd-units](systemd_units): Systemd units for various custom services I have on the webserver.
|
- [systemd-units](systemd_units): Systemd units for various custom services I have on the webserver.
|
||||||
- [caddy.service](systemd_units/caddy.service): Unit for the caddyserver instance that powers everything.
|
- [caddy.service](systemd_units/caddy.service): Unit for the caddyserver instance that powers everything.
|
||||||
- [goaccess.service](systemd_units/goaccess.service): Unit for the [GoAccess](https://goaccess.io) instance that powers [stats.msfjarvis.dev](https://stats.msfjarvis.dev)
|
|
||||||
- [mirror-bot.service](systemd_units/mirror-bot.service), [mirror-bot-2.service](systemd_units/mirror-bot-2.service): Systemd units for my copies of [aria-telegram-mirror-bot](https://github.com/out386/aria-telegram-mirror-bot).
|
- [mirror-bot.service](systemd_units/mirror-bot.service), [mirror-bot-2.service](systemd_units/mirror-bot-2.service): Systemd units for my copies of [aria-telegram-mirror-bot](https://github.com/out386/aria-telegram-mirror-bot).
|
||||||
- [uno-bot.service](systemd_units/uno-bot.service): Service unit for the [mau_mau_bot](https://github.com/msfjarvis/mau_mau_bot) instance I run to play UNO with friends.
|
- [uno-bot.service](systemd_units/uno-bot.service): Service unit for the [mau_mau_bot](https://github.com/msfjarvis/mau_mau_bot) instance I run to play UNO with friends.
|
||||||
- [walls-bot.service](systemd_units/walls-bot.service): Unit for the [walls-bot](https://github.com/msfjarvis/walls-bot) instance I run for my desktop walls collections.
|
- [walls-bot.service](systemd_units/walls-bot.service): Unit for the [walls-bot](https://github.com/msfjarvis/walls-bot) instance I run for my desktop walls collections.
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Run goaccess every 10 minutes to update statistics
|
|
||||||
Requires=goaccess.service
|
|
||||||
|
|
||||||
[Timer]
|
|
||||||
Unit=goaccess.service
|
|
||||||
OnUnitInactiveSec=10m
|
|
||||||
RandomizedDelaySec=10m
|
|
||||||
AccuracySec=1s
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=timers.target
|
|
|
@ -1,31 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=goaccess: real-time web log analyzer
|
|
||||||
After=syslog.target
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
LimitMEMLOCK=infinity
|
|
||||||
LimitNOFILE=65535
|
|
||||||
RestartSec=2s
|
|
||||||
Type=simple
|
|
||||||
User=caddy
|
|
||||||
Group=caddy
|
|
||||||
ExecStart=/usr/bin/goaccess --log-format=VCOMMON --output=/var/www/stats.msfjarvis.dev/index.html --log-file=/etc/logs/requests.log --no-query-string --anonymize-ip --double-decode --real-os --compression=zlib
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
# Security
|
|
||||||
PrivateTmp=true
|
|
||||||
ProtectSystem=full
|
|
||||||
ProtectHome=true
|
|
||||||
NoNewPrivileges=true
|
|
||||||
ProtectControlGroups=true
|
|
||||||
ProtectKernelModules=true
|
|
||||||
ProtectKernelTunables=true
|
|
||||||
PrivateDevices=true
|
|
||||||
RestrictAddressFamilies=AF_INET AF_INET6
|
|
||||||
RestrictNamespaces=true
|
|
||||||
RestrictRealtime=true
|
|
||||||
SystemCallArchitectures=native
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
|
@ -8,8 +8,7 @@ function prettyPrint() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Grab all service names
|
# Grab all service names
|
||||||
declare -a services=('caddy' 'goaccess' 'mirror-bot' 'mirror-bot-2' 'uno-bot' 'pyrobud' 'walls-bot' 'walls-bot-rs')
|
declare -a services=('caddy' 'mirror-bot' 'mirror-bot-2' 'uno-bot' 'pyrobud' 'walls-bot' 'walls-bot-rs')
|
||||||
declare -a timers=('goaccess-update')
|
|
||||||
|
|
||||||
# Now loop through each service and install it
|
# Now loop through each service and install it
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
|
@ -30,18 +29,3 @@ for service in "${services[@]}"; do
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for timer in "${timers[@]}"; do
|
|
||||||
if [ "${1}" ] && [[ ${timer} != "${1}" && "${timer}.timer" != "${1}" ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
prettyPrint "Checking root access"
|
|
||||||
sudo -v || return 1
|
|
||||||
prettyPrint "Installing ${timer}"
|
|
||||||
sudo cp -v "${timer}.timer" /etc/systemd/system/
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
if [ -z "${NO_RESTART}" ]; then
|
|
||||||
prettyPrint "Enabling ${timer}"
|
|
||||||
sudo systemctl enable "${timer}.timer"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue