|
@@ -1070,4 +1070,29 @@ function email_install_tls {
|
1070
|
1070
|
fi
|
1071
|
1071
|
}
|
1072
|
1072
|
|
|
1073
|
+function install_web_local_user_interface {
|
|
1074
|
+ # TODO
|
|
1075
|
+ # This is intended as a placeholder for a potential local web user interface
|
|
1076
|
+ # similar to Plinth or the yunohost admin interface
|
|
1077
|
+ local_hostname=$(cat /etc/avahi/avahi-daemon.conf | grep 'host-name' | awk -F '=' '{print $2}').local
|
|
1078
|
+
|
|
1079
|
+ mkdir -p /var/www/${local_hostname}/htdocs
|
|
1080
|
+ echo '<html>' > /var/www/${local_hostname}/htdocs/index.html
|
|
1081
|
+ echo ' <body>' >> /var/www/${local_hostname}/htdocs/index.html
|
|
1082
|
+ echo " This is a test on $local_hostname" >> /var/www/${local_hostname}/htdocs/index.html
|
|
1083
|
+ echo ' </body>' >> /var/www/${local_hostname}/htdocs/index.html
|
|
1084
|
+ echo '</html>' >> /var/www/${local_hostname}/htdocs/index.html
|
|
1085
|
+ chown -R www-data:www-data /var/www/${local_hostname}/htdocs
|
|
1086
|
+
|
|
1087
|
+ nginx_file=/etc/nginx/sites-available/$local_hostname
|
|
1088
|
+ echo 'server {' > $nginx_file
|
|
1089
|
+ echo ' listen 80;' >> $nginx_file
|
|
1090
|
+ echo ' listen [::]:80;' >> $nginx_file
|
|
1091
|
+ echo " server_name ${local_hostname};" >> $nginx_file
|
|
1092
|
+ echo " root /var/www/${local_hostname}/htdocs;" >> $nginx_file
|
|
1093
|
+ echo ' index index.html;' >> $nginx_file
|
|
1094
|
+ echo '}' >> $nginx_file
|
|
1095
|
+ nginx_ensite $local_hostname
|
|
1096
|
+}
|
|
1097
|
+
|
1073
|
1098
|
# NOTE: deliberately no exit 0
|