Commit Graph

1203 Commits

Author SHA1 Message Date
Ian Denhardt d9e34b748c Web UI: viewer for plain text files
This just generalizes PdfDetail to also recognize text/plain. It has
been renamed BrowserViewDetail to reflect its more general nature.

Adding more formats will now be trivial: just add entries to the
`supportedMimeTypes` array.
2019-12-03 16:22:03 +01:00
mpl 1625019561
Merge pull request #1260 from omarchehab98/uiaudio
server/perkeepd/ui: Implement blob audio
2019-06-16 01:13:32 +02:00
Omar Chehab 5c043c6311 server/perkeepd/ui: Fix blob item video play button styling
Closes #776

Change-Id: I85c17f5478b476c06de611f759f618e608120976
2019-06-12 09:53:06 -07:00
Omar Chehab 99f2e2dcb4 server/perkeepd/ui: Implement blob detail audio
Summary:

Implement audio player using web ui.

Add new blob aspect for audio files.

Test Plan:

1. Upload browser compatible audio to perkeep
2. Navigate to web UI
3. Open the audio blob's detail page
4. Play audio

Before:

Audio cannot be played using web ui

After:

Compatible audio can be played and paused from the detail page

Audio title and artist are shown if available

Issue: #202
Change-Id: Icd450aaa16e9e622a677c23f4f1f699784453dbc
2019-06-11 19:21:12 -07:00
Omar Chehab a838f6e15a server/perkeepd/ui: Implement blob item audio
Summary:

Implement audio preview using web ui.

Add new blob handler for audio files.

Test Plan:

1. Upload browser compatible audio to perkeep
2. Navigate to web UI
3. Play audio without leaving perkeep ui
4. Pause audio

Before:

Audio cannot be played using web ui

After:

Compatible audio can be visually identified by the volume icon instead of the default file icon.

Hovering over the audio blob shows a play button.

Click the play button to start playing the audio.

Click the pause button to stop playing the audio.

Issue: #202

Change-Id: Iab8ee4a339f44178992e11e02232d480cd534b3e
2019-06-11 19:21:04 -07:00
mpl 9417938aa3 vendor: update a bunch of dependencies, and clean some things up
This change:

1) makes perkeep.org/server/perkeepd/ui/goui a module on its own, so that it
gets ignored by go mod with respect to perkeep.org. Because there's no reason it
should appear in perkeep.org/go.mod, as it is only used by gopherjs to rebuild
the web UI code.
2) updates a few of our dependencies to keep up with upstream changes (go get
-u, go mod tidy, go mod vendor).
3) readds manually (since go mod vendor removes them)
vendor/github.com/gopherjs/gopherjs (and its deps) as well as vendor/myitcv.io
because they are needed when one wants to rebuild the web UI.

As a result I think we can now drop dep, so it is done in this change as
well.

Change-Id: I155819163e15e214a6ba44bab2c19ae171d83d1b
2019-05-30 02:03:30 +02:00
Ian Denhardt 9601cf75f8 Web UI: Render PDFs in detail view.
Per the comment, this is pretty straightforward: just embed it in an
iframe

Tested in Firefox and Chromium.

Fixes #795

Change-Id: Ic9620ae974a4c6c562c769db4f2c0f76f22a4041
2019-05-04 01:27:21 -04:00
Mathieu Lonjaret aa7ab23772 Merge "pkg/importer: add "instapaper" importer for Instapaper service" 2018-12-03 15:07:30 +00:00
Angel 3dbb01138f pkg/importer: add "instapaper" importer for Instapaper service
A working importer for the Instapaper service. The importer imports
bookmarks, full text articles, and highlights. A blob item handler for
Instapaper highlight permanodes is included to show summarized highlight
content from the server UI.

Also, this CL updates github.com/garyburd.com/go-auth to rev
bca2e7f09a178fd36b034107a00e2323bca6a82e in order to get support for
XAuth requests.

Fixes #1208

Change-Id: I72e0c40b245c7eec4a44bb475fcaa96a0ee9a1c5
2018-11-26 07:57:08 -05:00
mpl dc4c57880c server/perkeepd/ui: use TokenOrNone in selectall
Omission from 8130bd61ef

