Skip to content

About

port of nyudlts/medialog to Go

Resources

Stars

0 stars

Watchers

3 watching

Forks

Repository files navigation

Go-Medialog v1.1.0

A digital media logging and reporting application

Running the Application

Prerequisites

  • A MySQL/MariaDB database configured and accessible
  • A YAML configuration file (see go-medialog.yml for an example)

Configuration

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

CLI Flags

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

Common Commands

Start the server (development):

./medialog --config go-medialog.yml --environment dev

Start the server (production):

./medialog --config go-medialog.yml --environment prod --prod

Start the server (production) using https:

./medialog --config go-medialog.yml --environment prod --prod --https

Run database migrations:

./medialog --config go-medialog.yml --environment dev --migrate

Roll back database migrations:

./medialog --config go-medialog.yml --environment dev --rollback

Auto-migrate the database schema:

./medialog --config go-medialog.yml --environment dev --automigrate

Create the admin user:

./medialog --config go-medialog.yml --environment dev --create-admin

Print the version:

./medialog --version

About

port of nyudlts/medialog to Go

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages