Opened 2 years ago

Closed 7 months ago

#5009 closed defect (wontfix)

obfsproxy does not build from instructions on debian squeeze

Reported by: arma Owned by: asn
Priority: normal Milestone:
Component: Obfsproxy Version:
Keywords: Cc: intrigeri, nickm, marlowe
Actual Points: Parent ID:
Points:

Description

# apt-get install autotools-dev gcc git libevent-2.0-5 libevent-openssl-2.0-5 libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libevent-2.0-5
E: Couldn't find any package by regex 'libevent-2.0-5'
E: Unable to locate package libevent-openssl-2.0-5
E: Couldn't find any package by regex 'libevent-openssl-2.0-5'
tord2@moria:~/obfsproxy$ ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4 --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --include=m4 --force
autoreconf: running: /usr/bin/autoheader --include=m4 --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:4: installing `./install-sh'
configure.ac:4: installing `./missing'
Makefile.am: installing `./depcomp'
autoreconf: Leaving directory `.'
tord2@moria:~/obfsproxy$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc  
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking for a sed that does not truncate output... /bin/sed
checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 2.6
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.6/dist-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.6/dist-packages
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libevent... no
configure: error: Package requirements (libevent >= 2.0) were not met:

No package 'libevent' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables libevent_CFLAGS
and libevent_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Child Tickets

TicketSummaryOwner
#5087configure should realize libssl-dev is missingasn

Attachments (1)

add_distro_packages_obfsproxy.patch (2.1 KB) - added by asn 2 years ago.

Download all attachments as: .zip

Change History (35)

comment:1 Changed 2 years ago by arma

Looks like we want another stanza of instructions for how to grab and build a local copy of libevent2, and how to tell obfsproxy's ./configure where it is?

comment:2 Changed 2 years ago by nickm

I'm not much of a debianist, but shouldn't there be some libevent-*-dev packages there too?

comment:3 Changed 2 years ago by Sebastian

There are, but not for libevent2 yet. On irc there was talk about requesting a backport, but afaik no results yet; so potentially soon it'll be easy to get libeven2 on stable debian.

comment:4 Changed 2 years ago by arma

  • Component changed from Pluggable transport to Obfsproxy

comment:5 Changed 2 years ago by asn

  • Cc intrigeri added

CCing intrigeri since IIRC he can add packages to the Debian backports repositories.

comment:6 Changed 2 years ago by arma

In the mean time, and for people who can't or won't add new apt sources lines, we should come up with simple instructions for building libevent2 alongside obfsproxy. I'm picturing something like "git clone https://libevent.git, cd libevent, build it like this, then change your obfsproxy ./configure line to say --with-foo-dir=libevent".

comment:7 follow-up: Changed 2 years ago by asn

  • Cc nickm added

I think that if you build and install libevent2, obfsproxy will find the locally installed header files and libraries in /usr/local/ automatically. That's what happens in a Debian system of mine.

$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.16-stable.tar.gz
$ tar xvf libevent-2.0.16-stable.tar.gz
$ cd libevent-2.0.16-stable
$ ./configure && make
# make install

$ cd ~
$ git clone git://git.torproject.org/obfsproxy.git
$ cd obfsproxy/
$ ./autogen.sh && ./configure && make

If that doesn't work, doing:

$ export libevent_CFLAGS="/usr/local/include"
$ export libevent_LIBS="/usr/local/lib"

could help.

obfsproxy doesn't have a --with-libevent-dir switch in its configure script, and I think it's intentional, because the correct way of doing this is by using pkg-config. I'm not sure what pkg-config is exactly -- I think it's a package with some rules for each library that tells you where to find its objects and headers -- but that's what I remember Nick saying in IRC.
That said, we should add pkg-config to the to-apt-get-install-list.

BTW, I've heard reports of people having problems with ntohl during configure, and I remember seeing something similar in an Ubuntu system some months ago. I believe it's caused by the script in m4/winsocks.m4, which was added by Zack, because ntohl and a bunch of related functions require a special library on Windows.. Could this also cause problems in Linux? Unfortunately, I don't know autotools, and I won't be able to play with this for the next some days. Nick, any ideas?

Roger, can you try the above instructions in your setup, and see if it works? During the week, I'll try to correct them and make a website version out of them.

(CCing nickm in case he knows anything about the autotools stuff.)

comment:8 Changed 2 years ago by asn

(Semi-Off-topic: Nick you might want to add a libevent2-latest.tar.gz symlink to the website, so that we can add that to the guide and have it fetch us the latest libevent2 stable release every time.)

comment:9 Changed 2 years ago by intrigeri

I have prepared backports for amd64 and i386. Once someone has confirmed they work well, I will upload these to the official Debian backports archive. So, please test and report back.

You can download my backports (source and binary packages) like this:

$ dget http://gaffer.ptitcanardnoir.org/intrigeri/tmp/libevent_2.0.16-stable-1~bpo60+1/libevent_2.0.16-stable-1~bpo60+1_amd64.changes
$ dget http://gaffer.ptitcanardnoir.org/intrigeri/tmp/libevent_2.0.16-stable-1~bpo60+1/libevent_2.0.16-stable-1~bpo60+1_i386.changes

Notes:

  • dget can be found in the devscripts package.
  • The .changes files are signed with my OpenPGP key, and can be verified using dscverify.

comment:10 in reply to: ↑ 7 ; follow-up: Changed 2 years ago by arma

Replying to asn:

$ export libevent_CFLAGS="/usr/local/include"
$ export libevent_LIBS="/usr/local/lib"

could help.

Ok. I built libevent2 and set these two envs, and it looks like it's finding libevent fine.

obfsproxy doesn't have a --with-libevent-dir switch in its configure script, and I think it's intentional, because the correct way of doing this is by using pkg-config. I'm not sure what pkg-config is exactly -- I think it's a package with some rules for each library that tells you where to find its objects and headers -- but that's what I remember Nick saying in IRC.
That said, we should add pkg-config to the to-apt-get-install-list.

That's odd -- tor doesn't use pkg-config. I wonder if the "pkg-config vs --with-libevent-dir" discussion is worth a separate ticket so it doesn't get lost.

BTW, I've heard reports of people having problems with ntohl during configure, and I remember seeing something similar in an Ubuntu system some months ago. I believe it's caused by the script in m4/winsocks.m4, which was added by Zack, because ntohl and a bunch of related functions require a special library on Windows.. Could this also cause problems in Linux? Unfortunately, I don't know autotools, and I won't be able to play with this for the next some days. Nick, any ideas?

Correct, my ./configure now fails at

checking for library containing ntohl... no
configure: error: could not find ntohl

comment:11 Changed 2 years ago by arma

Ok, the immediate issue was that it needed "export libevent_LIBS=-L/usr/local/lib/". Presumably whatever autoconf stuff is going on didn't add in the -L when you expected it to. It resulted in the ntohl check trying to build the test program with "/usr/local/lib/" as one of gcc's command lines, and that didn't fly.

comment:12 Changed 2 years ago by arma

libevent_CFLAGS wanted to start with -I too

comment:13 Changed 2 years ago by arma

Ok, now it builds: turns out libevent_LIBS wanted to include " -levent", else the link line wouldn't specify any library to use.

comment:14 Changed 2 years ago by arma

Builds, but doesn't run. Next is export LD_LIBRARY_PATH to wherever the libevent2 lib is.

And that appears to make it work. Whew.

comment:15 Changed 2 years ago by asn

And we should also add autoconf, pkg-config and libtool to the APT packages list, judging by Runa's instructions: http://pastebin.com/pML9bi9K

comment:16 follow-up: Changed 2 years ago by arma

  • Cc marlowe added

Marlowe: did you try intrigeri's debs? If so, what happened?

comment:17 Changed 2 years ago by arma

For posterity, this is what I did to make it work on debian stable without using root:

$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.16-stable.tar.gz
$ tar xvf libevent-2.0.16-stable.tar.gz
$ cd libevent-2.0.16-stable
$ ./configure --prefix=/home/tord/event2 && make && make install

