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
989c48f8
Commit
989c48f8
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Switch from git to gogs to maintain consistency
parent
795f216d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/freedombone-app-gogs
+54
-55
54 additions, 55 deletions
src/freedombone-app-gogs
src/freedombone-config
+2
-2
2 additions, 2 deletions
src/freedombone-config
src/freedombone-utils-onion
+2
-2
2 additions, 2 deletions
src/freedombone-utils-onion
with
58 additions
and
59 deletions
src/freedombone-app-gogs
+
54
−
55
View file @
989c48f8
...
...
@@ -34,8 +34,8 @@ SHOW_ON_ABOUT=1
GOGS_USERNAME
=
'gogs'
GOGS_VERSION
=
'0.11.29'
G
IT
_DOMAIN_NAME
=
G
IT
_CODE
=
G
OGS
_DOMAIN_NAME
=
G
OGS
_CODE
=
GIT_ONION_PORT
=
8090
GIT_ADMIN_PASSWORD
=
GOGS_BIN
=
...
...
@@ -47,9 +47,8 @@ GOGS_MOBILE_APP_URL=
gogs_variables
=(
ONION_ONLY
GIT_ADMIN_PASSWORD
GIT_DOMAIN_NAME
GIT_CODE
GIT_ONION_PORT
GOGS_DOMAIN_NAME
GOGS_CODE
MY_USERNAME
DDNS_PROVIDER
ARCHITECTURE
)
...
...
@@ -69,8 +68,8 @@ function change_password_gogs {
function
install_interactive_gogs
{
if
[[
$ONION_ONLY
!=
"no"
]]
;
then
G
IT
_DOMAIN_NAME
=
'gogs.local'
write_config_param
"G
IT
_DOMAIN_NAME"
"
$G
IT
_DOMAIN_NAME
"
G
OGS
_DOMAIN_NAME
=
'gogs.local'
write_config_param
"G
OGS
_DOMAIN_NAME"
"
$G
OGS
_DOMAIN_NAME
"
else
function_check interactive_site_details
interactive_site_details git
...
...
@@ -160,8 +159,8 @@ function upgrade_gogs {
# Change port number if necessary
if
!
grep
-q
"HTTP_PORT =
${
GOGS_PORT
}
"
"
${
GOGS_CONFIG_FILE
}
"
;
then
sed
-i
"s|HTTP_PORT =.*|HTTP_PORT =
${
GOGS_PORT
}
|g"
"
${
GOGS_CONFIG_FILE
}
"
read_config_param G
IT
_DOMAIN_NAME
sed
-i
"s|proxy_pass .*|proxy_pass http://localhost:
${
GOGS_PORT
}
;|g"
"/etc/nginx/sites-available/
${
G
IT
_DOMAIN_NAME
}
"
read_config_param G
OGS
_DOMAIN_NAME
sed
-i
"s|proxy_pass .*|proxy_pass http://localhost:
${
GOGS_PORT
}
;|g"
"/etc/nginx/sites-available/
${
G
OGS
_DOMAIN_NAME
}
"
systemctl restart gogs
systemctl restart nginx
fi
...
...
@@ -272,7 +271,7 @@ function restore_local_gogs {
return
fi
if
[
${#
G
IT
_DOMAIN_NAME
}
-gt
2
]
;
then
if
[
${#
G
OGS
_DOMAIN_NAME
}
-gt
2
]
;
then
function_check gogs_create_database
gogs_create_database
...
...
@@ -280,7 +279,7 @@ function restore_local_gogs {
GOGS_CONFIG_FILE
=
"
${
GOGS_CONFIG_PATH
}
/app.ini"
function_check restore_database
restore_database gogs
"
${
G
IT
_DOMAIN_NAME
}
"
restore_database gogs
"
${
G
OGS
_DOMAIN_NAME
}
"
temp_restore_dir
=
/root/tempgogs
if
[
-d
"
${
USB_MOUNT
}
/backup/gogs"
]
;
then
echo
$"Restoring Gogs settings"
...
...
@@ -354,7 +353,7 @@ function restore_local_gogs {
function
backup_remote_gogs
{
if
[
-d
/home/
$GOGS_USERNAME
]
;
then
function_check suspend_site
suspend_site
${
G
IT
_DOMAIN_NAME
}
suspend_site
${
G
OGS
_DOMAIN_NAME
}
function_check backup_database_to_friend
backup_database_to_friend gogs
...
...
@@ -383,7 +382,7 @@ function backup_remote_gogs {
function
restore_remote_gogs
{
if
grep
-q
"gogs domain"
"
$COMPLETION_FILE
"
;
then
G
IT
_DOMAIN_NAME
=
$(
get_completion_param
"gogs domain"
)
G
OGS
_DOMAIN_NAME
=
$(
get_completion_param
"gogs domain"
)
function_check gogs_create_database
gogs_create_database
...
...
@@ -392,7 +391,7 @@ function restore_remote_gogs {
GOGS_CONFIG_FILE
=
${
GOGS_CONFIG_PATH
}
/app.ini
function_check restore_database_from_friend
restore_database_from_friend gogs
"
${
G
IT
_DOMAIN_NAME
}
"
restore_database_from_friend gogs
"
${
G
OGS
_DOMAIN_NAME
}
"
if
[
-d
"
${
SERVER_DIRECTORY
}
/backup/gogs"
]
;
then
if
[
!
-d
$GOGS_CONFIG_PATH
]
;
then
mkdir
-p
$GOGS_CONFIG_PATH
...
...
@@ -449,19 +448,19 @@ function restore_remote_gogs {
}
function
remove_gogs
{
if
[
${#
G
IT
_DOMAIN_NAME
}
-eq
0
]
;
then
if
[
${#
G
OGS
_DOMAIN_NAME
}
-eq
0
]
;
then
return
fi
systemctl stop gogs
systemctl disable gogs
nginx_dissite
"
${
G
IT
_DOMAIN_NAME
}
"
remove_certs
"
${
G
IT
_DOMAIN_NAME
}
"
if
[
-d
"/var/www/
${
G
IT
_DOMAIN_NAME
}
"
]
;
then
rm
-rf
"/var/www/
${
G
IT
_DOMAIN_NAME
}
"
nginx_dissite
"
${
G
OGS
_DOMAIN_NAME
}
"
remove_certs
"
${
G
OGS
_DOMAIN_NAME
}
"
if
[
-d
"/var/www/
${
G
OGS
_DOMAIN_NAME
}
"
]
;
then
rm
-rf
"/var/www/
${
G
OGS
_DOMAIN_NAME
}
"
fi
if
[
-f
"/etc/nginx/sites-available/
${
G
IT
_DOMAIN_NAME
}
"
]
;
then
rm
"/etc/nginx/sites-available/
${
G
IT
_DOMAIN_NAME
}
"
if
[
-f
"/etc/nginx/sites-available/
${
G
OGS
_DOMAIN_NAME
}
"
]
;
then
rm
"/etc/nginx/sites-available/
${
G
OGS
_DOMAIN_NAME
}
"
fi
function_check drop_database
drop_database gogs
...
...
@@ -477,11 +476,11 @@ function remove_gogs {
userdel
-r
gogs
function_check remove_ddns_domain
remove_ddns_domain
"
$G
IT
_DOMAIN_NAME
"
remove_ddns_domain
"
$G
OGS
_DOMAIN_NAME
"
}
function
install_gogs
{
if
[
!
"
$G
IT
_DOMAIN_NAME
"
]
;
then
if
[
!
"
$G
OGS
_DOMAIN_NAME
"
]
;
then
return
fi
...
...
@@ -584,33 +583,33 @@ function install_gogs {
systemctl daemon-reload
systemctl start gogs
if
[
!
-d
"/var/www/
${
G
IT
_DOMAIN_NAME
}
"
]
;
then
mkdir
"/var/www/
${
G
IT
_DOMAIN_NAME
}
"
if
[
!
-d
"/var/www/
${
G
OGS
_DOMAIN_NAME
}
"
]
;
then
mkdir
"/var/www/
${
G
OGS
_DOMAIN_NAME
}
"
fi
if
[
-d
"/var/www/
${
G
IT
_DOMAIN_NAME
}
/htdocs"
]
;
then
rm
-rf
"/var/www/
${
G
IT
_DOMAIN_NAME
}
/htdocs"
if
[
-d
"/var/www/
${
G
OGS
_DOMAIN_NAME
}
/htdocs"
]
;
then
rm
-rf
"/var/www/
${
G
OGS
_DOMAIN_NAME
}
/htdocs"
fi
if
[[
"
${
ONION_ONLY
}
"
==
"no"
]]
;
then
function_check nginx_http_redirect
nginx_http_redirect
"
${
G
IT
_DOMAIN_NAME
}
"
nginx_http_redirect
"
${
G
OGS
_DOMAIN_NAME
}
"
{
echo
'server {'
;
echo
' listen 443 ssl;'
;
echo
' #listen [::]:443 ssl;'
;
echo
" root /var/www/
${
G
IT
_DOMAIN_NAME
}
/htdocs;"
;
echo
" server_name
${
G
IT
_DOMAIN_NAME
}
;"
;
echo
" root /var/www/
${
G
OGS
_DOMAIN_NAME
}
/htdocs;"
;
echo
" server_name
${
G
OGS
_DOMAIN_NAME
}
;"
;
echo
' access_log /dev/null;'
;
echo
" error_log /dev/null;"
;
echo
''
;
}
>>
"/etc/nginx/sites-available/
${
G
IT
_DOMAIN_NAME
}
"
echo
''
;
}
>>
"/etc/nginx/sites-available/
${
G
OGS
_DOMAIN_NAME
}
"
function_check nginx_ssl
nginx_ssl
"
${
G
IT
_DOMAIN_NAME
}
"
nginx_ssl
"
${
G
OGS
_DOMAIN_NAME
}
"
function_check nginx_security_options
nginx_security_options
"
${
G
IT
_DOMAIN_NAME
}
"
nginx_security_options
"
${
G
OGS
_DOMAIN_NAME
}
"
{
echo
' add_header Strict-Transport-Security max-age=0;'
;
echo
''
;
echo
' location / {'
;
}
>>
"/etc/nginx/sites-available/
${
G
IT
_DOMAIN_NAME
}
"
echo
' location / {'
;
}
>>
"/etc/nginx/sites-available/
${
G
OGS
_DOMAIN_NAME
}
"
function_check nginx_limits
nginx_limits
"
${
G
IT
_DOMAIN_NAME
}
"
'10G'
nginx_limits
"
${
G
OGS
_DOMAIN_NAME
}
"
'10G'
{
echo
" proxy_pass http://localhost:
${
GOGS_PORT
}
;"
;
echo
' }'
;
echo
''
;
...
...
@@ -625,24 +624,24 @@ function install_gogs {
echo
' access_log /dev/null;'
;
echo
' }'
;
echo
'}'
;
echo
''
;
}
>>
"/etc/nginx/sites-available/
${
G
IT
_DOMAIN_NAME
}
"
echo
''
;
}
>>
"/etc/nginx/sites-available/
${
G
OGS
_DOMAIN_NAME
}
"
else
echo
-n
''
>
"/etc/nginx/sites-available/
${
G
IT
_DOMAIN_NAME
}
"
echo
-n
''
>
"/etc/nginx/sites-available/
${
G
OGS
_DOMAIN_NAME
}
"
fi
{
echo
'server {'
;
echo
" listen 127.0.0.1:
${
GIT_ONION_PORT
}
default_server;"
;
echo
" root /var/www/
$G
IT
_DOMAIN_NAME
/htdocs;"
;
echo
" server_name
$G
IT
_DOMAIN_NAME
;"
;
echo
" root /var/www/
$G
OGS
_DOMAIN_NAME
/htdocs;"
;
echo
" server_name
$G
OGS
_DOMAIN_NAME
;"
;
echo
' access_log /dev/null;'
;
echo
" error_log /dev/null;"
;
echo
''
;
}
>>
"/etc/nginx/sites-available/
${
G
IT
_DOMAIN_NAME
}
"
echo
''
;
}
>>
"/etc/nginx/sites-available/
${
G
OGS
_DOMAIN_NAME
}
"
function_check nginx_security_options
nginx_security_options
"
${
G
IT
_DOMAIN_NAME
}
"
nginx_security_options
"
${
G
OGS
_DOMAIN_NAME
}
"
{
echo
' add_header Strict-Transport-Security max-age=0;'
;
echo
''
;
echo
' location / {'
;
}
>>
"/etc/nginx/sites-available/
${
G
IT
_DOMAIN_NAME
}
"
echo
' location / {'
;
}
>>
"/etc/nginx/sites-available/
${
G
OGS
_DOMAIN_NAME
}
"
function_check nginx_limits
nginx_limits
"
${
G
IT
_DOMAIN_NAME
}
"
'10G'
nginx_limits
"
${
G
OGS
_DOMAIN_NAME
}
"
'10G'
{
echo
" proxy_pass http://localhost:
${
GOGS_PORT
}
;"
;
echo
' }'
;
echo
''
;
...
...
@@ -656,15 +655,15 @@ function install_gogs {
echo
' log_not_found off;'
;
echo
' access_log /dev/null;'
;
echo
' }'
;
echo
'}'
;
}
>>
"/etc/nginx/sites-available/
${
G
IT
_DOMAIN_NAME
}
"
echo
'}'
;
}
>>
"/etc/nginx/sites-available/
${
G
OGS
_DOMAIN_NAME
}
"
function_check configure_php
configure_php
function_check create_site_certificate
create_site_certificate
"
${
G
IT
_DOMAIN_NAME
}
"
'yes'
create_site_certificate
"
${
G
OGS
_DOMAIN_NAME
}
"
'yes'
nginx_ensite
"
${
G
IT
_DOMAIN_NAME
}
"
nginx_ensite
"
${
G
OGS
_DOMAIN_NAME
}
"
if
[
!
-d
/var/lib/tor
]
;
then
echo
$'No Tor installation found. Gogs onion site cannot be configured.'
...
...
@@ -689,11 +688,11 @@ function install_gogs {
systemctl restart php7.0-fpm
systemctl restart nginx
set_completion_param
"gogs domain"
"
$G
IT
_DOMAIN_NAME
"
set_completion_param
"gogs domain"
"
$G
OGS
_DOMAIN_NAME
"
set_completion_param
"gogs onion domain"
"
$GIT_ONION_HOSTNAME
"
function_check add_ddns_domain
add_ddns_domain
"
${
G
IT
_DOMAIN_NAME
}
"
add_ddns_domain
"
${
G
OGS
_DOMAIN_NAME
}
"
# obtain the secret key
GOGS_SECRET_KEY
=
"
$(
create_password
"
${
MINIMUM_PASSWORD_LENGTH
}
"
)
"
...
...
@@ -722,17 +721,17 @@ function install_gogs {
echo
''
;
echo
'[server]'
;
}
>>
${
GOGS_CONFIG_FILE
}
if
[[
${
ONION_ONLY
}
==
'no'
]]
;
then
echo
"DOMAIN =
${
G
IT
_DOMAIN_NAME
}
"
>>
${
GOGS_CONFIG_FILE
}
echo
"ROOT_URL = https://
$G
IT
_DOMAIN_NAME
/"
>>
${
GOGS_CONFIG_FILE
}
echo
"DOMAIN =
${
G
OGS
_DOMAIN_NAME
}
"
>>
${
GOGS_CONFIG_FILE
}
echo
"ROOT_URL = https://
$G
OGS
_DOMAIN_NAME
/"
>>
${
GOGS_CONFIG_FILE
}
else
echo
"DOMAIN =
${
GIT_ONION_HOSTNAME
}
"
>>
${
GOGS_CONFIG_FILE
}
echo
"ROOT_URL = http://
$G
IT
_DOMAIN_NAME
/"
>>
${
GOGS_CONFIG_FILE
}
echo
"ROOT_URL = http://
$G
OGS
_DOMAIN_NAME
/"
>>
${
GOGS_CONFIG_FILE
}
fi
{
echo
"HTTP_PORT =
${
GOGS_PORT
}
"
;
echo
"SSH_PORT =
$SSH_PORT
"
;
echo
'SSH_DOMAIN = %(DOMAIN)s'
;
echo
"CERT_FILE = /etc/ssl/certs/
${
G
IT
_DOMAIN_NAME
}
.pem"
;
echo
"KEY_FILE = /etc/ssl/private/
${
G
IT
_DOMAIN_NAME
}
.key"
;
echo
"CERT_FILE = /etc/ssl/certs/
${
G
OGS
_DOMAIN_NAME
}
.pem"
;
echo
"KEY_FILE = /etc/ssl/private/
${
G
OGS
_DOMAIN_NAME
}
.key"
;
echo
'DISABLE_ROUTER_LOG = true'
;
echo
''
;
echo
'[session]'
;
...
...
@@ -762,9 +761,9 @@ function install_gogs {
systemctl restart gogs
if
!
grep
-q
"gogs domain:"
"
${
COMPLETION_FILE
}
"
;
then
echo
"gogs domain:
${
G
IT
_DOMAIN_NAME
}
"
>>
"
${
COMPLETION_FILE
}
"
echo
"gogs domain:
${
G
OGS
_DOMAIN_NAME
}
"
>>
"
${
COMPLETION_FILE
}
"
else
sed
-i
"s|gogs domain.*|gogs domain:
${
G
IT
_DOMAIN_NAME
}
|g"
"
${
COMPLETION_FILE
}
"
sed
-i
"s|gogs domain.*|gogs domain:
${
G
OGS
_DOMAIN_NAME
}
|g"
"
${
COMPLETION_FILE
}
"
fi
function_check configure_firewall_for_git
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-config
+
2
−
2
View file @
989c48f8
...
...
@@ -74,8 +74,8 @@ GNUSOCIAL_DOMAIN_NAME=
GNUSOCIAL_CODE
=
GNUSOCIAL_WELCOME_MESSAGE
=
$"<h1>Welcome to
\$
GNUSOCIAL_DOMAIN_NAME a federated social network</h1><p>Another
$PROJECT_NAME
site</p>"
GNUSOCIAL_BACKGROUND_IMAGE_URL
=
G
IT
_DOMAIN_NAME
=
G
IT
_CODE
=
G
OGS
_DOMAIN_NAME
=
G
OGS
_CODE
=
USB_DRIVE
=
/dev/sdb1
HWRNG_TYPE
=
ENABLE_SOCIAL_KEY_MANAGEMENT
=
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-onion
+
2
−
2
View file @
989c48f8
...
...
@@ -211,7 +211,7 @@ function set_default_onion_domains {
BLUDIT_DOMAIN_NAME
=
'bludit.local'
DOKUWIKI_DOMAIN_NAME
=
'dokuwiki.local'
DEFAULT_DOMAIN_NAME
=
"
${
LOCAL_NAME
}
.local"
G
IT
_DOMAIN_NAME
=
'gogs.local'
G
OGS
_DOMAIN_NAME
=
'gogs.local'
}
function
create_avahi_onion_domains
{
...
...
@@ -229,7 +229,7 @@ function create_avahi_onion_domains {
function_check create_avahi_service
create_avahi_service blog http tcp
"
$HTMLY_ONION_PORT
"
fi
if
[
$G
IT
_DOMAIN_NAME
]
;
then
if
[
$G
OGS
_DOMAIN_NAME
]
;
then
function_check create_avahi_service
create_avahi_service git http tcp
"
$GIT_ONION_PORT
"
fi
...
...
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