Commit graph

3741 commits

Author SHA1 Message Date
Hans-Christoph Steiner
6a3758d3c4 update: more accurate fastlane subdir/flavor matching
This should fix Schildichat showing Element X's metadata.
2025-07-26 12:36:32 +00:00
linsui
120a1655b4 scanner: report all errors 2025-07-26 18:33:57 +08:00
Hans-Christoph Steiner
5049645003 make gradlew-fdroid a standalone project
https://gitlab.com/fdroid/gradlew-fdroid
2025-07-25 17:46:31 +00:00
Hans-Christoph Steiner
96c0d928da update: support fastlane/ dir in subdir:
GNU Taler apps use this.
* https://git.taler.net/taler-android.git/tree/merchant-terminal/fastlane/metadata/android/en-US?h=pos-1.0.2
2025-07-16 17:32:49 +02:00
Hans-Christoph Steiner
ba5c78d45f update: fetch Builds one time and reuse 2025-07-16 16:35:58 +02:00
Hans-Christoph Steiner
52c1bcca70 only copy icons into repo/ if they changed
This should make things more efficient and reduce the size of the diffs in
the transparency log.  Using shutil.copy2() preserves metadata.
2025-06-25 09:46:20 +00:00
Hans-Christoph Steiner
d71fba164c nightly: fix bug that clones nightly repo to wrong location
bug introduced in ce018158ee from !1563
2025-06-24 13:08:48 +02:00
Hans-Christoph Steiner
e177520379 nightly: include project's LICENSE in the nightly repo 2025-06-24 13:08:48 +02:00
Hans-Christoph Steiner
fd3f71ad3c
run tests/refresh-SUSS_DEFAULT.py 2025-06-23 22:37:23 +02:00
Hans-Christoph Steiner
53bf6c7ce1 deploy: use master branch when working complete git-mirror repo
The *-nightly git repo always uses the _master_ branch.  The `index_only:`
support maintains a separate local branch since its git repo should be as
small as possible.  The full repo should be maintained for mirrors not
using `index_only:` so that when it force-pushes, it does not need to always
push all the files, only the updated ones.  So the full repo should be
maintained in the _master_ branch, and only the `index_only` mirrors should
have their own branch.

This adds a test case to reproduce this error:
https://gitlab.com/fdroid/fdroidclient/-/jobs/10347168516

This case also applies to any setup that used `servergitmirrors:` before the
`index_only:` feature was added.  This also applies to cases if the repo
maintainer manually clones the *-nightly repo into _fdroid/git-mirror/_
2025-06-23 12:39:15 +00:00
Hans-Christoph Steiner
76d711ba3c nightly: convert to black format 2025-06-18 18:34:53 +02:00
Hans-Christoph Steiner
b2057a1ce0 nightly: switch dep from vcs_git to GitPython
This code already depends on GitPython, and hopefully the common.vcs* stuff
can eventually go away entirely.  GitPython should provide those bits
already, and they are maintained by someone else.

https://github.com/gitpython-developers/GitPython/pull/2029
2025-06-18 18:34:49 +02:00
Hans-Christoph Steiner
ce018158ee nightly: set up test for git clone function 2025-06-18 18:03:59 +02:00
Hans-Christoph Steiner
494d811846 update: If cateogories.yml only has icon:, then add name:
E.g. if _categories.yml_ is like:

```yaml
Time:
  icon: time.png
```
2025-06-16 17:13:48 +00:00
Hans-Christoph Steiner
59102fb07f update: use ctime/mtime to control _strip_and_copy_image runs
Oftentimes, the file that is copied is stripped, in which case, the file
size is different.  Using a file size check here means it will rerun the
strip and copy every time `fdroid update` is run for any image that needs
to be stripped.  If the source's ctime is newer than the destination, then
the process should run since it is a newly created file.  Even more so with
mtime, since the destination's mtime is reset based on the source's.
2025-06-11 17:33:34 +02:00
linsui
cd1630d2f5 Lazyload environment variables in config.yml 2025-06-11 13:02:09 +00:00
Hans-Christoph Steiner
721de49104 make_website: only parse repo_pubkey if its needed
This makes writing tests a lot easier, since the test cases no longer need
to provide a value for `repo_pubkey:`.
2025-06-08 20:12:04 +00:00
Jochen Sprickerhof
cfc848771d Deprecate bzr, hg and git-svn support (attack surface) 2025-05-23 07:14:42 +00:00
linsui
a5d966bf0f calculate all combinations of gradle flavors 2025-05-22 12:24:33 +02:00
linsui
e957583337 common: add calculate_gradle_flavor_combination 2025-05-22 12:24:32 +02:00
linsui
6c054f62ca flavour -> flavor 2025-05-22 12:16:43 +02:00
linsui
243a0475f9 checkupdates: don't create branch with .lock end 2025-05-22 12:12:24 +02:00
linsui
e538c34c32 checkupdates: set push ref to HEAD:refs/heads/branch_name 2025-05-22 12:12:24 +02:00
Leo Heitmann Ruiz
ffd4274503 Fix handling of Triple-T 1.0.0 graphics
Unlike screenshots, the featureGraphic, icon, promoGraphic, and tvBanner
should be placed directly in the locale directory instead of in a
dedicated subdirectory (in the F-Droid metadata structure). For version
1.0.0 of the Triple-T structure this currently isn't done. Instead, the
graphics are treated as screenshots are.

To illustrate:

en-US/listing/icon/icon.png
en-US/listing/featureGraphic/play_store_feature_graphic.png

Should end up as:

en-US/icon.png
en-US/featureGraphic.png

But instead they currently end up as:

en-US/icon/icon.png
en-US/featureGraphic/play_store_feature_graphic.png

This patch should fix it.

It seems the erroneous behavior was introduced in
a4169484fd

Closes #1260
2025-05-21 16:57:35 +00:00
Hans-Christoph Steiner
20b36f1970 SOURCE_DATE_EPOCH from app's git otherwise fdroiddata metadata file
https://reproducible-builds.org/docs/source-date-epoch
2025-05-19 16:31:40 +02:00
Hans-Christoph Steiner
4e7bda736c update: never execute VCS e.g. git
Package repos come from untrusted sources, in terms of the buildserver. They
should be handled in VMs and containers as much as possible to avoid
vulnerabilities.  As far as I could tell, `fdroid update` only has a single
place where it executes any VCS system: if there is .fdroid.yml present in
a package repo, then it will fetch the commit ID using git.

For better security properties, this implements a simple function to just
read the files to get that commit ID.  The function that executes git to do
the same thing is relabeled "unsafe".  That is used for status JSON
everywhere, but that runs on fdroiddata.git and fdroidserver.git, which are
trusted repos.

The unsafe version is also used in places where git.Repo() is needed for
other things.
2025-05-12 18:30:03 +02:00
Jochen Sprickerhof
b83c1aace3
Make v2 localized config optional
Fixes:

Traceback (most recent call last):
  File "/home/fdroid/fdroidserver/fdroid", line 22, in <module>
    fdroidserver.__main__.main()
  File "/home/fdroid/fdroidserver/fdroidserver/__main__.py", line 222, in main
    raise e
  File "/home/fdroid/fdroidserver/fdroidserver/__main__.py", line 203, in main
    mod.main()
  File "/home/fdroid/fdroidserver/fdroidserver/update.py", line 2774, in main
    fdroidserver.index.make(archived_apps, archapks, repodirs[1], True)
  File "/home/fdroid/fdroidserver/fdroidserver/index.py", line 132, in make
    make_v2(
  File "/home/fdroid/fdroidserver/fdroidserver/index.py", line 728, in make_v2
    output["repo"] = v2_repo(repodict, repodir, archive)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fdroid/fdroidserver/fdroidserver/index.py", line 686, in v2_repo
    repo["icon"] = config["archive" if archive else "repo"]["icon"]
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'icon'
2025-04-28 08:38:54 +02:00
Hans-Christoph Steiner
2a33857fd0
update: include stages timing info in update.json
!1627 missed this, so stages only get included in running.json.  That means
the stages info is only visible while update is running, making it hard to
use.
2025-04-23 19:26:50 +02:00
Hans-Christoph Steiner
56338cd7d0 repo_key_sha256 to list of valid config keys
fdroidserver!287
2025-04-16 11:11:57 +00:00
Hans-Christoph Steiner
17e5a59704 verify: generate <appid>.json files that list all reports 2025-04-10 15:41:46 +00:00
Hans-Christoph Steiner
029636ed61 verify: write verified.json in function to ease testing 2025-04-10 15:41:46 +00:00
linsui
2aba6fd324 checkupdates: always print remote message of git push 2025-04-09 17:48:11 +08:00
linsui
a13dd109d3 checkupdates: adjust log level 2025-04-09 14:51:27 +08:00
Michael Pöhn
69f9f52ba2 drop error prefix when raising VCSException in case retrieving git revision failed 2025-04-03 10:24:46 +00:00
Michael Pöhn
046c527ee8 vcs_git: clearer error messages for checkrepo()
This updates error messages the help identify issues when loading srclibs
and fixes pushing srclibs into build vms/containers.
2025-04-03 10:24:46 +00:00
Michael Pöhn
0d88a94192 metadata: rename srcdir -> srclibs_dir for clarity 2025-04-03 10:24:46 +00:00
Hans-Christoph Steiner
a011b34b97 black format and use returncode directly without != 0 2025-03-31 11:27:13 +02:00
Hans-Christoph Steiner
9a8d80ee6b purge dead code: apk_signer_fingerprint_short 2025-03-31 11:09:07 +02:00
Hans-Christoph Steiner
4cefec9333
fix missing comma in error message 2025-03-25 12:13:22 +01:00
Hans-Christoph Steiner
8f351d8406 publish: convert to black code format 2025-03-25 10:23:00 +00:00
Hans-Christoph Steiner
5150c721f4 verify_apk_signature: work when options is not set
Then test_signatures.py can run on the PUBLISH CI job.
2025-03-25 10:23:00 +00:00
Hans-Christoph Steiner
acbab69722 update: add execution stages to status JSON
This should help us profile what takes so long in `fdroid update`.  It also
gives feedback so that people can see how close to done it is, or where it
failed.

This is based on how incremental status JSON works for `fdroid build`.
2025-03-24 11:14:40 +01:00
Hans-Christoph Steiner
35d205a9b9 scanner: only output "X problems found" if errors or --verbose
UNIX/POSIX standard behavior is to output nothing at all if a command
succeeds.  This suppresses "0 problems found", unless the user requests it.
2025-03-21 08:45:23 +00:00
Hans-Christoph Steiner
4b9100ae80 publish: remove last use of stats/ dir
This file can be treated like the other index files in repo/. This also has
the advantage that it will automatically get synced by @CiaranG's existing
sync scripts.
2025-03-20 15:08:32 +01:00
Hans-Christoph Steiner
38378ddfb7 rename v1_sort_packages to sort_package_versions 2025-03-20 15:08:32 +01:00
Hans-Christoph Steiner
8565a97465 rename functions and variables to reflect stats/ going away 2025-03-20 15:08:32 +01:00
Hans-Christoph Steiner
20569217d9 index: fail if user sets mirrors:isPrimary wrong
Really, this is not meant to be set by the user in the config.  But if they
add something harmless that'll be ignored anyway, it seems that throwing an
error is too much.  So only throw the error if it is set wrongly.
2025-03-20 11:13:09 +00:00
linsui
5e28cd367f scanner: add bun.lock as lock file of package.json 2025-03-20 07:29:09 +00:00
Hans-Christoph Steiner
e23b196a0f
run tests/refresh-SUSS_DEFAULT.py 2025-03-19 17:45:08 +01:00
Hans-Christoph Steiner
2f4e0f47a1 signatures: make from . import net optional
This eliminates the need to have python3-requests installed on the signing
server.  This was missed in 031ae1103e
2025-03-12 17:27:26 +01:00