-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,26 @@ Hint: If you are really lazy we provide precompiled deploy packages in the branc | |
3. Create a deploy folder `mkdir deploy` | ||
4. Copy the backend into a new folder `cp -r ./app/backend/* deploy` | ||
5. Copy the frontend build into the backend folder `cp -r ./app/frontend/build ./deploy/static-site` | ||
|
||
## Set the following environment variables in the webui | ||
|
||
| Name | Description | Default | | ||
| --- | --- | --- | | ||
| PORT | Port to listen | 8787 | | ||
| VAPID_KEY | Vapid key for the app, [see generate](#generate-vapid-key) | undefined | | ||
| SUB | Admin email in format "mailto:[email protected]" | undefined | | ||
| CORS | Enable cors, if your frontend is served on a different domain | false | | ||
| SENDKEY | Key to send notifications | undefined | | ||
| LOGINKEY | Key to login to the ui | undefined | | ||
|
||
### Generate Vapid key | ||
|
||
```bash | ||
deno run --allow-net --allow-read --allow-write --unstable ./deploy/main.ts generate | ||
``` | ||
|
||
or if you do not want to checkout this repository you can use the following command: | ||
|
||
```bash | ||
deno run -A --unstable --import-map https://raw.githubusercontent.com/K0IN/Notify/deno-port/app/backend/deno.json https://raw.githubusercontent.com/K0IN/Notify/deno-port/app/backend/main.ts generate | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,9 +50,19 @@ I know this looks scary on first glance but i swear it makes sense. | |
2. Start the docker (fill in the vapid key from step 1.) `docker run -p 8787:8787 -e VAPID_KEY=<vapidkey> -e SUB=mailto:[email protected] -e SENDKEY=mypassword ghcr.io/k0in/notify:latest` | ||
3. Start sending notifications | ||
`curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer mypassword" -d '{"title":"Hello", "message":"World"}' http://localhost:8787/api/notify` | ||
or use our cli | ||
|
||
by the way, you can also use the deno cli to send notifications | ||
|
||
`deno run --allow-net --unstable --import-map https://raw.githubusercontent.com/K0IN/Notify/main/app/backend/deno.json https://raw.githubusercontent.com/K0IN/Notify/main/app/backend/main.ts notify -r http://localhost:8787/api/notify -t test -m world --key mypassword` | ||
|
||
(which can be build into a single binary) | ||
|
||
```bash | ||
deno compile --allow-net --unstable --import-map https://raw.githubusercontent.com/K0IN/Notify/main/app/backend/deno.json --output notify https://raw.githubusercontent.com/K0IN/Notify/main/app/backend/main.ts | ||
|
||
./notify notify -r http://localhost:8787/api/notify -t test -m world --key mypassword | ||
``` | ||
|
||
## Need Help? 🤔 | ||
|
||
- Refer to our great [documentation](doc/install.md) | ||
|