Code Monkey home page Code Monkey logo

redir's Introduction

redir Latest relsease

Full-featured, self-hosted URL shortener written in Go.

Features Description
Custom Domain Everything is under control with your own domain
Link Shortener Support /s/semantic-name for short semantic alias for anonymous shortening
Go Vanity Import Redirect /x/repo-name to configured VCS and pkg.go.dev for API documentation
Access Control 1) Private links won't be listed in public index page; 2) Allow link to be accessible only after a configured time point; 3) Allow warn to visitors about external URL redirects (for liability control)
Public Indexes Router /s provides a list of avaliable short links
Admin Dashboard Dashboard /s?mode=admin provides full management ability
Visitor Analysis Statistics visualization regarding PV, UV, Referrer, Devices, Location, etc
GDPR Compliant Including imprint, privacy, contact pages; optional warning about external redirects, etc.

Documentations

Web Interfaces

There are three major pages available in redir.

Admin Dashboard Access Control Public Indexes
Router: /s?mode=admin for management:
Control a link should only be available after a certain time:
Router /s provides public accessibility to see all public links:

CLI Usage

The redir command offers server side operation feature from shell:

$ redir

redir is a featured URL shortener. The redir server (run via '-s' option),
will connect to the default database address mongodb://localhost:27018.
It is possible to reconfig redir using an external configuration file.
See https://changkun.de/s/redir for more details.

Version: dev

GoVersion: devel go1.18-39e08c6cd7 Tue Sep 21 13:18:09 2021 +0000

Command line usage:

$ redir [-s] [-f <file>] [-d <file>] [-op <operator> -a <alias> -l <link> -p -trust -vt <time>]

...

Customization

You can configure redir using a configuration file. The default configuration is embedded into the binary.

Alternative configuration can be used to replace default config and specified in environtment variable REDIR_CONF, for example REDIR_CONF=/path/to/config.yml redir -s to run the redir server under given configuration.

Deployment

Download Pre-Builds

Please check the release page.

Build from Source

You need install Go to build the redir command.

Build everything into a single native binary:

$ make dashboard # build front-end
$ make           # build back-end and embed front-end files into binary

$ redir -s # run the server, require an external database

Build and deploy with Docker:

$ docker network create traefik_proxy
$ make dashboard && make build && make up

Contributing

Easiest way to contribute is to provide feedback! We would love to hear what you like and what you think is missing. PRs are also welcome.

License

MIT © 2020-2021 Changkun Ou

redir's People

Contributors

changkun avatar dependabot[bot] avatar huertx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.