From e34df3b6565b876c1a750848a111e741bb7968cf Mon Sep 17 00:00:00 2001 From: notplants Date: Fri, 17 Dec 2021 17:18:50 -0500 Subject: [PATCH 1/3] Remove configuration of http basic auth --- peach-config/src/setup_peach.rs | 1 + peach-web/debian/postinst | 36 --------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/peach-config/src/setup_peach.rs b/peach-config/src/setup_peach.rs index fd70b3e..d17ecf8 100644 --- a/peach-config/src/setup_peach.rs +++ b/peach-config/src/setup_peach.rs @@ -10,6 +10,7 @@ use crate::update::update_microservices; use crate::utils::{cmd, conf, create_group_if_doesnt_exist, does_user_exist, get_output}; use crate::RtcOption; + /// Idempotent setup of PeachCloud device which sets up networking configuration, /// configures the peachcloud apt repository, installs system dependencies, /// installs microservices, and creates necessary system groups and users. diff --git a/peach-web/debian/postinst b/peach-web/debian/postinst index 0a09b6a..c2aba8e 100644 --- a/peach-web/debian/postinst +++ b/peach-web/debian/postinst @@ -5,54 +5,18 @@ set -e adduser --quiet --system peach-web usermod -g peach peach-web -# create secret passwords folder if it doesn't already exist -mkdir -p /var/lib/peachcloud/passwords -chown -R peach-web:peach /var/lib/peachcloud/passwords -chmod -R u+rwX,go+rX,go-w /var/lib/peachcloud/passwords - # create nginx config cat < /etc/nginx/sites-enabled/default server { listen 80 default_server; server_name peach.local www.peach.local; - # nginx authentication - auth_basic "If you have forgotten your password visit: http://peach.local/send_password_reset/"; - auth_basic_user_file /var/lib/peachcloud/passwords/htpasswd; - # remove trailing slash if found rewrite ^/(.*)/$ /$1 permanent; location / { proxy_pass http://127.0.0.1:3000; } - - # public routes - location /send_password_reset { - auth_basic off; - proxy_pass http://127.0.0.1:3000; - } - location /reset_password { - auth_basic off; - proxy_pass http://127.0.0.1:3000; - } - location /public/ { - auth_basic off; - proxy_pass http://127.0.0.1:3000; - } - location /js/ { - auth_basic off; - proxy_pass http://127.0.0.1:3000; - } - location /css/ { - auth_basic off; - proxy_pass http://127.0.0.1:3000; - } - location /icons/ { - auth_basic off; - proxy_pass http://127.0.0.1:3000; - } - } EOF -- 2.49.0 From c41dae8d046ff6c76ad6ff82cb9cf7a909eef01a Mon Sep 17 00:00:00 2001 From: notplants Date: Fri, 17 Dec 2021 17:23:27 -0500 Subject: [PATCH 2/3] Copy Rocket.toml to /usr/share/peach-web --- Cargo.lock | 2 +- peach-web/Cargo.toml | 3 ++- peach-web/Rocket.toml | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88d21fb..5adc1e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2541,7 +2541,7 @@ dependencies = [ [[package]] name = "peach-web" -version = "0.4.12" +version = "0.4.14" dependencies = [ "env_logger 0.8.4", "log 0.4.14", diff --git a/peach-web/Cargo.toml b/peach-web/Cargo.toml index 5bc93b3..9cd8bb2 100644 --- a/peach-web/Cargo.toml +++ b/peach-web/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "peach-web" -version = "0.4.12" +version = "0.4.14" authors = ["Andrew Reid "] edition = "2018" description = "peach-web is a web application which provides a web interface for monitoring and interacting with the PeachCloud device. This allows administration of the single-board computer (ie. Raspberry Pi) running PeachCloud, as well as the ssb-server and related plugins." @@ -21,6 +21,7 @@ maintainer-scripts="debian" systemd-units = { unit-name = "peach-web" } assets = [ ["target/release/peach-web", "/usr/bin/", "755"], + ["Rocket.toml", "/usr/share/peach-web/Rocket.toml", "644"], ["templates/**/*", "/usr/share/peach-web/templates/", "644"], ["static/*", "/usr/share/peach-web/static/", "644"], ["static/css/*", "/usr/share/peach-web/static/css/", "644"], diff --git a/peach-web/Rocket.toml b/peach-web/Rocket.toml index d46d8fb..b678c04 100644 --- a/peach-web/Rocket.toml +++ b/peach-web/Rocket.toml @@ -1,3 +1,6 @@ +[default] +secret = "VYVUDivXvu8g6llxeJd9F92pMfocml5xl/Jjv5Sk4yw=" + [development] template_dir = "templates/" disable_auth = true -- 2.49.0 From 94bac00664278e58d471aa1f5b69d827250fbb2b Mon Sep 17 00:00:00 2001 From: notplants Date: Sat, 18 Dec 2021 09:22:55 -0500 Subject: [PATCH 3/3] Fix typo in secret_key --- Cargo.lock | 2 +- peach-web/Cargo.toml | 2 +- peach-web/Rocket.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5adc1e1..4e54f81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2541,7 +2541,7 @@ dependencies = [ [[package]] name = "peach-web" -version = "0.4.14" +version = "0.4.15" dependencies = [ "env_logger 0.8.4", "log 0.4.14", diff --git a/peach-web/Cargo.toml b/peach-web/Cargo.toml index 9cd8bb2..648de74 100644 --- a/peach-web/Cargo.toml +++ b/peach-web/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "peach-web" -version = "0.4.14" +version = "0.4.15" authors = ["Andrew Reid "] edition = "2018" description = "peach-web is a web application which provides a web interface for monitoring and interacting with the PeachCloud device. This allows administration of the single-board computer (ie. Raspberry Pi) running PeachCloud, as well as the ssb-server and related plugins." diff --git a/peach-web/Rocket.toml b/peach-web/Rocket.toml index b678c04..1af1b71 100644 --- a/peach-web/Rocket.toml +++ b/peach-web/Rocket.toml @@ -1,5 +1,5 @@ [default] -secret = "VYVUDivXvu8g6llxeJd9F92pMfocml5xl/Jjv5Sk4yw=" +secret_key = "VYVUDivXvu8g6llxeJd9F92pMfocml5xl/Jjv5Sk4yw=" [development] template_dir = "templates/" -- 2.49.0