diff --git a/host_vars/lasagne.binary.kitchen b/host_vars/lasagne.binary.kitchen index 35bbb57..be19262 100644 --- a/host_vars/lasagne.binary.kitchen +++ b/host_vars/lasagne.binary.kitchen @@ -41,6 +41,7 @@ mosquitto_bridges: ha_version: "2025.1.0" ha_pg_db_pass: "{{ vault_ha_pg_db_pass }}" ha_pg_grafana_db_pass: "{{ vault_ha_pg_grafana_db_pass }}" +pgadmin4_subfolder: "/api/ingress/pgadmin4" pgadmin4_db_password: "{{ vault_pgadmin4_db_password }}" pgadmin4_initial_user_email: noby@binary-kitchen.de pgadmin4_initial_user_password: "{{ vault_pgadmin4_initial_user_password }}" diff --git a/roles/homeassistant/templates/vhost.j2 b/roles/homeassistant/templates/vhost.j2 index c7a7497..e3e5101 100644 --- a/roles/homeassistant/templates/vhost.j2 +++ b/roles/homeassistant/templates/vhost.j2 @@ -32,8 +32,10 @@ server { proxy_pass http://localhost:3000; } - location = /pgadmin4 { rewrite ^ /pgadmin4/; } - location /pgadmin4 { try_files $uri @pgadmin4; } + location /api/ingress/pgadmin4 { + try_files $uri @pgadmin4; + } + location @pgadmin4 { include uwsgi_params; uwsgi_pass unix:/run/pgadmin4/pgadmin4.sock; diff --git a/roles/pgadmin4/defaults/main.yml b/roles/pgadmin4/defaults/main.yml index 7da5e34..a5310f9 100644 --- a/roles/pgadmin4/defaults/main.yml +++ b/roles/pgadmin4/defaults/main.yml @@ -5,6 +5,7 @@ pgadmin4_db_database: pgadmin4 pgadmin4_db_user: pgadmin4 pgadmin4_db_password: xxxxx pgadmin4_conf_dir: /etc/pgadmin +pgadmin4_subfolder: /pgadmin4 pgadmin4_initial_user_email: admin@admin.com pgadmin4_initial_user_password: admin42 diff --git a/roles/pgadmin4/templates/pgadmin4.service.j2 b/roles/pgadmin4/templates/pgadmin4.service.j2 index cfa45aa..bcc92b9 100644 --- a/roles/pgadmin4/templates/pgadmin4.service.j2 +++ b/roles/pgadmin4/templates/pgadmin4.service.j2 @@ -16,7 +16,7 @@ ExecStart=uwsgi \ --threads 25 \ --chdir /usr/pgadmin4/web/ \ --manage-script-name \ - --mount /pgadmin4=pgAdmin4:app + --mount {{ pgadmin4_subfolder }}=pgAdmin4:app ExecReload=/bin/kill -HUP $MAINPID ExecStop=/bin/kill -INT $MAINPID Restart=always