diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2013-10-06 07:40:34 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2013-10-06 07:40:34 -0400 |
commit | 54a16ce06802dd417473d6923cd7132b4164d2b2 (patch) | |
tree | 728510094e237b91521659a08cd1becbcbdab09a | |
parent | net-proxy/obfsproxy: testing python rewrite (diff) | |
download | blueness-54a16ce06802dd417473d6923cd7132b4164d2b2.tar.gz blueness-54a16ce06802dd417473d6923cd7132b4164d2b2.tar.bz2 blueness-54a16ce06802dd417473d6923cd7132b4164d2b2.zip |
net-proxy/obfsproxy: add standalone daemon initd scripts
Package-Manager: portage-2.2.1
Manifest-Sign-Key: 0xF52D4BBA
-rw-r--r-- | net-proxy/obfsproxy/Manifest | 6 | ||||
-rw-r--r-- | net-proxy/obfsproxy/files/obfsproxy.confd | 45 | ||||
-rw-r--r-- | net-proxy/obfsproxy/files/obfsproxy.initd | 58 | ||||
-rw-r--r-- | net-proxy/obfsproxy/obfsproxy-0.2.3.ebuild | 34 | ||||
-rw-r--r-- | net-proxy/obfsproxy/obfsproxy-0.2.4.ebuild | 34 |
5 files changed, 173 insertions, 4 deletions
diff --git a/net-proxy/obfsproxy/Manifest b/net-proxy/obfsproxy/Manifest index 31aed1b..8d63441 100644 --- a/net-proxy/obfsproxy/Manifest +++ b/net-proxy/obfsproxy/Manifest @@ -1,5 +1,7 @@ +AUX obfsproxy.confd 1494 SHA256 a370791b7bf021fffe83c257642f623368c28d02946e3865194bfa22f8279b95 SHA512 722224e227cbedecae1e769a2d1198a397d7096daea8c6b7b2f0aff92396a1ec4b83e1037dff31d99fe98812be220461d6e479966131975c7e2b80bb82b19093 WHIRLPOOL f85c83be1bd54451248a29040815afc9e9b46be780d6a73e0a307accaf94685bfeebad28ac69ff284f2f21fd9b565a1e25e71401002ae25c90f5eef39b97e4df +AUX obfsproxy.initd 1808 SHA256 52789c3b7ddcdb7221111a2498e15721d611918765e405e7354b9303ef8858bb SHA512 640c91ec243b6115c050a5752cc62fe4bbfeddfa7a45fb806dceeb08b4cc230890bc1f96269adcddfe49c43ca0d143ab4a735fce65068a608ba6d2af10a7d973 WHIRLPOOL f84b6fc41eabac25bf3d2eb3f7a42e91ee94f7aa69e189a3d4fdc592b1ffde3f3428a42fa22a4cd76275574a539266afc65d65e932d1b633a8f6b39b7397b51a DIST obfsproxy-0.2.3.tar.gz 50020 SHA256 a0be3f2f0934f6114363e375cdce39d36b7e72ddb63d8f16b21c1c8cedc11cc9 SHA512 22c72c9d41a19f9b5887d4ac4ab2c7467b141e85eb1eea3ca85e52cc909e43abd783f5d1327b642a6ea211eafdc94917ca7ed3b936c3396d8cfe9a7bf178d067 WHIRLPOOL 161cf0ec7456029e8b947ab0007484ee7b97a0ac879e15eb0a8b141095e7831de7cfcb5adc4c137dae634304e5401b84a04a46b3b436c38f2305048e88eeee1d DIST obfsproxy-0.2.4.tar.gz 50979 SHA256 b0f34860cb7c9a1e6eedc95c3b3549baf67e90e4c32036bb9c4c015370734e43 SHA512 65708747c653613e2b2950c4d12643a449970da8026b43cf7bb38d1a94a195bcd41e30a34777ba844007794a5cd6e9d5df17b10cbd89048b310c7ee506069bb0 WHIRLPOOL 8d000fdf233340e6fc7777a96985db019e0a02816ec588efe77cf9d28728dc0f32ab945a50df71f17a92d9b25c5aa5d734795940a8ac8dcc4a4f76c7ec1f0c1b -EBUILD obfsproxy-0.2.3.ebuild 607 SHA256 5b3af0be861adb27dbeb977b238fa3a9124c797874516f6810a2be0a4cb6b511 SHA512 10f495d37726a2185b70b20eda64c6e4c03c9ecac8d78f107fff9a040d3993475e3d8d5dab5af8ea37cb185206d9931e7f506bb4c8f00a5813696b235b29abca WHIRLPOOL 3e46d54b8ed9b085286cec9fcf05a8cb52b678c251edfc7d0e679c4c7ede43d7afd10c779a63f11683a6e0af7ec20f37fdd938f8a7a6263bf963ffc578ccabc5 -EBUILD obfsproxy-0.2.4.ebuild 607 SHA256 5b3af0be861adb27dbeb977b238fa3a9124c797874516f6810a2be0a4cb6b511 SHA512 10f495d37726a2185b70b20eda64c6e4c03c9ecac8d78f107fff9a040d3993475e3d8d5dab5af8ea37cb185206d9931e7f506bb4c8f00a5813696b235b29abca WHIRLPOOL 3e46d54b8ed9b085286cec9fcf05a8cb52b678c251edfc7d0e679c4c7ede43d7afd10c779a63f11683a6e0af7ec20f37fdd938f8a7a6263bf963ffc578ccabc5 +EBUILD obfsproxy-0.2.3.ebuild 1806 SHA256 e55179e775452c469c00ce82fe6345eb48d30c64d8164f3c898c21e3a072e39a SHA512 0e4c643c130cd5729e10b925a50c2227086121ca0681d67749b9dabaa95ac6f91061381624794bf96b9f67ca24cf2f8abd64581d027f4c5c267533b28f50ab37 WHIRLPOOL bb899652beacf895197faac43f0742ebd1deddccfb5f9f662a55b4314514d7eb0db377e7f0b94c5358d45e6cc141280b2809fc13ed677b19a6ef25e1dde72fc3 +EBUILD obfsproxy-0.2.4.ebuild 1806 SHA256 e55179e775452c469c00ce82fe6345eb48d30c64d8164f3c898c21e3a072e39a SHA512 0e4c643c130cd5729e10b925a50c2227086121ca0681d67749b9dabaa95ac6f91061381624794bf96b9f67ca24cf2f8abd64581d027f4c5c267533b28f50ab37 WHIRLPOOL bb899652beacf895197faac43f0742ebd1deddccfb5f9f662a55b4314514d7eb0db377e7f0b94c5358d45e6cc141280b2809fc13ed677b19a6ef25e1dde72fc3 MISC metadata.xml 319 SHA256 1f131e89abe09d6120753980e23dcb5e4438359f11fb10d2bb20d554d9fc6dea SHA512 5c9bceffaa09973714dd04e28e4f23639bc0f3d7f790d2a0e7666b5397c3fa16ca0227555bf904fe5c335d9f0daa6a05db2bbb3ea1ff25fcdbcb7436621b52f4 WHIRLPOOL 7ee9236cbd0e478c1a267145e4c945e9bdc8548255ca0ef9d1d569bdca4fe49568fc0ddad91588ee545581cc2b0c72681389ef4a57e14dae2542c81117b4146c diff --git a/net-proxy/obfsproxy/files/obfsproxy.confd b/net-proxy/obfsproxy/files/obfsproxy.confd new file mode 100644 index 0000000..e75aa93 --- /dev/null +++ b/net-proxy/obfsproxy/files/obfsproxy.confd @@ -0,0 +1,45 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/obfsproxy/files/obfsproxy.confd,v 1.1 2013/01/19 16:00:49 blueness Exp $ + +# protocols ofbsproxy will obfuscate = obfs2 | dummy +PROTOCOL="obfs2" + +#options for PROTOCOLE="dummy" +# dummy <mode> <listen_address> [<target_address>] +# mode ~ server|client|socks +# listen_address, target_address ~ host:port +# target_address is required for server and client mode, and forbidden for socks mode. +# Examples: +# obfsproxy dummy socks 127.0.0.1:5000 +# obfsproxy dummy client 127.0.0.1:5000 192.168.1.99:11253 +# obfsproxy dummy server 192.168.1.99:11253 127.0.0.1:9005 + +#MODE="socks" +#LISTEN="127.0.0.1:5000" +#TARGET="127.0.0.1:9005" + + +#options for PROTOCOL="obfs2" +# obfs2 [obfs2_args] obfs2_opts +# 'obfs2_opts': +# mode ~ server|client|socks +# listen address ~ host:port +# 'obfs2_args': +# Destination Address ~ --dest=host:port +# Shared Secret ~ --shared-secret=<secret> +# Example: +# obfsproxy obfs2 --dest=127.0.0.1:666 --shared-secret=himitsu server 127.0.0.1:1026 + +MODE="server" +DESTINATION="127.0.0.1:666" +SECRET="changeme" +LISTEN="127.0.0.1:1026" + +#Logging +# --log-file=<file> ~ set logfile +# --log-min-severity=warn|notice|info|debug ~ set minimum logging severity (default: notice) +# --no-log ~ disable logging +# --no-safe-logging ~ disable safe (scrubbed address) logging + +LOGGING="--log-file=/var/log/obfsproxy.log --log-min-severity=warn" diff --git a/net-proxy/obfsproxy/files/obfsproxy.initd b/net-proxy/obfsproxy/files/obfsproxy.initd new file mode 100644 index 0000000..19e3dd3 --- /dev/null +++ b/net-proxy/obfsproxy/files/obfsproxy.initd @@ -0,0 +1,58 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/obfsproxy/files/obfsproxy.initd,v 1.1 2013/01/19 16:00:49 blueness Exp $ + +PIDFILE="/var/run/obfsproxy.pid" +DAEMON="/usr/bin/obfsproxy" + +depend() { + need net +} + +checkconfig() { + [[ "x${PROTOCOL}" = "x" ]] \ + && eerror "PROTOCOL not given" && return 1 + [[ "x${MODE}" = "x" ]] \ + && eerror "MODE not given" && return 1 + if [ ${PROTOCOL} = "dummy" ] ; then + [[ "x${LISTEN}" = "x" ]] \ + && eerror "No listen address was given" && return 1 + [[ "x${MODE}" = "xserver" && "x${TARGET}" = "x" ]] \ + && eerror "MODE=server but no target address was given" && return 1 + [[ "x${MODE}" = "xsocks" && "x${TARGET}" != "x" ]] \ + && eerror "MODE=sock but a target address was given" && return 1 + CMDLINE="${LOGGING} ${PROTOCOL} ${MODE} ${LISTEN} ${TARGET}" + elif [ ${PROTOCOL} = "obfs2" ] ; then + [[ "x${MODE}" = "xsocks" && "x${DESTINATION}" != "x" ]] \ + && eerror "MODE=sock but a destination address was given" && return 1 + [[ "x${LISTEN}" = "x" ]] \ + && eerror "LISTEN host:port was not given" && return 1 + [[ "x${DESTINATION}" != "x" ]] \ + && DESTINATION="--dest=${DESTINATION}" + [[ "x${SECRET}" != "x" ]] \ + && SECRET="--shared-secret=${SECRET}" + CMDLINE="${LOGGING} ${PROTOCOL} ${DESTINATION} ${SECRET} ${MODE} ${LISTEN}" + else + eerror "Unknown protocol ${PROTOCOL}" + return 1 + fi + return 0 +} + +start() { + checkconfig || return 1 + ebegin "Starting obfsproxy server" + start-stop-daemon --start \ + --background --make-pidfile --pidfile ${PIDFILE} \ + --exec ${DAEMON} -- ${CMDLINE} + eend $? +} + +stop() { + ebegin "Stopping obfsproxy server" + start-stop-daemon --stop \ + --pidfile ${PIDFILE} \ + --exec ${DAEMON} + eend $? +} diff --git a/net-proxy/obfsproxy/obfsproxy-0.2.3.ebuild b/net-proxy/obfsproxy/obfsproxy-0.2.3.ebuild index 97c4128..02ee94e 100644 --- a/net-proxy/obfsproxy/obfsproxy-0.2.3.ebuild +++ b/net-proxy/obfsproxy/obfsproxy-0.2.3.ebuild @@ -14,8 +14,40 @@ SRC_URI="mirror://pypi/o/${PN}/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" +IUSE="daemon" DOCS=( ChangeLog INSTALL README TODO doc/HOWTO.txt ) RDEPEND="dev-python/pyptlib" + +src_install() { + distutils-r1_src_install + if use daemon; then + newconfd "${FILESDIR}"/obfsproxy.confd obfsproxy + newinitd "${FILESDIR}"/obfsproxy.initd obfsproxy + fi +} + +pkg_postinst() { + einfo + einfo "To run ${PN} with a tor bridge, add the following to your torrc file:" + einfo + einfo " SocksPort 0" + einfo " ORPort 443 # or some other port if you already run a webserver/skype" + einfo " BridgeRelay 1" + einfo " ExitPolicy reject *:*" + einfo " Nickname CHANGEME_1" + einfo " ContactInfo CHANGEME_2" + einfo " ServerTransportPlugin obfs2,obfs3 exec /usr/bin/${PN} managed" + einfo + einfo "Obviously, change CHANGEME_1 and CHANGEME_2 to appropriate values. When you" + einfo "start tor, you should see a message similar to the following in its logs:" + einfo + einfo " Oct 05 20:00:41.000 [notice] Registered server transport 'obfs2' at '0.0.0.0:26821" + einfo " Oct 05 20:00:42.000 [notice] Registered server transport 'obfs3' at '0.0.0.0:40172" + einfo + einfo "Note the port numbers, 26821 and 40172 in this case, and report it, along with" + einfo "your IP address, to your bridge clients. If you are behind a NAT firewall, you" + einfo "you need to do port forwarding on those ports." + einfo +} diff --git a/net-proxy/obfsproxy/obfsproxy-0.2.4.ebuild b/net-proxy/obfsproxy/obfsproxy-0.2.4.ebuild index 97c4128..02ee94e 100644 --- a/net-proxy/obfsproxy/obfsproxy-0.2.4.ebuild +++ b/net-proxy/obfsproxy/obfsproxy-0.2.4.ebuild @@ -14,8 +14,40 @@ SRC_URI="mirror://pypi/o/${PN}/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" +IUSE="daemon" DOCS=( ChangeLog INSTALL README TODO doc/HOWTO.txt ) RDEPEND="dev-python/pyptlib" + +src_install() { + distutils-r1_src_install + if use daemon; then + newconfd "${FILESDIR}"/obfsproxy.confd obfsproxy + newinitd "${FILESDIR}"/obfsproxy.initd obfsproxy + fi +} + +pkg_postinst() { + einfo + einfo "To run ${PN} with a tor bridge, add the following to your torrc file:" + einfo + einfo " SocksPort 0" + einfo " ORPort 443 # or some other port if you already run a webserver/skype" + einfo " BridgeRelay 1" + einfo " ExitPolicy reject *:*" + einfo " Nickname CHANGEME_1" + einfo " ContactInfo CHANGEME_2" + einfo " ServerTransportPlugin obfs2,obfs3 exec /usr/bin/${PN} managed" + einfo + einfo "Obviously, change CHANGEME_1 and CHANGEME_2 to appropriate values. When you" + einfo "start tor, you should see a message similar to the following in its logs:" + einfo + einfo " Oct 05 20:00:41.000 [notice] Registered server transport 'obfs2' at '0.0.0.0:26821" + einfo " Oct 05 20:00:42.000 [notice] Registered server transport 'obfs3' at '0.0.0.0:40172" + einfo + einfo "Note the port numbers, 26821 and 40172 in this case, and report it, along with" + einfo "your IP address, to your bridge clients. If you are behind a NAT firewall, you" + einfo "you need to do port forwarding on those ports." + einfo +} |