diff --git a/docs/changelog.md b/docs/changelog.md index 35a1a97..ae5a6bc 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,6 +6,22 @@ The format is based on [Keep a Changelog]. ## [Unreleased] +## [0.9.2] - 2024-07-30 + +### Added +- **install**: Add support for installing Moonraker's python package via pip. +- **scripts**: Add script to sync python and system dependencies from + `pyproject.toml` and `system-dependencies.json` respectively. +- **dev**: Add pre-commit hook to call `sync_dependencies.py`. + +### Fixed +- **build**: Build from sdist now correctly includes share data. +- **build**: Remove stray `.gitignore` from Python Wheel. + +### Changed +- **install**: The `MOONRAKER_FORCE_DEFAULTS` environment variable has changed + to `MOONRAKER_FORCE_SYSTEM_INSTALL`. + ## [0.9.1] - 2024-07-25 ### Fixed @@ -190,7 +206,8 @@ The format is based on [Keep a Changelog]. [api_changes.md]: api_changes.md -[unreleased]: https://github.com/Arksine/moonraker/compare/v0.9.1...HEAD +[unreleased]: https://github.com/Arksine/moonraker/compare/v0.9.2...HEAD +[0.9.2]: https://github.com/Arksine/moonraker/compare/v0.9.1...v0.9.2 [0.9.1]: https://github.com/Arksine/moonraker/compare/v0.9.0...v0.9.1 [0.9.0]: https://github.com/Arksine/moonraker/compare/v0.8.0...v0.9.0 [0.8.0]: https://github.com/Arksine/moonraker/compare/v0.7.1...v0.8.0 diff --git a/docs/configuration.md b/docs/configuration.md index 633efc3..eceba14 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -2222,7 +2222,7 @@ folder that provides supplemental information for the application. The Moonraker uses the [PDM backend](https://backend.pdm-project.org/) to perform its package builds. An example of a pdm build script that generates a `release_info` file may be found -[here](https://github.com/Arksine/moonraker/blob/master/scripts/pdm_build_dist.py). +[here](https://github.com/Arksine/moonraker/blob/master/pdm_build.py). #### The System Dependencies File Format diff --git a/docs/installation.md b/docs/installation.md index a47f13b..c83ab33 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,19 +1,19 @@ ## Installation -This document provides a guide on how to install Moonraker on a Raspberry -Pi running Raspian/Rasperry Pi OS. Other SBCs and/or linux distributions -may work, however they may need a custom install script. Moonraker -requires Python 3.7 or greater, verify that your distribution's -Python 3 packages meet this requirement. +This document provides a guide on how to install Moonraker on a Debian +based Linux Distributions. Other linux distributions may work, however +they may need a custom install script. Moonraker requires Python 3.7 or +greater, verify that your distribution's Python 3 packages meet this +requirement. ### Installing Klipper Klipper should be installed prior to installing Moonraker. Please see -[Klipper's Documention](https://klipper3d.com/Overview.html) for details. +[Klipper's Documentation](https://klipper3d.com/Overview.html) for details. After installing Klipper you should make sure to add Moonraker's [configuration requirements](#klipper-configuration-requirements). -### Klipper Configuration Requirements +#### Klipper Configuration Requirements Moonraker depends on the following Klippy extras for full functionality: @@ -34,7 +34,7 @@ missing one or both, you can simply add the bare sections to `printer.cfg`: path: ~/printer_data/gcodes ``` -### Enabling Klipper's Unix Domain Socket Server +#### Enabling Klipper's Unix Domain Socket Server After Klipper is installed it may be necessary to modify its `defaults` file in order to enable the Unix Domain Socket. Begin by opening the file in your @@ -53,7 +53,7 @@ KLIPPY_EXEC=/home/pi/klippy-env/bin/python KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/printer.cfg -l /tmp/klippy.log" ``` -Add `-a /tmp/klippy_uds` to KLIPPY_ARGS: +Add `-a /home/pi/printer_data/comms/klippy.sock` to KLIPPY_ARGS: ``` # Configuration for /etc/init.d/klipper @@ -61,7 +61,7 @@ KLIPPY_USER=pi KLIPPY_EXEC=/home/pi/klippy-env/bin/python -KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/printer.cfg -l /tmp/klippy.log -a /tmp/klippy_uds" +KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/printer.cfg -l /tmp/klippy.log -a /home/pi/printer_data/comms/klippy.sock ``` !!! note @@ -79,7 +79,7 @@ KLIPPY_USER=pi KLIPPY_EXEC=/home/pi/klippy-env/bin/python -KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/printer_data/config/printer.cfg -l /home/pi/printer_data/logs/klippy.log -a /tmp/klippy_uds" +KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/printer_data/config/printer.cfg -l /home/pi/printer_data/logs/klippy.log -a /home/pi/printer_data/comms/klippy.sock" ``` Moonraker's install script will create the data folder, however you @@ -94,13 +94,52 @@ mv printer.cfg ~/printer_data/config ### Installing Moonraker -Begin by cloning the git respository: +Moonraker provides an install script that can be used to facilitate +installation. The type of installation depends on where the install +script is located on the host file system. If the install script is +downloaded and run individually, the script will install Moonraker as +a Python Package using pip. If the script is run from Moonraker's +original source it will install Moonraker from source. + +Prior to installation it is necessary to open a terminal on the host +machine, or SSH into it. It is recommended to read this entire +section before proceeding with the installation. + +#### Installing the Moonraker Python package + +The Python Package version of Moonraker will receive fewer updates, and +should generally be more stable. This is intended for users that do +not need to run unofficial 3rd party extensions, such as +[Moonraker-Timelapse](https://github.com/mainsail-crew/moonraker-timelapse), +and do not desire to run the "bleeding edge" version of Moonraker. + +To perform this installation, download Moonraker's +[install script](https://raw.githubusercontent.com/Arksine/moonraker/master/scripts/install-moonraker.sh) +from Github, then run the installer: + +``` +cd ~ +wget https://raw.githubusercontent.com/Arksine/moonraker/master/scripts/install-moonraker.sh +./install-moonraker.sh +``` + +#### Installing Moonraker from source + +Moonraker can be run directly from source. This method of installation will +clone Moonraker's git repository, and may receive frequent bleeding edge +updates. Users who want to test Moonraker, run unofficial modifications, and +do not mind SSHing into the host to correct issues should choose this option. + +To install Moonraker from source, clone its git repository then run the installer: ``` cd ~ git clone https://github.com/Arksine/moonraker.git +~/moonraker/scripts/install-moonraker.sh ``` +#### Customizing the installation + The install script will attempt to create a basic configuration if `moonraker.conf` does not exist at the expected location, however if you prefer to have Moonraker start with a robust configuration you may create @@ -109,20 +148,17 @@ it now. By default the configuration file should be located at data path may be configured using the script's command line options. The [sample moonraker.conf](./moonraker.conf) may be used as a starting point, full details can be found in the -[confguration documentation](./configuration.md). +[configuration documentation](./configuration.md). -For a default installation run the following commands: -``` -cd ~/moonraker/scripts -./install-moonraker.sh -``` -The install script has a few command line options that may be useful, +The install script has several command line options that may be useful, particularly for those upgrading: - `-f`: - Force an overwrite of Moonraker's systemd script. By default the - the systemd script will not be modified if it exists. + Force an overwrite of Moonraker's systemd script. In addition, a + new `moonraker.env` file will be created, and the PolKit rules will + be re-installed. By default these items will not be modified if + they exist. - `-a `: The installer uses this option to determine the name of the service to install. If `-d` is not provided then this options will also be @@ -133,7 +169,7 @@ particularly for those upgrading: files and directories used by moonraker. See the `Data Folder Structure` section for details. If omitted this defaults to `$HOME/printer_data`. - `-c ` - Specifies the path to Moonraker's configuation file. By default the + Specifies the path to Moonraker's configuration file. By default the configuration is expected at `/config/moonraker.conf`. ie: `/home/pi/printer_data/config/moonraker.conf`. - `-l ` @@ -157,25 +193,26 @@ variables: - `MOONRAKER_VENV` - `MOONRAKER_REBUILD_ENV` -- `MOONRAKER_FORCE_DEFAULTS` +- `MOONRAKER_FORCE_SYSTEM_INSTALL` - `MOONRAKER_DISABLE_SYSTEMCTL` - `MOONRAKER_SKIP_POLKIT` - `MOONRAKER_CONFIG_PATH` -- `MOONAKER_LOG_PATH` +- `MOONRAKER_LOG_PATH` - `MOONRAKER_DATA_PATH` - `MOONRAKER_SPEEDUPS` -When the script completes it should start both Moonraker and Klipper. In -`klippy.log` you should find the following entry: +When the script completes it should start the Moonraker system service. If Klipper +is running and Moonraker is able to establish a connection the following log entry +should be available in `klippy.log`: `webhooks client : Client info {'program': 'Moonraker', 'version': ''}` -Now you may install a client, such as +Now you may wish to install a frontend, such as [Mainsail](https://github.com/mainsail-crew/mainsail) or [Fluidd](https://github.com/fluidd-core/fluidd). !!! Note - Moonraker's install script no longer includes the nginx dependency. + Moonraker's installer does not include nginx as a dependency. If you want to install one of the above clients on the local machine, you may want to first install nginx (`sudo apt install nginx` on debian/ubuntu distros). @@ -299,7 +336,7 @@ Following are some items to take note of: - The `EnvironmentFile` field contains Moonraker's arguments. See the [environment file section](#the-environment-file) for details. - The `ExecStart` field begins with the python executable, followed by - by the enviroment variable `MOONRAKER_ARGS`. This variable is set in + by the environment variable `MOONRAKER_ARGS`. This variable is set in the environment file. @@ -362,7 +399,7 @@ If is necessary to run Moonraker without logging to a file the While moonraker will still log to stdout, all requests for support must be accompanied by `moonraker.log`. -Each command line argument has an associated enviroment variable that may +Each command line argument has an associated environment variable that may be used to specify options in place of the command line. - `MOONRAKER_DATA_PATH=""`: equivalent to `-d ` @@ -460,7 +497,7 @@ with the `sudo` prefix. This has significant downsides: wants to poll information about the system. Moonraker now supports communicating with system services via D-Bus. -Operations that require elevated privileges are authrorized through +Operations that require elevated privileges are authorized through PolicyKit. On startup Moonraker will check for the necessary privileges and warn users if they are not available. Warnings are presented in `moonraker.log` and directly to the user through some clients.