Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/guysoft/OctoPi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Sheffer <guysoft@gmail.com>2021-02-11 19:49:54 +0300
committerGitHub <noreply@github.com>2021-02-11 19:49:54 +0300
commit08c9b5e63a97090dbb217045c9d7fb50815093ba (patch)
treea2ea456ab7144cfcde39eb2d20883013c3a30a1e
parentb6b7f3623aa59021513693596537543b725aff04 (diff)
parent5d08be9d487834470d2d64a3e1b770d5466781f5 (diff)
Merge pull request #722 from XRyu/devel related #711
Small fixes on the ubuntu-variant as mentioned in discussion #711
-rw-r--r--src/variants/ubuntu_arm64/filesystem/root/etc/haproxy/haproxy.cfg49
-rw-r--r--src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service15
-rw-r--r--src/variants/ubuntu_arm64/post_chroot_script2
3 files changed, 66 insertions, 0 deletions
diff --git a/src/variants/ubuntu_arm64/filesystem/root/etc/haproxy/haproxy.cfg b/src/variants/ubuntu_arm64/filesystem/root/etc/haproxy/haproxy.cfg
new file mode 100644
index 0000000..8ef4d16
--- /dev/null
+++ b/src/variants/ubuntu_arm64/filesystem/root/etc/haproxy/haproxy.cfg
@@ -0,0 +1,49 @@
+global
+ maxconn 4096
+ user haproxy
+ group haproxy
+ log /dev/log local1 debug
+ tune.ssl.default-dh-param 2048
+
+defaults
+ log global
+ mode http
+ compression algo gzip
+ option httplog
+ option dontlognull
+ retries 3
+ option redispatch
+ option http-server-close
+ option forwardfor
+ maxconn 2000
+ timeout connect 5s
+ timeout client 15min
+ timeout server 15min
+
+frontend public
+ bind :::80 v4v6
+ bind :::443 v4v6 ssl crt /etc/ssl/snakeoil.pem
+ option forwardfor except 127.0.0.1
+ use_backend webcam if { path_beg /webcam/ }
+ use_backend webcam_hls if { path_beg /hls/ }
+ use_backend webcam_hls if { path_beg /jpeg/ }
+ default_backend octoprint
+
+backend octoprint
+ acl needs_scheme req.hdr_cnt(X-Scheme) eq 0
+
+ http-request replace-path ^([^\ :]*)\ /(.*) \1\ /\2
+ http-request add-header X-Scheme https if needs_scheme { ssl_fc }
+ http-request add-header X-Scheme http if needs_scheme !{ ssl_fc }
+ option forwardfor
+ server octoprint1 127.0.0.1:5000
+ errorfile 503 /etc/haproxy/errors/503-no-octoprint.http
+
+backend webcam
+ http-request replace-path /webcam/(.*) /\1
+ server webcam1 127.0.0.1:8080
+ errorfile 503 /etc/haproxy/errors/503-no-webcam.http
+
+backend webcam_hls
+ server webcam_hls_1 127.0.0.1:28126
+ errorfile 503 /etc/haproxy/errors/503-no-webcam-hls.http
diff --git a/src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service b/src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service
new file mode 100644
index 0000000..bd5feb5
--- /dev/null
+++ b/src/variants/ubuntu_arm64/filesystem/root/etc/systemd/system/webcamd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=the OctoPi webcam daemon with the user specified config
+# ConditionPathExists=/etc/octopi_streamer/mjpeg
+
+[Service]
+WorkingDirectory=/root/bin
+StandardOutput=append:/var/log/webcamd.log
+StandardError=append:/var/log/webcamd.log
+ExecStart=/root/bin/webcamd
+Restart=always
+Type=forking
+RestartSec=1
+
+[Install]
+WantedBy=multi-user.target
diff --git a/src/variants/ubuntu_arm64/post_chroot_script b/src/variants/ubuntu_arm64/post_chroot_script
index ff0ed50..d699ad2 100644
--- a/src/variants/ubuntu_arm64/post_chroot_script
+++ b/src/variants/ubuntu_arm64/post_chroot_script
@@ -7,6 +7,8 @@ export LC_ALL=C
source /common.sh
install_cleanup_trap
+# Unpack the filesystem changes for the variant
+unpack /filesystem/root /
# add-apt-repository ppa:ubuntu-raspi2/ppa -y
apt-get update