$ export libevent_CFLAGS=-I/home/tord/event2/include
$ export libevent_LIBS="-L/home/tord/event2/lib -levent"
$ export LD_LIBRARY_PATH=/home/tord/event2/lib/

$ cd ..
$ git clone https://git.torproject.org/obfsproxy.git
$ cd obfsproxy
$ ./autogen.sh && ./configure && make

[I assume you have a tor bridge already running with ORPort on 9009]

$ ./obfsproxy obfs2 --dest=127.0.0.1:9009 server 0.0.0.0:1051

comment:18 in reply to: ↑ 16 ; follow-up: Changed 2 years ago by marlowe

Replying to arma:

Marlowe: did you try intrigeri's debs? If so, what happened?

I used the debs and everything went perfectly.

comment:19 in reply to: ↑ 18 ; follow-up: Changed 2 years ago by arma

Replying to marlowe:

Replying to arma:

Marlowe: did you try intrigeri's debs? If so, what happened?

I used the debs and everything went perfectly.

Excellent. Intrigeri, how long until we can get them into backports?

The deb is a much better plan than my "compile in place" nonsense, mainly because when Tor runs obfsproxy in managed mode, the libevent2 library needs to be in the default library path.

comment:20 in reply to: ↑ 19 ; follow-up: Changed 2 years ago by intrigeri

Replying to arma:

Intrigeri, how long until we can get them into backports?

Since I've got my Debian developer cap recently, I've had to ask for my key to be added to the backports keyring. I expect this to be done in a matter of days, which will allow me to upload the backports.

comment:21 follow-up: Changed 2 years ago by ioerror

This is easier to cut and paste:

mkdir ~/obfs
wget https://github.com/downloads/libevent/libevent/libevent-2.0.16-stable.tar.gz
tar xvf libevent-2.0.16-stable.tar.gz
cd libevent-2.0.16-stable
./configure --prefix=/home/obfs/event2 && make && make install

export libevent_CFLAGS=-I/home/obfs/event2/include
export libevent_LIBS="-L/home/obfs/event2/lib -levent"
export LD_LIBRARY_PATH=/home/obfs/event2/lib/

cd ..
git clone https://git.torproject.org/obfsproxy.git
cd obfsproxy
./autogen.sh && ./configure && make

./obfsproxy obfs2 --dest=127.0.0.1:9001 server 0.0.0.0:1051

comment:22 in reply to: ↑ 21 Changed 2 years ago by hellais

I setup an obfs proxy on a box and made this little guide to get it up and running on Ubuntu 11.04:

# Install the basic dependencies
apt-get install autoconf autotools-dev gcc git pkg-config libtool
# Build the libevent backport
# get devscripts package
apt-get install devscripts
# Download intrigeri's key to verify the back port
gpg --recv-key A57498FF
# Download the backport
mkdir libevent-2.0;cd libevent-2.0;
dget http://gaffer.ptitcanardnoir.org/intrigeri/tmp/libevent_2.0.16-stable-1~bpo60+1/libevent_2.0.16-stable-1~bpo60+1_amd64.changes
dpkg -i libevent-2.0-5_2.0.16-stable-1~bpo60+1_amd64.deb
dpkg -i libevent-core-2.0-5_2.0.16-stable-1~bpo60+1_amd64.deb
dpkg -i libevent-extra-2.0-5_2.0.16-stable-1~bpo60+1_amd64.deb
dpkg -i libevent-pthreads-2.0-5_2.0.16-stable-1~bpo60+1_amd64.deb
dpkg -i libevent-openssl-2.0-5_2.0.16-stable-1~bpo60+1_amd64.deb
dpkg -i libevent-dbg_2.0.16-stable-1~bpo60+1_amd64.deb
dpkg -i libevent-dev_2.0.16-stable-1~bpo60+1_amd64.deb

cd ../
git clone https://git.torproject.org/obfsproxy.git
cd obfsproxy
./autogen.sh && ./configure && make

# To start the obfsproxy directly without installing (replace 9001 with your ORPort)
./obfsproxy obfs2 --dest=127.0.0.1:9001 server 0.0.0.0:1051

