1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-01 08:40:11 +02:00
Commit Graph

281 Commits

Author SHA1 Message Date
Jochen Sprickerhof
b6f1f4231a Drop code for the old wiki 2021-11-24 18:16:07 +01:00
Jochen Sprickerhof
45a20ab365 [checkupdates] Tweak logging
- Increase severity of version mismatch.
- Don't log that the process is done.
2021-10-14 12:11:01 +00:00
Jochen Sprickerhof
fde48a1e77 [checkupdates] Warn if no version in latest tag 2021-08-21 08:23:27 +02:00
Jochen Sprickerhof
16f8d50194 [checkupdates] make no version information an error 2021-07-29 11:38:15 +02:00
Jochen Sprickerhof
58dcb4c2a0 [checkupdates] Don't fail for disabled apps 2021-07-29 11:37:34 +02:00
Jochen Sprickerhof
44a0e7e74f [checkupdates] Simplify logic in check_http 2021-07-28 00:09:40 +02:00
Jochen Sprickerhof
8f836b3b01 [checkupdates] Move log messages into method 2021-07-28 00:09:40 +02:00
Jochen Sprickerhof
ae98844943 [checkupdates] Raise exception instead of returning an error 2021-07-28 00:09:40 +02:00
Jochen Sprickerhof
6f7a1ecf01 [checkupdates] Don't catch exceptions
Basically moves all code one level up.
2021-07-28 00:09:40 +02:00
Jochen Sprickerhof
a2db8f4a62 [checkupdates] Exit 1 in case of errors 2021-07-28 00:09:40 +02:00
Jochen Sprickerhof
674786db96 [checkupdates] Ignore broken submodule
In case the app repository has a broken submodule, checkupdates failed
and did not search for any version updates. Ignoring the error let's us
at least find new version in the main repo (which is probably the right
place anyhow) and thus an improvement.
2021-06-25 12:15:41 +02:00
Benedikt Brückmann
01b9fb1549 Fix pep8 whitespace errors 2021-06-25 06:28:47 +02:00
Benedikt Brückmann
1e943a22df rewrite docstrings to match numpy style guide 2021-06-25 06:28:47 +02:00
Jochen Sprickerhof
b49c3741bd [checkupdates] Use tag if version is 'Unknown'
Regression from cd405cc9.
Parse_androidmanifests() can return 'Unknown' or 'Ignore' if it did not
find a version name. The check_tags() always returned the tag and
checkupdates_app() replaced the version by the tag in the 'Unknown'
case. Since cd405cc9 the tag is the hash and so the version would become
the hash as well. This patch moves the 'Unknown' check directly after
the Parse_androidmanifests().
2021-06-20 08:49:49 +02:00
Jochen Sprickerhof
39c55d799b [checkupdates] Only update if version code is grater
Don't change the current versions in case there is an error in the check_* methods or upstream screwed up.
2021-06-17 11:52:37 +00:00
Jochen Sprickerhof
cd405cc93e Use hash of tag when adding new version
Also extend getref with a refname parameter and implement it for
vcs_git.
2021-06-17 11:51:18 +00:00
Jochen Sprickerhof
cebdcdd67c [checkupdates] UpdateCheckData tag for verocode if no regex
Use the tag as the version code if no regex was specified. This allows:

UpdateCheckData: '|||'

meaning the tag should be used for version code and name.
2021-06-15 19:27:29 +02:00
Jochen Sprickerhof
bdec7d8652 [checkupdates] UpdateCheckData use tag by default
Use the tag as version, if no version file was specified:

UpdateCheckData: app/build.gradle|versionCode\s(\d+)||

Extract version from tag, if a regex was specified:

UpdateCheckData: app/build.gradle|versionCode\s(\d+)||Android-([\d.]+)

Use the tag for both if no file was specified:

UpdateCheckData: |\+(\d+)||Android-([\d.]+)
2021-06-09 14:02:02 +02:00
Jochen Sprickerhof
69a0a7da39 [checkupdates] UpdateCheckData warn if file was not found
Instead of throwing an exception.
2021-06-09 11:52:11 +02:00
Jochen Sprickerhof
a74922f56e [checkupdates] handle non matching regex 2021-06-07 17:59:43 +02:00
linsui
92ec6265a3 checkupdates.py: use pathlib and support Windows 2021-06-07 21:02:03 +08:00
Jochen Sprickerhof
ed2da42eff Support hex in versionCode with UCM RepoManifest
Same a b83c3c9e.
2021-06-07 13:47:18 +02:00
Jochen Sprickerhof
133b626b22 Support UpdateCheckData in check_tags 2021-06-07 13:47:18 +02:00
Jochen Sprickerhof
ba2b236e7b Drop unused package id check 2021-06-07 13:47:18 +02:00
Jochen Sprickerhof
185da60d93 Support AutoUpdateMode: Version without pattern
Since 24dd6740 UpdateCheckMode: Tags uses the found tag instead of
regenerating it from the AutoUpdateMode pattern making the pattern
superfluous. This adds support for dropping the pattern and a test case.
2021-06-01 13:59:49 +02:00
Sylvia van Os
24dd6740e1 Use tag if known
This ensures that we actually use the tag someone created when a new tag
is detected.
2021-04-07 09:41:03 +00:00
Hans-Christoph Steiner
fc7f9204b6 checkupdates: set User-Agent to make gitlab.com happy
closes #863
2021-02-02 21:37:53 +01:00
Hans-Christoph Steiner
0f6b638986 common.get_app_display_name() for finding app names 2021-01-14 20:34:15 +01:00
Hans-Christoph Steiner
bf25b4ca03 eliminate app.builds everywhere, it should be app['Builds']
The .txt format was the last place where the lowercase "builds" was used,
this converts references everywhere to be "Builds".  This makes it possible
to load metadata YAML files with any YAML parser, then have it possible to
use fdroidserver methods on that data, like metadata.write_metadata().

