Tool to plan guided tours.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
finga ab77af9350 app-yew: Add password change logic 8 months ago
.cargo Move clippy config into a more "global" place 9 months ago
app-seed Rename `PasswordResult` to `PasswordCheck` 8 months ago
app-yew app-yew: Add password change logic 8 months ago
doc doc: Update schema and endpoints docs [CI SKIP] 8 months ago
migrations server: Use `argon2` as PBKDF 9 months ago
shared shared: Add field for empty email in `EmailCheck` 8 months ago
tou-rs Rename `PasswordResult` to `PasswordCheck` 8 months ago
.gitignore Add yew frontend 8 months ago
.gitmodules Client is now app-seed and default feature 8 months ago
.woodpecker.yml ci: Optimize ci build times 8 months ago
Cargo.lock app-yew: Add page to change the email address 8 months ago
Cargo.toml server: Rename the `server` package to `tou-rs` 8 months ago
LICENSE Create a project structure and a login stub 10 months ago
Makefile.toml server: Rename the `server` package to `tou-rs` 8 months ago
README.md readme: Build badge link [CI SKIP] 8 months ago
diesel.toml Add status and role fields to user 9 months ago
tou-rs.toml tou-rs: Create session cleaner 8 months ago

README.md

tou-rs

status-badge

Build

Using Seed

cargo make build_seed

Using Yew

cargo make build_yew

Run

Using Seed

cargo make serve_seed

Using Yew

cargo make serve_yew

Usage

USAGE:
    tou-rs [OPTIONS] [SUBCOMMAND]

OPTIONS:
    -c, --config <FILE>        Path to the configuration file
    -h, --help                 Print help information
    -l, --log-level <LEVEL>    Log level [default: warn] [possible values: off, error, warn, info,
                               debug, trace]
    -V, --version              Print version information

SUBCOMMANDS:
    help     Print this message or the help of the given subcommand(s)
    serve    Start the tou-rs server
    user     Handle user accounts

Options

Configuration file

The path to the configuration file with the filename tou-rs.toml. When this argument is not given following default paths are used to find the configuration file:

  • Current directory
  • Depending on the platform:
    • Linux: $XDG_CONFIG_HOME or $HOME/.config/
    • macOS: $HOME/Library/Application Support
    • Windows: {FOLDERID_RoamingAppData}
  • And at last /etc/tou-rs/

Subcommands

Serve

Start the tou-rs server. This is the default behaviour.

User

Handle user accounts.

Create

Create a new user accout. This command expects the role and the email address of the new user. The password can either be provided as subsequent parameter or will be prompted if omitted.

USAGE:
    tou-rs user create <ROLE> <EMAIL> [PASSWORD]

ARGS:
    <ROLE>        Role of the new user [possible values: admin, user, viewer]
    <EMAIL>       Email address of the new user
    <PASSWORD>    Password of the new user (omit for prompt)

Configuration

The config is devided in sections with following parameters (all parameters with a default value are optional):

  • cookies:
    • secret: Cookie secret
    • age: Maximum age of the cookies in seconds (default: 57600 (24 hours))
    • secure: Boolean flag if secure cookies should be used (default: true)
  • sessions:
    • secret: Pepper to be used when generating a session token (Base64 encoded value)
    • expiry: The amount of seconds before invalidating a session (default: 57600 (24 hours))
    • cleanup: The inverval in seconds when sessions should be cleaned up (default: 3600 (1 hour))
  • database:
    • path: Path to the database (should maybe default to: /var/lib/tou-rs/tou-rs.sqlite (would need to create path first?))
    • secret: Pepper to be used when hashing secrets in the database (Base64 encoded value)
  • server:
    • ip: IP address to listen on (default: ::1)
    • port: Port to listen on (default: 8000)
    • domain: Domain the application is reachable with (default: localhost)

Example

[cookies]
secret = "cookie_secret"
age = 57600
secure = true

[sessions]
secret = "session_pepper"
expiry = 57600
cleanup = 3600

[database]
path = "tou-rs.sqlite"
secret = "database_pepper"

[server]
ip = "::1"
port = 8000
domain = "localhost"