Skip to content
master
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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. It expects a foo.db in the repo root.

To get an empty sqlite file with the correct schema, use this online utility - https://sqliteonline.com/#fiddle-5d6c0626e3699dmuk01a04iq

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

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

Releases

No releases published
You can’t perform that action at this time.