Change-Id: Iecf31de608283f12d48ef150d42c7cf55c055d16
2018-10-07 19:16:33 +02:00
mpl 8130bd61ef server/perkeepd/ui/goui: suppress basic auth on OmitAuthToken
The javascript code was taking into account the OmitAuthToken signal
that there should be no auth, but it hadn't been done in the gopherjs
code yet as well.

Fixes #1221

Change-Id: I3eda0cc12c99664739d6073cc1aeba1aeed8a88a
2018-09-26 20:00:36 +02:00
mpl 2453859515 server/perkeepd/ui: actually use defaults for dialog size
Change-Id: I69a3406db8fd71618b1b8feba207707aef726db9
2018-09-25 20:02:38 +02:00
mpl 44db6d9b98 server/perkeepd/ui: treat ref: as special case only with full blobRef
The ref: predicate was treated as a special case, to make it correspond
to navigating to a "blobRef URL", e.g.
http://localhost:3179/ui/sha224-b6a88695e3a9178d45fdfb1fa888939d5adc090f866aaa1d7b5ec3a5

However, we should not do that when the query is only for the prefix of
a blobRef, e.g. "ref:sha224-b6a88695".
This CL therefore adds a check to make sure we're in the presence of a
full blobRef before navigating to the special case.

Fixes #1119

Change-Id: Ib92b43adbb2316c1607d617eb03de132c38de85f
2018-09-19 03:01:02 +02:00
Mathieu Lonjaret 9a49f0959d Merge "importer/twitter: add likes import" 2018-08-21 23:53:37 +00:00
mpl 0888d28260 all: fix misc bugs found with go test ./...
Change-Id: If5bda860c9cc6bdc14c2977646516c58d17d62de
2018-08-17 02:17:54 +02:00
Niklas Merz 05f86e7846
importer/twitter: add likes import
Import liked tweets via favorites API

Change-Id: I8000bcd20cd895e540ec4d3b36035531172c7cb6
2018-08-14 17:49:37 +02:00
mpl f6280b16cd server/perkeepd: fix typo in log message
Change-Id: I56d4534ba92fd7e4b78613d697f8af6671b6ecfe
2018-08-08 18:33:34 +02:00
Mathieu Lonjaret 82925c5010 Merge "perkeepd: remove map zoom guided by loc: or locrect:" 2018-08-02 18:11:12 +00:00
Mathieu Lonjaret e66f5ce20a Merge "server/perkeepd/ui: display search query errors" 2018-08-02 17:56:49 +00:00
mpl 5e271c0e08 perkeepd: remove map zoom guided by loc: or locrect:
As well as the rectangle which was drawn to show the area corresponding
to the requested location.

The initial zoom is now only based on the location of the search
results.

As (the intended) side-effect, geocoding requests are not needed
anymore, since the map aspect does not need to know the coordinates of a
loc: request anymore. Which allowed to trim down the
server/perkeepd/ui/goui/geo pkg.

Updates #1115

Change-Id: I22983661fd482b652d8bf34a63fa88d7b7695d5e
2018-08-02 03:41:07 +02:00
mpl 8b537a6630 server/perkeepd: readd log about using Lets Encrypt
Change-Id: Ia3df8ba3e10d568e8033b7b69ed8ef13e554898c
2018-07-25 19:51:48 +02:00
mpl 3f1b2f475d vendor: update golang.org/x/crypto
to c126467f60eb25f8f27e5a981f32a87e3965053f

For acme tls-alpn-01 support.
And enable it in perkeepd.
Remove http-01 challenge support.

Fixes #1078 (by making it obsolote)

Change-Id: I45220b6269024a2ff7a181f69cf708869705dca7
2018-07-24 04:03:16 +02:00
Mathieu Lonjaret 38e3e3d07a Merge "vendor: update myitcv.io" 2018-07-23 19:15:06 +00:00
Euan Kemp 4c3d497fc1 vendor: update myitcv.io
to bf2c84553c7827a1cb6cecf19424fdb93b887d5b.

This is required per the change mentioned in
https://github.com/myitcv/react/issues/116#issuecomment-405631245.

Without this change, 'dep ensure' can't be run, unless the upstream
myitcv.io html is reverted/updated or dep fixes a few issues allowing
project-root calculations to be overridden.

Change-Id: I63ab98b8701dcea753d4e67828f47227801638be
2018-07-23 09:56:03 -07:00
Mathieu Lonjaret b5c76a70e8 Merge "server/perkeepd/ui: replace pudgy with keepy" 2018-07-18 17:58:09 +00:00
Mathieu Lonjaret 0f73329557 Merge "importer: Add a Mastodon importer" 2018-07-17 14:41:12 +00:00
D Anzorge c06d31eda4 importer: Add a Mastodon importer
The Mastodon importer uses the Mastodon API (implemented by Mastodon and
Pleroma) to import posts into Perkeep. The webui also now recognizes
Mastodon posts, and displays their text.

The importer does some things differently than most other Perkeep
importers, since it needs to be able to import from arbitrary URLs. It
does not share any credentials globally between all accounts, to enable
use of multiple accounts on multiple servers.

This also introduces new dependencies of go-mastodon and linkheader
(both under the MIT license).

Resolves #1183

Change-Id: I9a532bbd5720992482fc758f14286c11d5bf6ef0
2018-07-17 00:20:37 +02:00
mpl ba5aa9d3b9 server/perkeepd/ui: replace pudgy with keepy
-busy/munching pudgy is replaced with a "dancing" keepy
-sad pudgy replaced by a sad keepy
-everywhere else is normal keepy (which is one sprite of the dancing
keepy animation)
-we still need an "interested" keepy for when the user is about to drop
something on the d&d area
-glitch embedy directory has not been removed yet, to keep the pudgy
animations technique as a reference for future work.

We also need to update the animation in the GCE launcher.

Updates #1177

Change-Id: I95fe53cb51f93b8f498c8f026eddc07285c20db7
2018-06-29 21:48:11 +02:00
mpl 933ecd89df server/perkeepd/ui: display search query errors
This change:
-on startup, makes perkeepd log instruction about the Google geocoding
key, if it is not found in Perkeep configuration directory.
-in the web UI, makes search query errors from the search session show
up in a dialog, instead of just being logged in the javascript console.
Among other things, it will allow users to be more readily informed
that their loc: queries are failing because they don't have a geocode
key setup.

According to the Google geocoding team, we should not share a geocoding
API key (too risky/expensive), and using an API key is the only way to
make geocoding requests. So we have to let users deal with it themselves
unfortunately.

Updates #1115
Fixes #1116

Change-Id: I461e7f06a04ffd874678ab8233185999024cb3d8
2018-06-26 02:25:32 +02:00
mpl 877eafa49b perkeepd/ui: add dialog to import shared items
This change adds an 'Import share' entry in the main menu bar. This
entry creates a dialog that allows the user to enter the URL of a share
claim (the "shareURL" in the following).

That shareURL is sent to the server, which takes care of importing all
the blobs transitively reachable (directory children, and files
contents) through the share claim.

The web UI also keeps on polling the server to update the dialog on the
state of the importing process.

To handle the posted shareURL, and the polling, the server now has a new
HTTP handler: the shareImporter, installed at /ui/importshare.

In a future CL, another approach would be to integrate this handler as
yet another importer. But it would probably be better to do so once we have
a way for importers to report on their progress at any time. For now this
importer has its own dialog to do so, similar to the one for uploads.

Change-Id: I94cd03f834d7d1e9f4ec5c016ffdf16d911856c5
2018-06-19 02:05:23 +02:00
mpl 84633f4cb7 web UI: show progress dialog when adding items to set
Fixes #551

Change-Id: Ic103f718866e194b69576c81106702c8475840ba
2018-05-25 21:01:01 +02:00
Stephen Searles a462466f37 perkeepd: added --keep-going flag to start after index/recovery errors
In order to facilitate manual recovery in severe scenarios, the
--keep-going flag will make the server come back online even when there
are index or recovery errors. This will allow further querying on the
unhealthy server to identify missing data or to extract data for
migration to a new/healthy instance.

Fixes #1166

Change-Id: I4153905757d9e7d8014780dd5660a862cb8ba1ab
2018-05-18 22:29:12 -04:00
Brad Fitzpatrick 05d5ea0ab0 Merge "pkg/serverinit: remove reindex parameter to InstallHandlers" 2018-05-18 02:53:14 +00:00
mpl 2549b78425 server/perkeepd/ui: new directory view
The old directory aspect (directory_detail.js), was done before the
current (React-based) look and layout of the web UI. It is still
functional, but does not look very good, and does not match the look of
the rest of the web UI.

