Skip to content

Commit

Permalink
Splitted manager from main os
Browse files Browse the repository at this point in the history
  • Loading branch information
a13ssandr0 committed Aug 31, 2022
1 parent 7518ab5 commit 9090bd0
Show file tree
Hide file tree
Showing 2,165 changed files with 11 additions and 87,101 deletions.
1 change: 1 addition & 0 deletions stage2/04-unitotem/00-packages
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
python3-pip python3-apt python3-venv python3-distutils-extra
libopenjp2-7-dev
openssl
mediainfo
haproxy
Expand Down
31 changes: 8 additions & 23 deletions stage2/04-unitotem/01-run.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
#!/bin/bash -e

# UniTotem manager base environment
cp -r files/unitotem "${ROOTFS_DIR}/opt/"
chmod a+x "${ROOTFS_DIR}/opt/unitotem/uniman.py"
install -v -m 777 -d "${ROOTFS_DIR}/opt/unitotem/static/uploaded"
on_chroot << EOF
python3 -m venv /opt/unitotem/env --system-site-packages
source /opt/unitotem/env/bin/activate
pip3 install python-crontab flask flask-httpauth requests validators decorator qrcode PyChromeDevTools waitress pymediainfo ruamel.yaml
deactivate
EOF
install -v -m 644 files/start-xorg.service "${ROOTFS_DIR}/etc/systemd/system/"
install -v -m 755 files/xinitrc "${ROOTFS_DIR}/etc/X11/xinit/"

install -v -d "${ROOTFS_DIR}/etc/ssl/unitotem"
openssl req -x509 -nodes -newkey rsa:2048 -keyout "${ROOTFS_DIR}/etc/ssl/unitotem/key.pem" -out "${ROOTFS_DIR}/etc/ssl/unitotem/crt.pem" -days 365000 -subj "/C=../ST=./L=./O=a13ssandr0/OU=UniTotem/CN=UniTotem/emailAddress=."
cat ${ROOTFS_DIR}/etc/ssl/unitotem/{crt,key}.pem > "${ROOTFS_DIR}/etc/ssl/unitotem.pem"
rm -r "${ROOTFS_DIR}/etc/ssl/unitotem"
chmod 0600 "${ROOTFS_DIR}/etc/ssl/unitotem.pem"
curl -s --compressed -o "${ROOTFS_DIR}/etc/apt/trusted.gpg.d/unitotem-manager.asc" "https://a13ssandr0.github.io/unitotem-manager/KEY.gpg"
curl -s --compressed -o "${ROOTFS_DIR}/etc/apt/sources.list.d/unitotem-manager.list" "https://a13ssandr0.github.io/unitotem-manager/unitotem-manager.list"

install -v -m 644 files/{start-xorg,unitotem-manager}.service "${ROOTFS_DIR}/etc/systemd/system/"
on_chroot << EOF
adduser unitotem || true # if rerunning the script, it attempts to create the user and finds out it already exists, fails safely
EOF
on_chroot << EOF
# if rerunning the script, it attempts to create the user and finds out it already exists, fails safely
adduser --disabled-password --gecos "" unitotem || true
systemctl enable start-xorg.service
systemctl enable unitotem-manager.service
apt-get update
apt-get -o APT::Acquire::Retries=3 install -y unitotem-manager
EOF

install -v files/haproxy.cfg "${ROOTFS_DIR}/etc/haproxy"
install -v -m 755 files/xinitrc "${ROOTFS_DIR}/etc/X11/xinit/"


# Enable iptables firewall and allow ports 22, 80, 443 (disable because not working inside chroot)

Expand Down
45 changes: 0 additions & 45 deletions stage2/04-unitotem/files/haproxy.cfg

This file was deleted.

16 changes: 0 additions & 16 deletions stage2/04-unitotem/files/unitotem-manager.service

This file was deleted.

57 changes: 0 additions & 57 deletions stage2/04-unitotem/files/unitotem/iwlist.py

This file was deleted.

2 changes: 0 additions & 2 deletions stage2/04-unitotem/files/unitotem/static/Sortable.min.js

This file was deleted.

17 changes: 0 additions & 17 deletions stage2/04-unitotem/files/unitotem/static/ace-builds/ace.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9090bd0

Please sign in to comment.