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
ef686e62
Commit
ef686e62
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Handle firewall when changing vpn tls port
parent
f5a8c426
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-vpn
+20
-4
20 additions, 4 deletions
src/freedombone-app-vpn
with
20 additions
and
4 deletions
src/freedombone-app-vpn
+
20
−
4
View file @
ef686e62
...
...
@@ -106,13 +106,17 @@ function install_interactive_vpn {
}
function
vpn_change_tls_port
{
EXISTING_VPN_TLS_PORT
=
$VPN_TLS_PORT
if
!
grep
-q
"VPN-TLS"
$FIREWALL_CONFIG
;
then
EXISTING_VPN_TLS_PORT
=
443
else
EXISTING_VPN_TLS_PORT
=
$(
cat
$FIREWALL_CONFIG
|
grep
"VPN-TLS"
|
awk
-F
'='
'{print $2}'
)
fi
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
dialog
--title
$"VPN Configuration"
\
--backtitle
$"Freedombone Control Panel"
\
--inputbox
$'Change TLS port'
10 50
$VPN_TLS_PORT
2>
$data
--inputbox
$'Change TLS port'
10 50
$
EXISTING_
VPN_TLS_PORT
2>
$data
sel
=
$?
case
$sel
in
0
)
...
...
@@ -134,17 +138,29 @@ function vpn_change_tls_port {
done
if
[
$VPN_TLS_PORT
-eq
443
]
;
then
if
[[
"
$PREVIOUS_VPN_TLS_PORT
"
!=
"443"
]]
;
then
firewall_remove VPN-TLS
${
EXISTING_VPN_TLS_PORT
}
fi
systemctl stop nginx
systemctl disable nginx
else
if
[[
"
$PREVIOUS_VPN_TLS_PORT
"
!=
"
$VPN_TLS_PORT
"
]]
;
then
firewall_remove VPN-TLS
${
EXISTING_VPN_TLS_PORT
}
firewall_add VPN-TLS
${
VPN_TLS_PORT
}
tcp
fi
systemctl
enable
nginx
systemctl restart nginx
fi
systemctl restart stunnel
dialog
--title
$"VPN Configuration"
\
--msgbox
$"TLS port changed to
$VPN_TLS_PORT
"
6 60
if
[
$VPN_TLS_PORT
-eq
443
]
;
then
dialog
--title
$"VPN Configuration"
\
--msgbox
$"TLS port changed to
${
VPN_TLS_PORT
}
. Forward this port from your internet router."
10 60
else
dialog
--title
$"VPN Configuration"
\
--msgbox
$"TLS port changed to
${
VPN_TLS_PORT
}
. Forward this port from your internet router."
10 60
fi
fi
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