diff --git a/.gitignore b/.gitignore index 6414e17c9..b7ca861c5 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,6 @@ Configuration.schema.json qemu-*-static -public_html.gen.go \ No newline at end of file +public_html.gen.go + +__debug_bin diff --git a/internal/suites/example/compose/authelia/docker-compose.backend.dev.yml b/internal/suites/example/compose/authelia/docker-compose.backend.dev.yml index 10316235f..e1e36700f 100644 --- a/internal/suites/example/compose/authelia/docker-compose.backend.dev.yml +++ b/internal/suites/example/compose/authelia/docker-compose.backend.dev.yml @@ -7,8 +7,13 @@ services: args: USER_ID: ${USER_ID} GROUP_ID: ${GROUP_ID} + security_opt: + - seccomp:unconfined + - apparmor:unconfined command: /resources/entrypoint-backend.sh working_dir: /app + cap_add: + - SYS_PTRACE volumes: - './example/compose/authelia/resources/:/resources' - '../..:/app' diff --git a/internal/suites/example/compose/authelia/resources/entrypoint-backend.sh b/internal/suites/example/compose/authelia/resources/entrypoint-backend.sh index f6290ea38..6446f8d21 100755 --- a/internal/suites/example/compose/authelia/resources/entrypoint-backend.sh +++ b/internal/suites/example/compose/authelia/resources/entrypoint-backend.sh @@ -2,8 +2,14 @@ set -x +# We move out of the workspace to not include the modules as dependencies of the project. +cd / + echo "Use hot reloaded version of Authelia backend" go get github.com/cespare/reflex +go get github.com/go-delve/delve/cmd/dlv + +cd /app # Sleep 10 seconds to wait the end of npm install updating web directory # and making reflex reload multiple times. diff --git a/internal/suites/example/compose/authelia/resources/run-backend-dev.sh b/internal/suites/example/compose/authelia/resources/run-backend-dev.sh index a809cf089..67fb450df 100755 --- a/internal/suites/example/compose/authelia/resources/run-backend-dev.sh +++ b/internal/suites/example/compose/authelia/resources/run-backend-dev.sh @@ -2,10 +2,8 @@ set -e -# Build the binary -go build -o /tmp/authelia/authelia-tmp cmd/authelia/*.go while true; do - /tmp/authelia/authelia-tmp --config /etc/authelia/configuration.yml + dlv --listen 0.0.0.0:2345 --headless=true --continue --accept-multiclient debug cmd/authelia/*.go -- --config /etc/authelia/configuration.yml sleep 10 done \ No newline at end of file