Code Monkey home page Code Monkey logo

cuekeeper's Introduction

CueKeeper

Copyright Thomas Leonard, 2020

CueKeeper is a web-based GTD system (a fancy TODO list) that runs entirely in your browser (the data is stored on your computer, in your browser).

Installation

Download the latest cuekeeper-bin zip from the releases list, e.g.

https://github.com/talex5/cuekeeper/releases/download/v0.4/cuekeeper-bin-0.4.zip

Extract it somewhere permanent (not your Downloads folder) and open the index.html file inside in a web browser. Most browsers will allow you to "pin" the tab so that it is always available. e.g. In Firefox, right-click on the browser tab and choose "Pin Tab" from the menu. The tab icon will go red when something becomes due.

Instructions for using CueKeeper can be found here:

http://roscidus.com/blog/blog/2015/04/28/cuekeeper-gitting-things-done-in-the-browser/

Upgrading: You can just unpack the new archive over the old one and refresh the browser tab. If you just get a blank window, you probably have another CueKeeper tab open somewhere and will need to close that first so it can update the database schema to the latest version. If upgrading from versions earlier than 0.3, you will need to upgrade to version 0.3 first (it will prompt you to do this if needed).

Chromium note: If it says "The user denied permission to access the database." try turning off Block third-party cookies (I don't know why it thinks a local HTML file writing to a local database is a third-party cookie). Also, it seems that all file://... pages will see the same database on Chromium, whereas on Firefox each page gets its own one.

Backups

All data will be stored locally in your web browser, so make sure you're backing up your browser's data! Also, the data will be stored based on the location of the index.html file - if you move the cuekeeper directory, you will get a fresh database (and it will look as if your data has gone - don't panic!).

For example, I use Firefox on Linux. The data is stored at

~/.mozilla/firefox/XXX.default/storage/default/file++++home+user+cuekeeper+index.html/

Building (using Docker)

The easiest way to build CueKeeper is using Docker:

make docker-build

Then load test.html in a browser to test locally (no server required).

Building (without Docker)

You'll need the opam package manager. It should be available through your distribution, but you can use a generic opam binary if it's missing or too old (I use opam 2.0.4). Ensure you're using OCaml 4.07.1 (check with ocaml -version). If not, switch to that version:

opam switch create 4.07.1

Install the dependencies (-t includes the test dependencies too):

opam pin add -yn cuekeeper.dev .
opam depext -t cuekeeper
opam install --deps-only -t cuekeeper

Build:

make

Load test.html in a browser to test locally (no server required).

Note that this defaults to "dev" mode, where the Javascript generated will be very large (about 9 MB) and not optimised. To get a smaller file, use dune build --profile=release ./js/client.bc.js (should be about 980 KB).

Running a server

While test.html can be opened directly in a browser, as above, you can also build a server. This allows you to sync between devices (e.g. a laptop and mobile phone).

Warning: This is a work-in-progress:

  • The server does not yet persist the data itself (the client sends the whole history the first time it connects after the service is restarted).
  • You have to sync manually by clicking the Sync button - it does not send or fetch changes automatically.

First, generate an access token (a long random string that grants access to the server). The pwgen command is useful for this:

$ pwgen -s 32 1
dtXZ7fQfX52VsnJNk22J6uKy8JSn6klb

To avoid storing the secret in the server binary, generate its SHA256 hash:

$ echo -n dtXZ7fQfX52VsnJNk22J6uKy8JSn6klb | sha256sum
774400f3384a6f37cc2bc54b2fd0280193b613a5bc401c0e54fd17fe4ec19572

Copy the file server/devices.ml.example as server/devices.ml and add the hash you generated above, e.g.:

let lookup = function
  | "774400f3384a6f37cc2bc54b2fd0280193b613a5bc401c0e54fd17fe4ec19572" -> Some "Laptop"
  | _ -> None

The string at the end ("Laptop") is just used for logging. You can generate a different access token for each device you want to sync and list them all here, one per line. Make sure the None line comes last - this rejects all unknown tokens.

To build the server component:

opam pin mirage 3.7.3
make server

You will be prompted to create a self-signed X.509 certificate. Just enter your server's hostname as the "Common Name" (for testing, you could use "localhost" here and generate a proper one later).

To run the server:

./server/cuekeeper

By default the server listens on TCP port 8443, but this can be changed by editing server/unikernel.ml.

Open the URL in a browser, e.g.

https://localhost:8443/

You'll probably now get some scary-looking warning about the certificate not being trusted. To get rid of the warning, add your newly-generated server.pem as follows:

In Firefox:

  1. Firefox will say "This Connection is Untrusted".
  2. Expand the I Understand the Risks section.
  3. Click Add Exception, then Confirm Security Exception (and "Permanently store this exception").

In Chrome:

  1. It will say "Your connection is not private" (in fact, the opposite is true; if encryption wasn't being used it wouldn't have complained at all).
  2. Go to Settings -> Show advanced settings.
  3. Click the Manage certificates button (in the HTTPS/SSL section).
  4. In the Authorities tab, click Import... and select your server/conf/server.pem file.
  5. Select Trust this certificate for identifying websites.

Finally, you should be prompted for your access key. Paste in the token you generated above (e.g. dtXZ7fQfX52VsnJNk22J6uKy8JSn6klb in the example above - not the hash).

Deploying as a Xen VM

In fact, the server is a Mirage unikernel and can also be compiled and booted as a Xen virtual machine:

make server MIRAGE_FLAGS="-t xen"
cd server
xl create -c cuekeeper.xl

Bugs

Please any send questions or comments to the mirage mailing list:

http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

Bugs can be reported on the mailing list or as GitHub issues:

https://github.com/talex5/cuekeeper/issues

Conditions

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

This project includes Foundation (http://foundation.zurb.com). These files are released under the MIT license.

This project includes the Pikaday date picker (https://github.com/dbushell/Pikaday). These files are released under the BSD & MIT licenses.

This project includes FileSaver.js (https://github.com/eligrey/FileSaver.js), which is released under a permissive license.

Full details of all licenses can be found in the LICENSE file.

cuekeeper's People

Contributors

alpha-60 avatar talex5 avatar yomimono avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cuekeeper's Issues

can't make "server" on Mac

I followed all instructions in the README, and on the make server step, I get

one-C02VV5SWHTD6:server bcohen$ make server
make: *** No rule to make target `server'.  Stop.
None-C02VV5SWHTD6:server bcohen$ 

Style fields that open menus to look more like drop-downs

As you wrote in CueKeeper: Gitting Things Done in the Browser:

  • The UI needs some work. In particular, could someone find a tasteful way to style the fields in the panels so they look like drop-downs? I keep clicking on the item’s name instead of the (show) button by mistake (although this might be because I used to have it the other way around, with a (change) button, but that was worse).

I want to contribute a starting point for the style:

starting point for field drop-down styling

.ck-item.ck-project::after, .ck-item.ck-context::after {
  content: '▾';
  color: #aaa;
  padding-left: 0.15em;
}

This is just a starting point. You can probably improve this styling to better communicate that clicking the field opens a drop-down of replacement values, as opposed to opening a drop-down of actions like “delete”.

The CSS selector in my example code is incomplete. You will probably need to create a new class to mark all drop-down fields with, rather than trying to write a selector with existing classes.

Stack overflow inverting parent relation

If you use the history view (or sync) to move from a revision where A is a parent of B to one where B is a parent of A in one step then the display code will fail with a stack overflow.

This is because it tries to show the old A fading out, but the old A now has a child B, which has a child A, ...

We should either detect the loop and stop, or refuse to add new children to things that are fading out.

Add title attributes to the one-letter toggle buttons

The “✓ n w f ★” buttons are hard to use if you don’t know what they do. I would expect hovering over them with the mouse to show their full name. For example, the “f” button should show “future” or “mark as for future”. You can implement this by adding title="future" to the a element.

I think you can implement this by changing the function toggle_label, or perhaps make_toggles below it.

Sometimes fails with AbortError on Safari

If you have CueKeeper open in two windows, making a change will often cause one of them to fail with IndexedDB transaction (RO) failed: AbortError: (no message) (error code 0).

I've done some testing on @avsm's Mac mini (thanks!) and can now reproduce the error with a few lines of JavaScript:

http://test.roscidus.com/static/idb_reads.html

The page will:

  1. Open a test database, creating a single key=value pair if it doesn't exist.
  2. Attempt to read the value of the key ten times, once per second.

If you open this in two windows in Safari at once, one of them will likely fail with AbortError. I've reported it, but if they don't fix it quickly we might need to introduce some kind of random back-off-and-retry on abort.

SecurityError: The operation is insecure.

Reported to happen on Firefox 37. Possibly the user had cookies disabled, which would disable access to local storage. Should detect this and give a better error message if so.

Firefox 71 on Fedora gives ConstraintError

The firefox-71.0-8.npgo.fc30.x86_64 package on Fedora does not work with CueKeeper. Making a change results in the error:

(Failure "IndexedDB operation (RW) failed: ConstraintError: A mutation operation in the transaction failed because a constraint was not satisfied. (error code 0)") Refresh this page to continue.

This seems to be a GCC bug. A work-around is to use the clang build of Firefox. See https://bugzilla.redhat.com/show_bug.cgi?id=1779570#c24

Error running `make`

I know the project is still in flux, but just reporting my experience trying to get started on a fresh checkout.

$ make
ocamlbuild -cflag -g -no-links -use-ocamlfind client.byte test.byte
+ ocamlfind ocamlc -c -g -g -bin-annot -strict-sequence -syntax camlp4o -package lwt.syntax,irmin,lwt,sexplib.syntax,uuidm,irmin.mem,base64,ocamlgraph,reactiveData,omd -w A-4-44 -I js -o ck_model.cmo ck_model.ml
File "ck_model.ml", line 763, characters 9-27:
Warning 48: implicit elimination of optional argument ?init
File "ck_model.ml", line 768, characters 12-20:
Warning 48: implicit elimination of optional argument ?step
File "ck_model.ml", line 771, characters 18-32:
Warning 48: implicit elimination of optional argument ?step
File "ck_model.ml", line 782, characters 25-32:
Warning 48: implicit elimination of optional argument ?step
+ ocamlfind ocamlc -c -g -g -bin-annot -strict-sequence -package js_of_ocaml.syntax,js_of_ocaml,js_of_ocaml.tyxml -syntax camlp4o -package lwt.syntax,irmin,lwt,sexplib.syntax,uuidm,irmin.mem,base64,ocamlgraph,reactiveData,omd -w A-4-44 -I js -o js/ck_template.cmo js/ck_template.ml
File "js/ck_template.ml", line 283, characters 13-25:
Warning 48: implicit elimination of optional argument ?a
File "js/ck_template.ml", line 684, characters 60-73:
Warning 48: implicit elimination of optional arguments ?extensions, ?default_lang
File "js/ck_template.ml", line 684, characters 77-88:
Warning 48: implicit elimination of optional arguments ?override, ?pindent, ?nl2br, ?cs
File "js/ck_template.ml", line 854, characters 11-19:
Warning 48: implicit elimination of optional argument ?init
File "js/ck_template.ml", line 873, characters 17-25:
Warning 48: implicit elimination of optional argument ?init
File "js/ck_template.ml", line 891, characters 11-19:
Warning 48: implicit elimination of optional argument ?init
File "js/ck_template.ml", line 960, characters 51-62:
Warning 48: implicit elimination of optional argument ?step
File "js/ck_template.ml", line 961, characters 42-53:
Warning 48: implicit elimination of optional argument ?step
File "js/ck_template.ml", line 967, characters 74-85:
Warning 48: implicit elimination of optional argument ?step
File "js/ck_template.ml", line 1000, characters 7-15:
Warning 48: implicit elimination of optional argument ?init
+ ocamlfind ocamlc -c -g -g -bin-annot -strict-sequence -syntax camlp4o -package lwt.syntax,irmin,lwt,sexplib.syntax,uuidm,irmin.mem,base64,ocamlgraph,reactiveData,omd -w A-4-44 -I js -o git_storage.cmo git_storage.ml
File "git_storage.ml", line 8, characters 38-47:
Error: Unbound module I.History
Command exited with code 2.
Compilation unsuccessful after building 55 targets (0 cached) in 00:00:06.
make: *** [all] Error 10

issue with make server on Ubuntu 20.04 LTS

@talex5
I have stood up a Ubuntu 20.04 LTS server on Linode, and am trying to now build a cueserver for my use.
I believe I have installed all the opam packages, but I get this error now:

root@localhost:~/cuekeeper# make server
rm -rf _build/static
mkdir -p _build/static
cp -r resources _build/static/
dune build --profile=release ./js/client.bc.js
File "lib/ck_utils.ml", line 70, characters 2-30:
70 |   ReactiveData.RList.make_from init changes
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound value ReactiveData.RList.make_from
ocaml-crunch lib/ck_init.ml
Generating ck_init.ml
Skipping generation of .mli
make: *** [Makefile:56: server] Error 1
root@localhost:~/cuekeeper# 

Problems building client and server

make fails with pinned version of bin_prot, but works with current bin_prot (0.9.0).

make server fails because server/config.ml seems out of sync with current mirage:

  • get_mode() is not supported anymore
  • ipv4_conf does not have these fields anymore

I would like to be able to use the server to access cuekeeper from different devices. Can you recommend another unikernel configuration I could look at, to fix this one ?

Allow cancelling editing with the Esc key

Allowing cancellation of in-progress actions with the Esc key makes it nicer to explore the UI, because can click on unfamiliar controls without worrying that the UI state will be changed in a hard-to-undo manner.

When you click on the title of an action, it is replaced with a text field so you can edit it. If you think the current name is okay after all, you should be able to hit the Esc key to convert the text field back into a static label. Right now, you have to close the action box with the X in the top-right and open it again to return to the previous state.

Another example: if you click on an area or context within an action box, a drop-down menu appears so you can choose a new value. You can currently close it by clicking in empty space out of the menu. It would be nice if you could also press Esc to close the menu.

An error occurred while executing make client, because the function of _requestAnimationFrame is deprecated.

An error occurred while executing make client

dune build ./js/client.bc.js @runtest
File "js/ck_animate.ml", line 40, characters 8-39:
Error (warning 3): deprecated: Js_of_ocaml.Dom_html._requestAnimationFrame
[since 2.6] Use [Dom_html.window##requestAnimationFrame] instead.
File "js/ck_animate.ml", line 74, characters 8-39:
Error (warning 3): deprecated: Js_of_ocaml.Dom_html._requestAnimationFrame
[since 2.6] Use [Dom_html.window##requestAnimationFrame] instead.
File "js/ck_animate.ml", line 97, characters 22-53:
Error (warning 3): deprecated: Js_of_ocaml.Dom_html._requestAnimationFrame
[since 2.6] Use [Dom_html.window##requestAnimationFrame] instead.
make: *** [Makefile:14: client-test] Error 1

I checked the Dom_html description of Js_of_ocaml,

Deprecated [since 2.6] Use [Dom_html.window##requestAnimationFrame] instead.

So I modified it like this

[Dom_html.window##requestAnimationFrame] (Js.wrap_callback aux)

But it still reports an error

File "js/ck_animate.ml", line 40, characters 9-47:
Error: This expression has type
         (float -> unit) Js_of_ocaml__.Js.callback ->
         Dom_html.animation_frame_request_id Js.meth
       but an expression was expected of type 'a Js.meth
make: *** [Makefile:14: client-test] Error 1

Deprecated function.

val _requestAnimationFrame : (unit -> unit) [Js.callback]

It seems that there is a type mismatch. After learning some ocaml, I found that it is not so easy to modify, so I had to come here to ask for advice. thanks!

"Close All" sometimes results in runaway memory consumption

I noticed this while trying out the application today.

To recreate all I have to do is click "Show History" and then "Close All". It leads to runaway memory consumption (on my system the tab dies after 9gb). Not sure what is causing it as I've only just started playing with this application.

I'll keep poking around as I have time and try to understand what is occurring.

I'm on Ubuntu 16.04 and I'm running this in Chrome version 59.0.3071.115

How to make use of export and backup functions

I used the export function, but I didn't find out how to import it. I like the program you made so much, but how to back up and use the export program makes me feel very confused.
Or we can add a button to import and export files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.