Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
riseup_vpn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
leap
riseup_vpn
Merge requests
!15
[feat] add /firewall/isup
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
[feat] add /firewall/isup
meskio/riseup_vpn:feat/firewall_isup
into
master
Overview
3
Commits
1
Changes
4
Closed
meskio
requested to merge
meskio/riseup_vpn:feat/firewall_isup
into
master
5 years ago
Overview
3
Commits
1
Changes
4
Expand
Related: bitmask-systray#97
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
18fe361b
1 commit,
5 years ago
4 files
+
31
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
helper/darwin.go
+
10
−
0
Options
@@ -27,6 +27,7 @@ To inspect the rules in the firewall manually, use the bitmask anchor:
package
main
import
(
"bytes"
"errors"
"fmt"
"log"
@@ -103,6 +104,15 @@ func firewallStop() error {
return
exec
.
Command
(
pfctl
,
"-a"
,
bitmask_anchor
,
"-F"
,
"all"
)
.
Run
()
}
func
firewallIsUp
()
bool
{
out
,
err
:=
exec
.
Command
(
pfctl
,
"-a"
,
bitmask_anchor
,
"-sr"
)
.
Output
()
if
err
!=
nil
{
log
.
Printf
(
"An error ocurred getting the status of the firewall: %v"
,
err
)
return
false
}
return
bytes
.
Contains
(
out
,
[]
byte
(
"block out proto udp to any port 53"
))
}
func
enablePf
()
{
cmd
:=
exec
.
Command
(
pfctl
,
"-e"
)
cmd
.
Run
()
Loading