INNER CODE UNIT · Python
main
ProtonVPN/android-app · app/prepare_gh.py:17
def main():
if 'CI_RUNNER_INTERNAL_CERTIFICATE_URL' not in os.environ or 'CI_RUNNER_INTERNAL_PRIVATE_KEY' not in os.environ:
print("Cert vars not found. Skipping guest holes.")
return
cert_url = os.environ['CI_RUNNER_INTERNAL_CERTIFICATE_URL']
cert_priv_path = os.environ['CI_RUNNER_INTERNAL_PRIVATE_KEY']
endpoint_url = os.environ['GUEST_HOLE_ENDPOINT_URL']
json = get_guest_holes(endpoint_url, cert_url, cert_priv_path)
print("GuestHoleServers.json:")
print(json)
with open('app/src/main/assets/GuestHoleServers.json', 'w', encoding='utf-8') as guest_holes_file:
guest_holes_file.write(json)
if __name__ == "__main__":
main()