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
Guillaume Hervier
chromebrew
Commits
2d7d3f92
Commit
2d7d3f92
authored
Dec 09, 2017
by
Ed Reel
Committed by
GitHub
Dec 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1450 from allenbenz/add-syncthing
Add syncthing package
parents
dab4b601
cbbdf878
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
packages/syncthing.rb
packages/syncthing.rb
+56
-0
No files found.
packages/syncthing.rb
0 → 100644
View file @
2d7d3f92
require
'package'
class
Syncthing
<
Package
description
'An application that lets you synchronize your files across multiple devices'
homepage
'https://github.com/syncthing/syncthing'
version
'0.14.41'
source_url
'https://github.com/syncthing/syncthing/archive/v0.14.41.tar.gz'
source_sha256
'9c406897443465e03d3259df1dda10bd86e49ae4286f8c855d9f35e47026af2f'
binary_url
({
})
binary_sha256
({
})
depends_on
'go'
=>
:build
def
self
.
build
#The system tmp dir is mounted noexec, and the build will fail if it is used
system
"TMPDIR=/usr/local/tmp go run build.go -version v0.14.40"
end
def
self
.
install
system
"mkdir -p
#{
CREW_DEST_PREFIX
}
/bin"
system
"mv bin/syncthing
#{
CREW_DEST_PREFIX
}
/bin/syncthing-bin"
[
1
,
5
,
7
].
each
do
|
i
|
system
"mkdir -p
#{
CREW_DEST_PREFIX
}
/share/man/man
#{
i
}
"
system
"gzip man/*.
#{
i
}
"
system
"cp -R man/*.
#{
i
}
.gz
#{
CREW_DEST_PREFIX
}
/share/man/man
#{
i
}
"
end
#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
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