summaryrefslogtreecommitdiffstats
path: root/.gitpod.yml
diff options
context:
space:
mode:
authorYarden Shoham <git@yardenshoham.com>2024-02-14 00:57:55 +0200
committerGitHub <noreply@github.com>2024-02-13 17:57:55 -0500
commit4f346916838fcc95c6d7eb574145c8b78f7ac726 (patch)
tree3072e19288662c99a8ff8c96399d8416dd25af50 /.gitpod.yml
parenta8748eedae3518550bd43fd592d206df2bea6bef (diff)
downloadgitea-4f346916838fcc95c6d7eb574145c8b78f7ac726.tar.gz
gitea-4f346916838fcc95c6d7eb574145c8b78f7ac726.zip
Fix Gitpod logic of setting ROOT_URL (#29162)
Diffstat (limited to '.gitpod.yml')
-rw-r--r--.gitpod.yml15
1 files changed, 12 insertions, 3 deletions
diff --git a/.gitpod.yml b/.gitpod.yml
index 35b22c45ae..ed2f57f4bf 100644
--- a/.gitpod.yml
+++ b/.gitpod.yml
@@ -10,10 +10,19 @@ tasks:
- name: Run backend
command: |
gp sync-await setup
- if [ ! -f custom/conf/app.ini ]
- then
+
+ # Get the URL and extract the domain
+ url=$(gp url 3000)
+ domain=$(echo $url | awk -F[/:] '{print $4}')
+
+ if [ -f custom/conf/app.ini ]; then
+ sed -i "s|^ROOT_URL =.*|ROOT_URL = ${url}/|" custom/conf/app.ini
+ sed -i "s|^DOMAIN =.*|DOMAIN = ${domain}|" custom/conf/app.ini
+ sed -i "s|^SSH_DOMAIN =.*|SSH_DOMAIN = ${domain}|" custom/conf/app.ini
+ sed -i "s|^NO_REPLY_ADDRESS =.*|SSH_DOMAIN = noreply.${domain}|" custom/conf/app.ini
+ else
mkdir -p custom/conf/
- echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini
+ echo -e "[server]\nROOT_URL = ${url}/" > custom/conf/app.ini
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
fi
export TAGS="sqlite sqlite_unlock_notify"