Index

joshstock.in / 81b4469

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
10313 Dec 2020 12:1281b4469Update lua-gitweb READMEJosh Stockin1331G

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

text/plain2413 bytesdownload raw
1# lua-gitweb
2
3A git web client for Lua/OpenResty, similar to stagit.
4
5## Requirements
6
7Lua modules (Lua 5.1/LuaJIT 2.1.0/OpenResty LuaJIT compatible, accessible from Lua path/cpath):
8
9| Module | Description |
10| ------ | ----------- |
11| [lfs](https://github.com/keplerproject/luafilesystem) | Filesystem API |
12| [lyaml](https://github.com/gvvaughan/lyaml) | Reads and parses YAML config files |
13| [puremagic](https://github.com/wbond/puremagic) | MIME type by content, used in blob rendering |
14| [etlua](https://github.com/leafo/etlua) | Embedded Lua templating (for HTML rendering) |
15
16Other command line tools (installed on system path, accessible from shell):
17
18| Program | Description |
19| ------- | ----------- |
20| [md4c](https://github.com/mity/md4c) (md2html) | Renders GitHub flavored Markdown |
21| [highlight](http://www.andre-simon.de/doku/highlight/en/highlight.php) | Syntax highlighting in HTML format |
22
23Linkable Libraries (installed on system path, accessible with LuaJIT's C FFI):
24
25| Library | Description |
26| ------- | ----------- |
27| [libgit2](https://github.com/libgit2/libgit2) | Linkable C API for Git |
28
29## Using
30
311. Copy this directory with its scripts to a place OpenResty/nginx workers have
32access, such as `/srv/[SITE]/lua-gitweb`. (In reality it doesn't matter where,
33as long as it's accessible.)
34
352. Copy your config file (`repos.yaml`) to `/etc/[SITE]/repos.yaml` (or somewhere
36else).
37
383. Add the following near the top (`main` context, outside of any blocks) of your
39OpenResty/nginx configuration file:
40```
41env LUA_GITWEB; # Script won't run without this
42env LUA_GITWEB_ENV=PROD; # PROD for Production, DEV for Development. DEV by default.
43env LUA_GITWEB_CONFIG=/etc/[SITE]/repos.yaml; # Wherever you put your configuration file
44```
45
464. Add the following to the `http` block in your OpenResty/nginx configuration
47file:
48```
49lua_package_path ";;/srv/[SITE]/lua-gitweb/?.lua"; # Add lua-gitweb to your Lua package path
50init_by_lua_file /srv/[SITE]/lua-gitweb/init.lua; # Initialize modules for nginx workers
51```
52
535. And in whichever `location` block you wish to serve content:
54```
55content_by_lua_file /srv/[SITE]/lua-gitweb/app.lua;
56```
57
586. Restart OpenResty/nginx
59
60## Copyright and Licensing
61
62This package is copyrighted by [Joshua 'joshuas3'
63Stockin](https://joshstock.in/) and licensed under the [MIT License](LICENSE).
64
65&lt;<https://joshstock.in>&gt; | josh@joshstock.in | joshuas3#9641
66