Commit Graph

251 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
mpl fca3f33449 Merge "search UI: find all roots" 2012-11-16 01:03:54 +00:00
mpl b204d521c3 Merge "fix serverconfig tests, broken because of discovery move from ui to root" 2012-11-16 00:57:24 +00:00
mpl 4a97ef3bb1 Merge "small fixes subsequent to brads comments on 94541905ffe9e92e97125229331ca9a25305381a" 2012-11-16 00:55:29 +00:00
mpl 0824bc7f7c Pointer to minux codereview to do the restart on darwin
Change-Id: I077803b367b543f998d5d25026db2be477963bf8
2012-11-15 18:57:53 +01:00
mpl 535b856e1c small fixes subsequent to brads comments on 94541905ff
Change-Id: I7493cc715f85d146049a452e9808814a13f7468b
2012-11-15 18:42:19 +01:00
Brad Fitzpatrick 3fe746e3aa Merge "find the path to the executable of the running instance to restart camli properly" 2012-11-15 16:45:10 +00:00
mpl 94541905ff use pkg/images (EXIF help) for thumbnails in ui
Change-Id: I60f0102efd1eb5b1c9ca070fe959b499ed8f7c5a
2012-11-15 01:53:58 +01:00
mpl 62b5da6f99 find the path to the executable of the running instance
to restart camli properly

This change adds the functionality to find the path to
the currently running executable, so that camlistore
can be restarted without à priori knowledge of cwd.
It should work for linux, netBSD and freeBSD, and it
might work for openBSD.
The naive (os.Args[0]) approach is still used with
darwin.

Reference: https://codereview.appspot.com/6736069/

Change-Id: Icc9fc2b4e1b3542cfbe6c457c1fefbe762eff2f1
2012-11-14 16:10:50 +01:00
mpl d1e5a1d4c6 search UI: find all roots
This change allows to find all roots (permanodes with the
"camliRoot" attribute) from the search.html ui page.
To achieve that, func (x *Index) SearchPermanodesWithAttr
now uses a prefix string without the query part if the
query is "".

http://code.google.com/p/camlistore/issues/detail?id=35

Change-Id: I396fba683e6e7b2296d1f0df8009c07e3c2cd09d
2012-11-14 11:11:40 +01:00
Brad Fitzpatrick e2a0f194ba Merge "fix search handler test: leading slash for thumbnailSrc removed" 2012-11-12 23:28:46 +00:00
Brad Fitzpatrick 998163ec09 Merge "images: exif, rotation, flipping" 2012-11-12 23:28:29 +00:00
mpl ffcbad9528 fix search handler test:
leading slash for thumbnailSrc removed

Change-Id: If402235986d12bfbba11bbaf4f82d5cb051ec226
2012-11-12 23:20:24 +01:00
mpl fd274ecbb1 fix serverconfig tests,
broken because of discovery move from ui to root

Change-Id: I3e2e5c9280f9ea691d9143aa2bc0a971a6dce325
2012-11-12 23:04:55 +01:00
mpl 858326fec1 images: exif, rotation, flipping
This change implements rotation and flipping on images.
It can be done automatically, using the EXIF Orientation as a hint,
or optionally forced.

Change-Id: I97e887599d6a191964344e81cf8e90922313d958
2012-11-12 21:26:53 +01:00
mpl def34eff94 display thumbnail on the permanode page if content is image.
The serveDescribe search handler now also checks for the
thumbnails req parameter and uses populateJSONThumbnails.
As a result, the client side can directly use thumbnailSrc
from the json response.

http://code.google.com/p/camlistore/issues/detail?id=62

