Adds option to enable motion webcontrol (#17)

* Adds motion webcontrol

* ⬆️ Upgrades motion to version 4.1.1-r1

* ⬆️ Upgrades nginx to version 1.14.2-r0

* ⬆️ Upgrades ffmpeg to version 4.0.2-r0

* 🔨 Configuration cleanup

*  Rename motion_api to motion_webcontrol

* 📝Adds documentation for motion_webcontrol

* ✏️ Updated documentation

* ✏️ Spelling

* ⚠️ Added warning logs
This commit is contained in:
Joakim Sørensen 2019-02-04 21:12:05 +01:00 committed by Franck Nijhof
parent e9e86bde4e
commit d59990a506
6 changed files with 52 additions and 2 deletions

View file

@ -99,6 +99,14 @@ more severe level, e.g., `debug` also shows `info` messages. By default,
the `log_level` is set to `info`, which is the recommended setting unless the `log_level` is set to `info`, which is the recommended setting unless
you are troubleshooting. you are troubleshooting.
### Option: `motion_webcontrol`
Enables the motion webcontrol endpoint running on port `7999`.
:warning: MotionEye HTTP webcontrol **DOES NOT** support authentication
and **DOES NOT** support SSL! Enable this **ONLY** when you know what
you are doing! **NEVER, EVERY** expose this port to the outside world!
### Option: `port` ### Option: `port`
By default motionEye runs on port `8765`, this option allows you to change By default motionEye runs on port `8765`, this option allows you to change

View file

@ -58,4 +58,4 @@ LABEL \
org.label-schema.usage="https://github.com/hassio-addons/addon-motioneye/tree/master/README.md" \ org.label-schema.usage="https://github.com/hassio-addons/addon-motioneye/tree/master/README.md" \
org.label-schema.vcs-ref=${BUILD_REF} \ org.label-schema.vcs-ref=${BUILD_REF} \
org.label-schema.vcs-url="https://github.com/hassio-addons/addon-motioneye" \ org.label-schema.vcs-url="https://github.com/hassio-addons/addon-motioneye" \
org.label-schema.vendor="Community Hass.io Add-ons" org.label-schema.vendor="Community Hass.io Add-ons"

View file

@ -29,6 +29,7 @@
], ],
"options": { "options": {
"log_level": "info", "log_level": "info",
"motion_webcontrol": false,
"port": 8765, "port": 8765,
"ssl": true, "ssl": true,
"certfile": "fullchain.pem", "certfile": "fullchain.pem",
@ -36,6 +37,7 @@
}, },
"schema": { "schema": {
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)", "log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)",
"motion_webcontrol": "bool",
"port": "port", "port": "port",
"ssl": "bool", "ssl": "bool",
"certfile": "str", "certfile": "str",

View file

@ -7,6 +7,13 @@
source /usr/lib/hassio-addons/base.sh source /usr/lib/hassio-addons/base.sh
if ! hass.directory_exists '/data/motioneye'; then if ! hass.directory_exists '/data/motioneye'; then
cp -R /etc/motioneye /data/motioneye \ cp -R /etc/motioneye/ /data/motioneye/ \
|| hass.die 'Failed to create initial motionEye configuration' || hass.die 'Failed to create initial motionEye configuration'
fi fi
# Needed for existing installations.
if ! hass.file_exists '/data/motioneye/motion.conf'; then
cp /etc/motioneye/motion.conf /data/motioneye/motion.conf \
|| hass.die 'Failed to create initial motion configuration'
fi

View file

@ -0,0 +1,19 @@
#!/usr/bin/with-contenv bash
# ==============================================================================
# Community Hass.io Add-ons: motionEye
# Configure motion webcontrol access
# ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
readonly motion='/data/motioneye/motion.conf'
if hass.config.true 'motion_webcontrol'; then
hass.log.info "Enabling motion webcontrol..."
hass.log.warning "This opens up an UNSECURE port to the outside world!"
hass.log.warning "This port has NO SSL & NO AUTHENICATION!"
hass.log.warning "YOU HAVE BEEN WARNED!"
sed -i "s/webcontrol_localhost on/webcontrol_localhost off/" "$motion"
else
sed -i "s/webcontrol_localhost off/webcontrol_localhost on/" "$motion"
fi

View file

@ -0,0 +1,14 @@
# @enabled on
# @show_advanced off
# @normal_password
# @admin_username admin
# @admin_password
# @normal_username user
webcontrol_localhost on
thread thread-1.conf
webcontrol_html_output off
webcontrol_port 7999
setup_mode off
webcontrol_parms 2