fdroidserver.deploy module

fdroidserver.deploy.find_release_infos(index_v2_path, repo_dir, package_names)

Find files, texts, etc. for uploading to a release page in index-v2.json.

This function parses index-v2.json for file-paths elegible for deployment to release pages. (e.g. GitHub releases) It also groups these files by packageName and versionName. e.g. to get a list of files for all specific release of fdroid client you may call:

find_binary_release_infos()[‘org.fdroid.fdroid’][‘0.19.2’]

All paths in the returned data-structure are of type pathlib.Path.

fdroidserver.deploy.main()
fdroidserver.deploy.push_binary_transparency(git_repo_path, git_remote)

Push the binary transparency git repo to the specifed remote.

If the remote is a local directory, make sure it exists, and is a git repo. This is used to move this git repo from an offline machine onto a flash drive, then onto the online machine. Also, this pulls because pushing to a non-bare git repo is error prone.

This is also used in offline signing setups, where it then also creates a “local copy dir” git repo that serves to shuttle the git data from the offline machine to the online machine. In that case, git_remote is a dir on the local file system, e.g. a thumb drive.

fdroidserver.deploy.sync_from_localcopy(repo_section, local_copy_dir)

Sync the repo from “local copy dir” filesystem to this box.

In setups that use offline signing, this is the last step that syncs the repo from the “local copy dir” e.g. a thumb drive to the repo on the local filesystem. That local repo is then used to push to all the servers that are configured.

fdroidserver.deploy.update_awsbucket(repo_section, is_index_only=False, verbose=False, quiet=False)

Upload the contents of the directory repo_section (including subdirectories) to the AWS S3 “bucket”.

The contents of that subdir of the bucket will first be deleted.

Requires AWS credentials set in config.yml: awsaccesskeyid, awssecretkey

fdroidserver.deploy.update_awsbucket_libcloud(repo_section, is_index_only=False)

No summary.

Upload the contents of the directory repo_section (including subdirectories) to the AWS S3 “bucket”.

The contents of that subdir of the bucket will first be deleted.

Requires AWS credentials set in config.yml: awsaccesskeyid, awssecretkey

fdroidserver.deploy.update_awsbucket_s3cmd(repo_section, is_index_only=False)

Upload using the CLI tool s3cmd, which provides rsync-like sync.

The upload is done in multiple passes to reduce the chance of interfering with an existing client-server interaction. 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.

fdroidserver.deploy.update_localcopy(repo_section, local_copy_dir)

Copy data from offline to the “local copy dir” filesystem.

This updates the copy of this repo used to shuttle data from an offline signing machine to the online machine, e.g. on a thumb drive.

fdroidserver.deploy.update_remote_storage_with_rclone(repo_section, is_index_only=False, verbose=False, quiet=False)

Upload fdroid repo folder to remote storage using rclone sync.

Rclone sync can send the files to any supported remote storage service once without numerous polling. If remote storage is s3 e.g aws s3, wasabi, filebase then path will be bucket_name/fdroid/repo where bucket_name will be an s3 bucket If remote storage is storage drive/sftp e.g google drive, rsync.net the new path will be bucket_name/fdroid/repo where bucket_name will be a folder

Better than the s3cmd command as it does the syncing in one command Check https://rclone.org/docs/#config-config-file (optional config file)

fdroidserver.deploy.update_servergitmirrors(servergitmirrors, repo_section)

Update repo mirrors stored in git repos.

This is a hack to use public git repos as F-Droid repos. It recreates the git repo from scratch each time, so that there is no history. That keeps the size of the git repo small. Services like GitHub or GitLab have a size limit of something like 1 gig. This git repo is only a git repo for the purpose of being hosted. For history, there is the archive section, and there is the binary transparency log.

fdroidserver.deploy.update_serverwebroot(serverwebroot, repo_section)

Deploy the index files to the serverwebroot using rsync.

Upload the first time without the index files and delay the deletion as much as possible. That keeps the repo functional while this update is running. Then once it is complete, rerun the command again to upload the index files. Always using the same target with rsync allows for very strict settings on the receiving server, you can literally specify the one rsync command that is allowed to run in ~/.ssh/authorized_keys. (serverwebroot is guaranteed to have a trailing slash in common.py)

It is possible to optionally use a checksum comparison for accurate comparisons on different filesystems, for example, FAT has a low resolution timestamp

fdroidserver.deploy.update_serverwebroots(serverwebroots, repo_section, standardwebroot=True)
fdroidserver.deploy.upload_apk_to_android_observatory(path)
fdroidserver.deploy.upload_apk_to_virustotal(virustotal_apikey, packageName, apkName, hash, versionCode, **kwargs)
fdroidserver.deploy.upload_to_android_observatory(repo_section)
fdroidserver.deploy.upload_to_github_releases(repo_section, gh_config, global_gh_token)
fdroidserver.deploy.upload_to_github_releases_repo(repo_conf, release_infos, global_gh_token)
fdroidserver.deploy.upload_to_servergitmirror(mirror_config: Dict[str, str], local_repo: Repo, enabled_remotes: List[str], repo_section: str, is_index_only: bool, fdroid_dir: str, git_mirror_path: str, ssh_cmd: str, progress: RemoteProgress) None
fdroidserver.deploy.upload_to_virustotal(repo_section, virustotal_apikey)