[DEV] Debug authelia when running a suite. (#1060)
* [DEV] Debug authelia when running a suite. This runs dlv debugger within authelia backend container so that an IDE can remote debug the application using port 2345. * Apply suggestions from code review Co-authored-by: Amir Zarrinkafsh <nightah@me.com>pull/1062/head^2
parent
7dc79b2ac4
commit
eec6424bc9
|
@ -44,3 +44,5 @@ Configuration.schema.json
|
|||
qemu-*-static
|
||||
|
||||
public_html.gen.go
|
||||
|
||||
__debug_bin
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue