Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 37e3a3fe7c | |||
| 49288a5b8b |
@@ -6,15 +6,20 @@ A self-hosted bookmark database with full-text page content search.
|
|||||||
|
|
||||||
* Simple cross-platform single binary deployment
|
* Simple cross-platform single binary deployment
|
||||||
* or docker if you prefer
|
* or docker if you prefer
|
||||||
|
* Bookmarklet, single click to add a bookmark from any webpage
|
||||||
* Full-text search
|
* Full-text search
|
||||||
* Bookmark content is scraped and indexed locally
|
* Bookmark content is scraped and indexed locally
|
||||||
* Page content periodically refreshed automatically
|
* Page content periodically refreshed automatically
|
||||||
* Interactively search across titles and content
|
* Interactively search across titles and content
|
||||||
* Rippingly fast results, as you type
|
* Rippingly fast results, as you type
|
||||||
|
* full text search ~60ms (over full text content of 600 bookmarks)
|
||||||
* No need to remember how you filed something, you just need a keyword
|
* No need to remember how you filed something, you just need a keyword
|
||||||
or two to discover it again
|
or two to discover it again
|
||||||
* Embedded database, no separate database system required
|
* Embedded database, no separate database required
|
||||||
* Light on resources
|
* Light on resources
|
||||||
|
* ~21Mb binary
|
||||||
|
* ~40Mb memory
|
||||||
|
* ~24Mb database (600 bookmarks, full text content indexed)
|
||||||
* Easily export your bookmarks to a plain text file - your data is yours
|
* Easily export your bookmarks to a plain text file - your data is yours
|
||||||
|
|
||||||
# Roadmap
|
# Roadmap
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/tardisx/linkwallet/db"
|
"github.com/tardisx/linkwallet/db"
|
||||||
@@ -10,8 +11,19 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
var dbPath string
|
||||||
|
flag.StringVar(&dbPath, "db-path", "", "path to the database file")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
if dbPath == "" {
|
||||||
|
log.Fatal("You need to specify the path to the database file with -db-path")
|
||||||
|
}
|
||||||
|
|
||||||
dbh := db.DB{}
|
dbh := db.DB{}
|
||||||
dbh.Open("badger")
|
err := dbh.Open(dbPath)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
bmm := db.NewBookmarkManager(&dbh)
|
bmm := db.NewBookmarkManager(&dbh)
|
||||||
cmm := db.NewConfigManager(&dbh)
|
cmm := db.NewConfigManager(&dbh)
|
||||||
|
|
||||||
|
|||||||
9
db/db.go
9
db/db.go
@@ -1,6 +1,7 @@
|
|||||||
package db
|
package db
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/tardisx/linkwallet/entity"
|
"github.com/tardisx/linkwallet/entity"
|
||||||
@@ -11,16 +12,16 @@ type DB struct {
|
|||||||
store *bolthold.Store
|
store *bolthold.Store
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *DB) Open(dir string) {
|
func (db *DB) Open(path string) error {
|
||||||
// options := bolthold.DefaultOptions
|
// options := bolthold.DefaultOptions
|
||||||
// options.Dir = dir
|
// options.Dir = dir
|
||||||
// options.ValueDir = dir
|
// options.ValueDir = dir
|
||||||
store, err := bolthold.Open("bolt.db", 0666, nil)
|
store, err := bolthold.Open(path, 0666, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
return fmt.Errorf("cannot open '%s' - %s", path, err)
|
||||||
|
|
||||||
}
|
}
|
||||||
db.store = store
|
db.store = store
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *DB) Close() {
|
func (db *DB) Close() {
|
||||||
|
|||||||
12
docker-compose.yml-sample
Normal file
12
docker-compose.yml-sample
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
version: "2.1"
|
||||||
|
services:
|
||||||
|
linkwallet:
|
||||||
|
image: tardisx/linkwallet:latest
|
||||||
|
container_name: linkwallet
|
||||||
|
command: /app/linkwallet -db-path=/data/linkwallet.db
|
||||||
|
volumes:
|
||||||
|
- /home/username/.linkwallet:/data
|
||||||
|
ports:
|
||||||
|
- 8109:8080
|
||||||
|
restart: unless-stopped
|
||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"golang.org/x/mod/semver"
|
"golang.org/x/mod/semver"
|
||||||
)
|
)
|
||||||
|
|
||||||
const Tag = "v0.0.11"
|
const Tag = "v0.0.12"
|
||||||
|
|
||||||
var versionInfo struct {
|
var versionInfo struct {
|
||||||
Local struct {
|
Local struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user