Skip to content

Commit 97ecf92

Browse files
committed
6.8.0
1 parent 1163099 commit 97ecf92

File tree

121 files changed

+2398
-1345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2398
-1345
lines changed

Dockerfile

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Dockerfile for motion-UI
2+
3+
# Base image
4+
FROM debian:12-slim
5+
6+
# Metadata
7+
LABEL version="1.0" maintainer="lbr38 <motionui@protonmail.com>"
8+
9+
# Variables
10+
ARG WWW_DIR="/var/www/motionui"
11+
ARG DATA_DIR="/var/lib/motionui"
12+
ARG PHP_VERSION="8.3"
13+
ARG DEBIAN_FRONTEND=noninteractive
14+
ARG branch=main
15+
16+
# Export branch as environment variable for /init script
17+
ENV BRANCH=${branch}
18+
19+
# PACKAGES INSTALL
20+
# Add repositories
21+
ADD https://packages.repomanager.net/repo/gpgkeys/packages.repomanager.net.pub /tmp/packages.repomanager.net.gpg
22+
RUN apt-get update -y -qq && apt-get install -y -qq gnupg2 ca-certificates && rm -rf /var/lib/apt/lists/* && \
23+
cat /tmp/packages.repomanager.net.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/packages.repomanager.net.gpg
24+
RUN echo "deb https://packages.repomanager.net/repo/deb/motionui-nginx/bookworm/nginx/prod bookworm nginx" > /etc/apt/sources.list.d/nginx.list && \
25+
echo "deb https://packages.repomanager.net/repo/deb/motionui-php/bookworm/main/prod bookworm main" > /etc/apt/sources.list.d/php.list && \
26+
echo "deb https://packages.repomanager.net/repo/deb/go2rtc/all/main/prod all main" > /etc/apt/sources.list.d/go2rtc.list
27+
# TODO: when motion 5.x.x package is released, use it instead
28+
# echo "deb https://packages.repomanager.net/repo/motion/bookworm/main_prod bookworm main" > /etc/apt/sources.list.d/motion.list
29+
30+
# Install dependencies
31+
RUN apt-get update -y -qq && \
32+
apt-get install -y -qq findutils iputils-ping apt-transport-https dnsutils vim ffmpeg mediainfo postfix python3-psutil \
33+
# Install postfix
34+
postfix \
35+
# Install motion (standby until motion is releasing a package for version 5.x.x)
36+
# motion \
37+
# Install go2rtc
38+
go2rtc \
39+
# Install motion dependencies - TODO: when motion 5.x.x package is released, use it instead
40+
autoconf automake autopoint build-essential pkgconf libtool libzip-dev libjpeg-dev git libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavdevice-dev libwebp-dev gettext libmicrohttpd-dev libcamera-tools libcamera-dev libcamera-v4l2 \
41+
# Install nginx and PHP 8.3
42+
nginx php${PHP_VERSION}-fpm php${PHP_VERSION}-cli php${PHP_VERSION}-sqlite3 php${PHP_VERSION}-curl php${PHP_VERSION}-yaml php${PHP_VERSION}-opcache php${PHP_VERSION}-xml sqlite3 \
43+
# Install xdebug if branch is devel
44+
$(if [ "$branch" = "devel" ]; then echo "php${PHP_VERSION}-xdebug"; fi) && \
45+
apt-get -qq autoremove -y && rm -rf /var/lib/apt/lists/*
46+
47+
# Build motion from sources
48+
# TODO: when motion 5.x.x package is released, use it instead
49+
RUN git clone https://github.com/Motion-Project/motion.git && cd motion && autoreconf -fiv && ./configure --prefix=/usr --sysconfdir=/etc && make && make install && cd .. && rm motion -r
50+
51+
# SERVICES CONFIG
52+
# Configure Nginx
53+
RUN rm -rf /etc/nginx/sites-enabled/default /etc/nginx/conf.d/default.conf /var/www/html
54+
COPY docker/config/nginx/nginx.conf /etc/nginx/nginx.conf
55+
COPY docker/config/nginx/motionui.conf /etc/nginx/sites-enabled/motionui.conf
56+
57+
# Configure PHP
58+
COPY docker/config/php/www.conf /etc/php/8.3/fpm/pool.d/www.conf
59+
60+
# Configure Postfix
61+
COPY docker/config/postfix/main.cf /etc/postfix/main.cf
62+
# Copy master.cf with custom listening port 2525 (to avoid conflict with other mail services on the host)
63+
COPY docker/config/postfix/master.cf /etc/postfix/master.cf
64+
65+
# Copy motionui files
66+
RUN mkdir -p $WWW_DIR $DATA_DIR
67+
COPY www/ $WWW_DIR/
68+
69+
# Create motionui group and set basic permissions
70+
RUN groupadd motionui && \
71+
usermod -a -G motionui www-data
72+
# RUN chown -R www-data:motionui $WWW_DIR $DATA_DIR
73+
74+
# Configure motion
75+
RUN mkdir -p /var/log/motion /var/run/motion && \
76+
chown -R www-data:motionui /var/log/motion /var/run/motion && \
77+
chmod 775 /var/log/motion /var/run/motion && \
78+
# New main directory is /usr/var/lib/motion
79+
rm /usr/var/lib/motion/* -fr && \
80+
mkdir -p /usr/var/lib/motion && \
81+
chown -R www-data:motionui /usr/var/lib/motion && \
82+
chmod 770 /usr/var/lib/motion && \
83+
# Create a symbolic link to /etc/motion to keep compatibility
84+
ln -s /usr/var/lib/motion /etc/motion
85+
86+
# Copy motion main config file
87+
COPY www/templates/motion/motion.conf /etc/motion/motion.conf
88+
89+
# Copy motion event bin files
90+
RUN mkdir -p /usr/lib/motion
91+
COPY www/bin/on_event* /usr/lib/motion/
92+
RUN chown -R www-data:motionui /usr/lib/motion
93+
94+
# Copy motion init script
95+
COPY docker/config/motion/init /etc/init.d/motion
96+
RUN chmod 755 /etc/init.d/motion
97+
98+
# Some basic configurations
99+
RUN sed -i 's/# alias ll=/alias ll=/g' /root/.bashrc && \
100+
echo "set ic" > /root/.vimrc && \
101+
echo "set mouse-=a" >> /root/.vimrc && \
102+
echo "syntax on" >> /root/.vimrc && \
103+
echo "set background=dark" >> /root/.vimrc && \
104+
# SQLite
105+
echo ".headers on" > /root/.sqliterc && \
106+
echo ".mode column" >> /root/.sqliterc
107+
108+
# Setup go2rtc
109+
110+
# Copy go2rtc init script
111+
COPY docker/config/go2rtc/init /etc/init.d/go2rtc
112+
RUN chmod 755 /etc/init.d/go2rtc && \
113+
mkdir -p /var/run/go2rtc && \
114+
chown -R www-data:motionui /var/run/go2rtc && \
115+
chmod 775 /var/run/go2rtc
116+
117+
# Copy entrypoint script
118+
COPY docker/init /init
119+
RUN chmod 700 /init
120+
121+
# Expose port 8080
122+
EXPOSE 8080
123+
124+
# Set working dir
125+
WORKDIR ${DATA_DIR}
126+
127+
ENTRYPOINT ["/init"]

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ It should help you **installing** and starting using motion-UI.
6666

6767
## 📱 Android app
6868

69-
An Android app is available for download <a href="https://github.com/lbr38/motion-UI/releases/tag/android-1.0.0">here</a> (in the assets section).
69+
Get the android app to visualize your cameras and manage your motion-UI instance on your smartphone.
70+
71+
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
72+
alt="Get it on F-Droid"
73+
height="80">](https://f-droid.org/packages/app.motionui.android)
7074

7175
## 📧 Contact
7276

docker/docker-compose-dev.yml renamed to docker-compose-dev.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ services:
77
image: motionui-image
88
privileged: true
99
network_mode: host
10+
environment:
11+
FQDN: motionui-dev.localhost
1012
build:
1113
context: .
1214
dockerfile: Dockerfile
1315
args:
14-
env: devel
15-
fqdn: motionui-dev.localhost
16+
branch: devel
1617
restart: unless-stopped
1718
volumes:
1819
- /etc/localtime:/etc/localtime:ro

docker/docker-compose.yml renamed to docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ services:
66
image: motionui-image
77
privileged: true
88
network_mode: host
9+
environment:
10+
FQDN: motionui.example.com
911
build:
1012
context: .
1113
dockerfile: Dockerfile
1214
args:
13-
env: prod
14-
fqdn: motionui.example.com
15+
branch: main
1516
restart: unless-stopped
1617
volumes:
1718
- /etc/localtime:/etc/localtime:ro

docker/Dockerfile

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)