diff options
| author | 2025-07-10 05:45:22 +0200 | |
|---|---|---|
| committer | 2025-07-10 05:45:22 +0200 | |
| commit | 26502fa62ee05465e524987ab5b86078f2e64e6f (patch) | |
| tree | ecd485e10f7e621aef174a31004f57586d554141 /httpd.c | |
| parent | Updated documentation. (diff) | |
| download | penes-snac2-26502fa62ee05465e524987ab5b86078f2e64e6f.tar.gz penes-snac2-26502fa62ee05465e524987ab5b86078f2e64e6f.tar.xz penes-snac2-26502fa62ee05465e524987ab5b86078f2e64e6f.zip | |
Added metadata to nodeinfo 2.0.
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 9 |
1 files changed, 7 insertions, 2 deletions
| @@ -66,7 +66,9 @@ const char *nodeinfo_2_0_template = "" | |||
| 66 | "\"services\":{\"outbound\":[],\"inbound\":[]}," | 66 | "\"services\":{\"outbound\":[],\"inbound\":[]}," |
| 67 | "\"usage\":{\"users\":{\"total\":%d,\"activeMonth\":%d,\"activeHalfyear\":%d}," | 67 | "\"usage\":{\"users\":{\"total\":%d,\"activeMonth\":%d,\"activeHalfyear\":%d}," |
| 68 | "\"localPosts\":%d}," | 68 | "\"localPosts\":%d}," |
| 69 | "\"openRegistrations\":false,\"metadata\":{}}"; | 69 | "\"openRegistrations\":false,\"metadata\":{" |
| 70 | "\"nodeDescription\":\"%s\",\"nodeName\":\"%s\"" | ||
| 71 | "}}"; | ||
| 70 | 72 | ||
| 71 | xs_str *nodeinfo_2_0(void) | 73 | xs_str *nodeinfo_2_0(void) |
| 72 | /* builds a nodeinfo json object */ | 74 | /* builds a nodeinfo json object */ |
| @@ -99,7 +101,10 @@ xs_str *nodeinfo_2_0(void) | |||
| 99 | n_posts += index_len(pidxfn); | 101 | n_posts += index_len(pidxfn); |
| 100 | } | 102 | } |
| 101 | 103 | ||
| 102 | return xs_fmt(nodeinfo_2_0_template, n_utotal, n_umonth, n_uhyear, n_posts); | 104 | const char *name = xs_dict_get_def(srv_config, "title", ""); |
| 105 | const char *desc = xs_dict_get_def(srv_config, "short_description", ""); | ||
| 106 | |||
| 107 | return xs_fmt(nodeinfo_2_0_template, n_utotal, n_umonth, n_uhyear, n_posts, desc, name); | ||
| 103 | } | 108 | } |
| 104 | 109 | ||
| 105 | 110 | ||