Добавлен moonraker

This commit is contained in:
Nikolay Kopitonenko 2024-08-15 01:53:31 +03:00
parent ddeec510d6
commit d98c9c8faf
2 changed files with 67 additions and 1 deletions

View File

@ -164,6 +164,50 @@ file:
mode: "0644" mode: "0644"
md5: 6f16423d3bbe2ad00bf8aac1cad3420f md5: 6f16423d3bbe2ad00bf8aac1cad3420f
/etc/systemd/system/moonraker.service:
exists: true
filetype: file
owner: root
group: root
mode: "0644"
md5: b907778cc6b577667c5e813acebce508
/home/pi/moonraker:
exists: true
filetype: directory
owner: pi
group: pi
mode: "0755"
/home/pi/moonraker-env:
exists: true
filetype: directory
owner: pi
group: pi
mode: "0755"
/etc/polkit-1/localauthority/50-local.d/10-moonraker.pkla:
exists: true
filetype: file
owner: root
group: root
mode: "0644"
/home/pi/printer_data/config:
exists: true
filetype: directory
owner: pi
group: pi
mode: "0755"
/home/pi/printer_data/config/moonraker.conf:
exists: true
filetype: file
owner: pi
group: pi
mode: "0644"
md5: 116f36349e01e22a14506b3e079dab6b
service: service:
klipper: klipper:
name: klipper name: klipper

View File

@ -19,7 +19,7 @@ set -xe
&& ./klipper/scripts/install-octopi.sh \ && ./klipper/scripts/install-octopi.sh \
" "
} }
install -m644 -o 0 -g 0 $ConfigsHome/etc/default/klipper /etc/default/klipper install -m644 -o 0 -g 0 -C $ConfigsHome/etc/default/klipper /etc/default/klipper
# Mainsail # Mainsail
[ -e /home/pi/mainsail ] && { [ -e /home/pi/mainsail ] && {
@ -37,6 +37,7 @@ install -m644 -o 0 -g 0 $ConfigsHome/etc/default/klipper /etc/default/klipper
chmod 0 /home/pi/mainsail/.git chmod 0 /home/pi/mainsail/.git
apt-get -y install nginx apt-get -y install nginx
rm -f /etc/nginx/conf.d/default.conf rm -f /etc/nginx/conf.d/default.conf
rm -f /etc/nginx/sites-enabled/default rm -f /etc/nginx/sites-enabled/default
@ -47,6 +48,26 @@ install -m644 -o 0 -g 0 $ConfigsHome/etc/nginx/sites-enabled/mainsail /etc/nginx
install -m644 -o 0 -g 0 -C $ConfigsHome/etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg install -m644 -o 0 -g 0 -C $ConfigsHome/etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg
# Moonraker
mkdir /home/pi/printer_data/config &>/dev/null || :
chown pi:pi /home/pi/printer_data/config &>/dev/null || :
[ -e /home/pi/printer_data/config/moonraker.conf ] || \
install -m644 -o pi -g pi $ConfigsHome/home/pi/printer_data/config/moonraker.conf /home/pi/printer_data/config/moonraker.conf
[ -e /home/pi/moonraker ] && {
su - pi -c "cd /home/pi/moonraker \
&& git pull \
"
:
} || {
su - pi -c "cd /home/pi \
&& git clone --depth=1 $GITEA_BASE/moonraker.git \
&& (cd moonraker && git config pull.rebase false) \
&& ./moonraker/scripts/install-moonraker.sh \
"
}
bash -c ' bash -c '
systemctl enable klipper systemctl enable klipper
systemctl unmask nginx systemctl unmask nginx
@ -55,4 +76,5 @@ systemctl enable octoprint
systemctl restart haproxy systemctl restart haproxy
systemctl restart nginx systemctl restart nginx
systemctl restart klipper systemctl restart klipper
systemctl restart moonraker
' 2>/dev/null & ' 2>/dev/null &