eephttpd

package module
v0.0.9995 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: GPL-3.0 Imports: 22 Imported by: 2

README

eephttpd

So much for a simple static file server.

eepHttpd is a web hosting tool for content in I2P, I2P sites, and I2P torrents. On it's own, it's basically a static directory server with limited scripting abilities written in pure-Go.

However, it responds differently to different kinds of interaction.

  1. If a Git client attempts to access it, then they will be able to clone the entire site, up from the document root(So Use this for things You want to SHARE ANONYMOUSLY with a large audience, not for things you want to keep secret.) This allows people to clone the site in order to mirror it.
  2. When any file is changed in the docroot, eephttpd generates a multi-file torrent of the site and places it in the docroot under the file name eephttpd.torrent. This allows people to mirror the site's exact content, and participate in keeping the site's content up.
  3. When a browser with I2P in Private Browsing connects to it, it creates a magnet link and replies with it as an X-I2P-TORRENTLOCATION header. In this way, the browser can help the user download the whole web site using Bittorrent and substitute HTTP resources for Bittorrent resources when they are ready.
  4. If a Torrent client attempts to access the /a URL, it is forwarded to an Open Torrent Tracker. Every single eephttpd site is also an open torrent tracker. Moreover, every single eephttpd site treats itself as the primary tracker for the whole-site torrent it generates. This is intended to encourage the distribution of open trackers on I2P.

So... more to come on why this is cool.

In order to build a .deb file, either use checkinstall or run:

    go mod vendor
    make orig
    debuild -us -uc

or just run:

    make deb

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirSize added in v0.0.9993

func DirSize(path string) (int64, error)

func FileExists added in v0.0.3

func FileExists(filename string) bool

func IsDirectory added in v0.0.9995

func IsDirectory(path string) bool

func LoadFeedConfig added in v0.0.9995

func LoadFeedConfig(filename string) (ret map[string]string)

func Never added in v0.0.91

func SetAccessList

func SetAccessList(s []string) func(*EepHttpd) error

SetAccessList tells the system to treat the accessList as a whitelist

func SetAccessListType

func SetAccessListType(s string) func(*EepHttpd) error

SetAccessListType tells the system to treat the accessList as a whitelist

func SetAllowZeroIn

func SetAllowZeroIn(b bool) func(*EepHttpd) error

SetAllowZeroIn tells the tunnel to accept zero-hop peers

func SetAllowZeroOut

func SetAllowZeroOut(b bool) func(*EepHttpd) error

SetAllowZeroOut tells the tunnel to accept zero-hop peers

func SetCloseIdle

func SetCloseIdle(b bool) func(*EepHttpd) error

SetCloseIdle tells the connection to close it's tunnels during extended idle time.

func SetCloseIdleTime

func SetCloseIdleTime(u int) func(*EepHttpd) error

SetCloseIdleTime sets the time to wait before closing tunnels to idle levels

func SetCloseIdleTimeMs

func SetCloseIdleTimeMs(u int) func(*EepHttpd) error

SetCloseIdleTimeMs sets the time to wait before closing tunnels to idle levels in milliseconds

func SetCompress

func SetCompress(b bool) func(*EepHttpd) error

SetCompress tells clients to use compression

func SetEncrypt

func SetEncrypt(b bool) func(*EepHttpd) error

SetEncrypt tells the router to use an encrypted leaseset

func SetFastRecieve

func SetFastRecieve(b bool) func(*EepHttpd) error

SetFastRecieve tells clients to use compression

func SetFeedFilePath added in v0.0.9995

func SetFeedFilePath(s string) func(*EepHttpd) error

SetFeedFilePath sets the path to save the config file at.

func SetFilePath

func SetFilePath(s string) func(*EepHttpd) error

SetFilePath sets the path to save the config file at.

func SetGitURL added in v0.0.98

func SetGitURL(s string) func(*EepHttpd) error

func SetHost

func SetHost(s string) func(*EepHttpd) error

SetHost sets the host of the service to forward

func SetHostname added in v0.0.98

func SetHostname(s string) func(*EepHttpd) error

func SetINIFile added in v0.0.991

func SetINIFile(s string) func(*EepHttpd) error

func SetInBackups

func SetInBackups(u int) func(*EepHttpd) error

SetInBackups sets the inbound tunnel backups

func SetInLength

func SetInLength(u int) func(*EepHttpd) error

SetInLength sets the number of hops inbound

func SetInQuantity

func SetInQuantity(u int) func(*EepHttpd) error

SetInQuantity sets the inbound tunnel quantity

func SetInVariance

func SetInVariance(i int) func(*EepHttpd) error

SetInVariance sets the variance of a number of hops inbound

func SetKeyFile

func SetKeyFile(s string) func(*EepHttpd) error

SetKeyFile sets

func SetLeaseSetKey

func SetLeaseSetKey(s string) func(*EepHttpd) error

SetLeaseSetKey sets the host of the EepHttpd's SAM bridge

func SetLeaseSetPrivateKey

func SetLeaseSetPrivateKey(s string) func(*EepHttpd) error

SetLeaseSetPrivateKey sets the host of the EepHttpd's SAM bridge

func SetLeaseSetPrivateSigningKey

func SetLeaseSetPrivateSigningKey(s string) func(*EepHttpd) error

SetLeaseSetPrivateSigningKey sets the host of the EepHttpd's SAM bridge

func SetMessageReliability

func SetMessageReliability(s string) func(*EepHttpd) error

SetMessageReliability sets the host of the EepHttpd's SAM bridge

func SetName

func SetName(s string) func(*EepHttpd) error

SetName sets the host of the EepHttpd's SAM bridge

