A digital media logging and reporting application
- A MySQL/MariaDB database configured and accessible
- A YAML configuration file (see
go-medialog.ymlfor an example)
The config file defines environments (e.g., dev, prod) with database connection details, log location, and admin email:
dev:
admin_email: admin@example.com
database:
username: <db_user>
password: <db_password>
url: <db_host>
port: 3306
database_name: <db_name>
https_keys:
certificate: path/to/cert
key: path/to/key
log: /path/to/logfile
port: 8080| Flag | Type | Description |
|---|---|---|
--config |
string | Path to the YAML configuration file |
--environment |
string | Environment key to use from the config file (e.g., dev) |
--version |
bool | Print the application version and exit |
--prod |
bool | Run in production mode (logs to file instead of stdout) |
--migrate |
bool | Run database migrations and exit |
--rollback |
bool | Roll back database migrations and exit |
--automigrate |
bool | Auto-migrate the database schema and exit |
--create-admin |
bool | Create the admin user (email from config) and exit |
--create-json |
bool | Export database to JSON and exit |
--gorm-debug |
bool | Enable GORM debug logging |
--https |
bool | run on https using cert and key defined in config |
Start the server (development):
./medialog --config go-medialog.yml --environment devStart the server (production):
./medialog --config go-medialog.yml --environment prod --prodStart the server (production) using https:
./medialog --config go-medialog.yml --environment prod --prod --httpsRun database migrations:
./medialog --config go-medialog.yml --environment dev --migrateRoll back database migrations:
./medialog --config go-medialog.yml --environment dev --rollbackAuto-migrate the database schema:
./medialog --config go-medialog.yml --environment dev --automigrateCreate the admin user:
./medialog --config go-medialog.yml --environment dev --create-adminPrint the version:
./medialog --version