diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 800c2057..0f3ffc83 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -138,7 +138,7 @@ arch_pip_install:
- master@fdroid/fdroidserver
script:
- pacman --sync --sysupgrade --refresh --noconfirm git grep python-pip python-virtualenv tar
- - pip install -e .
+ - pip install -e .[test]
- fdroid
- fdroid readmeta
- fdroid update --help
diff --git a/fdroidserver/common.py b/fdroidserver/common.py
index a19795a0..84451d70 100644
--- a/fdroidserver/common.py
+++ b/fdroidserver/common.py
@@ -3764,10 +3764,12 @@ def is_repo_file(filename):
and not filename.endswith(b'.idsig') \
and not filename.endswith(b'.log.gz') \
and os.path.basename(filename) not in [
+ b'index.css',
b'index.jar',
b'index_unsigned.jar',
b'index.xml',
b'index.html',
+ b'index.png',
b'index-v1.jar',
b'index-v1.json',
b'categories.txt',
diff --git a/fdroidserver/index.py b/fdroidserver/index.py
index fb62014b..f9120bd8 100644
--- a/fdroidserver/index.py
+++ b/fdroidserver/index.py
@@ -30,6 +30,7 @@ import tempfile
import urllib.parse
import zipfile
import calendar
+import qrcode
from binascii import hexlify, unhexlify
from datetime import datetime, timezone
from xml.dom.minidom import Document
@@ -129,6 +130,334 @@ def make(apps, apks, repodir, archive):
fdroid_signing_key_fingerprints)
make_v1(sortedapps, apks, repodir, repodict, requestsdict,
fdroid_signing_key_fingerprints)
+ make_website(sortedapps, repodir, repodict)
+
+
+def _should_file_be_generated(path, magic_string):
+ if os.path.exists(path):
+ with open(path) as f:
+ if magic_string not in f.readline(): # if the magic_string is not in the first line the file should be overwritten
+ return False
+ return True
+
+
+def make_website(apps, repodir, repodict):
+ _, repo_pubkey_fingerprint = extract_pubkey()
+ repo_pubkey_fingerprint_stripped = repo_pubkey_fingerprint.replace(" ", "")
+ link = repodict["address"]
+ link_fingerprinted = "{link}?fingerprint={fingerprint}".format(link=link, fingerprint=repo_pubkey_fingerprint_stripped)
+ autogenerate_comment = "auto-generated - fdroid index updates will overwrite this file" # do not change this string, as it will break the updates for existing files with older versions of this string
+
+ if not os.path.exists(repodir):
+ os.makedirs(repodir)
+
+ qrcode.make(link_fingerprinted).save(os.path.join(repodir, "index.png"))
+
+ html_name = 'index.html'
+ html_file = os.path.join(repodir, html_name)
+
+ if _should_file_be_generated(html_file, autogenerate_comment):
+ with open(html_file, 'w') as f:
+ name = repodict["name"]
+ description = repodict["description"]
+ icon = repodict["icon"]
+ f.write("""
+
+
+
+
+
+
+ {name}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {name}
+
+
+
+
+
+
+
+
+ {description}
+
+
+ Currently it serves
+
+ {number_of_apps}
+
+ apps. To add it to your F-Droid client, scan the QR code (click it to enlarge) or use this URL:
+