diff options
| author | 2025-01-27 18:07:00 +0000 | |
|---|---|---|
| committer | 2025-01-27 18:07:00 +0000 | |
| commit | f6044d3aa0241a832b0ad1d2c394c0a1b814dbe3 (patch) | |
| tree | 72334e7a24b997957d201490681552b6b1ad2e2f /utils.c | |
| parent | Add short_description_raw option (diff) | |
| parent | Fixed crash in the notification area after deleting a post. (diff) | |
| download | snac2-f6044d3aa0241a832b0ad1d2c394c0a1b814dbe3.tar.gz snac2-f6044d3aa0241a832b0ad1d2c394c0a1b814dbe3.tar.xz snac2-f6044d3aa0241a832b0ad1d2c394c0a1b814dbe3.zip | |
Merge branch 'master' into master
Diffstat (limited to 'utils.c')
| -rw-r--r-- | utils.c | 10 |
1 files changed, 7 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ | 2 | /* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ |
| 3 | 3 | ||
| 4 | #include "xs.h" | 4 | #include "xs.h" |
| 5 | #include "xs_io.h" | 5 | #include "xs_io.h" |
| @@ -98,7 +98,7 @@ static const char *greeting_html = | |||
| 98 | "<html><head>\n" | 98 | "<html><head>\n" |
| 99 | "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n" | 99 | "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n" |
| 100 | "<link rel=\"icon\" type=\"image/x-icon\" href=\"https://%host%/favicon.ico\"/>\n" | 100 | "<link rel=\"icon\" type=\"image/x-icon\" href=\"https://%host%/favicon.ico\"/>\n" |
| 101 | "<title>Welcome to %host%</title>\n" | 101 | "<title>Welcome to %host%</title>\n</head>\n" |
| 102 | "<body style=\"margin: auto; max-width: 50em\">\n" | 102 | "<body style=\"margin: auto; max-width: 50em\">\n" |
| 103 | "%blurb%" | 103 | "%blurb%" |
| 104 | "<p>The following users are part of this community:</p>\n" | 104 | "<p>The following users are part of this community:</p>\n" |
| @@ -319,6 +319,10 @@ int adduser(const char *uid) | |||
| 319 | mkdirx(d); | 319 | mkdirx(d); |
| 320 | } | 320 | } |
| 321 | 321 | ||
| 322 | /* add a specially short data retention time for the relay */ | ||
| 323 | if (strcmp(uid, "relay") == 0) | ||
| 324 | config = xs_dict_set(config, "purge_days", xs_stock(1)); | ||
| 325 | |||
| 322 | xs *cfn = xs_fmt("%s/user.json", basedir); | 326 | xs *cfn = xs_fmt("%s/user.json", basedir); |
| 323 | 327 | ||
| 324 | if ((f = fopen(cfn, "w")) == NULL) { | 328 | if ((f = fopen(cfn, "w")) == NULL) { |
| @@ -331,7 +335,7 @@ int adduser(const char *uid) | |||
| 331 | } | 335 | } |
| 332 | 336 | ||
| 333 | printf("\nCreating RSA key...\n"); | 337 | printf("\nCreating RSA key...\n"); |
| 334 | key = xs_evp_genkey(4096); | 338 | key = xs_evp_genkey(2048); |
| 335 | printf("Done.\n"); | 339 | printf("Done.\n"); |
| 336 | 340 | ||
| 337 | xs *kfn = xs_fmt("%s/key.json", basedir); | 341 | xs *kfn = xs_fmt("%s/key.json", basedir); |