mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-07 16:00:28 +03:00
move default keystore location to keystore.jks, i.e. in the fdroid repo
This makes `fdroid init` create a complete, self-contained repo in a single folder. That makes it easily transferable, backupable, etc. It also means that `fdroid update` can add a keystore to an existing unsigned repo without having to worry about finding the right folder or overwriting any other existing files.
This commit is contained in:
parent
4861595288
commit
af360199f1
2 changed files with 4 additions and 1 deletions
|
|
@ -63,7 +63,7 @@ default_config = {
|
||||||
'stats_to_carbon': False,
|
'stats_to_carbon': False,
|
||||||
'repo_maxage': 0,
|
'repo_maxage': 0,
|
||||||
'build_server_always': False,
|
'build_server_always': False,
|
||||||
'keystore': os.path.join("$HOME", '.local', 'share', 'fdroidserver', 'keystore.jks'),
|
'keystore': 'keystore.jks',
|
||||||
'smartcardoptions': [],
|
'smartcardoptions': [],
|
||||||
'char_limits': {
|
'char_limits': {
|
||||||
'Summary': 50,
|
'Summary': 50,
|
||||||
|
|
@ -2038,6 +2038,7 @@ def genkey(keystore, repo_keyalias, password, keydname):
|
||||||
'-keypass:file', config['keypassfile'],
|
'-keypass:file', config['keypassfile'],
|
||||||
'-dname', keydname])
|
'-dname', keydname])
|
||||||
# TODO keypass should be sent via stdin
|
# TODO keypass should be sent via stdin
|
||||||
|
os.chmod(keystore, 0o0600)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise BuildException("Failed to generate key", p.output)
|
raise BuildException("Failed to generate key", p.output)
|
||||||
# now show the lovely key that was just generated
|
# now show the lovely key that was just generated
|
||||||
|
|
|
||||||
|
|
@ -227,6 +227,8 @@ def main():
|
||||||
elif not os.path.exists(keystore):
|
elif not os.path.exists(keystore):
|
||||||
# no existing or specified keystore, generate the whole thing
|
# no existing or specified keystore, generate the whole thing
|
||||||
keystoredir = os.path.dirname(keystore)
|
keystoredir = os.path.dirname(keystore)
|
||||||
|
if keystoredir is None or keystoredir == '':
|
||||||
|
keystoredir = os.path.join(os.getcwd(), keystoredir)
|
||||||
if not os.path.exists(keystoredir):
|
if not os.path.exists(keystoredir):
|
||||||
os.makedirs(keystoredir, mode=0o700)
|
os.makedirs(keystoredir, mode=0o700)
|
||||||
password = common.genpassword()
|
password = common.genpassword()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue