diff options
| author | 2025-01-24 08:23:18 +0100 | |
|---|---|---|
| committer | 2025-01-24 08:23:18 +0100 | |
| commit | a72d09ae56b927b872540fec5c85881496c23e27 (patch) | |
| tree | 0c777b21e089fb56532da0380bd9fd917afc6136 /utils.c | |
| parent | Updated documentation. (diff) | |
| download | snac2-a72d09ae56b927b872540fec5c85881496c23e27.tar.gz snac2-a72d09ae56b927b872540fec5c85881496c23e27.tar.xz snac2-a72d09ae56b927b872540fec5c85881496c23e27.zip | |
Set value 'purge_days' to 1 by default when creating the relay user.
Diffstat (limited to 'utils.c')
| -rw-r--r-- | utils.c | 4 |
1 files changed, 4 insertions, 0 deletions
| @@ -318,6 +318,10 @@ int adduser(const char *uid) | |||
| 318 | mkdirx(d); | 318 | mkdirx(d); |
| 319 | } | 319 | } |
| 320 | 320 | ||
| 321 | /* add a specially short data retention time for the relay */ | ||
| 322 | if (strcmp(uid, "relay") == 0) | ||
| 323 | config = xs_dict_set(config, "purge_days", xs_stock(1)); | ||
| 324 | |||
| 321 | xs *cfn = xs_fmt("%s/user.json", basedir); | 325 | xs *cfn = xs_fmt("%s/user.json", basedir); |
| 322 | 326 | ||
| 323 | if ((f = fopen(cfn, "w")) == NULL) { | 327 | if ((f = fopen(cfn, "w")) == NULL) { |