# The Caddyfile is an easy way to configure your Caddy web server.
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.
# {
# 	http_port 80
# 	https_port 443
# }

:80 {
	# Set this path to your site's directory.
	root * /usr/share/caddy
	# Enable the static file server.
	file_server
	# Another common task is to set up a reverse proxy:
	# reverse_proxy localhost:8080
	# Or serve a PHP site through php-fpm:
	# php_fastcgi localhost:9000
}

# (domain_tls) {
# 	tls /opt/certs/ssl-bundle/domain.cert.pem /opt/certs/ssl-bundle/private.key.pem
# }
# (porkbun) {
# 	tls dns@tono.lol {
# 		# ca https://acme-v02.api.letsencrypt.org/directory
# 		dns porkbun {
# 			# api_key {env.PORKBUN_API_KEY}
# 			# api_secret_key {env.PORKBUN_API_SECRET_KEY}
# 			api_key pk1_758e4af3213cbf7eb03e0002881807c7615ddf22f776cbfe8f6e6ba74e8a5fee
# 			api_secret_key sk1_2f19c20b9de65527d7fb69610e2a02a9b7a896e32a3c63014db81474e779d383
# 		}
# 		# resolvers 9.9.9.9
# 	}
# }
# (logging) {
# 	log {
# 		output file /var/log/caddy/{args[0]}.log {
# 			roll_size 10mb
# 			roll_keep 5
# 			roll_keep_for 24h
# 		}
# 		format json {
# 			message_key msg
# 			level_key level
# 			time_key ts
# 			name_key name
# 			time_format wall
# 		}
# 		level WARN
# 	}
# }

# # :3000 {
# # 	handle_path /cgit-css/* {
# # 		root * /usr/share/cgit/
# # 		file_server
# # 	}
# # 	handle {
# # 		reverse_proxy localhost:8999 {
# # 			transport fastcgi {
# # 				env DOCUMENT_ROOT /usr/lib/cgit/
# # 				env SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi
# # 			}
# # 		}
# # 	}
# # }

# :3000 {
# 	handle_path /cgit-css/* {
# 		root * /usr/share/cgit/
# 		file_server
# 	}

# 	# @assets path /custom.css /cgit.js /cgit.png /custom-head.html /robots.txt
# 	# handle @assets {
# 	# 	root * /usr/share/cgit/
# 	# 	file_server
# 	# }

# 	handle {
# 		reverse_proxy localhost:8999 {
# 			# unix:/var/run/fcgiwrap.sock
# 			# reverse_proxy unix:/run/fcgiwrap.sock {
# 			transport fastcgi {
# 				env DOCUMENT_ROOT /usr/lib/cgit/
# 				env SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi
# 			}
# 		}
# 	}
# }

# :8080 {
# 	reverse_proxy localhost:6697
# }

# :80 {
# 	import git
# }

# ro.mara-ayu.ts.net {
# 	tls {
# 		get_certificate tailscale
# 	}
# }

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile
