Преглед изворни кода

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
Perflyst пре 7 година
родитељ
комит
105884ca4e
3 измењених фајлова са 44 додато и 6 уклоњено
  1. 1 0
      .gitignore
  2. 41 4
      README.md
  3. 2 2
      nitter.conf

+ 1 - 0
.gitignore

@@ -3,3 +3,4 @@ nitter
 *.db
 /tests/__pycache__
 /tests/geckodriver.log
+/tmp

+ 41 - 4
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.)

+ 2 - 2
nitter.conf

@@ -5,5 +5,5 @@ title = "nitter"
 staticDir = "./public"
 
 [Cache]
-directory = "/tmp/niter"
-profileMinutes = 10  # how long to cache profiles
+directory = "./tmp"
+profileMinutes = 10  # how long to cache profiles