Therefore, this change adds a new directory layout, with a
blob container approach and layout similar to the one for permanode
sets, and replaces the old one as the default Directory aspect.

It seems to have performance issues (slow loads), but I think it's
better to enable it now, rather than wait again for many months to
land it. Especially if it forces us to address said performance issues.
If it's too bad and users want the old one in the meantime, it should be
easy to re-enable the old as the default.

Change-Id: Ieb0cde8290f0a058008cdc73b596ad1a330ded1a
2018-05-15 18:53:06 +02:00
Brad Fitzpatrick 8e71a705db pkg/serverinit: remove reindex parameter to InstallHandlers
Push it down into the index.

Change-Id: I327bfcbc314b652d5f24a457e1b62b138a187db5
2018-05-14 23:13:32 -04:00
Brad Fitzpatrick 2606360f1d server/perkeepd: more cleanups
And move the camlistore.net code to a new file, autodns.go.

Change-Id: I7503b72c9c3f1c7a2207cab35c746c34dd90740c
2018-05-13 16:57:56 -07:00
Brad Fitzpatrick 7da4196852 server/perkeepd: rename source files from camlistore*.go to perkeepd*.go
Updates #981

Change-Id: I6c59fcd8d2ae56e102507a162c83ead85d20b039
2018-05-13 16:01:02 -07:00
Brad Fitzpatrick f3f38f0c76 perkeepd, serverinit, gce: opaque-ify serverinit.Config, trim camlistored.go
This change has two major parts, which were interwoven enough to do
them in one change:

1) make serverinit.Config fully opaque, in prep for TOML configs #1134

2) shrink the massive server/perkeepd/camlistored.go file. It was out
   of control and had a bunch of code that better belonged
   elsewhere. This change moves a few hundred lines of code from
   camlistored.go into more logical places: internal/osutil/gce for
   GCE stuff, serverinit for config stuff (KeyRingAndId), etc.

I also added a TODO to make it possible to compile perkeepd without
any GCE stuff, which I saw as a possible and worthy goal only after
moving everything away.

Updates #1134

Change-Id: Iea6f84c5aca9c70b97806f4a201ec35e0f630e3b
2018-05-13 15:50:10 -07:00
Brad Fitzpatrick aef92f7e14 pkg/serverinit: start making serverinit.Config representation more opaque
Updates #1134

Change-Id: I56fa1c565c267dad0e1ca69f7d36338828ac954e
2018-05-13 11:16:18 -07:00
mpl b76a4f6727 internal/osutil: revert to using "test safe" func for identitySecretRing
And while we're at it, rename said func (CamliConfigDir) to
PerkeepConfigDir.

Fixes #1161

Change-Id: Ia8c9b5826046437b77c8e16ee91912e31ad319a3
2018-05-12 02:12:03 +02:00
Brad Fitzpatrick e22801a8ab server/perkeepd: don't ignore error from serverinit.WriteDefaultConfigFile
Fixes #1154

Change-Id: I1b35ab70ef3ad20fa8527a074485661a36b04e52
2018-05-09 20:51:42 -07:00
Brad Fitzpatrick 245bb63fff osutil: fix Windows use old Camlistore-named APPDATA directory
Fixes #1150

Change-Id: Ia2843437abbaba96e936c1c0f46bf8b171a2e28e
2018-05-07 20:52:13 -07: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
Brad Fitzpatrick 12894d4630 all: Windows fixes (don't listen on file descriptors in test.World, etc)
test/integration: don't listen on file descriptors.
make.go: unrelated, but options to make it much faster.
internal/images: t.Skip on HEIC dependency failures

Fixes #1140
Updates golang/go#25210

Change-Id: I8092155411826d6ed1f8d85230b753d1369044af
2018-05-01 21:38:19 -07:00
Brad Fitzpatrick 2f39adc517 server/sigserver: delete old and unused sigserver
We can resurrect later. Or more likely: we'll support perkeepd
being configured (#1134) as only a signing server.

Change-Id: I19278e107baf02864c085421327392a6ffbb3364
2018-05-01 13:59:57 -07:00
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