Commit graph

52 commits

Author SHA1 Message Date
linsui
7a98650ed3 Sort import
ruff check --fix --select I
2025-07-26 15:35:19 +00: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
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
e03915e391 deploy: ensure progress is instantiated before trying to use it 2024-10-30 14:43:45 +00:00
Hans-Christoph Steiner
fe3d929f67 deploy: lists for command lines to handle escaping
fdroidserver uses lists of strings to handle the escaping command line
arguments, this converts the rclone code to that pattern.
2024-09-17 10:16:57 +00:00
Hans-Christoph Steiner
5126a58af8 deploy: rclone_config always as list to avoid code duplication 2024-09-17 10:16:57 +00:00
Hans-Christoph Steiner
492d4a5619
fix typo in translatable string: s,itmes,items,g 2024-09-10 17:00:54 +02:00
Hans-Christoph Steiner
fbb6772e37 always use GitLab Pages, not Artifacts, with index-only mode
If the repo is too large, then it'll hit the GitLab Pages limit.  That is
basically impossible in index-only mode, so it should always use Pages.
2024-07-03 09:18:22 +00:00
Hans-Christoph Steiner
034e83bfca deploy: complete index-only support for awsbucket: 2024-07-03 09:18:22 +00:00
Michael Pöhn
0fa88c5c20
💇 implement review nits
Implement review nits as requested bei @eighthave in
https://gitlab.com/fdroid/fdroidserver/-/merge_requests/1471
2024-06-27 12:28:54 +02:00
Michael Pöhn
aca98c1355
🏏 incorporate review feedback 2024-06-27 12:28:29 +02:00
Michael Pöhn
a87284cf80
🚥 deploy: tests for github releases deploy functions
Add test cases for github releases function in deploy.py
2024-06-27 12:28:16 +02:00
Michael Pöhn
242490ddc3
🎯 deploy: no releaseChannels on github releases
Don't deploy versions of to GitHub releases where a `releaseChannels`
value is set in index-v2.json. (This usually would mean it's a alpha or
beta version.)
2024-06-27 12:28:04 +02:00
Michael Pöhn
c6598f2835
☄️ deploy: github releases - whatsNew text as note
Use whatsNew text (if available) as release notes text when deploying to
Github releases. This feature will always use 'en-US' locale texts,
since English is the lingua franka on GitHub. Additionally this change
also adds a config option to preprend a static text to those release
notes.
2024-06-27 12:27:51 +02:00
Michael Pöhn
a079f9d85f
♟️ deploy: add global config github_token 2024-06-27 12:27:39 +02:00
Michael Pöhn
7a6fa7f816
🛄 deploy: separate function for release file lookup 2024-06-27 12:27:27 +02:00
Michael Pöhn
1b19293ab0
🛰️ deploy: github releases
Implemented basic support for using `fdroid delpoy` to upload APKs from
the repo to GitHub releases.
2024-06-27 12:27:01 +02:00
pmmayero
8255dec6b8 fix: jinja 2 CVE 2024-06-12 06:30:27 +00:00
pmmayero
3f59d0908f fix: subprocess.check_output to produce string and not bytes 2024-06-12 06:30:27 +00:00
proletarius101
845ed3ef47 Add index only deployment mode 2024-06-11 17:45:59 +00:00
paul mayero
7aabfbcbf0 Adding rclone as an option to fdroid deploy 2024-05-29 14:08:07 +00:00
Hans-Christoph Steiner
18f3acc32e split out options from read_config()
There is no longer any reason for these to be intertwined.

This deliberately avoids touching some files as much as possible because
they are super tangled and due to be replaced.  Those files are:

* fdroidserver/build.py
* fdroidserver/update.py

# Conflicts:
#	tests/testcommon.py

# Conflicts:
#	fdroidserver/btlog.py
#	fdroidserver/import_subcommand.py
2024-05-08 16:26:46 +02:00
linsui
f82d648cb1 deploy: retry when git push fails 2024-05-05 20:53:35 +00:00
Hans-Christoph Steiner
79f148167a deploy: automatically convert to black format 2024-04-24 08:42:15 +00:00
Hans-Christoph Steiner
cb04d801d8 deploy: manually move hard cases to black code format 2024-04-24 08:42:15 +00:00
Michael Pöhn
fb33ae58e2
🐑 naive alt-store support
Naive shot at implementing alt store support. Might still be missing important
bits and pices I'm not aware of.
2024-04-23 16:04:07 +02:00
proletarius101
947217549a feat: add servergitmirrors as a dict support 2024-02-14 16:50:39 +00:00
Hans-Christoph Steiner
810387a009 deploy: update_serverwebroots() for testable logic
This moves all of the serverwebroot: logic into a function, and adds tests.
I did this because I ran into issues in the logic in main():

Traceback (most recent call last):
  File "/builds/eighthave/fdroidserver/fdroid", line 22, in <module>
    fdroidserver.__main__.main()
  File "/builds/eighthave/fdroidserver/fdroidserver/__main__.py", line 230, in main
    raise e
  File "/builds/eighthave/fdroidserver/fdroidserver/__main__.py", line 211, in main
    mod.main()
  File "/builds/eighthave/fdroidserver/fdroidserver/deploy.py", line 753, in main
    s = serverwebroot.rstrip('/').split(':')
AttributeError: 'dict' object has no attribute 'rstrip'
2024-01-23 18:49:12 +01:00
Hans-Christoph Steiner
fbf097d390 deploy: update_serverwebroot() works w/o options/config
Since update_serverwebroot() is part of the public API, this function should
work without setting `fdroidserver.deploy.options` or
`fdroidserver.deploy.config`.
2024-01-23 17:48:47 +01:00
Hans-Christoph Steiner
7a656d45e3 config: convert serverwebroot: to list-of-dicts format
This allows for more metadata about the server and deploy mode.
2024-01-22 22:11:49 +01:00
Hans-Christoph Steiner
00aa595f37 deploy: give useful error if rsync is not installed 2023-09-08 10:42:27 +02:00
Hans-Christoph Steiner
f7830a41f1 deploy: ensure mirrors and binary transparency always create 'master'
If there was a global default on a machine that was something other than
'master', these things would crash with:

Traceback (most recent call last):
  File "/home/hans/code/fdroid/server/fdroid", line 22, in <module>
    fdroidserver.__main__.main()
  File "/home/hans/code/fdroid/server/fdroidserver/__main__.py", line 230, in main
    raise e
  File "/home/hans/code/fdroid/server/fdroidserver/__main__.py", line 211, in main
    mod.main()
  File "/home/hans/code/fdroid/server/fdroidserver/deploy.py", line 833, in main
    push_binary_transparency(BINARY_TRANSPARENCY_DIR,
  File "/home/hans/code/fdroid/server/fdroidserver/deploy.py", line 705, in push_binary_transparency
    local.pull('master')
  File "/usr/lib/python3/dist-packages/git/remote.py", line 1045, in pull
    res = self._get_fetch_info_from_stderr(proc, progress, kill_after_timeout=kill_after_timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/git/remote.py", line 848, in _get_fetch_info_from_stderr
    proc.wait(stderr=stderr_text)
  File "/usr/lib/python3/dist-packages/git/cmd.py", line 604, in wait
    raise GitCommandError(remove_password_if_present(self.args), status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git pull -v -- local master
  stderr: 'fatal: couldn't find remote ref master'
2023-05-10 09:21:14 +02:00
Hans-Christoph Steiner
1fbfae355a pylint: Reenable R1723 no-else-break
* R1723: Unnecessary "elif" after "break", remove the leading "el" from "elif" (no-else-break)
2023-03-20 16:33:16 +01:00
FestplattenSchnitzel
abc752314b pylint: Reenable E1101 no-member 2023-03-20 16:33:16 +01:00
Hans-Christoph Steiner
75bf953c80 fix pylint: C0104: Disallowed name "bar" (disallowed-name) 2023-02-02 16:02:49 +01:00
Hans-Christoph Steiner
1a30766c24
deploy: GIT_DEPTH=1 so GitLab Pages job runs as quick as possible
* https://docs.gitlab.com/ee/ci/large_repositories/index.html#shallow-cloning
2022-11-16 20:16:34 +01:00
Hans-Christoph Steiner
d0976a3684
deploy: check repo size before enabling GitLab Pages 2022-11-16 20:16:30 +01:00
Hans-Christoph Steiner
cdce0958f8
deploy: convert .gitlab-ci.yml generation to dict + yaml.dump() 2022-11-16 20:16:27 +01:00
Hans-Christoph Steiner
01f7dfd0b3 index-v2.jar is not a valid file, remove references
entry.jar is the signed file, it references index-v2.json.
2022-11-15 13:22:09 +00:00
Jochen Sprickerhof
c89a9f0e8b
Add timeout argument to requests.(get,post) 2022-09-05 17:50:10 +02:00
Hans-Christoph Steiner
2448f070e9 fix tests and docstring error 2022-05-23 15:34:30 +02:00
Hans-Christoph Steiner
293975d081
refactor comment into docstring for update_serverwebroot 2022-05-23 14:41:37 +02:00
Hans-Christoph Steiner
053a64718a
deploy: handle index-v2 files on two pass sync methods
When using rsync or s3cmd, the upload is done in multiple passes. This
reduces the chance of interfering with an existing client-server
interaction.

- rsync: In the first pass, upload without the index files and delay
  the deletion as much as possible.  That keeps the repo functional
  while this update is running.  Then second pass uploads the index
  files.

- s3cmd: In the first pass, only new files are uploaded.  In the
  second pass, changed files are uploaded, overwriting what is on the
  server.  On the third/last pass, the indexes are uploaded, and any
  removed files are deleted from the server.  The last pass is the
  only pass to use a full MD5 checksum of all files to detect changes.
2022-05-23 14:41:34 +02:00
Hans-Christoph Steiner
707cd7addb
publish index-v1.json and include a gpg signature
This gives a more flexible and direct way for many clients to consume the
index file. #969
2022-02-22 22:58:09 +01:00
Jochen Sprickerhof
b6f1f4231a Drop code for the old wiki 2021-11-24 18:16:07 +01: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
33bff6b298 Publish unsigned builds
This should make debugging reproducible builds easier.
2021-02-12 10:20:30 +00:00
Jochen Sprickerhof
2103569958 Run push_binary_transparency only once 2021-02-02 09:07:28 +01:00
Hans-Christoph Steiner
97d5933a05 change config.py to config.yml everywhere it is needed 2021-01-29 13:24:17 +01:00