mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-13 10:40:29 +03:00
index: fix GitLab Raw URLs with gitlab.com and recent versions
GitLab seems to be moving to always having "-" as the first path segment in all the project URLs. So the URL without a "-" is now a redirect.
This commit is contained in:
parent
531c36f310
commit
ba854cbc0f
4 changed files with 85 additions and 4 deletions
|
|
@ -247,6 +247,26 @@ class IndexTest(unittest.TestCase):
|
|||
fdroidserver.common.default_config['repo_icon'])))
|
||||
self.assertTrue(os.path.exists(os.path.join('repo', 'index.xml')))
|
||||
|
||||
def test_get_mirror_service_urls(self):
|
||||
for url in [
|
||||
'git@github.com:foo/bar',
|
||||
'git@github.com:foo/bar.git',
|
||||
'https://github.com/foo/bar',
|
||||
'https://github.com/foo/bar.git',
|
||||
]:
|
||||
self.assertEqual(['https://raw.githubusercontent.com/foo/bar/master/fdroid'],
|
||||
fdroidserver.index.get_mirror_service_urls(url))
|
||||
|
||||
for url in [
|
||||
'git@gitlab.com:group/project',
|
||||
'git@gitlab.com:group/project.git',
|
||||
'https://gitlab.com/group/project',
|
||||
'https://gitlab.com/group/project.git',
|
||||
]:
|
||||
self.assertEqual(['https://group.gitlab.io/project/fdroid',
|
||||
'https://gitlab.com/group/project/-/raw/master/fdroid'],
|
||||
fdroidserver.index.get_mirror_service_urls(url))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
|
|
|
|||
25
tests/key-tricks.py
Executable file
25
tests/key-tricks.py
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import fdroidserver
|
||||
import shutil
|
||||
import sys
|
||||
from fdroidserver import common, nightly
|
||||
|
||||
if os.getenv('CI') is None:
|
||||
print('ERROR: This can overwrite SSH keys, so it should only be run in CI')
|
||||
sys.exit(1)
|
||||
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
config = fdroidserver.common.read_config(common.options)
|
||||
nightly.PASSWORD = config['keystorepass']
|
||||
nightly.KEY_ALIAS = config['repo_keyalias']
|
||||
|
||||
privkey = nightly._ssh_key_from_debug_keystore('keystore.jks')
|
||||
print('privkey', privkey)
|
||||
ssh_private_key_file = os.path.join(os.getenv('HOME'), '.ssh', 'id_rsa')
|
||||
if os.path.exists(ssh_private_key_file):
|
||||
print('ERROR:', ssh_private_key_file, 'exists!')
|
||||
sys.exit(1)
|
||||
shutil.move(privkey, ssh_private_key_file)
|
||||
shutil.move(privkey + '.pub', ssh_private_key_file + '.pub')
|
||||
Loading…
Add table
Add a link
Reference in a new issue