commit 1060baa

Paul Wilde  ·  2024-01-26 15:40:19 +0000 UTC
parent 7de892b
added host-meta endpoint for subwaytooter app
4 files changed,  +69, -0
+13, -0
 1@@ -0,0 +1,13 @@
 2+<!DOCTYPE html>
 3+<html><head>
 4+<meta name="viewport" content="width=device-width, initial-scale=1"/>
 5+<title>Welcome to %host%</title>
 6+<body style="margin: auto; max-width: 50em">
 7+<p><b>%host%</b> is a <a href="https://en.wikipedia.org/wiki/Fediverse">Fediverse</a> instance that uses the <a href="https://en.wikipedia.org/wiki/ActivityPub">ActivityPub</a> protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.</p>
 8+<p>This server runs the <a href="https://comam.es/what-is-snac">snac</a> software and there is no automatic sign-up process.</p>
 9+<p>The following users are part of this community:</p>
10+
11+%userlist%
12+
13+<p>This site is powered by <abbr title="Social Networks Are Crap">snac</abbr>.</p>
14+</body></html>
+21, -0
 1@@ -0,0 +1,21 @@
 2+{
 3+    "prefix": "",
 4+    "port": 8001,
 5+    "dbglevel": 0,
 6+    "queue_retry_minutes": 2,
 7+    "queue_retry_max": 10,
 8+    "cssurls": [
 9+        ""
10+    ],
11+    "max_timeline_entries": 128,
12+    "timeline_purge_days": 120,
13+    "local_purge_days": 0,
14+    "admin_account": "",
15+    "title": "",
16+    "short_description": "",
17+    "fastcgi": false,
18+    "layout": 2.7,
19+    "address": "0.0.0.0",
20+    "host": "snac.notnull.space",
21+    "admin_email": "paul@notnull.space"
22+}
+27, -0
 1@@ -0,0 +1,27 @@
 2+body { max-width: 48em; margin: auto; line-height: 1.5; padding: 0.8em; word-wrap: break-word; }
 3+pre { overflow-x: scroll; }
 4+.snac-embedded-video, img { max-width: 100% }
 5+.snac-origin { font-size: 85% }
 6+.snac-score { float: right; font-size: 85% }
 7+.snac-top-user { text-align: center; padding-bottom: 2em }
 8+.snac-top-user-name { font-size: 200% }
 9+.snac-top-user-id { font-size: 150% }
10+.snac-avatar { float: left; height: 2.5em; padding: 0.25em }
11+.snac-author { font-size: 90%; text-decoration: none }
12+.snac-author-tag { font-size: 80% }
13+.snac-pubdate { color: #a0a0a0; font-size: 90% }
14+.snac-top-controls { padding-bottom: 1.5em }
15+.snac-post { border-top: 1px solid #a0a0a0; }
16+.snac-children { padding-left: 2em; border-left: 1px solid #a0a0a0; }
17+.snac-textarea { font-family: inherit; width: 100% }
18+.snac-history { border: 1px solid #606060; border-radius: 3px; margin: 2.5em 0; padding: 0 2em }
19+.snac-btn-mute { float: right; margin-left: 0.5em }
20+.snac-btn-unmute { float: right; margin-left: 0.5em }
21+.snac-btn-follow { float: right; margin-left: 0.5em }
22+.snac-btn-unfollow { float: right; margin-left: 0.5em }
23+.snac-btn-hide { float: right; margin-left: 0.5em }
24+.snac-btn-delete { float: right; margin-left: 0.5em }
25+.snac-btn-limit { float: right; margin-left: 0.5em }
26+.snac-btn-unlimit { float: right; margin-left: 0.5em }
27+.snac-footer { margin-top: 2em; font-size: 75% }
28+.snac-poll-result { margin-left: auto; margin-right: auto; }
+8, -0
 1@@ -235,6 +235,14 @@ int server_get_handler(xs_dict *req, const char *q_path,
 2         *body  = xs_str_new("User-agent: *\n"
 3                             "Disallow: /\n");
 4     }
 5+    else
 6+    if (strcmp(q_path, "/.well-known/host-meta") == 0) {
 7+        status = 200;
 8+        *ctype = "application/xrd+xml";
 9+        *body  = xs_str_new("<XRD>"
10+                "<Link rel=\"lrdd\" type=\"application/xrd+xml\" template=\"%s/.well-known/webfinger?resource={uri}\"/>"
11+                "</XRD>");
12+    }
13 
14     if (status != 0)
15         srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status));