From 06ec5880d9b4e3d73d5e55289fed5f2e57ff239d Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Jun 03 2019 08:37:49 +0000 Subject: [docker] run httpd on port 5000 instead of 80 We wouldn't need to do this because of httpd, however there is a following use-case supervisorctl stop httpd sudo -u copr-fe python3 /opt/copr/frontend/coprs_frontend/manage.py \ runserver -p 80 -h 0.0.0.0 --no-reload which won't work because a non-root user can't start a server on privileged port (bellow 1024). Therefore, we need to switch to using 5000 for both `manage.py` server and httpd. I really dislike this change, so if you know how allow running the runserver command as `copr-fe` user on port `80`, please do so and then revert this commit. --- diff --git a/docker-compose.yaml b/docker-compose.yaml index 77a732d..221b828 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -45,7 +45,7 @@ services: stdin_open: true tty: true ports: - - "5000:80" + - "5000:5000" volumes: - .:/opt/copr:z diff --git a/docker/backend/files/etc/copr/copr-be.conf b/docker/backend/files/etc/copr/copr-be.conf index d011b6d..9349042 100644 --- a/docker/backend/files/etc/copr/copr-be.conf +++ b/docker/backend/files/etc/copr/copr-be.conf @@ -8,7 +8,7 @@ results_baseurl=http://backend/results/ # default is http://coprs/rest/api #frontend_base_url=http://localhost:5000 -frontend_base_url=http://frontend +frontend_base_url=http://frontend:5000 # must have same value as BACKEND_PASSWORD from have frontend in /etc/copr/copr.conf # default is PASSWORDHERE but you really should change it. really. diff --git a/docker/builder/files/etc/copr-rpmbuild/main.ini b/docker/builder/files/etc/copr-rpmbuild/main.ini index 9f5b40a..63f64ed 100644 --- a/docker/builder/files/etc/copr-rpmbuild/main.ini +++ b/docker/builder/files/etc/copr-rpmbuild/main.ini @@ -1,5 +1,5 @@ [main] -frontend_url = http://frontend +frontend_url = http://frontend:5000 enabled_source_protocols = https ftps [distgit0] diff --git a/docker/distgit/Dockerfile b/docker/distgit/Dockerfile index e721dd0..10b4d72 100644 --- a/docker/distgit/Dockerfile +++ b/docker/distgit/Dockerfile @@ -28,7 +28,7 @@ RUN mkdir /tmp/copr-dist-git RUN chown copr-dist-git:packager /tmp/copr-dist-git RUN echo "[dist-git]" > /etc/copr/copr-dist-git.conf && \ - echo "frontend_base_url=http://frontend" >> /etc/copr/copr-dist-git.conf && \ + echo "frontend_base_url=http://frontend:5000" >> /etc/copr/copr-dist-git.conf && \ echo "frontend_auth=1234" >> /etc/copr/copr-dist-git.conf && \ chmod 644 /etc/copr/copr-dist-git.conf diff --git a/docker/frontend/files/etc/copr/copr.conf b/docker/frontend/files/etc/copr/copr.conf index a4a9173..6bc1eaf 100644 --- a/docker/frontend/files/etc/copr/copr.conf +++ b/docker/frontend/files/etc/copr/copr.conf @@ -81,7 +81,7 @@ SEND_EMAILS = False #} PUBLIC_COPR_HOSTNAME = 'localhost:5000' -PUBLIC_COPR_BASE_URL = 'http://frontend' +PUBLIC_COPR_BASE_URL = 'http://frontend:5000' BACKEND_BASE_URL = 'http://localhost:5002' DIST_GIT_CLONE_URL = 'http://distgit/git/' diff --git a/docker/frontend/files/etc/httpd/conf.d/copr.conf b/docker/frontend/files/etc/httpd/conf.d/copr.conf index 652d8ce..4ca20c4 100644 --- a/docker/frontend/files/etc/httpd/conf.d/copr.conf +++ b/docker/frontend/files/etc/httpd/conf.d/copr.conf @@ -1,3 +1,5 @@ +Listen 5000 + WSGIPassAuthorization On WSGIDaemonProcess 127.0.0.1 user=copr-fe group=copr-fe threads=5