Is This Professor Good ? - Backend (itpg-backend)
Backend server for itpg, which is a platform where students can grade their professors after taking courses.
This permits future students to make more informed decisions when choosing their courses.
This package handles http requests, database transactions, and user state management.
Installation
Go install
$ go install github.com/vanillaiice/itpg@latest
Docker
$ docker pull vanillaiice/itpg:latest
Usage
NAME:
itpg-backend - Backend server for ITPG, handles database transactions and user state management through HTTP(S) requests.
USAGE:
itpg-backend [global options] command [command options]
VERSION:
v0.6.2
AUTHOR:
vanillaiice <vanillaiice1@proton.me>
COMMANDS:
run, r run itpg server
admin, a admin management
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--port PORT, -p PORT listen on PORT (default: "443")
--db-backend value, -b value database backend, either sqlite or postgres (default: "sqlite")
--db URL, -d URL database connection URL (default: "itpg.db")
--users-db value, -u value user state management bolt database (default: "users.db")
--cache-db URL, -C URL cache redis database connection URL
--cache-ttl value, -T value cache time-to-live in seconds (default: 10)
--log-level value, -g value log level (default: "info")
--cookie-timeout value, -i value cookie timeout in minutes (default: 30)
--env FILE, -e FILE load SMTP configuration from FILE (default: ".env")
--pass-reset-url URL, -r URL password reset web page URL
--allowed-origins value, -o value [ --allowed-origins value, -o value ] only allow specified origins to access resources (default: "*")
--allowed-mail-domains value, -m value [ --allowed-mail-domains value, -m value ] only allow specified mail domains to register (default: "*")
--smtp, -s use SMTP instead of SMTPS (default: false)
--http, -t use HTTP instead of HTTPS (default: false)
--cert-file FILE, -c FILE load SSL certificate file from FILE
--key-file FILE, -k FILE laod SSL secret key from FILE
--code-validity-min value, -I value code validity in minutes (default: 180)
--code-length value, -L value length of generated codes (default: 8)
--min-password-score value, -S value minimum acceptable password score computed by zxcvbn (default: 3)
--handler-config FILE, -n FILE load JSON handler config from FILE (default: "handlers.json")
--load FILE, -l FILE load TOML config from FILE
--help, -h show help
--version, -v print the version
Examples
Using Go
If itpg was installed using go install
, you can simply run it from the command line.
However, there should be an .env file containing the SMTP credentials needed to send confirmation emails.
# run the server with HTTP and pass an env file
$ itpg -t -e .smtp-env
# run the server with a TOML config file
$ itpg -l config.toml
Using Docker
# run the server with HTTPS and pass a TOML config file
$ ls itpg-data
# output: server.crt cert.key config.toml
$ docker run --rm -v ${PWD}/itpg-data:/itpg-data vanillaiice/itpg --load itpg-data/config.toml
Author
vanillaiice
Licence
GPLv3