Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align with printer data folder #46

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
![Klipper Moonraker Multiarch Image CI](https://github.com/dimalo/klipper-web-control-docker/workflows/Klipper%20Moonraker%20Multiarch%20Image%20CI/badge.svg)

# klipper-web-control-docker

__Caution__

If you used klipper-web-control-docker before, mind the changes in `docker-compose.yml` in accordance with the changed [moonraker standard](https://moonraker.readthedocs.io/en/latest/installation/#data-folder-structure).
Volume bindings were changed from `gcode_files:/home/klippy/gcode_files` to `gcodes:/home/klippy/printer_data/gcodes` and from `./config:/home/klippy/.config` to `./config:/home/klippy/printer_data/config`. `moonraker_data:/home/klippy/.moonraker` was removed.

__Klipper with Moonraker shipped with Fluidd and/or Mainsail__

- get your printer to the next level!
Expand Down
14 changes: 10 additions & 4 deletions config/moonraker.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
[server]
host: 0.0.0.0
port: 7125
enable_debug_logging: False
config_path: /home/klippy/.config
database_path: /home/klippy/.moonraker_database

[machine]
provider = none
validate_service = False

[file_manager]
queue_gcode_uploads = True
enable_object_processing = True

[data_store]
temperature_store_size: 1800
gcode_store_size: 1000

Expand All @@ -24,5 +31,4 @@ trusted_clients:
[history]

[update_manager]
enable_repo_debug: True
enable_system_updates: False
20 changes: 9 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ services:
- 7125:7125
restart: unless-stopped
volumes:
- gcode_files:/home/klippy/gcode_files
- gcodes:/home/klippy/printer_data/gcodes
# mind folder permissions
# be aware to create your own branch if you mount the config folder as it will be updated on the main branch
# that way you can merge upstream changes to your customized configs
- ./config:/home/klippy/.config
- moonraker_data:/home/klippy/.moonraker
# - <<your_config_path>>:/home/klippy/.config
# - ./printer.cfg:/home/klippy/.config/printer.cfg
- ./config:/home/klippy/printer_data/config
# - <<your_config_path>>:/home/klippy/printer_data/config
# - ./printer.cfg:/home/klippy/printer_data/config/printer.cfg
# mount serial device - take care to grant sufficient permissions to the device: <host_dev>:<container_dev>
# put <container_dev> into your printer.cfg
devices:
Expand Down Expand Up @@ -48,9 +48,9 @@ services:
# - gcode_files:/home/klippy/gcode_files
# # be aware to create your own branch if you mount the config folder as it will be updated on the main branch
# # that way you can merge upstream changes to your (developed) configs...
# - ./config_another_printer:/home/klippy/.config
# # - <<your_config_path>>:/home/klippy/.config
# # - ./another_printer.cfg:/home/klippy/.config/printer.cfg
# - ./config_another_printer:/home/klippy/printer_data/config
# # - <<your_config_path>>:/home/klippy/printer_data/config
# # - ./another_printer.cfg:/home/klippy/printer_data/config/printer.cfg
# # mount serial device - take care to grant sufficient permissions to the device: <host_dev>:<container_dev>
# # put <container_dev> into your printer.cfg
# devices:
Expand Down Expand Up @@ -91,6 +91,4 @@ services:
# - klipper_another_printer:klipper_another_printer

volumes:
gcode_files:
moonraker_data:

gcodes:
9 changes: 6 additions & 3 deletions klipper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ ENV LANGUAGE en_GB:en

ARG USER=klippy
ARG HOME=/home/${USER}
ENV CONFIG_DIR=${HOME}/.config
ARG PRINTER_DATA=${HOME}/printer_data
ENV CONFIG_DIR=${PRINTER_DATA}/config
ENV GCODE_DIR=${PRINTER_DATA}/gcodes
ENV KLIPPER_VENV_DIR=${HOME}/klippy-env
ENV MOONRAKER_VENV_DIR=${HOME}/moonraker-env

Expand All @@ -96,9 +98,10 @@ RUN useradd --user-group --no-log-init --shell /bin/false -m -d ${HOME} ${USER}
USER ${USER}
WORKDIR ${HOME}

RUN mkdir -p ${HOME}/gcode_files ${CONFIG_DIR} ${HOME}/.moonraker ${HOME}/.moonraker_database ${HOME}/.klipper_repo_backup ${HOME}/.moonraker_repo_backup
# According to https://moonraker.readthedocs.io/en/latest/installation/#data-folder-structure
RUN mkdir -p ${PRINTER_DATA} ${CONFIG_DIR} ${GCODE_DIR} ${PRINTER_DATA}/backup ${PRINTER_DATA}/certs ${PRINTER_DATA}/database ${PRINTER_DATA}/logs ${PRINTER_DATA}/systemd

VOLUME ${HOME}/gcode_files
VOLUME ${GCODE_DIR}
VOLUME ${CONFIG_DIR}

EXPOSE 7125
Expand Down
2 changes: 1 addition & 1 deletion klipper/klipper.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[program:klipper]
user=klippy
command=/home/klippy/klippy-env/bin/python /home/klippy/klipper/klippy/klippy.py -a /tmp/klippy_uds -l /var/log/klipper/klipper.log /home/klippy/.config/klipper.cfg
command=/home/klippy/klippy-env/bin/python /home/klippy/klipper/klippy/klippy.py -a /tmp/klippy_uds -l /var/log/klipper/klipper.log /home/klippy/printer_data/config/klipper.cfg
environment=USER=klippy,HOME=/home/klippy,PYTHONHOME=/home/klippy/klippy-env
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes = 0
Expand Down
2 changes: 1 addition & 1 deletion klipper/moonraker.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[program:moonraker]
user=klippy
command=/home/klippy/moonraker-env/bin/python /home/klippy/moonraker/moonraker/moonraker.py -l /var/log/klipper/moonraker.log -c /home/klippy/.config/moonraker.conf
command=/home/klippy/moonraker-env/bin/python /home/klippy/moonraker/moonraker/moonraker.py -d /home/klippy/printer_data -l /var/log/klipper/moonraker.log -c /home/klippy/printer_data/config/moonraker.conf
environment=USER=klippy,HOME=/home/klippy
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes = 0
Expand Down