1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-11 15:13:27 +02:00

server: support plain paths as a serverwebroot

For use cases where there is a web server running on the same machine where
the `fdroid update` is being run, allow plain paths in the serverwebroot
list.  This is useful for debug repos from build servers, like:

https://dev.guardianproject.info/fdroid
This commit is contained in:
Hans-Christoph Steiner 2015-04-30 23:39:58 -04:00
parent 463bfc5639
commit c941bf3215

View File

@ -226,7 +226,15 @@ def main():
standardwebroot = True
for serverwebroot in config.get('serverwebroot', []):
host, fdroiddir = serverwebroot.rstrip('/').split(':')
# this supports both an ssh host:path and just a path
s = serverwebroot.rstrip('/').split(':')
if len(s) == 1:
fdroiddir = s[0]
elif len(s) == 2:
host, fdroiddir = s
else:
logging.error('Malformed serverwebroot line: ' + serverwebroot)
sys.exit(1)
repobase = os.path.basename(fdroiddir)
if standardwebroot and repobase != 'fdroid':
logging.error('serverwebroot path does not end with "fdroid", '