Compare commits

..

24 Commits

Author SHA1 Message Date
9d23147758 Add zstd precompression to bbaovanc.com 2024-12-13 23:08:44 -06:00
a2c85d9493 Add demo.bbaovanc.com/staging 2023-11-05 01:06:56 -05:00
481f2eab47 Remove links.boba.best 2023-06-18 00:50:04 -05:00
e90e69c611 Move redirects from Hugo to Caddy 2023-05-14 00:48:23 -05:00
a7076a3e3d Redirect /contact/ to main page 2023-05-14 00:29:08 -05:00
c511214a11 Remove some old domains 2023-04-04 17:54:55 -05:00
9f7055d054 Remove search 2023-01-13 21:21:58 -06:00
a04f3b54fc Add HSTS to www.bbaovanc.com 2023-01-07 20:51:15 -06:00
21dc225361 Remove the 404 redirect from gitea 2022-09-15 19:42:55 -05:00
3e4ae36359 Remove static assets from gitea 2022-07-13 18:18:17 -05:00
d97b572fa3 Remove forum.bbaovanc.com 2022-07-12 00:08:29 -05:00
a26b936989 Translate some urls in redirect from Gitea to GitHub 2022-06-20 19:48:42 -05:00
2ac6af6b5c Change github redirect to permanent 2022-06-20 16:31:09 -05:00
44312da34c Redirect 404's on git.bbaovanc.com/bbaovanc/* to GitHub 2022-06-20 16:22:31 -05:00
6e70a8750d Redirect boba.best and www.boba.best to bbaovanc.com 2022-05-24 23:08:09 -05:00
e9add61c7b Remove img.bbaovanc.com 2022-05-24 22:32:59 -05:00
dc48f2a971 Move links.bbaovanc.com to links.boba.best 2022-05-24 19:24:28 -05:00
85d45068ae Remove some old boba.best domains
dorito.boba.best is now replaced with a Cloudflare page rule
2022-05-23 14:55:28 -05:00
3279951295 Clean up a few more domains 2022-05-23 03:06:20 -05:00
024579aefe Clean up some old domains 2022-05-23 02:51:06 -05:00
7efc3cce37 Switch search.bbaovanc.com to SearXNG 2022-05-23 02:40:11 -05:00
1588eabd22 Change linkace.bbaovanc.com to links.bbaovanc.com 2022-05-22 23:00:45 -05:00
8d96cb6de2 Add linkace.bbaovanc.com 2022-05-20 23:29:19 -05:00
7c7191882e Remove worthless server side logging
I never used it because it's not very useful. Too much noise from bots,
crawlers, etc.
2022-05-20 22:56:37 -05:00
25 changed files with 48 additions and 298 deletions

2
.gitignore vendored
View File

@ -1,3 +1 @@
email email
errors/img

View File

