mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 07:22:29 +03:00
* Change image name
* add fingerprint
This commit is contained in:
parent
4d464051ff
commit
8d51566a70
2 changed files with 51 additions and 35 deletions
|
@ -3769,6 +3769,7 @@ def is_repo_file(filename):
|
||||||
b'index_unsigned.jar',
|
b'index_unsigned.jar',
|
||||||
b'index.xml',
|
b'index.xml',
|
||||||
b'index.html',
|
b'index.html',
|
||||||
|
b'index.png',
|
||||||
b'index-v1.jar',
|
b'index-v1.jar',
|
||||||
b'index-v1.json',
|
b'index-v1.json',
|
||||||
b'categories.txt',
|
b'categories.txt',
|
||||||
|
|
|
@ -134,18 +134,22 @@ def make(apps, apks, repodir, archive):
|
||||||
|
|
||||||
|
|
||||||
def make_website(apps, repodir, repodict):
|
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)
|
||||||
|
|
||||||
if not os.path.exists(repodir):
|
if not os.path.exists(repodir):
|
||||||
os.makedirs(repodir)
|
os.makedirs(repodir)
|
||||||
html_name = 'index.html'
|
html_name = 'index.html'
|
||||||
|
|
||||||
link = repodict["address"]
|
|
||||||
|
|
||||||
html_file = os.path.join(repodir, html_name)
|
html_file = os.path.join(repodir, html_name)
|
||||||
with open(html_file, 'w') as f:
|
with open(html_file, 'w') as f:
|
||||||
name = repodict["name"]
|
name = repodict["name"]
|
||||||
description = repodict["description"]
|
description = repodict["description"]
|
||||||
f.write("""<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
|
f.write("""<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
|
||||||
<HTML><HEAD>
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=UTF-8'/>
|
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=UTF-8'/>
|
||||||
<META NAME="viewport" CONTENT="width=device-width; initial-scale=1.0; minimum-scale=0.5; maximum-scale=2.0; user-scalable=1;" />
|
<META NAME="viewport" CONTENT="width=device-width; initial-scale=1.0; minimum-scale=0.5; maximum-scale=2.0; user-scalable=1;" />
|
||||||
<TITLE>{name}</TITLE>
|
<TITLE>{name}</TITLE>
|
||||||
|
@ -158,24 +162,38 @@ def make_website(apps, repodir, repodict):
|
||||||
<META property="og:determiner" content="" />
|
<META property="og:determiner" content="" />
|
||||||
<META property="og:description" content="{description}" />
|
<META property="og:description" content="{description}" />
|
||||||
<META NAME='robots' CONTENT='index,nofollow'/>
|
<META NAME='robots' CONTENT='index,nofollow'/>
|
||||||
</HEAD><BODY>
|
</HEAD>
|
||||||
<h2>{name}</h2>
|
<BODY>
|
||||||
<div id='intro'>
|
<h2>{name}</h2>
|
||||||
<p style='margin-bottom:.2em;'><span style='float:right;width:100px;margin-left:.5em;'>
|
<div id='intro'>
|
||||||
<a href='images/fdroid_repo_qr.png' title='QR: {name}'><img src='images/fdroid_repo_qr.png' alt='QR: {name}' width='100'></a>
|
<p style='margin-bottom:.2em;'>
|
||||||
</span>
|
<span style='float:right;width:100px;margin-left:.5em;'>
|
||||||
{description}<br/>
|
<a href='index.png' title='QR: {name}'><img src='index.png' alt='QR: {name}' width='100'></a>
|
||||||
{details}</p>
|
</span>
|
||||||
<p class="center" style="margin-top:.5em">
|
{description}
|
||||||
<a href="{link}">
|
<br/>
|
||||||
<code style="color:#000000;font-weight:bold;">{link}</code>
|
<br/>
|
||||||
</a>
|
{details}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
<p class="center" style="margin-top:.5em">
|
||||||
</BODY>""".format(name=name,
|
<a href="{link_fingerprinted}">
|
||||||
|
<code style="color:#000000;font-weight:bold;">
|
||||||
|
{link}
|
||||||
|
</code>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<p>If you would like to manually verify the fingerprint (SHA-256) of the repository signing key, here it is:<br/>
|
||||||
|
<blockcode style="color:#000000;font-weight:bold;">
|
||||||
|
{fingerprint}
|
||||||
|
</blockcode>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</BODY>""".format(name=name,
|
||||||
description=description,
|
description=description,
|
||||||
details="Currently it serves <kbd>{}</kbd> apps. To add it to your F-Droid client, scan the QR code (click it to enlarge) or use this URL:".format(len(apps)),
|
details="Currently it serves <kbd>{}</kbd> apps. To add it to your F-Droid client, scan the QR code (click it to enlarge) or use this URL:".format(len(apps)),
|
||||||
link=link))
|
fingerprint=repo_pubkey_fingerprint,
|
||||||
|
link=link,
|
||||||
|
link_fingerprinted=link_fingerprinted))
|
||||||
|
|
||||||
css_file = os.path.join(repodir, "index.css")
|
css_file = os.path.join(repodir, "index.css")
|
||||||
with open(css_file, "w") as f:
|
with open(css_file, "w") as f:
|
||||||
|
@ -290,10 +308,7 @@ fieldset select, fieldset input, #reposelect select, #reposelect input { font-si
|
||||||
.appdetailcell { display:block; float:left; line-height:1.5em; }
|
.appdetailcell { display:block; float:left; line-height:1.5em; }
|
||||||
}""")
|
}""")
|
||||||
|
|
||||||
images_dir = os.path.join(repodir, "images")
|
qrcode.make(link_fingerprinted).save(os.path.join(repodir, "index.png"))
|
||||||
if not os.path.exists(images_dir):
|
|
||||||
os.makedirs(images_dir)
|
|
||||||
qrcode.make(link).save(os.path.join(images_dir, "fdroid_repo_qr.png"))
|
|
||||||
|
|
||||||
|
|
||||||
def make_v1(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_fingerprints):
|
def make_v1(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_fingerprints):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue