Commit Graph

11 Commits

Author SHA1 Message Date
Brad Fitzpatrick 306b58afd6 Merge "Modifications allowing /setup to be view on Windows" 2012-11-19 01:16:23 +00: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 3117265b61 bugfix in auth; mode was not set by config in localhost case
Change-Id: I5349af00d7629ca77de73dd886ba44d6bbc56da0
2012-11-16 18:12:41 +01:00
Brad Fitzpatrick 89eeb6e3d5 auth: remove import
Change-Id: Ic31bc3ce05caee2b41aad127ed807be8c057f3d2
2012-04-27 18:57:24 -07:00
Brad Fitzpatrick 8bcae0d59b auth: work around darwin lameness
Change-Id: I5899bffd9383dd22cac3f4fe5e4cd4da11b3a167
2012-04-27 18:49:42 -07:00
mpl f7448ec758 restrict setup access to localhost
Change-Id: I889b9debfc65e25084c1e9715e7d14621f009039
2012-04-15 20:09:51 +02:00
Brad Fitzpatrick 93af191e77 auth: add some more auth modes
Change-Id: I1674f5fff8a8ea3490f315844df68a474f8c6d5e
2012-04-12 16:54:25 -07:00
Brad Fitzpatrick 029d66fa9e In default config, allow localhost access for auth also.
Change-Id: Ie3fc2f3c44d7fc17a367f6a456c6db6511d08f33
2012-04-07 19:02:31 -07:00
Brad Fitzpatrick 40712671ee pkg/auth and pkg/schema: fix tests.
Change-Id: I54f391241c77902ad301edea92d39660f7cf0008
2012-03-29 16:15:59 -07:00
Brad Fitzpatrick 6c6dcdc8a1 auth: in dev mode, use localhost TCP port owners before http basic auth
Change-Id: I6a45518811fd8726233171d5436c625c645b4037
2012-03-27 17:57:13 -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