1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-02 09:10:11 +02:00

Merge branch 'signing-2.0-fixes-with-build-tweaks' into 'master'

Signing 2.0 fixes with build tweaks

See merge request fdroid/fdroidserver!801
This commit is contained in:
Michael Pöhn 2020-09-23 15:03:30 +00:00
commit 1baa5fd895
6 changed files with 21 additions and 24 deletions

View File

@ -1,12 +1,16 @@
variables: variables:
pip: pip3 --timeout 100 --retries 10 pip: pip3 --timeout 100 --retries 10
# speed up git checkout phase
GIT_DEPTH: 1
test: test:
image: registry.gitlab.com/fdroid/ci-images-server:latest image: registry.gitlab.com/fdroid/ci-images-server:latest
script: script:
- $pip install -e .[test] - $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 - cd tests
- ./complete-ci-tests - ./complete-ci-tests
@ -20,6 +24,7 @@ test:
metadata_v0: metadata_v0:
image: registry.gitlab.com/fdroid/ci-images-server:latest image: registry.gitlab.com/fdroid/ci-images-server:latest
variables: variables:
GIT_DEPTH: 1000
RELEASE_COMMIT_ID: 37f37ebd88e79ebe93239b72ed5503d5bde13f4b # 2.0a~ RELEASE_COMMIT_ID: 37f37ebd88e79ebe93239b72ed5503d5bde13f4b # 2.0a~
script: script:
- git fetch https://gitlab.com/fdroid/fdroidserver.git $RELEASE_COMMIT_ID - git fetch https://gitlab.com/fdroid/fdroidserver.git $RELEASE_COMMIT_ID

View File

@ -134,7 +134,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': 'keystore.jks', 'keystore': 'keystore.p12',
'smartcardoptions': [], 'smartcardoptions': [],
'char_limits': { 'char_limits': {
'author': 256, 'author': 256,
@ -3425,6 +3425,7 @@ def genkeystore(localconfig):
'-keyalg', 'RSA', '-keysize', '4096', '-keyalg', 'RSA', '-keysize', '4096',
'-sigalg', 'SHA256withRSA', '-sigalg', 'SHA256withRSA',
'-validity', '10000', '-validity', '10000',
'-storetype', 'pkcs12',
'-storepass:env', 'FDROID_KEY_STORE_PASS', '-storepass:env', 'FDROID_KEY_STORE_PASS',
'-dname', localconfig['keydname'], '-dname', localconfig['keydname'],
'-J-Duser.language=en'] '-J-Duser.language=en']

View File

@ -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: with open(os.path.join(repodir, 'index.xml'), 'wb') as f:
f.write(output) 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: if common.options.nosign:
logging.info(_("Creating unsigned index in preparation for signing")) logging.info(_("Creating unsigned index in preparation for signing"))

View File

@ -3,10 +3,10 @@
# #
# command which created the keystore used in this test case: # 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 \ # do keytool -genkey -keystore dummy-keystore.jks \
# -alias $ALIAS -keyalg 'RSA' -keysize '2048' \ # -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 # -keypass 123456 -dname 'CN=test, OU=F-Droid'; done
# #

View File

@ -1,15 +1,5 @@
#!/usr/bin/env python3 #!/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 inspect
import logging import logging
import optparse import optparse

View File

