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: swap out smee with homegrown proxy client #124

Merged
merged 7 commits into from
May 22, 2024
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
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ NEXTAUTH_URL=http://localhost:3000
# A comma-separated list of GitHub usernames that are allowed to access the app
ALLOWED_HANDLES=

# Go to https://smee.io/new set this to the URL that you are redirected to.
WEBHOOK_PROXY_URL=
# This is used to sign payloads from github, see this doc for more info
# https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries
WEBHOOK_SECRET=bad-secret

# Use `trace` to get verbose logging or `info` to show less
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ Configuration is contained in a `.env` file which you'll need to customize for y

- `PUBLIC_ORG` and `PRIVATE_ORG` environment variables if you want to keep your private mirrors in a different GitHub organization from the public forks
- `ALLOWED_HANDLES` variable to a comma-separated list of GitHub user handles which ought to be allowed to access the app to create mirrors. If unset, all users who are members of the organization will be allowed to use the app.
- use https://smee.io or your own infrastructure to make the docker service available to receive webhooks

```sh
docker build -t internal-contribution-forks .
Expand Down Expand Up @@ -147,11 +146,7 @@ You should be up and running on [http://localhost:3000](http://localhost:3000)!

Webhooks are an important part of this application, they listen for events that happen to your organization and trigger the app to do things like create branch protections or sync code between forks.

You can use [smee.io](https://smee.io) to test webhooks locally. [ngrok](https://ngrok.com/) is another option.

For smee: Go to [smee.io](https://smee.io/new), this will create a new URL for you to use. e.g. `https://smee.io/AbCd1234EfGh5678`.

Copy the URL and paste it into the `WEBHOOK_PROXY_URL` environment variable in `.env`.
We have our own webhook proxy that you can use to test webhooks locally. You will need to set `PUBLIC_ORG` (and `PRIVATE_ORG` if you want to test with a different organization) in your `.env` file to your GitHub organization name.

### GitHub Requirements

Expand Down
2 changes: 0 additions & 2 deletions env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const env = createEnv({
PRIVATE_KEY: z.string(),

// Optional environment variables
WEBHOOK_PROXY_URL: z.string().url().optional().or(z.literal('')),
LOG_LEVEL: z.string().optional().default('debug'),
NODE_ENV: z.string().optional().default('development'),
PUBLIC_ORG: z.string().optional(),
Expand Down Expand Up @@ -53,7 +52,6 @@ export const env = createEnv({
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
WEBHOOK_SECRET: process.env.WEBHOOK_SECRET,
PRIVATE_KEY: process.env.PRIVATE_KEY,
WEBHOOK_PROXY_URL: process.env.WEBHOOK_PROXY_URL,
LOG_LEVEL: process.env.LOG_LEVEL,
NODE_ENV: process.env.NODE_ENV,
PUBLIC_ORG: process.env.PUBLIC_ORG,
Expand Down
Loading
Loading