-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
132 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
tcpsplice | ||
monitor.go | ||
debian/tcpsplice | ||
debian/*debhelper* | ||
debian/*substvars* | ||
debian/files | ||
_* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
#!/bin/sh | ||
|
||
tcpsplice: tcpsplice.go monitor.html | ||
tcpsplice: *.go monitor.html | ||
@(echo -n "package main\nimport \"encoding/base64\"\nconst _monitorContent = \""; base64 -w 0 < monitor.html; echo "\"\nvar monitorContent []byte\nfunc init() { monitorContent, _ = base64.StdEncoding.DecodeString(_monitorContent) }") >monitor.go | ||
@export GOPATH=`pwd`; export GIT_SSL_NO_VERIFY=true; export CGO_ENABLED=0; go get -v -d && go build tcpsplice.go monitor.go && strip tcpsplice | ||
|
||
run: tcpsplice | ||
@./tcpsplice tcpsplice.conf | ||
|
||
deb: | ||
@debuild -i -us -uc -b | ||
|
||
@export GOPATH=/tmp/go; export CGO_ENABLED=0; go build -trimpath -o tcpsplice && strip tcpsplice | ||
clean: | ||
|
||
distclean: | ||
@rm -rf tcpsplice monitor.go src | ||
|
||
@rm -rf tcpsplice monitor.go | ||
deb: | ||
@debuild -e GOROOT -e GOPATH -e PATH -i -us -uc -b | ||
debclean: | ||
@debuild clean | ||
@debuild -- clean | ||
@rm -f ../tcpsplice_* | ||
|
||
run: tcpsplice | ||
@./tcpsplice tcpsplice.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
tcpsplice (1.1.0) stable; urgency=medium | ||
|
||
* update to Go 1.15 (and Go modules) | ||
|
||
-- Pierre-Yves Kerembellec <[email protected]> Mon, 21 Sep 2020 18:10:58 +0200 | ||
|
||
tcpsplice (1.0.2) stable; urgency=medium | ||
|
||
* add arbitrary metadata scan (+ display on monitoring screen) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5 | ||
9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ Source: tcpsplice | |
Section: net | ||
Priority: optional | ||
Maintainer: Pierre-Yves Kerembellec <[email protected]> | ||
Build-Depends: debhelper (>= 5), git-core, golang-go (>= 1.6), make | ||
Build-Depends: debhelper (>= 5), golang-1.15 | ||
Standards-Version: 3.7.2 | ||
|
||
Package: tcpsplice | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tcpsplice usr/bin | ||
tcpsplice.conf etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,12 @@ | ||
#!/usr/bin/make -f | ||
|
||
build: build-stamp | ||
DPKG_EXPORT_BUILDFLAGS=1 | ||
include /usr/share/dpkg/default.mk | ||
DEB_BUILD_OPTIONS=nostrip | ||
|
||
build-stamp: | ||
dh_testdir | ||
$(MAKE) | ||
touch build-stamp | ||
override_dh_strip: | ||
|
||
clean: | ||
dh_testdir | ||
dh_testroot | ||
rm -f build-stamp | ||
$(MAKE) clean | ||
dh_clean | ||
override_dh_strip_nondeterminism: | ||
|
||
install: build | ||
dh_testdir | ||
dh_prep | ||
dh_install tcpsplice /usr/sbin | ||
dh_install tcpsplice.conf /etc | ||
|
||
binary-indep: build install | ||
|
||
binary-arch: build install | ||
dh_testdir | ||
dh_testroot | ||
dh_installinit | ||
dh_fixperms | ||
dh_installdeb | ||
dh_gencontrol | ||
dh_md5sums | ||
dh_builddeb | ||
|
||
binary: binary-indep binary-arch | ||
.PHONY: build clean binary-indep binary-arch binary install | ||
%: | ||
dh $@ --with systemd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# tcpsplice base configuration | ||
# base configuration | ||
|
||
ENABLED=1 | ||
# CONFIGURATION="/etc/tcpsplice.conf" | ||
CONFIGURATION="/etc/tcpsplice.conf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#! /bin/sh | ||
### BEGIN INIT INFO | ||
# Provides: tcpsplice | ||
# Required-Start: $local_fs $network | ||
# Required-Stop: $local_fs $network | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: tcpsplice | ||
# Description: tcpsplice | ||
### END INIT INFO# | ||
|
||
set -e | ||
|
||
ENABLED=0 | ||
NAME=tcpsplice | ||
BINARY=/usr/bin/tcpsplice | ||
PIDFILE=/var/run/tcpsplice.pid | ||
CONFIGURATION=/etc/tcpsplice.conf | ||
|
||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME | ||
[ "$ENABLED" -eq 0 ] && exit 0 | ||
[ ! -x "$BINARY" ] && exit 0 | ||
[ ! -f "$CONFIGURATION" ] && exit 0 | ||
|
||
. /lib/lsb/init-functions | ||
|
||
case "$1" in | ||
start) | ||
log_daemon_msg "Starting $NAME" | ||
ulimit -n 65536 | ||
start-stop-daemon --start --oknodo --quiet --background --exec "$BINARY" --make-pidfile --pidfile "$PIDFILE" -- "$CONFIGURATION" | ||
log_end_msg $? | ||
;; | ||
stop) | ||
log_daemon_msg "Stopping $NAME" | ||
start-stop-daemon --stop --oknodo --quiet --pidfile "$PIDFILE" --retry 3 | ||
log_end_msg $? | ||
;; | ||
restart) | ||
$0 stop | ||
$0 start | ||
;; | ||
status) | ||
status_of_proc "$BINARY" "$NAME" && exit 0 || exit $? | ||
;; | ||
*) | ||
echo "Usage: /etc/init.d/$NAME {start|stop|restart|status}" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Unit] | ||
Description=tcpsplice | ||
After=network.target | ||
|
||
[Service] | ||
EnvironmentFile=/etc/default/tcpsplice | ||
StandardOutput=null | ||
StandardError=journal | ||
LimitNOFILE=65536 | ||
ExecStart=/usr/bin/tcpsplice ${CONFIGURATION} | ||
ExecReload=/bin/kill -HUP $MAINPID | ||
Restart=always | ||
RestartSec=3 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module tcpsplice | ||
|
||
go 1.15 | ||
|
||
require github.com/pyke369/golang-support v0.0.0-20200321184731-cd1ed731523d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github.com/pyke369/golang-support v0.0.0-20200321184731-cd1ed731523d h1:bssjYWDUaYbjtBc7gZ6BI3YBerIg5EAn+kAM5hMQf2s= | ||
github.com/pyke369/golang-support v0.0.0-20200321184731-cd1ed731523d/go.mod h1:0XGrzgrEp0fa/+JSV8XZePUwyjnU6C3bMc7Xz2bHHKI= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
server | ||
{ | ||
log = "console()" | ||
// log = "console()" | ||
} | ||
|
||
monitor | ||
{ | ||
listen = "*:8000" | ||
acl | ||
{ | ||
allow = [ "127.0.0.1" ] | ||
auth = [ "tcpsplice:monitor" ] | ||
} | ||
// acl | ||
// { | ||
// allow = [ "127.0.0.1" ] | ||
// auth = [ "tcpsplice:monitor" ] | ||
// } | ||
} | ||
|
||
services | ||
{ | ||
example | ||
{ | ||
local = [ "*:12345" ] | ||
remote = [ "my.origin.net:12345" ] | ||
local = [ "*:12345" ] | ||
remote = [ "my.origin.net:12345" ] | ||
// connect_timeout = 10 | ||
// write_timeout = 10 | ||
// idle_timeout = 60 | ||
// incoming_buffer_size = 64k | ||
// outgoing_buffer_size = 64k | ||
// log_minimum_size = 1k | ||
// session_minimum_size = 1k | ||
// meta_size = 16k | ||
// meta_scan = "[" | ||
} | ||
} |