-
-
Notifications
You must be signed in to change notification settings - Fork 140
/
algernon.1
143 lines (143 loc) · 3.74 KB
/
algernon.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
.\" -*-Nroff-*-
.\"
.TH "algernon" 1 "13 Jul 2024" "" ""
.SH NAME
algernon \- web server
.sp
.SH SYNOPSIS
.B algernon
[\fBflags\fR]
[\fBfile or directory\fR]
[\fBhost\fR][\fB:port\fR]
.sp
.SH DESCRIPTION
Serve the given file or directory, with an optional \fB:port\fP and \fBhostname\fP.
.sp
.SH OPTIONS
.sp
.TP
.B \-a or \-\-autorefresh
Inject JavaScript that refreshes the served web pages when they receive
server-sent events (SSE), when a file or directory has changed.
.TP
.B \-v or \-\-version
Display the current version number.
.TP
.B \-h or \-\-help
Display usage information. Includes a few flags that are not listed here.
.TP
.B \-\-noheaders
Don't use the security-related HTTP headers.
.TP
.B \-\-stricter
Stricter HTTP headers (same origin policy).
.TP
.B \-n or \-\-nobanner
Don't display a colorful banner at start.
.TP
.B \-\-cert=FILENAME
Provide a TLS certificate, for using HTTPS.
.TP
.B \-\-key=FILENAME
Provide a TLS key, for using HTTPS.
.TP
.B \-\-boltdb=FILENAME
Provide a Bolt database filename, instead of using \fB/tmp/algernon.db\fP.
.TP
.B \-t or \-\-httponly
Only serve regular HTTP.
.TP
.B \-\-http2only
Only serve HTTP/2, without HTTPS.
.TP
.B \-u
Serve QUIC aka HTTP/3.
.TP
.B \-\-limit=N
Limit clients to N request per second (the default is 10).
.TP
.B \-\-nodb
Don't use a database backend. Some Lua functions might not work.
.TP
.B \-\-timeout=N
Timeout when serving files, in seconds.
.TP
.B \-\-largesize=N
Threshold for not reading static files into memory, in bytes.
.TP
.B \-\-lua
Don't serve anything, just present an interactive Lua prompt (REPL).
.TP
.B \-\-server
Disable debug + interactive mode. Is unrelated to if anything is served or not.
.TP
.B \-q or \-\-quiet
Don't output anything to stdout or stderr.
.TP
.B \-\-servername=NAME
Custom HTTP header value for the \fBServer\fP field.
.TP
.B \-o or \-\-open=COMMAND
Open the served URL with \fBxdg-open\fP, or with the given application.
.TP
.B \-z or \-\-quit
Quit after the first request has been served.
.TP
.B \-m
View the given Markdown file in the browser.
Quit after the file has been served once.
This is equivalent to \fB\-q \-o \-z\fP.
.TP
.B \-c or \-\-statcache
Speed up responses by caching \fBos.Stat\fP.
Only use if served files will never be removed!
.TP
.B \-\-accesslog=FILENAME
Filename for where to log requests in the Combined Log Format (CLF).
.TP
.B \-\-ncsa=FILENAME
Filename for where to log requests in the Common Log Format (NCSA).
.TP
.B \-\-domain
Serve files from the subdirectory with the same name as the requested domain,
for instance \fB/srv/algernon/mydomain.com\fP and \fB/srv/algernon/otherweb.com\fP,
depending on if HTTP requests are using \fBhttps://mydomain.com\fP or
\fBhttps://otherweb.com\fP.
.TP
.B \-x or \-\-simple
Simple mode. Serve the current directory over regular HTTP, disable debug mode,
interactive mode, request limits and all features that require a database.
.TP
.PP
.SH "ENV"
.sp
The \fBNO_COLOR\fP environment variable can be set to 1 to turn off all colors.
.sp
.SH "WHY"
.sp
Web development with few dependencies and a decent caching system.
.SH "EXAMPLE USAGE"
.sp
.TP
For auto-refreshing a webpage while developing:
\fBalgernon --dev --httponly --debug --autorefresh --bolt --server . :4000\fP
.TP
Serve /srv/mydomain.com and /srv/otherweb.com over HTTP and HTTPS + HTTP/2:
\fBalgernon -c --domain --server --cachesize 67108864 --prod /srv\fP
.TP
Serve the current dir over QUIC, port 7000, no banner:
\fBalgernon -s -u -n . :7000\fP
.TP
Serve the current directory over HTTP, port 3000. No limits, cache, permissions
or database connections:
\fBalgernon -x\fP
.SH "SEE ALSO"
.BR caddy (1)
.BR nginx (1)
.SH BUGS
This man page is a work in progress.
.SH VERSION
1.17.1
.SH AUTHOR
.B algernon
was written by Alexander F. Rødseth <[email protected]>