diff --git a/.env-dev b/.env-dev new file mode 100644 index 0000000..f4e1727 --- /dev/null +++ b/.env-dev @@ -0,0 +1,11 @@ +ACME_API=https://acme.mock.directory +ACME_ACCEPT_TERMS=true +PAGES_DOMAIN=localhost.mock.directory +RAW_DOMAIN=raw.localhost.mock.directory +PAGES_BRANCHES=pages,master,main +GITEA_ROOT=https://codeberg.org +PORT=4430 +HTTP_PORT=1234 +ENABLE_HTTP_SERVER=true +LOG_LEVEL=trace +ACME_ACCOUNT_CONFIG=integration/acme-account.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d2cc8d1 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch PagesServer", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/main.go", + "args": ["sqlite", "sqlite_unlock_notify", "netgo"], + "envFile": "${workspaceFolder}/.env-dev" + }, + { + "name": "Launch PagesServer integration test", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/integration/main_test.go", + "args": ["codeberg.org/codeberg/pages/integration/..."], + "buildFlags": ["-tags", "'integration sqlite sqlite_unlock_notify netgo'"] + } + ] +} diff --git a/Justfile b/Justfile index e53ba79..0bf38a3 100644 --- a/Justfile +++ b/Justfile @@ -4,14 +4,9 @@ TAGS := 'sqlite sqlite_unlock_notify netgo' dev: #!/usr/bin/env bash set -euxo pipefail - export ACME_API=https://acme.mock.directory - export ACME_ACCEPT_TERMS=true - export PAGES_DOMAIN=localhost.mock.directory - export RAW_DOMAIN=raw.localhost.mock.directory - export PORT=4430 - export HTTP_PORT=1234 - export ENABLE_HTTP_SERVER=true - export LOG_LEVEL=trace + set -a # automatically export all variables + source .env-dev + set +a go run -tags '{{TAGS}}' . build: