Source for serving and static templating/compiling of https://joshstock.in.
{#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
---|---|---|---|---|---|---|---|---|
103 | 13 Dec 2020 12:12 | 81b4469 | Update lua-gitweb README | Josh Stockin | 1 | 33 | 1 | G |
Object | Latest Commit Subject | Time | Hash |
---|---|---|---|
.. | |||
git | Update lua-gitweb | 12 Dec 2020 20:23 | 009440a |
pages | Fix README rendering | 13 Dec 2020 11:45 | 5814dba |
utils | Add git blobs | 13 Dec 2020 01:05 | da32c63 |
README.md | Update lua-gitweb README | 13 Dec 2020 12:12 | 81b4469 |
app.lua | Update blob text rendering | 13 Dec 2020 11:10 | 29e3f47 |
init.lua | Update lua-gitweb | 12 Dec 2020 21:05 | 8147f6b |
repos.yaml | Update lua-gitweb | 12 Dec 2020 21:05 | 8147f6b |
A git web client for Lua/OpenResty, similar to stagit.
Lua modules (Lua 5.1/LuaJIT 2.1.0/OpenResty LuaJIT compatible, accessible from Lua path/cpath):
Module | Description |
---|---|
lfs | Filesystem API |
lyaml | Reads and parses YAML config files |
puremagic | MIME type by content, used in blob rendering |
etlua | Embedded Lua templating (for HTML rendering) |
Other command line tools (installed on system path, accessible from shell):
Program | Description |
---|---|
md4c (md2html) | Renders GitHub flavored Markdown |
highlight | Syntax highlighting in HTML format |
Linkable Libraries (installed on system path, accessible with LuaJIT's C FFI):
Library | Description |
---|---|
libgit2 | Linkable C API for Git |
Copy this directory with its scripts to a place OpenResty/nginx workers have
access, such as /srv/[SITE]/lua-gitweb
. (In reality it doesn't matter where,
as long as it's accessible.)
Copy your config file (repos.yaml
) to /etc/[SITE]/repos.yaml
(or somewhere
else).
Add the following near the top (main
context, outside of any blocks) of your
OpenResty/nginx configuration file:
env LUA_GITWEB; # Script won't run without this
env LUA_GITWEB_ENV=PROD; # PROD for Production, DEV for Development. DEV by default.
env LUA_GITWEB_CONFIG=/etc/[SITE]/repos.yaml; # Wherever you put your configuration file
http
block in your OpenResty/nginx configuration
file:lua_package_path ";;/srv/[SITE]/lua-gitweb/?.lua"; # Add lua-gitweb to your Lua package path
init_by_lua_file /srv/[SITE]/lua-gitweb/init.lua; # Initialize modules for nginx workers
location
block you wish to serve content:content_by_lua_file /srv/[SITE]/lua-gitweb/app.lua;
This package is copyrighted by Joshua 'joshuas3' Stockin and licensed under the MIT License.
<https://joshstock.in> | josh@joshstock.in | joshuas3#9641