This commit is contained in:
awieczarek 2024-10-23 12:39:24 +02:00
parent b61bee0220
commit c9105f300c
2 changed files with 5 additions and 2 deletions

View File

@ -10,6 +10,11 @@ COPY parse_db_url.sh /usr/local/bin/parse_db_url.sh
USER root USER root
RUN chmod 755 /usr/local/bin/parse_db_url.sh RUN chmod 755 /usr/local/bin/parse_db_url.sh
RUN useradd -ms /bin/bash customuser && \
chown -R customuser:customuser /var/lib/gitea/custom
USER customuser
ENV DATABASE_URL=${DATABASE_URL} ENV DATABASE_URL=${DATABASE_URL}
CMD ["/usr/local/bin/parse_db_url.sh"] CMD ["/usr/local/bin/parse_db_url.sh"]

View File

@ -1,7 +1,5 @@
#!/bin/sh #!/bin/sh
exec mkdir /var/lib/gitea/custom/conf
export GITEA__database__DB_TYPE=postgres export GITEA__database__DB_TYPE=postgres
export GITEA__database__USER=$(echo ${DATABASE_URL} | sed -r "s|.*://([^:]+):.*|\1|") 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__PASSWD=$(echo ${DATABASE_URL} | sed -r "s|.*://[^:]+:([^@]+)@.*|\1|")