# To install it and make Tor invoke obfsproxy (requires Tor >= 2.3.11-alpha)
make install
echo "ServerTransportPlugin obfs2 exec /usr/local/bin/obfsproxy --managed" >> /etc/torrc
/etc/init.d/tor restart
cat /var/log/tor/log | grep obfs2

comment:23 in reply to: ↑ 20 ; follow-up: Changed 2 years ago by intrigeri

Replying to intrigeri:

Since I've got my Debian developer cap recently, I've had to ask for my key to be added to the backports keyring. I expect this to be done in a matter of days, which will allow me to upload the backports.

Uploaded. We'll see how long it waits in the backports NEW queue: http://backports-master.debian.org/dak/new.html

comment:24 Changed 2 years ago by Spider.007

A complete package for Archlinux is available from the AUR:

https://aur.archlinux.org/packages.php?ID=56555

It works for me, although I have no idea how to test it. Also, where can I find (general/technical) documentation about what obfsproxy does? The source implies a custom alternative to ssl encryption?

comment:25 in reply to: ↑ 10 ; follow-up: Changed 2 years ago by nickm

Replying to arma:

That's odd -- tor doesn't use pkg-config. I wonder if the "pkg-config vs --with-libevent-dir" discussion is worth a separate ticket so it doesn't get lost.

It probably is. IMO we should deprecate or dump our --with-foo-dir stuff in Tor: it is broken in bunches of subtle ways.

BTW, I've heard reports of people having problems with ntohl during configure, and I remember seeing something similar in an Ubuntu system some months ago. I believe it's caused by the script in m4/winsocks.m4, which was added by Zack, because ntohl and a bunch of related functions require a special library on Windows.. Could this also cause problems in Linux? Unfortunately, I don't know autotools, and I won't be able to play with this for the next some days. Nick, any ideas?

Correct, my ./configure now fails at

checking for library containing ntohl... no
configure: error: could not find ntohl

More info needed; is this still happening? If so please open a ticket; not every bug with the same symptom is the same bug. (Opening a new ticket also helps ensure that you will say *what platform* and maybe even tell me the relevant parts of your config.log)

comment:26 in reply to: ↑ 25 Changed 2 years ago by arma

Replying to nickm:

Replying to arma:

Correct, my ./configure now fails at

checking for library containing ntohl... no
configure: error: could not find ntohl

More info needed; is this still happening? If so please open a ticket; not every bug with the same symptom is the same bug. (Opening a new ticket also helps ensure that you will say *what platform* and maybe even tell me the relevant parts of your config.log)

Filed as #5077. It's not an actual bug, insofar as when somebody encounters it I can figure out how to move them forward, and it's typically a mistake in the directions they're following; but if they don't have an arma around they stop, so it would be good for obfsproxy's build process to get better at recognizing it.

comment:27 in reply to: ↑ 23 Changed 2 years ago by weasel

Replying to intrigeri:

Uploaded. We'll see how long it waits in the backports NEW queue: http://backports-master.debian.org/dak/new.html

http://lists.debian.org/E1RvuNV-0007dD-Uk@morricone.debian.org

comment:28 Changed 2 years ago by Monotoko

I'm having a problem with the "make"... I followed the instructions in the comments (to do with libevent) and had the very same problem with libcrypto, but used the same CFLAGS and LIBS line and it configured correctly.

The problem I'm having now is:
src/crypt.c:196: error: implicit declaration of function âRAND_bytesâ

Is that a problem with the source code or my compiler..? (GCC?)

comment:29 Changed 2 years ago by fjwelte

Agree - Manually installing latest libevent worked for me.

Had to change git to git-core

libevent-openssl doesn't seem to exist (openssl support already included in libevent?)

"./autogen.sh && ./configure && make" fails unless libevent installed in default directory (unless change environment variables)

comment:30 Changed 2 years ago by koolfy

On "old" debian/ubuntu distributions, libssl might not be recent enough for libevent (dep is >= 0.9.8m-1)

