check doc
This commit is contained in:
parent
06c186b970
commit
32ee7378e9
@ -1,14 +0,0 @@
|
|||||||
services:
|
|
||||||
webapp:
|
|
||||||
container_name: obscreen
|
|
||||||
restart: unless-stopped
|
|
||||||
image: jierka/obscreen:latest
|
|
||||||
environment:
|
|
||||||
- DEBUG=false
|
|
||||||
- PORT=5000
|
|
||||||
- SECRET_KEY=ANY_SECRET_KEY_HERE
|
|
||||||
volumes:
|
|
||||||
- ./data/db:/app/data/db
|
|
||||||
- ./data/uploads:/app/data/uploads
|
|
||||||
ports:
|
|
||||||
- 5000:5000
|
|
||||||
@ -11,11 +11,15 @@
|
|||||||
<details closed>
|
<details closed>
|
||||||
<summary><h3>Using docker run</h3></summary>
|
<summary><h3>Using docker run</h3></summary>
|
||||||
|
|
||||||
- ⚠️ `docker ... --rm` option is not suitable for production use because it won't survive a reboot. However, it's okay for quick testing. You need to use --restart=always instead to ensure that it persists.
|
|
||||||
```bash
|
```bash
|
||||||
# (Optional) Install docker if needed
|
# (Optional) Install docker if needed
|
||||||
curl -sSL get.docker.com | sh && sudo usermod -aG docker $(whoami) && logout # then login again
|
curl -sSL get.docker.com | sh && sudo usermod -aG docker $(whoami) && logout
|
||||||
|
# ....then login again
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
```bash
|
||||||
# Prepare application data file tree
|
# Prepare application data file tree
|
||||||
cd ~ && mkdir -p obscreen/data/db obscreen/data/uploads && cd obscreen
|
cd ~ && mkdir -p obscreen/data/db obscreen/data/uploads && cd obscreen
|
||||||
|
|
||||||
@ -27,7 +31,6 @@ docker run --restart=always --name obscreen --pull=always \
|
|||||||
-p 5000:5000 \
|
-p 5000:5000 \
|
||||||
-v ./data/db:/app/data/db \
|
-v ./data/db:/app/data/db \
|
||||||
-v ./data/uploads:/app/data/uploads \
|
-v ./data/uploads:/app/data/uploads \
|
||||||
-v /dev/null:/app/var/run/play \
|
|
||||||
jierka/obscreen:latest
|
jierka/obscreen:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -43,7 +46,7 @@ docker run --restart=always --name obscreen --pull=always \
|
|||||||
cd ~ && mkdir -p obscreen/data/db obscreen/data/uploads && cd obscreen
|
cd ~ && mkdir -p obscreen/data/db obscreen/data/uploads && cd obscreen
|
||||||
|
|
||||||
# Download docker-compose.yml
|
# Download docker-compose.yml
|
||||||
curl https://raw.githubusercontent.com/jr-k/obscreen/master/docker-compose.headless.yml > docker-compose.yml
|
curl https://raw.githubusercontent.com/jr-k/obscreen/master/docker-compose.yml > docker-compose.yml
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
docker compose up --detach --pull=always
|
docker compose up --detach --pull=always
|
||||||
@ -57,56 +60,23 @@ docker compose up --detach --pull=always
|
|||||||
<summary><h3>System-wide</h3></summary>
|
<summary><h3>System-wide</h3></summary>
|
||||||
|
|
||||||
#### Install
|
#### Install
|
||||||
|
- Install studio by executing following script
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install system dependencies
|
curl -fsSL https://raw.githubusercontent.com/jr-k/obscreen/master/system/install-studio.sh -o /tmp/install-studio.sh && chmod +x /tmp/install-studio.sh && sudo /bin/bash /tmp/install-studio.sh $USER $HOME
|
||||||
sudo apt-get update
|
sudo reboot
|
||||||
sudo apt-get install -y git python3-pip python3-venv libsqlite3-dev
|
|
||||||
|
|
||||||
# Get files
|
|
||||||
cd ~ && git clone https://github.com/jr-k/obscreen.git && cd obscreen
|
|
||||||
|
|
||||||
# Install application dependencies
|
|
||||||
python3 -m venv venv
|
|
||||||
source ./venv/bin/activate
|
|
||||||
|
|
||||||
# 🚨For MacOS users, requirements installation may cause an error but it's ok if only for pysqlite3 package
|
|
||||||
# you'll need to install brew and execute command `brew install sqlite3`
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
# Customize server default values
|
|
||||||
cp .env.dist .env
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Configure
|
#### Configure
|
||||||
- Server configuration is editable in `.env` file.
|
- Server configuration is editable in `.env` file.
|
||||||
- Application configuration will be available at `http://localhost:5000/settings` page after run.
|
- Application configuration will be available at `http://localhost:5000/settings` page after run.
|
||||||
|
- Check logs with `journalctl -u obscreen-studio -f`
|
||||||
|
|
||||||
#### Start server
|
|
||||||
> ⚠️ Not suitable for production use because it won't survive a reboot. However, it's okay for quick testing. You need to use `systemd` (detailed in next section) to ensure that it persists.
|
|
||||||
```bash
|
|
||||||
python ./obscreen.py
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Start server forever with systemd
|
|
||||||
```bash
|
|
||||||
cat "$(pwd)/system/obscreen-studio.service" | sed "s#/home/pi#$HOME#g" | sed "s#=pi#=$USER#g" | sudo tee /etc/systemd/system/obscreen-studio.service
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable obscreen-studio.service
|
|
||||||
sudo systemctl start obscreen-studio.service
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Troubleshoot
|
|
||||||
```bash
|
|
||||||
# Watch logs with following command
|
|
||||||
sudo journalctl -u obscreen-studio -f
|
|
||||||
```
|
|
||||||
---
|
---
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## 🏁 Finally
|
|
||||||
- Run `sudo systemctl restart obscreen-studio` or `sudo reboot`
|
|
||||||
|
|
||||||
|
|
||||||
## 👌 Usage
|
## 👌 Usage
|
||||||
- Page which plays slideshow is reachable at `http://localhost:5000`
|
- Page which plays slideshow is reachable at `http://localhost:5000`
|
||||||
@ -121,7 +91,7 @@ sudo journalctl -u obscreen-studio -f
|
|||||||
#### How to install
|
#### How to install
|
||||||
- Install player autorun by executing following script (will install chromium, x11, pulseaudio and obscreen-player systemd service)
|
- Install player autorun by executing following script (will install chromium, x11, pulseaudio and obscreen-player systemd service)
|
||||||
```bash
|
```bash
|
||||||
curl -fsSL https://raw.githubusercontent.com/jr-k/obscreen/master/system/install-autorun-rpi.sh -o /tmp/install-autorun-rpi.sh && chmod +x /tmp/install-autorun-rpi.sh && sudo /bin/bash /tmp/install-autorun-rpi.sh $USER $HOME
|
curl -fsSL https://raw.githubusercontent.com/jr-k/obscreen/master/system/install-player-rpi.sh -o /tmp/install-player-rpi.sh && chmod +x /tmp/install-player-rpi.sh && sudo /bin/bash /tmp/install-player-rpi.sh $USER $HOME
|
||||||
sudo reboot
|
sudo reboot
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -17,23 +17,26 @@
|
|||||||
<details closed>
|
<details closed>
|
||||||
<summary><h3>Using docker run</h3></summary>
|
<summary><h3>Using docker run</h3></summary>
|
||||||
|
|
||||||
- ⚠️ `docker ... --rm` option is not suitable for production use because it won't survive a reboot. However, it's okay for quick testing. You need to use --restart=always instead to ensure that it persists.
|
|
||||||
```bash
|
```bash
|
||||||
# (Optional) Install docker if needed
|
# (Optional) Install docker if needed
|
||||||
curl -sSL get.docker.com | sh && sudo usermod -aG docker $(whoami) && logout # then login again
|
curl -sSL get.docker.com | sh && sudo usermod -aG docker $(whoami) && logout
|
||||||
|
# ....then login again
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
```bash
|
||||||
# Prepare application data file tree
|
# Prepare application data file tree
|
||||||
cd ~ && mkdir -p obscreen/data/db obscreen/data/uploads && cd obscreen
|
cd ~ && mkdir -p obscreen/data/db obscreen/data/uploads && cd obscreen
|
||||||
|
|
||||||
# Run the Docker container
|
# Run the Docker container
|
||||||
docker run --rm --name obscreen --pull=always \
|
docker run --restart=always --name obscreen --pull=always \
|
||||||
-e DEBUG=false \
|
-e DEBUG=false \
|
||||||
-e PORT=5000 \
|
-e PORT=5000 \
|
||||||
-e SECRET_KEY=ANY_SECRET_KEY_HERE \
|
-e SECRET_KEY=ANY_SECRET_KEY_HERE \
|
||||||
-p 5000:5000 \
|
-p 5000:5000 \
|
||||||
-v ./data/db:/app/data/db \
|
-v ./data/db:/app/data/db \
|
||||||
-v ./data/uploads:/app/data/uploads \
|
-v ./data/uploads:/app/data/uploads \
|
||||||
-v ./var/run/play:/app/var/run/play \
|
|
||||||
jierka/obscreen:latest
|
jierka/obscreen:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -46,7 +49,7 @@ docker run --rm --name obscreen --pull=always \
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Prepare application data file tree
|
# Prepare application data file tree
|
||||||
cd ~ && mkdir -p obscreen/data/db obscreen/data/uploads obscreen/system && cd obscreen
|
cd ~ && mkdir -p obscreen/data/db obscreen/data/uploads && cd obscreen
|
||||||
|
|
||||||
# Download docker-compose.yml
|
# Download docker-compose.yml
|
||||||
curl https://raw.githubusercontent.com/jr-k/obscreen/master/docker-compose.yml > docker-compose.yml
|
curl https://raw.githubusercontent.com/jr-k/obscreen/master/docker-compose.yml > docker-compose.yml
|
||||||
@ -63,49 +66,17 @@ docker compose up --detach --pull=always
|
|||||||
<summary><h3>System-wide (recommended)</h3></summary>
|
<summary><h3>System-wide (recommended)</h3></summary>
|
||||||
|
|
||||||
#### Install
|
#### Install
|
||||||
|
- Install studio by executing following script
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install system dependencies
|
curl -fsSL https://raw.githubusercontent.com/jr-k/obscreen/master/system/install-studio.sh -o /tmp/install-studio.sh && chmod +x /tmp/install-studio.sh && sudo /bin/bash /tmp/install-studio.sh $USER $HOME
|
||||||
sudo apt-get update
|
sudo reboot
|
||||||
sudo apt-get install -y git python3-pip python3-venv libsqlite3-dev exfat-fuse ntfs-3g
|
|
||||||
|
|
||||||
# Get files
|
|
||||||
cd ~ && git clone https://github.com/jr-k/obscreen.git && cd obscreen
|
|
||||||
|
|
||||||
# Install application dependencies
|
|
||||||
python3 -m venv venv
|
|
||||||
source ./venv/bin/activate
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
# Customize server default values
|
|
||||||
cp .env.dist .env
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Configure
|
#### Configure
|
||||||
- Server configuration is editable in `.env` file.
|
- Server configuration is editable in `.env` file.
|
||||||
- Application configuration will be available at `http://raspberrypi.local:5000/settings` page after run.
|
- Application configuration will be available at `http://raspberrypi.local:5000/settings` page after run.
|
||||||
|
- Check logs with `journalctl -u obscreen-studio -f`
|
||||||
#### Start server
|
|
||||||
> ⚠️ Not suitable for production use because it won't survive a reboot. However, it's okay for quick testing. You need to use `systemd` (detailed in next section) to ensure that it persists.
|
|
||||||
```bash
|
|
||||||
python ./obscreen.py
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Start server forever with systemctl
|
|
||||||
```bash
|
|
||||||
cat "$(pwd)/system/obscreen-studio.service" | sed "s#/home/pi#$HOME#g" | sed "s#=pi#=$USER#g" | sudo tee /etc/systemd/system/obscreen-studio.service
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable obscreen-studio.service
|
|
||||||
sudo systemctl start obscreen-studio.service
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Troubleshoot
|
|
||||||
```bash
|
|
||||||
# Watch logs with following command
|
|
||||||
sudo journalctl -u obscreen-studio -f
|
|
||||||
```
|
|
||||||
|
|
||||||
## 🏁 Finally
|
|
||||||
- Run `sudo systemctl restart obscreen-studio` or `sudo reboot`
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -124,7 +95,8 @@ sudo journalctl -u obscreen-studio -f
|
|||||||
#### How to install
|
#### How to install
|
||||||
- Install player autorun by executing following script (will install chromium, x11, pulseaudio and obscreen-player systemd service)
|
- Install player autorun by executing following script (will install chromium, x11, pulseaudio and obscreen-player systemd service)
|
||||||
```bash
|
```bash
|
||||||
curl -fsSL https://raw.githubusercontent.com/jr-k/obscreen/master/system/install-autorun-rpi.sh -o /tmp/install-autorun-rpi.sh && chmod +x /tmp/install-autorun-rpi.sh && sudo /bin/bash /tmp/install-autorun-rpi.sh $USER $HOME
|
curl -fsSL https://raw.githubusercontent.com/jr-k/obscreen/master/system/install-player-rpi.sh -o /tmp/install-player-rpi.sh && chmod +x /tmp/install-player-rpi.sh && sudo /bin/bash /tmp/install-player-rpi.sh $USER $HOME
|
||||||
|
sudo reboot
|
||||||
```
|
```
|
||||||
|
|
||||||
#### How to restart
|
#### How to restart
|
||||||
|
|||||||
@ -59,10 +59,10 @@ sleep 3
|
|||||||
|
|
||||||
# Update and install necessary packages
|
# Update and install necessary packages
|
||||||
apt update
|
apt update
|
||||||
apt install -y xinit xserver-xorg chromium-browser unclutter pulseaudio exfat-fuse ntfs-3g
|
apt install -y xinit xserver-xorg chromium-browser unclutter pulseaudio
|
||||||
|
|
||||||
# Add user to tty, video and plugdev groups
|
# Add user to tty, video groups
|
||||||
usermod -aG tty,video,plugdev $OWNER
|
usermod -aG tty,video $OWNER
|
||||||
|
|
||||||
# Configure Xwrapper
|
# Configure Xwrapper
|
||||||
touch /etc/X11/Xwrapper.config
|
touch /etc/X11/Xwrapper.config
|
||||||
@ -72,12 +72,6 @@ grep -qxF "needs_root_rights=yes" /etc/X11/Xwrapper.config || echo "needs_root_r
|
|||||||
# Create the systemd service to start Chromium in kiosk mode
|
# Create the systemd service to start Chromium in kiosk mode
|
||||||
curl https://raw.githubusercontent.com/jr-k/obscreen/master/system/obscreen-player.service | sed "s#/home/pi#$WORKING_DIR#g" | sed "s#=pi#=$OWNER#g" | tee /etc/systemd/system/obscreen-player.service
|
curl https://raw.githubusercontent.com/jr-k/obscreen/master/system/obscreen-player.service | sed "s#/home/pi#$WORKING_DIR#g" | sed "s#=pi#=$OWNER#g" | tee /etc/systemd/system/obscreen-player.service
|
||||||
|
|
||||||
# Configure external storage automount
|
|
||||||
curl https://raw.githubusercontent.com/jr-k/obscreen/master/system/external-storage/10-obscreen-media-automount.rules | sed "s#/home/pi#$WORKING_DIR#g" | tee /etc/udev/rules.d/10-obscreen-media-automount.rules
|
|
||||||
udevadm control --reload-rules
|
|
||||||
systemctl restart udev
|
|
||||||
udevadm trigger
|
|
||||||
|
|
||||||
# Reload systemd, enable and start the service
|
# Reload systemd, enable and start the service
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable obscreen-player.service
|
systemctl enable obscreen-player.service
|
||||||
61
system/install-studio.sh
Executable file
61
system/install-studio.sh
Executable file
@ -0,0 +1,61 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
OWNER=${1:-$USER}
|
||||||
|
WORKING_DIR=${2:-$HOME}
|
||||||
|
|
||||||
|
echo "# ==============================="
|
||||||
|
echo "# Installing Obscreen Studio"
|
||||||
|
echo "# Using user: $OWNER"
|
||||||
|
echo "# Working Directory: $WORKING_DIR"
|
||||||
|
echo "# ==============================="
|
||||||
|
|
||||||
|
# ============================================================
|
||||||
|
# Installation
|
||||||
|
# ============================================================
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "# Waiting 3 seconds before installation..."
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
# Install system dependencies
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y git python3-pip python3-venv libsqlite3-dev exfat-fuse ntfs-3g
|
||||||
|
|
||||||
|
# Get files
|
||||||
|
cd $WORKING_DIR
|
||||||
|
git clone https://github.com/jr-k/obscreen.git
|
||||||
|
cd obscreen
|
||||||
|
|
||||||
|
# Install application dependencies
|
||||||
|
python3 -m venv venv
|
||||||
|
source ./venv/bin/activate
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Customize server default values
|
||||||
|
cp .env.dist .env
|
||||||
|
|
||||||
|
# Add user to needed group
|
||||||
|
usermod -aG plugdev $OWNER
|
||||||
|
|
||||||
|
# ============================================================
|
||||||
|
# Automount script for external storage
|
||||||
|
# ============================================================
|
||||||
|
|
||||||
|
curl https://raw.githubusercontent.com/jr-k/obscreen/master/system/external-storage/10-obscreen-media-automount.rules | sed "s#/home/pi#$WORKING_DIR#g" | tee /etc/udev/rules.d/10-obscreen-media-automount.rules
|
||||||
|
udevadm control --reload-rules
|
||||||
|
systemctl restart udev
|
||||||
|
udevadm trigger
|
||||||
|
|
||||||
|
# ============================================================
|
||||||
|
# Systemd service installation
|
||||||
|
# ============================================================
|
||||||
|
|
||||||
|
cat "./system/obscreen-studio.service" | sed "s#/home/pi#$HOME#g" | sed "s#=pi#=$USER#g" | sudo tee /etc/systemd/system/obscreen-studio.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable obscreen-studio.service
|
||||||
|
|
||||||
|
# ============================================================
|
||||||
|
# Start
|
||||||
|
# ============================================================
|
||||||
|
|
||||||
|
sudo systemctl restart obscreen-studio.service
|
||||||
Loading…
Reference in New Issue
Block a user