πŸ”— Link Manager as a Service.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
cmd
docs
env
pkg
vendor
.dockerignore
.gitattributes
.gitignore
.goreleaser.yml
.scrutinizer.yml
.travis.yml
LICENSE
Makefile
README.md
go.mod
go.sum
main.go
main_test.go

README.md

πŸ”— Click! Tweet

Link Manager as a Service β€” your personal link storage and URL shortener.

Patreon Build Status Code Coverage Code Quality Research License

Roadmap

Motivation

  • We need better integration with static sites built with Hugo.
  • We want better products than Bitly or Ow.ly.
  • We have to full control over our users' data and protect it from third parties.

Quick start

Requirements:

  • Docker 18.06.0-ce or above
  • Docker Compose 1.22.0 or above
  • Go 1.9.2 or above
  • GNU Make 3.81 or above
$ make up demo status

     Name                    Command               State                          Ports
---------------------------------------------------------------------------------------------------------------
click_db_1        docker-entrypoint.sh postgres    Up      0.0.0.0:5432->5432/tcp
click_server_1    /bin/sh -c echo $BASIC_USE ...   Up      0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
click_service_1   service run --with-profili ...   Up      0.0.0.0:8080->80/tcp, 0.0.0.0:8090->8090/tcp,
                                                           0.0.0.0:8091->8091/tcp, 0.0.0.0:8092->8092/tcp

$ open http://127.0.0.1.xip.io/github/click

$ make help
GET curl /api/v1/UUID
$ curl http://127.0.0.1.xip.io/api/v1/10000000-2000-4000-8000-160000000005 | jq
# {
#   "id": "10000000-2000-4000-8000-160000000005",
#   "name": "Click! - Link Manager as a Service",
#   "aliases": [
#     {
#       "id": "10000000-2000-4000-8000-160000000008",
#       "namespace": "10000000-2000-4000-8000-160000000001",
#       "urn": "github/click"
#     },
#     {
#       "id": "10000000-2000-4000-8000-160000000007",
#       "namespace": "10000000-2000-4000-8000-160000000001",
#       "urn": "github/click!"
#     },
#     {
#       "id": "10000000-2000-4000-8000-160000000006",
#       "namespace": "10000000-2000-4000-8000-160000000004",
#       "urn": "github/click"
#     }
#   ],
#   "targets": [
#     {
#       "id": "10000000-2000-4000-8000-160000000011",
#       "rule": {
#         "description": "Project's source code",
#         "tags": [
#           "src"
#         ]
#       },
#       "url": "https://github.com/kamilsk/click"
#     },
#     {
#       "id": "10000000-2000-4000-8000-160000000009",
#       "rule": {
#         "description": "Project's bug tracker",
#         "alias": "10000000-2000-4000-8000-160000000006"
#       },
#       "url": "https://github.com/kamilsk/click/issues/new"
#     },
#     {
#       "id": "10000000-2000-4000-8000-160000000010",
#       "rule": {
#         "description": "Project's promo page",
#         "alias": "10000000-2000-4000-8000-160000000007",
#         "tags": [
#           "promo"
#         ],
#         "match": 1
#       },
#       "url": "https://kamilsk.github.io/click/"
#     }
#   ]
# }

$ curl -H "X-Click-Namespace: 10000000-2000-4000-8000-160000000001" -v http://127.0.0.1.xip.io/github/click!
# > GET /github/click! HTTP/1.1
# > Host: 127.0.0.1.xip.io
# > User-Agent: curl/7.54.0
# > Accept: */*
# >
# < HTTP/1.1 302 Found
# < Location: https://kamilsk.github.io/click/
# < Date: Sat, 05 May 2018 09:34:47 GMT
# < Content-Length: 0
# <

Specification

API

You can find API specification here. Also, we recommend using Insomnia HTTP client to work with the API - you can import data for it from the file. Or you can choose Postman - its import data is here and here.

CLI

You can use CLI not only to start the HTTP server but also to execute CRUD operations.

Service command-line interface
$ make install

$ click help
Click!

Usage:
  click [command]

Available Commands:
  completion  Print Bash or Zsh completion
  ctl         Click! Service Control
  help        Help about any command
  migrate     Apply database migration
  run         Start HTTP server
  version     Show application version

Flags:
  -h, --help   help for click

Use "click [command] --help" for more information about a command.

Bash and Zsh completions

You can find completion files here or build your own using these commands

$ click completion -f bash > /path/to/bash_completion.d/click.sh
$ click completion -f zsh  > /path/to/zsh-completions/_click.zsh

Installation

Brew

$ brew install kamilsk/tap/click

Binary

$ export REQ_VER=2.0.0  # all available versions are on https://github.com/kamilsk/click/releases/
$ export REQ_OS=Linux   # macOS and Windows are also available
$ export REQ_ARCH=64bit # 32bit is also available
# wget -q -O click.tar.gz
$ curl -sL -o click.tar.gz \
       https://github.com/kamilsk/click/releases/download/"${REQ_VER}/click_${REQ_VER}_${REQ_OS}-${REQ_ARCH}".tar.gz
$ tar xf click.tar.gz -C "${GOPATH}"/bin/ && rm click.tar.gz

Docker Hub

$ docker pull kamilsk/click:2.x
# or use mirror
$ docker pull quay.io/kamilsk/click:2.x

From source code

$ egg github.com/kamilsk/click@^2.0.0 -- make test install
# or use mirror
$ egg bitbucket.org/kamilsk/click@^2.0.0 -- make test install

egg1 is an extended go get.

Update

This application is in a state of MVP and under active development. SemVer is used for releases, and you can easily be updated within minor versions, but major versions can be not BC-safe.

1 The project is still in prototyping. ↩


Gitter @kamilsk @octolab

made with ❀️ by OctoLab