главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md23
-rw-r--r--libretranslate.service8
-rw-r--r--nginx2
3 files changed, 18 insertions, 15 deletions
diff --git a/README.md b/README.md
index f951875..ab76e9c 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,15 @@
# LibreTranslate-init
-Run LibreTranslate on Ubuntu 20.04.
+Run [LibreTranslate](https://libretranslate.com) on Ubuntu 20.04.
Uses [LibreTranslate WSGI](https://community.libretranslate.com/t/is-wsgi-currently-supported/24/3) with [Gunicorn and Nginx](https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04).
```
-# Add argosopentech user
-useradd argosopentech
-mkdir /home/argosopentech
-chown argosopentech:argosopentech /home/argosopentech
-usermod -aG sudo argosopentech
-su argosopentech
+# Add libretranslate user
+useradd libretranslate
+mkdir /home/libretranslate
+chown libretranslate:libretranslate /home/libretranslate
+usermod -aG sudo libretranslate
+su libretranslate
# Add swap space (optional)
sudo fallocate -l 10G /swapfile
@@ -18,14 +18,17 @@ sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
-# Download and run LibreTranslate-init
-git clone https://github.com/argosopentech/LibreTranslate-init.git ~/LibreTranslate-init
+# Download LibreTranslate-init
+git clone https://github.com/libretranslate/LibreTranslate-init.git ~/LibreTranslate-init
-# Run LibreTranslate on port 5000
+# Download dependencies and run LibreTranslate on port 5000
~/LibreTranslate-init/setup.sh
# Run LibreTranslate WSGI with nginx and systemd
~/LibreTranslate-init/run.sh
+# Check LibreTranslate status
+sudo systemctl status libretranslate
+
```
diff --git a/libretranslate.service b/libretranslate.service
index ac6a081..10d5138 100644
--- a/libretranslate.service
+++ b/libretranslate.service
@@ -3,11 +3,11 @@ Description=LibreTranslate WSGI with Gunicorn and Nginx
After=network.target
[Service]
-User=argosopentech
+User=libretranslate
Group=www-data
-WorkingDirectory=/home/argosopentech/LibreTranslate
-Environment="PATH=/home/argosopentech/LibreTranslate/env/bin"
-ExecStart=/home/argosopentech/LibreTranslate/env/bin/gunicorn --workers 3 --bind unix:libretranslate.sock -m 007 wsgi:app
+WorkingDirectory=/home/libretranslate/LibreTranslate
+Environment="PATH=/home/libretranslate/LibreTranslate/env/bin"
+ExecStart=/home/libretranslate/LibreTranslate/env/bin/gunicorn --workers 3 --bind unix:libretranslate.sock -m 007 wsgi:app
[Install]
WantedBy=multi-user.target
diff --git a/nginx b/nginx
index 9c007a8..ad9ab8a 100644
--- a/nginx
+++ b/nginx
@@ -4,6 +4,6 @@ server {
location / {
include proxy_params;
- proxy_pass http://unix:/home/argosopentech/LibreTranslate/libretranslate.sock;
+ proxy_pass http://unix:/home/libretranslate/LibreTranslate/libretranslate.sock;
}
}