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
7d782933
Commit
7d782933
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Ability to initiate an upgrade from webadmin
parent
50e79ed4
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/freedombone-installer
+24
-0
24 additions, 0 deletions
src/freedombone-installer
webadmin/EN/reset.html
+1
-0
1 addition, 0 deletions
webadmin/EN/reset.html
webadmin/EN/upgrade.html
+77
-0
77 additions, 0 deletions
webadmin/EN/upgrade.html
webadmin/reset.php
+10
-2
10 additions, 2 deletions
webadmin/reset.php
with
112 additions
and
2 deletions
src/freedombone-installer
+
24
−
0
View file @
7d782933
...
@@ -52,6 +52,7 @@ FIREWALL_DOMAINS=/root/${PROJECT_NAME}-firewall-domains.cfg
...
@@ -52,6 +52,7 @@ FIREWALL_DOMAINS=/root/${PROJECT_NAME}-firewall-domains.cfg
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
webadmin_install_dir
=
"/var/www/
${
local_hostname
}
/htdocs/admin"
webadmin_install_dir
=
"/var/www/
${
local_hostname
}
/htdocs/admin"
upgrade_file
=
"
$webadmin_install_dir
/.upgrade.txt"
language_file
=
"
$webadmin_install_dir
/.language.txt"
language_file
=
"
$webadmin_install_dir
/.language.txt"
system_monitor_file
=
"
$webadmin_install_dir
/.system_monitor.txt"
system_monitor_file
=
"
$webadmin_install_dir
/.system_monitor.txt"
dynamic_dns_file
=
"
$webadmin_install_dir
/.dynamicdns.txt"
dynamic_dns_file
=
"
$webadmin_install_dir
/.dynamicdns.txt"
...
@@ -75,6 +76,7 @@ installer_script=/root/.fbone_installer.sh
...
@@ -75,6 +76,7 @@ installer_script=/root/.fbone_installer.sh
webadmin_prev_hour
=
99
webadmin_prev_hour
=
99
# temporary backup and restore scripts
# temporary backup and restore scripts
upgrade_script
=
/root/.webadmin_upgrade.sh
backup_script
=
/root/.webadmin_backup.sh
backup_script
=
/root/.webadmin_backup.sh
backup_keys_script
=
/root/.webadmin_backup_keys.sh
backup_keys_script
=
/root/.webadmin_backup_keys.sh
restore_script
=
/root/.webadmin_restore.sh
restore_script
=
/root/.webadmin_restore.sh
...
@@ -574,6 +576,7 @@ function check_for_existing_processes {
...
@@ -574,6 +576,7 @@ function check_for_existing_processes {
echo
'}'
;
echo
'}'
;
echo
''
;
echo
''
;
echo
'exit_if_process_is_running fbone_installer.sh'
;
echo
'exit_if_process_is_running fbone_installer.sh'
;
echo
'exit_if_process_is_running webadmin_upgrade.sh'
;
echo
'exit_if_process_is_running webadmin_format.sh'
;
echo
'exit_if_process_is_running webadmin_format.sh'
;
echo
'exit_if_process_is_running webadmin_backup.sh'
;
echo
'exit_if_process_is_running webadmin_backup.sh'
;
echo
'exit_if_process_is_running webadmin_backup_keys.sh'
;
echo
'exit_if_process_is_running webadmin_backup_keys.sh'
;
...
@@ -1288,6 +1291,26 @@ function webadmin_change_password {
...
@@ -1288,6 +1291,26 @@ function webadmin_change_password {
rm
"
$change_password_file
"
rm
"
$change_password_file
"
}
}
function
webadmin_upgrade
{
if
[
-f
"
$upgrade_file
"
]
;
then
rm
"
$upgrade_file
"
check_for_existing_processes
$upgrade_script
{
echo
"echo
\"
Beginning webadmin upgrade
\$
(date)
\"
>
$webadmin_install_dir
/upgrade.txt"
;
echo
"chown www-data:www-data
$webadmin_install_dir
/upgrade.txt"
;
echo
''
;
echo
"/usr/local/bin/
${
PROJECT_NAME
}
-upgrade >>
$webadmin_install_dir
/upgrade.txt"
;
echo
''
;
echo
"chown www-data:www-data
$webadmin_install_dir
/upgrade.txt"
;
echo
''
;
echo
"exit 0"
;
}
>>
$upgrade_script
chmod
+x
$upgrade_script
# run in a separate process
./
$upgrade_script
&
fi
}
function
reset_shutdown
{
function
reset_shutdown
{
if
[
-f
"
$shutdown_file
"
]
;
then
if
[
-f
"
$shutdown_file
"
]
;
then
rm
"
$shutdown_file
"
rm
"
$shutdown_file
"
...
@@ -1620,6 +1643,7 @@ do
...
@@ -1620,6 +1643,7 @@ do
backup_and_restore
backup_and_restore
backup_and_restore_keys
backup_and_restore_keys
add_remove_users
add_remove_users
webadmin_upgrade
install_apps_from_webadmin
install_apps_from_webadmin
sleep
1
sleep
1
remove_apps_from_webadmin
remove_apps_from_webadmin
...
...
This diff is collapsed.
Click to expand it.
webadmin/EN/reset.html
+
1
−
0
View file @
7d782933
...
@@ -76,6 +76,7 @@
...
@@ -76,6 +76,7 @@
<br><br>
<br><br>
<form
action=
"reset.php"
method=
"post"
>
<form
action=
"reset.php"
method=
"post"
>
<input
type=
"submit"
name=
"submitupgrade"
value=
"Upgrade"
/><br><br>
<input
type=
"submit"
name=
"submitshutdown"
value=
"Shutdown"
/><br><br>
<input
type=
"submit"
name=
"submitshutdown"
value=
"Shutdown"
/><br><br>
<input
type=
"submit"
name=
"submitreset"
value=
"Reset"
/><br><br>
<input
type=
"submit"
name=
"submitreset"
value=
"Reset"
/><br><br>
<input
type=
"submit"
name=
"submitresetcancel"
value=
"Cancel"
/>
<input
type=
"submit"
name=
"submitresetcancel"
value=
"Cancel"
/>
...
...
This diff is collapsed.
Click to expand it.
webadmin/EN/upgrade.html
0 → 100644
+
77
−
0
View file @
7d782933
<!DOCTYPE html>
<html>
<head>
<style>
#headerpic
{
width
:
60%
;
height
:
auto
;
margin-right
:
auto
;
margin-left
:
auto
;
min-width
:
220px
;
}
.header
{
text-align
:
center
;
padding
:
32px
;
}
#iconpic
{
width
:
20%
;
height
:
auto
;
margin-right
:
auto
;
margin-left
:
auto
;
min-width
:
120px
;
}
.appurl
{
color
:
grey
;
font-size
:
100%
;
}
.appdesc
{
color
:
black
;
font-size
:
65%
;
}
button
{
border
:
none
;
outline
:
0
;
display
:
inline-block
;
padding
:
8px
;
color
:
white
;
background-color
:
#000
;
text-align
:
center
;
cursor
:
pointer
;
width
:
100%
;
font-size
:
18px
;
}
a
{
text-decoration
:
none
;
color
:
black
;
}
button
:hover
,
a
:hover
{
opacity
:
0.7
;
}
</style>
</head>
<body>
<div
class=
"header"
>
<a
href=
"index.html"
><img
id=
"headerpic"
class=
"img-responsive"
src=
"images/logo.png"
></a>
<h3>
An upgrade is scheduled
</h3>
<h3>
Systems may be temporarily unavailable in the next few minutes
</h3>
<p>
Upgrades happen automatically. You don't need to start them manually like this, except in rare circumstances.
</p>
<br>
<form
action=
"index.html"
>
<input
type=
"submit"
value=
"Go Back"
/>
</form>
</div>
</body>
</html>
This diff is collapsed.
Click to expand it.
webadmin/reset.php
+
10
−
2
View file @
7d782933
...
@@ -4,8 +4,16 @@
...
@@ -4,8 +4,16 @@
$output_filename
=
"settings.html"
;
$output_filename
=
"settings.html"
;
if
(
isset
(
$_POST
[
'submitupgrade'
]))
{
$reset_file
=
fopen
(
".upgrade.txt"
,
"w"
)
or
die
(
"Unable to write to upgrade file"
);
fwrite
(
$reset_file
,
"upgrade"
);
fclose
(
$reset_file
);
$output_filename
=
"upgrade.html"
;
}
if
(
isset
(
$_POST
[
'submitreset'
]))
{
if
(
isset
(
$_POST
[
'submitreset'
]))
{
$reset_file
=
fopen
(
".reset.txt"
,
"w"
)
or
die
(
"Unable to write to
domain
file"
);
$reset_file
=
fopen
(
".reset.txt"
,
"w"
)
or
die
(
"Unable to write to
reset
file"
);
fwrite
(
$reset_file
,
"reset"
);
fwrite
(
$reset_file
,
"reset"
);
fclose
(
$reset_file
);
fclose
(
$reset_file
);
...
@@ -13,7 +21,7 @@ if (isset($_POST['submitreset'])) {
...
@@ -13,7 +21,7 @@ if (isset($_POST['submitreset'])) {
}
}
if
(
isset
(
$_POST
[
'submitshutdown'
]))
{
if
(
isset
(
$_POST
[
'submitshutdown'
]))
{
$shutdown_file
=
fopen
(
".shutdown.txt"
,
"w"
)
or
die
(
"Unable to write to
domai
n file"
);
$shutdown_file
=
fopen
(
".shutdown.txt"
,
"w"
)
or
die
(
"Unable to write to
shutdow
n file"
);
fwrite
(
$shutdown_file
,
"shutdown"
);
fwrite
(
$shutdown_file
,
"shutdown"
);
fclose
(
$shutdown_file
);
fclose
(
$shutdown_file
);
...
...
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