diff --git a/README.md b/README.md index c071d5b..557bf7b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ +@name . + # SMR + ## Overview This repository contains the source code to a pastebin clone. It was made after @@ -9,23 +12,17 @@ be small, fast, and secure. It is built on top of [Kore](https://kore.io), using [sqlite3](https://sqlite.org) as it's database. SMR is implemented in about 4k SLOC and is expected to never exceed 5k SLOC. Contributions welcome. -``` - -------------------------------------------------------------------------------- -Language files blank comment code -------------------------------------------------------------------------------- -Lua 38 231 438 2338 -C 4 65 133 719 -HTML 18 23 0 562 -JavaScript 4 23 34 293 -SQL 36 6 35 274 -CSS 3 4 8 74 -C/C++ Header 4 3 0 48 -------------------------------------------------------------------------------- -SUM: 107 355 648 4308 -------------------------------------------------------------------------------- - -``` +Language|files|blank|comment|code +:-------|-------:|-------:|-------:|-------: +Lua|37|331|678|2197 +HTML|22|100|0|1021 +C|4|102|251|712 +JavaScript|4|23|34|293 +SQL|36|6|61|274 +make|1|30|6|146 +CSS|3|4|8|74 +C/C++ Header|4|3|0|48 +SUM:|111|599|1038|4765 ## Roadmap @@ -66,6 +63,32 @@ If you want to contribute to this repository: 7. Clone this repository into the smr folder, cd into the root, and run `make`! * 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. +## Folder layout + +While the core business logic of SMR is kept under 5k SLOC, tests, documentation, +and other resources exceed this limit. The following is an explanation of what +goes where: + +
+smr/
+  assets/ - kore assets, compiled into the binary. Javascript and CSS are kept here.
+  cert/ - kore certificates. This is a default to get you started, but in production you should set certificates appropriately.
+  conf/ - kore configuration. See https://docs.kore.io/4.2.0/applications/koreconf.html
+  doc/ - documentation for smr that doesn't belong to any particular file
+  kore_chroot/ - a chroot to get you started modifying smr. In production this should be a properly configured chroot
+  packaging/ - scripts for packaging smr for different systems
+  spec/ - unit and system tests for smr
+  src/ - all the business logic of smr
+    lua/ - Lua shared code between endpoints
+      endpoints/ - 1-per endpoint business logic
+    pages/ - Etlua templated html, exposed from src/lua/pages.lua
+    sql/ - Sqlite queries, exposed from src/lua/queries.lua
+  tools/ - command line tools for working with the smr database
+    accounts/ - tool for modifying author accounts
+    archive/ - tool for generating archives of the site (NOT the same as backups)
+    migrate/ - tool for migrating/upgrading the smr database
+
+ ## Misc. notes SMR requires a slightly modified version of Kore to run. See [my kore patches](https://git.fuwafuwa.moe/rmalley/kore_patches) diff --git a/src/pages/edit_bio.etlua b/src/pages/edit_bio.etlua new file mode 100644 index 0000000..ad57e0f --- /dev/null +++ b/src/pages/edit_bio.etlua @@ -0,0 +1,48 @@ + + + + + + + <% if author then %> + + <% end %> + <% if title then %> + <%- title %> + <% else %> + 🍑 + <% end %> + + + <% if extra_load then %> + <% for _,load in ipairs(extra_load) do %> + <%- load %> + <% end %> + <% end %> + + +
+ +

+ Edit Biography for <%= user %> +

+<% if err then %><%= err %><% end %> +
+
+ +
+
+
+
+ +
+
+
+ +
+ + + +