Implemented not working oauth2-proxy draft

This commit is contained in:
2025-01-26 13:25:39 +01:00
parent e6292663b4
commit 7b9959af21
8 changed files with 61 additions and 13 deletions

View File

@@ -22,6 +22,8 @@ services:
{% include 'templates/docker/services/' + database_type + '.yml.j2' %}
{% include 'templates/docker/services/oauth2-proxy.yml.j2' %}
cache:
image: memcached
container_name: openproject-memcached
@@ -38,7 +40,7 @@ services:
container_name: openproject-proxy
command: "./docker/prod/proxy"
ports:
- "${PORT}:80"
- "127.0.0.1:{{http_port}}:80"
environment:
APP_HOST: web
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
@@ -79,8 +81,8 @@ services:
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
AUTOHEAL_CONTAINER_LABEL: autoheal
AUTOHEAL_START_PERIOD: 600
AUTOHEAL_INTERVAL: 30
AUTOHEAL_START_PERIOD: 600
AUTOHEAL_INTERVAL: 30
worker:
<<: *app

View File

@@ -8,7 +8,6 @@
#
OPENPROJECT_HTTPS=true
OPENPROJECT_HOST__NAME={{domain}}
PORT=127.0.0.1:{{http_port}}
OPENPROJECT_RAILS__RELATIVE__URL__ROOT=
IMAP_ENABLED=false
POSTGRES_PASSWORD="{{ database_password }}"

View File

@@ -5,4 +5,7 @@ database_password: "{{openproject_database_password}}"
repository_address: "https://github.com/opf/openproject-deploy"
database_type: "postgres"
# The following volume doesn't have a practcical function. It just exist to prevent the creation of unnecessary anonymous volumes
dummy_volume: "{{repository_directory}}dummy_volume"
dummy_volume: "{{repository_directory}}dummy_volume"
oauth2_proxy_client_secret: "{{openproject_oauth2_proxy_client_secret}}"
oauth2_proxy_cookie_secret: "{{openproject_oauth2_proxy_cookie_secret}}"
#oauth2_proxy_upstream_application: ""

View File

@@ -2,6 +2,18 @@ server
{
server_name {{domain}};
# Include OAuth2 Proxy
{% if oauth2_proxy_active | bool %}
# OAuth2-Proxy-Endpunkte
location /oauth2/ {
proxy_pass http://127.0.0.1:{{oauth2_proxy_port}};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
{% endif %}
# Include Matomo Tracking Code
{% if nginx_matomo_tracking | bool %}
{% include 'roles/nginx-matomo-tracking/templates/matomo-tracking.conf.j2' %}

View File

@@ -1,5 +1,10 @@
location /
{
{% if oauth2_proxy_active | bool %}
auth_request /oauth2/auth;
error_page 401 = /oauth2/start;
{% endif %}
proxy_pass http://127.0.0.1:{{http_port}}/;
# headers