script: rework moonraker service setup

This commit is contained in:
th33xitus
2021-03-28 15:51:50 +02:00
parent d658c3a4cd
commit 2f9de620bc
4 changed files with 192 additions and 290 deletions

42
resources/moonraker.conf Normal file
View File

@@ -0,0 +1,42 @@
[server]
host: 0.0.0.0
port: %PORT%
enable_debug_logging: False
config_path: %CFG%
database_path: %MR_DB%
klippy_uds_address: %UDS%
[authorization]
enabled: True
api_key_file: ~/.moonraker_api_key
trusted_clients:
127.0.0.1
%LAN%
::1/128
FE80::/10
cors_domains:
*.local
*://my.mainsail.xyz
*://app.fluidd.xyz
[octoprint_compat]
[update_manager]
[update_manager client mainsail]
type: web
repo: meteyou/mainsail
path: ~/mainsail
[update_manager client fluidd]
type: web
repo: cadriel/fluidd
path: ~/fluidd
#[update_manager client KlipperScreen]
#type: git_repo
#path: /home/%USER%/KlipperScreen
#origin: https://github.com/jordanruthe/KlipperScreen.git
#env: /home/%USER%/.KlipperScreen-env/bin/python
#requirements: scripts/KlipperScreen-requirements.txt
#install_script: scripts/KlipperScreen-install.sh

View File

@@ -0,0 +1,15 @@
#Systemd service file for moonraker
[Unit]
Description=Starts Moonraker %INST% on startup
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
User=%USER%
RemainAfterExit=yes
ExecStart=%MR_ENV%/bin/python %MR_DIR%/moonraker/moonraker.py -l %MR_LOG% -c %MR_CONF%
Restart=always
RestartSec=10