smr/README.md

81 lines
3.7 KiB
Markdown
Raw Normal View History

# SMR
2020-05-16 01:10:11 +02:00
## Overview
2020-05-16 01:10:11 +02:00
This repository contains the source code to a pastebin clone. It was made after
concerns with pastebin.com taking down certain kinds of content. SMR aims to
be small, fast, and secure. It is built on top of [Kore](https://kore.io), using
[luajit](https://luajit.org) to expose a Lua programming environment. It uses
2021-02-22 08:46:57 +01:00
[sqlite3](https://sqlite.org) as it's database. SMR is implemented in about
2022-11-21 01:32:49 +01:00
4k SLOC and is expected to never exceed 5k SLOC. Contributions welcome.
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Lua 36 190 306 1993
C 4 61 116 709
HTML 18 21 0 561
SQL 36 6 35 266
JavaScript 3 19 21 203
CSS 3 4 8 73
C/C++ Header 4 3 0 46
-------------------------------------------------------------------------------
SUM: 104 304 486 3851
-------------------------------------------------------------------------------
```
## Roadmap
* Accounts (complete)
* Comments (complete)
2020-10-12 02:01:03 +02:00
* Tags (complete)
2020-12-29 20:13:33 +01:00
* Search (complete)
2022-11-21 01:32:49 +01:00
* Archive (complete)
* Author biographies (complete)
* Kore 4.2.0 (complete)
* addon api
2021-01-11 04:35:25 +01:00
TODO's:
2022-11-21 01:32:49 +01:00
* Currently, people can post comments to unlisted stories even if they don't have
2021-01-11 04:35:25 +01:00
the correct link.
2022-11-21 01:32:49 +01:00
* Find a replacement preprocessor
* The archive is currently generated weekly from a cron job, and served
syncronously. We can generate a zip file on-the-fly instead, and if the client
disconnects, it's fine to drop the whole thing.
* We can simplify a lot of error handling logic by setting sql prepared statements to reset during error unwinding.
* We can simplify a lot of business logic by having requests parse their parameters eagerly.
2021-01-11 04:35:25 +01:00
## Hacking
If you want to contribute to this repository:
2020-12-23 08:14:56 +01:00
1. Install the [kore webserver](https://kore.io)(Documentation -> installation)
2. Use a `kodev create smr` to create a blank kore application
3. Install Lua and Luarocks from your package manager
4. Use Luarocks to install the following dependencies (`luarocks install <package>`)
* etlua - Lua templating, comparable to Jinja for Python
* lpeg - Parsing Expression Grammers, used to build text parsers
* lsqlite3 - Sqlite3 for Lua, a lightweight database
* lua-zlib - Data compression
5. You may need to modify conf/build.conf, I use Lua 5.1 on my development machine,
but everything should still work with later versions.
2021-01-04 04:05:50 +01:00
6. Install [spp](https://github.com/radare/spp)
7. Clone this repository into the smr folder, cd into the root, and run `make`!
2022-02-20 01:21:50 +01:00
* You may need to modify the configuration in the Makefile, add `test.monster 127.0.0.1` to your `/etc/hosts`, modify command invocation, ect.
2022-02-20 01:21:50 +01:00
## Misc. notes
SMR requires a slightly modified version of Kore to run. See [my kore patches](https://git.fuwafuwa.moe/rmalley/kore_patches)
for the changes I needed to make to get the JIT compiler playing nice with
Kore's seccomp restrictions. There are a few other changes, like modified kore
to accept any text as input for things like file upload.
2021-01-04 04:05:50 +01:00
**UPDATE (12/18/2020)**
2021-01-04 04:05:50 +01:00
Kore 4.0 no longer needs the seccomp changes, as those have been exposed to
library users, and smr has been updated appropriately. It still needs the
allow-multiline-input patch though.