Index

joshstock.in / 9e579d9

Source for serving and static templating/compiling of https://joshstock.in.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
10413 Dec 2020 16:059e579d9Update lua-gitweb READMEJosh Stockin13516G

Blob @ joshstock.in / lua-gitweb / README.md

text/plain3118 bytesdownload raw
1# resty-gitweb
2
3A git web interface for Lua/OpenResty.
4
5## Requirements
6
7Lua modules (Lua 5.1/LuaJIT 2.1.0/OpenResty LuaJIT compatible, accessible from
8Lua path/cpath):
9
10| Module | Description |
11| ------ | ----------- |
12| [lfs](https://github.com/keplerproject/luafilesystem) | Filesystem API |
13| [lyaml](https://github.com/gvvaughan/lyaml) | Reads and parses YAML config files |
14| [puremagic](https://github.com/wbond/puremagic) | MIME type by content, used in blob rendering |
15| [etlua](https://github.com/leafo/etlua) | Embedded Lua templating (for HTML rendering) |
16
17Other command line tools (installed on system path, accessible from shell):
18
19| Program | Description |
20| ------- | ----------- |
21| [md4c](https://github.com/mity/md4c) (md2html) | Renders GitHub flavored Markdown |
22| [highlight](http://www.andre-simon.de/doku/highlight/en/highlight.php) | Syntax highlighting in HTML format |
23
24Linkable Libraries (installed on system path, accessible with LuaJIT's C FFI):
25
26| Library | Description |
27| ------- | ----------- |
28| [libgit2](https://github.com/libgit2/libgit2) | Linkable C API for Git |
29
30## Using
31
321. Copy this directory with its scripts to a place OpenResty/nginx workers have
33 access, such as `/srv/[SITE]/resty-gitweb`. (In reality it doesn't matter
34 where, as long as it's accessible.)
35
362. Copy your config file (`resty-gitweb.yaml`) to
37 `/etc/[SITE]/resty-gitweb.yaml` (or somewhere else)
38
393. Add the following near the top (`main` context, outside of any blocks) of
40 your OpenResty/nginx configuration file:
41
42```
43# resty-gitweb configuration
44env RESTY_GITWEB; # Script won't run without this
45env RESTY_GITWEB_ENV=PROD; # PROD for Production, DEV for Development. DEV by default.
46env RESTY_GITWEB_CONFIG=/etc/[SITE]/resty-gitweb.yaml; # Wherever you put your configuration file
47```
48
494. Add the following to the `http` block in your OpenResty/nginx configuration
50 file:
51
52```
53lua_package_path ";;/srv/[SITE]/resty-gitweb/?.lua"; # Add resty-gitweb to your Lua package path
54init_by_lua_file /srv/[SITE]/resty-gitweb/init.lua; # Initialize modules for nginx workers
55```
56
575. And in whichever `location` block you wish to serve content:
58
59```
60content_by_lua_file /srv/[SITE]/resty-gitweb/app.lua;
61```
62
636. Restart OpenResty/nginx
64
65Note that I use "OpenResty/nginx" instead of just OpenResty; if you desire, you
66can actually use nginx with only a few OpenResty components. These are the only
67OpenResty components you actually need to
68[compile](https://www.nginx.com/resources/wiki/extending/compiling/) to use
69this package:
70
71* [lua-nginx-module](https://github.com/openresty/lua-nginx-module)
72* [lua-resty-core](https://github.com/openresty/lua-resty-core)
73* [lua-resty-shell](https://github.com/openresty/lua-resty-shell)
74
75Optionally, you can build these with OpenResty's
76[branch](https://github.com/openresty/luajit2) of LuaJIT 2 instead of the
77original.
78
79## Copyright and Licensing
80
81This package is copyrighted by [Joshua 'joshuas3'
82Stockin](https://joshstock.in/) and licensed under the [MIT License](LICENSE).
83
84&lt;<https://joshstock.in>&gt; | josh@joshstock.in | joshuas3#9641
85