0
Fork 0
mirror of https://projects.blender.org/infrastructure/gitea-custom.git synced 2024-12-22 15:23:32 -05:00

Fix problem displaying images in RST preview

This commit is contained in:
Brecht Van Lommel 2023-05-25 12:59:48 +02:00
parent 8b39413afc
commit 624cd22f38
2 changed files with 4 additions and 1 deletions

View file

@ -16,7 +16,7 @@ Add to Gitea app.ini.
[markup.restructuredtext] [markup.restructuredtext]
ENABLED = true ENABLED = true
FILE_EXTENSIONS = .rst FILE_EXTENSIONS = .rst
RENDER_COMMAND = timeout 30s sudo -u sphinx ./custom/sphinx/venv/bin/python3 ./custom/sphinx/sphinx_to_html.py RENDER_COMMAND = timeout 30s sudo --preserve-env=GITEA_PREFIX_SRC -u sphinx ./custom/sphinx/venv/bin/python3 ./custom/sphinx/sphinx_to_html.py
[markup.sanitizer.restructuredtext] [markup.sanitizer.restructuredtext]
ELEMENT = div ELEMENT = div

View file

@ -13,6 +13,7 @@ import tempfile
page_contents = sys.stdin.read() page_contents = sys.stdin.read()
base_url = "https://projects.blender.org" base_url = "https://projects.blender.org"
uatest_base_url = "https://uatest.projects.blender.org"
local_url = "http://localhost:3000" local_url = "http://localhost:3000"
placeholder_url = "https://placeholder.org" placeholder_url = "https://placeholder.org"
@ -20,6 +21,8 @@ placeholder_url = "https://placeholder.org"
gitea_prefix = os.environ.get("GITEA_PREFIX_SRC", "") gitea_prefix = os.environ.get("GITEA_PREFIX_SRC", "")
if gitea_prefix.startswith(base_url): if gitea_prefix.startswith(base_url):
gitea_prefix = gitea_prefix[len(base_url):] gitea_prefix = gitea_prefix[len(base_url):]
if gitea_prefix.startswith(uatest_base_url):
gitea_prefix = gitea_prefix[len(uatest_base_url):]
if gitea_prefix.startswith(local_url): if gitea_prefix.startswith(local_url):
gitea_prefix = gitea_prefix[len(local_url):] gitea_prefix = gitea_prefix[len(local_url):]