+/config

my dotfiles and nix configuration

git clone https://git.julia.blue/+/config

Julia RyanEnable motd25665e9

main
3.4 KiB214 linesraw
1{
2	log {
3		format console {
4			time_key "" # journalctl already provides timestamps
5		}
6	}
7	metrics {
8		per_host
9		observe_catchall_hosts
10	}
11	email "juliaryan3.14@gmail.com"
12	layer4 {
13		:443 {
14			@ally tls sni dropbear.sh
15			route @ally {
16				proxy tcp/hassium.ddns.net:23443
17			}
18
19			@tls-any tls
20			route "@tls-any" {
21				proxy localhost:23443
22			}
23		}
24	}
25	https_port 23443
26}
27
28(log) {
29	log {
30		output file /var/log/caddy/"{args[0]}".log {
31			mode 644
32		}
33	}
34}
35
36(auth) {
37	basic_auth {
38		julia {$HTTP_BASIC_AUTH_PASSWORD}
39	}
40}
41
42julia.blue pineapple.computer julia.is.fckn.gay xn--ni8h.is.fckn.gay {
43	root /website
44	encode
45	try_files {path} {path}.html
46	file_server {
47		browse
48		precompressed
49	}
50	handle_errors {
51		rewrite /{err.status_code}.html
52		file_server
53	}
54	import log main
55}
56
57stats.pineapple.computer {
58	reverse_proxy localhost:9001
59	import log stats
60	import auth
61}
62
63atuin.pineapple.computer {
64	reverse_proxy localhost:9002
65	import log atuin
66}
67
68sync.pineapple.computer {
69	reverse_proxy localhost:9003
70	import log sync
71	import auth
72}
73
74db.pineapple.computer {
75	reverse_proxy localhost:9004
76	import log pgadmin
77	import auth
78}
79
80l.julia.blue {
81	reverse_proxy localhost:9005
82	import log chhoto
83}
84
85cache.pineapple.computer {
86	reverse_proxy localhost:9006
87	import log harmonia
88}
89
90photos.julia.blue images.julia.blue {
91	reverse_proxy localhost:9007
92	import log immich
93	import auth
94}
95
96home.julia.blue {
97	reverse_proxy localhost:8123
98	import log home-assistant
99}
100
101qbt.julia.blue {
102	reverse_proxy localhost:9008
103	import log qbittorrent
104	import auth
105}
106
107notif.julia.blue, http://notif.julia.blue {
108	reverse_proxy localhost:9009
109	import log ntfy
110	@httpget {
111		protocol http
112		method GET
113		path_regexp "^/([-_a-z0-9]{0,64}$|docs/|static/)"
114	}
115	redir @httpget "https://{host}{uri}"
116}
117
118git.julia.blue {
119	vars repoRoot "^/[^/]+/[^/]+/"
120	vars webRoot /var/cache/sorcery
121	vars socket unix//run/sorcery/sock
122	vars gitDir "/git"
123	import log sorcery
124
125	root * {vars.webRoot}
126	header Cache-Control "no-cache"
127
128	@assets {
129		path /css/style.css /js/* /fonts/*
130		file {path}
131	}
132	handle @assets {
133		file_server
134	}
135
136	@repoDirIndex {
137		path_regexp "{vars.repoRoot}$"
138		file {path}index.html
139	}
140	@repoRefDirIndex {
141		path_regexp {vars.repoRoot}ref/.+/$
142		file {path}index.html
143	}
144	handle @repoDirIndex {
145		rewrite * {path}index.html
146		file_server
147	}
148	handle @repoRefDirIndex {
149		rewrite * {path}index.html
150		file_server
151	}
152
153	@repoHtml {
154		path_regexp {vars.repoRoot}"(?:refs|ref/.+/blob/.+)$"
155		file {path}
156	}
157	handle @repoHtml {
158		header Content-Type "text/html"
159		file_server
160	}
161
162	@gitinfo {
163		path_regexp ${vars.repoRoot}gitinfo\.json$
164		file {path}
165	}
166	handle @gitinfo {
167		file_server
168	}
169
170	@homepage path /
171	handle @homepage {
172		reverse_proxy {vars.socket}
173	}
174
175	handle {
176		header -Cache-Control
177
178		reverse_proxy {vars.socket} {
179			@accel header X-Accel-Redirect *
180			handle_response @accel {
181				rewrite * {http.reverse_proxy.header.X-Accel-Redirect}
182
183				@git path /_sorcery-git/*
184				handle @git {
185					header -Cache-Control
186					copy_response_headers {
187						include Cache-Control
188					}
189					root * {vars.gitDir}
190					uri strip_prefix /_sorcery-git
191					file_server
192				}
193
194				handle {
195					root * {vars.webRoot}
196					uri strip_prefix /_sorcery
197
198					@rendered path_regexp {vars.repoRoot}"(?:refs|ref/.+/blob/.+)$"
199					handle @rendered {
200						header Content-Type "text/html"
201						file_server
202					}
203					handle {
204						file_server
205					}
206				}
207			}
208		}
209	}
210
211	request_body {
212		max_size 64MB
213	}
214}