Commit Graph

90 Commits

Author SHA1 Message Date
Brad Fitzpatrick 45f873a1c8 app/...: fix staticcheck warnings
Signed-off-by: Brad Fitzpatrick <brad@danga.com>
2024-01-14 12:53:42 -08:00
Oleksandr Redko a911bc8060 all: fix or disable staticcheck deprecations
(Originally from https://github.com/perkeep/perkeep/pull/1648)
2024-01-13 16:50:09 -08:00
Brad Fitzpatrick d030e15d5a app/publisher, make.go: remove publisher/GopherJS support
The publisher app required GopherJS which has been behind upstream Go
for many years. This just removes all GopherJS stuff, breaking the publisher
app in the process. We'll have to rewrite it.

Signed-off-by: Brad Fitzpatrick <brad@danga.com>
2023-12-31 13:17:08 -08:00
Brad Fitzpatrick bec657b7e2 Remove legacy +build comments; use go:build only
Signed-off-by: Brad Fitzpatrick <brad@danga.com>
2023-12-31 09:18:39 -08:00
Brad Fitzpatrick a549aab217 Remove legacy Google AppEngine alternate implementations
AppEngine lets you do just about anything these days. No need to cater
to the ancient limited version.

Signed-off-by: Brad Fitzpatrick <brad@danga.com>
2023-12-31 08:50:03 -08:00
Oleksandr Redko 44b1dbe0f6 all: refactor to net/http statuses instead of ints 2023-01-24 08:39:29 -08:00
Oleksandr Redko 001c417e73
all: replace deprecated io/ioutil with io and os (#1647) 2023-01-23 10:25:14 -08:00
Michael Hoffmann f06efdb51f misc: remove sha1 from tests, remove testhooks, minor cleanups 2023-01-13 07:58:19 -08:00
Brad Fitzpatrick 921894783b all: gofmt for Go 1.19
Signed-off-by: Brad Fitzpatrick <brad@danga.com>
2022-12-31 22:45:40 -08:00
ginabythebay b2d3e64a0f
Fix #1635, trim slash when looking up resource files (#1637) 2022-12-31 21:46:44 -08:00
Gina White 5576dea344 camlistore.org -> perkeep.org
fix up some links

There are still some references to camlistore.org that I don't
understand so left alone.
2022-12-31 20:44:52 -08:00
luz paz d605f86c82 Fix various typos
Found via `codespell -q 3 -S ./clients/web/embed,./clients/chrome -L ba,everytime,impres,keypair,msdos,pres,ro,te,ue`
2022-05-02 14:31:09 -07:00
Tamás Gulácsi 1c400bd5b3 Remove unused code
as `staticcheck -checks=U1000` suggested.
2021-08-09 17:34:14 +02:00
Alexandre Viau ccad6635e4
move to go:embed (#1396) 2021-07-29 15:24:05 -04:00
aviau 231ba4233f pkg/schema: create CamliType type
Create a CamliType type in pkg/schema and use it in a couple of
packages.

It can be implemented in other packages as we go.
2021-01-19 00:47:58 -05:00
Attila Tajti 9a1336816a app/publisher/js: support for sha224 hashes (#1293)
Fixes #1292
2019-12-27 21:59:25 +01:00
mpl 40657f8271 app/publisher/js: make it ignored by tests, with build tag
Since we do not systematically regenerate app/publisher/js/zsearch.go
anymore (because it's part of building the web UI process),
go test ./app/publisher/js
would fail. But we want go test ./... to succeed, so we add build tags
in ./app/publisher/js so that it gets ignored by default.

Change-Id: Ia77689ed937411a628e903189433b70be659e941
2019-04-30 23:50:40 +02:00
Brad Fitzpatrick 46bb719dc5 buildinfo: track Version and Dockerfile separately
And don't hard-code VERSION info in the Dockerfile.

Change-Id: I35cb22fbb56cd634be4f1342c54ca86ce0e79901
2018-05-02 13:36:32 -07:00
mpl d196d34d63 app/publisher: fix the tests
Change-Id: I87534c8fff76e2b28693c8176012b1b0864c153a
2018-05-01 12:52:02 -07:00
Brad Fitzpatrick ca76a40bbc Rename camlistored to perkeepd.
Updates #981

Change-Id: I8fe43c240c149074c23128a89ab426af9cbf94b4
2018-04-21 11:06:09 -07:00
Paul Lindner 84b2c6b3e4 all: various lint fixes
- correct logging that logged functions instead of their value
- use ID vs Id naming
- use correct function names in comments

Change-Id: I61562cef7ebac7337ec6c85312cdf7915cb1a84b
2018-02-05 11:59:00 -08:00
Paul Lindner 459c75410e all: more renaming of Camlistore to Perkeep
Change-Id: I118e3cbcf20d80afeffc84f001388c4556f21628
2018-01-30 03:02:56 -08:00
Brad Fitzpatrick 194d4f9443 blobserver, all: add contexts to ReceiveBlob, Fetch & million resulting deps
I had intended for this to be a small change.

I was going to just add context.Context to the BlobReceiver interface,
but then I saw blob.Fetcher could also use one, so I decided to do two
in one CL.

And then it got a bit infectious and ended up touching everything.

I ended up doing SubFetch in the process by necessity.

At a certain point I finally started using context.TODO() in a few
spots, but not too many. But removing context.TODO() will come in the
future. There are more blob storage interfaces lacking context, too,
like RemoveBlobs.

Updates #733

Change-Id: Idf273180b3f8e397ac5929c6d7f520ccc5cdce08
2018-01-18 16:22:16 -08:00
Paul Lindner b88b82f1ee all: convert imports of golang.org/x/net/context to context
Change-Id: I01cfa903ab2b97a1ad3ea57eb29fe88819216a3f
2018-01-13 16:37:49 -08:00
Brad Fitzpatrick 57648c6b83 all: update copyright holder from Google Inc to The Perkeep Authors
The AUTHORS file is the list of copyright holders.
2018-01-03 16:52:49 -08:00
Brad Fitzpatrick c3d05cdce9 Move more packages out of pkg/ and into internal/
Moved hashutil, httputil, osutil, netutil,
images, media, magic, video, and rollsum.
2018-01-02 21:03:30 -08:00
Brad Fitzpatrick d6a0b05df0 Rename import paths from camlistore.org to perkeep.org.
Part of the project renaming, issue #981.

After this, users will need to mv their $GOPATH/src/camlistore.org to
$GOPATH/src/perkeep.org. Sorry.

This doesn't yet rename the tools like camlistored, camput, camget,
camtool, etc.

Also, this only moves the lru package to internal. More will move to
internal later.

Also, this doesn't yet remove the "/pkg/" directory. That'll likely
happen later.

This updates some docs, but not all.

devcam test now passes again, even with Go 1.10 (which requires vet
checks are clean too). So a bunch of vet tests are fixed in this CL
too, and a bunch of other broken tests are now fixed (introduced from
the past week of merging the CL backlog).

Change-Id: If580db1691b5b99f8ed6195070789b1f44877dd4
2018-01-01 16:03:34 -08:00
Attila Tajti e68b6dc7cf app/publisher: rewrite gensearchtypes.go using go/ast
Use the go/parser to parse, go/ast to modify and
go/format to write the types needed for publisher/js
instead of running godoc.

Change-Id: I567fac9e6cdd0cb29fbd097b0d478fd9f35864fb
2017-12-30 02:25:45 +01:00
Paul Lindner b09cd377d7 Switch to stdlib context from golang.org/x/net/context
This switches most usages of the pre-1.7 context library to use the
standard library.  Remaining usages are in:

  app/publisher/main.go
  pkg/fs/...

Change-Id: Ia74acc39499dcb39892342a2c9a2776537cf49f1
2017-11-26 01:12:26 -08:00
Mathieu Lonjaret 32fbc99a66 Merge "app/publisher/js/zsearch.go: do not track in git" 2017-10-29 15:16:19 +00:00
mpl c3e7fc8002 app/publisher: remove useless urlquery escaper
According to https://golang.org/pkg/html/template/#ErrorCode
(ErrPredefinedEscaper), the template engine already performs
sanitization equivalent to urlquery on any pipeline, and therefore makes
this extra urlquery call unnecessary, and even maybe harmful.

Change-Id: I7fcce395bf015b64022d1ac66b42069cdefb69eb
2017-10-04 18:41:32 +02:00
mpl 683fa350f7 app/publisher: remove now disallowed html escaper from template
Apparently the html escaper was not being used in the right order/place,
and the auto-escaper does a better job than us at escaping?

For reference: https://go-review.googlesource.com/c/go/+/37880

I have noticed some odd results when trying other escaping combinations,
but that's a Go problem, if any, that I will investigate independently.

Fixes #960

Change-Id: I43e6eca26404d0bcbc7a48764393186f1d112dbc
2017-09-29 00:15:51 +02:00
mpl f7cbcc7812 app/publisher/js/zsearch.go: do not track in git
If we keep app/publisher/js/zsearch.go, when running make.go, it first gets mirrored into
CAMLI_ROOT/tmp/build-gopath-nosqlite/src/camlistore.org/app/publisher/js/zsearch.go
, with the same modtime as app/publisher/js/zsearch.go.

Then in genSearchTypes,
CAMLI_ROOT/tmp/build-gopath-nosqlite/src/camlistore.org/app/publisher/js/zsearch.go gets
regenerated anyway, because its modtime is older than that of
CAMLI_ROOT/tmp/build-gopath-nosqlite/src/camlistore.org/pkg/search/describe.go

Then in a subsequent run of make.go, the mirroring overwrites the newly regenerated file,
because its modtime is different (indeed, it is newer) than that of
app/publisher/js/zsearch.go

And the cycle repeats ad vitam eternam.

I think if we added app/publisher/js/zsearch.go to mirrorIgnored, it
might fix the problem, but I don't see the point in even keeping
zearch.go in git at all, so I propose with this CL to simply remove it.

If removed, it is simply generated at the first make.go run, and never
again afterwards (except if pkg/search/describe.go changes).

Fixes #957

Change-Id: Ia6fcc50ce33513a2003809783fc323ab36a60b52
2017-09-22 00:10:51 +02:00
Paul Lindner fa46c3935d Correct various misspelled words
Change-Id: I236e880526e4c2b0bd318da041983d557e0aa885
2017-09-11 08:33:31 -07:00
Fabian Wickborn bee7463f74 app/scanningcabinet/scancab: Count PDF pages with rsc.io/pdf
This commit changes the PDF page count so that a pure-Go count is tried
first. If that fails, a fallback to counting the pages with the
external tool "pdfinfo" is made.

Change-Id: I3a1b665b6b7c5996bc9154f754cbd900a1170119
2017-07-28 07:00:49 +02:00
Fabian Wickborn 6393fc4275 app/scancab: fix filename regexp for updateLoop
This commit removes two slashes from the filename regexp which prevented
successful matching of files to upload to the scanningcabinet.

I assume that the slashes were just a leftover from the port from Perl.

Change-Id: I6712c9c5464d7ecd748fb352a993afbc759edbec
2017-07-15 13:26:08 +02:00
Steve Armstrong 8197b88059 app/scanningcabinet: Show doc's other tags in search results
When listing documents that matched a given tag search, show the other tags those docs have

Change-Id: Id8897c4bcd1958cb7d8cac2a59e60e6f975180c5
2017-05-28 10:42:55 -07:00
mpl 1e2d3661b6 pkg/server: give a caching fetcher to downloadhandler
When the DownloadHandler handles a zip archive requests, it writes the
zip archive being built directly to the network response, in order to
avoid writing any of the files to disk or to memory. As a consequence,
as soon as the archive starts being built, if any error reading one of
the files occurs, it can't properly report it to the client as the
response had already started being sent.

In this change, if the DownloadHandler's Fetcher is a caching fetcher,
we try reading all the requested files before starting the zip archive.
As a result, we can error early and properly if any of the files can't
be read. And since the blobs get cached as they are read the first time,
reading them a second time when actually building the archive should not
be too costly.

Change-Id: I6477d82149b08b1db1471ca9ad77fef254929db0
2017-05-15 15:29:07 +02:00
Steve Armstrong c5d80de3b9 app/scanningcabinet: Always include jQuery
Change-Id: I7557c99e922e9fb0dbb30e1c7b66dfae9f136aa0
2017-05-11 20:48:57 -07:00
Mathieu Lonjaret 8f1a7df176 Merge "app/publisher: variable width images in UI" 2017-04-29 14:31:54 +00:00
Attila Tajti c5b444807b app/publisher: variable width images in UI
Change the css to allow variable width images, keep constant height only.

Use a fixed limit maxThumbWidthRatio to limit thumbnail image width
for panoramic images.

Fixes #902

Change-Id: I60c16c63b018680885c67f00b47e2e96c8dba47e
2017-04-29 06:25:31 +02:00
Attila Tajti a684dd010a app/publisher: add zip download file times
Change-Id: I2a13a2588d2a2142ca3b89fbc61026030b8b0393
2017-04-27 01:08:38 +02:00
Mathieu Lonjaret 5d6c006be3 Merge "app/publisher: use relative paths in filenames within zip" 2017-04-26 14:19:34 +00:00
Attila Tajti f504d10ee4 app/publisher: use relative paths in filenames within zip
Change-Id: Ib491b8e664e2f623d61dfd8afb81242042c0cd5c
2017-04-26 07:30:23 +02:00
Attila Tajti c1eeefe837 app/publisher: use scheme from window.location
Also remove the scheme variable from the template that
tells what protocol the backend uses to talk to camlistore.

Fixes #920

Change-Id: Ia25e99d0f1b77077158f761f11a5c6bacfa2dc3b
2017-04-25 16:33:14 +02:00
mpl fae92b072e app/scanningcabinet: add go doc
Change-Id: I7076e0777a10675b0cf1ae5ed86e473dad148c46
2017-04-12 18:36:31 +02:00
Steve Armstrong af5c7d1535 app/scanningcabinet: fix tag cloud and add typeahead
* Switch getTags to return a frequency map
* Removed old tag cloud library because it has been [archived and is not available](https://code.google.com/archive/p/visapi-gadgets/)
* Switched to [jQCloud](http://mistic100.github.io/jQCloud/) and vendored in the CSS and JS
* Add type-ahead suggestion for tag search box and tag edit page

Change-Id: I69b00b107d531f744c1a96cd986dee34fb3dfe06
2017-03-31 23:58:27 -07:00
Steve Armstrong 70746313f6 app/scanningcabinet: logf for prefixing
Change-Id: I9baf72c2d9f0e02f121c28638533ed43980219ff
2017-03-28 21:15:02 -07:00
Steve Armstrong 9e2e35cf6f app/scanningcabinet: move static UI files to folder
Change-Id: I410fbaf0a113732cc2bde319607edab384122678
2017-03-24 21:36:03 -07:00
Mathieu Lonjaret 75424def01 Merge "pkg/server: add files "zipper" to DownloadHandler" 2017-03-17 13:36:40 +00:00