[Tor-BSD] obfs4proxy imported to pkgsrc (with build instructions for FreeBSD)

Alexander Nasonov alnsn at yandex.ru
Sat Sep 30 09:02:52 EDT 2017


Just want to let you know that I imported net/obfs4proxy to pkgsrc.

Since pkgsrc is cross-platform, you can build obfs4proxy and tor
packages on other BSDs. Also, you have an option to build them
as a regular user.

The instruction below is for building net/obfs4proxy and net/tor on
FreeBSD 11 amd64 as a regular user in their home directory. It takes
only 9 shell commands to get a working tor and obfs4proxy binaries.
The most advanced mk-fragment step is optional but it gives you so
many goodies you don't want to miss it.


Steps 1-2. Get the latest pkgsrc tree into ~/pkgsrc:

cd ${HOME:?}
cvs -d anoncvs at anoncvs.NetBSD.org:/cvsroot checkout pkgsrc


Step 3. It's optional but highly recommented. There are some inline
        comments to help you decide whether you want a particular
        feature or not.

cat > /tmp/mk-fragment <<EOF

MAKE_JOBS=4                    # Parallel builds.
DEPENDS_TARGET=package-install # Create binary packages in ~/pkgsrc/packages.
PKG_OPTIONS.tor=-doc           # Skip building non-essential packages.
PREFER.openssl=pkgsrc          # Native OpensSSL is slower on NetBSD.

# Optional hardening. It builds but I'm not sure whether
# ASLR works on FreeBSD. You may try HardenedBSD instead.
USE_CWRAPPERS=no
PKGSRC_MKPIE=yes
PKGSRC_USE_SSP=yes
PKGSRC_USE_RELRO=yes

# Download distfiles over socks proxy on port 9050.
FETCH_USING=		custom
FETCH_CMD=		/usr/local/bin/curl
FETCH_BEFORE_ARGS=	--socks4a 127.0.0.1:9050 \
			${PASSIVE_FETCH:D--ftp-pasv} \
			--fail --insecure --location --remote-time \
			${FETCH_TIMEOUT:D--connect-timeout ${FETCH_TIMEOUT}} \
			${FETCH_TIMEOUT:D--speed-time ${FETCH_TIMEOUT}} \
			${FETCH_USE_IPV4_ONLY:D--ipv4}
FETCH_AFTER_ARGS=	-O
FETCH_RESUME_ARGS=	-C -
FETCH_OUTPUT_ARGS=	-o

# Download distfiles from a hidden service.
MASTER_SITE_OVERRIDE=	http://pkgsrcbadj4vrrrr.onion/pub/pkgsrc/distfiles/

EOF

Steps 4-5. Bootstrap. This step builds a barebone binary kit and places
           it into ~/pkg. The last option (--mk-fragment) is optional.

cd pkgsrc/bootstrap
./bootstrap --prefix=${HOME:?}/pkg --unprivileged --mk-fragment=/tmp/mk-fragment

Steps 6-7. Build tor.

cd ../net/tor
${HOME:?}/pkg/bin/bmake package-install

Steps 8-9. Build obfs4proxy.

cd ../../net/obfs4proxy
${HOME:?}/pkg/bin/bmake package-install

Step 10. Profit!

${HOME:?}/pkg/bin/tor -f /path/to/your/torrc

-- 
Alex



More information about the Tor-BSD mailing list