func SetOutBackups

func SetOutBackups(u int) func(*EepHttpd) error

SetOutBackups sets the inbound tunnel backups

func SetOutLength

func SetOutLength(u int) func(*EepHttpd) error

SetOutLength sets the number of hops outbound

func SetOutQuantity

func SetOutQuantity(u int) func(*EepHttpd) error

SetOutQuantity sets the outbound tunnel quantity

func SetOutVariance

func SetOutVariance(i int) func(*EepHttpd) error

SetOutVariance sets the variance of a number of hops outbound

func SetPort

func SetPort(s string) func(*EepHttpd) error

SetPort sets the port of the service to forward

func SetReduceIdle

func SetReduceIdle(b bool) func(*EepHttpd) error

SetReduceIdle tells the connection to reduce it's tunnels during extended idle time.

func SetReduceIdleQuantity

func SetReduceIdleQuantity(u int) func(*EepHttpd) error

SetReduceIdleQuantity sets minimum number of tunnels to reduce to during idle time

func SetReduceIdleTime

func SetReduceIdleTime(u int) func(*EepHttpd) error

SetReduceIdleTime sets the time to wait before reducing tunnels to idle levels

func SetReduceIdleTimeMs

func SetReduceIdleTimeMs(u int) func(*EepHttpd) error

SetReduceIdleTimeMs sets the time to wait before reducing tunnels to idle levels in milliseconds

func SetSAMHost

func SetSAMHost(s string) func(*EepHttpd) error

SetSAMHost sets the host of the EepHttpd's SAM bridge

func SetSAMPort

func SetSAMPort(s string) func(*EepHttpd) error

SetSAMPort sets the port of the EepHttpd's SAM bridge using a string

func SetSaveFile

func SetSaveFile(b bool) func(*EepHttpd) error

SetSaveFile tells the router to save the tunnel's keys long-term

func SetServeDir

func SetServeDir(s string) func(*EepHttpd) error

SetServeDir sets the path to the directory you want to serve

func SetSigType

func SetSigType(s string) func(*EepHttpd) error

SetSigType sets the type of the forwarder server

func SetType

func SetType(s string) func(*EepHttpd) error

SetType sets the type of the forwarder server

Types

type EepHttpd

type EepHttpd struct {
	*samtracker.SamTracker
	*gitkit.Server
	*watcher.Watcher
	ServeDir string
	GitRepo  *git.Repository
	GitURL   string
	Hostname string
	IniFile  string
	// contains filtered or unexported fields
}

EepHttpd is a structure which automatically configured the forwarding of a local service to i2p over the SAM API.

func NewEepHttpd

func NewEepHttpd(host, port string) (*EepHttpd, error)

NewEepHttpd makes a new SAM forwarder with default options, accepts host:port arguments

func NewEepHttpdFromOptions

func NewEepHttpdFromOptions(opts ...func(*EepHttpd) error) (*EepHttpd, error)

NewEepHttpdFromOptions makes a new SAM forwarder with default options, accepts host:port arguments

func (*EepHttpd) Close

func (f *EepHttpd) Close() error

Close shuts the whole thing down.

func (*EepHttpd) GetType

func (f *EepHttpd) GetType() string

func (*EepHttpd) HandleFile

func (f *EepHttpd) HandleFile(rw http.ResponseWriter, rq *http.Request)

func (*EepHttpd) HandleGit added in v0.0.91

func (f *EepHttpd) HandleGit(rw http.ResponseWriter, rq *http.Request)

func (*EepHttpd) HandleMarkdown

func (f *EepHttpd) HandleMarkdown(rw http.ResponseWriter, rq *http.Request)

func (*EepHttpd) HandleMissing

func (f *EepHttpd) HandleMissing(rw http.ResponseWriter, rq *http.Request)

func (*EepHttpd) HandleScript

func (f *EepHttpd) HandleScript(rw http.ResponseWriter, rq *http.Request)

func (*EepHttpd) HandleTorrent added in v0.0.9991

func (e *EepHttpd) HandleTorrent(rw http.ResponseWriter, rq *http.Request)

func (*EepHttpd) HostName added in v0.0.98

func (e *EepHttpd) HostName() string

func (*EepHttpd) Load

func (s *EepHttpd) Load() (samtunnel.SAMTunnel, error)

func (*EepHttpd) MakeTorrent added in v0.0.98

func (e *EepHttpd) MakeTorrent() error

func (*EepHttpd) Print added in v0.0.991

func (e *EepHttpd) Print() string

func (*EepHttpd) ProxyRequest added in v0.0.98

func (f *EepHttpd) ProxyRequest(req *http.Request) (*http.Request, error)

func (*EepHttpd) Pull added in v0.0.98

func (e *EepHttpd) Pull() error

func (*EepHttpd) PullFeeds added in v0.0.9995

func (e *EepHttpd) PullFeeds() error

func (*EepHttpd) ResetGit added in v0.0.991

func (e *EepHttpd) ResetGit() error

func (*EepHttpd) Save added in v0.0.991

func (e *EepHttpd) Save() error

func (*EepHttpd) Serve

func (f *EepHttpd) Serve() error

Serve starts the SAM connection and and forwards the local host:port to i2p

func (*EepHttpd) ServeHTTP

func (f *EepHttpd) ServeHTTP(rw http.ResponseWriter, rq *http.Request)

func (*EepHttpd) ServeParent

func (f *EepHttpd) ServeParent()

func (*EepHttpd) Target added in v0.0.98

func (f *EepHttpd) Target() string

func (*EepHttpd) Up

func (f *EepHttpd) Up() bool

type Option

type Option func(*EepHttpd) error

Option is a EepHttpd Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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