totp-reverse-proxy

command module
v0.0.0-...-e300080 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 12 Imported by: 0

README

totp-reverse-proxy

A small go based reverse proxy with support for TLS, TOTP, and logging using session cookies.

Usage

In Linux you can generate the TOTP key using following command:

    SECRET=$(dd if=/dev/urandom|base64|tr -cd 'A-Z2-7'|head -c16)

And for TOTP client like Google Authenticator the QR-code can be generated with help of qrencode tool:

    SERVERNAME=external.myhost.domain
    qrencode -t ANSI256 -o - "otpauth://totp/user@$SERVERNAME?secret=$SECRET'

To build and run the proxy:

go build
./totp_reverse_proxy -server $SECRET -upstream http://localhost:8000 &

The proxy will write the logs to rotated proxy-access.log file. To test the TOTP the https://totp.danhersam.com/ can be used.

The current version of the proxy supports following options:

Usage of ./totp-reverse-proxy:
  -cert string
        Path to HTTPS Certificate
  -https
        Enable HTTPS
  -key string
        Path to HTTPS key
  -listen string
        Listen address (default ":9090")
  -secret string
        TOTP Secret Key
  -upstream string
        Upstream URL

Documentation

Overview

totp_reverse_proxy.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL