Commit Graph

1095 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
81cff5eaa3 skip rewritemeta tests if ruamel.yaml > 0.17.21 #1138 2025-12-03 19:07:25 +01:00
Hans-Christoph Steiner
8c7f5abf92 checkupdates: only run tests on GNU/Linux
checkupdates is only ever run in production on Debian and it often fails
elsewhere.

https://gitlab.com/fdroid/fdroidserver/-/jobs/12307572200
2025-12-03 19:07:25 +01:00
Hans-Christoph Steiner
6c46c363a1 calculate_math_string: isolate tests, they need no setUp 2025-12-03 19:07:25 +01:00
Hans-Christoph Steiner
0a252a0bdd net.download_file() only uses https:// by default
This strictly enforces things like this only use https://:

* `Binaries:` / `binary:` URLs
* `fdroid signatures` fetching APKs
* `fdroid install` fetching from GitHub
2025-12-03 17:13:19 +01:00
linsui
cd33d91e2b scanner: remove file without read permission 2025-12-03 16:43:23 +01:00
Hans-Christoph Steiner
f64f9c82ca scanner: check binaries for debuggable/testOnly
This used to be enforced by !1734, but that bitrotted away and no longer
works.  This is a better place to enforce this, since it is easier to
reliably find it in the APK rather than the source code.
2025-12-02 18:11:24 +01:00
Hans-Christoph Steiner
5712438809 lint: update list of URL shorteners 2025-12-01 18:39:44 +01:00
Hans-Christoph Steiner
13874b9f4f lint: use PEP8 upper case names for global vars 2025-12-01 16:24:58 +01:00
Hans-Christoph Steiner
34a6e2cfee lint: require https:// and no shorteners in Donate: links 2025-12-01 16:11:17 +01:00
Hans-Christoph Steiner
40a5d8ecf8 lint: require Binaries:/binary: use https:// and no URL shorteners 2025-12-01 16:11:17 +01:00
Hans-Christoph Steiner
7a9bb1d0d8 lint: fix false positives on URL shorteners 2025-12-01 16:11:15 +01:00
Michael Pöhn
6f1c253b09 🧹 cleanup get_virt_container_type() fail with exception instead exiting 2025-11-26 12:57:35 +00:00
Hans-Christoph Steiner
40d1113898 purge remove_debuggable_flags(), upstreams should handle this
Also, there might be valid use cases for using fdroidserver to build APKs
that are debuggable.  There are other checks to ensure that debuggable APKs
are not published, e.g. in `fdroid update`.

48df58854c/fdroidserver/update.py (L1978)
2025-11-26 12:35:01 +00:00
linsui
146f2b93fe rewritemeta: support read from stdin 2025-11-26 12:22:39 +00:00
Hans-Christoph Steiner
2112858185 schedule_verify: do not schedule if no Repo: is provided 2025-11-26 11:55:11 +00:00
Hans-Christoph Steiner
171cf77cc3 rm config.buildserver.yml, ANDROID_HOME set in /etc/profile.d/bsenv.sh
`fdroid build_local_run` has been running without this for a long time.
2025-11-26 11:50:58 +00:00
Hans-Christoph Steiner
be27b58114 checkupdates: standardize on "from fdroidserver import X"
This is the code style used in most of the rest of the submodules.
2025-11-26 11:49:49 +00:00
Hans-Christoph Steiner
0b4764504d checkupdates: fix pylint invalid-name use-dict-literal no-else-return/raise 2025-11-26 11:49:49 +00:00
Hans-Christoph Steiner
b43faa8c75 lint: port to common.config, remove local config var 2025-11-24 12:31:28 +01:00
Hans-Christoph Steiner
379e293320 lint; fix double execution of tests 2025-11-24 12:01:48 +01:00
Hans-Christoph Steiner
9abb716e48 lint: check git/srclib Repo URLs for proper format 2025-11-24 12:01:48 +01:00
Hans-Christoph Steiner
09a229f662 lint: master or main is actually preferred in URLs over HEAD 2025-11-24 12:01:48 +01:00
linsui
b47ceb648b Remove /opt/gradle related code 2025-11-18 00:32:08 +08:00
Ygsk Lv.212
a211a047b5 Update BTC & LTC regex for Taproot and stricter rules 2025-11-17 09:44:54 +00:00
linsui
91b5c85a7c Update litecoin address regex 2025-11-17 02:33:07 +08:00
Hans-Christoph Steiner
b1b30d13a4 set up config['ndk_paths'] on demand by reading source.properties
ndk_paths is set up right after installing the NDK and right before
ndk_paths is used in Build.ndk_path().

A proper NDK install always has a _source.properties_ which declares
the revision and release strings. That is used as the source of
revision and release.  This only reads from the local filesystem, and
reads the official source of version info (_source.properties_),
thereby avoiding any potential network calls that sdkmanager might
do. This implementation was inspired by @uniqx's:

ed931d47d7 (27b997d583cd1c0a05b2213437e0d9fe6536bfe3)
2025-11-11 15:56:01 +01:00
Michael Pöhn
9de92dc215 💂 push: owner fix 2025-11-05 11:20:41 +01:00
Hans-Christoph Steiner
950efbbb45 safety catch for --cpus so it isn't higher than actual CPUs 2025-10-29 21:22:35 +01:00
Hans-Christoph Steiner
8421d61369 get_virt_memory_opt: support str values like "16GB" 2025-10-29 21:22:35 +01:00
Michael Pöhn
cd3ca7dc57 🪗 get auto NDK installs working in vm builds 2025-10-29 21:06:43 +01:00
Hans-Christoph Steiner
4f1b50f7a6 switch test_signatures.py to mkdtemp to fix mystery
I have no idea what is causing this to fail, but the mkdtemp pattern used
in other test files seems to fix it.

https://gitlab.com/fdroid/fdroidserver/-/jobs/11776468083
======================================================================
ERROR: test_main (tests.test_signatures.SignaturesTest.test_main)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builds/fdroid/fdroidserver/tests/test_signatures.py", line 28, in test_main
    with TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
                                         ^^^^^^^^^^^^^^
  File "/builds/fdroid/fdroidserver/tests/shared_test_code.py", line 44, in __enter__
    self.orig_cwd = os.getcwd()
                    ^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
----------------------------------------------------------------------
2025-10-23 12:03:52 +02:00
Hans-Christoph Steiner
2fbd6f1a19 new subcommand "schedule_verify" to generate events for apps to verify 2025-10-23 12:03:52 +02:00
Hans-Christoph Steiner
da032d517a new subcommand "pull": podman/vagrant implementation 2025-10-22 19:45:25 +02:00
Hans-Christoph Steiner
9fa7193620 new subcommand "push": podman/vagrant implementation 2025-10-22 19:42:50 +02:00
Hans-Christoph Steiner
63660e1aed new subcommand "exec": podman implementation 2025-10-20 15:38:03 +02:00
Hans-Christoph Steiner
fd60436aa3 new subcommand "destroy": podman implementation 2025-10-20 15:38:03 +02:00
Hans-Christoph Steiner
76673627fc new subcommand "up" for vagrant up and `podman run 2025-10-20 15:38:00 +02:00
Hans-Christoph Steiner
87d0e5a10b specify virt_container_type via config and CLI options 2025-10-16 14:14:03 +02:00
Hans-Christoph Steiner
b00b9c9390 metadata: get_single_build() for new subcommands
The new subcommands operate on a single APPID:VERSIONCODE pair, so this new
function fetches the metadata needed for that operation, and includes any
required checks.

The algorithm came from:
uniqx/fdroidserver@2b779e6599

This reworking of it includes:

* removed `check_disabled`, seems like the scheduler should handle that? If
  it is required, it can be added later.
* standard variable names
* fixed spelling errors and hopefully improved docstrings
* black format
* added tests
* standardized the strings, made them localizable
2025-10-09 17:00:58 +02:00
Hans-Christoph Steiner
9a6148c5b4 deploy: do not leak username/hostname from machine pushing repo
Git will use the username/hostname to set the Author and Committer fields
if the config items user.name and user.email are not set.  This might
inadvertently leak info about the machine that is hosting the deploy
process.  So this changes it to be a hardcoded value, unless the repo
environment has explicitly set these values either in the Git config or in
environment variables.
2025-09-29 13:25:13 +02:00
Hans-Christoph Steiner
473068f311 deploy: test case for !1666
This is included here and not there because it relies on lots of stuff that
was refactored.  !1666 was broken out to get the fix out for fdroidclient
as soon as possible.
2025-09-29 13:25:13 +02:00
Hans-Christoph Steiner
8601749734 deploy: assert logs when error messges should be thrown 2025-09-29 13:25:13 +02:00
Hans-Christoph Steiner
e8f7771c1f tests: suppress "WARNING:root:unsafe permissions on 'config.yml' (should be 0600)!" 2025-09-29 13:25:13 +02:00
Hans-Christoph Steiner
04ec16d68a deploy: move remote repo to common test setup in TestServerGitMirrors 2025-09-29 13:25:13 +02:00
Hans-Christoph Steiner
5fcc5b1252 deploy: simplify asserts in servergitmirrors tests 2025-09-29 13:25:13 +02:00
Hans-Christoph Steiner
a96e647b2f deploy: common test setup for all tests of servergitmirrors
This refactors the servergitmirrors tests into their own class.
2025-09-29 13:25:13 +02:00
Hans-Christoph Steiner
b6e73345e2 deploy: convert to common.get_config()
717df09be0
2025-09-29 13:25:13 +02:00
Hans-Christoph Steiner
0a5f15dad7 nightly: GitLab URLs end in '.git' to avoid warning and redirects
warning: redirecting to https://gitlab.com/fdroid/fdroidclient-nightly.git/
2025-09-29 13:25:13 +02:00
Hans-Christoph Steiner
4cf3727db7 use example.com as default repo domain name, closes admin#300 2025-09-29 11:21:00 +00:00
paul mayero
ffc0a6cec0 Fix tests for replacing s3cmd and libcloud 2025-09-25 14:21:02 +00:00