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
cbcdc4dd
Commit
cbcdc4dd
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Adding users to the blocklist
parent
df3df89f
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-utils-firewall
+11
-8
11 additions, 8 deletions
src/freedombone-utils-firewall
with
11 additions
and
8 deletions
src/freedombone-utils-firewall
+
11
−
8
View file @
cbcdc4dd
...
...
@@ -465,6 +465,7 @@ function firewall_block_domain {
blocked_domain
=
"
$1
"
if
[[
"
$blocked_domain
"
==
*
'@'
*
]]
;
then
# Don't try to block email/microblog addresses
echo
"
${
blocked_domain
}
"
>>
$FIREWALL_DOMAINS
return
fi
if
!
grep
-q
"
$blocked_domain
"
$FIREWALL_DOMAINS
;
then
...
...
@@ -538,15 +539,17 @@ function firewall_refresh_blocklist {
function
firewall_unblock_domain
{
unblocked_domain
=
"
$1
"
if
grep
-q
"
${
unblocked_domain
}
"
$FIREWALL_DOMAINS
;
then
hexstr
=
$(
domain_to_hex_string
$unblocked_domain
)
iptables
-D
INPUT
-p
udp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
iptables
-D
INPUT
-p
tcp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
iptables
-D
OUTPUT
-p
udp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
iptables
-D
OUTPUT
-p
tcp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
iptables
-D
FORWARD
-p
udp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
iptables
-D
FORWARD
-p
tcp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
if
[[
"
${
unblocked_domain
}
"
!=
*
'@'
*
]]
;
then
hexstr
=
$(
domain_to_hex_string
$unblocked_domain
)
iptables
-D
INPUT
-p
udp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
iptables
-D
INPUT
-p
tcp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
iptables
-D
OUTPUT
-p
udp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
iptables
-D
OUTPUT
-p
tcp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
iptables
-D
FORWARD
-p
udp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
iptables
-D
FORWARD
-p
tcp
--dport
53
-m
string
--hex-string
"
$hexstr
"
--algo
bm
-j
DROP
save_firewall_settings
fi
sed
-i
"/
${
unblocked_domain
}
/d"
$FIREWALL_DOMAINS
save_firewall_settings
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