Commit Graph

1158 Commits

Author SHA1 Message Date
mpl 4d16a0e5c3 server/perkeepd: self-fix instance user-data
Since we renamed Camlistore to Perkeep, we also renamed the docker image
deployed by the launcher, as well as the systemd service that this
docker image runs in.
This means existing users on GCE do not get updates when they restart
the service or reset their instance.

This change adds a check and a function that allows perkeepd to fix the
user-data metadata of its own GCE instance, which is where the names
mentioned above are defined.

Therefore, if we deploy a new camlistore docker image containing that
code, the existing users should get a server capable of self-fixing its
own instance into a perkeep one.

Change-Id: I9ff66f684f0ad647d15e5fcdd08d26c524a18329
2018-04-30 15:58:26 -07:00
Mathieu Lonjaret 2c93b93e60 Merge "server/perkeepd/ui: perm aspect takes precedence over map aspect" 2018-04-28 06:22:13 +00:00
mpl a735460c3f server/perkeepd/ui: perm aspect takes precedence over map aspect
This change makes the Permanode aspect come before the Map in the list
of aspects. That way, if there is no specific aspect selected for a
permanode, the default one should then be Permanode rather than Map.

I'm not sure it's not going to break a specific workflow though.

Change-Id: I3d54dc84c7f4fb313d8ed0f7285db69b4ecbf366
2018-04-27 17:31:47 -07:00
Brad Fitzpatrick f8bc4ac6e5 ui: link to mobile setup in UI drop-down
Updates #1120

Change-Id: I2185c656038637aec04a44a5754e67a6de20fee0
2018-04-27 17:22:13 -07:00
Brad Fitzpatrick 2b720aa101 search, index: rewrite, fix the "map" sort algorithm, index camliNodeType
Change-Id: Idb0e44c3f61bea9fc2cc76619223b86aa5aa4c58
2018-04-26 15:19:03 -07:00
Brad Fitzpatrick 6a68c7dea3 server/perkeepd/ui: fix size of swarm logo
Change-Id: I66aaf4053e5a129d112fe389cf222004ace3f20d
2018-04-25 13:43:40 -07:00
Brad Fitzpatrick f636f75b75 server/perkeepd/ui: change foursquare logo to swarm logo
Upstream rebranded.

Change-Id: I0ce6e98f29c5c3fe59ec9ac905cf4bb8976f0a4f
2018-04-25 13:31:48 -07:00
mpl 66e6766571 pkg/gpgchallenge: use long form when looking for key ID
We migrated to using the long form for key IDs sometime ago, but we
never updated the client of the gpgchallenge accordingly, so in
functions that take a keyID as an argument, it would fail to find the
given long keyID within a key ring.

However, for usability reasons, we want to keep the short form in the
hostname of the instance (and hence as the DNS entry), so we revert to
using the short form when perkeepd is setting its host name.

Change-Id: I8373016671fdead32780a04f6d64045e81cc9cd1
2018-04-23 21:44:25 -07:00
mpl 7a27eb42eb cmd: rename camget to pk-get, and make it a mode of pk
A couple of related fixes and renames too.

Updates #981
Fixes #1056

Change-Id: Id47a933c77422edfb9db41d34c38ed9d0d7a1846
2018-04-22 20:50:54 -07:00
Brad Fitzpatrick 38d0075c3a all: make log lines a bit more consistent
Change-Id: I06c5bbe072c9857ca3afbf97d14146b9cd96a49e
2018-04-22 08:51:43 -07:00
mpl aaac9635d2 pkg/search: allow empty expression
We had checks in place to return an error if a search query had both
no constraint and no expression. However:
1) we accepted " " as a valid search expression (which is the
work-around that was used by the web UI for the index page)
2) the rest of the code seems to be coping well if we remove these
checks, which this CL does.

This allows us to remove the q=" " trick in the web UI, which does not
seem to be breaking anything, and has the side-effect of improving the
map aspect story (issue 1081). Because with this change, the index page
is not considered anymore as the result of a search query, which means
if one then clicks on an image, one then gets to the image permanode as
a "standalone" item, instead of as one item part of set.
As a consequence:
1) If one then clicks on the map aspect, one gets only this item on the
map (with the proper zoom level), instead of all the items from the
index page.
2) The other side of the coin is left/right navigation does not "work"
anymore in this context, since the item is not part of a set anymore.

In other words, this change makes the index page (i.e. the empty search)
a somewhat particular case, and makes it behave a little differently
from the result of any other (non-empty) search.

Updates issue #1081

Change-Id: Ibbb1711c67c7cf8adaf94ab5d2c68c3755e4983b
2018-04-21 17:44:43 -07:00
Brad Fitzpatrick 46f31ba425 server/perkeepd/ui: rename UI menu from Camli to Perkeep
Also disable the annoying mouse hover enter/exit behavior. Require
clicks. TODO: more focus events elsewhere should close the menu, but
this is better than before.

Also, rename the PIGGY variable to KEEPY for now, in prep for changing
the logo from a pig to the Keepy the Perkeep Parakeet mascot.

Updates #981

Change-Id: I48d9dd7267701b39122836aaad708726b1c105ac
2018-04-21 12:37:52 -07:00
Brad Fitzpatrick ca76a40bbc Rename camlistored to perkeepd.
Updates #981

Change-Id: I8fe43c240c149074c23128a89ab426af9cbf94b4
2018-04-21 11:06:09 -07:00
mpl f8ef262ff9 make.go: clean up, notably remove the tmp source code mirroring
Fixes #1004

Change-Id: Iea01cfc601b8dd8f2a81fe5da40cdd272b164bb1
2018-04-17 19:39:46 +02:00
mpl a2359a934f server/camlistored/ui: relax requirements for thumber
We actually don't need to know the filename of an image for a valid
thumber to be created, so this change is removing such a strict check,
which was making foursquare venue photos not be displayed.

Also fix broken initialization of the thumber in foursquare container.

Change-Id: Iefb36fc403a3c1101d83f6af916b447e149f5acf
2018-03-31 00:11:38 +02:00
mpl 7bdd826360 pkg/importer: pick the "best" importer account when several exist
We still need to figure out the root cause of the problem, i.e.
why a sha224 importer node was created in the first place, when a
valid sha1 one already existed. Next CL.

Updates #1069

Change-Id: I00b4aab9a4f67b9c4ee198774378630615f6d11d
2018-03-02 16:02:18 +01:00
Mathieu Lonjaret 0fee217fe0 Merge "web UI: disable key nav when editing permanode attributes" 2018-02-21 18:50:57 +00:00
mpl ed47d7f303 web UI: disable key nav when editing permanode attributes
Also, only reset new row on first load, as opposed to on every React
update.

Fixes #923
Fixes #1059

Change-Id: I6ebaa31ca3509c4b53944861d7f3c5896547b425
2018-02-21 17:59:19 +01:00
Attila Tajti b71c054373 pkg/blobserver/overlay: add “overlay” blobserver type
The blobserver uses a base blobserver in read-only mode,
and uses another stage blobserver to record changes.

In a sense it is a read-write view on the master
blobserver that never changes base itself.

Change-Id: I39c7d7bbac713c32fd17710fab43754b546ebb3b
2018-02-21 05:51:00 +01:00
mpl 86da8c822c camnetdns: use Lets Encrypt http-01 challenge
Fixes #1033

Change-Id: I83b654ee1b33912e92c2b41339dec45de3b13456
2018-02-21 00:12:15 +01:00
Mathieu Lonjaret 14758c0d1e Merge "server/camlistored: add inline query parameter, and set Content-Disposition" 2018-02-20 22:30:36 +00:00
mpl 3d519b2773 server/camlistored: add inline query parameter, and set Content-Disposition
The download handler was setting the Content-Disposition to attachment
when the MIME type was "application/octet-stream". That means when e.g.
a plain text file (and probably others) is (incorrectly) detected as
"application/octet-stream", it is saved to disk instead of being opened
as text by the browser, when using the "View Original" button of the web
UI.
Conversely, when using the "Download" button of the web UI, the file
should always be saved to disk, and never be opened by the browser.

Therefore, we add the ?inline request parameter to the downloadhandler
GET handler to unambiguously request whether the response should have an
inline or an attachment Content-Disposition.

The View Original button action now always requests an inlined response.

The Download button action now detects whether the selection was only
about one file, and if yes it requests the file as an attachment
(instead of using the POST handler that zips all the requested files).

Change-Id: I4bbc42f17fb4ea0aff9e17056e80156611d4b419
2018-02-20 23:27:22 +01:00
mpl 0d96057201 pk/blobserver/blobpacked: check large storage integrity
Check that all blobpacked zips are in the blobpacked meta, and
vice-versa (that all entries in meta do exist as a zip in large
storage).

As the current recovery code would not fix the case of stale entries
(large blobRefs in the blobpacked index of large blobs that don't exist
anymore), this change also adds a new recovery mode, which wipes the
existing blobpacked index, before rebuilding it.

In doing so, the recovery var in blobpacked pkg, as well as the
flagRecovery in camlistored.go have been changed to ints instead of bools,
to take into account that we now have several modes of operation for
recovery.

Fixes #946

Change-Id: I1fe76b805af34933e362d70c9f27bfd5403e3f3a
2018-02-17 02:53:24 +01:00
mpl db2604f981 pkg/schema: break static-sets in subsets for large directories
The current maximum size for a schema blob is 1MB. For a large enough
directory (~20000 children), the resulting static-set JSON schema is
over that maximum size.

We could increase that maximum, but we would eventually hit the maximum
blob size (16MB), which would only allow for ~300000 children. Even if
that is an uncommon size, it is technically possible to have such large
directories, so I don't think it would be reasonable to restrict users
to such a limit. So it does not seems like enough of a solution.

The solution proposed in this CL is to spread the children of a
directory (when they are more numerous than a given maximum, here set to
10000) onto several static-sets, recursively if needed. These
static-sets (subsets of the whole lot of children) are stored in the new
"mergeSets" field of their parent static-set schema. The actual fileRefs
or dirRefs, are still stored in the "members" field of the subset they were
spread in. The "mergeSets" and "members" field of a static-set are therefore
mutually exclusive.

Fixes #924

Change-Id: Ibe47b50795d5288fe904d3cce0cc7f780d313408
2018-02-09 01:36:38 +01:00
Mathieu Lonjaret 6e8a5930c9 all: make server advertise when it has legacy SHA-1 indexes, use that info
when its wholeref index lines contain any "sha1-" wholeref lines.

Then, have the client use that info when uploading files to also
compute the sha-1 (in addition to the sha-224) and ask the server for
both.

By client, we mean changes to cmd/camput, to pkg/client functions (for
camput and other Go clients, such as the apps), and to the web UI.

Also, add a -sha1 mode to devcam server, as well as the
CAMLI_SHA1_ENABLED env var, to facilitate testing/debugging of the
legacy sha1 mode.  Fix/document unrelated options in devcam server
while we're at it.

Change-Id: I369679d2a4719f6f8b409f78dd4d065e13a3f62f
2018-01-31 01:10:52 +01:00
Brad Fitzpatrick f9f109ffa1 all: more Camlistore to Perkeep renamings
Updates #981

Change-Id: I7fd4958bceaa4ada63d07aacf08af11cc03f32d7
2018-01-30 13:31:59 -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 d4ff75359c pkg/client: reduce the number of New constructors, return error by default
This removes NewDefault and NewFromParams.

Now the default way to create a client is:

    client.New() -> (*Client, error)

Specifying a server is optional and now requires
client.OptionServer(server).

If the caller really wants to log.Fatal on error, they can use
client.NewOrFail.

Also, some of the boilerplate from GopherJS callers is now promoted to
be the default behavior in the client package.

Change-Id: Icb106cf3e13cc492fe5b2f7f240e1ad4227eaf33
2018-01-24 07:42:04 -08:00
Paul Lindner 6d2d9714de all: simpify constructs by running gofmt -s on all code
Change-Id: Idc12ddcfe8f735d77c6baa942f5bb7a2c7d9b40b
2018-01-21 10:27:12 -08:00
Brad Fitzpatrick 1d3ab02349 Merge "blobserver, all: add contexts to ReceiveBlob, Fetch & million resulting deps" 2018-01-19 01:43:58 +00: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
Attila Tajti 761bff63c0 server/camlistored: add sha224 support to web UI
The web UI support the old sha1 blob hash only.

Add initial support for sha224 blob refs.

Also add sha2.js and sha224.js to goog/crypt in the embedded resources.

Change-Id: If52d75d254d6163a737c56cf1676be1ef7eddb31
2018-01-17 16:07:04 +01:00
mpl e9e9da4bf8 server/camlistored: use Let's Encrypt http-01 challenge
As the priority is to fix GCE instances, the port for the http-01
challenge is not configurable for now (80) even not on GCE, but it will
be in a follow-up change.

update golang.org/x/crypto/* (for acme) to rev
13931e22f9e72ea58bb73048bc752b48c6d4d4ac
update golang.org/x/sys/* to rev
fff93fa7cd278d84afc205751523809c464168ab (because unix is a dep of
crypto)

remove warning about Let's Encrypt security issue from pkg/deploy/gce

I had to manually exclude vendor/golang.org/x/crypto/acme/jws_test.go
for now because it contains a private key, and git whines about it, and
i could not override it.

Fixes #1033

Change-Id: Ie4f2049e97892dee9ab513300a5f12e64976aec8
2018-01-16 23:43:13 +01:00
Magnus Landerblom e4970b542d server/camlistored: don't use deprecated lastModifiedDate for uploaded file
Use web standard lastModified instead of the deprecated lastModifiedDate.

See warning at top of:
https://developer.mozilla.org/en-US/docs/Web/API/File/lastModifiedDate

Change-Id: I0b975dc17129de4b68b279e9acd44bbac4bf3f2f
2018-01-15 22:27:00 +00:00
Tamás Gulácsi 2ba0c43003 pkg/blobserver/union: add "union" blobserver type
This blobserver is just "cat"ing the given "read" storages.
This is read-only, so you should use some other storage to augment this for
writing and removing - for example the "cond" storage is perfect for this.

My use-case is to use blobpacked with large=diskpacked, small=filesystem,
but consolidate the small blob storage into a diskpacked + filesystem
after the filesystem becomes huge.

Another use-case is joining separately built camlistore servers into one.
(For me, they have to be separated later, so I've built them separately,
but I've to use it joined for a month).

Change-Id: I4e7e42cd59286f0f34da2f6ff01e44439771d53c
2018-01-12 06:54:24 +01:00
Brad Fitzpatrick 9265c980de all: change github.com/camlistore/camlistore to github.com/perkeep/perkeep
Change-Id: I0d612bf450e9e8d9ce0767c5a0cb0c44c0d8704f
2018-01-05 19:49:59 -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
mpl b5b668b661 pkg/client: force nil transport when on the browser
Calls to net.Dial* are prohibited with GopherJS. This can happen if the
client's transport is set by the user.

This change forces transportForConfig to return nil when the client
package is compiled with gopherjs, in order to make sure that a call to
newClient returns a client with a nil transport.

Change-Id: I577457bd7d924d31710168086dc2b394df3d1ae0
2018-01-03 16:38:47 +01: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
Mathieu Lonjaret ef4af89ea4 Merge "server/camlistored: add "Select all" button to web UI" 2018-01-02 16:40:02 +00:00
Brad Fitzpatrick 11e9c5567c Move some packages from perkeep.org/pkg to perkeep.org/internal
Notably: pkg/misc all moves.

And pkg/googlestorage is deleted, since it's not used. Only the
x/net/http2/h2demo code used to use it, but that ended in
https://go-review.googlesource.com/33230 (our vendored code is old).
So just nuke that dir for now. When it's refreshed, it'll either be
gone (dep prune) or new enough to not need googlestorage.

Also move pkg/pools, pkg/leak, and pkg/geocode to internal.

More remains.

Change-Id: I2640c4d18424062fdb8461ba451f1ce26719ae9d
2018-01-01 20:54:48 -08:00
mpl a630f8dce3 server/camlistored: add "Select all" button to web UI
Fixes #842

Change-Id: Id69754d2d54f84b3441293d6631c2fa94135829d
2018-01-02 02:10:18 +01: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
Mathieu Lonjaret ece9b76f41 Merge "server/camlistored/ui: revert ref predicate to constraint" 2018-01-01 22:46:34 +00:00
Brad Fitzpatrick 9ca28d644b Merge "pkg/serverinit: on GCE, reset name if instance name is in camlistore.net" 2017-12-31 02:04:05 +00:00
Govert Versluis 8548962dbe Add Azure blobserver support.
Fixes #425

Change-Id: I02bb29e6503bfef0894cbfde0c2a3304cf70c932
2017-12-29 12:39:49 -08:00
Daniel Heath 59ac14caa5 Vendor OpenSans (apache 2 licence)
Change-Id: Ie74b37efc007011b32810fd91c65b7750588a76e
2017-12-29 10:22:49 -08:00
Paul Lindner e97eae91dc all: lint fixes for "don't use leading k in Go names"
Change-Id: I8647c1dcc0535b1fc8dc0e1b1ca4623c23d6ac7c
2017-12-13 11:31:25 -08:00
Paul Lindner 15feaeb24c all: lint fixes for 'error strings should not be capitalized or end with punctuation or a newline'
Change-Id: I9c3766a51ac8be694ae76befff4b6fa9a85e34eb
2017-12-11 06:13:25 -08:00
Paul Lindner f28eb3cce8 Remove appengine server and the old python blobserver
Change-Id: I734f4621f77ce902050e9b37805e7f8912f75e97
2017-11-30 19:13:37 -08:00