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
f3dc531b
Commit
f3dc531b
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Standard domain name
parent
7fefb18b
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-turtl
+53
-53
53 additions, 53 deletions
src/freedombone-app-turtl
with
53 additions
and
53 deletions
src/freedombone-app-turtl
+
53
−
53
View file @
f3dc531b
...
...
@@ -36,20 +36,20 @@ VARIANTS="full full-vim writer"
IN_DEFAULT_INSTALL
=
0
SHOW_ON_ABOUT
=
1
TURTL_
API_
DOMAIN_NAME
=
TURTL_
API_
CODE
=
TURTL_
API_
ONION_PORT
=
8107
TURTL_DOMAIN_NAME
=
TURTL_CODE
=
TURTL_ONION_PORT
=
8107
TURTL_PORT
=
8181
TURTL_
API_
REPO
=
"https://github.com/turtl/api.git"
TURTL_
API_
COMMIT
=
'53e00a5583f52de8f86ef380fe11c176b5738dcf'
TURTL_REPO
=
"https://github.com/turtl/api.git"
TURTL_COMMIT
=
'53e00a5583f52de8f86ef380fe11c176b5738dcf'
TURTL_ADMIN_PASSWORD
=
TURTL_STORAGE_LIMIT_MB
=
100
TURTL_BASE_DIR
=
/etc/turtl
turtl_variables
=(
ONION_ONLY
DEFAULT_DOMAIN_NAME
TURTL_
API_
DOMAIN_NAME
TURTL_
API_
CODE
TURTL_DOMAIN_NAME
TURTL_CODE
TURTL_STORAGE_LIMIT_MB
DDNS_PROVIDER
MY_EMAIL_ADDRESS
...
...
@@ -76,11 +76,11 @@ function install_interactive_turtl {
fi
if
[[
$ONION_ONLY
!=
"no"
]]
;
then
TURTL_
API_
DOMAIN_NAME
=
'notes.local'
write_config_param
"TURTL_
API_
DOMAIN_NAME"
"
$TURTL_
API_
DOMAIN_NAME
"
TURTL_DOMAIN_NAME
=
'notes.local'
write_config_param
"TURTL_DOMAIN_NAME"
"
$TURTL_DOMAIN_NAME
"
else
function_check interactive_site_details
interactive_site_details
"turtl"
"TURTL_
API_
DOMAIN_NAME"
"TURTL_
API_
CODE"
interactive_site_details
"turtl"
"TURTL_DOMAIN_NAME"
"TURTL_CODE"
fi
APP_INSTALLED
=
1
}
...
...
@@ -114,22 +114,22 @@ function reconfigure_turtl {
}
function
upgrade_turtl
{
read_config_param
"TURTL_
API_
DOMAIN_NAME"
read_config_param
"TURTL_DOMAIN_NAME"
function_check set_repo_commit
set_repo_commit
$TURTL_BASE_DIR
/api
"turtl
api
commit"
"
$TURTL_
API_
COMMIT
"
$TURTL_
API_
REPO
nginx_dissite
$TURTL_
API_
DOMAIN_NAME
set_repo_commit
$TURTL_BASE_DIR
/api
"turtl commit"
"
$TURTL_COMMIT
"
$TURTL_REPO
nginx_dissite
$TURTL_DOMAIN_NAME
chown
-R
turtl:turtl
$TURTL_BASE_DIR
nginx_ensite
$TURTL_
API_
DOMAIN_NAME
nginx_ensite
$TURTL_DOMAIN_NAME
}
function
backup_local_turtl
{
read_config_param
"TURTL_
API_
DOMAIN_NAME"
read_config_param
"TURTL_DOMAIN_NAME"
source_directory
=
$TURTL_BASE_DIR
if
[
-d
$source_directory
]
;
then
dest_directory
=
turtl
function_check suspend_site
suspend_site
${
TURTL_
API_
DOMAIN_NAME
}
suspend_site
${
TURTL_DOMAIN_NAME
}
function_check backup_directory_to_usb
backup_directory_to_usb
$source_directory
$dest_directory
...
...
@@ -141,7 +141,7 @@ function backup_local_turtl {
if
[
-d
$source_directory
]
;
then
dest_directory
=
rethinkdb
function_check suspend_site
suspend_site
${
TURTL_
API_
DOMAIN_NAME
}
suspend_site
${
TURTL_DOMAIN_NAME
}
function_check backup_directory_to_usb
backup_directory_to_usb
$source_directory
$dest_directory
...
...
@@ -152,8 +152,8 @@ function backup_local_turtl {
}
function
restore_local_turtl
{
read_config_param
"TURTL_
API_
DOMAIN_NAME"
if
[
$TURTL_
API_
DOMAIN_NAME
]
;
then
read_config_param
"TURTL_DOMAIN_NAME"
if
[
$TURTL_DOMAIN_NAME
]
;
then
temp_restore_dir
=
/root/tempturtl
restore_directory_from_usb
$temp_restore_dir
turtl
if
[
-d
$TURTL_BASE_DIR
]
;
then
...
...
@@ -198,8 +198,8 @@ function restore_local_turtl {
}
function
backup_remote_turtl
{
read_config_param
"TURTL_
API_
DOMAIN_NAME"
if
[
$TURTL_
API_
DOMAIN_NAME
]
;
then
read_config_param
"TURTL_DOMAIN_NAME"
if
[
$TURTL_DOMAIN_NAME
]
;
then
temp_backup_dir
=
$TURTL_BASE_DIR
if
[
-d
$temp_backup_dir
]
;
then
echo
$"Backing up turtl"
...
...
@@ -220,8 +220,8 @@ function backup_remote_turtl {
}
function
restore_remote_turtl
{
read_config_param
"TURTL_
API_
DOMAIN_NAME"
if
[
$TURTL_
API_
DOMAIN_NAME
]
;
then
read_config_param
"TURTL_DOMAIN_NAME"
if
[
$TURTL_DOMAIN_NAME
]
;
then
temp_restore_dir
=
/root/tempturtl
mkdir
$temp_restore_dir
function_check restore_directory_from_friend
...
...
@@ -276,15 +276,15 @@ function remove_turtl {
remove_completion_param install_turtl
sed
-i
'/turtl/d'
$COMPLETION_FILE
deluser turtl
nginx_dissite
$TURTL_
API_
DOMAIN_NAME
if
[
-f
/etc/nginx/sites-available/
$TURTL_
API_
DOMAIN_NAME
]
;
then
rm
/etc/nginx/sites-available/
$TURTL_
API_
DOMAIN_NAME
nginx_dissite
$TURTL_DOMAIN_NAME
if
[
-f
/etc/nginx/sites-available/
$TURTL_DOMAIN_NAME
]
;
then
rm
/etc/nginx/sites-available/
$TURTL_DOMAIN_NAME
fi
remove_certs
$TURTL_
API_
DOMAIN_NAME
remove_certs
$TURTL_DOMAIN_NAME
function_check remove_onion_service
remove_onion_service turtlapi
${
TURTL_
API_
ONION_PORT
}
remove_onion_service turtlapi
${
TURTL_ONION_PORT
}
function_check remove_ddns_domain
remove_ddns_domain
$TURTL_
API_
DOMAIN_NAME
remove_ddns_domain
$TURTL_DOMAIN_NAME
rm
-rf
/etc/rethinkdb
rm
-rf
/var/lib/rethinkdb
rm
-rf
$TURTL_BASE_DIR
...
...
@@ -297,11 +297,11 @@ function turtl_setup {
BINDPORT
=
${
BINDPORT
:-
8181
}
PROD_ERR_HANDLING
=
${
PROD_ERR_HANDLING
:-
t
}
if
[[
$ONION_ONLY
==
'no'
]]
;
then
FQDN
=
${
FQDN
:-
$TURTL_
API_
DOMAIN_NAME
}
SITE_URL
=
${
SITE_URL
:-
https
://
$TURTL_
API_
DOMAIN_NAME
}
FQDN
=
${
FQDN
:-
$TURTL_DOMAIN_NAME
}
SITE_URL
=
${
SITE_URL
:-
https
://
$TURTL_DOMAIN_NAME
}
else
FQDN
=
${
FQDN
:-
$TURTL_
API_
ONION_HOSTNAME
}
SITE_URL
=
${
SITE_URL
:-
http
://
$TURTL_
API_
ONION_HOSTNAME
}
FQDN
=
${
FQDN
:-
$TURTL_ONION_HOSTNAME
}
SITE_URL
=
${
SITE_URL
:-
http
://
$TURTL_ONION_HOSTNAME
}
fi
ADMIN_EMAIL
=
${
ADMIN_EMAIL
:-
$MY_USERNAME
@
$DEFAULT_DOMAIN_NAME
}
EMAIL_FROM
=
${
EMAIL_FROM
:-
noreply
@
$DEFAULT_DOMAIN_NAME
}
...
...
@@ -311,9 +311,9 @@ function turtl_setup {
DEFAULT_STORAGE_LIMIT
=
${
DEFAULT_STORAGE_LIMIT
:-
100
}
STORAGE_INVITE_CREDIT
=
${
STORAGE_INVITE_CREDIT
:-
25
}
if
[[
$ONION_ONLY
==
'no'
]]
;
then
LOCAL_UPLOAD_URL
=
${
LOCAL_UPLOAD_URL
:-
https
://
$TURTL_
API_
DOMAIN_NAME
}
LOCAL_UPLOAD_URL
=
${
LOCAL_UPLOAD_URL
:-
https
://
$TURTL_DOMAIN_NAME
}
else
LOCAL_UPLOAD_URL
=
${
LOCAL_UPLOAD_URL
:-
http
://
$TURTL_
API_
ONION_HOSTNAME
}
LOCAL_UPLOAD_URL
=
${
LOCAL_UPLOAD_URL
:-
http
://
$TURTL_ONION_HOSTNAME
}
fi
LOCAL_UPLOAD_PATH
=
${
LOCAL_UPLOAD_PATH
:-
"
$TURTL_BASE_DIR
/data"
}
AWS_S3_TOKEN
=
${
AWS_S3_TOKEN
:-
(
:token
''
...
...
@@ -501,10 +501,10 @@ __ENDCONFIG__
# install turtl API
cd
$TURTL_BASE_DIR
/
git clone
$TURTL_
API_
REPO
$TURTL_BASE_DIR
/api
git clone
$TURTL_REPO
$TURTL_BASE_DIR
/api
cd
$TURTL_BASE_DIR
/api
git checkout
$TURTL_
API_
COMMIT
-b
$TURTL_
API_
COMMIT
set_completion_param
"turtl
api
commit"
"
$TURTL_
API_
COMMIT
"
git checkout
$TURTL_COMMIT
-b
$TURTL_COMMIT
set_completion_param
"turtl commit"
"
$TURTL_COMMIT
"
cd
$TURTL_BASE_DIR
/quicklisp/local-projects
git clone git://github.com/orthecreedence/cl-hash-util
if
[[
"
$check_architecture
"
!=
*
"arm"
*
]]
;
then
...
...
@@ -538,27 +538,27 @@ __ENDCONFIG__
echo
"(pushnew
\"
./
\"
asdf:*central-registry* :test #'equal)"
>>
$TURTL_BASE_DIR
/api/launch.lisp
echo
'(load "start")'
>>
$TURTL_BASE_DIR
/api/launch.lisp
TURTL_
API_
ONION_HOSTNAME
=
$(
add_onion_service turtlapi 80
${
TURTL_
API_
ONION_PORT
}
)
TURTL_ONION_HOSTNAME
=
$(
add_onion_service turtlapi 80
${
TURTL_ONION_PORT
}
)
turtl_setup
}
function
install_turtl_nginx
{
turtl_nginx_site
=
/etc/nginx/sites-available/
$TURTL_
API_
DOMAIN_NAME
turtl_nginx_site
=
/etc/nginx/sites-available/
$TURTL_DOMAIN_NAME
if
[[
$ONION_ONLY
==
"no"
]]
;
then
function_check nginx_http_redirect
nginx_http_redirect
$TURTL_
API_
DOMAIN_NAME
nginx_http_redirect
$TURTL_DOMAIN_NAME
echo
'server {'
>>
$turtl_nginx_site
echo
' listen 443 ssl;'
>>
$turtl_nginx_site
echo
' listen [::]:443 ssl;'
>>
$turtl_nginx_site
echo
" server_name
${
TURTL_
API_
DOMAIN_NAME
}
;"
>>
$turtl_nginx_site
echo
" server_name
${
TURTL_DOMAIN_NAME
}
;"
>>
$turtl_nginx_site
echo
''
>>
$turtl_nginx_site
echo
' # Security'
>>
$turtl_nginx_site
function_check nginx_ssl
nginx_ssl
$TURTL_
API_
DOMAIN_NAME
nginx_ssl
$TURTL_DOMAIN_NAME
function_check nginx_disable_sniffing
nginx_disable_sniffing
$TURTL_
API_
DOMAIN_NAME
nginx_disable_sniffing
$TURTL_DOMAIN_NAME
echo
' add_header Strict-Transport-Security max-age=15768000;'
>>
$turtl_nginx_site
echo
''
>>
$turtl_nginx_site
...
...
@@ -568,7 +568,7 @@ function install_turtl_nginx {
echo
''
>>
$turtl_nginx_site
echo
' location / {'
>>
$turtl_nginx_site
function_check nginx_limits
nginx_limits
$TURTL_
API_
DOMAIN_NAME
'15m'
nginx_limits
$TURTL_DOMAIN_NAME
'15m'
echo
" proxy_pass http://localhost:
${
TURTL_PORT
}
/;"
>>
$turtl_nginx_site
echo
' proxy_set_header Host $host;'
>>
$turtl_nginx_site
echo
' proxy_buffering off;'
>>
$turtl_nginx_site
...
...
@@ -578,11 +578,11 @@ function install_turtl_nginx {
echo
-n
''
>
$turtl_nginx_site
fi
echo
'server {'
>>
$turtl_nginx_site
echo
" listen 127.0.0.1:
${
TURTL_
API_
ONION_PORT
}
;"
>>
$turtl_nginx_site
echo
" server_name
${
TURTL_
API_
ONION_HOSTNAME
}
;"
>>
$turtl_nginx_site
echo
" listen 127.0.0.1:
${
TURTL_ONION_PORT
}
;"
>>
$turtl_nginx_site
echo
" server_name
${
TURTL_ONION_HOSTNAME
}
;"
>>
$turtl_nginx_site
echo
''
>>
$turtl_nginx_site
function_check nginx_disable_sniffing
nginx_disable_sniffing
$TURTL_
API_
DOMAIN_NAME
nginx_disable_sniffing
$TURTL_DOMAIN_NAME
echo
''
>>
$turtl_nginx_site
echo
' # Logs'
>>
$turtl_nginx_site
echo
' access_log /dev/null;'
>>
$turtl_nginx_site
...
...
@@ -590,7 +590,7 @@ function install_turtl_nginx {
echo
''
>>
$turtl_nginx_site
echo
' location / {'
>>
$turtl_nginx_site
function_check nginx_limits
nginx_limits
$TURTL_
API_
DOMAIN_NAME
'15m'
nginx_limits
$TURTL_DOMAIN_NAME
'15m'
echo
" proxy_pass http://localhost:
${
TURTL_PORT
}
/;"
>>
$turtl_nginx_site
echo
' proxy_set_header Host $host;'
>>
$turtl_nginx_site
echo
' proxy_buffering off;'
>>
$turtl_nginx_site
...
...
@@ -598,15 +598,15 @@ function install_turtl_nginx {
echo
'}'
>>
$turtl_nginx_site
function_check add_ddns_domain
add_ddns_domain
$TURTL_
API_
DOMAIN_NAME
add_ddns_domain
$TURTL_DOMAIN_NAME
set_completion_param
"turtl
api
domain"
"
$TURTL_
API_
DOMAIN_NAME
"
set_completion_param
"turtl domain"
"
$TURTL_DOMAIN_NAME
"
function_check create_site_certificate
create_site_certificate
$TURTL_
API_
DOMAIN_NAME
'yes'
create_site_certificate
$TURTL_DOMAIN_NAME
'yes'
function_check nginx_ensite
nginx_ensite
$TURTL_
API_
DOMAIN_NAME
nginx_ensite
$TURTL_DOMAIN_NAME
systemctl restart nginx
}
...
...
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