Commit Graph

48 Commits

Author SHA1 Message Date
mpl 63d6e384bb path fixes for third_party move
A few more left in in misc/docker that I'll do separately

Related: 75d60962f6

Change-Id: Id5f6a3729e33aca97f8664ca8ef91afc64461891
2016-04-21 12:25:17 -07:00
Tamás Gulácsi 7402cc0efd Delete misc unused objects
Using honnef.co/go/unused/cmd/unused

Change-Id: I672b3cb77f09e9bd80dcdc149cde4f7f2939e451
2016-04-06 17:59:51 +02:00
Will Norris 77ed42edf8 add canonical import paths
The import path was added to the go file that included the package
documentation if one existed.  Otherwise, I used what seemed to be the
primary file for the package.

Fixes #689

Change-Id: If51be0e86529fd6f179e80af6781e639f8550fd2
2016-03-13 19:57:14 -07:00
mpl c38f2a8ea2 pkg/misc/amazon/s3: fix test for Client
Because omitted in b9aec12f31

Change-Id: I2ca82360b3ff90d65be6f84eabdb785efcee99a9
2016-01-27 15:57:14 +01:00
mpl b9aec12f31 blobserver/s3: limit concurrent PutObject calls
Fixes issue #675

Since camput does not seem affected by the above issue, and that camput
(pkg/client really) main difference in how it uploads is that it does
gated requests, it seemed to follow that gating the requests might fix
the problem.

With this change, I don't see the problem anymore either in
TestS3WriteFiles or by manually uploading with the web UI.

I suppose this indicates that S3 throttles incoming connections pretty
strictly, but I have no formal evidence of it.

Change-Id: I48f10923a710f4a21e44bc251e648db37ae504ec
2016-01-25 21:39:57 +01:00
mpl 92d5c1d045 pkg/blobserver/s3: directory & blobpacked support
Fixes issue #529

Change-Id: Iea7aea015b58c0325887fa07ae3a004b7822511e
2015-12-16 23:58:27 +01:00
Brad Fitzpatrick 9868aa0f8d Remove httputil.CloseBody relic. 2015-11-23 19:02:10 -08:00
mpl b6eb85631c blob SubFetcher: explicitely states with errors the testSubFetcher constraints
testSubFetcher in blobserver/storagetest was already checking that we'd
get specific error messages in the case of negative input parameters or
an out of range offset.

This change rationalizes these constraints with named errors
(ErrNegativeSubFetch and ErrOutOfRangeOffsetSubFetch) specified
in the SubFetcher interface.

It also fixes the googlestorage and s3 implementations so that they pass
the aforementioned test.

Change-Id: I25b72b842855b90ee3cab44c90654581dccf4b8e
2015-02-26 15:18:27 +01:00
Emil Hessman e8ffb9a66c pkg: fix various vet reports
Change-Id: I0b7fa09849650fe696e59ad5c5c73a034ab80faa
2014-11-12 23:25:53 +01:00
Brad Fitzpatrick 0e841e0f51 Rename pkg/misc to pkg/hashutil
It only had one function anyway.

