Skip to content

Commit

Permalink
Fixing 1 (#8)
Browse files Browse the repository at this point in the history
* Update docker-publish.yml

* fix: Deleted .DS_store

* Fix: changes Env vars

* fix: moved the source files to a dir named src

* Feat: Add support for discord webhooks

* chore: uppdated the node version

* fix: fixed the yaml indenting

* Deleted .env smaple file and moved it to readme

* moved the enviorment variables to readme

* removed container name

* changed the .env for discord webhook supprort

* migrated from discord js to fetch

* added list of states to prevent bugs due to typos
  • Loading branch information
bernes1 authored Aug 24, 2023
1 parent 14f31a6 commit 303cdd3
Show file tree
Hide file tree
Showing 12 changed files with 615 additions and 128 deletions.
Binary file removed .DS_Store
Binary file not shown.
9 changes: 0 additions & 9 deletions .env_sample

This file was deleted.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:16-alpine
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . /app/
CMD ["node", "index.js"]
COPY ./src /app/
CMD ["node", "/app/src/index.js"]
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,29 @@
the software subscribes to a mqtt topic and notifys me when the hackerspace is open with push notifications from pushover



### Setup

make a folder with .env and docker-compose.yml file provided in this repo.
.env file sould contain these vaiables

```
MQTT_BROKER = 'mqtts://yourbrokerhost'
MQTT_USERNAME = 'Mqtt broker username'
MQTT_PASSWORD = 'password for your broker'
MQTT_PORT = 1883
MQTT_TOPIC = 'topic'
PUSHOVER_USER = 'your user api key'
PUSHOVER_TOKEN = 'Your application token'
DISCORD_WEBHOOK= 'Webhook url'
DISCORD_ROLE_ID= '<@&ROLE_ID_Here>'
```

To start the container run this command in the directory with the docker-compose file


```bash
docker-compose up -d
```
7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: '3.9'
services:
notify:
restart: unless-stopped
image: notify:latest
container_name: hacker-notify
env_file: .env
restart: unless-stopped
image: hackerspace-notify:latest
env_file: .env

80 changes: 0 additions & 80 deletions index.js

This file was deleted.

31 changes: 0 additions & 31 deletions notify.js

This file was deleted.

Loading

0 comments on commit 303cdd3

Please sign in to comment.