mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-22 13:45:19 +00:00
Fix Gitpod logic of setting ROOT_URL (#29162)
(cherry picked from commit 4f346916838fcc95c6d7eb574145c8b78f7ac726)
This commit is contained in:
parent
0fc61c8836
commit
e52d877582
15
.gitpod.yml
15
.gitpod.yml
|
@ -10,10 +10,19 @@ tasks:
|
||||||
- name: Run backend
|
- name: Run backend
|
||||||
command: |
|
command: |
|
||||||
gp sync-await setup
|
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/
|
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
|
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
|
||||||
fi
|
fi
|
||||||
export TAGS="sqlite sqlite_unlock_notify"
|
export TAGS="sqlite sqlite_unlock_notify"
|
||||||
|
|
Loading…
Reference in a new issue