[download-web] Make database port configurable



commit 97d7ea2b010170fc3772990c810853505c83e552
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Tue Jul 7 13:46:15 2020 +0200

    Make database port configurable

 download.gnome.org.conf           | 2 +-
 entrypoint.sh                     | 2 ++
 mirrorbrain.conf                  | 1 +
 templates/create-hashes-cron.yaml | 6 ++++++
 templates/db-vacuum-cron.yaml     | 6 ++++++
 templates/mirrorprobe-cron.yaml   | 6 ++++++
 templates/mirrors-scan-cron.yaml  | 6 ++++++
 7 files changed, 28 insertions(+), 1 deletion(-)
---
diff --git a/download.gnome.org.conf b/download.gnome.org.conf
index 3f9c7e9..d8277b2 100644
--- a/download.gnome.org.conf
+++ b/download.gnome.org.conf
@@ -9,7 +9,7 @@
 </IfModule>
 
 DBDriver pgsql
-DBDParams "host=DB_HOST user=DB_USER password=DB_PASSWORD dbname=DB_NAME connect_timeout=15"
+DBDParams "host=DB_HOST port=DB_PORT user=DB_USER password=DB_PASSWORD dbname=DB_NAME connect_timeout=15"
 
 LoadModule form_module modules/mod_form.so
 LoadModule mirrorbrain_module modules/mod_mirrorbrain.so
diff --git a/entrypoint.sh b/entrypoint.sh
index 3247c13..575717e 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -1,11 +1,13 @@
 #!/bin/bash
 
 sed -i "s/DB_HOST/$DB_HOST/g" /download/mirrorbrain.conf
+sed -i "s/DB_PORT/$DB_PORT/g" /download/mirrorbrain.conf
 sed -i "s/DB_NAME/$DB_NAME/g" /download/mirrorbrain.conf
 sed -i "s/DB_USER/$DB_USER/g" /download/mirrorbrain.conf
 sed -i "s/DB_PASSWORD/$DB_PASSWORD/g" /download/mirrorbrain.conf
 
 sed -i "s/DB_HOST/$DB_HOST/g" /download/httpd.conf
+sed -i "s/DB_PORT/$DB_PORT/g" /download/httpd.conf
 sed -i "s/DB_NAME/$DB_NAME/g" /download/httpd.conf
 sed -i "s/DB_USER/$DB_USER/g" /download/httpd.conf
 sed -i "s/DB_PASSWORD/$DB_PASSWORD/g" /download/httpd.conf
diff --git a/mirrorbrain.conf b/mirrorbrain.conf
index 46e69f9..b524d7d 100644
--- a/mirrorbrain.conf
+++ b/mirrorbrain.conf
@@ -7,6 +7,7 @@ dbpass = DB_PASSWORD
 dbdriver = postgresql
 dbhost = DB_HOST
 dbname = DB_NAME
+dbport = DB_PORT
 
 [mirrorprobe]
 logfile = /download/mirrorprobe.log
diff --git a/templates/create-hashes-cron.yaml b/templates/create-hashes-cron.yaml
index 804f99d..6352cc9 100644
--- a/templates/create-hashes-cron.yaml
+++ b/templates/create-hashes-cron.yaml
@@ -19,6 +19,7 @@ spec:
             command: ["/bin/sh", "-c"]
             args:
             - sed -i "s/DB_HOST/$DB_HOST/g" /download/mirrorbrain.conf;
+              sed -i "s/DB_PORT/$DB_PORT/g" /download/mirrorbrain.conf;
               sed -i "s/DB_NAME/$DB_NAME/g" /download/mirrorbrain.conf;
               sed -i "s/DB_USER/$DB_USER/g" /download/mirrorbrain.conf;
               sed -i "s/DB_PASSWORD/$DB_PASSWORD/g" /download/mirrorbrain.conf;
@@ -39,6 +40,11 @@ spec:
                 secretKeyRef:
                   name: download-web
                   key: database-host