@ -19,14 +19,4 @@
} }
import conf.d/* import conf.d/*
log {
output file /var/log/caddy/access.log {
roll_size 1GiB
roll_keep 5
roll_keep_for 168h
}
}
}
import conf.d/*
import conf.d/* import conf.d/*

View File

@ -1,17 +1,27 @@
# vim: ft=caddyfile # vim: ft=caddyfile
www.bbaovanc.com { www.bbaovanc.com, boba.best, www.boba.best {
redir https://bbaovanc.com{uri} import hsts
redir https://bbaovanc.com{uri} 308
} }
bbaovanc.com { bbaovanc.com {
import hsts import hsts
import log
redir /contact /
redir /contact/ /
redir /blog/links/ /links/
redir /blog/posts /blog/
redir /blog/posts/ /blog/
handle_path /blog/posts/* {
redir * /blog{uri}
}
redir /blog/sed-text-substitution-in-discord/ /blog/text-substitution-in-discord-using-sed/
header Cache-Control no-cache header Cache-Control no-cache
root * /var/www/bbaovanc.com/public root * /var/www/bbaovanc.com/public
file_server { file_server {
precompressed br gzip precompressed zstd br gzip
} }
import basicerrors import basicerrors

View File

@ -1,18 +0,0 @@
# vim: ft=caddyfile
www.brainman.org {
redir https://brainman.org{uri}
}
brainman.org {
import hsts
import log
header Cache-Control no-cache
root * /var/www/brainman.org/public
file_server {
precompressed br gzip
}
import basicerrors
}

View File

@ -1,11 +0,0 @@
# vim: ft=caddyfile
commento.bbaovanc.com {
encode zstd gzip
import hsts
import log
reverse_proxy localhost:83
import basicerrors
}

View File

@ -2,13 +2,21 @@
demo.bbaovanc.com { demo.bbaovanc.com {
import hsts import hsts
import log
header Cache-Control no-store
header X-Robots-Tag noindex
root * /var/www/demo.bbaovanc.com root * /var/www/demo.bbaovanc.com
file_server { handle /staging/* {
browse header Cache-Control no-cache
file_server {
browse
precompressed br gzip
}
}
handle {
header Cache-Control no-store
header X-Robots-Tag noindex
file_server {
browse
}
} }
import basicerrors import basicerrors

View File

@ -1,9 +0,0 @@
# vim: ft=caddyfile
dorito.boba.best {
encode zstd gzip
import hsts
import log
redir https://discord.gg/NZWzSCY5UE
import basicerrors
}

View File

@ -1,10 +0,0 @@
# vim: ft=caddyfile
errors.bbaovanc.com {
encode zstd gzip
import hsts
import log
root * /etc/caddy/errors/img
file_server
import basicerrors
}

View File

@ -1,15 +0,0 @@
# vim: ft=caddyfile
flower.boba.best {
encode zstd gzip
import hsts
import log
root * /var/www/flower.boba.best
handle {
rewrite * /flowerpet.gif
file_server
}
import basicerrors
}

View File

@ -1,22 +0,0 @@
# vim: ft=caddyfile
forum.bbaovanc.com {
encode zstd gzip
import hsts
import log
handle /app/* {
reverse_proxy localhost:2083
}
root * /var/www/forum.bbaovanc.com/public
php_fastcgi unix//run/php/php-fpm.sock
header /assets/* {
+Cache-Control "public, must-revalidate, proxy-revalidate"
+Cache-Control "max-age=25000"
Pragma "public"
}
file_server
import basicerrors
}

View File

@ -1,15 +0,0 @@
# vim: ft=caddyfile
furry.boba.best {
encode zstd gzip
import hsts
import log
root * /var/www/furry.boba.best
handle {
rewrite * /alien_furry.gif
file_server
}
import basicerrors
}

View File

@ -3,16 +3,23 @@
git.bbaovanc.com { git.bbaovanc.com {
encode zstd gzip encode zstd gzip
import hsts import hsts
import log
handle_path /_/static/assets/* {
root * /var/www/git.bbaovanc.com/public
file_server
}
handle { handle {
reverse_proxy localhost:81 { reverse_proxy localhost:81 {
header_up X-Real-IP {remote_host} header_up X-Real-IP {remote_host}
#@404 status 404
#handle_response @404 {
# handle /bbaovanc/* {
# root * /etc/caddy/github-redirect/
# rewrite * /index.php?uri={uri}
# php_fastcgi unix//run/php/php-fpm.sock
# }
# handle {
# copy_response
# }
#}
} }
} }

View File

@ -1,14 +0,0 @@
# vim: ft=caddyfile
img.bbaovanc.com {
encode zstd gzip
import hsts
import log
root * /var/www/img.bbaovanc.com
file_server {
browse
}
import basicerrors
}

View File

@ -3,7 +3,6 @@
isso.bbaovanc.com { isso.bbaovanc.com {
encode zstd gzip encode zstd gzip
import hsts import hsts
import log
reverse_proxy localhost:86 { reverse_proxy localhost:86 {
header_down Cache-Control no-cache header_down Cache-Control no-cache

View File

@ -1,11 +0,0 @@
# vim: ft=caddyfile
lhci.bbaovanc.com {
encode zstd gzip
import hsts
import log
reverse_proxy localhost:87
import basicerrors
}

View File

@ -1,11 +0,0 @@
# vim: ft=caddyfile
lists.bbaovanc.com {
encode zstd gzip
import hsts
import log
reverse_proxy localhost:85
import basicerrors
}

View File

@ -1,13 +0,0 @@
# vim: ft=caddyfile
media.bbaovanc.com {
encode zstd gzip
import hsts
import log
root * /var/www/media.bbaovanc.com
file_server {
browse
}
import basicerrors
}

View File

@ -3,7 +3,6 @@
plausible.bbaovanc.com { plausible.bbaovanc.com {
encode zstd gzip encode zstd gzip
import hsts import hsts
import log
rewrite /js/bobalytics.js /js/plausible.js rewrite /js/bobalytics.js /js/plausible.js
rewrite /js/bobalytics.outbound-links.js /js/plausible.outbound-links.js rewrite /js/bobalytics.outbound-links.js /js/plausible.outbound-links.js

View File

@ -1,13 +0,0 @@
# vim: ft=caddyfile
remark.bbaovanc.com {
encode zstd gzip
import hsts
import log
reverse_proxy localhost:82 {
header_up X-Real-IP {remote_host}
}
import basicerrors
}

View File

@ -1,9 +0,0 @@
# vim: ft=caddyfile
rick.bbaovanc.com, rick.boba.best {
encode zstd gzip
import hsts
import log
redir https://www.youtube.com/watch?v=dQw4w9WgXcQ temporary
import basicerrors
}

View File

@ -1,77 +0,0 @@
# vim: ft=caddyfile
search.bbaovanc.com {
encode zstd gzip
import hsts
@api {
path /config
path /status
}
@static {
path /static/*
}
@morty {
path /morty/*
}
@notmorty {
not path /morty/*
}
header {
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
# Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
X-Content-Type-Options "nosniff"
# Disallow the site to be rendered within a frame (clickjacking protection)
X-Frame-Options "SAMEORIGIN"
# Disable some features
Permissions-Policy "accelerometer=();ambient-light-sensor=(); autoplay=();camera=();encrypted-media=();focus-without-user-activation=(); geolocation=();gyroscope=();magnetometer=();microphone=();midi=();payment=();picture-in-picture=(); speaker=();sync-xhr=();usb=();vr=()"
# Disable some features (legacy)
Feature-Policy "accelerometer 'none';ambient-light-sensor 'none'; autoplay 'none';camera 'none';encrypted-media 'none';focus-without-user-activation 'none'; geolocation 'none';gyroscope 'none';magnetometer 'none';microphone 'none';midi 'none';payment 'none';picture-in-picture 'none'; speaker 'none';sync-xhr 'none';usb 'none';vr 'none'"
# Referer
Referrer-Policy "no-referrer"
# X-Robots-Tag
X-Robots-Tag "noindex, noarchive, nofollow"
}
header @api {
Access-Control-Allow-Methods "GET, OPTIONS"
Access-Control-Allow-Origin "*"
}
header @static {
#Cache-Control "public, max-age=31536000"
Cache-Control no-cache
defer
}
header @notmorty {
Content-Security-Policy "upgrade-insecure-requests; default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; form-action 'self'; font-src 'self'; frame-ancestors 'self'; base-uri 'self'; connect-src 'self' https://overpass-api.de; img-src 'self' data: https://*.tile.openstreetmap.org; frame-src https://www.youtube-nocookie.com https://player.vimeo.com https://www.dailymotion.com https://www.deezer.com https://www.mixcloud.com https://w.soundcloud.com https://embed.spotify.com"
}
handle @morty {
header Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline'; form-action 'self'; frame-ancestors 'self'; base-uri 'self'; img-src 'self' data:; font-src 'self'; frame-src 'self'"
reverse_proxy localhost:3000
}
handle {
reverse_proxy localhost:4040 {
header_up X-Forwarded-Port {http.request.port}
header_up X-Forwarded-TlsProto {tls_protocol}
header_up X-Forwarded-TlsCipher {tls_cipher}
header_up X-Forwarded-HttpsProto {proto}
}
}
import basicerrors
}

View File

@ -1,15 +0,0 @@
# vim: ft=caddyfile
stib.boba.best {
encode zstd gzip
import hsts
import log
root * /var/www/stib.boba.best
handle {
rewrite * /stib.gif
file_server
}
import basicerrors
}

View File

@ -1,5 +0,0 @@
#!/bin/sh -x
mkdir -p img/
cd img/
curl https://http.cat | grep -oE '[0-9]{3}\.jpg' | sort | uniq | parallel $@ 'wget -q https://http.cat/{} && echo "DL {}"'

View File

@ -2,7 +2,7 @@
{{ $text := placeholder "http.error.status_text" -}} {{ $text := placeholder "http.error.status_text" -}}
{{ $full_text := printf "%s %s" (placeholder "http.error.status_code") (placeholder "http.error.status_text") -}} {{ $full_text := printf "%s %s" (placeholder "http.error.status_code") (placeholder "http.error.status_text") -}}
{{ $host := placeholder "http.request.host" -}} {{ $host := placeholder "http.request.host" -}}
{{ $img_url := (printf "https://errors.bbaovanc.com/%s.jpg" $code) -}} {{ $img_url := (printf "https://http.cat/%s.jpg" $code) -}}
<html> <html>
<head> <head>
<title>{{ $full_text }}</title> <title>{{ $full_text }}</title>

View File

@ -0,0 +1,7 @@
<?php
$uri = $_GET["uri"];
$uri = preg_replace('/(\/bbaovanc\/.*?(?=\/))\/src\/(commit|branch)/', '$1/blob', $uri);
$uri = preg_replace('/(\/bbaovanc\/.*?(?=\/))\/(commits|blame)\/(branch|commit)/', '$1/$2', $uri);
header('Status: 301 Moved Permanently');
header('Location: https://github.com' . $uri);
?>