Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
chromebrew
Commits
99fcc8f7
Commit
99fcc8f7
authored
Nov 24, 2017
by
Allen Benz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added iptables wrapper script for syncthing
parent
88fddd6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
packages/syncthing.rb
packages/syncthing.rb
+23
-1
No files found.
packages/syncthing.rb
View file @
99fcc8f7
...
...
@@ -21,7 +21,29 @@ class Syncthing < Package
def
self
.
install
system
"mkdir -p
#{
CREW_DEST_PREFIX
}
/bin"
system
"mv bin/syncthing
#{
CREW_DEST_PREFIX
}
/bin"
system
"mv bin/syncthing
#{
CREW_DEST_PREFIX
}
/bin/syncthing-bin"
#syncthing requires some ports to be open
system
%Q(echo '#!/bin/bash
if [[ $EUID == 0 ]]; then
echo "Do not run syncthing as root."
echo "This wrapper script calls iptables with sudo to open ports for syncthing."
echo "syncthing run as root will try and fail to write to the read-only root directory."
exit
fi
#syncthing listens on these ports
sudo /sbin/iptables -I INPUT -p tcp --dport 22000 -j ACCEPT &&
sudo /sbin/iptables -I INPUT -p udp --dport 21025 -j ACCEPT &&
syncthing-bin
#clean up created rules to avoid duplicating them
sudo /sbin/iptables -D INPUT -p tcp --dport 22000 -j ACCEPT
sudo /sbin/iptables -D INPUT -p udp --dport 21025 -j ACCEPT
' >
#{
CREW_DEST_PREFIX
}
/bin/syncthing)
system
"chmod +x
#{
CREW_DEST_PREFIX
}
/bin/syncthing"
#The build process leaves 50M of files around that we do not need
system
"rm -rf /usr/local/tmp/syncthing-*/"
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment