Remove configuration of http basic auth
This commit is contained in:
parent
3399a3c80f
commit
e34df3b656
|
@ -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.
|
||||
|
|
|
@ -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 <<EOF > /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
|
||||
|
||||
|
|
Loading…
Reference in New Issue