To use Google Cloud as a provider, you’ll first need to create a Service Account.
- Login to your GCP console. Create a new Project if needed.
- Go to Identity and Access Management (IAM & Admin).
- On the left-hand panel, click 'Service Accounts'.
- Click 'Create Service Account'.
- Choose a service account name e.g. 'cloudproxy' and select Create and Continue.
- Choose Compute Engine / Compute Admin Role, then click Continue.
- Click Done.
- The service account will appear in the list as [email protected].
Now you have your Service Account created, but you still need to create a key for this Service Account.
- Click the newly created service account.
- Click 'Keys'.
- Choose Add Key / Create New Key.
- Choose JSON as Key type.
- Click Create.
- Save the key to your local storage.
Last, you need to create a firewall rule for the default network.
- On the left-hand panel, select VPC network / Firewall.
- Click 'Create Firewall Rule'.
- Name --> cloudproxy
- Target tags --> cloudproxy
- Source IP ranges --> 0.0.0.0/0
- Specified protocols and ports --> tcp --> 8899
- Leave all other options intact and click 'Create'.
You can now use GCP as a proxy provider, below details of the environment variables.
GCP_ENABLED
- to enable GCP as a provider, set as True. Default value: False
GCP_PROJECT
- GCP project ID where to create proxy instances.
GCP_SERVICE_ACCOUNT_KEY
- the service account key to allow CloudProxy access to your account. Please note this is not the path to the key, but the key itself.
The easiest method to set the GCP_SERVICE_ACCOUNT_KEY
is to use a shell variable. For example, GCP_KEY=$(cat /path/to/service_account.json)
and then use the new variable $GCP_KEY
.
GCP_MIN_SCALING
- this is the minimal proxies you require to be provisioned. Default value: 2
GCP_MAX_SCALING
- this is currently unused, however will be when autoscaling is implemented. We recommend you set this as the same as the minimum scaling to avoid future issues for now. Default value: 2
GCP_SIZE
- this sets the instance size, we recommend the smallest instance as the volume even a small instance can handle is high. Default value: f1-micro
GCP_REGION
- this sets the region & zone where the instance is deployed. Some websites may redirect to the language of the country your IP is from. Default value: us-central1-a
GCP_IMAGE_PROJECT
- this sets the project of the image family the instance is deployed with. The default image family project is ubuntu-os-cloud. Default value: ubuntu-os-cloud
GCP_IMAGE_FAMILY
- this sets the image family the instance is deployed with. The default image family is Ubuntu 20.04 LTS Minimal. Default value: ubuntu-minimal-2004-lts