Index

resty-gitweb / e49d46e

A git web interface for Lua/OpenResty (you're on it right now!)

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
113 Dec 2020 16:16e49d46eInitial commit (imported, read description)Josh Stockin1917250G

Tree

ObjectLatest Commit SubjectTimeHash
foldergitInitial commit (imported, read description)13 Dec 2020 16:16e49d46e
folderpagesInitial commit (imported, read description)13 Dec 2020 16:16e49d46e
folderutilsInitial commit (imported, read description)13 Dec 2020 16:16e49d46e
fileLICENSEInitial commit (imported, read description)13 Dec 2020 16:16e49d46e
fileREADME.mdInitial commit (imported, read description)13 Dec 2020 16:16e49d46e
fileapp.luaInitial commit (imported, read description)13 Dec 2020 16:16e49d46e
fileinit.luaInitial commit (imported, read description)13 Dec 2020 16:16e49d46e
filerepos.yamlInitial commit (imported, read description)13 Dec 2020 16:16e49d46e

README

resty-gitweb

A git web interface for Lua/OpenResty.

Requirements

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

Using

  1. Copy this directory with its scripts to a place OpenResty/nginx workers have access, such as /srv/[SITE]/resty-gitweb. (In reality it doesn't matter where, as long as it's accessible.)

  2. Copy your config file (resty-gitweb.yaml) to /etc/[SITE]/resty-gitweb.yaml (or somewhere else)

  3. Add the following near the top (main context, outside of any blocks) of your OpenResty/nginx configuration file:

# resty-gitweb configuration
env RESTY_GITWEB;          # Script won't run without this
env RESTY_GITWEB_ENV=PROD; # PROD for Production, DEV for Development. DEV by default.
env RESTY_GITWEB_CONFIG=/etc/[SITE]/resty-gitweb.yaml; # Wherever you put your configuration file
  1. Add the following to the http block in your OpenResty/nginx configuration file:
lua_package_path ";;/srv/[SITE]/resty-gitweb/?.lua"; # Add resty-gitweb to your Lua package path
init_by_lua_file /srv/[SITE]/resty-gitweb/init.lua;  # Initialize modules for nginx workers
  1. And in whichever location block you wish to serve content:
content_by_lua_file /srv/[SITE]/resty-gitweb/app.lua;
  1. Restart OpenResty/nginx

Note that I use "OpenResty/nginx" instead of just OpenResty; if you desire, you can actually use nginx with only a few OpenResty components. These are the only OpenResty components you actually need to compile to use this package:

Optionally, you can build these with OpenResty's branch of LuaJIT 2 instead of the original.

Copyright and Licensing

This package is copyrighted by Joshua 'joshuas3' Stockin and licensed under the MIT License.

<https://joshstock.in> | josh@joshstock.in | joshuas3#9641