diff options
| author | Xe Iaso <me@xeiaso.net> | 2023-03-18 17:47:19 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2023-03-18 17:47:19 -0400 |
| commit | 55c70e63454cd410f075a5dff7a59109a66e9b8a (patch) | |
| tree | 4f8c296649d26519ab0ddf2be762a67b8aaf798b /cmd/xedn | |
| parent | e02edb4eb42ba2c1c397a802c60564436635035d (diff) | |
| download | x-55c70e63454cd410f075a5dff7a59109a66e9b8a.tar.xz x-55c70e63454cd410f075a5dff7a59109a66e9b8a.zip | |
add Iosevka Iaso fonts to XeDN
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd/xedn')
| -rw-r--r-- | cmd/xedn/index.html | 9 | ||||
| -rw-r--r-- | cmd/xedn/main.go | 10 |
2 files changed, 13 insertions, 6 deletions
diff --git a/cmd/xedn/index.html b/cmd/xedn/index.html index 03c4b8e..954c54a 100644 --- a/cmd/xedn/index.html +++ b/cmd/xedn/index.html @@ -2,9 +2,8 @@ <html> <head> <title>XeDN</title> - <style> - main{font-family:monospace,monospace;max-width:38rem;padding:2rem;margin:auto}@media only screen and (max-device-width:736px){main{padding:0}}::selection{background:#d3869b}body{background:#282828;color:#ebdbb2}pre{background-color:#3c3836;padding:1em;border:0}a,a:active,a:visited{color:#b16286;background-color:#1d2021}h1,h2,h3,h4,h5{margin-bottom:.1rem}blockquote{border-left:1px solid #bdae93;margin:.5em 10px;padding:.5em 10px}footer{align:center}@media (prefers-color-scheme:light){body{background:#fbf1c7;color:#3c3836}pre{background-color:#ebdbb2;padding:1em;border:0}a,a:active,a:visited{color:#b16286;background-color:#f9f5d7}h1,h2,h3,h4,h5{margin-bottom:.1rem}blockquote{border-left:1px solid #655c54;margin:.5em 10px;padding:.5em 10px}} - </style> + <link rel="stylesheet" href="/static/css/iosevka/family.css" /> + <link rel="stylesheet" href="/static/css/xess.css" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> </head> <body id="top"> @@ -13,9 +12,7 @@ <p>Hi there! This server is a part of XeDN, the overengineered CDN made by <a href="https://xeiaso.net">Xe Iaso</a>. I hope you're having a good day. This server can't help you much.</p> - <footer> - <p>CSS available under the MIT license.</p> - </footer> + <p>From <a href="https://xeiaso.net">Within</a>.</p> </main> </body> </html> diff --git a/cmd/xedn/main.go b/cmd/xedn/main.go index eff055a..50127f5 100644 --- a/cmd/xedn/main.go +++ b/cmd/xedn/main.go @@ -40,11 +40,20 @@ var ( b2Backend = flag.String("b2-backend", "f001.backblazeb2.com", "Backblaze B2 base host") addr = flag.String("addr", ":8080", "server address") dir = flag.String("dir", os.Getenv("XEDN_STATE"), "where XeDN should store cached data") + staticDir = flag.String("static-dir", envOr("XEDN_STATIC", "./static"), "where XeDN should look for static assets") //go:embed index.html indexHTML []byte ) +func envOr(name, def string) string { + if val, ok := os.LookupEnv(name); ok { + return val + } + + return def +} + type Cache struct { ActualHost string Client *http.Client @@ -433,6 +442,7 @@ func main() { mux.Handle("/sticker/", ois) mux.Handle("/avatar/", sd) + mux.Handle("/static/", http.FileServer(http.Dir(*staticDir))) hdlr := func(w http.ResponseWriter, r *http.Request) { etagLock.RLock() |
