fdroidserver.deploy module

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)

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)

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)

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_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_virustotal(repo_section, virustotal_apikey)