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

feat: Generate client upload token #3

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ DATABASE_URL="${DATABASE_URL_WITHOUT_SCHEMA}/${DATABASE_NAME}"
DATABASE_URL_NON_POOLING="${DATABASE_URL_WITHOUT_SCHEMA}/${DATABASE_NAME}"

# Redis
REDIS_HOST="redis"
REDIS_HOST="localhost"
REDIS_PORT="6379"
REDIS_USER=""
REDIS_PASSWORD=""
REDIS_URL="rediss://${REDIS_USER}:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}"
REDIS_URL="redis://${REDIS_USER}:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}"

# Vercel Blob Storage
BLOB_READ_WRITE_TOKEN="vercel_blob_rw_0511953119b0c1167283c7453a088727" # Fake vercel token
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
--health-timeout 5s
--health-retries 5
env:
BLOB_READ_WRITE_TOKEN: 'vercel_blob_rw_0511953119b0c1167283c7453a088727' # Fake vercel token
DATABASE_URL: 'postgresql://postgres_user:postgres_password@localhost:5432/postgres_db'
DATABASE_URL_NON_POOLING: 'postgresql://postgres_user:postgres_password@localhost:5432/postgres_db'
DATABASE_URL_WITHOUT_SCHEMA: 'postgresql://postgres_user:postgres_password@localhost:5432'
Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,35 @@ Deploys the pending migrations to the databases.

To learn Fastify, check out the [Fastify documentation](https://www.fastify.io/docs/latest/).

## Setup blob storage connection locally

### Install & run ngrok

Head to https://ngrok.com/download and download ngrok for your operating system.

**Beware:** If you are using WSL on Windows, you can just follow the linux guide and set it up in your WSL.

Now create a ngrok tunnel to your API:

```sh
ngrok http 3000

# Example using a static domain. This is highly recommended
ngrok http --domain=healthy-monkey-dancing.ngrok-free.app 3000
```

I recommend heading to https://dashboard.ngrok.com/cloud-edge/domains and creating a static domain, so you won't have to update your `.env` file in the web application every time you create a new tunnel.

### Setup .env files

#### API

Set the `BLOB_READ_WRITE_TOKEN` variable to the one from vercel.

#### Web

Set the `PUBLIC_API_URL` variable to the ngrok tunnel url. Example: `PUBLIC_API_URL="https://healthy-monkey-dancing.ngrok-free.app/api/"`

## Generate Ed25519 key pair

```bash
Expand Down
Loading