CueKeeper

Copyright Thomas Leonard, 2017

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.2/cuekeeper-bin-0.2.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/

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 1.2.2). Ensure you're using OCaml 4.03 or later (check with ocaml -version). If not, switch to that version:

opam sw 4.03.0

Pin a few patches we require:

opam pin add -n reactiveData https://github.com/hhugo/reactiveData.git
opam pin add -n bin_prot 'https://github.com/talex5/bin_prot.git#cuekeeper'

opam update

Install the dependencies:

opam install sexplib uuidm irmin tyxml reactiveData js_of_ocaml omd base64 tar-format crunch cohttp irmin-indexeddb ounit mirage-http

Build:

make

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

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.
  • You must use Irmin 0.10.1, due to https://github.com/talex5/irmin-indexeddb/issues/3.

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 install mirage
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/mir-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="--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

版权所有Thomas Leonard,2017

CueKeeper是基于网络的 GTD 系统(一个花哨的TODO列表),完全在浏览器中运行(数据存储在您的计算机上,在浏览器中)。

安装

发布列表下载最新的 cuekeeper-bin zip,例如

https://github.com/talex5/cuekeeper/releases /download/v0.2/cuekeeper-bin-0.2.zip

将其解压到永久的位置(而不是您的下载文件夹),然后在Web浏览器中打开 index.html 文件。大多数浏览器将允许您固定选项卡,使其始终可用。例如在Firefox中,右键单击浏览器标签,然后从菜单中选择Pin Tab。某些事情到期时,标签图标将变红。

使用CueKeeper的说明可以在这里找到:

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

备份

所有数据将存储在本地的Web浏览器中,因此请确保您备份浏览器的数据!另外,数据将根据 index.html 文件的位置进行存储 - 如果你移动 cuekeeper 目录,你会得到一个新的数据库好像你的数据已经消失 - 不要惊慌!)。

例如,我在Linux上使用Firefox。数据存储在

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

建设(使用Docker)

构建CueKeeper的最简单方法是使用Docker:

make docker-build

然后在浏览器中加载 test.html 以在本地测试(不需要服务器)。

建设(不含Docker)

您需要 opam 软件包管理器。 它应该可以通过您的发行版,但您可以使用通用opam二进制文件,如果它丢失或太旧(我使用opam 1.2.2)。 确保使用OCaml 4.03或更高版本(请参阅 ocaml -version )。如果没有,请切换到该版本:

opam sw 4.03.0
固定我们需要的几个补丁:

opam pin add -n reactiveData https://github.com/hhugo/reactiveData.git
opam pin add -n bin_prot 'https://github.com/talex5/bin_prot.git#cuekeeper'

opam update

安装依赖项:

opam install sexplib uuidm irmin tyxml reactiveData js_of_ocaml omd base64 tar-format crunch cohttp irmin-indexeddb ounit mirage-http

构建:

make

在浏览器中加载 test.html 以在本地测试(不需要服务器)。

运行服务器

虽然可以直接在浏览器中打开 test.html ,如上所述,您也可以构建一个服务器。 这样,您可以在设备(例如笔记本电脑和手机)之间进行同步。

警告:这是一项正在进行中的

  • 服务器尚未保留数据本身 (客户端在重新启动服务后首次发送连接的整个历史记录)。
  • 您必须通过点击 Sync 按钮手动同步 - 它不会自动发送或获取更改。
  • 您必须使用Irmin 0.10.1,因为 https://github.com/talex5/irmin-indexeddb / issues / 3 。

首先,生成一个访问令牌(一个长的随机字符串,它允许访问服务器)。 pwgen 命令对此有用:

$ pwgen -s 32 1
dtXZ7fQfX52VsnJNk22J6uKy8JSn6klb

为了避免在服务器二进制文件中存储秘密,请生成其SHA256哈希:

$ echo -n dtXZ7fQfX52VsnJNk22J6uKy8JSn6klb | sha256sum
774400f3384a6f37cc2bc54b2fd0280193b613a5bc401c0e54fd17fe4ec19572

将文件 server / devices.ml.example 复制为 server / devices.ml 并添加哈希 您以上生成,例如:

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

结尾处的字符串(笔记本电脑)仅用于记录。 您可以为要同步的每个设备生成不同的访问令牌,并将其全部列出,每行一个。 确保行是最后一行 - 这将拒绝所有未知令牌。

构建服务器组件:

opam install mirage
make server

系统将提示您创建自签名X.509证书。只需输入服务器的主机名 作为通用名称(为了测试,您可以在这里使用localhost,然后生成一个适当的)。

要运行服务器:

./server/mir-cuekeeper

默认情况下,服务器侦听TCP端口8443,但可以通过编辑 server / unikernel.ml 来更改。

在浏览器中打开URL,例如

https://localhost:8443/

您现在可能会收到一些关于证书不受信任的吓人的警告。 要摆脱警告,请添加新生成的server.pem,如下所示:

在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").

在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.
最后,应提示您输入访问密钥。 粘贴在上面生成的令牌中(例如,上述示例中的 dtXZ7fQfX52VsnJNk22J6uKy8JSn6klb - 不是哈希)。

作为Xen VM部署

实际上,服务器是 Mirage unkernel ,也可以作为Xen虚拟机进行编译和引导:

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

错误

请向幻影邮件列表发送任何问题或意见:

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

可以在邮件列表或GitHub问题上报告错误:

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

条件

这个图书馆是免费软件;你可以重新分配它和/或 根据GNU小将公司的条款进行修改 自由软件基金会发布的许可证;或者 版本2.1的许可证,或(在您的选择)任何更高版本。

这个图书馆是分发的,希望它是有用的, 但不提供任何保证;甚至没有隐含的保证 适销性或特定用途的适用性。参见GNU 较小的通用公共许可证,以获取更多细节。

您应该已经收到了GNU小公司的副本 许可证与这个图书馆一起;如果没有,请写入自由软件 Foundation,Inc.,51 Franklin Street,Fifth Floor,Boston,MA 02110-1301 美国

此项目包括Foundation( http://foundation.zurb.com )。这些文件 根据麻省理工学院的许可证发布。

该项目包括Pikaday日期选择器( https://github.com/dbushell/Pikaday )。 这些文件是在BSD& MIT许可证。

此项目包括FileSaver.js( https://github.com/eligrey/FileSaver.js ),其中 根据许可证发放。

所有许可证的全部详细信息可以在LICENSE文件中找到。




相关问题推荐