Compare commits

...

7 Commits

Author SHA1 Message Date
Hans-Christoph Steiner 9a9b5beeaa simplify test setup
I'm in the midst of working towards getting rid of the "config" instances
that are in the subcommand module, e.g. `fdroidserver.lint.config`
2024-05-07 11:33:04 +00:00
Hans-Christoph Steiner 14c8647909 add additional tests 2024-05-07 11:33:04 +00:00
linsui d243cbd030 lint: blocklist known AOSP debug keys in AASK 2024-05-07 11:33:04 +00:00
Michael Pöhn 08c553e1cb Merge branch 'deploy' into 'master'
deploy: retry when git push fails

See merge request fdroid/fdroidserver!1480
2024-05-06 06:36:58 +00:00
linsui f82d648cb1 deploy: retry when git push fails 2024-05-05 20:53:35 +00:00
Michael Pöhn 79586fd9e3 Merge branch 'fix-icons-in-fdroid-mirror' into 'master'
mirror: apparently the 'icons' dir does not always exist

See merge request fdroid/fdroidserver!1476
2024-05-05 17:14:49 +00:00
Hans-Christoph Steiner 6f07538cdc mirror: apparently the 'icons' dir does not always exist
https://apt.izzysoft.de/fdroid/archive/com.futsch1.medtimer_28.apk:
2024-04-21 18:55:20 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/com.hardbacknutter.nevertoomanybooks_75.apk:
2024-04-21 18:55:20 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/com.jovial.jrpn15_20.apk:
2024-04-21 18:55:20 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/com.jovial.jrpn2_20.apk:
2024-04-21 18:55:20 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/com.logger.app_8.apk:
2024-04-21 18:55:21 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/com.lorenzovainigli.foodexpirationdates.foss_22.apk:
2024-04-21 18:55:21 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/com.openathena_36.apk:
2024-04-21 18:55:21 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/com.oppzippy.openscq30_21.apk:
2024-04-21 18:55:21 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/com.sanmer.mrepo_713.apk:
2024-04-21 18:55:21 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/com.starry.myne_325.apk:
2024-04-21 18:55:21 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/dev.imranr.obtainium_22602.apk:
2024-04-21 18:55:22 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/dev.sanmer.pi_137.apk:
2024-04-21 18:55:22 ERROR 404: Not Found.
https://apt.izzysoft.de/fdroid/archive/org.breezyweather_50108.apk:
2024-04-21 18:55:22 ERROR 404: Not Found.
2024-04-21 18:55:22,448 ERROR: no "icon" in org.breezyweather
2024-04-21 18:55:22,449 ERROR: no "icon" in com.lorenzovainigli.foodexpirationdates.foss
2024-04-21 18:55:22,449 ERROR: no "icon" in com.jovial.jrpn15
2024-04-21 18:55:22,450 ERROR: no "icon" in com.jovial.jrpn2
2024-04-21 18:55:22,450 ERROR: no "icon" in com.logger.app
2024-04-21 18:55:22,450 ERROR: no "icon" in com.futsch1.medtimer
2024-04-21 18:55:22,451 ERROR: no "icon" in com.sanmer.mrepo
2024-04-21 18:55:22,451 ERROR: no "icon" in com.starry.myne
2024-04-21 18:55:22,451 ERROR: no "icon" in com.hardbacknutter.nevertoomanybooks
2024-04-21 18:55:22,452 ERROR: no "icon" in dev.imranr.obtainium
2024-04-21 18:55:22,452 ERROR: no "icon" in com.openathena
2024-04-21 18:55:22,453 ERROR: no "icon" in com.oppzippy.openscq30
2024-04-21 18:55:22,453 ERROR: no "icon" in dev.sanmer.pi
2024-04-21 18:55:22,454 CRITICAL: Unknown exception found!
Traceback (most recent call last):
  File "/home/fdroid/code/fdroid/fdroidserver/fdroid", line 22, in <module>
    fdroidserver.__main__.main()
  File "/home/fdroid/code/fdroid/fdroidserver/fdroidserver/__main__.py", line 230, in main
    raise e
  File "/home/fdroid/code/fdroid/fdroidserver/fdroidserver/__main__.py", line 211, in main
    mod.main()
  File "/home/fdroid/code/fdroid/fdroidserver/fdroidserver/mirror.py", line 269, in main
    _run_wget(os.path.join(basedir, section, icondir), urls[icondir])
KeyError: 'icons'
2024-05-02 18:29:42 +02:00
4 changed files with 57 additions and 3 deletions

View File

@ -837,7 +837,15 @@ def push_binary_transparency(git_repo_path, git_remote):
origin.set_url(git_remote)
else:
origin = gitrepo.create_remote('origin', git_remote)
origin.push(GIT_BRANCH)
for _i in range(3):
try:
origin.push(GIT_BRANCH)
except git.GitCommandError as e:
logging.error(e)
continue
break
else:
raise FDroidException(_("Pushing to remote server failed!"))
def main():

View File

@ -722,7 +722,13 @@ def check_updates_ucm_http_aum_pattern(app): # noqa: D403
def check_certificate_pinned_binaries(app):
if len(app.get('AllowedAPKSigningKeys')) > 0:
keys = app.get('AllowedAPKSigningKeys')
known_keys = common.config.get('apk_signing_key_block_list', [])
if keys:
if known_keys:
for key in keys:
if key in known_keys:
yield _('Known debug key is used in AllowedAPKSigningKeys: ') + key
return
if app.get('Binaries') is not None:
yield _(

View File

@ -268,7 +268,8 @@ def main():
urls[icondir].append(url)
for icondir in icondirs:
_run_wget(os.path.join(basedir, section, icondir), urls[icondir])
if icondir in urls:
_run_wget(os.path.join(basedir, section, icondir), urls[icondir])
if __name__ == "__main__":

View File

@ -438,6 +438,45 @@ class LintTest(unittest.TestCase):
with self.assertRaises(TypeError):
fdroidserver.lint.lint_config('mirrors.yml')
def test_check_certificate_pinned_binaries_empty(self):
fdroidserver.common.config = {}
app = fdroidserver.metadata.App()
app.AllowedAPKSigningKeys = [
'a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc'
]
self.assertEqual(
[],
list(fdroidserver.lint.check_certificate_pinned_binaries(app)),
"when the config is empty, any signing key should be allowed",
)
def test_lint_known_debug_keys_no_match(self):
fdroidserver.common.config = {
"apk_signing_key_block_list": "a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc"
}
app = fdroidserver.metadata.App()
app.AllowedAPKSigningKeys = [
'2fd4fd5f54babba4bcb21237809bb653361d0d2583c80964ec89b28a26e9539e'
]
self.assertEqual(
[],
list(fdroidserver.lint.check_certificate_pinned_binaries(app)),
"A signing key that does not match one in the config should be allowed",
)
def test_lint_known_debug_keys(self):
fdroidserver.common.config = {
'apk_signing_key_block_list': 'a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc'
}
app = fdroidserver.metadata.App()
app.AllowedAPKSigningKeys = [
'a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc'
]
for warn in fdroidserver.lint.check_certificate_pinned_binaries(app):
anywarns = True
logging.debug(warn)
self.assertTrue(anywarns)
class LintAntiFeaturesTest(unittest.TestCase):
def setUp(self):