mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Merge commit 'refs/merge-requests/138' of gitorious.org:f-droid/fdroidserver
This commit is contained in:
commit
fa37c3b2f8
5 changed files with 12 additions and 7 deletions
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
|
@ -56,8 +56,8 @@ def genpassword():
|
||||||
def genkey(keystore, repo_keyalias, password, keydname):
|
def genkey(keystore, repo_keyalias, password, keydname):
|
||||||
'''generate a new keystore with a new key in it for signing repos'''
|
'''generate a new keystore with a new key in it for signing repos'''
|
||||||
logging.info('Generating a new key in "' + keystore + '"...')
|
logging.info('Generating a new key in "' + keystore + '"...')
|
||||||
write_password_file("keystorepass", password)
|
common.write_password_file("keystorepass", password)
|
||||||
write_password_file("keypass", password)
|
common.write_password_file("keypass", password)
|
||||||
p = FDroidPopen(['keytool', '-genkey',
|
p = FDroidPopen(['keytool', '-genkey',
|
||||||
'-keystore', keystore, '-alias', repo_keyalias,
|
'-keystore', keystore, '-alias', repo_keyalias,
|
||||||
'-keyalg', 'RSA', '-keysize', '4096',
|
'-keyalg', 'RSA', '-keysize', '4096',
|
||||||
|
|
@ -66,12 +66,13 @@ def genkey(keystore, repo_keyalias, password, keydname):
|
||||||
'-storepass:file', config['keystorepassfile'],
|
'-storepass:file', config['keystorepassfile'],
|
||||||
'-keypass:file', config['keypassfile'],
|
'-keypass:file', config['keypassfile'],
|
||||||
'-dname', keydname])
|
'-dname', keydname])
|
||||||
|
# TODO keypass should be sent via stdin
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise BuildException("Failed to generate key", p.stdout)
|
raise BuildException("Failed to generate key", p.stdout)
|
||||||
# now show the lovely key that was just generated
|
# now show the lovely key that was just generated
|
||||||
p = FDroidPopen(['keytool', '-list', '-v',
|
p = FDroidPopen(['keytool', '-list', '-v',
|
||||||
'-keystore', keystore, '-alias', repo_keyalias])
|
'-keystore', keystore, '-alias', repo_keyalias],
|
||||||
output = p.communicate(password)[0]
|
'-storepass:file', config['keystorepassfile'])
|
||||||
logging.info(output.lstrip().strip() + '\n\n')
|
logging.info(output.lstrip().strip() + '\n\n')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -101,7 +102,7 @@ def main():
|
||||||
else:
|
else:
|
||||||
# we're running straight out of the git repo
|
# we're running straight out of the git repo
|
||||||
prefix = tmp
|
prefix = tmp
|
||||||
examplesdir = prefix
|
examplesdir = prefix + '/examples'
|
||||||
|
|
||||||
fdroiddir = os.getcwd()
|
fdroiddir = os.getcwd()
|
||||||
|
|
||||||
|
|
@ -112,7 +113,8 @@ def main():
|
||||||
shutil.copyfile(os.path.join(examplesdir, 'config.py'), 'config.py')
|
shutil.copyfile(os.path.join(examplesdir, 'config.py'), 'config.py')
|
||||||
os.chmod('config.py', 0o0600)
|
os.chmod('config.py', 0o0600)
|
||||||
else:
|
else:
|
||||||
logging.info('Looks like this is already an F-Droid repo, cowardly refusing to overwrite it...')
|
logging.warn('Looks like this is already an F-Droid repo, cowardly refusing to overwrite it...')
|
||||||
|
logging.info('Try running `fdroid init` in an empty directory.')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
# now that we have a local config.py, read configuration...
|
# now that we have a local config.py, read configuration...
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ def main():
|
||||||
'-storepass:file', config['keystorepassfile'],
|
'-storepass:file', config['keystorepassfile'],
|
||||||
'-keypass:file', config['keypassfile'],
|
'-keypass:file', config['keypassfile'],
|
||||||
'-dname', config['keydname']])
|
'-dname', config['keydname']])
|
||||||
|
# TODO keypass should be sent via stdin
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise BuildException("Failed to generate key")
|
raise BuildException("Failed to generate key")
|
||||||
|
|
||||||
|
|
@ -141,6 +142,7 @@ def main():
|
||||||
'-keypass:file', config['keypassfile'], '-sigalg',
|
'-keypass:file', config['keypassfile'], '-sigalg',
|
||||||
'MD5withRSA', '-digestalg', 'SHA1',
|
'MD5withRSA', '-digestalg', 'SHA1',
|
||||||
apkfile, keyalias])
|
apkfile, keyalias])
|
||||||
|
# TODO keypass should be sent via stdin
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise BuildException("Failed to sign application")
|
raise BuildException("Failed to sign application")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -800,6 +800,7 @@ def make_index(apps, apks, repodir, archive, categories):
|
||||||
'-keypass:file', config['keypassfile'],
|
'-keypass:file', config['keypassfile'],
|
||||||
'-digestalg', 'SHA1', '-sigalg', 'MD5withRSA',
|
'-digestalg', 'SHA1', '-sigalg', 'MD5withRSA',
|
||||||
os.path.join(repodir, 'index.jar') , config['repo_keyalias']])
|
os.path.join(repodir, 'index.jar') , config['repo_keyalias']])
|
||||||
|
# TODO keypass should be sent via stdin
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
logging.info("Failed to sign index")
|
logging.info("Failed to sign index")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -16,7 +16,7 @@ setup(name='FDroidServer',
|
||||||
[ 'buildserver/config.buildserver.py',
|
[ 'buildserver/config.buildserver.py',
|
||||||
'examples/config.py',
|
'examples/config.py',
|
||||||
'examples/makebs.config.py',
|
'examples/makebs.config.py',
|
||||||
'fdroid-icon.png']),
|
'examples/fdroid-icon.png']),
|
||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'python-magic',
|
'python-magic',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue