https://github.com/0-vortex/open-sauced-catsup-app-test
Experimenting with probot and serverless for hot.opensauced.pizza
https://github.com/0-vortex/open-sauced-catsup-app-test
Last synced: 10 months ago
JSON representation
Experimenting with probot and serverless for hot.opensauced.pizza
- Host: GitHub
- URL: https://github.com/0-vortex/open-sauced-catsup-app-test
- Owner: 0-vortex
- License: mit
- Created: 2022-02-08T19:11:15.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-23T17:50:43.000Z (over 4 years ago)
- Last Synced: 2025-05-22T06:11:35.021Z (about 1 year ago)
- Language: JavaScript
- Size: 622 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
🍕 Open Sauced Catsup App Test 🍕
The path to your next Open Source contribution
## 📖 Prerequisites
In order to run the project locally we need `node>=16` and `npm>=8` installed on our development machines.
## 🖥️ Local development
To install the application:
```shell
npm ci
```
Befor you can run the application we need to start the smee proxy:
```shell
npm run proxy
```
To start a local copy of the app on port `3000`:
```shell
npm start
```
The preconfigured app is of almost no use to anyone as it can only be installed by the preconfigured user and send webhooks to a dead server.
It is quite possible that some of the secrets are rendered invalid as well. THey serve as placeholders and should be replaced with values provided by your testing app.
## 📦 Deploy to production
### Cloudflare account
Set up a cloudflare account and enable workers, change `account_id` in [wrangler.toml](./wrangler.toml) to your account id.
Go to your workers dashboard and create a new worker, select any template, adjust `name` in [wrangler.toml](./wrangler.toml) if it is taken.
Select the "Settings" tab on your newly created worker and click "Variables", add the following placeholders for now:
- `APP_ID`
- `APP_PK`
- `DISCORD_URL`
- `CLIENT_ID`
- `CLIENT_SECRET`
- `WEBHOOK_SECRET`
**Note**: At the very end of this process you will have to encrypt all the values for the publish command to work.
Copy the "Routes" URL provided by the worker for the next part.
### GitHub App
Create a new GitHub application with scopes `issues:write` and `metadata:read` while also enabling tracking events.
Upon creation you should have plain-text values for `APP_ID`, `CLIENT_ID`.
Click the "Generate a new client secret" button and copy the value of `CLIENT_SECRET`.
In the webhook return URL copw the value of your worker route as described in the last step of the Cloudflare setup.
It is advised you generate the `WEBHOOK_SECRET` using the following command:
```shell
# random key strokes can work too if you don't have ruby(??)
ruby -rsecurerandom -e 'puts SecureRandom.hex(20)'
```
Now, go to the very bottom and click "Generate a new private key" and open a terminal in the location of the downloaded file.
Rename this file to `private-key.pem` for the next command to work:
```shell
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in private-key.pem -out private-key-pkcs8.key
```
Copy the contents of `private-key-pkcs8.key` to `APP_PK`.
### Discord
Go to your server of choice, click "Settings" and then "Integrations", create a new webhook and copy the URL and paste that value into `DISCORD_URL`.
Now you are good to use the wrangler release workflows and deploy to production!
### Terminal publish
Login to cloudflare with your account credentials, advised you let the browser open an OAuth dialog with:
```shell
npm run wrangler -- login
```
Now you can test all the variables are correct by publishing from the terminal:
```shell
# npm run wrangler -- publish
npm run publish
```
Open up a production real time log using:
```shell
npm run wrangler -- tail
```
### CI publish
Create a new GitHub actions secrets named `CF_API_TOKEN`, get its value from Cloudflare's [create a new token](https://dash.cloudflare.com/profile/api-tokens) using the "Edit Cloudflare Workers" template.
Push new code to the server, after a release the new code should be sent to the server and instantly propagate.
## 🤝 Contributing
We encourage you to contribute to Open Sauced! Please check out the [Contributing guide](https://docs.opensauced.pizza/contributing/introduction-to-contributing/) for guidelines about how to proceed.

## 🍕 Community
Got Questions? Join the conversation in our [Discord](https://discord.gg/U2peSNf23P).
Find Open Sauced videos and release overviews on our [YouTube Channel](https://www.youtube.com/channel/UCklWxKrTti61ZCROE1e5-MQ).
## 🎦 Repository Visualization
[
](./src)
## ⚖️ LICENSE
MIT © [Open Sauced](LICENSE)