Skip to content

dotslash/bookmarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A url shortener that backs data in sqlite. Written in golang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published