Instructions assume you are on unix-like system.
Create .env file from example.env.
cp example.env .envYou can use any name for the DB file; .gitignore excludes all *.db files from git tracking.
DB_SOURCE_NAME and GOOSE_DBSTRING must point to the same file
GitHub integration
- Generate app client secret and store it in the
GH_CLIENT_SECRETvariable. - Generate private key and put it into
pemdirectory (or any other directory, just make sureGH_PRIVATE_KEY_PATHis set correctly).
You can generate both client secret and private key on the GitHub App settings page.
Go will automatically install all dependencies once you execute go run or go build.
You must have sqlite3 installed on your system.
Install goose for migrations:
go install github.com/pressly/goose/v3/cmd/goose@latestSet GOOSE_* variables in the .env file if you didn't already
GOOSE_DRIVER=sqlite3
GOOSE_DBSTRING=./db/mkblog.db
GOOSE_MIGRATION_DIR=./db/migrations
GOOSE_TABLE=goose_migrationsRun migrations:
goose upIf ~/go/bin is not in your PATH:
~/go/bin/goose upRun the server:
go run .caddy run --resume