Commit Graph

16 Commits

Author SHA1 Message Date
Salman Aljammaz 10d67c6d20 localhost auth: resolve localhost to [::1] if using ipv6
http://camlistore.org/issue/238

Change-Id: Icab7d87fe651365fb44db4c2874d4976fa631ad6
2013-10-21 17:02:03 +01:00
Bill Thiede c5434e293d netutil: for better backtraces use named function.
Per feedback on https://camlistore-review.googlesource.com/507

Change-Id: Id6c0e4f66d221e6677167aaf590dc3cc696e5391
2013-08-18 11:36:35 -07:00
Bill Thiede 3418ed1d89 netutil: On FreeBSD replace call to lsof(1) with sockstat(1).
sockstat(1) is in the base system image, whereas lsof(1) is only avaible
through ports.

The addresses Issue 190

Change-Id: I5e3cd6b6c10d2aa75f799320d80acfd61275ea62
2013-08-18 03:41:03 +00:00
Bill Thiede e6b86ddb9d Fixes to appease make presubmit and make forcefull on FreeBSD.
This change adds a dependency on lsof(1) when running on FreeBSD.
lsof(1) is not part of the base system, and lsof(1) would need to be
installed (usually from ports).  If lsof(1) is not installed an error
will be returned in the form of:

ident_test.go:88: exec: "lsof": executable file not found in $PATH

Change-Id: I3cb15af369dc10a8a39aeaf82cceff3c788104b8
2013-08-03 11:48:57 -07:00
Brad Fitzpatrick b6a688ba8a netutil: return ErrUnsupportedOS and skip tests if not darwin or linux
Change-Id: I50235b0112668a50776043708e9bb8eb13131900
2013-07-29 14:19:28 -07:00
Brad Fitzpatrick 9468e5ba70 More docs. Every package is documented now.
misc.CountingReader moves into readerutil.

pkg/atomics is folded into pkg/types.

pkg/test/testdep is folded into pkg/test, with better name/docs.

Old cruft from pkg/webserver is deleted.

Change-Id: I3f72d8b29804254ef944995fb085837c878f79f5
2013-07-07 21:12:30 -07:00
Brad Fitzpatrick ca58d8e2e0 Remove noisy var _ = log.Printf lines.
Change-Id: Ia58b8ef5f271f542ae4fe61c7fb1497322770322
2013-06-14 12:55:55 -07:00
mpl fbead58f92 fix tests for images and netutil
Change-Id: I89d978ce25cc8748ffab54aa3112e6b854f73b85
2012-11-19 19:52:06 +01:00
Maxime Lavigne 3ec58472db Modifications allowing /setup to be view on Windows
When you go to /setup on Windows, it currently checks
the "localhostAuthorized" function that checks your
UserID with os.Getuid() and than check with the local
and remote address to see if you are allow. In Windows
os.Getuid will always equals -1 and the function default
to unallowed. On darwin, it does check for uid but
afterward only cares if the local and remote addresses
are loopback addresses.

So, I changed this function so that when the os.Getuid
is not avalaible on the platform and returns -1, it does
the same check as in darwin.

I also modified the "isLocalhost" function to use the
helper function "net.IsLoopback" instead of string matching.

Since, I already had parsed addresses and had to call
AddPairUserId, I checked if it wouldn't be simpler to
pass net.Addr directly instead of strings and reconvert
them afterward. It seemed after looking at all the code
that called this function that it simplified calls quite
a bit to do so.

Finally, I modified "netutil.Localhost" for it to return
the first IP it finds instead of the string representation
of the first IP enclosed in square brackets. Since the square
brackets around the IP are only necessary in a TCPAddr, it
would be simplier and more robust for the user to directly
print TCPAddr instead of appending this string to a post.

Change-Id: Id79de6bebd6380f877074211c0d260782058765f
2012-11-18 20:20:25 -05:00
mpl 6ac49843ab fix IPv4 assumption
Change-Id: I334e6ccb5b26a083b55750271262a3469f63e78e
2012-10-16 00:20:57 +02:00
Brad Fitzpatrick 767c81071d netutil: change mac lsof args. might be faster. didn't fix previous deadlock, though.
Change-Id: I159e9de4526683ae2f1fd2c18042b94e20029fdb
2012-04-27 18:51:07 -07:00
Brad Fitzpatrick 95d46f1c47 netutil: better error message when ident connection isn't found.
Change-Id: If18d32d31b0701f7ac770313f337ea0aef43adaf
2012-04-27 16:27:25 -07:00
Brad Fitzpatrick af78a93c9a netutil: implement IPv6 ident on Linux; add http auth handler example.
Change-Id: I35c8993909cbddd22ace481a4a5bf7e36c323fec
2012-03-27 17:28:42 -07:00
Brad Fitzpatrick 6078992fe0 netutil: implement ConnUserid on darwin.
Change-Id: I6d163a921966dea4be9908c676bdb5d035cba295
2012-03-27 15:54:34 -07:00
Brad Fitzpatrick 2838ec13dd netutil: add end-to-end ident test; passes on Linux, fails on Darwin
Next up: implement on Darwin.

Change-Id: Ib41f5e5c6fd086dfc4bfd3205d1d807fbd9cecb2
2012-03-27 10:58:41 -07:00
Brad Fitzpatrick 0714a463c9 Update from r60 to [almost] Go 1.
A lot is still broken, but most stuff at least compiles now.

The directory tree has been rearranged now too.  Go libraries are now
under "pkg".  Fully qualified, they are e.g. "camlistore.org/pkg/jsonsign".

The go tool cannot yet fetch from arbitrary domains, but discussion is
happening now on which mechanism to use to allow that.

For now, put the camlistore root under $GOPATH/src.  Typically $GOPATH
is $HOME, so Camlistore should be at $HOME/src/camlistore.org.

Then you can:

$ go build ./server/camlistored

... etc

The build.pl script is currently disabled.  It'll be resurrected at
some point, but with a very different role (helping create a fake
GOPATH and running the go build command, if things are installed at
the wrong place, and/or running fileembed generators).

Many things are certainly broken.

Many things are disabled.  (MySQL, all indexing, etc).

Many things need to be moved into
camlistore.org/third_party/{code.google.com,github.com} and updated
from their r60 to Go 1 versions, where applicable.

The GoMySQL stuff should be updated to use database/sql and the ziutek
library implementing database/sql/driver.

Help wanted.

Change-Id: If71217dc5c8f0e70dbe46e9504ca5131c6eeacde
2012-02-18 21:53:06 -08:00