This fixes an issue caused by gitlab repositories soft-delete for 7 days
before they are fully deleted. If we remove a repository in order
to upload new binaries, we need to be able to create a new one right
away. See https://bugs.torproject.org/33034
We were leaving connections to the database open, which causes some
calls to hang. This adds destructors to the SQLite3 class and the
classes that use it, and refactors some code to make one database
connection per class object. This also makes sure that the destructors
for objects that use databases are actually called.
Before we were conflating the locales for the tor browser binaries with
the available locale for gettor email body localizations. This patch
checks our links database for available locales.
This fixes an issue that occurred while running the new gitlab script on
the gettor machine. Newer library versions require the b64 encoded byte
string to be converted to ascii text.
This commit cleans up the script a bit by:
- making more detailed comments,
- streamlining the choice of remote repository
- printing all output to std error
- captilization consistency
This modifies update_files to update each tor browser binary in gitlab,
internet archive, and google docs, and then delete the binary before
downloading the next one. This will save storage space on the gettor
host.
Have the script read directly from an environment variable instead of
passing the token in as a command line argument. This will hide it from
other processes.
Also removed downloaded files to prevent a messy directory.
The script will continue with the rest of the uploads but will exit with
a non-zero code so that we'll be notified to upload the missing files
manually.
We were running out of space in both of our github and gitlab
repositories due to storage limits. This change switches to using the
github REST API to upload torbrowser binaries as releases. Releases are
not subject to the space limits of repositories and, even better, do not
count against our bandwidth limits when users download them.