diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 14807970..148885d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,16 @@ variables: pip: pip3 --timeout 100 --retries 10 +# speed up git checkout phase + GIT_DEPTH: 1 test: image: registry.gitlab.com/fdroid/ci-images-server:latest script: - $pip install -e .[test] + # the `fdroid build` test in tests/run-tests needs android-23 + - echo y | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-23" - cd tests - ./complete-ci-tests @@ -20,6 +24,7 @@ test: metadata_v0: image: registry.gitlab.com/fdroid/ci-images-server:latest variables: + GIT_DEPTH: 1000 RELEASE_COMMIT_ID: 37f37ebd88e79ebe93239b72ed5503d5bde13f4b # 2.0a~ script: - git fetch https://gitlab.com/fdroid/fdroidserver.git $RELEASE_COMMIT_ID diff --git a/fdroidserver/common.py b/fdroidserver/common.py index daa652b9..9b8f59cf 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -134,7 +134,7 @@ default_config = { 'stats_to_carbon': False, 'repo_maxage': 0, 'build_server_always': False, - 'keystore': 'keystore.jks', + 'keystore': 'keystore.p12', 'smartcardoptions': [], 'char_limits': { 'author': 256, @@ -3425,6 +3425,7 @@ def genkeystore(localconfig): '-keyalg', 'RSA', '-keysize', '4096', '-sigalg', 'SHA256withRSA', '-validity', '10000', + '-storetype', 'pkcs12', '-storepass:env', 'FDROID_KEY_STORE_PASS', '-dname', localconfig['keydname'], '-J-Duser.language=en'] diff --git a/fdroidserver/index.py b/fdroidserver/index.py index 7e76f299..6d247141 100644 --- a/fdroidserver/index.py +++ b/fdroidserver/index.py @@ -566,7 +566,8 @@ def make_v0(apps, apks, repodir, repodict, requestsdict, fdroid_signing_key_fing with open(os.path.join(repodir, 'index.xml'), 'wb') as f: f.write(output) - if 'repo_keyalias' in common.config: + if 'repo_keyalias' in common.config \ + or (common.options.nosign and 'repo_pubkey' in common.config): if common.options.nosign: logging.info(_("Creating unsigned index in preparation for signing")) diff --git a/tests/publish.TestCase b/tests/publish.TestCase index 38691f85..d0d08376 100755 --- a/tests/publish.TestCase +++ b/tests/publish.TestCase @@ -3,10 +3,10 @@ # # command which created the keystore used in this test case: # -# $ for ALIAS in 'repokey a163ec9b d2d51ff2 dc3b169e 78688a0f'; \ +# $ for ALIAS in repokey a163ec9b d2d51ff2 dc3b169e 78688a0f; \ # do keytool -genkey -keystore dummy-keystore.jks \ # -alias $ALIAS -keyalg 'RSA' -keysize '2048' \ -# -validity '10000' -storepass 123456 \ +# -validity '10000' -storepass 123456 -storetype jks \ # -keypass 123456 -dname 'CN=test, OU=F-Droid'; done # diff --git a/tests/rewritemeta.TestCase b/tests/rewritemeta.TestCase index 8a7d41e4..c4b34867 100755 --- a/tests/rewritemeta.TestCase +++ b/tests/rewritemeta.TestCase @@ -1,15 +1,5 @@ #!/usr/bin/env python3 -# -# command which created the keystore used in this test case: -# -# $ for ALIAS in 'repokey a163ec9b d2d51ff2 dc3b169e 78688a0f'; \ -# do keytool -genkey -keystore dummy-keystore.jks \ -# -alias $ALIAS -keyalg 'RSA' -keysize '2048' \ -# -validity '10000' -storepass 123456 \ -# -keypass 123456 -dname 'CN=test, OU=F-Droid'; done -# - import inspect import logging import optparse diff --git a/tests/run-tests b/tests/run-tests index dc4e934f..77d2734d 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -778,7 +778,7 @@ $fdroid server update --local-copy-dir=$LOCALCOPYDIR # check that --android-home fails when dir does not exist or is not a dir REPOROOT=`create_test_dir` -KEYSTORE=$REPOROOT/keystore.jks +KEYSTORE=$REPOROOT/keystore.p12 cd $REPOROOT set +e $fdroid init --keystore $KEYSTORE --android-home /opt/fakeandroidhome @@ -805,7 +805,7 @@ echo_header "check that fake android home passes 'fdroid init'" REPOROOT=`create_test_dir` FAKE_ANDROID_HOME=`create_test_dir` create_fake_android_home $FAKE_ANDROID_HOME -KEYSTORE=$REPOROOT/keystore.jks +KEYSTORE=$REPOROOT/keystore.p12 cd $REPOROOT $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME @@ -820,7 +820,7 @@ else FAKE_ANDROID_HOME=`create_test_dir` create_fake_android_home $FAKE_ANDROID_HOME rm -f $FAKE_ANDROID_HOME/build-tools/*/aapt - KEYSTORE=$REPOROOT/keystore.jks + KEYSTORE=$REPOROOT/keystore.p12 cd $REPOROOT set +e $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME @@ -835,7 +835,7 @@ echo_header "check that --android-home overrides ANDROID_HOME" REPOROOT=`create_test_dir` FAKE_ANDROID_HOME=`create_test_dir` create_fake_android_home $FAKE_ANDROID_HOME -KEYSTORE=$REPOROOT/keystore.jks +KEYSTORE=$REPOROOT/keystore.p12 cd $REPOROOT $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME set +e @@ -859,7 +859,7 @@ else echo_header "setup a new repo from scratch with keystore and android-home set on cmd line" REPOROOT=`create_test_dir` - KEYSTORE=$REPOROOT/keystore.jks + KEYSTORE=$REPOROOT/keystore.p12 FAKE_ANDROID_HOME=`create_test_dir` create_fake_android_home $FAKE_ANDROID_HOME STORED_ANDROID_HOME=$ANDROID_HOME @@ -916,7 +916,7 @@ grep -F '