Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Google Cloud provider #38

Merged
merged 4 commits into from Jul 4, 2021

Conversation

dusancz
Copy link
Contributor

@dusancz dusancz commented Jul 4, 2021

This Pull Request adds Google Cloud provider support for cloudproxy and solves #35.

Known issues:

  • Proxy removal from cloudproxy-ui does not work when "Remove" button is clicked. (At least didn't work for me)

Future work:

  • Given that this code is based on the AWS code, it will be probably a good idea at some point in the future to refactor all the providers' code to reduce the amount of duplicated code and logic.

@claffin claffin linked an issue Jul 4, 2021 that may be closed by this pull request
@claffin claffin self-requested a review July 4, 2021 16:24
@claffin
Copy link
Owner

claffin commented Jul 4, 2021

@dusancz how are you loading in the GCP service account key? I find the JSON content doesn't load nicely as an environment variable.

I've looked at making a change where it base64 encodes the key and then decoding it just before using it, but curious what your approach is.

Otherwise, I've just tested it and it works well. Many thanks for your contribution!

@dusancz
Copy link
Contributor Author

dusancz commented Jul 4, 2021

Hi @claffin!
I have a simple bash script for loading it, feel free adding it to the PR as a separate .sh file if you wish:

 #!/bin/bash
 sa=$(cat /path/to/service_account.json)

 docker run \
     -e USERNAME='username' \
     -e PASSWORD='password' \
     -e AGE_LIMIT='3000' \
     -e GCP_ENABLED=True \
     -e GCP_PROJECT='gcp-project-name' \
     -e GCP_SERVICE_ACCOUNT_KEY="$sa" \
     -it -p 8000:8000 cloudproxy:latest

@claffin
Copy link
Owner

claffin commented Jul 4, 2021

Thanks, @dusancz for the clarification, I've added additional guidance instead to cover.

I will merge this now and release it. Many thanks again for your contribution!

One thing that I may look at doing in the future is the automatic creation of the firewall rules, as that would make it even easier to set up. I will raise an issue.

On the topic of the remove button, it does work for me but I notice it doesn't work on my mobile so not how big an issue it is. If you're able to investigate any further and see where the problem may be, feel free to raise an issue and I will take a closer look.

In terms of refactoring, I agree, the code has a lot of duplication. Especially the main.py files for each provider are near all duplicates with minor differences. No reason why these couldn't be all in one file in a for loop. I will raise an issue.

@claffin claffin merged commit f7bfdb4 into claffin:main Jul 4, 2021
@claffin claffin removed their request for review July 4, 2021 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Cloud as a provider
2 participants