50 lines
822 B
Markdown
50 lines
822 B
Markdown
# Toothless' Bot Home
|
|
|
|
React + Vite + Tailwind link home running on port `3020`.
|
|
|
|
## Local
|
|
|
|
```sh
|
|
npm install
|
|
npm run build
|
|
npm run serve
|
|
```
|
|
|
|
Open `http://localhost:3020`.
|
|
|
|
## PM2
|
|
|
|
```sh
|
|
npm run build
|
|
pm2 start ecosystem.config.cjs
|
|
```
|
|
|
|
The app name is `linkweb`. The GitHub webhook receiver is:
|
|
|
|
```text
|
|
POST /webhook/github
|
|
```
|
|
|
|
On a valid webhook request, the server runs:
|
|
|
|
```sh
|
|
git pull --ff-only
|
|
npm install
|
|
npm run build
|
|
pm2 restart linkweb
|
|
```
|
|
|
|
Set `WEBHOOK_SECRET` in `ecosystem.config.cjs` if you want GitHub `x-hub-signature-256` verification:
|
|
|
|
```js
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: '3020',
|
|
PM2_APP_NAME: 'linkweb',
|
|
WEBHOOK_PATH: '/webhook/github',
|
|
WEBHOOK_SECRET: 'your-secret',
|
|
}
|
|
```
|
|
|
|
You can also set `PM2_BIN`, `NPM_BIN`, or `GIT_BIN` if a command is not available on the production `PATH`.
|