@ -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 # check that --android-home fails when dir does not exist or is not a dir
REPOROOT=`create_test_dir` REPOROOT=`create_test_dir`
KEYSTORE=$REPOROOT/keystore.jks KEYSTORE=$REPOROOT/keystore.p12
cd $REPOROOT cd $REPOROOT
set +e set +e
$fdroid init --keystore $KEYSTORE --android-home /opt/fakeandroidhome $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` REPOROOT=`create_test_dir`
FAKE_ANDROID_HOME=`create_test_dir` FAKE_ANDROID_HOME=`create_test_dir`
create_fake_android_home $FAKE_ANDROID_HOME create_fake_android_home $FAKE_ANDROID_HOME
KEYSTORE=$REPOROOT/keystore.jks KEYSTORE=$REPOROOT/keystore.p12
cd $REPOROOT cd $REPOROOT
$fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME
@ -820,7 +820,7 @@ else
FAKE_ANDROID_HOME=`create_test_dir` FAKE_ANDROID_HOME=`create_test_dir`
create_fake_android_home $FAKE_ANDROID_HOME create_fake_android_home $FAKE_ANDROID_HOME
rm -f $FAKE_ANDROID_HOME/build-tools/*/aapt rm -f $FAKE_ANDROID_HOME/build-tools/*/aapt
KEYSTORE=$REPOROOT/keystore.jks KEYSTORE=$REPOROOT/keystore.p12
cd $REPOROOT cd $REPOROOT
set +e set +e
$fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME $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` REPOROOT=`create_test_dir`
FAKE_ANDROID_HOME=`create_test_dir` FAKE_ANDROID_HOME=`create_test_dir`
create_fake_android_home $FAKE_ANDROID_HOME create_fake_android_home $FAKE_ANDROID_HOME
KEYSTORE=$REPOROOT/keystore.jks KEYSTORE=$REPOROOT/keystore.p12
cd $REPOROOT cd $REPOROOT
$fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME
set +e set +e
@ -859,7 +859,7 @@ else
echo_header "setup a new repo from scratch with keystore and android-home set on cmd line" echo_header "setup a new repo from scratch with keystore and android-home set on cmd line"
REPOROOT=`create_test_dir` REPOROOT=`create_test_dir`
KEYSTORE=$REPOROOT/keystore.jks KEYSTORE=$REPOROOT/keystore.p12
FAKE_ANDROID_HOME=`create_test_dir` FAKE_ANDROID_HOME=`create_test_dir`
create_fake_android_home $FAKE_ANDROID_HOME create_fake_android_home $FAKE_ANDROID_HOME
STORED_ANDROID_HOME=$ANDROID_HOME STORED_ANDROID_HOME=$ANDROID_HOME
@ -916,7 +916,7 @@ grep -F '<application id=' repo/index.xml > /dev/null
echo_header "setup a new repo from scratch and generate a keystore" echo_header "setup a new repo from scratch and generate a keystore"
REPOROOT=`create_test_dir` REPOROOT=`create_test_dir`
KEYSTORE=$REPOROOT/keystore.jks KEYSTORE=$REPOROOT/keystore.p12
cd $REPOROOT cd $REPOROOT
$fdroid init --keystore $KEYSTORE $fdroid init --keystore $KEYSTORE
test -e $KEYSTORE test -e $KEYSTORE
@ -935,7 +935,7 @@ grep -F '<application id=' repo/index.xml > /dev/null
echo_header "setup a new repo manually and generate a keystore" echo_header "setup a new repo manually and generate a keystore"
REPOROOT=`create_test_dir` REPOROOT=`create_test_dir`
KEYSTORE=$REPOROOT/keystore.jks KEYSTORE=$REPOROOT/keystore.p12
cd $REPOROOT cd $REPOROOT
cp $WORKSPACE/examples/fdroid-icon.png $REPOROOT/ cp $WORKSPACE/examples/fdroid-icon.png $REPOROOT/
! test -e $KEYSTORE ! test -e $KEYSTORE
@ -965,7 +965,7 @@ grep -F '<application id=' repo/index.xml > /dev/null
echo_header "setup a new repo from scratch, generate a keystore, then add APK and update" echo_header "setup a new repo from scratch, generate a keystore, then add APK and update"
REPOROOT=`create_test_dir` REPOROOT=`create_test_dir`
KEYSTORE=$REPOROOT/keystore.jks KEYSTORE=$REPOROOT/keystore.p12
cd $REPOROOT cd $REPOROOT
$fdroid init --keystore $KEYSTORE $fdroid init --keystore $KEYSTORE
test -e $KEYSTORE test -e $KEYSTORE
@ -1001,7 +1001,7 @@ test ! -e NONE
echo_header "setup a new repo with no keystore, add APK, and update" echo_header "setup a new repo with no keystore, add APK, and update"
REPOROOT=`create_test_dir` REPOROOT=`create_test_dir`
KEYSTORE=$REPOROOT/keystore.jks KEYSTORE=$REPOROOT/keystore.p12
cd $REPOROOT cd $REPOROOT
touch fdroid-icon.png touch fdroid-icon.png
mkdir repo mkdir repo
@ -1167,7 +1167,7 @@ echo_header "sign binary repo in offline box, then publishing from online box"
if have_git_2_3; then if have_git_2_3; then
OFFLINE_ROOT=`create_test_dir` OFFLINE_ROOT=`create_test_dir`
KEYSTORE=$WORKSPACE/tests/keystore.jks KEYSTORE=$WORKSPACE/tests/keystore.p12
LOCAL_COPY_DIR=`create_test_dir`/fdroid LOCAL_COPY_DIR=`create_test_dir`/fdroid
mkdir $LOCAL_COPY_DIR mkdir $LOCAL_COPY_DIR
ONLINE_ROOT=`create_test_dir` ONLINE_ROOT=`create_test_dir`