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
304963ca
Commit
304963ca
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Hidden service path
parent
da059f83
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-rss
+1
-11
1 addition, 11 deletions
src/freedombone-app-rss
src/freedombone-utils-onion
+15
-13
15 additions, 13 deletions
src/freedombone-utils-onion
with
16 additions
and
24 deletions
src/freedombone-app-rss
+
1
−
11
View file @
304963ca
...
...
@@ -323,20 +323,10 @@ function install_rss_main {
rss_create_database
RSS_READER_ONION_HOSTNAME
=
$(
add_onion_service rss 80
${
RSS_READER_ONION_PORT
}
)
if
[[
"
$RSS_READER_ONION_HOSTNAME
"
!=
*
".onion"
]]
;
then
echo
$'Unable to create onion address for rss reader site'
echo
"
$RSS_READER_ONION_HOSTNAME
"
exit
7352582
fi
sleep
4
sleep
2
RSS_MOBILE_READER_ONION_HOSTNAME
=
$(
add_onion_service rss_mobile 80
${
RSS_MOBILE_READER_ONION_PORT
}
)
if
[[
"
$RSS_MOBILE_READER_ONION_HOSTNAME
"
!=
*
".onion"
]]
;
then
echo
$'Unable to create onion address for rss mobile site'
echo
"
$RSS_MOBILE_READER_ONION_HOSTNAME
"
exit
7639532
fi
echo
'server {'
>
/etc/nginx/sites-available/
$RSS_READER_DOMAIN_NAME
echo
" listen 127.0.0.1:
$RSS_MOBILE_READER_ONION_PORT
;"
>>
/etc/nginx/sites-available/
$RSS_READER_DOMAIN_NAME
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-onion
+
15
−
13
View file @
304963ca
...
...
@@ -34,6 +34,8 @@ TOR_MAX_TRAFFIC_PER_DAY_GB=3
TOR_PACKAGE_UPSTREAM
=
'http://deb.torproject.org/torproject.org'
TOR_GPG_KEY
=
'A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89'
HIDDEN_SERVICE_PATH
=
'/var/lib/tor/hidden_service_'
function
add_email_hostname
{
extra_email_hostname
=
"
$1
"
email_hostnames
=
$(
cat
/etc/exim4/update-exim4.conf.conf |
grep
"dc_other_hostnames"
|
awk
-F
"'"
'{print $2}'
)
...
...
@@ -54,7 +56,7 @@ function wait_for_onion_service_base {
onion_service_name
=
"
$1
"
sleep_ctr
=
0
while
[
!
-f
/var/lib/tor/hidden_service_
${
onion_service_name
}
/hostname
]
;
do
while
[
!
-f
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
/hostname
]
;
do
sleep
1
sleep_ctr
=
$((
sleep_ctr
+
1
))
if
[
$sleep_ctr
-gt
10
]
;
then
...
...
@@ -68,7 +70,7 @@ function wait_for_onion_service {
wait_for_onion_service_base
${
onion_service_name
}
if
[
!
-f
/var/lib/tor/hidden_service_
${
onion_service_name
}
/hostname
]
;
then
if
[
!
-f
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
/hostname
]
;
then
# try a second time
onion_update
wait_for_onion_service_base
${
onion_service_name
}
...
...
@@ -95,13 +97,13 @@ function remove_onion_service {
fi
fi
fi
if
[
-d
/var/lib/tor/hidden_service_
${
onion_service_name
}
]
;
then
shred
-zu
/var/lib/tor/hidden_service_
${
onion_service_name
}
/
*
rm
-rf
/var/lib/tor/hidden_service_
${
onion_service_name
}
if
[
-d
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
]
;
then
shred
-zu
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
/
*
rm
-rf
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
fi
if
[
-d
/var/lib/tor/hidden_service_
${
onion_service_name
}
_mobile
]
;
then
shred
-zu
/var/lib/tor/hidden_service_
${
onion_service_name
}
_mobile/
*
rm
-rf
/var/lib/tor/hidden_service_
${
onion_service_name
}
_mobile
if
[
-d
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
_mobile
]
;
then
shred
-zu
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
_mobile/
*
rm
-rf
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
_mobile
fi
remove_completion_param
"
${
onion_service_name
}
onion domain"
onion_update
...
...
@@ -113,8 +115,8 @@ function add_onion_service {
onion_service_port_to
=
$3
onion_stealth_name
=
"
$4
"
if
[
-f
/var/lib/tor/hidden_service_
${
onion_service_name
}
/hostname
]
;
then
echo
$(
cat
/var/lib/tor/hidden_service_
${
onion_service_name
}
/hostname
)
if
[
-f
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
/hostname
]
;
then
echo
$(
cat
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
/hostname
)
return
fi
...
...
@@ -123,7 +125,7 @@ function add_onion_service {
exit
877367
fi
if
!
grep
-q
"hidden_service_
${
onion_service_name
}
"
/etc/tor/torrc
;
then
echo
"HiddenServiceDir
/var/lib/tor/hidden_service_
${
onion_service_name
}
/"
>>
/etc/tor/torrc
echo
"HiddenServiceDir
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
/"
>>
/etc/tor/torrc
echo
"HiddenServicePort
${
onion_service_port_from
}
127.0.0.1:
${
onion_service_port_to
}
"
>>
/etc/tor/torrc
if
[
${#
onion_stealth_name
}
-gt
0
]
;
then
echo
"HiddenServiceAuthorizeClient stealth
${
onion_stealth_name
}
"
>>
/etc/tor/torrc
...
...
@@ -135,12 +137,12 @@ function add_onion_service {
function_check wait_for_onion_service
wait_for_onion_service
${
onion_service_name
}
if
[
!
-f
/var/lib/tor/hidden_service_
${
onion_service_name
}
/hostname
]
;
then
if
[
!
-f
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
/hostname
]
;
then
echo
$"
${
onion_service_name
}
onion site hostname not found"
exit
763624
fi
onion_address
=
$(
cat
/var/lib/tor/hidden_service_
${
onion_service_name
}
/hostname
)
onion_address
=
$(
cat
${
HIDDEN_SERVICE_PATH
}
${
onion_service_name
}
/hostname
)
# Record the domain in the completion file
set_completion_param
"
${
onion_service_name
}
onion domain"
"
${
onion_address
}
"
...
...
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