diff options
author | Martin Fischer <martin@push-f.com> | 2022-07-30 20:17:25 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2022-07-30 22:21:23 +0200 |
commit | 56c071bb832304ba9a2ec67215b1a8ae40723840 (patch) | |
tree | 2282e1f0eafcf65e807f2e9120617401b705d75c /README.md | |
parent | a920436c3af249266ff907d15755c1291737905a (diff) |
implement lua scripting
Inspired by the Scribunto extension for MediaWiki.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -24,6 +24,10 @@ Listening on http://127.0.0.1:8000 By default GitPad is in single-user mode, serving the branch pointed to by `HEAD`. +**WARNING**: The `lua` feature is enabled by default. Lua sandboxing is still +experimental, so giving users access who you don't trust might lead to a system +compromise. + ## Multi-user mode Multi-user mode requires you to set up a reverse-proxy that authenticates users @@ -76,6 +80,20 @@ name = "John Doe" email = "john@example.com" ``` +## Lua scripting + +Files can start with a shebang like `#!hello`, which will +interpret the following text with the `view` function returned +by in this case `bin/hello.lua`, e.g. + +```lua +function view(text) + return '<pre>' .. gitpad.html_escape(string.upper(text)) .. '</pre>' +end + +return {view=view} +``` + ## Contributing Feedback, bug reports and suggestions are welcome! |