The easiest and most user-frienly workaround for now is to wget and sudo dpkg -i one of those : http://packages.ubuntu.com/oneiric/i386/libssl0.9.8/download

As it's 0.9.8o the dep will be met and the build environment can therefore be installed with the dget described here (https://trac.torproject.org/projects/tor/ticket/5009#comment:9) and the sudo dpkg -i discribed there (https://trac.torproject.org/projects/tor/ticket/5009#comment:22)

As opposed to building those manually and adding non-user-friendly and error-prone steps to the process described here (https://www.torproject.org/projects/obfsproxy-instructions.html.en)

Changed 2 years ago by asn

comment:31 follow-up: Changed 2 years ago by asn

I attached a small patch for the website. It improves the HTML a bit, it adds the obfsproxy logo in obfsproxy.html.en, it adds links to the gnu/linux distro packages, and it gives credit to the guy who made the ASCII-art-to-image program.

Before applying the patch, you should fetch attachment:logo_shaded.svg:ticket:5111 (https://trac.torproject.org/projects/tor/raw-attachment/ticket/5111/logo%20shaded.svg), and put it into images/ with the name obfsproxy_logo.svg. Thanks!

As far as distro packages are concerned, I simply put some distro images from images/distros/ into obfsproxy-instructions.html.en and when you click them it takes you to the appropriate package webpage.

I started writing something along the lines of https://www.torproject.org/download/download-unix.html.en and https://www.torproject.org/docs/debian.html.en for obfsproxy but I don't like it and I never finished it. Also, I didn't find an Arch linux logo in images/distros/ so I didn't add a link to its webpage. We can very easily do it by getting a logo from here https://www.archlinux.org/art/ .

comment:32 in reply to: ↑ 31 ; follow-up: Changed 2 years ago by rransom

Replying to asn:

I attached a small patch for the website. It improves the HTML a bit, it adds the obfsproxy logo in obfsproxy.html.en, it adds links to the gnu/linux distro packages, and it gives credit to the guy who made the ASCII-art-to-image program.

That should be four separate patches.

As far as distro packages are concerned, I simply put some distro images from images/distros/ into obfsproxy-instructions.html.en and when you click them it takes you to the appropriate package webpage.

This needs some text to explain what the images mean and why users should consider pointing their mice at them.

Also, someone should explain how to build obfsproxy from a release tarball, not just from a Git checkout.

Also, WTF are you discussing this on *this* ticket for? There's a separate ticket for 'mention obfsproxy releases on the obfsproxy-instructions page'.

Also, I didn't find an Arch linux logo in images/distros/ so I didn't add a link to its webpage. We can very easily do it by getting a logo from here https://www.archlinux.org/art/ .

I don't think The Tor Project should promote Arch Linux.

comment:33 in reply to: ↑ 32 Changed 2 years ago by asn

Replying to rransom:

Replying to asn:

I attached a small patch for the website. It improves the HTML a bit, it adds the obfsproxy logo in obfsproxy.html.en, it adds links to the gnu/linux distro packages, and it gives credit to the guy who made the ASCII-art-to-image program.

That should be four separate patches.

As far as distro packages are concerned, I simply put some distro images from images/distros/ into obfsproxy-instructions.html.en and when you click them it takes you to the appropriate package webpage.

This needs some text to explain what the images mean and why users should consider pointing their mice at them.

Also, someone should explain how to build obfsproxy from a release tarball, not just from a Git checkout.

Also, WTF are you discussing this on *this* ticket for? There's a separate ticket for 'mention obfsproxy releases on the obfsproxy-instructions page'.

I was not aware of #5582. I will improve the current patch, split it into parts and post the relevant parts in #5582.

Also, I didn't find an Arch linux logo in images/distros/ so I didn't add a link to its webpage. We can very easily do it by getting a logo from here https://www.archlinux.org/art/ .

I don't think The Tor Project should promote Arch Linux.

comment:34 Changed 7 months ago by asn

  • Resolution set to wontfix
  • Status changed from new to closed

This ticket is about the old C-based obfsproxy. Closing.

Note: See TracTickets for help on using tickets.