From 8a36283fe079cc3164edfb48d7b4b5d9aec287df Mon Sep 17 00:00:00 2001 From: ItsNiklas Date: Sun, 24 Sep 2023 20:46:23 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(patches):=20Attempt=20to=20fix?= =?UTF-8?q?=20#1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domjudge-packaging/docker/domserver/Dockerfile | 10 +++++----- .../20-add-firewall-remote-user.py | 12 ------------ .../remote_user_scripts/90-add-nginx-remote-user.sh | 5 ----- 3 files changed, 5 insertions(+), 22 deletions(-) delete mode 100755 domjudge-packaging/docker/examples/remote_user_scripts/20-add-firewall-remote-user.py delete mode 100755 domjudge-packaging/docker/examples/remote_user_scripts/90-add-nginx-remote-user.sh diff --git a/domjudge-packaging/docker/domserver/Dockerfile b/domjudge-packaging/docker/domserver/Dockerfile index 73fbdaa..52a9f25 100644 --- a/domjudge-packaging/docker/domserver/Dockerfile +++ b/domjudge-packaging/docker/domserver/Dockerfile @@ -40,11 +40,6 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ ADD domjudge.tar.gz /domjudge-src COPY domserver/build.sh /domjudge-src/build.sh -# Apply patches -COPY domserver/scripts/patches.sh /scripts/patches.sh -COPY domserver/scripts/patches.d /scripts/patches.d -RUN chmod 700 /scripts/patches.sh && /scripts/patches.sh - # Build and install domserver RUN /domjudge-src/build.sh @@ -103,6 +98,11 @@ ENV PATH="$PATH:/opt/domjudge/domserver/bin" COPY domserver/configure.sh /configure.sh RUN chmod 700 /configure.sh && /configure.sh && rm -f /configure.sh +# Apply patches +COPY domserver/scripts/patches.sh /scripts/patches.sh +COPY domserver/scripts/patches.d /scripts/patches.d +RUN chmod 700 /scripts/patches.sh && /scripts/patches.sh + # Expose HTTP port EXPOSE 80 diff --git a/domjudge-packaging/docker/examples/remote_user_scripts/20-add-firewall-remote-user.py b/domjudge-packaging/docker/examples/remote_user_scripts/20-add-firewall-remote-user.py deleted file mode 100755 index e840a7c..0000000 --- a/domjudge-packaging/docker/examples/remote_user_scripts/20-add-firewall-remote-user.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python3 - -import yaml - -security_path = "/opt/domjudge/domserver/webapp/config/packages/security.yaml" - -if __name__ == "__main__": - with open(security_path, mode="rt") as f: - security = yaml.load(f, Loader=yaml.FullLoader) - security["security"]["firewalls"]["main"]["remote_user"] = {"provider": "domjudge_db_provider"} - with open(security_path, mode="wt") as f: - yaml.dump(security, f) diff --git a/domjudge-packaging/docker/examples/remote_user_scripts/90-add-nginx-remote-user.sh b/domjudge-packaging/docker/examples/remote_user_scripts/90-add-nginx-remote-user.sh deleted file mode 100755 index ec2ed6a..0000000 --- a/domjudge-packaging/docker/examples/remote_user_scripts/90-add-nginx-remote-user.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e - -# shellcheck disable=SC2154 -sed -i "s!fastcgi_param *REMOTE_USER *$remote_user;!fastcgi_param REMOTE_USER $http_remote_user;!g" /etc/nginx/fastcgi_params -echo 'underscores_in_headers on;' >> /etc/nginx/snippets/domjudge-inner