Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
a6e2b549
Commit
a6e2b549
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Placeholder web user interface
parent
1cea4926
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-utils-setup
+3
-0
3 additions, 0 deletions
src/freedombone-utils-setup
src/freedombone-utils-web
+25
-0
25 additions, 0 deletions
src/freedombone-utils-web
with
28 additions
and
0 deletions
src/freedombone-utils-setup
+
3
−
0
View file @
a6e2b549
...
...
@@ -1076,6 +1076,9 @@ function setup_web {
function_check install_web_server_access_control
install_web_server_access_control
function_check install_web_local_user_interface
install_web_local_user_interface
}
function
upgrade_apps
{
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-web
+
25
−
0
View file @
a6e2b549
...
...
@@ -1070,4 +1070,29 @@ function email_install_tls {
fi
}
function install_web_local_user_interface {
# TODO
# This is intended as a placeholder for a potential local web user interface
# similar to Plinth or the yunohost admin interface
local_hostname=$(cat /etc/avahi/avahi-daemon.conf | grep 'host-name' | awk -F '=' '{print $2}').local
mkdir -p /var/www/${local_hostname}/htdocs
echo '
<html>
' > /var/www/${local_hostname}/htdocs/index.html
echo '
<body>
' >> /var/www/${local_hostname}/htdocs/index.html
echo " This is a test on $local_hostname" >> /var/www/${local_hostname}/htdocs/index.html
echo '
</body>
' >> /var/www/${local_hostname}/htdocs/index.html
echo '
</html>
' >> /var/www/${local_hostname}/htdocs/index.html
chown -R www-data:www-data /var/www/${local_hostname}/htdocs
nginx_file=/etc/nginx/sites-available/$local_hostname
echo 'server {' > $nginx_file
echo ' listen 80;' >> $nginx_file
echo ' listen [::]:80;' >> $nginx_file
echo " server_name ${local_hostname};" >> $nginx_file
echo " root /var/www/${local_hostname}/htdocs;" >> $nginx_file
echo ' index index.html;' >> $nginx_file
echo '}' >> $nginx_file
nginx_ensite $local_hostname
}
# NOTE: deliberately no exit 0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment