chiark / gitweb /
fdroidserver.git
7 years agoMerge branch 'feature/dscanner' into master
Hans-Christoph Steiner [Tue, 6 Dec 2016 13:03:34 +0000 (14:03 +0100)]
Merge branch 'feature/dscanner' into master

dscanner - drozer scanner work.

closes !187

7 years agodscanner - Drozer based post-build dynamic vulnerability scanner command
Kevin C. Krinke [Tue, 6 Dec 2016 12:57:04 +0000 (13:57 +0100)]
dscanner - Drozer based post-build dynamic vulnerability scanner command

 * New command `dscanner`, enables one to scan signed APKs with Drozer
 * Drozer is a dynamic vulnerability scanner for Android
 * Drozer runs in a emulator or on-device, this new `dscanner` command...
  * starts a docker image with Drozer and the Android Emulator pre-installed,
  * loads the signed APK into the emulator
  * activates Drozer automated tests for the APK
  * gathers the report output and places it next to the original APK
 * The Drozer docker image can be:
  * cached locally for re-use (just don't run --clean*)
  * retrieved from dockerhub.com for more efficient runtime
  * or be built from scratch (in the new "./docker" directory)
 * New "Vulnerability Scanning" documentation section (run gendocs.sh)

7 years agoMerge branch 'collection-fixes-and-KnownVuln' into 'master'
Hans-Christoph Steiner [Tue, 6 Dec 2016 12:37:11 +0000 (12:37 +0000)]
Merge branch 'collection-fixes-and-KnownVuln' into 'master'

add KnownVuln anti-feature, and other fixes

This is a bit of a random collection of things that I have added in the process of working on the drozer/scanner support, YAML support, etc.  The only new things are:

* adding new AntiFeature for security issues: `KnownVuln`
* removing broken, incomplete XML metadata support

Everything else included are just code improvements.  This also includes the first check for `KnownVuln`, which is a scanner to check whether custom OpenSSL binaries in apps are not old with known vulnerabilities.  `KnownVuln` will then ultimately be used for things like the drozer scanner !187

See merge request !189

7 years agofix `fdroid build` with non-git repos
Hans-Christoph Steiner [Thu, 1 Dec 2016 22:29:38 +0000 (23:29 +0100)]
fix `fdroid build` with non-git repos

HEAD is really only in git.  This was introduced in
a4e4310803a463433eb7515c2038a8d3ea44edc4

7 years agoconvert metadata test dumps to YAML for easy comparison
Hans-Christoph Steiner [Wed, 23 Nov 2016 14:14:44 +0000 (15:14 +0100)]
convert metadata test dumps to YAML for easy comparison

When making code changes related to the metadata parsing, it is useful to
see how the internal format has changed by seeing the differences in the
dump files.  Those files are currently in the binary .pickle format.  This
just straight converts them to YAML, which is a text format, so that normal
diff tools work to see changes.

The dump files are named .yaml instead of .yml since .yml is used for hand-
edited YAML files for fdroiddata/metadata, while these dump files here are
a human readable form of a Python pickle.

7 years agoremove support for XML app metadata, its broken
Hans-Christoph Steiner [Wed, 23 Nov 2016 14:01:23 +0000 (15:01 +0100)]
remove support for XML app metadata, its broken

JSON and YAML are very closely related, so supporting both of them is
basically almost no extra work.  Both are also closely related to how
Python works with dicts and pickles. XML is a very different beast, and its
not popular for this kind of thing anyway, so just purge it.

7 years agoApp.get_last_build() method to replace duplicated code
Hans-Christoph Steiner [Fri, 18 Nov 2016 22:17:19 +0000 (23:17 +0100)]
App.get_last_build() method to replace duplicated code

Look @mvdan, I added a method to the App class!

7 years agodo proper checking of versionCode value
Hans-Christoph Steiner [Fri, 18 Nov 2016 21:40:29 +0000 (22:40 +0100)]
do proper checking of versionCode value

versionCode is defined as a Java Integer, so any value between -2147483648
(Integer.MIN_VALUE) and 2147483647 (Integer.MIN_VALUE) is valid, including
0.

https://developer.android.com/guide/topics/manifest/manifest-element.html#vcode

7 years agocheck all APKs for old versions of OpenSSL
Hans-Christoph Steiner [Thu, 3 Nov 2016 13:14:08 +0000 (14:14 +0100)]
check all APKs for old versions of OpenSSL

This scans all APKs for old versions of OpenSSL libraries that are known to
be vulnerable to issues, or fully unsupported.

This really should be implemented as a per-APK AntiFeature, so that it can
apply to any version that is vulnerable.  Since AntiFeatures are currently
only per-App, this instead sets the AntiFeature only if the latest APK is
vulnerable.

Google also enforces this:
https://support.google.com/faqs/answer/6376725?hl=en

apk['antiFeatures'] has the first letter small, since all build fields
start with a lowercase letter.  app.AntiFeatures has the first
uppercase since all App fields are that way.

7 years agocheck aapt version to make sure its new enough #236
Hans-Christoph Steiner [Tue, 15 Nov 2016 13:56:11 +0000 (14:56 +0100)]
check aapt version to make sure its new enough #236

Since `fdroid update` parses the output of aapt, and since aapt's output
format changes in non-compatible ways, test to make sure that the version
of aapt is new enough to prevent mystery stacktraces.  This only prints a
warning since in many cases, the old version will work just fine.

7 years agoMerge branch 'master' into 'master'
Ciaran Gultnieks [Fri, 2 Dec 2016 16:09:22 +0000 (16:09 +0000)]
Merge branch 'master' into 'master'

Add gradle 3.2.1

See merge request !192

7 years agoAdd gradle 3.2.1
est31 [Fri, 2 Dec 2016 05:51:38 +0000 (06:51 +0100)]
Add gradle 3.2.1

7 years agoMerge branch 'buildtools-25.0.1' into 'master'
Daniel Martí [Thu, 1 Dec 2016 12:40:25 +0000 (12:40 +0000)]
Merge branch 'buildtools-25.0.1' into 'master'

makebs: add buildtools 25.0.1

Please verify hash before merging.

See merge request !191

7 years agomakebs: add buildtools 25.0.1
Boris Kraut [Thu, 1 Dec 2016 07:38:31 +0000 (08:38 +0100)]
makebs: add buildtools 25.0.1

7 years agoMerge branch 'master' into 'master'
Hans-Christoph Steiner [Sat, 26 Nov 2016 08:02:42 +0000 (08:02 +0000)]
Merge branch 'master' into 'master'

Add ndk 13b

See merge request !190

7 years agoAdd ndk 13b
est31 [Fri, 25 Nov 2016 20:10:44 +0000 (21:10 +0100)]
Add ndk 13b

7 years agoMerge branch 'fdroid-yml-builds' into 'master'
Hans-Christoph Steiner [Thu, 24 Nov 2016 14:04:09 +0000 (14:04 +0000)]
Merge branch 'fdroid-yml-builds' into 'master'

builds straight from source repo using .fdroid.yml

The overarching theme of the merge request is allowing _.fdroid.yml_ to be included in an app's source repo, then letting `fdroid build` build the app straight out of the git repo without requiring a setup like _fdroiddata_ (e.g. _config.py_, _metadata/packagename.txt_, etc.).  _fdroiddata_ repos can then include source repos with a _.fdroid.yml_ by having _metadata/packagename.txt_ that includes just:

```
Repo Type:git
Repo:https://gitlab.com/upstream/app.git
```

Any other metadata fields that are included in _metadata/packagename.txt_ will override what is in _.fdroid.yml_, giving the repo manager the final say about what is included in their repo.  This setup provides a number of benefits:

* CI systems like jenkins, travis, gitlab-ci can build from _.fdroid.yml_
* very easy to start building apps using `fdroid build`, no separate repo needed
* some maintenance can be offloaded to the upstream dev

See merge request !184

7 years agoMerge branch 'patch-1' into 'master'
Hans-Christoph Steiner [Thu, 24 Nov 2016 08:38:04 +0000 (08:38 +0000)]
Merge branch 'patch-1' into 'master'

docs: remove one-line requirement for links

See merge request !188

7 years agodocs: remove one-line requirement for links
Boris Kraut [Thu, 24 Nov 2016 07:30:03 +0000 (07:30 +0000)]
docs: remove one-line requirement for links

7 years agoif building directly in git repo, use file path for remote
Hans-Christoph Steiner [Tue, 8 Nov 2016 15:26:22 +0000 (16:26 +0100)]
if building directly in git repo, use file path for remote

When a git repo has a .fdroid.yml file in it, and `fdroid build` is run
directly in that git repo, then this uses the file path as the remote for
the git repo in build/appid that is actually built.  That makes it possible
to run builds of commits that are only local, and makes things a whole lot
faster.

7 years agoignore files created by tests
Hans-Christoph Steiner [Tue, 8 Nov 2016 08:35:45 +0000 (09:35 +0100)]
ignore files created by tests

7 years agoallow metadata to be embedded in source repos via .fdroid.yml
Hans-Christoph Steiner [Mon, 7 Nov 2016 20:47:53 +0000 (21:47 +0100)]
allow metadata to be embedded in source repos via .fdroid.yml

This allows a source repo to include a complete metadata file so that it
can be built directly in place using `fdroid build`.  If that app is then
included in fdroiddata, it will first load the source repo type and URL
from fdroiddata, then read .fdroid.yml if it exists, then include the rest
of the metadata as specified in fdroiddata, so that fdroiddata has
precedence over the metadata in the source code.

This lets `fdroid build` apps without having a whole fdroiddata setup, but
instead just directly in place in the source code.  This also lets devs
optionallu maintain the fdroid metadata as part of their app, rather than
in fdroiddata without loosing any control.  This should make it easier to
spread around the maintenance load.

7 years agoswitch import test to custom, small test app
Hans-Christoph Steiner [Mon, 7 Nov 2016 22:24:52 +0000 (23:24 +0100)]
switch import test to custom, small test app

The test project should be moved to https://gitlab.com/fdroid/ci-test-app

7 years agoconvert comments above functions to python docstrings
Hans-Christoph Steiner [Mon, 7 Nov 2016 20:27:21 +0000 (21:27 +0100)]
convert comments above functions to python docstrings

This is how to write per-function comments.
https://www.python.org/dev/peps/pep-0257/

7 years agoproperly parse build metadata list types like gradle=
Hans-Christoph Steiner [Mon, 7 Nov 2016 20:21:32 +0000 (21:21 +0100)]
properly parse build metadata list types like gradle=

Something like `gradle: yes` in YAML will be parsed as a boolean, since
'yes' is officially defined as a boolean true in YAML.  For metadata fields
that need to be lists, this needs to be converted.  Same goes for a single
string like `gradle: customFlavor`.

7 years agoinclude version, commit, and android tools versions in local log
Hans-Christoph Steiner [Mon, 7 Nov 2016 14:36:16 +0000 (15:36 +0100)]
include version, commit, and android tools versions in local log

This includes more info to help track down problems with reproducible
builds, like the specific version being built, and which exact versions of
the Android SDK and NDK were used.

7 years agolog versions of all installed Android SDK/NDK components
Hans-Christoph Steiner [Mon, 7 Nov 2016 10:39:33 +0000 (11:39 +0100)]
log versions of all installed Android SDK/NDK components

Any variation in the Android tools used to build an APK can cause the build
to be unreproducible.  To help troubleshoot these times, this posts the
installed versions of the Android SDK and NDK components to the lastbuild
log, for the long term record.

refs #148

7 years agoMerge branch 'makebs' into 'master'
Hans-Christoph Steiner [Wed, 16 Nov 2016 21:09:17 +0000 (21:09 +0000)]
Merge branch 'makebs' into 'master'

makebs updates

See merge request !185

7 years agomakebs: add gradle 3.2
Daniel Martí [Tue, 15 Nov 2016 20:56:15 +0000 (20:56 +0000)]
makebs: add gradle 3.2

7 years agomakebs: update to support repo r40
Daniel Martí [Tue, 15 Nov 2016 20:56:04 +0000 (20:56 +0000)]
makebs: update to support repo r40

7 years agoall: make newer pycodestyle happy
Daniel Martí [Tue, 15 Nov 2016 20:55:06 +0000 (20:55 +0000)]
all: make newer pycodestyle happy

Apparently the "two empty lines" rule is now stricter.

7 years agoMerge branch 'node' into 'master'
Daniel Martí [Tue, 8 Nov 2016 21:33:38 +0000 (21:33 +0000)]
Merge branch 'node' into 'master'

buildserver: install nodejs

Install nodejs to allow webapps to be build (in the future...).

Ref: https://gitlab.com/fdroid/fdroidserver/issues/60

See merge request !183

7 years agobuildserver: install nodejs
Boris Kraut [Mon, 7 Nov 2016 21:54:47 +0000 (22:54 +0100)]
buildserver: install nodejs

7 years agoMerge branch 'build-FPE-update-zip' into 'master'
Daniel Martí [Mon, 7 Nov 2016 15:11:14 +0000 (15:11 +0000)]
Merge branch 'build-FPE-update-zip' into 'master'

Build Privileged Extension OTA update.zip using `fdroid build`

This allows `fdroid build` to build the OTA update ZIP file for F-Droid Privileged Extension, so that the official releases can be built and distributed via the normal F-Droid channels.   This is related to #233

Ultimately the client will also have to be updated to allow it to handle the non-APK files.

See merge request !181

7 years agowp-fdroid: show GPG Signature link for source tarballs
Hans-Christoph Steiner [Thu, 3 Nov 2016 09:38:22 +0000 (10:38 +0100)]
wp-fdroid: show GPG Signature link for source tarballs

Now that source tarballs can be GPG-signed, the website should also display
a link to fetch them.

7 years agogpg-sign all valid files in the repo, including source tarballs
Hans-Christoph Steiner [Thu, 3 Nov 2016 09:26:38 +0000 (10:26 +0100)]
gpg-sign all valid files in the repo, including source tarballs

This makes sure there is a GPG signature on any file that is included in
the repo, including APKs, OBB, source tarballs, media files, OTA update
ZIPs, etc.  Having a GPG signature is more important on non-APK files since
they mostly do not have any signature mechanism of their own.

This also adds basic tests of adding non-APK/OBB files to a repo with
`fdroid update`.

closes #232

7 years agoallow arbitrary build products, not only APKs
Hans-Christoph Steiner [Mon, 31 Oct 2016 18:53:55 +0000 (19:53 +0100)]
allow arbitrary build products, not only APKs

This makes it so that the final build product can be specified in output=
and it'll work no matter if its an APK or not.  This was developed around
the case of building the OTA update.zip for the Privileged Extension. It
should work for any build process in theory but it has not yet been tested.

https://gitlab.com/fdroid/privileged-extension/issues/9

7 years agoget_release_filename() to handle any file type, not just APKs
Hans-Christoph Steiner [Mon, 31 Oct 2016 15:51:34 +0000 (16:51 +0100)]
get_release_filename() to handle any file type, not just APKs

In order to support non-APK files that are built by `fdroid build`, this
function that names the file releases needs to be generic.

7 years agouse versionName unmodified as specified
Hans-Christoph Steiner [Wed, 26 Oct 2016 18:41:37 +0000 (20:41 +0200)]
use versionName unmodified as specified

The versionName is defined as a string or string resource that can be any
arbitrary data.  fdroid should not second guess the developer here, and
should just use the versionName unmodified.  For anything that needs to
compare different versions of apps, versionCode should always be used since
that's what Android uses.

https://developer.android.com/guide/topics/manifest/manifest-element.html#vname

7 years agoupdate buildserver scripts in sdist tarball manifest
Hans-Christoph Steiner [Wed, 26 Oct 2016 18:46:34 +0000 (20:46 +0200)]
update buildserver scripts in sdist tarball manifest

This was overlooked in previous work on ./makebuildserver

7 years agoMerge branch 'support-media-files' into 'master'
Daniel Martí [Wed, 2 Nov 2016 21:11:05 +0000 (21:11 +0000)]
Merge branch 'support-media-files' into 'master'

Support media files

This is the first step in supporting adding artibitrary files to fdroid repos, targeted add supporting media files and flashable _update.zip_ files like used to install the Privileged Extension.  This reuses the existing metadata fields to keep compatibilty with older versions, but that means that lots of names are confusingly named since they refer to aspects of an APK rather than a generic file.  We can address that later when we refactor the whole index metadata.

See merge request !177

7 years agoMerge branch 'master' into 'master'
Hans-Christoph Steiner [Wed, 2 Nov 2016 17:18:02 +0000 (17:18 +0000)]
Merge branch 'master' into 'master'

Scanner: handle utf8 errors more gracefully

Don't throw an error without any info which file caused it.

Fixes #226

See merge request !180

7 years agoreuse os.stat() result when checking for non-APK files
Hans-Christoph Steiner [Wed, 2 Nov 2016 14:50:34 +0000 (15:50 +0100)]
reuse os.stat() result when checking for non-APK files

This should make things a bit more efficient when running on lots of files,
unless python was already caching the result...

7 years agosupport adding arbitrary files to a repo
Hans-Christoph Steiner [Thu, 13 Oct 2016 16:24:58 +0000 (18:24 +0200)]
support adding arbitrary files to a repo

This adds the most basic level of support for including arbitrary files in
an F-Droid repository.  This is useful for things like including videos,
ebooks, update.zip files for ROM updates, and more.  The aim is to have
this as generic as possible to keep it flexible for unforeseen uses.

Code-wise, this is really just a first effort.  This area of code has not
been touched in a very long time, and the repo parsing is done in a giant
function that is not easy to break apart.  It should be broken up to more
cleanly support arbitrary files.

Also remove the TODO line, we've decided to keep the old permission
format for now, at least until there is a major overhaul of the index
data format.  And the issue tracker the proper place for TODOs.

7 years agocreate addElementIfInApk() function for clean up common operation
Hans-Christoph Steiner [Thu, 13 Oct 2016 16:02:44 +0000 (18:02 +0200)]
create addElementIfInApk() function for clean up common operation

There are currently a couple different ways this is done in the code, this
commit changes all of them to be like addElementNonEmpty().

7 years agoScanner: handle utf8 errors more gracefully
est31 [Wed, 2 Nov 2016 11:51:15 +0000 (12:51 +0100)]
Scanner: handle utf8 errors more gracefully

Fixes #226

7 years agoremove unused 'apps' argument from update.scan_apks()
Hans-Christoph Steiner [Thu, 13 Oct 2016 15:28:54 +0000 (17:28 +0200)]
remove unused 'apps' argument from update.scan_apks()

7 years agosupport all valid versionCode values, i.e. Java Integer values
Hans-Christoph Steiner [Thu, 13 Oct 2016 14:50:31 +0000 (16:50 +0200)]
support all valid versionCode values, i.e. Java Integer values

versionCode can be any Java Integer value, from Integer.MAX_VALUE
(2147483648) to Integer.MIN_VALUE (-2147483647)

7 years agoMerge branch 'texinfo' into 'master'
Hans-Christoph Steiner [Mon, 31 Oct 2016 17:51:16 +0000 (17:51 +0000)]
Merge branch 'texinfo' into 'master'

CI: use new docker image with texinfo

docs/gendocs.sh uses makeinfo.

See merge request !179

7 years agoCI: use new docker image with texinfo
Daniel Martí [Mon, 31 Oct 2016 14:02:39 +0000 (14:02 +0000)]
CI: use new docker image with texinfo

docs/gendocs.sh uses makeinfo.

7 years agoMerge branch 'updates' into 'master'
Daniel Martí [Tue, 25 Oct 2016 11:06:47 +0000 (11:06 +0000)]
Merge branch 'updates' into 'master'

makebs and CI updates

See merge request !178

7 years agoBump ci images and default build-tools
Daniel Martí [Sun, 23 Oct 2016 15:58:37 +0000 (16:58 +0100)]
Bump ci images and default build-tools

7 years agomakebs: bump m2repo, add api25 and build-tools 25
Daniel Martí [Sun, 23 Oct 2016 15:47:19 +0000 (16:47 +0100)]
makebs: bump m2repo, add api25 and build-tools 25

7 years agoMerge branch 'build-tools' into 'master'
Ciaran Gultnieks [Wed, 5 Oct 2016 18:09:46 +0000 (18:09 +0000)]
Merge branch 'build-tools' into 'master'

makebs: add build-tools 24.0.3

See merge request !175

7 years agoMerge branch 'fixes-on-the-way-to-kvm' into 'master'
Ciaran Gultnieks [Wed, 5 Oct 2016 18:09:18 +0000 (18:09 +0000)]
Merge branch 'fixes-on-the-way-to-kvm' into 'master'

buildserver fixes on the way to KVM

Here are a couple of relatively basic fixes I found while working on the KVM support (merge request coming soon).

See merge request !174

7 years agomakebs: add build-tools 24.0.3
Daniel Martí [Mon, 3 Oct 2016 08:10:41 +0000 (09:10 +0100)]
makebs: add build-tools 24.0.3

7 years agobuildserver: only auto-detect KVM in ./makebuildserver
Hans-Christoph Steiner [Wed, 28 Sep 2016 07:52:00 +0000 (09:52 +0200)]
buildserver: only auto-detect KVM in ./makebuildserver

Having a second, different KVM auto-detect routine in Vagrantfile will only
confuse things.  This also removes the direct call to the systemd utility.

7 years agobuildserver: run dir check as very first thing
Hans-Christoph Steiner [Mon, 26 Sep 2016 11:11:22 +0000 (07:11 -0400)]
buildserver: run dir check as very first thing

No point in running any other code if the script is just going to bail
out with an error.  This assumes that ./makebuildserver is only ever
run from a git clone of fdroidserver.git.

7 years agobuildserver: use py3's pathlib to generate cache file URL
Hans-Christoph Steiner [Mon, 26 Sep 2016 11:17:31 +0000 (07:17 -0400)]
buildserver: use py3's pathlib to generate cache file URL

This should handle edge cases better, like odd characters in the path, etc.

7 years agojenkins-build-makebuildserver: remove errant blank line
Hans-Christoph Steiner [Mon, 26 Sep 2016 10:14:37 +0000 (06:14 -0400)]
jenkins-build-makebuildserver: remove errant blank line

7 years agoMerge branch 'master' into 'master'
Hans-Christoph Steiner [Tue, 27 Sep 2016 12:54:02 +0000 (12:54 +0000)]
Merge branch 'master' into 'master'

Add qt sdk support

Qt SDK extraction on the VM

See merge request !172

7 years agoAdd qt sdk support
est31 [Sat, 24 Sep 2016 12:10:55 +0000 (14:10 +0200)]
Add qt sdk support

7 years agoMerge branch 'checkupdates-crash' into 'master'
Ciaran Gultnieks [Mon, 26 Sep 2016 21:46:16 +0000 (21:46 +0000)]
Merge branch 'checkupdates-crash' into 'master'

checkupdates: avoid crash with --auto and None CVC

As reported by @CiaranG.

See merge request !173

7 years agocheckupdates: avoid crash with --auto and None CVC
Daniel Martí [Mon, 26 Sep 2016 20:07:55 +0000 (21:07 +0100)]
checkupdates: avoid crash with --auto and None CVC

Reproducible via `fdroid checkupdates --auto subreddit.android.appstore`
at fdroiddata HEAD (e76449ab).

WARNING: ...subreddit.android.appstore : Couldn't find package ID
CRITICAL: Unknown exception found!
Traceback (most recent call last):
  File "/home/mvdan/.bin/fdroid", line 147, in <module>
    main()
  File "/home/mvdan/.bin/fdroid", line 124, in main
    mod.main()
  File "/home/mvdan/git/fsr/fdroidserver/checkupdates.py", line 571, in main
    checkupdates_app(app)
  File "/home/mvdan/git/fsr/fdroidserver/checkupdates.py", line 469, in checkupdates_app
    if int(build.vercode) >= int(app.CurrentVersionCode):
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

7 years agoMerge branch 'fix-post-kvm' into 'master'
Ciaran Gultnieks [Fri, 23 Sep 2016 16:33:52 +0000 (16:33 +0000)]
Merge branch 'fix-post-kvm' into 'master'

Fix post KVM

A couple of fixes to the KVM support that was just merged, as reported by @CiaranG

See merge request !171

7 years agobuildserver: bochs can also be used with KVM
Hans-Christoph Steiner [Fri, 23 Sep 2016 15:40:23 +0000 (17:40 +0200)]
buildserver: bochs can also be used with KVM

jenkins.debian.net is being detected as 'bochs' rather than 'qemu'.

7 years agobuildserver: only check cache permissions when using libvirt
Hans-Christoph Steiner [Fri, 23 Sep 2016 13:19:15 +0000 (15:19 +0200)]
buildserver: only check cache permissions when using libvirt

VirtualBox runs as the same user as `fdroid`, so the cache does not need to
be accessible by the world.  On libvirt, libvirtd runs the VMs as its own
user, so in that case, the cache dirs must have permissions to let that
user access them.

7 years agobuildserver: wipe snapshot from libvirt store on --clean
Hans-Christoph Steiner [Mon, 19 Sep 2016 14:45:06 +0000 (16:45 +0200)]
buildserver: wipe snapshot from libvirt store on --clean

7 years agoMerge branch 'buildserver-qemu-kvm' into 'master'
Ciaran Gultnieks [Fri, 23 Sep 2016 12:25:12 +0000 (12:25 +0000)]
Merge branch 'buildserver-qemu-kvm' into 'master'

buildserver running in qemu/kvm to support KVM on KVM

jenkins.debian.net runs in QEMU/KVM instances, so in order to run the F-Droid buildserver there, it needs to work inside of a KVM guest.  The best way I found to do that is to create QEMU/KVM instances via KVM's "nested" virtualization support.  This collection of commits enables using QEMU/KVM as the buildserver when `./makebuildserver` detects that it is running inside of KVM.  Otherwise, the old behavior is default: running in VirtualBox.

I have run these tests inside of ubuntu/16.04 on bare metal, which uses VirtualBox, and ubuntu/16.04 KVM guest, which uses QEMU/KVM.  It'll also run on the Guardian Project jenkins box, which is Debian/jessie.

@mvdan @CiaranG @krt

See merge request !168

7 years agoMerge branch 'master' into 'master'
Hans-Christoph Steiner [Fri, 23 Sep 2016 06:36:58 +0000 (06:36 +0000)]
Merge branch 'master' into 'master'

makebs: add gradle 3.1

See merge request !170

7 years agomakebs: add gradle 3.1
est31 [Fri, 23 Sep 2016 05:50:52 +0000 (07:50 +0200)]
makebs: add gradle 3.1

7 years agoMerge branch 'vagrant' into 'master'
Daniel Martí [Tue, 20 Sep 2016 16:19:08 +0000 (16:19 +0000)]
Merge branch 'vagrant' into 'master'

docs: update vagrant link

As pointed out in https://f-droid.org/forums/topic/documentation-bug-fix-report/#post-21839 , the link to the vagrant doc is 404. I'd assume that this is the correct link, but please verify this before merge.

See merge request !169

7 years agodocs: update vagrant link
Boris Kraut [Tue, 20 Sep 2016 09:38:12 +0000 (11:38 +0200)]
docs: update vagrant link

7 years agobuildserver: only include latest m2 when provisioning
Hans-Christoph Steiner [Mon, 19 Sep 2016 11:29:46 +0000 (13:29 +0200)]
buildserver: only include latest m2 when provisioning

I think the `android update sdk` tool is installing all of the m2 files
that are present in the temp cache, and it seems to do it in order of
newest to oldest.  Well done, and I thought that tool couldn't get any
worse.  So only include the latest version of android_m2repository*.zip in
the temp cache.

7 years agobuildserver: ensure dirs to mount cache exist in guest VM instance
Hans-Christoph Steiner [Thu, 15 Sep 2016 13:50:16 +0000 (15:50 +0200)]
buildserver: ensure dirs to mount cache exist in guest VM instance

It seems that the 9p synced folder setup is not as flexible and easy as the
VirtualBox one, so we have to do more little things like this.

7 years agobuildserver: fix jenkins build to support QEMU/KVM
Hans-Christoph Steiner [Thu, 15 Sep 2016 12:38:36 +0000 (14:38 +0200)]
buildserver: fix jenkins build to support QEMU/KVM

7 years agobuildserver: retry apt-get downloads 20 times
Hans-Christoph Steiner [Thu, 15 Sep 2016 09:12:49 +0000 (11:12 +0200)]
buildserver: retry apt-get downloads 20 times

Try harder before failing the whole buildserver setup.

7 years agobuildserver: auto-detect and use libvirt's QEMU+KVM
Hans-Christoph Steiner [Thu, 15 Sep 2016 09:12:18 +0000 (11:12 +0200)]
buildserver: auto-detect and use libvirt's QEMU+KVM

For running in QEMU/KVM guests like on jenkins.debian.net, this sets up the
whole process automatically.  This only really covers the case where this
is running in a KVM guest, and the original case of running VirtualBox on
bare metal.  It could be extended to cover more cases if someone wanted to.

7 years agobuildserver: make sure cachedir is accessible to VM instance
Hans-Christoph Steiner [Tue, 6 Sep 2016 12:22:29 +0000 (14:22 +0200)]
buildserver: make sure cachedir is accessible to VM instance

It seems that KVM/QEMU's 9p sharing is more sensitive to file perms.  If
~/.cache is 0700, then ~/.cache/fdroidserver cannot be mounted in the guest

7 years agobuildserver: support optionally using qemu+kvm
Hans-Christoph Steiner [Mon, 5 Sep 2016 21:21:24 +0000 (23:21 +0200)]
buildserver: support optionally using qemu+kvm

This makes it possible to run the full build process in a KVM virtual
machine, like jenkins.debian.net.

closes #190

7 years agobuildserver: ignore android sdk repos of proprietary bits
Hans-Christoph Steiner [Thu, 15 Sep 2016 09:29:31 +0000 (11:29 +0200)]
buildserver: ignore android sdk repos of proprietary bits

The Android SDK by default includes some Google repositories of their
proprietary SDKs.  We of course do not want that stuff ever.  We also do
not need the emulator images since this process does not currently install
or run an emulator.

7 years agoexample file for public read only S3 bucket policy
Hans-Christoph Steiner [Thu, 15 Sep 2016 09:35:38 +0000 (11:35 +0200)]
example file for public read only S3 bucket policy

This is the locked down S3 policy as created by Benetech for their Secure
App Generator project.

7 years agoskip `fdroid import` test if gitlab is not available
Hans-Christoph Steiner [Thu, 15 Sep 2016 06:29:18 +0000 (08:29 +0200)]
skip `fdroid import` test if gitlab is not available

This prevents CI build failures when gitlab is deploying or has other
issues that might cause a 500.

7 years agoMerge branch 'gradle-wrapper' into 'master'
Daniel Martí [Thu, 15 Sep 2016 20:45:44 +0000 (20:45 +0000)]
Merge branch 'gradle-wrapper' into 'master'

Make the gradle wrapper smarter

@eighthave PTAL

This will help with issues like https://gitlab.com/fdroid/fdroiddata/issues/515

See merge request !166

7 years agoMerge branch 'makebs-updates' into 'master'
Hans-Christoph Steiner [Thu, 15 Sep 2016 20:38:43 +0000 (20:38 +0000)]
Merge branch 'makebs-updates' into 'master'

Makebs updates

See merge request !167

7 years agomakebs: bump support repo to 38
Daniel Martí [Thu, 15 Sep 2016 19:07:25 +0000 (20:07 +0100)]
makebs: bump support repo to 38

7 years agomakebs: bump tools to 25.2.2
Daniel Martí [Thu, 15 Sep 2016 19:07:16 +0000 (20:07 +0100)]
makebs: bump tools to 25.2.2

7 years agogradle: support gradle-wrapper.properties version
Daniel Martí [Thu, 15 Sep 2016 18:14:40 +0000 (19:14 +0100)]
gradle: support gradle-wrapper.properties version

Brings our wrapper closer to gradlew's functionality.

Updates #98.

7 years agogradle: delay calculating some versions
Daniel Martí [Thu, 15 Sep 2016 18:10:18 +0000 (19:10 +0100)]
gradle: delay calculating some versions

Simplifies the wrapper script.

7 years agoMerge branch 'control-errors-warnings' into 'master'
Daniel Martí [Mon, 12 Sep 2016 14:16:42 +0000 (14:16 +0000)]
Merge branch 'control-errors-warnings' into 'master'

make metadata exceptions optional based on CLI flag

In many cases, there are times where metadata errors need to be ignored, or
at least not stop the command from running.  For example, there will
inevitably be new metadata fields added, in which case a packaged version
of fdroidserver will throw errors on each one.  This adds a standard -W
flag to customize the response: ignore, default, or error.

* by default, the errors are still errors
* `fdroid readmeta -W` will just print errors
* `fdroid readmeta -Wignore` will not even print errors

https://gitlab.com/fdroid/fdroidserver/issues/150

See merge request !164

7 years agoMerge branch 'buildserver-fixes-pre-kvm' into 'master'
Daniel Martí [Mon, 12 Sep 2016 14:16:15 +0000 (14:16 +0000)]
Merge branch 'buildserver-fixes-pre-kvm' into 'master'

buildserver fixes pre-KVM

This is a collection of little fixes to the buildserver setup that I did while implementing the QEMU+KVM support.  Since I was running the whole process repeatedly, I had opportunity to find and fix little things like this.

See merge request !165

7 years agobuildserver: remove Kivy, unused since 2013 and out of date
Hans-Christoph Steiner [Mon, 12 Sep 2016 11:05:05 +0000 (13:05 +0200)]
buildserver: remove Kivy, unused since 2013 and out of date

This is the last thing using Chef, which adds a lot of time to the time it
takes to fully provision the buildserver.  This slows down development on
the things we are actually using, like running all builds on
jenkins.debian.net.

#210 #165

7 years agobuildserver: download apt package first to increase reliability
Hans-Christoph Steiner [Tue, 6 Sep 2016 12:33:13 +0000 (14:33 +0200)]
buildserver: download apt package first to increase reliability

This does not have the careful result rechecking that chef has, when it
installs each package in the list one at a time.  So to help with failures
caused by a package failing to download, first try downloading all the
package, then run the install.  The install pass will try to download any
missing packages.

Really, this should use ansible or perhaps chef again since those include
lots of tricks around this stuff.

7 years agobuildserver: only specify lib*-dev to future proof package list
Hans-Christoph Steiner [Thu, 8 Sep 2016 19:47:42 +0000 (21:47 +0200)]
buildserver: only specify lib*-dev to future proof package list

Using libssl-dev will work on all releases of Debian, but Debian/stretch
does not have libssl1.0.0.

7 years agobuildserver: test build of Checkey and old F-Droid
Hans-Christoph Steiner [Thu, 7 Jul 2016 19:44:55 +0000 (21:44 +0200)]
buildserver: test build of Checkey and old F-Droid

The buildserver should still be able to build old versions of apps, and
Checkey is a verified, reproducible build.

7 years agobuildserver: force a known-good version of chef
Hans-Christoph Steiner [Tue, 30 Aug 2016 20:56:06 +0000 (22:56 +0200)]
buildserver: force a known-good version of chef

This forces the release channel and version of chef-solo to install on the
guest VM.  I was getting really massive, odd stacktraces without specifying
this, and chef is only used for Kivy now anyway.

7 years agobuildserver: vagrant-cachier conflicts with custom apt cache
Hans-Christoph Steiner [Tue, 30 Aug 2016 19:23:40 +0000 (21:23 +0200)]
buildserver: vagrant-cachier conflicts with custom apt cache

The technique where /var/cache/apt is mounted as a shared folder conflicts
with vagrant-cachier's workings.  Therefore, ignore vagrant-cachier if the
user selects ./makebuildserver's custom apt cache.  The shared folder way
has the advantage for CI builds of storing the cache outside of
VAGRANT_HOME, which is set to be in the git project.  That gets wiped by
`git clean -fdx` on each CI build.

7 years agomake metadata exceptions optional based on CLI flag
Hans-Christoph Steiner [Mon, 12 Sep 2016 10:55:48 +0000 (12:55 +0200)]
make metadata exceptions optional based on CLI flag

In many cases, there are times where metadata errors need to be ignored, or
at least not stop the command from running.  For example, there will
inevitably be new metadata fields added, in which case a packaged version
of fdroidserver will throw errors on each one.  This adds a standard -W
flag to customize the response: ignore, default, or error.

* by default, the errors are still errors
* `fdroid readmeta -W` will just print errors
* `fdroid readmeta -Wignore` will not even print errors

https://gitlab.com/fdroid/fdroidserver/issues/150

7 years agoBump to 0.7.0 0.7.0
Daniel Martí [Sun, 11 Sep 2016 09:52:11 +0000 (11:52 +0200)]
Bump to 0.7.0

7 years agoMerge branch 'updates' into 'master'
Daniel Martí [Sat, 10 Sep 2016 10:06:44 +0000 (10:06 +0000)]
Merge branch 'updates' into 'master'

all: bump to build-tools 24.0.2

Update the docker image to include it there too.

See merge request !163