passwdserver

package
v0.0.0-...-2db35d6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IOTimeout is the timeout (in seconds) used for transfering data between password input web server and clients.
	IOTimeout = 30 * time.Second
	/*
		ShutdownTimeout is the maximum number of seconds to wait for completion of pending IO transfers, before shutting
		down the password input web server.
	*/
	ShutdownTimeout = 3 * time.Second
	// CLIFlag is the command line flag that enables this password input web server to launch.
	CLIFlag = `pwdserver`
	// PageHTML is the content of HTML page that asks for a password input.
	PageHTML = `<html>
<head>
	<title>Hello</title>
</head>
<body>
	<pre>%s</pre>
    <form action="%s" method="post">
        <p>Enter password to launch main program: <input type="password" name="` + autounlock.PasswordInputName + `"/></p>
        <p><input type="submit" value="Launch"/></p>
        <p>%s</p>
    </form>
</body>
</html>
	`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type WebServer

type WebServer struct {
	Port int    // Port is the TCP port to listen on.
	URL  string // URL is the secretive URL that serves the unlock page. The URL must include leading slash.
	// contains filtered or unexported fields
}

WebServer runs an HTTP (not HTTPS) server that serves a single web page at a pre-designated URL, the page then allows a visitor to enter a correct password to decrypt program data and configuration, and finally launches a supervisor along with daemons using decrypted data.

func (*WebServer) Shutdown

func (ws *WebServer) Shutdown()

Shutdown instructs web server to shut down within several seconds, consequently that Start() function will cease to block.

func (*WebServer) Start

func (ws *WebServer) Start() error

Start runs the web server and blocks until the server shuts down from a successful unlocking attempt.

Jump to

Keyboard shortcuts

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