mirror of
https://github.com/hassio-addons/addon-motioneye.git
synced 2025-05-05 03:31:22 +00:00
✨ 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:
parent
e9e86bde4e
commit
d59990a506
6 changed files with 52 additions and 2 deletions
|
@ -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
|
||||
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`
|
||||
|
||||
By default motionEye runs on port `8765`, this option allows you to change
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
],
|
||||
"options": {
|
||||
"log_level": "info",
|
||||
"motion_webcontrol": false,
|
||||
"port": 8765,
|
||||
"ssl": true,
|
||||
"certfile": "fullchain.pem",
|
||||
|
@ -36,6 +37,7 @@
|
|||
},
|
||||
"schema": {
|
||||
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)",
|
||||
"motion_webcontrol": "bool",
|
||||
"port": "port",
|
||||
"ssl": "bool",
|
||||
"certfile": "str",
|
||||
|
|
|
@ -7,6 +7,13 @@
|
|||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
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'
|
||||
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
|
19
motioneye/rootfs/etc/cont-init.d/31-motion.sh
Normal file
19
motioneye/rootfs/etc/cont-init.d/31-motion.sh
Normal 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
|
14
motioneye/rootfs/etc/motioneye/motion.conf
Normal file
14
motioneye/rootfs/etc/motioneye/motion.conf
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue