bookmarks

command module
v0.0.0-...-f391ad9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 4 Imported by: 0

README

Build Status codecov

Bookmarks

This is the code for bm.suram.in. I use this to bookmark websites with custom redirect URLs.

The application is written in Go and uses editable grid to list/search/update the bookmarked URLs. The app uses sqlite (the poor man's DB!) to persist data.

Use internal/testdata/test_db to get an empty sqlite file with the correct schema. Schema is as follows.

CREATE TABLE "aliases" (
    `orig`   TEXT,
    `alias`  TEXT UNIQUE,
    `rec_id` INTEGER PRIMARY KEY AUTOINCREMENT
);
CREATE INDEX aliases_orig_index ON "aliases" (orig);

CREATE TABLE `config` (
	`key`	TEXT,
	`value`	TEXT,
	PRIMARY KEY(key)
)

Admin features

The application has 2 "admin" features. To enable these features there needs to be a record with key set to bm_secret and value set to {YOUR_SECRET_KEY} in the config table.

  1. After this, content can be modified only if the correct secret is passed in the request.
  2. Any bookmark with alias that starts with _ will be hidden unless the secret is passed in the request.

Installation

Clone the repository to $GOPATH/src/github.com/dotslash/bookmarks and the following to start the server.

go build
./bookmarks http://localhost:8085 8085 foo.db

The logs will go to ~/log/bm-info.log, ~/log/bm-error.log

Check scripts/supervisor_aws.conf to see how I install the server.

Chrome Extension

The application also comes with a compatible chrome extension. Check out its Readme

Documentation

Overview

Entry point to the bookmarks server. Example usage: ./bookmarks.bin https://bm.suram.in 8085 arg1 : Address of the server hosting the application. This will be used

to generate short urls. E.g - https://bm.suram.in/r/foo

arg2 : port to run the http server at. arg3 : db location

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL