Compare commits

...

24 Commits

Author SHA1 Message Date
awieczarek
4de784eb54 Test 2024-10-23 13:05:11 +02:00
awieczarek
1126f1f12e Test 2024-10-23 13:03:48 +02:00
awieczarek
6ef5d5d1e6 Test 2024-10-23 13:02:27 +02:00
awieczarek
e76265b68d Test 2024-10-23 13:01:17 +02:00
awieczarek
b56fa05ddf Test 2024-10-23 12:58:07 +02:00
awieczarek
836df4270e Test 2024-10-23 12:54:51 +02:00
awieczarek
b322b0e35c Test 2024-10-23 12:50:41 +02:00
awieczarek
d000f389e7 Test 2024-10-23 12:49:39 +02:00
awieczarek
faaabd1200 Test 2024-10-23 12:46:16 +02:00
awieczarek
0824676343 Test 2024-10-23 12:42:51 +02:00
awieczarek
c9105f300c Test 2024-10-23 12:39:24 +02:00
awieczarek
b61bee0220 Test 2024-10-23 12:36:29 +02:00
awieczarek
9687f022af Test 2024-10-23 12:33:11 +02:00
awieczarek
a2cc89f0ec Test 2024-10-23 12:29:23 +02:00
awieczarek
85546a29a1 Test 2024-10-23 12:26:05 +02:00
awieczarek
b38f9a0eb1 Test 2024-10-23 12:22:23 +02:00
awieczarek
319abacc59 Test 2024-10-23 12:20:35 +02:00
awieczarek
b164162f3d Test 2024-10-23 12:18:56 +02:00
awieczarek
2c9afae4d5 Test 2024-10-23 12:18:35 +02:00
awieczarek
d722cdac45 Test 2024-10-23 12:15:54 +02:00
awieczarek
a01d30819a Test 2024-10-23 12:12:36 +02:00
awieczarek
736eb33ee0 Test 2024-10-23 12:09:27 +02:00
awieczarek
0a5457ab16 Test 2024-10-23 12:08:26 +02:00
awieczarek
b68433891e Test 2024-10-23 12:06:45 +02:00
4 changed files with 35 additions and 19 deletions

View File

@ -1,8 +1,19 @@
FROM gitea/gitea:1.14.5-rootless
ADD data /var/lib/gitea
ADD conf/ /var/lib/gitea/custom/conf/
ADD config /etc/gitea
ADD data /var/lib/gitea
ADD localtime /etc/localtime
ADD timezone /etc/timezone
COPY parse_db_url.sh /usr/local/bin/parse_db_url.sh
USER root
RUN chmod 755 /usr/local/bin/parse_db_url.sh
USER 1000:1000
ENV DATABASE_URL=${DATABASE_URL}
CMD ["/usr/local/bin/parse_db_url.sh"]

View File

@ -1,7 +0,0 @@
[database]
DB_TYPE = postgres
HOST = db:5432
NAME = gitea
USER = gitea
PASSWD = gitea
SSL_MODE = require

View File

@ -16,6 +16,3 @@ build:
GITEA__database__NAME: gitea
GITEA__database__USER: gitea
GITEA__database__PASSWD: gitea
run:
web: /usr/local/bin/gitea web -port $PORT

View File

@ -1,12 +1,27 @@
#!/bin/sh
export GITEA__database__DB_TYPE=${DATABASE_URL%%:*}
export GITEA__database__USER=$(echo ${DATABASE_URL} | sed -r "s|.*://([^:]+):.*|\1|")
export GITEA__database__PASSWD=$(echo ${DATABASE_URL} | sed -r "s|.*://[^:]+:([^@]+)@.*|\1|")
export GITEA__database__HOST=$(echo ${DATABASE_URL} | sed -r "s|.*@([^:]+):.*|\1|")
export GITEA__database__NAME=$(echo ${DATABASE_URL} | sed -r "s|.*:([0-9]+)/([^?]+).*|\2|")
DATABASE_URL=$(echo $DATABASE_URL)
echo $DATABASE_URL
echo $GITEA__database__NAME
DB_TYPE="postgres"
USER=$(echo $DATABASE_URL | sed -e 's,.*//\(.*\):.*@.*,\1,')
PASSWD=$(echo $DATABASE_URL | sed -e 's,.*//.*:\(.*\)@.*,\1,')
HOST=$(echo $DATABASE_URL | sed -e 's,.*@\(.*\):\(.*\)/.*,\1,')
PORT_DB=$(echo $DATABASE_URL | sed -e 's,.*@.*:\(.*\)/.*,\1,')
NAME=$(echo $DATABASE_URL | sed -e 's,.*/\(.*\)$,\1,')
exec /usr/local/bin/gitea web -port $PORT
SSL_MODE="require"
printf "\n[server]\n" >> /var/lib/gitea/custom/conf/app.ini
printf "HTTP_PORT = $PORT\n" >> /var/lib/gitea/custom/conf/app.ini
printf "[database]\n" >> /var/lib/gitea/custom/conf/app.ini
printf "DB_TYPE = $DB_TYPE\n" >> /var/lib/gitea/custom/conf/app.ini
printf "HOST = $HOST:$PORT_DB\n" >> /var/lib/gitea/custom/conf/app.ini
printf "NAME = $NAME\n" >> /var/lib/gitea/custom/conf/app.ini
printf "USER = $USER\n" >> /var/lib/gitea/custom/conf/app.ini
printf "PASSWD = $PASSWD\n" >> /var/lib/gitea/custom/conf/app.ini
printf "SSL_MODE = $SSL_MODE\n" >> /var/lib/gitea/custom/conf/app.ini
cat /var/lib/gitea/custom/conf/app.ini
/usr/local/bin/gitea web -port $PORT