.\" This man page is autogenerated from the pagekite built-in manual.
.TH PAGEKITE "1" "2016-12-18" "https://pagekite.net/" "Awesome Commands"
.nh
.ad l
.SH NAME
pagekite \- Make localhost servers publicly visible
.SH SYNOPSIS
\fBpagekite\fR [\fI\-\-options\fR] [\fIservice\fR] \fIkite\-name\fR [\fI+flags\fR]
.SH DESCRIPTION
PageKite is a system for exposing \fIlocalhost\fR servers to the
public Internet. It is most commonly used to make local web servers or
SSH servers publicly visible, although almost any TCP\-based protocol can
work if the client knows how to use an HTTP proxy.
PageKite uses a combination of tunnels and reverse proxies to compensate
for the fact that \fIlocalhost\fR usually does not have a public IP
address and is often subject to adverse network conditions, including
aggressive firewalls and multiple layers of NAT.
This program implements both ends of the tunnel: the local "back\-end"
and the remote "front\-end" reverse\-proxy relay. For convenience,
\fBpagekite\fR also includes a basic HTTP server for quickly exposing
files and directories to the World Wide Web for casual sharing and
collaboration.
.SH BASIC USAGE
.nf
Basic usage, gives \fIhttp://localhost:80/\fR a public name:
$ pagekite NAME.pagekite.me
To expose specific folders, files or use alternate local ports:
$ pagekite /a/path/ NAME.pagekite.me +indexes # built\-in HTTPD
$ pagekite *.html NAME.pagekite.me # built\-in HTTPD
$ pagekite 3000 NAME.pagekite.me # HTTPD on 3000
To expose multiple local servers (SSH and HTTP):
$ pagekite ssh://NAME.pagekite.me AND 3000 NAME.pagekite.me
.fi
.SH SERVICES AND KITES
The most comman usage of \fBpagekite\fR is as a back\-end, where it
is used to expose local services to the outside world.
Examples of services are: a local HTTP server, a local SSH server,
a folder or a file.
A service is exposed by describing it on the command line, along with the
desired public kite name. If a kite name is requested which does not already
exist in the configuration file and program is run interactively, the user
will be prompted and given the option of signing up and/or creating a new
kite using the \fBpagekite.net\fR service.
Multiple services and kites can be specified on a single command\-line,
separated by the word 'AND' (note capital letters are required).
This may cause problems if you have many files and folders by that
name, but that should be relatively rare. :\-)
.SH KITE CONFIGURATION
The options \fB\-\-list\fR, \fB\-\-add\fR, \fB\-\-disable\fR and \fB\-\-remove\fR can be used to
manipulate the kites and service definitions in your configuration file,
if you prefer not to edit it by hand. Examples:
.nf
Adding new kites
$ pagekite \-\-add /a/path/ NAME.pagekite.me +indexes
$ pagekite \-\-add 80 OTHER\-NAME.pagekite.me
To display the current configuration
$ pagekite \-\-list
Disable or delete kites (\-\-add re\-enables)
$ pagekite \-\-disable OTHER\-NAME.pagekite.me
$ pagekite \-\-remove NAME.pagekite.me
.fi
.SH FLAGS
Flags are used to tune the behavior of a particular kite, for example
by enabling access controls or specific features of the built\-in HTTP
server.
.SS Common flags
.TP
\fB+ip\fR/\fI1.2.3.4\fR \fR
Enable connections only from this IP address.
.TP
\fB+ip\fR/\fI1.2.3\fR \fR
Enable connections only from this /24 netblock.
.SS HTTP protocol flags
.TP
\fB+password\fR/\fIname\fR=\fIpass\fR
Require a username and password (HTTP Basic Authentication)
.TP
\fB+rewritehost\fR \fR
Rewrite the incoming Host: header.
.TP
\fB+rewritehost\fR=\fIN\fR \fR
Replace Host: header value with N.
.TP
\fB+rawheaders\fR \fR
Do not rewrite (or add) any HTTP headers at all.
.TP
\fB+insecure\fR \fR
Allow access to phpMyAdmin, /admin, etc. (per kite).
.SS Built-in HTTPD flags
.TP
\fB+indexes \fR
Enable directory indexes.
.TP
\fB+indexes\fR=\fIall\fR \fR
Enable directory indexes including hidden (dot\-) files.
.TP
\fB+hide \fR
Obfuscate URLs of shared files.
.TP
\fB+cgi\fR=\fIlist\fR
A list of extensions, for which files should be treated as
CGI scripts (example: \fI+cgi=cgi,pl,sh\fR).
.SH OPTIONS
The full power of \fBpagekite\fR lies in the numerous options which
can be specified on the command line or in a configuration file (see below).
Note that many options, especially the service and domain definitions,
are additive and if given multiple options the program will attempt to
obey them all. Options are processed in order and if they are not
additive then the last option will override all preceding ones.
Although \fBpagekite\fR accepts a great many options, most of the
time the program defaults will Just Work.
.SS Common options
.TP
\fB\-\-clean \fR
Skip loading the default configuration file.
.TP
\fB\-\-signup \fR
Interactively sign up for pagekite.net service.
.TP
\fB\-\-defaults \fR
Set defaults for use with pagekite.net service.
.TP
\fB\-\-whitelabel=D \fR
Set defaults for pagekite.net white\-labels.
.TP
\fB\-\-whitelabels=D\fR
Set defaults for pagekite.net white\-labels (with TLS).
.TP
\fB\-\-nocrashreport\fR
Don't send anonymous crash reports to pagekite.net.
.SS Back-end options
.TP
\fB\-\-shell \fR
Run PageKite in an interactive shell.
.TP
\fB\-\-nullui \fR
Silent UI for scripting. Assumes Yes on all questions.
.TP
\fB\-\-list \fR
List all configured kites.
.TP
\fB\-\-add \fR
Add (or enable) the following kites, save config.
.TP
\fB\-\-remove \fR
Remove the following kites, save config.
.TP
\fB\-\-disable \fR
Disable the following kites, save config.
.TP
\fB\-\-only \fR
Disable all but the following kites, save config.
.TP
\fB\-\-insecure \fR
Allow access to phpMyAdmin, /admin, etc. (global).
.TP
\fB\-\-local\fR=\fIports\fR \fR
Configure for local serving only (no remote front\-end).
.TP
\fB\-\-watch\fR=\fIN\fR \fR
Display proxied data (higher N = more verbosity).
.TP
\fB\-\-noproxy \fR
Ignore system (or config file) proxy settings.
.TP
\fB\-\-proxy\fR=\fItype\fR:\fIserver\fR:\fIport\fR, \fB\-\-socksify\fR=\fIserver\fR:\fIport\fR, \fB\-\-torify\fR=\fIserver\fR:\fIport\fR
Connect to the front\-ends using SSL, an HTTP proxy, a SOCKS proxy,
or the Tor anonymity network. The type can be any of 'ssl', 'http'
or 'socks5'. The server name can either be a plain hostname,
user@hostname or user:password@hostname. For SSL connections the
user part may be a path to a client cert PEM file. If multiple
proxies are defined, they will be chained one after another.
.TP
\fB\-\-service_on\fR=\fIproto\fR:\fIkitename\fR:\fIhost\fR:\fIport\fR:\fIsecret\fR
Explicit configuration for a service kite. Generally kites are
created on the command\-line using the service short\-hand
described above, but this syntax is used in the config file.
.TP
\fB\-\-service_off\fR=\fIproto\fR:\fIkitename\fR:\fIhost\fR:\fIport\fR:\fIsecret\fR
Same as \-\-service_on, except disabled by default.
.TP
\fB\-\-service_cfg\fR=\fI...\fR, \fB\-\-webpath\fR=\fI...\fR
These options are used in the configuration file to store service
and flag settings (see above). These are both likely to change in
the near future, so please just pretend you didn't notice them.
.TP
\fB\-\-frontend\fR=\fIhost\fR:\fIport\fR
Connect to the named front\-end server. If this option is repeated,
multiple connections will be made.
.TP
\fB\-\-frontends\fR=\fInum\fR:\fIdns\-name\fR:\fIport\fR
Choose \fInum\fR front\-ends from the A records of a DNS domain
name, using the given port number. Default behavior is to probe
all addresses and use the fastest one.
.TP
\fB\-\-nofrontend\fR=\fIip\fR:\fIport\fR
Never connect to the named front\-end server. This can be used to
exclude some front\-ends from auto\-configuration.
.TP
\fB\-\-fe_certname\fR=\fIdomain\fR
Connect using SSL, accepting valid certs for this domain. If
this option is repeated, any of the named certificates will be
accepted, but the first will be preferred.
.TP
\fB\-\-fe_nocertcheck
Connect using SSL/TLS, but do not verify the remote certificate.
This is largely insecure but still thwarts passive attacks and
prevents routers and firewalls from corrupting the PageKite tunnel.
.TP
\fB\-\-ca_certs\fR=\fI/path/to/file\fR
Path to your trusted root SSL certificates file.
.TP
\fB\-\-dyndns\fR=\fIX\fR
Register changes with DynDNS provider X. X can either be simply
the name of one of the 'built\-in' providers, or a URL format
string for ad\-hoc updating.
.TP
\fB\-\-all \fR
Terminate early if any tunnels fail to register.
.TP
\fB\-\-new \fR
Don't attempt to connect to any kites' old front\-ends.
.TP
\fB\-\-fingerpath\fR=\fIP\fR \fR
Path recipe for the httpfinger back\-end proxy.
.TP
\fB\-\-noprobes \fR
Reject all probes for service state.
.SS Front-end options
.TP
\fB\-\-isfrontend \fR
Enable front\-end operation.
.TP
\fB\-\-domain\fR=\fIproto,proto2,pN\fR:\fIdomain\fR:\fIsecret\fR
Accept tunneling requests for the named protocols and specified
domain, using the given secret. A * may be used as a wildcard for
subdomains or protocols.
.TP
\fB\-\-authdomain\fR=\fIauth\-domain\fR, \fB\-\-authdomain\fR=\fItarget\-domain\fR:\fIauth\-domain\fR
Use \fIauth\-domain\fR as a remote authentication server for the
DNS\-based authetication protocol. If no \fItarget\-domain\fR
is given, use this as the default authentication method.
.TP
\fB\-\-motd\fR=\fI/path/to/motd\fR
Send the contents of this file to new back\-ends as a
"message of the day".
.TP
\fB\-\-host\fR=\fIhostname\fRListen on the given hostname only.
.TP
\fB\-\-ports\fR=\fIlist\fR \fR
Listen on a comma\-separated list of ports.
.TP
\fB\-\-portalias\fR=\fIA:B\fRReport port A as port B to backends (because firewalls).
.TP
\fB\-\-protos\fR=\fIlist\fR \fR
Accept the listed protocols for tunneling.
.TP
\fB\-\-rawports\fR=\fIlist\fR
Listen for raw connections these ports. The string '%s'
allows arbitrary ports in HTTP CONNECT.
.TP
\fB\-\-accept_acl_file\fR=\fI/path/to/file\fR
Consult an external access control file before accepting an
incoming connection. Quick'n'dirty for mitigating abuse. The
format is one rule per line: `rule policy comment` where a
rule is an IP or regexp and policy is 'allow' or 'deny'.
.TP
\fB\-\-client_acl\fR=\fIpolicy\fR:\fIregexp\fR, \fB\-\-tunnel_acl\fR=\fIpolicy\fR:\fIregexp\fR
Add a client connection or tunnel access control rule.
Policies should be 'allow' or 'deny', the regular expression
should be written to match IPv4 or IPv6 addresses. If defined,
access rules are checkd in order and if none matches, incoming
connections will be rejected.
.TP
\fB\-\-tls_default\fR=\fIname\fR
Default name to use for SSL, if SNI (Server Name Indication)
is missing from incoming HTTPS connections.
.TP
\fB\-\-tls_endpoint\fR=\fIname\fR:\fI/path/to/file\fR
Terminate SSL/TLS for a name using key/cert from a file.
.SS System options
.TP
\fB\-\-optfile\fR=\fI/path/to/file\fR
Read settings from file X. Default is \fI~/.pagekite.rc\fR.
.TP
\fB\-\-optdir\fR=\fI/path/to/directory\fR
Read settings from \fI/path/to/directory/*.rc\fR, in
lexicographical order.
.TP
\fB\-\-savefile\fR=\fI/path/to/file\fR
Saved settings will be written to this file.
.TP
\fB\-\-save \fR
Save the current configuration to the savefile.
.TP
\fB\-\-settings\fR
Dump the current settings to STDOUT, formatted as a configuration
file would be.
.TP
\fB\-\-nozchunks \fR
Disable zlib tunnel compression.
.TP
\fB\-\-sslzlib \fR
Enable zlib compression in OpenSSL.
.TP
\fB\-\-buffers\fR=\fIN\fR \fR
Buffer at most N kB of data before blocking.
.TP
\fB\-\-logfile\fR=\fIF\fR \fR
Log to file F, \fIstdio\fR means standard output.
.TP
\fB\-\-daemonize \fR
Run as a daemon.
.TP
\fB\-\-runas\fR=\fIU\fR:\fIG\fR \fR
Set UID:GID after opening our listening sockets.
.TP
\fB\-\-pidfile\fR=\fIP\fR \fR
Write PID to the named file.
.TP
\fB\-\-errorurl\fR=\fIU\fR \fR
URL to redirect to when back\-ends are not found.
.TP
\fB\-\-selfsign\fR
Configure the built\-in HTTP daemon for HTTPS, first generating a
new self\-signed certificate using \fBopenssl\fR if necessary.
.TP
\fB\-\-httpd\fR=\fIX\fR:\fIP\fR, \fB\-\-httppass\fR=\fIX\fR, \fB\-\-pemfile\fR=\fIX\fR
Configure the built\-in HTTP daemon. These options are likely to
change in the near future, please pretend you didn't see them.
.SH CONFIGURATION FILES
If you are using \fBpagekite\fR as a command\-line utility, it will
load its configuration from a file in your home directory. The file is
named \fI.pagekite.rc\fR on Unix systems (including Mac OS X), or
\fIpagekite.cfg\fR on Windows.
If you are using \fBpagekite\fR as a system\-daemon which starts up
when your computer boots, it is generally configured to load settings
from \fI/etc/pagekite.d/*.rc\fR (in lexicographical order).
In both cases, the configuration files contain one or more of the same
options as are used on the command line, with the difference that at most
one option may be present on each line, and the parser is more tolerant of
white\-space. The leading '\-\-' may also be omitted for readability and
blank lines and lines beginning with '#' are treated as comments.
\fBNOTE:\fR When using \fB\-o\fR, \fB\-\-optfile\fR or \fB\-\-optdir\fR on the command line,
it is advisable to use \fB\-\-clean\fR to suppress the default configuration.
.SH SECURITY
Please keep in mind, that whenever exposing a server to the public
Internet, it is important to think about security. Hacked webservers are
frequently abused as part of virus, spam or phishing campaigns and in
some cases security breaches can compromise the entire operating system.
Some advice:
.nf
* Switch PageKite off when not using it.
* Use the built\-in access controls and SSL encryption.
* Leave the firewall enabled unless you have good reason not to.
* Make sure you use good passwords everywhere.
* Static content is very hard to hack!
* Always, always make frequent backups of any important work.
.fi
Note that as of version 0.5, \fBpagekite\fR includes a very basic
request firewall, which attempts to prevent access to phpMyAdmin and
other sensitive systems. If it gets in your way, the \fB+insecure\fR
flag or \fB\-\-insecure\fR option can be used to turn it off.
For more, please visit:
.SH BUGS
Using \fBpagekite\fR as a front\-end relay with the native Python SSL
module may result in poor performance. Please use the pyOpenSSL wrappers
instead.
.SH SEE ALSO
lapcat(1), ,
.SH CREDITS
.nf
\- Bjarni R. Einarsson
\- The Beanstalks Project ehf.
\- The Rannis Technology Development Fund
\- Joar Wandborg
.fi
\- Luc\-Pierre Terral
.SH COPYRIGHT AND LICENSE
Copyright 2010\-2016, the Beanstalks Project ehf. and Bjarni R. Einarsson.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see: