From a2d7f485035698c78adb4d63d4b04b4ec347037d Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Thu, 31 Aug 2023 18:00:07 +0400 Subject: [PATCH] Separate sections, note about nodejs version --- docs/selfhost.md | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/docs/selfhost.md b/docs/selfhost.md index 87bb5ab..9ba9acd 100644 --- a/docs/selfhost.md +++ b/docs/selfhost.md @@ -2,11 +2,14 @@ ## Without Docker -Install Node and NPM: +### Install nodejs and npm + +For Debian, Ubuntu: packages in the repository are so old, +consider installing them with [NodeSource](https://github.com/nodesource/distributions#installation-instructions). +Minimal required version is NodeJS 18. + +Other distros: ```bash -# Debian, Ubuntu -# TODO: Really old version in repos, use nodesource -sudo apt install nodejs npm # CentOS sudo yum install nodejs # Arch @@ -15,26 +18,37 @@ sudo pacman -S nodejs npm doas apk add nodejs npm ``` -Create a user for txtdot, log in: +### User for txtdot + +Almost all distros except Alpine: ```bash -# Not Alpine (coreutils) sudo useradd -r -m -s /sbin/nologin -U txtdot sudo -u txtdot bash +``` -# Alpine (busybox) +Alpine Linux with busybox + doas: +```bash doas addgroup -S txtdot doas adduser -h /home/txtdot -s /sbin/nologin -G txtdot -S -D txtdot doas -u txtdot bash ``` -Clone the repo: +### Build, config and launch + +Clone the git repository, cd into it: ```bash git clone https://github.com/txtdot/txtdot.git src +cd src +``` + +Copy and modify the sample config file (see the Environment section): +```bash +cp .env.example .env +nano .env ``` Install packages, compile TS: ```bash -cd src npm install npm run build ``` @@ -44,7 +58,10 @@ Manually start the server to check if it works (Ctrl+C to exit): npm run start ``` -Log out from txtdot account: `exit` +Log out from the txtdot account: +```bash +exit +``` ### Add txtdot to autostart Either using systemd unit file: