diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e65bd826..0e44e9ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -619,14 +619,13 @@ ipfs: - cd /tmp - wget https://dist.ipfs.tech/kubo/v0.20.0/kubo_v0.20.0_linux-amd64.tar.gz - tar -xvzf kubo_v0.20.0_linux-amd64.tar.gz - - export PATH=/tmp/kubo:$PATH - - ipfs init + - /tmp/kubo/ipfs init - test -d /tmp/fdroid/repo || mkdir -p /tmp/fdroid/repo - cp $FDROIDSERVER/tests/config.py $FDROIDSERVER/tests/keystore.jks /tmp/fdroid/ - cp $FDROIDSERVER/tests/repo/com.politedroid_6.apk /tmp/fdroid/repo/ - cd /tmp/fdroid - - 'printf "ipfs = True\n" >> config.py' + - 'echo ipfs = \"/tmp/kubo/ipfs\" >> config.py' - $FDROIDSERVER/fdroid update --verbose --create-metadata - $FDROIDSERVER/fdroid deploy --verbose - - ipfs files ls /repo - - ipfs files ls /repo/com.politedroid_6.apk + - /tmp/kubo/ipfs files ls /repo + - /tmp/kubo/ipfs files ls /repo/com.politedroid_6.apk diff --git a/examples/config.yml b/examples/config.yml index 1c6b1be2..1bb974cd 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -268,11 +268,11 @@ # awssecretkey: {env: awssecretkey} -# To deploy to IPFS you need the ipfs command line utility in $PATH and have a -# `ipfs daemon` running. To serve the repo permanently, you either need to keep -# the daemon running or use a pinning service. +# To deploy to IPFS you need the ipfs command line utility and specify +# the path as an argument. To serve the repo permanently, you either need to +# keep the daemon running or use a pinning service. # -# ipfs: true +# ipfs: /path/to/ipfs # If you want to force 'fdroid server' to use a non-standard serverwebroot. diff --git a/fdroidserver/deploy.py b/fdroidserver/deploy.py index 135ec83e..82c4ddde 100644 --- a/fdroidserver/deploy.py +++ b/fdroidserver/deploy.py @@ -333,7 +333,16 @@ def update_ipfs(repo_section): logging.debug(_('adding {section} to ipfs').format(section=repo_section)) return subprocess.check_output( - ['ipfs', 'add', '-r', '-Q', '--to-files', f"/{repo_section}", repo_section], text=True + [ + config.get("ipfs"), + 'add', + '-r', + '-Q', + '--to-files', + f"/{repo_section}", + repo_section, + ], + text=True, ).strip() @@ -346,7 +355,14 @@ def update_ipns(ipfs_hash, ipns_key): ) subprocess.check_call( - ['ipfs', 'name', 'publish', '--key', ipns_key, '/ipfs/{}'.format(ipfs_hash)] + [ + config.get("ipfs"), + 'name', + 'publish', + '--key', + ipns_key, + '/ipfs/{}'.format(ipfs_hash), + ] )