Skip to content

Commit edfae26

Browse files
author
Stephan van Rooij
committed
feat: Major version bump
And set max listener count
1 parent b38c0e6 commit edfae26

File tree

6 files changed

+1812
-2270
lines changed

6 files changed

+1812
-2270
lines changed

.travis.yml

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
language: node_js
2-
cache:
3-
directories:
4-
- ~/.npm
5-
notifications:
6-
email: false
2+
73
node_js:
8-
- 'node'
9-
- 'lts/*'
10-
after_success:
11-
- npm run semantic-release
4+
- 10
5+
- 13
6+
127
branches:
13-
except:
14-
- /^v\d+\.\d+\.\d+$/
8+
only:
9+
- "master"
10+
11+
jobs:
12+
include:
13+
# Define the release stage that runs semantic-release
14+
- stage: release
15+
node_js: lts/*
16+
if: branch = master
17+
# Advanced: optionally overwrite your default `script` step to skip the tests
18+
# script: skip
19+
deploy:
20+
provider: script
21+
skip_cleanup: true
22+
script:
23+
- npx semantic-release

Dockerfile

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
FROM node:boron-alpine
2-
1+
FROM node:current-alpine
32
ENV IPCAM2MQTT_PORT=8021
4-
5-
WORKDIR /usr/ipcam2mqtt
6-
7-
COPY package.json package-lock.json ./
8-
9-
RUN npm install --production
10-
3+
WORKDIR /usr/src/app
4+
COPY package*.json ./
5+
RUN npm ci --only=production
116
COPY . .
12-
137
EXPOSE 8021
14-
15-
CMD ["node","index.js"]
8+
CMD ["node", "./index.js"]

README.md

+28-22
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
11
# ipcam2mqtt
22

3-
[![npm](https://img.shields.io/npm/v/ipcam2mqtt.svg?style=flat-square)](https://www.npmjs.com/package/ipcam2mqtt)
4-
[![travis](https://img.shields.io/travis/svrooij/ipcam2mqtt.svg?style=flat-square)](https://travis-ci.org/svrooij/ipcam2mqtt)
5-
[![mqtt-smarthome](https://img.shields.io/badge/mqtt-smarthome-blue.svg?style=flat-square)](https://github.com/mqtt-smarthome/mqtt-smarthome)
6-
[![Support me on Patreon][badge_patreon]][patreon]
7-
[![PayPal][badge_paypal_donate]][paypal-donations]
8-
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
3+
[![npm][badge_npm]][link_npm]
4+
[![Support me on Github][badge_sponsor]][link_sponsor]
5+
[![travis][badge_travis]][link_travis]
6+
[![github issues][badge_issues]][link_issues]
7+
[![mqtt-smarthome](https://img.shields.io/badge/mqtt-smarthome-blue.svg)](https://github.com/mqtt-smarthome/mqtt-smarthome)
8+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
99

1010
This node.js application is a bridge between the your IP Cameras (with sound or motion detection) and a mqtt server. That way your can have your home respond to sound detection events.
1111

1212
It's intended as a building block in heterogenous smart home environments where an MQTT message broker is used as the centralized message bus. See [MQTT Smarthome on Github](https://github.com/mqtt-smarthome/mqtt-smarthome) for a rationale and architectural overview.
1313

1414
## Installation
1515

16-
Using ipcam2mqtt is really easy, but it requires at least [Node.js](https://nodejs.org/) v6 or higher. (This app is tested against the latest version and the last lts version).
16+
Using ipcam2mqtt is really easy, but it requires at least [Node.js](https://nodejs.org/) v6 or higher.
17+
(This app is tested against node v10, v13 and the latest lts version).
1718

18-
`sudo npm install -g ipcam2mqtt`
19+
`npm install -g ipcam2mqtt`
1920

2021
## Usage
2122

2223
```plain
2324
ipcam2mqtt 0.0.0-development
24-
Usage: ipcam2mqtt [options]
25+
Usage: index.js [options]
2526
2627
Options:
2728
-m, --mqtt mqtt broker url. See
2829
https://github.com/svrooij/ipcam2mqtt#mqtt-url
2930
[default: "mqtt://127.0.0.1"]
30-
-n, --name instance name. used as mqtt client id and as topic prefix
31+
-i, --instance instance name. used as mqtt client id and as topic prefix
3132
[default: "cameras"]
3233
-p, --port The port to run on [default: 8000]
3334
--timeout The timeout in seconds for resetting back to inactive, -1
3435
for no reset [default: 10]
3536
-k, --keep-images Set this if you want to keep the images in mqtt [boolean]
3637
-h, --help Show help [boolean]
37-
-l, --logging possiblevalues: "error", "warn","info","debug"
38-
[default: "info"]
38+
-v, --verbosity Set the verbosity.
39+
[choices: "error", "warn", "info", "debug"] [default: "info"]
3940
--version Show version number [boolean]
4041
```
4142

@@ -60,7 +61,7 @@ You now have and FTP server running on your computer. Now you can configure the
6061

6162
## Topics
6263

63-
Every message starts with the instance name (specified with the `-n` argument), which defaults to `cameras` so we'll asume the default.
64+
Every message starts with the instance name (specified with the `-i` argument), which defaults to `cameras` so we'll asume the default.
6465

6566
### Connect messages
6667

@@ -92,17 +93,17 @@ To start ipcam2mqtt with PM2, you have to use this command.
9293
```bash
9394
pm2 start ipcam2mqtt -x -- [regular-options]
9495
# the -x -- part is to tell pm2 you want to specify arguments to the script. example:
95-
pm2 start ipcam2mqtt -x -- -n cameras -m mqtt://your.mqtt.host:1883
96+
pm2 start ipcam2mqtt -x -- -i cameras -m mqtt://your.mqtt.host:1883
9697
```
9798

9899
## Docker
99100

100-
You can also run this bridge on docker. Be sure to specify your own mqtt connection string! This command connects port `8821` (you can change this) to the container where the bridge runs at `8021`.
101+
You can also run this bridge on docker. Be sure to specify your own mqtt connection string! This command connects port `8021` (you can change this) to the container where the bridge runs at `8021`.
101102

102103
You can also set the other properties by using the `-e "IPCAM2MQTT_...=newvalue"` argument. All the properties can be set with the prefix `IPCAM2MQTT_` followed by the full name.
103104

104-
```bash
105-
docker run -d -e "IPCAM2MQTT_MQTT=mqtt://your.mqtt.nl:1883" -p 8821:8021 --name ipcam2mqtt svrooij/ipcam2mqtt:latest
105+
```Shell
106+
docker run -d -e "IPCAM2MQTT_MQTT=mqtt://your.mqtt.nl:1883" -p 8021:8021 --name ipcam2mqtt svrooij/ipcam2mqtt:latest
106107
# Open (and follow) the logs
107108
docker logs ipcam2mqtt -f
108109
```
@@ -115,9 +116,14 @@ The actual FTP server part is mostly copied, improved and simplified from [mqtt-
115116

116117
## Beer
117118

118-
This bridge took me a lot of hours to build, so I invite everyone using it to [Buy me a beer](https://svrooij.nl/buy-me-a-beer/)
119+
This bridge took me a lot of hours to build, so I invite everyone using it check out my brand new Github [sponsor page][link_sponsor]
120+
121+
[badge_sponsor]: https://img.shields.io/badge/Sponsor-on%20Github-red
122+
[badge_issues]: https://img.shields.io/github/issues/svrooij/ipcam2mqtt
123+
[badge_npm]: https://img.shields.io/npm/v/ipcam2mqtt
124+
[badge_travis]: https://img.shields.io/travis/svrooij/ipcam2mqtt
119125

120-
[badge_paypal_donate]: https://svrooij.nl/badges/paypal_donate.svg
121-
[badge_patreon]: https://svrooij.nl/badges/patreon.svg
122-
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T9XFJYUSPE4SG
123-
[patreon]: https://www.patreon.com/svrooij
126+
[link_sponsor]: https://github.com/sponsors/svrooij
127+
[link_issues]: https://github.com/svrooij/ipcam2mqtt/issues
128+
[link_npm]: https://www.npmjs.com/package/ipcam2mqtt
129+
[link_travis]: https://travis-ci.org/svrooij/ipcam2mqtt

0 commit comments

Comments
 (0)