Change-Id: Iec4b7868d823148c8e1d2607347fe9d3c1463403
2014-11-06 13:31:58 -03:00
mpl 917a09ca6d Merge "blobserver/s3: implement SubFetcher" 2014-10-19 14:13:02 +00:00
mpl b24580d523 blobserver/s3: implement SubFetcher
Change-Id: I42ac364e268463998598990a8bf0df7437f4d05d
2014-10-19 16:11:54 +02:00
Brad Fitzpatrick 1f75759371 s3: style fixes
Change-Id: I0c8dacb00f57d374c3148fe5c8017a9f146d36f4
2014-10-19 13:35:42 +02:00
tnt 4ac9938c8b Fixed some formatting functions that were called with invalid number/type of arguments.
Change-Id: I261c6fb732a6cf1e54e01fa3e5388c39c6deb720
2014-07-01 12:48:33 +02:00
mpl ae4716fcf1 ui tests: check both locally and globally for node modules
Change-Id: I1378e07c055b85402296ca0bfc5c4ba14ae8c2bf
2014-06-06 23:29:08 +02:00
Brian Gitonga Marete 630ba8c68f pkg/misc/amazon/s3: Fix test broken by commit bf8d6bdb.
Commit bf8d6bdb (s3: auto-select correct region, handle buckets with
dots in hostname) changed the definition of s3.Client replacing the
second field, which was of type *http.Client, with a field of type
http.RoundTripper. But the test utility function getTestClient() was
not modified accordingly. Fix this to make `go test' in
pkg/misc/amazon/s3 succeed again (without this fix the test fails to
build).

Change-Id: Ida383e2050e215cc2446303c0ce59aa7ab6e7981
2014-05-13 14:23:04 +03:00
Brad Fitzpatrick bf8d6bdb4f s3: auto-select correct region, handle buckets with dots in hostname
Fixes camlistore.org/issue/404

Change-Id: Ia6b3f51f1fd5beba585fa8dd8a918d30905fb9bb
2014-05-08 15:31:48 -07:00
Brad Fitzpatrick 559f6530a8 Merge "Switch to different S3 endpoint Switch to a URL in the form of https://s3.amazonaws.com/mybucket.mydomain.com/myObjectKey This adds support for buckets with periods in their name and S3 clones" 2014-05-08 22:22:47 +00:00
Govert Versluis cef0aa0d16 Switch to different S3 endpoint
Switch to a URL in the form of
https://s3.amazonaws.com/mybucket.mydomain.com/myObjectKey
This adds support for buckets with periods in their name and S3 clones

Addresses https://code.google.com/p/camlistore/issues/detail?id=404

Change-Id: Id5c744c88916dbac5a0ab01330929546984ef2d2
2014-04-14 10:48:03 +02:00
Brad Fitzpatrick bf708b005d closure: ignore emacs temp files in gendeps
Change-Id: I634d46f2f55673eb81dcc8532bdc2ba4fc294c5f
2014-04-05 19:13:58 -07:00
Govert Versluis 33d5718843 Added missing check for http.StatusOK in Stat.
Also made checks for http.StatusOK / 200 uniform

Change-Id: I8ef608dc098cdfd221a53be20801d7dcdcdf7655
2014-03-23 17:37:16 +01:00
Brad Fitzpatrick bfde349851 s3: do some retries in ListBucket, to work around Amazon-vs-Go's HTTP/TLS bug
Change-Id: Idfc8187d07f558f2e7c590dc6c14c66791f46e57
2014-03-17 22:59:02 -07:00
Antti Rasinen f837fcb9d8 Convert all S3 requests to HTTPS
Also includes fixes for two missing data items
for errors.

Change-Id: Ib174b4bf83f3f264f463b4c203c1f42213b18f5e
2014-03-09 21:00:13 +02:00
Brad Fitzpatrick ea15158f7c Enumerate changes for future sync changes
Add blobserver.EnumerateAllFrom, make S3 client API match the underlying S3 protocol
with marker instead of after, and then push after->marker conversion logic up
into the s3 enumerate code that's using the S3 client.

Change-Id: I034a7c1c8af441881ebba74bcb523bd690cd16d3
2014-03-04 12:11:59 -08:00
Brad Fitzpatrick eb27581da7 httputil: add DecodeJSON and CloseBody helpers, then use them everywhere
httputil.CloseBody closes a http.Response.Body nicely, such that it's
more likely to be re-used.

httputil.DecodeJSON parses JSON from a Response.Body and closes the
body. It also keeps a temporary copy of the input, for error messages.

Then use them everywhere, to improve HTTP TCP connection re-use.

And misc other clean-ups.

Change-Id: I5dc44be0165b13659459ed29ce5ab44c17d9739f
2014-01-28 22:00:52 -08:00
Aaron Boodman 53e12a740c Add jstests.go, a unit test harness for JavaScript files.
Change-Id: I3d755f0001c0528f5db2dbe8cdfc10fa60443c89
2014-01-06 20:21:43 -08:00
Brad Fitzpatrick 3e725e2a98 Change self-signed cert fingerprint to 80 bits of SHA-256.
More secondary preimage resistance. Also better docs and less vague and less promoted Android
UI.

Feedback from Adam Langley, but likely misinterpreted.

Change-Id: I3bf1029b6fc07c0b8dab2af44926aa87b0d4cbad
2014-01-04 16:37:33 -08:00
Brad Fitzpatrick 9366723666 Rename pkg/misc/resize to pkg/images/resize
Change-Id: I9b8105cbae0c6dc66ccbb1dd15a48363ee2f1e85
2013-12-16 17:49:28 -08:00
Brad Fitzpatrick 4fca427a28 misc/resize: don't depend on Go 1.2 image/color/palette in test 2013-12-16 10:19:55 -08:00
Bill Thiede 036e35a258 images: performance and memory improvements.
Makes the assumption that our old image logic was 'If the image is
huge (>2400px) shrink it to twice the target thumbnail size with
resample (which is quick) then box filter the image in half (which is
slow)'.  There was a bug there that was causing large intermediary
images to be allocated when the source image was just the right size
and in portrait orientation (mainly trigger by photos from my Nexus 4).

Generalizes resize code to always resample to 2 times the thumbnail
size and then smooth down.  Throws more pixels away faster.

Add downsizing routines that operate inplace.  This greatly reduces
our peak memory usage when generating thumbnails.

Add version optimized for our particular resize case (halving);
providing a speed boost over the generalized versions.

Add tests and benchmarks comparing new resize to old.

Test for pkg/misc/resize can be run with --output=output_dir/ to see
the images generated by the old and new resize routines along with
mask of their differences.

Addresses some of the concerns in https://camlistore.org/issue/237

Change-Id: I6464fa637da9db371f15761bb699c045604b6cb8
2013-12-14 16:28:49 -08:00
Brad Fitzpatrick f3f48eb70b Support alternate S3 hostnames
Change-Id: I9a27eb5fb9c4e5ef3b516ce9cf5a4b5bb4e1df61
2013-09-01 09:50:35 -07:00
Brad Fitzpatrick 91cdda8475 Match common Go case
Change-Id: I14606ee5ba422cf43f68dc65af2b40a096c7ca35
2013-09-01 09:13:13 -07:00
mpl e682cda008 appengine: fix build issues
split pkg/jsonconfig/sign.go and pkg/server/root.go
because of unsupported stuff on appengine

Change-Id: I6f97ec2e043dabbe54971a88dc401a45ba36a60a
2013-08-11 19:42:57 +02:00
mpl 6c4dc821fa update closure library: automatically generate the list of required files
Also updated parseProvidesRequires to use a bufio.Scanner

http://camlistore.org/issue/149

Change-Id: I13df7f03e3482b77e71687adc2b71b8dd9eeb0db
2013-07-19 19:22:41 +02: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
mpl 004c261358 closure: GenJSDeps now takes a VFS, delete ui/deps.js
This changes allows to always dynamically serve deps.js, generated
either from the local files, or from the embedded resources.
ui.go and publish.go now make use of it.

http://camlistore.org/issue/151

Change-Id: I129895b2c65a0726c1239bdd7387c62e90649a9d
2013-07-05 19:43:22 +02:00
Brad Fitzpatrick 1c4964c1bc Merge branch 'master' of ssh://camlistore.org:29418/camlistore 2013-06-14 12:56:04 -07:00
Brad Fitzpatrick ca58d8e2e0 Remove noisy var _ = log.Printf lines.
Change-Id: Ia58b8ef5f271f542ae4fe61c7fb1497322770322
2013-06-14 12:55:55 -07:00
mpl ad5f3b854d genjsdeps: now pkg + cmd in misc/closure/
pkg/server/ui.go uses misc/closure too

fixes http://camlistore.org/issue/142

Change-Id: I614e34e6b7d493d66aa61108e3ca940854844c0f
2013-06-14 00:29:45 +02:00
mpl 89e14d8f7d misc/genjsdeps: command to generate closure deps
reusing code from pkg/server/ui.go

Change-Id: I56b8d4b42df2fbcbbe3d654261036cdb907f9f27
2013-06-11 00:00:47 +02:00
mpl ac431439f3 Allow HTTPS with a self-signed certificate.
A new client configuration parameter, "trustedCerts" (list of strings)
is introduced. A certificate fingerprint is defined as the 10 digits
prefix of the sha1 of the whole certificate (in ASN1. DER form).
trustedCerts should contain the list of fingerprints of the
certificates we trust. If not empty, the server's certificate
is checked against that list, instead of using the full x509 validation
on it.

-added a dial function and tls configuration, which check if we're using
SSL, and if we're in "trustedCerts" mode.
pkg/client/client.go
pkg/client/config.go

-moved android specific hacks from camput to the client layer, so that
the dial and tls config could reuse/access them. Also allows future
reuse for other commands, such as camget.
pkg/client/android.go

-adapted camput to the above changes:
cmd/camput/android.go
cmd/camput/camput.go
cmd/camput/files.go

-server prints a hint when it generates the self-signed:
pkg/misc/misc.go
server/camlistored/camlistored.go

-camliactivity:
clients/android/res/xml/preferences.xml
clients/android/src/org/camlistore/Preferences.java
clients/android/src/org/camlistore/SettingsActivity.java
clients/android/src/org/camlistore/UploadService.java
clients/android/src/org/camlistore/UploadThread.java

http://camlistore.org/issue/131

Change-Id: I6be20161549a69aafc8eb7b9e96e9351dc1c5b09
2013-04-23 17:10:37 +02:00
Brad Fitzpatrick 5f6130b13b gethandler: use http.ServeContent; delete pre-Go 1 HTTP Range stuff
Change-Id: Icef01ea04aa7d38fc39c829618ff2856449eb326
2013-01-20 14:06:55 -08:00
Brad Fitzpatrick 37bf028633 s3: verify configured bucket exists at start-up.
Change-Id: I43d0795641fe9dbc345a1f0916b828ede76cf4a6
2013-01-20 11:33:41 -08:00
Brad Fitzpatrick 2fe555aeb9 s3: remove debug logging
Change-Id: Idd4c3538362dd14b59ae6b150992d806ae7ff6b8
2012-12-22 18:45:27 -08:00
Brad Fitzpatrick c83e29cfde s3: improve bucket enumeration
Change-Id: I65ed4a6575250bb2005215df461ada64ac20e41e
2012-12-22 13:50:18 -08:00
Brad Fitzpatrick 21d142e538 s3: some work on Buckets, add TODO
Change-Id: I183a85a0b9639790adec025830dae2f276006290
2012-12-21 16:23:19 -08:00
Brad Fitzpatrick 64bbffc3b5 move fileembed from misc 2012-02-28 12:45:46 +11: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