mirror of
https://github.com/mat-1/matdoesdev.git
synced 2025-08-02 14:46:04 +00:00
crawl txt and md
This commit is contained in:
parent
d1d2d78195
commit
2451e29498
2 changed files with 77 additions and 37 deletions
108
Caddyfile
108
Caddyfile
|
@ -1,3 +1,7 @@
|
||||||
|
# xcaddy build \
|
||||||
|
# --with github.com/mat-1/matdoesdev-caddy
|
||||||
|
|
||||||
|
|
||||||
(https_redirect) {
|
(https_redirect) {
|
||||||
@do_https_redirect {
|
@do_https_redirect {
|
||||||
not header_regexp veryoldbrowser User-Agent Navigator|MSIE|Mosaic|Kindle|^curl|NintendoBrowser/
|
not header_regexp veryoldbrowser User-Agent Navigator|MSIE|Mosaic|Kindle|^curl|NintendoBrowser/
|
||||||
|
@ -39,15 +43,15 @@ http://matdoes.dev https://matdoes.dev http://matctazmu565vivubva3p3bulaneangiff
|
||||||
not path /dot_git/*
|
not path /dot_git/*
|
||||||
}
|
}
|
||||||
# respond @chrome "This site is best viewed with Firefox (or any browser that isn't Chrome).
|
# respond @chrome "This site is best viewed with Firefox (or any browser that isn't Chrome).
|
||||||
|
|
||||||
#If you're unable to use Firefox, you can also access this website via SSH, Gemini, Gopher, Finger, Telnet, and some others." 403
|
#If you're unable to use Firefox, you can also access this website via SSH, Gemini, Gopher, Finger, Telnet, and some others." 403
|
||||||
|
|
||||||
# easter egg that makes old browsers show the retro page
|
# easter egg that makes old browsers show the retro page
|
||||||
@retro_redirect {
|
@retro_redirect {
|
||||||
path /
|
path /
|
||||||
header_regexp oldbrowser User-Agent PaleMoon|Trident|MSIE|Netscape|Navigator
|
header_regexp oldbrowser User-Agent PaleMoon|Trident|MSIE|Netscape|Navigator|Mosaic
|
||||||
}
|
}
|
||||||
redir @retro_redirect /retro 302
|
redir @retro_redirect http://matdoes.dev/retro 302
|
||||||
|
|
||||||
root * /www
|
root * /www
|
||||||
file_server {
|
file_server {
|
||||||
|
@ -66,6 +70,22 @@ http://matdoes.dev https://matdoes.dev http://matctazmu565vivubva3p3bulaneangiff
|
||||||
rewrite @json_index /.json
|
rewrite @json_index /.json
|
||||||
rewrite @json {path}.json
|
rewrite @json {path}.json
|
||||||
|
|
||||||
|
# redirect to .txt if the user requested text/plain
|
||||||
|
@txt {
|
||||||
|
header Accept text/plain
|
||||||
|
not path *.txt
|
||||||
|
}
|
||||||
|
@txt_index {
|
||||||
|
header Accept text/plain
|
||||||
|
path /
|
||||||
|
}
|
||||||
|
rewrite @txt_index /.txt
|
||||||
|
rewrite @txt {path}.txt
|
||||||
|
# rewrite /.txt to /index.txt
|
||||||
|
handle {
|
||||||
|
rewrite /.txt /index.txt
|
||||||
|
}
|
||||||
|
|
||||||
# don't require .html
|
# don't require .html
|
||||||
try_files {path} {path}.html
|
try_files {path} {path}.html
|
||||||
|
|
||||||
|
@ -102,11 +122,11 @@ http://matdoes.dev https://matdoes.dev http://matctazmu565vivubva3p3bulaneangiff
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
route /buttons/stats.json {
|
route /buttons/stats.json {
|
||||||
uri strip_prefix /buttons
|
uri strip_prefix /buttons
|
||||||
file_server {
|
file_server {
|
||||||
root /opt/x227f
|
root /opt/x227f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
handle_path /buttons/i/* {
|
handle_path /buttons/i/* {
|
||||||
try_files {path} {path}.png {path}.gif {path}.jpg {path}.webp {path}.avif {path}.bmp
|
try_files {path} {path}.png {path}.gif {path}.jpg {path}.webp {path}.avif {path}.bmp
|
||||||
root * /opt/x227f/buttons
|
root * /opt/x227f/buttons
|
||||||
|
@ -121,12 +141,21 @@ http://matdoes.dev https://matdoes.dev http://matctazmu565vivubva3p3bulaneangiff
|
||||||
header Content-Encoding gzip
|
header Content-Encoding gzip
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handle_path /shwecky {
|
||||||
|
reverse_proxy https://shrecked.dev {
|
||||||
|
header_up Host shrecked.dev
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
route /status.json {
|
route /status.json {
|
||||||
reverse_proxy 127.0.0.1:9247 {
|
reverse_proxy 127.0.0.1:9247 {
|
||||||
rewrite /
|
rewrite /
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handle_errors 400 {
|
||||||
|
respond "🐟"
|
||||||
|
}
|
||||||
handle_errors {
|
handle_errors {
|
||||||
@should_be_404 {
|
@should_be_404 {
|
||||||
expression {http.error.status_code} == 404
|
expression {http.error.status_code} == 404
|
||||||
|
@ -153,25 +182,25 @@ http://matdoes.dev https://matdoes.dev http://matctazmu565vivubva3p3bulaneangiff
|
||||||
}
|
}
|
||||||
|
|
||||||
staging.matdoes.dev {
|
staging.matdoes.dev {
|
||||||
root * /www-staging
|
root * /www-staging
|
||||||
file_server {
|
file_server {
|
||||||
precompressed br gzip
|
precompressed br gzip
|
||||||
}
|
}
|
||||||
|
|
||||||
# redirect to .json if the user requested application/json
|
# redirect to .json if the user requested application/json
|
||||||
@json {
|
@json {
|
||||||
header Accept application/json
|
header Accept application/json
|
||||||
not path *.json
|
not path *.json
|
||||||
}
|
}
|
||||||
@json_index {
|
@json_index {
|
||||||
header Accept application/json
|
header Accept application/json
|
||||||
path /
|
path /
|
||||||
}
|
}
|
||||||
rewrite @json_index /.json
|
rewrite @json_index /.json
|
||||||
rewrite @json {path}.json
|
rewrite @json {path}.json
|
||||||
|
|
||||||
# don't require .html
|
# don't require .html
|
||||||
try_files {path} {path}.html
|
try_files {path} {path}.html
|
||||||
|
|
||||||
handle /robots.txt {
|
handle /robots.txt {
|
||||||
respond "User-agent: *
|
respond "User-agent: *
|
||||||
|
@ -219,7 +248,6 @@ matrix.matdoes.dev matrix.matdoes.dev:8448 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stats.matrix.matdoes.dev {
|
stats.matrix.matdoes.dev {
|
||||||
reverse_proxy 127.0.0.1:81
|
reverse_proxy 127.0.0.1:81
|
||||||
}
|
}
|
||||||
|
@ -248,14 +276,24 @@ http://s.matdoes.dev https://s.matdoes.dev {
|
||||||
reverse_proxy 127.0.0.1:28019
|
reverse_proxy 127.0.0.1:28019
|
||||||
}
|
}
|
||||||
|
|
||||||
|
staging.s.matdoes.dev {
|
||||||
|
reverse_proxy 127.0.0.1:28020
|
||||||
|
}
|
||||||
|
|
||||||
mail.matdoes.dev {
|
mail.matdoes.dev {
|
||||||
respond "mat's mail server :)"
|
respond "mat's mail server :)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
matdoes.dev. {
|
||||||
|
# tls /home/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/matdoes.dev/matdoes.dev.crt /home/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/matdoes.dev/matdoes.dev.key
|
||||||
|
|
||||||
|
respond "meow"
|
||||||
|
}
|
||||||
|
|
||||||
jmap.matdoes.dev {
|
jmap.matdoes.dev {
|
||||||
log {
|
log {
|
||||||
output stdout
|
output stdout
|
||||||
}
|
}
|
||||||
|
|
||||||
header Access-Control-Allow-Origin "*"
|
header Access-Control-Allow-Origin "*"
|
||||||
header Access-Control-Allow-Methods "*"
|
header Access-Control-Allow-Methods "*"
|
||||||
|
@ -263,7 +301,7 @@ jmap.matdoes.dev {
|
||||||
|
|
||||||
reverse_proxy https://localhost:8080 {
|
reverse_proxy https://localhost:8080 {
|
||||||
transport http {
|
transport http {
|
||||||
tls
|
tls
|
||||||
tls_insecure_skip_verify
|
tls_insecure_skip_verify
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,10 +334,6 @@ hetzner.matdoes.dev {
|
||||||
respond "uwu" 402
|
respond "uwu" 402
|
||||||
}
|
}
|
||||||
|
|
||||||
xmpp.matdoes.dev {
|
|
||||||
respond ""
|
|
||||||
}
|
|
||||||
|
|
||||||
mcassets.matdoes.dev {
|
mcassets.matdoes.dev {
|
||||||
reverse_proxy 127.0.0.1:10573
|
reverse_proxy 127.0.0.1:10573
|
||||||
}
|
}
|
||||||
|
@ -315,3 +349,7 @@ www.www.matdoes.dev {
|
||||||
www.matdoes.dev {
|
www.matdoes.dev {
|
||||||
redir https://matdoes.dev{uri}
|
redir https://matdoes.dev{uri}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
seized.matdoes.dev {
|
||||||
|
reverse_proxy 127.0.0.1:11270
|
||||||
|
}
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from "./$types"
|
import type { PageData } from './$types'
|
||||||
|
|
||||||
export let data: PageData
|
export let data: PageData
|
||||||
const { page, slug } = data
|
const { page, slug } = data
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- make sveltekit crawl to the json api -->
|
<!-- make sveltekit crawl to the json, txt, and md api -->
|
||||||
<div style="display:none"><a href="{slug}.json">JSON API</a></div>
|
<div style="display:none"><a href="{slug}.json">JSON API</a></div>
|
||||||
|
<div style="display:none"><a href="{slug}.txt">txt</a></div>
|
||||||
|
<div style="display:none"><a href="{slug}.md">md</a></div>
|
||||||
|
|
||||||
<svelte:component this={page} />
|
<svelte:component this={page} />
|
||||||
|
|
Loading…
Add table
Reference in a new issue