Добавлен mainsail

This commit is contained in:
Nikolay Kopitonenko 2024-08-14 23:41:15 +03:00
parent 0378b7e968
commit ada5784168
2 changed files with 84 additions and 4 deletions

View File

@ -39,6 +39,20 @@ file:
group: pi
mode: "0755"
/home/pi/mainsail:
filetype: directory
exists: true
owner: pi
group: pi
mode: "0755"
/home/pi/mainsail/.git:
filetype: directory
exists: true
owner: pi
group: pi
mode: "0000"
/home/pi/.octoprint/config.yaml:
exists: true
filetype: file
@ -113,10 +127,49 @@ file:
contents: |
pi ALL=(ALL) NOPASSWD: ALL
/etc/init.d/nginx:
exists: true
filetype: file
owner: root
group: root
mode: "0755"
/etc/nginx/conf.d/default.conf:
exists: false
/etc/nginx/sites-enabled/default:
exists: false
/etc/nginx/conf.d/mainsail.conf:
exists: true
filetype: file
owner: root
group: root
mode: "0644"
md5: 3426243d4230c11bd4154498cc4f2fe7
/etc/nginx/sites-enabled/mainsail:
exists: true
filetype: file
owner: root
group: root
mode: "0644"
/etc/haproxy/haproxy.cfg:
exists: true
filetype: file
owner: root
group: root
mode: "0644"
md5: 6f16423d3bbe2ad00bf8aac1cad3420f
service:
klipper:
name: klipper
enabled: true
nginx:
name: nginx
enabled: true
octoprint:
name: octoprint
enabled: false
enabled: true

View File

@ -21,6 +21,33 @@ set -xe
}
install -m644 -o 0 -g 0 $ConfigsHome/etc/default/klipper /etc/default/klipper
systemctl enable klipper 2>/dev/null
systemctl disable octoprint 2>/dev/null
systemctl restart klipper 2>/dev/null &
# Mainsail
[ -e /home/pi/mainsail ] && {
su - pi -c "cd /home/pi/mainsail \
&& chmod 755 .git \
&& git pull \
"
:
} || {
su - pi -c "cd /home/pi \
&& git clone --depth=1 $GITEA_BASE/mainsail.git \
&& (cd mainsail && git config pull.rebase false) \
"
}
chmod 0 /home/pi/mainsail/.git
apt-get -y install nginx
rm -f /etc/nginx/conf.d/default.conf
rm -f /etc/nginx/sites-enabled/default
install -m644 -o 0 -g 0 $ConfigsHome/etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg
bash -c '
systemctl enable klipper
systemctl unmask nginx
systemctl enable nginx
systemctl enable octoprint
systemctl restart haproxy
systemctl restart nginx
systemctl restart klipper
' 2>/dev/null &