All Projects â†’ golang-design â†’ redir

golang-design / redir

Licence: MIT license
🧭 a request redirector

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to redir

redir
🧭 Full-featured, self-hosted URL shortener.
Stars: ✭ 61 (+144%)
Mutual labels:  redirector
yellowsocks
transparent TCP to SOCKS5 redirector
Stars: ✭ 30 (+20%)
Mutual labels:  redirector
Red Team Infrastructure Wiki
Wiki to collect Red Team infrastructure hardening resources
Stars: ✭ 2,981 (+11824%)
Mutual labels:  redirector
ycsm
This is a quick script installation for resilient redirector using nginx reverse proxy and letsencrypt compatible with some popular Post-Ex Tools (Cobalt Strike, Empire, Metasploit, PoshC2).
Stars: ✭ 73 (+192%)
Mutual labels:  redirector

redir

a request redirector, aka URL shortener

Usage

The current redir implmenets the following features:

  • Link shortener: shorten links under /s
  • Go Vanity Import: redirect domain/x to configured VCS and pkg.go.dev for API documentation
  • PV/UV timeline, visitor referer, devices visualization

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.

The served alias can only be allocated by golang.design members. The current approach is to use redir command on the golang.design server. Here is the overview of its usage:

$ redir
usage: redir [-s] [-f <file>] [-op <operator> -a <alias> -l <link>]
options:
  -a string
        alias for a new link
  -f string
        import aliases from a YAML file
  -l string
        actual link for the alias, optional for delete/fetch
  -op string
        operators, create/update/delete/fetch (default "create")
  -s    run redir service

examples:
redir -s                  run the redir service
redir -f ./import.yml     import aliases from a file
redir -a alias -l link    allocate new short link if possible
redir -op fetch -a alias  fetch alias information

For the command line usage, one only needs to use -a, -l, and -op if needed. The command will talk to the Redis data store and issue a new allocated alias. For instance, the following command:

$ redir -a changkun -l https://changkun.de
https://golang.design/s/changkun

creates a new alias under golang.design/s/changkun.

If the -a is not provided, then redir command will throw an error.

Import from a YAML file is also possible, for instance:

$ redir -f import.yml

The aliases are either imported as a new alias or updated for an existing alias.

Moreover, it is possible to visit /s directly listing all exist aliases under golang.design.

Build

Makefile defines different ways to build the service:

$ make        # build native binary
$ make run    # assume your local redis is running
$ make build  # build docker images
$ make up     # run via docker-compose
$ make down   # remove compose stuff
$ make status # view compose status
$ make clean  # cleanup

Troubleshooting

private golang.design projects go get failure

  1. make sure you are a member of golang.design
  2. add ssh public key to your account
  3. git config --global url."[email protected]:".insteadOf "https://github.com/"
  4. add export GOPRIVATE=golang.design/x to your bash profile (e.g. .zshrc).

License

MIT © The golang.design Initiative Authors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].