From 105884ca4e33a8c4ca077517df4e0ef10470f888 Mon Sep 17 00:00:00 2001 From: Perflyst Date: Thu, 8 Aug 2019 18:34:49 +0200 Subject: [PATCH] Use local tmp directory and enhance readme (#8) * Use local tmp directory * Enhance installation guide and add systemd service * Apply suggestions * Fix typo * Drop start of systemd service as its done with --now --- .gitignore | 1 + README.md | 45 +++++++++++++++++++++++++++++++++++++++++---- nitter.conf | 4 ++-- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index e1e4ff7..8ebd860 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ nitter *.db /tests/__pycache__ /tests/geckodriver.log +/tmp diff --git a/README.md b/README.md index 8c3ad5d..374a1a1 100644 --- a/README.md +++ b/README.md @@ -13,16 +13,53 @@ Inspired by the [invidio.us](https://github.com/omarroth/invidious) project. ## Installation +You need to install nim on your system: https://nim-lang.org/install.html +It is possible to install nim system wide or in the user directory you create below. + ```bash -git clone https://github.com/zedeus/nitter -cd nitter -nimble build +# useradd -m nitter +# su nitter +$ git clone https://github.com/zedeus/nitter +$ cd nitter +$ nimble build -d:release +$ mkdir ./tmp ``` -To run, `./nitter`. It's currently not possible to change any settings or things +To run nitter, execute `./nitter`. It's currently not possible to change any settings or things like the title, this will change as the project matures a bit. For now the focus is on implementing missing features. +You should put nitter behind a reverse proxy with e.g. nginx or apache. + +It is also possible to run nitter via systemd: + +```bash +[Unit] +Description=Nitter (An alternative Twitter front-end) +After=syslog.target +After=network.target + +[Service] +Type=simple + +# set user and group +User=nitter +Group=nitter + +# configure location +WorkingDirectory=/home/nitter/nitter +ExecStart=/home/nitter/nitter/nitter + +Restart=always +RestartSec=15 + +[Install] +WantedBy=multi-user.target +``` + +Then enable and start +`systemctl enable --now nitter.service` + ## Todo (roughly in this order) - Search (images/videos, hashtags, etc.) diff --git a/nitter.conf b/nitter.conf index ba3446d..2e3c023 100644 --- a/nitter.conf +++ b/nitter.conf @@ -5,5 +5,5 @@ title = "nitter" staticDir = "./public" [Cache] -directory = "/tmp/niter" -profileMinutes = 10 # how long to cache profiles \ No newline at end of file +directory = "./tmp" +profileMinutes = 10 # how long to cache profiles