Compare commits
39 Commits
95ca67ba71
...
master
Author | SHA1 | Date | |
---|---|---|---|
76a4fbf214 | |||
5c60b243c5 | |||
c89756dbeb | |||
d982284ade | |||
1d27eaf2c9 | |||
637deb9395 | |||
9d23147758 | |||
a2c85d9493 | |||
481f2eab47 | |||
e90e69c611 | |||
a7076a3e3d | |||
c511214a11 | |||
9f7055d054 | |||
a04f3b54fc | |||
21dc225361 | |||
3e4ae36359 | |||
d97b572fa3 | |||
a26b936989 | |||
2ac6af6b5c | |||
44312da34c | |||
6e70a8750d | |||
e9add61c7b | |||
dc48f2a971 | |||
85d45068ae | |||
3279951295 | |||
024579aefe | |||
7efc3cce37 | |||
1588eabd22 | |||
8d96cb6de2 | |||
7c7191882e | |||
d7c8a425de | |||
e3227eb2a2 | |||
18a359987a | |||
099a3b4422 | |||
f9b9eaec4d | |||
17bf265c0e | |||
c5eda471ec | |||
57aceaf461 | |||
fb11fe0efb |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1 @@
|
||||
email
|
||||
|
||||
errors/img
|
||||
|
10
Caddyfile
10
Caddyfile
@ -19,14 +19,4 @@
|
||||
}
|
||||
|
||||
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/*
|
||||
|
@ -1,17 +1,28 @@
|
||||
# vim: ft=caddyfile
|
||||
|
||||
www.bbaovanc.com {
|
||||
redir https://bbaovanc.com{uri}
|
||||
www.bbaovanc.com, boba.best, www.boba.best {
|
||||
import hsts
|
||||
redir https://bbaovanc.com{uri} 308
|
||||
}
|
||||
|
||||
bbaovanc.com {
|
||||
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/
|
||||
redir /categories/tinkering/ /categories/experiments/
|
||||
|
||||
header Cache-Control no-cache
|
||||
root * /var/www/bbaovanc.com/public
|
||||
file_server {
|
||||
precompressed br gzip
|
||||
precompressed br zstd gzip
|
||||
}
|
||||
|
||||
import basicerrors
|
||||
|
@ -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
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
# vim: ft=caddyfile
|
||||
|
||||
commento.bbaovanc.com {
|
||||
encode zstd gzip
|
||||
import hsts
|
||||
import log
|
||||
|
||||
reverse_proxy localhost:83
|
||||
|
||||
import basicerrors
|
||||
}
|
@ -2,14 +2,41 @@
|
||||
|
||||
demo.bbaovanc.com {
|
||||
import hsts
|
||||
import log
|
||||
|
||||
header Cache-Control no-store
|
||||
header X-Robots-Tag noindex
|
||||
root * /var/www/demo.bbaovanc.com
|
||||
header X-Robots-Tag noindex
|
||||
|
||||
@index_pages path / /staging/ /test/ /pull_request/ /archive/
|
||||
handle @index_pages {
|
||||
header Cache-Control no-store
|
||||
header boba-handle indices
|
||||
file_server {
|
||||
browse {
|
||||
sort time desc
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handle /staging/* {
|
||||
header Cache-Control no-cache
|
||||
header boba-handle staging
|
||||
file_server {
|
||||
precompressed br zstd gzip
|
||||
}
|
||||
}
|
||||
|
||||
@test_sites path /test/* /pull_request/*
|
||||
handle @test_sites {
|
||||
header Cache-Control no-store
|
||||
header boba-handle test
|
||||
file_server {
|
||||
browse
|
||||
}
|
||||
}
|
||||
|
||||
handle {
|
||||
respond fallback
|
||||
}
|
||||
|
||||
import basicerrors
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
# vim: ft=caddyfile
|
||||
|
||||
drone.bbaovanc.com {
|
||||
encode zstd gzip
|
||||
import hsts
|
||||
import log
|
||||
|
||||
reverse_proxy localhost:8080 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
|
||||
import basicerrors
|
||||
}
|
@ -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
|
||||
}
|
@ -3,16 +3,23 @@
|
||||
git.bbaovanc.com {
|
||||
encode zstd gzip
|
||||
import hsts
|
||||
import log
|
||||
|
||||
handle_path /_/static/assets/* {
|
||||
root * /var/www/git.bbaovanc.com/public
|
||||
file_server
|
||||
}
|
||||
|
||||
handle {
|
||||
reverse_proxy localhost:81 {
|
||||
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
|
||||
# }
|
||||
#}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
12
conf.d/isso.bbaovanc.com
Normal file
12
conf.d/isso.bbaovanc.com
Normal file
@ -0,0 +1,12 @@
|
||||
# vim: ft=caddyfile
|
||||
|
||||
isso.bbaovanc.com {
|
||||
encode zstd gzip
|
||||
import hsts
|
||||
|
||||
reverse_proxy localhost:86 {
|
||||
header_down Cache-Control no-cache
|
||||
}
|
||||
|
||||
import basicerrors
|
||||
}
|
@ -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
|
||||
}
|
@ -3,11 +3,15 @@
|
||||
plausible.bbaovanc.com {
|
||||
encode zstd gzip
|
||||
import hsts
|
||||
import log
|
||||
|
||||
rewrite /js/bobalytics.js /js/plausible.js
|
||||
rewrite /js/bobalytics.outbound-links.js /js/plausible.outbound-links.js
|
||||
rewrite /js/bobalytics.hash.outbound-links.js /js/plausible.hash.outbound-links.js
|
||||
rewrite /js/bobalytics.exclusions.outbound-links.js /js/plausible.exclusions.outbound-links.js
|
||||
rewrite /js/bobalytics.exclusions.hash.outbound-links.js /js/plausible.exclusions.hash.outbound-links.js
|
||||
|
||||
rewrite /js/bobalytics.local.outbound-links.js /js/plausible.local.outbound-links.js
|
||||
|
||||
reverse_proxy localhost:84
|
||||
|
||||
import basicerrors
|
||||
|
@ -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
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# vim: ft=caddyfile
|
||||
|
||||
rick.bbaovanc.com {
|
||||
encode zstd gzip
|
||||
import hsts
|
||||
import log
|
||||
|
||||
redir https://www.youtube.com/watch?v=dQw4w9WgXcQ;
|
||||
}
|
@ -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
|
||||
}
|
@ -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 {}"'
|
@ -2,7 +2,7 @@
|
||||
{{ $text := 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" -}}
|
||||
{{ $img_url := (printf "https://errors.bbaovanc.com/%s.jpg" $code) -}}
|
||||
{{ $img_url := (printf "https://http.cat/%s.jpg" $code) -}}
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ $full_text }}</title>
|
||||
@ -23,7 +23,7 @@
|
||||
<body bgcolor="black" text="white">
|
||||
<center>
|
||||
<h1>{{ $full_text }}</h1>
|
||||
<img src='{{ $img_url }}' alt="cat" />
|
||||
<img src="{{ $img_url }}" alt="cat" />
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
7
github-redirect/index.php
Normal file
7
github-redirect/index.php
Normal 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);
|
||||
?>
|
Reference in New Issue
Block a user