summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilhelm Schuster2021-02-22 11:36:10 +0100
committerWilhelm Schuster2021-02-22 11:36:10 +0100
commit8f55e27b413ca86b5d14f9e148850bbfe21e4411 (patch)
tree651c61bcc09e3664b72bd1583eab4fea6698bd88
downloadaur-8f55e27b413ca86b5d14f9e148850bbfe21e4411.tar.gz
Initial import
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD50
-rw-r--r--fluidd-klipper.cfg53
-rw-r--r--fluidd-nginx.conf64
4 files changed, 188 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..705900300d0c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = fluidd-git
+ pkgdesc = Klipper web frontend
+ pkgver = r488.ca5ff43
+ pkgrel = 1
+ url = https://github.com/cadriel/fluidd
+ arch = any
+ license = GPLv3
+ makedepends = npm
+ optdepends = nginx: serve via HTTP
+ optdepends = ustreamer: webcam streaming support
+ provides = fluidd
+ conflicts = fluidd
+ source = git+https://github.com/cadriel/fluidd.git#branch=master
+ source = fluidd-klipper.cfg
+ source = fluidd-nginx.conf
+ sha256sums = SKIP
+ sha256sums = 3ab90887f056957d983aa4c00aa92d0a29f8aad07e410b18751a26a6e73539de
+ sha256sums = e7b5ad3cf3024961e072add95e7367076874330dde8b1594e3410354005fbc7b
+
+pkgname = fluidd-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6d50303048c3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: Wilhelm Schuster <aur [aT] rot13 dot io>
+pkgname=fluidd-git
+_pkgname="${pkgname%-git}"
+pkgver=r488.ca5ff43
+pkgrel=1
+pkgdesc="Klipper web frontend"
+arch=(any)
+url="https://github.com/cadriel/fluidd"
+license=('GPLv3')
+depends=()
+makedepends=('npm')
+optdepends=('nginx: serve via HTTP'
+ 'ustreamer: webcam streaming support')
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+source=('git+https://github.com/cadriel/fluidd.git#branch=master' 'fluidd-klipper.cfg' 'fluidd-nginx.conf')
+sha256sums=('SKIP'
+ '3ab90887f056957d983aa4c00aa92d0a29f8aad07e410b18751a26a6e73539de'
+ 'e7b5ad3cf3024961e072add95e7367076874330dde8b1594e3410354005fbc7b')
+
+pkgver() {
+ cd "$srcdir/$_pkgname"
+
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+build() {
+ cd "$srcdir/$_pkgname"
+
+ npm install --no-update-notifier --no-audit --cache "${srcdir}/npm-cache"
+ ./node_modules/.bin/vue-cli-service build
+}
+
+package() {
+ cd "$srcdir/$_pkgname"
+
+ install -dm755 "${pkgdir}/usr/share/webapps"
+ cp -r dist "$pkgdir/usr/share/webapps/${_pkgname}"
+
+ # Non-deterministic race in npm gives 777 permissions to random directories.
+ # See https://github.com/npm/cli/issues/1103 for details.
+ find "${pkgdir}/usr" -type d -exec chmod 755 {} +
+
+ # npm gives ownership of ALL FILES to build user
+ # https://bugs.archlinux.org/task/63396
+ chown -R root:root "${pkgdir}"
+
+ install -Dm644 "${srcdir}/fluidd-klipper.cfg" "${pkgdir}/usr/share/doc/${_pkgname}/fluidd-klipper.cfg"
+ install -Dm644 "${srcdir}/fluidd-nginx.conf" "${pkgdir}/usr/share/doc/${_pkgname}/fluidd-nginx.conf"
+}
diff --git a/fluidd-klipper.cfg b/fluidd-klipper.cfg
new file mode 100644
index 000000000000..04182c294220
--- /dev/null
+++ b/fluidd-klipper.cfg
@@ -0,0 +1,53 @@
+[virtual_sdcard]
+#path: /opt/klipper/gcode_files
+
+[pause_resume]
+
+[display_status]
+
+[gcode_macro CANCEL_PRINT]
+rename_existing: BASE_CANCEL_PRINT
+gcode:
+ TURN_OFF_HEATERS
+ CLEAR_PAUSE
+ SDCARD_RESET_FILE
+ BASE_CANCEL_PRINT
+
+[gcode_macro PAUSE]
+rename_existing: BASE_PAUSE
+# change this if you need more or less extrusion
+variable_extrude: 1.0
+gcode:
+ ##### read E from pause macro #####
+ {% set E = printer["gcode_macro PAUSE"].extrude|float %}
+ ##### set park positon for x and y #####
+ # default is your max posion from your printer.cfg
+ {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
+ {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
+ ##### calculate save lift position #####
+ {% set max_z = printer.toolhead.axis_maximum.z|float %}
+ {% set act_z = printer.toolhead.position.z|float %}
+ {% if act_z < (max_z - 2.0) %}
+ {% set z_safe = 2.0 %}
+ {% else %}
+ {% set z_safe = max_z - act_z %}
+ {% endif %}
+ ##### end of definitions #####
+ SAVE_GCODE_STATE NAME=PAUSE_state
+ BASE_PAUSE
+ G91
+ G1 E-{E} F2100
+ G1 Z{z_safe} F900
+ G90
+ G1 X{x_park} Y{y_park} F6000
+
+[gcode_macro RESUME]
+rename_existing: BASE_RESUME
+gcode:
+ ##### read E from pause macro #####
+ {% set E = printer["gcode_macro PAUSE"].extrude|float %}
+ ##### end of definitions #####
+ G91
+ G1 E{E} F2100
+ RESTORE_GCODE_STATE NAME=PAUSE_state
+ BASE_RESUME
diff --git a/fluidd-nginx.conf b/fluidd-nginx.conf
new file mode 100644
index 000000000000..fa902a88c5c6
--- /dev/null
+++ b/fluidd-nginx.conf
@@ -0,0 +1,64 @@
+map $http_upgrade $connection_upgrade {
+ default upgrade;
+ '' close;
+}
+
+# moonraker
+upstream apiserver {
+ ip_hash;
+ server 127.0.0.1:7125;
+}
+
+server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+
+ access_log /var/log/nginx/fluidd-access.log;
+ error_log /var/log/nginx/fluidd-error.log;
+
+ #disable this section on smaller hardware like a pi zero
+ gzip on;
+ gzip_vary on;
+ gzip_proxied any;
+ gzip_proxied expired no-cache no-store private auth;
+ gzip_comp_level 4;
+ gzip_buffers 16 8k;
+ gzip_http_version 1.1;
+ gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml;
+
+ #web_path from mainsail static files
+ root /usr/share/webapps/fluidd;
+
+ index index.html;
+ server_name _;
+
+ #disable max upload size
+ client_max_body_size 0;
+
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+
+ location = /index.html {
+ add_header Cache-Control "no-store, no-cache, must-revalidate";
+ }
+
+ location /websocket {
+ proxy_pass http://apiserver/websocket;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection $connection_upgrade;
+ proxy_set_header Host $http_host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_read_timeout 86400;
+ }
+
+ location ~ ^/(printer|api|access|machine|server)/ {
+ proxy_pass http://apiserver$request_uri;
+ proxy_set_header Host $http_host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Scheme $scheme;
+ }
+}