Local Native App

version: 0.2.2

A note/bookmark taking tool to save your notes in a local sqlite database, synced with other devices via ssb protocal.

Web extension UI

Local Native web extension popup screenshot

Search your notes

Local Native patchbay screenshot

(not so) Quick start

It is developer friendly now, and requires some fiddling.

Below componets must all exist and correctly setup.

Install browser extension

git clone https://gitlab.com/yiwang/localnative.git
cd localnative-browser-extension/app
npm i -g web-ext
web-ext run --verbose # firefox

Setup browser extension host binary

  • use cargo install localnative_cli, and find the binary at ~/.cargo/bin/localnative-web-ext-host

  • or build from source, via cargo

cd localnative-rs
cargo build

Setup native messaging manifest to point to extension host binary

  • Copy manifest json template file app.localnative.json from localnative-browser-extension/host to your browser's specific manifest location
  • Change the host path in app.localnative.json to where localnative-web-ext-host binary is from previous step
Firefox example manifest file

~/.mozilla/native-messaging-hosts/app.localnative.json

{
  "name": "app.localnative",
  "description": "Local Native Host",
  "path": "/home/USER/.cargo/bin/localnative-web-ext-host",
  "type": "stdio",
  "allowed_extensions": [
    "localnative@example.org"
  ]
}
Chromium example manifest file

~/.config/chromium/NativeMessagingHosts/app.localnative.json

{
  "name": "app.localnative",
  "description": "Local Native Host",
  "path": "/home/USER/.cargo/bin/localnative-web-ext-host",
  "type": "stdio",
  "allowed_origins": [
    // use this ID if you install from chrome web store,
    // or add/change to what the actual ID is if you "LOAD UNPACKED" from source.
    "chrome-extension://oclkmkeameccmgnajgogjlhdjeaconnb/"
  ]
}

Setup Node.js global binaries

currently the rust host binary calls some node.js binaries for ssb work, so

npm i -g localnative

the host may not know the global node bin path, so cd to where you node global bin directory, and

(sudo) ln -s localnative-ssb* /usr/local/bin/

Start a sbot server

The web extension send message to localnative-web-ext-host and writes new note to sqlite first, then response to display the search result, and finally try to sync with ssb. If sbot server is not running, the host will not sync with ssb at that time.

So use those softwares:

Patchwork simpler user friendly UI.

Patchbay more advanced, and show the raw json of each message for easiler debugging, combined with custom filter and good enough free text search.

Database

If above things are correctly setup, localnative.sqlite3 database file is created at the directory ~/.ssb/localnative.sqlite3 the first time you click the web ext popup.

hint to see what localnative-web-ext-host went wrong:

RUST_BACKTRACE=1 chromium-browser
RUST_BACKTRACE=1 web-ext run --verbose

You can use DB Browser for SQLite to explore the database, and adding other device's ssb public key as authoer in the ssb table.

TODO

desktop platform

  • windows?

mobile

  • android
  • ios

i18n

  • more languages?

db

  • encryption?

Changelog

v0.2.2

  • persist language choice
  • fix firefox language dropdown issue

v0.2.1

  • add i18n zh-CN

v0.2.0

  • allow public note be send to ssb
  • breaking schema change of table note by adding is_public column, sql migration script added

v0.1.5

  • allow web-ext to function without ssb sync
  • docs with screenshots

v0.1.4

  • remove annotations in ssb message
  • fill all ssb fields after publish

v0.1.3

  • recursively reduce annotation markdown size
  • ssbify None result handling

v0.1.2

  • fix to not ssbify when empty annotations
  • internalize ssbify code
  • allow small sized markdown to be displayed in ssb message

v0.1.1

  • use sql transactions
  • simplify rust to nodejs calls to global binaries

v0.1.0

  • ssb sync with other ids
  • add ssbify option
  • hide delete item operation

v0.1.0

  • hide delete item operation
  • tune UI elements to be more instant responsive

v0.0.2

  • add delete item operation
  • tune UI elements to be more instant responsive

v0.0.1

  • basic firefox and chrome extension

Release

https://localnative.app/release/

release
├── [       4096]  v0.0.1
│   └── [       4096]  web-ext-host
│       ├── [    5656824]  localnative-web-ext-host-0.0.1
│       ├── [         65]  localnative-web-ext-host-0.0.1.md5
│       └── [         97]  localnative-web-ext-host-0.0.1.sha256
├── [       4096]  v0.0.2
│   └── [       4096]  web-ext-host
│       ├── [    5667040]  localnative-web-ext-host-0.0.2
│       ├── [         65]  localnative-web-ext-host-0.0.2.md5
│       └── [         97]  localnative-web-ext-host-0.0.2.sha256
├── [       4096]  v0.1.0
│   └── [       4096]  web-ext-host
│       ├── [    5840840]  localnative-web-ext-host-0.1.0
│       ├── [         65]  localnative-web-ext-host-0.1.0.md5
│       └── [         97]  localnative-web-ext-host-0.1.0.sha256
├── [       4096]  v0.1.1
│   └── [       4096]  web-ext-host
│       ├── [    5847912]  localnative-web-ext-host-0.1.1
│       ├── [         65]  localnative-web-ext-host-0.1.1.md5
│       └── [         97]  localnative-web-ext-host-0.1.1.sha256
├── [       4096]  v0.1.2
│   └── [       4096]  web-ext-host
│       ├── [    5857136]  localnative-web-ext-host-0.1.2
│       ├── [         65]  localnative-web-ext-host-0.1.2.md5
│       └── [         97]  localnative-web-ext-host-0.1.2.sha256
├── [       4096]  v0.1.3
│   └── [       4096]  web-ext-host
│       ├── [    5857264]  localnative-web-ext-host-0.1.3
│       ├── [         65]  localnative-web-ext-host-0.1.3.md5
│       └── [         97]  localnative-web-ext-host-0.1.3.sha256
├── [       4096]  v0.1.4
│   └── [       4096]  web-ext-host
│       ├── [    5857064]  localnative-web-ext-host-0.1.4
│       ├── [         65]  localnative-web-ext-host-0.1.4.md5
│       └── [         97]  localnative-web-ext-host-0.1.4.sha256
├── [       4096]  v0.1.5
│   └── [       4096]  web-ext-host
│       ├── [    5857344]  localnative-web-ext-host-0.1.5
│       ├── [         65]  localnative-web-ext-host-0.1.5.md5
│       └── [         97]  localnative-web-ext-host-0.1.5.sha256
└── [       4096]  v0.2.0
    └── [       4096]  web-ext-host
        ├── [    5861624]  localnative-web-ext-host-0.2.0
        ├── [         65]  localnative-web-ext-host-0.2.0.md5
        └── [         97]  localnative-web-ext-host-0.2.0.sha256

18 directories, 27 files

Source Code

https://gitlab.com/yiwang/localnative

or ssb://%q13hLJchNXz/xZi9mjWVHyIbRnkr5VjF0Y6BfhrOV6Q=.sha256

License

AGPL-3.0