Change-Id: I4ff606f8d3ef291490f05cabdc66219744b53638
2012-11-10 00:04:44 +01:00
mpl 438ae4ecb4 recent permanodes thumbnails
Change-Id: I140766df4b58853e5bc4358f564cf1cfc807882a
2012-11-09 19:43:18 +01:00
Brad Fitzpatrick fddd9e6d2e Merge branch 'master' of ssh://camlistore.org:29418/camlistore 2012-11-09 10:00:55 -08:00
Brad Fitzpatrick ef47a3533e index: fix deadlock, document PeerBlob and friends' lock rules, rename lk to mu 2012-11-09 10:00:47 -08:00
mpl 40bd73ee07 move discovery from /ui/ to / in genconfig too
Change-Id: I1a020696e64c58f911e85070263c015bdbd2be1c
2012-11-08 15:27:17 +01:00
Brad Fitzpatrick db55ee77d9 camput: automatic blobroot path discovery 2012-11-07 22:23:45 -06:00
Brad Fitzpatrick a51cda3a34 client: move stats stuff to stats.go 2012-11-07 21:11:12 -06:00
Brad Fitzpatrick 5221a1ded9 client: document SetHTTPClient 2012-11-07 21:06:10 -06:00
Brad Fitzpatrick 281a6c40f4 client: correct case of SetHTTPClient 2012-11-07 21:03:46 -06:00
Brad Fitzpatrick 3057358cfc Index the dimensions of images. 2012-11-07 23:54:00 +01:00
Brad Fitzpatrick a41269e78e Reindex all dev-server blobs into memindex on restart.
Required some sync work (full syncs on start, blocking full syncs on
start, and also adding a dev-only hack to force a depedency from
search -> sync, to control the handler initialization order, otherwise
publish handlers would race with the sync handler and they'd create
new "blog" and "pics" permanodes and we'd end up with duplicates).
2012-11-07 22:40:17 +01:00
Brad Fitzpatrick 71d7cf9e88 Implement storage generations, init and discovery 2012-11-07 21:14:56 +01:00
Brad Fitzpatrick a6d3151645 gofmt handlers 2012-11-07 20:54:55 +01:00
Brad Fitzpatrick b887087606 Do a TODO: s/errorIsNoEnt/os.IsNotExist/g 2012-11-07 20:02:34 +01:00
Brad Fitzpatrick bccf8ed575 Move discovery up from the UI handler to the Root handler. 2012-11-07 18:57:43 +01:00
Brad Fitzpatrick 5c4d0f71f5 gofmt 2012-11-07 18:49:14 +01:00
Brad Fitzpatrick df5eee936d Make discory work with an Accept header on the root 2012-11-07 18:04:40 +01:00
Brad Fitzpatrick 39d8df7bb2 serverconfig: docs and unexport GenLowLevelConfig 2012-11-07 17:51:42 +01:00
Brad Fitzpatrick 824dbf768f genfileembed: work around a Go 1.0 vs Go 1.1 bug in fmt %q, doing it ourselves.
folder.png and node.png had problems generating on Go 1.1's %q and compiling with Go 1.0.3
2012-11-05 18:43:20 +01:00
Brad Fitzpatrick e582f155ed Thumbnails for permanodes with members (folder) and camliContent to file images 2012-11-05 18:01:03 +01:00
Brad Fitzpatrick 6f82d343ef search: push thumbnail logic into its own function 2012-11-05 17:23:42 +01:00
Brad Fitzpatrick 9b7faaca07 Push server-side thumbnails down into DescribeRequest. Use node.png. 2012-11-05 16:32:56 +01:00
Brad Fitzpatrick 03b8cd143f Start of server-side icon support for recent permanodes list. 2012-11-05 15:48:13 +01:00
Brad Fitzpatrick 832b774025 search: add EdgesTo handler and tests 2012-11-05 15:09:34 +01:00
Brad Fitzpatrick f696007a14 index: implement EdgesTo
For finding back references in the graph.
2012-11-05 10:29:42 +01:00
Brad Fitzpatrick 8c9fba0d71 Merge branch 'rotate' of github.com:bradfitz/camlistore into rotate 2012-11-04 16:34:06 +01:00
Brad Fitzpatrick a2e01c513b Start of images package and EXIF test files.
Change-Id: Ie623ddc7f6df5cbde890a7c0a47affe91780534b
2012-11-04 16:16:02 +01:00
Brad Fitzpatrick e783ad1717 Add another search handler test, for recent permanodes.
Change-Id: Iaf40cd94aba7b96c16fa1b04c2bfcebdfeea870e
2012-11-04 15:26:13 +01:00
mpl 70368abb7d rotate thumbnails
Change-Id: I87dd3008facc5e9c8007fc8ebcba13e98f4a2175
2012-11-04 14:36:31 +01:00
Brad Fitzpatrick 305b4557b9 Improve search handler tests.
Change-Id: I5639447cc95f06d0773e7f15cb601d51c7dd5031
2012-11-04 13:59:19 +01:00
Brad Fitzpatrick 546e2fc14d Send Content-Length on JSON responses
Change-Id: I7e8034b0aea8031011607527f237e24d63b88502
2012-11-04 13:50:35 +01:00
Brad Fitzpatrick ab98ebfa23 some FakeIndex docs
Change-Id: I508e5326c07c8cc7bd39068a2d7e342d0b27884c
2012-11-04 12:38:33 +01:00
Brad Fitzpatrick 933375019d Remove *testing.T from IndexDeps constructor; use Fataler interface
Change-Id: I1cfcc2fa8059dca3f4e082c1dae896974d3d0e02
2012-11-04 12:27:45 +01:00