The list of supported platforms is available in platforms.json.
- Python: Version >= 3.8.10
- Python Virtual Environments: Documentation
Install the necessary system packages:
sudo apt install build-essential python3-dev
-
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
. venv/bin/activate
-
Install the required Python packages:
pip install -r requirements.txt
-
Obtain your credentials from the Google Cloud Console.
-
Set the
GMAIL_CREDENTIALS
environment variable to the path of your credentials file:export GMAIL_CREDENTIALS=path/to/gmail_credentials.json
Sample
gmail_credentials.json
{ "web": { "client_id": "", "project_id": "", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "", "redirect_uris": ["http://localhost/callback/"], "javascript_origins": ["http://localhost"] } }
Only the first item in the
redirect_uris
is used for the OAuth2 flow.
-
Obtain your credentials from the Twitter Developer Portal.
-
Set the
TWITTER_CREDENTIALS
environment variable to the path of your credentials file:export TWITTER_CREDENTIALS=path/to/twitter_credentials.json
Sample
twitter_credentials.json
{ "client_id": "", "client_secret": "", "redirect_uris": ["http://localhost/callback/"] }
Only the first item in the
redirect_uris
is used for the OAuth2 flow.
make grpc-compile
Set the environment variables and start the server in one command:
GMAIL_CREDENTIALS=path/to/gmail_credentials.json \
TWITTER_CREDENTIALS=path/to/twitter_credentials.json \
GRPC_HOST=localhost \
GRPC_PORT=8000 \
GRPC_SSL_PORT=8001 \
VAULT_GRPC_HOST=localhost \
VAULT_GRPC_PORT=6000 \
VAULT_GRPC_SSL_PORT=6001 \
VAULT_GRPC_INTERNAL_PORT=6099 \
VAULT_GRPC_INTERNAL_SSL_PORT=6098 \
SSL_CERTIFICATE=path/to/certificate \
SSL_KEY=path/to/key \
python3 grpc_server.py