Separated self-hosting guide into 2 pages, bugfixes

This commit is contained in:
DarkCat09 2023-09-01 16:43:15 +04:00
parent a2d7f48503
commit 2750ec3a27
Signed by: DarkCat09
GPG key ID: 0A26CD5B3345D6E3
2 changed files with 25 additions and 24 deletions

18
docs/docker.md Normal file
View file

@ -0,0 +1,18 @@
# Docker
If you prefer hosting without Docker, see [Self-Hosting](selfhost.md) instead.
Docker Engine and Docker Compose are required.
Note that built images are not provided via Docker Hub.
If you can't or don't want to build them on your server
and don't want to setup a CI/CD system,
[let us know](https://github.com/txtdot/txtdot/issues),
we'll consider setting up a GitHub Actions workflow.
```bash
git clone https://github.com/txtdot/txtdot.git
cd txtdot
docker compose build
docker compose up -d
```

View file

@ -1,8 +1,8 @@
# Self-Hosting # Self-Hosting
## Without Docker If you prefer hosting with Docker, see [Docker](docker.md) instead.
### Install nodejs and npm ## Install nodejs and npm
For Debian, Ubuntu: packages in the repository are so old, For Debian, Ubuntu: packages in the repository are so old,
consider installing them with [NodeSource](https://github.com/nodesource/distributions#installation-instructions). consider installing them with [NodeSource](https://github.com/nodesource/distributions#installation-instructions).
@ -18,7 +18,7 @@ sudo pacman -S nodejs npm
doas apk add nodejs npm doas apk add nodejs npm
``` ```
### User for txtdot ## Create a user for txtdot
Almost all distros except Alpine: Almost all distros except Alpine:
```bash ```bash
@ -26,14 +26,14 @@ sudo useradd -r -m -s /sbin/nologin -U txtdot
sudo -u txtdot bash sudo -u txtdot bash
``` ```
Alpine Linux with busybox + doas: Alpine Linux with busybox and doas:
```bash ```bash
doas addgroup -S txtdot doas addgroup -S txtdot
doas adduser -h /home/txtdot -s /sbin/nologin -G txtdot -S -D txtdot doas adduser -h /home/txtdot -s /sbin/nologin -G txtdot -S -D txtdot
doas -u txtdot bash doas -u txtdot bash
``` ```
### Build, config and launch ## Build, config and launch
Clone the git repository, cd into it: Clone the git repository, cd into it:
```bash ```bash
@ -41,7 +41,7 @@ git clone https://github.com/txtdot/txtdot.git src
cd src cd src
``` ```
Copy and modify the sample config file (see the Environment section): Copy and modify the sample config file (see the [Configuring](env.md) section):
```bash ```bash
cp .env.example .env cp .env.example .env
nano .env nano .env
@ -63,7 +63,7 @@ Log out from the txtdot account:
exit exit
``` ```
### Add txtdot to autostart ## Add txtdot to autostart
Either using systemd unit file: Either using systemd unit file:
```bash ```bash
wget https://raw.githubusercontent.com/TxtDot/txtdot/main/config/txtdot.service wget https://raw.githubusercontent.com/TxtDot/txtdot/main/config/txtdot.service
@ -93,20 +93,3 @@ sudo crontab -u txtdot -e
@reboot sleep 10 && cd /home/txtdot/src && npm run start @reboot sleep 10 && cd /home/txtdot/src && npm run start
# Save the file and exit # Save the file and exit
``` ```
## With Docker
Docker Engine and Docker Compose are required.
Note that built images are not provided via Docker Hub.
If you can't or don't want to build them on your server
and don't want to setup a CI/CD system,
[let us know](https://github.com/txtdot/txtdot/issues),
we'll consider setting up a GitHub Actions workflow.
```bash
git clone https://github.com/txtdot/txtdot.git
cd txtdot
docker compose build
docker compose up -d
```