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:
log: medialog_dev.log
port: 8080
database:
username: <db_user>
password: <db_password>
url: <db_host>
port: 3306
database_name: <db_name>
admin_email: admin@example.com| 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 |
Start the server (development):
./medialog --config go-medialog.yml --environment devStart the server (production):
./medialog --config go-medialog.yml --environment prod --prodRun 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 --versionThe server listens on port 8080 by default.