revise instructions

This commit is contained in:
Lera Elvoé 2025-05-23 13:35:54 +03:00
parent 7f17d4c29e
commit 17e231ed74
Signed by: yagich
SSH Key Fingerprint: SHA256:6xjGb6uA7lAVcULa7byPEN//rQ0wPoG+UzYVMfZnbvc

View File

@ -6,34 +6,43 @@ Released under [CNPLv7+](https://thufie.lain.haus/NPL.html).
Please read the [full terms](./LICENSE.md) for proper wording. Please read the [full terms](./LICENSE.md) for proper wording.
# installing & first time setup # installing & first time setup
1. first, install OpenResty. instructions for linux can be found [here](https://openresty.org/en/linux-packages.html). ## docker
2. then, install LuaJIT and Lua 5.1 (usually called `lua5.1` in package managers) ```bash
3. then, install [LuaRocks](https://luarocks.org) (prefer your package manager instead of a local install recommended by the guide) $ docker compose up
4. add luarocks search dirs to path: ```
- opens port 8080
- exposes `data/db` and `data/avatars` as volumes for data backup and persistence
- exposes `secrets/` as a volume so that the script won't try to perform first time setup again
## manual
1. install:
- OpenResty. instructions for linux can be found [here](https://openresty.org/en/linux-packages.html)
- LuaJIT and Lua 5.1 (usually called `lua5.1` in package managers)
- openssl (-dev)
- sqlite (-dev)
- libsodium (-dev)
- imagemagick (-dev)
- [LuaRocks](https://luarocks.org) (either through the guide's instructions or your package manager, whichever is newer)
2. add luarocks search dirs to path:
```bash ```bash
# in .bashrc (or other shell equivalent) # in .bashrc (or other shell equivalent)
eval "$(luarocks --lua-version 5.1 path)" eval "$(luarocks --lua-version 5.1 path)"
``` ```
5. clone repo 3. clone repo
6. install the dependencies: 4. install the lua dependencies:
```bash ```bash
$ luarocks --local --lua-version 5.1 build --only-deps $ luarocks --local --lua-version 5.1 build --only-deps
``` ```
7. create a file named `secrets.lua` in the project directory. 5. run:
use the `secrets.lua.example` file as reference, and generate a cryptographically secure random key, for example, with:
```bash ```bash
$ openssl rand -hex 32 $ start.sh production # or 'development' or empty string
```
8. run:
```bash
$ start.sh production
``` ```
the script will perform some necessary first time setup (and create a hidden file in the folder to ensure it won't do so again). it will create an administrator account and print the credentials to the console; **this will only happen once**. make sure you save them somewhere. the administrator account is the only one that can promote other users to moderator. the script will perform some necessary first time setup (and create a hidden file in the folder to ensure it won't do so again). it will create an administrator account and print the credentials to the console; **this will only happen once**. make sure you save them somewhere. the administrator account is the only one that can promote other users to moderator.
(note the `production` argument. if called with no arguments, `start.sh` will run in a development environment, which uses a separate database.) (note the `production` argument. if called with no arguments, `start.sh` will run in a development environment, which uses a separate database and shows more debug information.)
this app is made with the assumption that it is being reverse-proxied. as such, you may want to change the port to something other than the default `8080`. you can do that in [`config.lua`]([./config.lua]). this app is made with the assumption that it is being reverse-proxied. as such, you may want to change the port to something other than the default `8080`. you can do that in [`config.lua`]([./config.lua]).