Personal blog (Golang, Fiber)

Dmitriy 6f53409687 Update cache package 2 tygodni temu
build 6f53409687 Update cache package 2 tygodni temu
cmd 541ff11f8c Update app 2 miesięcy temu
init 94c5cb168a Update systemd config 2 tygodni temu
internal 6f53409687 Update cache package 2 tygodni temu
migration 312e8cf738 Update migration 1 miesiąc temu
web 78e7897490 Update frontend 1 miesiąc temu
.gitignore cfd6f0f4f1 Update services 1 rok temu
Makefile 2fc69af855 Update config 1 miesiąc temu
docker-compose.yml 6f53409687 Update cache package 2 tygodni temu
go.mod 6f53409687 Update cache package 2 tygodni temu
go.sum 6f53409687 Update cache package 2 tygodni temu
readme.md c1f9d3e21e Update cache 2 tygodni temu

readme.md

Config example

.env

# APP
APP_PORT=8080
APP_STATIC_PATH=
APP_TEMPLATES_PATH=

# CORS
CORS_ALLOW_ORIGIN=*
CORS_ALLOW_METHODS=GET,POST,PUT,DELETE

# DB
DB_DRIVER=mysql
DB_HOST=localhost
DB_PORT=1111
DB_NAME=db
DB_USER=user
DB_PASSWORD=pass
DB_MAX_OPEN_CONNS=0
DB_MAX_IDLE_CONNS=0
DB_MAX_OPEN_CONN_LIFETIME=0s
DB_MAX_IDLE_CONN_LIFETIME=0s

# Cache
CACHE_DEFAULT_EXPIRATION=24h

# SMTP
SMTP_HOST=smtp.example.com
SMTP_PORT=2525
SMTP_USER=example@example.com
SMTP_PASSWORD=pass

# Rate limiter
LOGIN_RATE_LIMITER_MAX_REQUESTS=10
LOGIN_RATE_LIMITER_EXPIRATION=30s	

# JWT
JWT_SECRET_KEY=test_secret
JWT_COOKIE=cookie
JWT_LIFETIME=1h

# Basic auth
BASIC_AUTH_USER=user
BASIC_AUTH_PASSWORD=pass

# Static
STATIC_VERSION=1

# Logger
LOGGER_STDOUT_ENABLED=true
LOGGER_STDOUT_LEVEL=info
LOGGER_EMAIL_ENABLED=true
LOGGER_EMAIL_LEVEL=error
LOGGER_EMAIL_RECIPIENT=info@example.com
LOGGER_EMAIL_SUBJECT=Error from example.com
LOGGER_FILE_ENABLED=true
LOGGER_FILE_LEVEL=info
LOGGER_FILE_PATH=/var/tmp/error.log

Commands

  • make run (run application)
  • make test (run tests)
  • make test-cover (test coverage statistics)
  • make lint (run linter)
  • make migration-status (migrations status)
  • make migration-up (apply migrations)
  • make migration-down (rollback migrations)
  • make docker-build (build and run Docker containers)
  • make docker-up (run Docker containers)
  • make docker-down (stop Docker containers)
  • make install-deps (dependencies installation)
  • make app-build (compile application)

Metrics (protected by Basic auth)

/metrics

Healthchecks

/livez /readyz