From eb07b98d43ac687858aa6391b596a9c2730e204a Mon Sep 17 00:00:00 2001 From: Ervins Rungis Date: Wed, 30 Oct 2024 15:25:20 +0200 Subject: [PATCH 1/3] blank commit with whitespace --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d1583ab..e459439b 100644 --- a/README.md +++ b/README.md @@ -661,6 +661,6 @@ Draupnir. Common causes for an invalid refresh token are: - The user has revoked the application's third-party access in the Google - account dashboard. + account dashboard. - The user is suspended via G Suite. - The user has been deleted. From ec2e195e682b9917301e370a32690e0672235191 Mon Sep 17 00:00:00 2001 From: Ervins Rungis Date: Wed, 30 Oct 2024 17:13:18 +0200 Subject: [PATCH 2/3] PDFR-43151 Fixing failing tests. Need to upgrade dependencies but ran into test issues Tests were failing with: ``` 13 examples, 5 failures Failed examples: rspec ./spec/draupnir/instance_spec.rb:67 # /instances POST /instances creates the instance if given a ready image rspec ./spec/draupnir/instance_spec.rb:117 # /instances GET /instances returns a JSON payload showing the instance rspec ./spec/draupnir/instance_spec.rb:143 # /instances GET /instances/:id shows the given instance rspec ./spec/draupnir/instance_spec.rb:184 # /instances GET /instances/:id returns the correct credentials for a given instance rspec ./spec/draupnir/instance_spec.rb:208 # /instances DELETE /instances/:id deletes the instance and returns a 204 make: *** [Makefile:26: test-integration] Error 1 ``` When container is built it is running tests towards it, it fails to create instance with error: ``` time="2024-10-30T14:03:18Z" level=info msg="Creating instance" client_ip_address=192.168.127.1 environment=test error="exit status 1" .... error: connection to server at \"localhost\" (::1), port 17007 failed: FATAL: no pg_hba.conf entry for host \"::1\", user \"draupnir\", database \"postgres\", no encryption\n+ echo 'INFO: Not able to connect via non-TLS connection' ... nINFO: Not able to connect without client certificate\nStopping instance\nwaiting for server to shut down.... done\nserver stopped\n" ``` so therefore we are met with 500 error: `time="2024-10-30T14:03:18Z" level=info msg="POST /instances 500 0.790049" client_ip_address=192.168.127.1 duration=0.790048763 environment=test error="failed to create instance: exit status 1"` I modified current pg_hba.conf: ``` local all all trust hostssl all draupnir 0.0.0.0/0 cert map=draupnir ``` to ``` local all all trust hostssl all draupnir 127.0.0.1/32 cert map=draupnir hostssl all draupnir ::1/128 cert map=draupnir hostssl all draupnir 0.0.0.0/0 cert map=draupnir ``` With these changes: * We retain local trust for all users and dbs; * Added explicit localhost rule that will allows local connections, also from ipv6 on local podman setup. * All hostssl entries continue to use the cert auth with map=draupnir. and the result = `13 examples, 0 failures` --- cmd/draupnir-finalise-image | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/draupnir-finalise-image b/cmd/draupnir-finalise-image index 4539f9d2..7368e27e 100755 --- a/cmd/draupnir-finalise-image +++ b/cmd/draupnir-finalise-image @@ -84,10 +84,13 @@ cat > "${UPLOAD_PATH}/pg_hba.conf" < Date: Wed, 30 Oct 2024 17:18:54 +0200 Subject: [PATCH 3/3] revert readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e459439b..6d1583ab 100644 --- a/README.md +++ b/README.md @@ -661,6 +661,6 @@ Draupnir. Common causes for an invalid refresh token are: - The user has revoked the application's third-party access in the Google - account dashboard. + account dashboard. - The user is suspended via G Suite. - The user has been deleted.