objective categorical abstract machine language personal data server

Favicon support

futur.blue 118d429f 1fdb4ff4

verified
+15 -3
+5 -1
.env.example
··· 34 34 # default: https://bsky.network 35 35 # PDS_CRAWLERS=https://bsky.network 36 36 37 - # (optional [but recommended]): a secret token used to generate DPoP nonces; 32 bytes, base64url 37 + # (optional [but recommended]) a secret token used to generate DPoP nonces; 32 bytes, base64url 38 38 # tip: run the `gen-keys` binary to generate this (more info in readme) 39 39 # PDS_DPOP_NONCE_SECRET= 40 + 41 + # (optional) a link to a .ico favicon to display on the frontend 42 + # default: /public/favicon.ico 43 + # PDS_FAVICON_URL=/public/favicon.ico 40 44 41 45 # (optional) email config (see readme for details) 42 46 # auth uri should look like smtp[s]://user:pass@host[:port]
+1
docker-compose.yaml
··· 17 17 - PDS_ADMIN_PASSWORD=${PDS_ADMIN_PASSWORD:?} 18 18 - PDS_CRAWLERS=${PDS_CRAWLERS:-https://bsky.network} 19 19 - PDS_DPOP_NONCE_SECRET=${PDS_DPOP_NONCE_SECRET:-} 20 + - PDS_FAVICON_URL=${PDS_FAVICON_URL:-} 20 21 21 22 - PDS_SMTP_STARTTLS=${PDS_SMTP_STARTTLS:-false} 22 23 - PDS_SMTP_AUTH_URI=${PDS_SMTP_AUTH_URI:-}
+3
dune
··· 44 44 (deps 45 45 (file ../public/client.js) 46 46 (file ../public/index.css) 47 + (file ../public/favicon.ico) 47 48 (source_tree ../public/fonts)) 48 49 (action 49 50 (with-stdout-to ··· 58 59 js 59 60 -e 60 61 css 62 + -e 63 + ico 61 64 -m 62 65 plain 63 66 ../public
+2 -1
frontend/src/templates/Layout.mlx
··· 1 1 open React 2 2 3 - let[@react.component] make ?(title = "Pegasus") ?(children = null) () = 3 + let[@react.component] make ?(title = "Pegasus") ?(children = null) ?(favicon = "/public/favicon.ico") () = 4 4 <html lang="en"> 5 5 <head> 6 6 <meta charSet="utf-8" /> ··· 28 28 /> 29 29 <link rel="stylesheet" href="/public/index.css" /> 30 30 <title>(string title)</title> 31 + <link rel="icon" type_="image/x-icon" href=favicon /> 31 32 </head> 32 33 <body 33 34 className="bg-feather-100 font-sans font-normal text-base tracking-normal">
+3
pegasus/lib/env.ml
··· 50 50 | _ -> 51 51 Uri.make ~scheme:"https" ~host:u () ) 52 52 53 + let favicon_url = 54 + getenv_opt "PDS_FAVICON_URL" ~default:"/public/favicon.ico" 55 + 53 56 let dpop_nonce_secret = 54 57 match getenv_opt "PDS_DPOP_NONCE_SECRET" ~default:"" with 55 58 | "" ->
+1 -1
pegasus/lib/util.ml
··· 468 468 let props_json = Template.props_to_json props |> Yojson.Basic.to_string in 469 469 let page_data = Printf.sprintf "window.__PAGE__ = {props: %s};" props_json in 470 470 let app = Template.make ~props () in 471 - let page = Frontend.Layout.make ?title ~children:app () in 471 + let page = Frontend.Layout.make ?title ~favicon:Env.favicon_url ~children:app () in 472 472 Dream.stream ?status 473 473 ~headers:[("Content-Type", "text/html")] 474 474 (fun stream ->
public/favicon.ico

This is a binary file and will not be displayed.