Skip to contentSkip to conversation

include Dockerfile used to proxy qemu.org to gitlab.io

PATCH In review Paolo Bonzini 2 participants 2 messages Jun 16, 2023 – Jun 21, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include Dockerfile used to proxy qemu.org to gitlab.io

The server configuration used to actually publish qemu-web.git to qemu.org together with the sphinx documentation, right now, is hidden in the machine that runs qemu.org.

Include it in the qemu-web.git website for documentation purpose, in the format of a Dockerfile that you can use to run your own qemu.org website.

Note: this container is not yet in use, but it is already live and can be tested by adding

20.218.253.93 qemu.org www.qemu.org git.qemu.org qemu-project.org www.qemu-project.org git.qemu-project.org

to your /etc/hosts file.

---
 container/Dockerfile         |  6 ++++
 container/README             | 31 +++++++++++++++++++++
 container/conf.d/git.conf    | 13 +++++++++
 container/conf.d/noname.conf | 11 ++++++++
 container/conf.d/ssl.conf    |  1 +
 container/conf.d/www.conf    | 54 ++++++++++++++++++++++++++++++++++++
 6 files changed, 116 insertions(+)
 create mode 100644 container/Dockerfile
 create mode 100644 container/README
 create mode 100644 container/conf.d/git.conf
 create mode 100644 container/conf.d/noname.conf
 create mode 100644 container/conf.d/ssl.conf
 create mode 100644 container/conf.d/www.conf
container/Dockerfile new file +6 -0
new file mode 100644
index 0000000..e22d646
@@ -0,0 +1,6 @@
+FROM quay.io/centos/centos:stream9
+EXPOSE 80
+RUN dnf install -y httpd-core mod_ssl
+COPY conf.d /etc/httpd/conf.d
+CMD /usr/sbin/httpd -DNO_DETACH -DFOREGROUND
+
container/README new file +31 -0
new file mode 100644
index 0000000..ea764ff
@@ -0,0 +1,31 @@
+This is a Dockerfile for a container that serves the following hosts:
+
+- qemu.org, www.qemu.org: a proxy server that "hides" the fact that
+  the QEMU web pages are actually hosted as GitLab pages under either
+  qemu-project.gitlab.io/qemu (the documentation) or
+  qemu-project.gitlab.io/qemu-web (the main website)
+
+- git.qemu.org: a simple redirect to gitlab.com/qemu-project for
+  both web browsers and git's smart HTTP backend
+
+
+A sample systemd service that publishes the website on port 8082
+is as follows:
+
+```
+[Unit]
+Description=Podman instance control service for Apache proxy server
+Requires=network.target
+After=network.target
+StartLimitIntervalSec=0
+
+[Service]
+Restart=always
+ExecStartPre=-podman stop qemu-web ; -podman rm qemu-web
+ExecStart=podman run --name qemu-web --publish=8082:80 qemu:qemu-web
+ExecStop=podman stop -t 10 qemu-web
+RestartSec=60
+
+[Install]
+WantedBy=default.target
+```
container/conf.d/git.conf new file +13 -0
new file mode 100644
index 0000000..13093c5
@@ -0,0 +1,13 @@
+<VirtualHost *:80>
+    ServerName git.qemu.org
+    ServerAlias git.qemu.org
+
+    RewriteEngine On
+
+    RewriteRule ^/(git/)?([^/?;]+)\.git(/?|/HEAD|/info/.*|/objects/.*|/git-(upload|receive)-pack)$ http://gitlab.com/qemu-project/$2$3 [R,L]
+    RewriteRule ^/$  https://gitlab.com/qemu-project/ [R]
+    RewriteRule ^(/[^/?;]+\.git)$ https://gitlab.com/qemu-project/$1/ [R]
+
+    Options -Indexes
+
+</VirtualHost>
container/conf.d/noname.conf new file +11 -0
new file mode 100644
index 0000000..db17b95
@@ -0,0 +1,11 @@
+<VirtualHost *:80>
+    ServerName qemu.org
+    ServerAlias qemu.org
+
+    RewriteEngine On
+
+    RewriteRule ^(.*) https://www.qemu.org$0 [R=301]
+
+    Options -Indexes
+
+</VirtualHost>
container/conf.d/ssl.conf new file +1 -0
new file mode 100644
index 0000000..b56a8a8
@@ -0,0 +1 @@
+# do nothing, ssl is handled outside the container
container/conf.d/www.conf new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.40.1
Acked-by on v1 1/1
#1 lore raw
Quoted 24 lines · Paolo Bonzini

The server configuration used to actually publish qemu-web.git to qemu.org together with the sphinx documentation, right now, is hidden in the machine that runs qemu.org.

Include it in the qemu-web.git website for documentation purpose, in the format of a Dockerfile that you can use to run your own qemu.org website.

Note: this container is not yet in use, but it is already live and can be tested by adding

20.218.253.93 qemu.org www.qemu.org git.qemu.org qemu-project.org www.qemu-project.org git.qemu-project.org

to your /etc/hosts file.

---
  container/Dockerfile         |  6 ++++
  container/README             | 31 +++++++++++++++++++++
  container/conf.d/git.conf    | 13 +++++++++
  container/conf.d/noname.conf | 11 ++++++++
  container/conf.d/ssl.conf    |  1 +
  container/conf.d/www.conf    | 54 ++++++++++++++++++++++++++++++++++++
  6 files changed, 116 insertions(+)
Quoted 6 lines

create mode 100644 container/Dockerfile
create mode 100644 container/README
create mode 100644 container/conf.d/git.conf
create mode 100644 container/conf.d/noname.conf
create mode 100644 container/conf.d/ssl.conf
create mode 100644 container/conf.d/www.conf