This playground environment provides a simple setup to experiment with CipherStash Proxy and EQL in a Docker Compose environment. It includes a PostgreSQL database with EQL installed at build time and a CipherStash Proxy configured to integrate with your CipherStash account. This environment is ideal for running the examples in the repository or testing CipherStash features.
- Docker and Docker Compose installed.
- A CipherStash account and access to the CipherStash Dashboard to obtain required environment variables.
- The CipherStash CLI installed and configured with your account credentials.
New to CipherStash? Sign up for a free account to get started.
- Postgres: A PostgreSQL database with EQL installed at build time.
- Proxy: The CipherStash Proxy service that encrypts/decrypts data and manages schema encryption.
-
Clone the repository:
git clone https://github.com/cipherstash/encrypt-query-language.git cd encrypt-query-language/playground
-
Create a
.envrc
file with the following variables:# CipherStash account credentials export CS_WORKSPACE_ID=your_workspace_id export CS_CLIENT_ACCESS_KEY=your_client_access_key # Encryption keys export CS_ENCRYPTION__CLIENT_ID=your_client_id export CS_ENCRYPTION__CLIENT_KEY=your_client_key export CS_ENCRYPTION__DATASET_ID=your_dataset_id # Optional overrides export PGPORT=5432 export CS_PORT=6432
These values are available in your CipherStash Dashboard. The Client ID and Key and Dataset ID are created through the CipherStash CLI.
-
Build and run the environment:
docker compose up --build
The PostgreSQL service is exposed on localhost:${PGPORT:-5432}
. You can connect using any PostgreSQL client:
psql -h localhost -p 5432 -U postgres
The CipherStash Proxy service is exposed on localhost:${CS_PORT:-6432}
. Example connection string:
postgresql://postgres:postgres@localhost:6432/postgres
or using psql
:
psql -h localhost -p 6432 -U postgres
- PostgreSQL logs all SQL statements (
log_statement=all
) for debugging purposes. - CipherStash Proxy supports unsafe logging for development. Disable it in production by setting
CS_UNSAFE_LOGGING
tofalse
.
Use this playground to test any examples from the repository's examples directory:
- Security warning: Do not use this environment in production. It is designed for local development and testing purposes only.
- EQL installation: The
eql-playground-pg
container automatically installs EQL during the build process. If modifications are needed, update the Dockerfile in thedb
directory.
To stop and remove the containers:
docker compose down