algernon.1 3.7 KB

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