USERGEN(1)

NAME
usergen - append a user into a slcl database

SYNOPSIS
usergen dir

DESCRIPTION
usergen performs the following steps: 1. Reads user credentials and quota from standard input. 2. Generates a JSON object with the read credentials and quota, as well as a random salt and signing key. 3. Appends the newly generated JSON object into the users key in dir/db.json. 4. Creates a directory with the username in dir/user/.

OPTIONS
dir defines the directory where db.json is located.

NOTES
For security reasons, passwords are never stored in plaintext into dir/db.json. Instead, a salted, multi-round hashed password is calculated and stored. Then, slcl(1) performs the same operations to ensure both tokens match.

EXAMPLES
Below, there is an example of a new user called johndoe with password secret and a specified quota of 512 MiB:

    $ ./usergen ~/db
    Username:
    johndoe
    Password:
    secret
    Quota, in MiB (leave empty for unlimited quota):
    512
    1000/1000
Then, dir/db.json should be updated to something similar to:

    {
      "users": [
        {
          "name": "johndoe",
          "password": "4c48385ec2be4798dc772d3c8f5649d8411afbdfc4708ada79379e3562af5abb",
          "salt": "835324df29527731f3faad663c58c3b19a07c193e97dc77f33e10d3942cdc91c",
          "key": "d0ae360b9af1177ce73eef3f499eea2627cd61b69df79dcb7a5c70bc658a4e63",
          "quota": "512"
        }
      ]
    }

COPYRIGHT
Copyright (C) 2023 Xavier Del Campo Romero.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

SEE ALSO
slcl(1)