The test files in tests/metadata/dump/*.yaml were manually edited by cutting
the builds: block and putting it the sort order for Builds: so the contents
should be unchanged.

```
sed -i \
 -e 's/app\.builds/app.get('Builds', \[\])/g' \
 -e "s/app\.get(Builds, \[\]) =/app\['Builds'] =/g" \
 -e "s/app\.get(Builds, \[\]) =/app\['Builds'] =/g" \
 -e "s/app\.get(Builds, \[\])/app.get('Builds', \[\])/g" \
 -e "s/app\.get('Builds', \[\])\.append/app\['Builds'\].append/g" \
 -e "s/app\['builds'\]/app.get('Builds', [])/g" \
 */*.*
```
2020-12-15 08:55:05 +01:00
Hans-Christoph Steiner
fede58a710 use ArgumentParser's own "usage" line in help output 2020-10-01 23:01:55 +02:00
Hans-Christoph Steiner
b23cf9f8ad use YAML names for referring to metadata fields in messages 2020-10-01 23:01:55 +02:00
Hans-Christoph Steiner
5e1377c77a standardize on "Application ID" in UI text 2020-10-01 23:01:55 +02:00
Hans-Christoph Steiner
e8a6d0f813
checkupdates: write status JSON 2020-02-18 23:45:52 +01:00
Marcus Hoffmann
9ae41cc1ff add support for gradle kotlin scripts
https://guides.gradle.org/migrating-build-logic-from-groovy-to-kotlin/
Closes fdroid/fdroidserver#613

cherry-picked from Bubu/fdroidserver@7d2e9f9c
2020-02-13 22:32:51 +01:00
Hans-Christoph Steiner
3b5e3a62a3
move getappname+getcvname to checkupdates, the only place they're used 2020-01-31 15:37:57 +01:00
Hans-Christoph Steiner
3df276cc3c
fix all bandit B310 urllib_urlopen
"Audit url open for permitted schemes. Allowing use of ‘file:’’ or custom
schemes is often unexpected."

https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b310-urllib-urlopen
2020-01-31 15:37:30 +01:00
Gerhard Olsson
cf9bff1d56 AutoUpdateMode: Do not include + in suffix
Add suffix to version only
2020-01-02 13:27:12 +00:00
Hans-Christoph Steiner
7d40e89341
checkupdates: split out vercode parsing into testable function 2019-12-03 23:51:48 +01:00
Jochen Sprickerhof
b83c3c9e18 Support hex in versionCode
Example: https://github.com/Wilm0r/giggity/blob/master/app/src/main/AndroidManifest.xml#L2
2019-11-29 20:01:29 +01:00
Michael Pöhn
be3d498391 checkupdates: check_http fix ignore check 2019-07-23 22:01:18 +02:00
Michael Pöhn
1c4d377793 use logging.warning in checkupdates 2019-07-23 22:01:18 +02:00
Gerhard Olsson
19aa736011 UpdateCheckName is Ignore: Do not parse manifests 2019-07-23 01:02:31 +02:00
Gerhard Olsson
7c4bed0558 UpdateCheckIgnore: Exception if version not matched
Ignoreversions were checked also if version did not match which raised the exception
The 'version check' runs in some unexpected situations like just
to find directories where to find the AutoName.
2019-07-23 00:21:28 +02:00
Hans-Christoph Steiner
a089614225 checkupdates: remove magic number 99999999 from HTTP checks
It is vestigal from old code and no longer is needed.
2018-08-29 17:24:24 +02:00
Michael Pöhn
24b20d7668 use simple ast+operator based calculator for evaluating Vercode Operation 2018-05-22 13:08:14 +02:00
mimi89999
aaa6b55bf7
checkupdates: Save app data to correct metadata format
Closes #461
2018-03-09 20:46:59 +01:00
Hans-Christoph Steiner
70d9633555 build/checkupdates/update: log current fdroiddata commit to wiki 2018-03-05 21:49:09 +01:00
Hans-Christoph Steiner
86907d2ebf checkupdates: exit with error if fdroiddata git repo is dirty
One key security property of the F-Droid ecosystem is that the sensitive
code is all stored forever in git repos and source tarballs.  That means
we can easily go back and see if there where exploits and where they came
from.  Therefore, checkupdates should require everything in fdroiddata be
committed to git before running.

This provides --allow-dirty to override that behavior.
2018-03-05 21:49:09 +01:00
Hans-Christoph Steiner
8f30c892c5 VercodeOperation: only allow simple math expresssions and %c 2018-03-05 09:45:58 +01:00
Hans-Christoph Steiner
7da0747849 checkupdates: require UpdateCheckData has valid HTTPS URL 2018-03-01 23:51:36 +01:00