1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00

Make webBaseUrl configurable

This commit is contained in:
Jochen Sprickerhof 2022-06-03 09:35:43 +02:00
parent 72e3d07acb
commit 1073dd57f7

View File

@ -91,11 +91,15 @@ def make(apps, apks, repodir, archive):
repodict['description'] = common.config['archive_description'] repodict['description'] = common.config['archive_description']
archive_url = common.config.get('archive_url', common.config['repo_url'][:-4] + 'archive') archive_url = common.config.get('archive_url', common.config['repo_url'][:-4] + 'archive')
repodict['address'] = archive_url repodict['address'] = archive_url
if 'archive_web_base_url' in common.config:
repodict["webBaseUrl"] = common.config['archive_web_base_url']
urlbasepath = os.path.basename(urllib.parse.urlparse(archive_url).path) urlbasepath = os.path.basename(urllib.parse.urlparse(archive_url).path)
else: else:
repodict['name'] = common.config['repo_name'] repodict['name'] = common.config['repo_name']
repodict['icon'] = common.config.get('repo_icon', common.default_config['repo_icon']) repodict['icon'] = common.config.get('repo_icon', common.default_config['repo_icon'])
repodict['address'] = common.config['repo_url'] repodict['address'] = common.config['repo_url']
if 'repo_web_base_url' in common.config:
repodict["webBaseUrl"] = common.config['repo_web_base_url']
repodict['description'] = common.config['repo_description'] repodict['description'] = common.config['repo_description']
urlbasepath = os.path.basename(urllib.parse.urlparse(common.config['repo_url']).path) urlbasepath = os.path.basename(urllib.parse.urlparse(common.config['repo_url']).path)
@ -711,7 +715,8 @@ def v2_repo(repodict, repodir, archive):
repo["icon"] = config["archive" if archive else "repo"]["icon"] repo["icon"] = config["archive" if archive else "repo"]["icon"]
repo["address"] = repodict["address"] repo["address"] = repodict["address"]
repo["webBaseUrl"] = "https://f-droid.org/packages/" if "webBaseUrl" in repodict:
repo["webBaseUrl"] = repodict["webBaseUrl"]
if "mirrors" in repodict: if "mirrors" in repodict:
repo["mirrors"] = [{"url": mirror} for mirror in repodict["mirrors"]] repo["mirrors"] = [{"url": mirror} for mirror in repodict["mirrors"]]