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
86c6ebc5
Commit
86c6ebc5
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
No basic auth initially
parent
94257175
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-app-edith
+1
-1
1 addition, 1 deletion
src/freedombone-app-edith
src/freedombone-utils-webadmin
+28
-2
28 additions, 2 deletions
src/freedombone-utils-webadmin
with
29 additions
and
3 deletions
src/freedombone-app-edith
+
1
−
1
View file @
86c6ebc5
...
@@ -277,7 +277,7 @@ function remove_edith {
...
@@ -277,7 +277,7 @@ function remove_edith {
}
}
function
install_edith
{
function
install_edith
{
$INSTALL_PACKAGES
php-gettext php-curl php-gd php-mysql git curl
$INSTALL_PACKAGES
php-gettext php-curl php-gd php-mysql git curl
apache2-utils
$INSTALL_PACKAGES
memcached php-memcached php-intl exiftool libfcgi0ldbl
$INSTALL_PACKAGES
memcached php-memcached php-intl exiftool libfcgi0ldbl
function_check install_nodejs
function_check install_nodejs
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-webadmin
+
28
−
2
View file @
86c6ebc5
...
@@ -31,6 +31,8 @@
...
@@ -31,6 +31,8 @@
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
<http:
//
www.gnu.org
/
licenses
/>
.
# along with this program. If not, see
<http:
//
www.gnu.org
/
licenses
/>
.
WEBADMIN_LOGIN_TEXT=$"Welcome to ${PROJECT_NAME}"
function web_admin_configure_installer_daemon {
function web_admin_configure_installer_daemon {
if [ -f /etc/systemd/system/webadmin.service ]; then
if [ -f /etc/systemd/system/webadmin.service ]; then
return
return
...
@@ -451,11 +453,31 @@ function web_admin_onion_only {
...
@@ -451,11 +453,31 @@ function web_admin_onion_only {
}
}
function web_admin_setup_login {
function web_admin_setup_login {
if [ ! -f /usr/bin/htpasswd ]; then
$INSTALL_PACKAGES apache2-utils
fi
read_config_param MY_USERNAME
read_config_param MY_USERNAME
webadmin_password=$("${PROJECT_NAME}-pass" -u "$MY_USERNAME" -a webadmin)
webadmin_password=$("${PROJECT_NAME}-pass" -u "$MY_USERNAME" -a webadmin)
if [ ! "$webadmin_password" ]; then
if [ ! "$webadmin_password" ]; then
webadmin_password="$(create_password "${MINIMUM_PASSWORD_LENGTH}")"
webadmin_password="$(create_password "${MINIMUM_PASSWORD_LENGTH}")"
"${PROJECT_NAME}-pass" -u "$MY_USERNAME" -a webadmin -p "$webadmin_password"
"${PROJECT_NAME}-pass" -u "$MY_USERNAME" -a webadmin -p "$webadmin_password"
# create a password for users
if [ ! -f /etc/nginx/.webadminpasswd ]; then
touch /etc/nginx/.webadminpasswd
fi
if grep -q "$MY_USERNAME:" /etc/nginx/.webadminpasswd; then
sed -i "/$MY_USERNAME:/d" /etc/nginx/.webadminpasswd
fi
echo -n "$webadmin_password" | htpasswd -i -s -c /etc/nginx/.webadminpasswd "$MY_USERNAME"
if [ ! -f /etc/nginx/.webadminpasswd ]; then
echo $'/etc/nginx/.webadminpasswd not found'
exit 5637653
fi
#echo -n "$webadmin_password" > "/var/www/${local_hostname}/htdocs/admin/initiallogin.txt"
fi
fi
}
}
...
@@ -463,8 +485,6 @@ function install_web_admin {
...
@@ -463,8 +485,6 @@ function install_web_admin {
# This is intended as an admin web user interface
# This is intended as an admin web user interface
# similar to Plinth or the yunohost
# similar to Plinth or the yunohost
web_admin_setup_login
language_subdir=$(web_admin_get_language_subdir)
language_subdir=$(web_admin_get_language_subdir)
local_hostname=$(grep 'host-name' /etc/avahi/avahi-daemon.conf | awk -F '=' '{print $2}').local
local_hostname=$(grep 'host-name' /etc/avahi/avahi-daemon.conf | awk -F '=' '{print $2}').local
...
@@ -513,6 +533,8 @@ function install_web_admin {
...
@@ -513,6 +533,8 @@ function install_web_admin {
echo ' error_log /dev/null;';
echo ' error_log /dev/null;';
echo '';
echo '';
echo ' location ^~ /admin {';
echo ' location ^~ /admin {';
echo " #auth_basic \"${WEBADMIN_LOGIN_TEXT}\";";
echo ' #auth_basic_user_file /etc/nginx/.webadminpasswd;';
echo " root /var/www/${local_hostname}/htdocs;";
echo " root /var/www/${local_hostname}/htdocs;";
echo ' index index.html;';
echo ' index index.html;';
echo " error_page 405 = \$uri;";
echo " error_page 405 = \$uri;";
...
@@ -554,6 +576,8 @@ function install_web_admin {
...
@@ -554,6 +576,8 @@ function install_web_admin {
{ echo ' add_header Strict-Transport-Security max-age=0;';
{ echo ' add_header Strict-Transport-Security max-age=0;';
echo '';
echo '';
echo ' location ^~ /admin {';
echo ' location ^~ /admin {';
echo " #auth_basic \"${WEBADMIN_LOGIN_TEXT}\";";
echo ' #auth_basic_user_file /etc/nginx/.webadminpasswd;';
echo " root /var/www/${local_hostname}/htdocs;";
echo " root /var/www/${local_hostname}/htdocs;";
echo ' index index.html;';
echo ' index index.html;';
echo " error_page 405 = \$uri;";
echo " error_page 405 = \$uri;";
...
@@ -602,6 +626,8 @@ function install_web_admin {
...
@@ -602,6 +626,8 @@ function install_web_admin {
# make the list of apps
# make the list of apps
web_admin_create_installed_apps
web_admin_create_installed_apps
web_admin_setup_login
chown -R www-data:www-data "/var/www/${local_hostname}/htdocs"
chown -R www-data:www-data "/var/www/${local_hostname}/htdocs"
web_admin_avahi
web_admin_avahi
...
...
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