Purchase a cup of coffee to get access to the internet.
Start dependencies
docker-compose up -dCopy the example config file
cp config.example.yaml config.yamlModify config file
# config.yaml
app:
name: "captive-portal"
env: "dev" # Change to "prod" in production environment
host: 127.0.0.1
port: 8080
graceful_timeout_second: 0.1
log_level: "debug"
newrelic:
license_key: "example" # Change to your own license key
openwrt:
encryption_key: "example" # Change to the own encryption key of OpenNDS
redis:
host: 127.0.0.1
port: 6379
db: 0
password: "" # Change to your own redis password or Refer to docker-compose.yml
db:
host: 127.0.0.1
port: 5432
user: "postgres"
name: "captive-portal"
password: "example" # Change to your own postgres password or Refer to docker-compose.ymlRun the application. The configuration file is in the current directory by default.
go run main.goFormat code
make formatCheck formatting
make lintIf you want to modify the database schema, you should modify the schema file directly.
And then generate models from the database
make modelsAfter you finished, dump the database schema
make dump-dbmake restore-db