+            - name: DB_PORT
+              valueFrom:
+                secretKeyRef:
+                  name: download-web
+                  key: database-port
             - name: DB_PASSWORD
               valueFrom:
                 secretKeyRef:
diff --git a/templates/db-vacuum-cron.yaml b/templates/db-vacuum-cron.yaml
index 8498627..3a7a5e0 100644
--- a/templates/db-vacuum-cron.yaml
+++ b/templates/db-vacuum-cron.yaml
@@ -19,6 +19,7 @@ spec:
             command: ["/bin/sh", "-c"]
             args:
             - sed -i "s/DB_HOST/$DB_HOST/g" /download/mirrorbrain.conf;
+              sed -i "s/DB_PORT/$DB_PORT/g" /download/mirrorbrain.conf;
               sed -i "s/DB_NAME/$DB_NAME/g" /download/mirrorbrain.conf;
               sed -i "s/DB_USER/$DB_USER/g" /download/mirrorbrain.conf;
               sed -i "s/DB_PASSWORD/$DB_PASSWORD/g" /download/mirrorbrain.conf;
@@ -39,6 +40,11 @@ spec:
                 secretKeyRef:
                   name: download-web
                   key: database-host
+            - name: DB_PORT
+              valueFrom:
+                secretKeyRef:
+                  name: download-web
+                  key: database-port
             - name: DB_PASSWORD
               valueFrom:
                 secretKeyRef:
diff --git a/templates/mirrorprobe-cron.yaml b/templates/mirrorprobe-cron.yaml
index 270c171..b6c11d6 100644
--- a/templates/mirrorprobe-cron.yaml
+++ b/templates/mirrorprobe-cron.yaml
@@ -19,6 +19,7 @@ spec:
             command: ["/bin/sh", "-c"]
             args:
             - sed -i "s/DB_HOST/$DB_HOST/g" /download/mirrorbrain.conf;
+              sed -i "s/DB_PORT/$DB_PORT/g" /download/mirrorbrain.conf;
               sed -i "s/DB_NAME/$DB_NAME/g" /download/mirrorbrain.conf;
               sed -i "s/DB_USER/$DB_USER/g" /download/mirrorbrain.conf;
               sed -i "s/DB_PASSWORD/$DB_PASSWORD/g" /download/mirrorbrain.conf;
@@ -39,6 +40,11 @@ spec:
                 secretKeyRef:
                   name: download-web
                   key: database-host
+            - name: DB_PORT
+              valueFrom:
+                secretKeyRef:
+                  name: download-web
+                  key: database-port
             - name: DB_PASSWORD
               valueFrom:
                 secretKeyRef:
diff --git a/templates/mirrors-scan-cron.yaml b/templates/mirrors-scan-cron.yaml
index dc600df..ae8e5b0 100644
--- a/templates/mirrors-scan-cron.yaml
+++ b/templates/mirrors-scan-cron.yaml
@@ -19,6 +19,7 @@ spec:
             command: ["/bin/sh", "-c"]
             args:
             - sed -i "s/DB_HOST/$DB_HOST/g" /download/mirrorbrain.conf;
+              sed -i "s/DB_PORT/$DB_PORT/g" /download/mirrorbrain.conf;
               sed -i "s/DB_NAME/$DB_NAME/g" /download/mirrorbrain.conf;
               sed -i "s/DB_USER/$DB_USER/g" /download/mirrorbrain.conf;
               sed -i "s/DB_PASSWORD/$DB_PASSWORD/g" /download/mirrorbrain.conf;
@@ -39,6 +40,11 @@ spec:
                 secretKeyRef:
                   name: download-web
                   key: database-host
+            - name: DB_PORT
+              valueFrom:
+                secretKeyRef:
+                  name: download-web
+                  key: database-port
             - name: DB_PASSWORD
               valueFrom:
                 secretKeyRef:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]