dexdump is only available for certain CPU architectures. Google binaries
are for amd64 and arm64. Debian binaries are for amd64, arm64, armhf,
i386, and riscv64. That leaves out armel, ppc64el, s390x, loong64, etc.
where pure Python code runs perfectly fine.
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.
`keypass: {env: keypass}` has been in use in production repos for
years. That is not anything new. It makes it possible to maintain
_config.yml_ publicly even when it needs secrets. This change makes
sure it is possible to use {env: foo} syntax anywhere where a string
value is valid. The "list of dicts" values can be str, list of str or
list of dicts with str.
Before the {env: keypass} syntax, the actual password was just inline
in the config file. Before this commit, it was only possible to use
{env: key} syntax in simple, string-only configs, e.g. from
examples/config.yml:
This outputs YAML in a string that is suitable for use in regexps
and string replacements, as well as complete files. It is therefore
explicitly set up to avoid writing out headers and footers.
This is a key piece of the ongoing `PUBLISH` _config.yml_ migration. There was uneven implementation of which YAML parser to use, and that could lead to bugs where one parser might read a value one way, and a different parser will read the value a different way. I wanted to be sure that YAML 1.2 would always work.
This makes all code that handles config files use the same `ruamel.yaml` parsers. This only touches other usages of YAML parsers when there is overlap. This does not port all of _fdroidserver_ to `ruamel.yaml` and YAML 1.2. The metadata files should already be YAML 1.2 anyway.
# Conflicts:
# fdroidserver/lint.py
This makes it easy to track all the places that use config.yml, and
hopefully makes things feel cleaner. This also standardizes all places
where config.yml is written out to use UTF-8 as the file encoding.
This also includes a lot of black code format fixes.
I don't think it is possible to automatically handle those cases, because
proxy setups can be so widely varied and can have privacy ramifications.
The person running the test who hits proxy errors will need to handle them
manually.
* It should include a subdir named after the test case.
* self.testdir is the common var name for this.
* tmp_repo is not a repo/ subdir, but instead the root of the whole repo
This name always confuses me, since there is also test_common.py. And this
module is not actually a test suite, even though it starts with "test".
This also makes for better tab completion, e.g.
python3 -m unittest tests/te[Tab] -> tests/test_
This test checks the detection of the default initial branch. It is a hard
thing to test since different platform configurations have different
defaults. checkupdates is basically only used on GNU/Linux anyway.
Here's the failure:
https://gitlab.com/fdroid/fdroidserver/-/jobs/8896420261
On some systems, localhost is only defined for 127.0.0.1 (e.g. Ubuntu
and Debian containers). However, there is code that hardcodes possible
values for localhost, making it possible to open an IPv6 socket for
localhost.
On those systems, the socket will be open but urllib3 will resolve
localhost *only* to 127.0.0.1, thus failing miserably to connect.
To resolve the situation, rather than defaulting to IPv6 we actually
resolve localhost and use the socket family of the first result. On my
current system (upcoming Ubuntu Plucky) if localhost=::1 is defined in
/etc/hosts it will come up as the first result, if not 127.0.0.1 will.
V2: Use self.port rather than a forgotten hardcoded port.
Fixes: f01628ca6b "fix localhost network tests on systems with IPv6"
verified.json can get quite large on verification.f-droid.org, and for some
unknown reason, it sometimes corrupts it when writing it out. All the data
is already available in all the other JSON files, so this just automatically
reconstructs it. Its a hack, but it took me much less time than I've
already spent trying to troubleshoot why it writes out corrupt verified.json.
ZipFile.namelist() produces a string per file. The filename could contain
newline chars, including at the beginning and end. ^$ in regex matches
around newline chars. \A\Z matches the beginning/end of the full string.
This is exactly the same as obfusk's r'\AMETA-INF/(?s:.)*\.(DSA|EC|RSA)\Z'
but in a readable format that is also easily searchable, and standard for
this code base.
https://github.com/obfusk/fdroid-fakesigner-poc/blob/master/fdroidserver-regex.patch#1251