19 Commits

Author SHA1 Message Date
Arksine
b92000dd46 moonraker: Use file_manager to update mutable endpoints
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-11 08:38:28 -04:00
Arksine
98b3c990e0 file_manager: Add configparser support
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-11 08:38:27 -04:00
Arksine
9c76875896 file_manager: use print_stats to determine if an operation is safe
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-05 14:02:06 -04:00
Arksine
43d54f078e file_manager: Restrict full access to "gcodes" and "config" paths
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-05 11:05:55 -04:00
Arksine
d572a13655 file_manager: refactor config file handling
Remove the "primary_config" option from the upload handler, as we no longer allow writes to printer.cfg unless it is located in the config path.  We now assume that the config path is the main config, so all files there are located at  /server/files/config/*.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-05 11:05:00 -04:00
Arksine
f0e388ccdc file_manager: Add support for config examples
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-01 06:05:19 -04:00
Arksine
b6f8ba775c file_manager: implement file_list_changed notifcation
This notification is moved from moonraker.py.  Instead of sending a filelist, it now updates the file list and sends all relevant information to the client.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-01 06:05:19 -04:00
Arksine
e0fb261c12 file_manager: refactor upload logic
Break gcode and config file uploads into their own functions.  Add a 'primary_config' argument to config file uploads.  If set to true, the upload will overwrite printer.cfg.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-01 06:05:19 -04:00
Arksine
8b5c8786b4 file_manager: Verify that uploads are not written to folders outside of the "base" directory
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-01 06:05:19 -04:00
Arksine
9743772b45 file_manager: Add support for configuration files
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-01 06:05:19 -04:00
Arksine
bf1a666e20 file_manager: Allow the self.file_paths to contain paths to files
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-01 06:05:19 -04:00
Arksine
f0fa1295a7 file_manager: handle file upload processing
This implentation allows for uploads to different local paths by specifying a "root" argument in the form.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-01 06:05:19 -04:00
Arksine
879ddea0e5 file_manager: quote file name passed to metadata process
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-14 07:49:08 -04:00
Arksine
1d1edf33c3 file_manager: Use sys.executable to identify python env
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-14 07:39:05 -04:00
Arksine
6c58bba8c5 file_manager: Add debug logging to metadata response
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-14 07:22:19 -04:00
Arksine
29e7df38d0 file_manager: Add move and copy APIs
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-14 07:00:52 -04:00
Arksine
5754609203 file_manager: reject requests to delete a "root" directory
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-04 15:22:08 -04:00
Arksine
0e79b6f3f7 file_manager: add JSON-RPC "directory" APIs
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-04 14:33:17 -04:00
Arksine
d1c740b900 moonraker: add initial source
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-02 12:24:15 -04:00