Merge pull request 'Copy Rocket.toml to /usr/share/peach-web' (#55) from copy-rocket-toml into main
Reviewed-on: #55
This commit is contained in:
commit
9324b3ec0b
|
@ -2541,7 +2541,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "peach-web"
|
name = "peach-web"
|
||||||
version = "0.4.12"
|
version = "0.4.15"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"env_logger 0.8.4",
|
"env_logger 0.8.4",
|
||||||
"log 0.4.14",
|
"log 0.4.14",
|
||||||
|
|
|
@ -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::utils::{cmd, conf, create_group_if_doesnt_exist, does_user_exist, get_output};
|
||||||
use crate::RtcOption;
|
use crate::RtcOption;
|
||||||
|
|
||||||
|
|
||||||
/// Idempotent setup of PeachCloud device which sets up networking configuration,
|
/// Idempotent setup of PeachCloud device which sets up networking configuration,
|
||||||
/// configures the peachcloud apt repository, installs system dependencies,
|
/// configures the peachcloud apt repository, installs system dependencies,
|
||||||
/// installs microservices, and creates necessary system groups and users.
|
/// installs microservices, and creates necessary system groups and users.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "peach-web"
|
name = "peach-web"
|
||||||
version = "0.4.12"
|
version = "0.4.15"
|
||||||
authors = ["Andrew Reid <gnomad@cryptolab.net>"]
|
authors = ["Andrew Reid <gnomad@cryptolab.net>"]
|
||||||
edition = "2018"
|
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."
|
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" }
|
systemd-units = { unit-name = "peach-web" }
|
||||||
assets = [
|
assets = [
|
||||||
["target/release/peach-web", "/usr/bin/", "755"],
|
["target/release/peach-web", "/usr/bin/", "755"],
|
||||||
|
["Rocket.toml", "/usr/share/peach-web/Rocket.toml", "644"],
|
||||||
["templates/**/*", "/usr/share/peach-web/templates/", "644"],
|
["templates/**/*", "/usr/share/peach-web/templates/", "644"],
|
||||||
["static/*", "/usr/share/peach-web/static/", "644"],
|
["static/*", "/usr/share/peach-web/static/", "644"],
|
||||||
["static/css/*", "/usr/share/peach-web/static/css/", "644"],
|
["static/css/*", "/usr/share/peach-web/static/css/", "644"],
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
[default]
|
||||||
|
secret_key = "VYVUDivXvu8g6llxeJd9F92pMfocml5xl/Jjv5Sk4yw="
|
||||||
|
|
||||||
[development]
|
[development]
|
||||||
template_dir = "templates/"
|
template_dir = "templates/"
|
||||||
disable_auth = true
|
disable_auth = true
|
||||||
|
|
|
@ -5,54 +5,18 @@ set -e
|
||||||
adduser --quiet --system peach-web
|
adduser --quiet --system peach-web
|
||||||
usermod -g peach 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
|
# create nginx config
|
||||||
cat <<EOF > /etc/nginx/sites-enabled/default
|
cat <<EOF > /etc/nginx/sites-enabled/default
|
||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
server_name peach.local www.peach.local;
|
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
|
# remove trailing slash if found
|
||||||
rewrite ^/(.*)/$ /$1 permanent;
|
rewrite ^/(.*)/$ /$1 permanent;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:3000;
|
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
|
EOF
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue