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
1b9422c5
Commit
1b9422c5
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Separate static content directory
parent
1583df53
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-app-etesync
+32
-2
32 additions, 2 deletions
src/freedombone-app-etesync
with
32 additions
and
2 deletions
src/freedombone-app-etesync
+
32
−
2
View file @
1b9422c5
...
@@ -154,6 +154,7 @@ function upgrade_etesync {
...
@@ -154,6 +154,7 @@ function upgrade_etesync {
pip3
install
-U
-r
requirements.txt uwsgi
pip3
install
-U
-r
requirements.txt uwsgi
python3 manage.py migrate
python3 manage.py migrate
chown
-R
etesync:etesync /etc/etesync
chown
-R
etesync:etesync /etc/etesync
chown
-R
www-data:www-data
"/var/www/
$ETESYNC_DOMAIN_NAME
/htdocs"
systemctl restart etesync
systemctl restart etesync
}
}
...
@@ -163,15 +164,18 @@ function backup_local_etesync {
...
@@ -163,15 +164,18 @@ function backup_local_etesync {
ETESYNC_DOMAIN_NAME
=
$(
get_completion_param
"etesync domain"
)
ETESYNC_DOMAIN_NAME
=
$(
get_completion_param
"etesync domain"
)
fi
fi
source_directory
=
/etc/etesync
suspend_site
"
${
ETESYNC_DOMAIN_NAME
}
"
suspend_site
"
${
ETESYNC_DOMAIN_NAME
}
"
systemctl stop etesync
systemctl stop etesync
source_directory
=
/etc/etesync
dest_directory
=
etesync
dest_directory
=
etesync
backup_directory_to_usb
"
$source_directory
"
$dest_directory
backup_directory_to_usb
"
$source_directory
"
$dest_directory
source_directory
=
"/var/www/
$ETESYNC_DOMAIN_NAME
/htdocs"
dest_directory
=
etesyncstatic
backup_directory_to_usb
"
$source_directory
"
$dest_directory
restart_site
restart_site
systemctl start etesync
systemctl start etesync
}
}
...
@@ -203,6 +207,24 @@ function restore_local_etesync {
...
@@ -203,6 +207,24 @@ function restore_local_etesync {
chown
-R
etesync:etesync
"
$etesync_dir
"
chown
-R
etesync:etesync
"
$etesync_dir
"
rm
-rf
$temp_restore_dir
rm
-rf
$temp_restore_dir
fi
fi
temp_restore_dir
=
/root/tempetesyncstatic
etesync_dir
=
"/var/www/
$ETESYNC_DOMAIN_NAME
/htdocs"
restore_directory_from_usb
$temp_restore_dir
etesync
if
[
-d
$temp_restore_dir
]
;
then
if
[
-d
"
$temp_restore_dir$etesync_dir
"
]
;
then
cp
-rp
"
$temp_restore_dir$etesync_dir
"
/
*
"
$etesync_dir
"
/
else
if
[
!
-d
"
$etesync_dir
"
]
;
then
mkdir
"
$etesync_dir
"
fi
cp
-rp
"
$temp_restore_dir
"
/
*
"
$etesync_dir
"
/
fi
chown
-R
www-data:www-data
"
$etesync_dir
"
rm
-rf
$temp_restore_dir
fi
systemctl start etesync
systemctl start etesync
restart_site
restart_site
...
@@ -317,6 +339,8 @@ function install_etesync {
...
@@ -317,6 +339,8 @@ function install_etesync {
sed
-i
"s|ALLOWED_HOSTS =.*|ALLOWED_HOSTS = [ '
${
ETESYNC_DOMAIN_NAME
}
', '
${
ETESYNC_ONION_HOSTNAME
}
' ]|g"
/etc/etesync/etesync_server/settings.py
sed
-i
"s|ALLOWED_HOSTS =.*|ALLOWED_HOSTS = [ '
${
ETESYNC_DOMAIN_NAME
}
', '
${
ETESYNC_ONION_HOSTNAME
}
' ]|g"
/etc/etesync/etesync_server/settings.py
sed
-i
"s|STATIC_ROOT =.*|STATIC_ROOT = os.environ.get('DJANGO_STATICS','/var/www/
$ETESYNC_DOMAIN_NAME
/htdocs')|g"
/etc/etesync/etesync_server/settings.py
pip3
install
-r
requirements.txt uwsgi
pip3
install
-r
requirements.txt uwsgi
python3 manage.py migrate
python3 manage.py migrate
...
@@ -398,6 +422,9 @@ function install_etesync {
...
@@ -398,6 +422,9 @@ function install_etesync {
echo
'WorkingDirectory=/etc/etesync'
;
echo
'WorkingDirectory=/etc/etesync'
;
echo
"ExecStart=/usr/bin/python3 /etc/etesync/manage.py runserver localhost:
${
ETESYNC_PORT_INTERNAL
}
"
;
echo
"ExecStart=/usr/bin/python3 /etc/etesync/manage.py runserver localhost:
${
ETESYNC_PORT_INTERNAL
}
"
;
echo
'Environment=USER=etesync'
;
echo
'Environment=USER=etesync'
;
echo
"Environment=DJANGO_STATICS=/var/www/
$ETESYNC_DOMAIN_NAME
/htdocs"
;
echo
"Environment=DJANGO_PORT=
${
ETESYNC_PORT_INTERNAL
}
"
;
echo
'Environment=SERVER="standalone"'
;
echo
'Restart=always'
;
echo
'Restart=always'
;
echo
'StandardError=syslog'
;
echo
'StandardError=syslog'
;
echo
''
;
echo
''
;
...
@@ -417,6 +444,9 @@ function install_etesync {
...
@@ -417,6 +444,9 @@ function install_etesync {
cd
"/etc/etesync"
||
exit
3463754637
cd
"/etc/etesync"
||
exit
3463754637
python3 /etc/etesync/manage.py collectstatic
--no-input
chown
-R
www-data:www-data
"/var/www/
$ETESYNC_DOMAIN_NAME
/htdocs"
echo
"from django.contrib.auth.models import User; User.objects.create_superuser('
$MY_USERNAME
', '
$MY_EMAIL_ADDRESS
', '
$ETESYNC_ADMIN_PASSWORD
')"
| python3 manage.py shell
echo
"from django.contrib.auth.models import User; User.objects.create_superuser('
$MY_USERNAME
', '
$MY_EMAIL_ADDRESS
', '
$ETESYNC_ADMIN_PASSWORD
')"
| python3 manage.py shell
"
${
PROJECT_NAME
}
-pass"
-u
"
$MY_USERNAME
"
-a
etesync
-p
"
$ETESYNC_ADMIN_PASSWORD
"
"
${
PROJECT_NAME
}
-pass"
-u
"
$MY_USERNAME
"
-a
etesync
-p
"
$ETESYNC_ADMIN_PASSWORD
"
...
...
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