summaryrefslogtreecommitdiff
path: root/weblate/SETUP-NOTES.md
diff options
context:
space:
mode:
Diffstat (limited to 'weblate/SETUP-NOTES.md')
-rw-r--r--weblate/SETUP-NOTES.md149
1 files changed, 149 insertions, 0 deletions
diff --git a/weblate/SETUP-NOTES.md b/weblate/SETUP-NOTES.md
new file mode 100644
index 0000000..b5e11fa
--- /dev/null
+++ b/weblate/SETUP-NOTES.md
@@ -0,0 +1,149 @@
+## Weblate.taler.net Setup Notes
+
+### The purpose of this is to document how the weblate.taler.net service was built, in the event that it needs to be repaired, changed, reproduced, etc.
+
+Always refer to https://docs.weblate.org/ if necessary, or just for a good laugh.
+
+### Upgrading
+
+See latest recommendations:
+https://docs.weblate.org/en/latest/admin/upgrade.html?highlight=upgrade#generic-upgrade-instructions
+
+Current process:
+
+```
+$ . ~/weblate-env/bin/activate
+
+$ systemctl --user stop celery-weblate
+
+$ systemctl --user stop uwsgi-weblate
+
+$ pip install -U Weblate
+
+$ maybe re-build settings.py from ~/weblate-env/lib/python3.8/site-packages/weblate/settings_example.py
+
+$ weblate collectstatic --noinput
+
+$ weblate check --deploy
+```
+
+### Basic structure:
+
+This weblate instance runs as a python3 virtualenv under non-priv `/home/weblate`.
+
+The generic instructions used to build the site are here, and were followed closely:
+https://docs.weblate.org/en/latest/admin/install/venv-debian.html
+
+#### Notes on general installation:
+
+* settings document is in `~/weblate-env/lib/python3.8/site-packages/weblate/settings.py` (see symlink in ~) (backup copy in `.`)
+* "data directory" or "DATA_DIR" is `~/weblate-env/lib/python3.8/site-packages/data/` (see symlink to `DATA_DIR/` in ~)
+* virtualenv is invoked anytime with `. ~/weblate-env/bin/activate`. This activates the weblate path to access weblate binaries without full paths.
+
+### Configuration
+
+#### `/home/weblate` shell account
+
+ non-priv user with access via SSH key
+ celery and uwsgi services run under this user (see *systemd* below)
+
+#### postgres
+
+ configured for `localhost` access only (ie - `$ psql`)
+ no password
+ Unix `weblate` user has full control over psql 'weblate' user
+ Must manually create 'weblate' database
+ DB Credentials added to `settings.py` "DATABASES" section
+
+Do this:
+ `psql=> CREATE EXTENSION pg_trgm;``
+
+#### e-mail
+
+ weblate@taler.net
+ * no password
+ * available via localhost using SMTP
+ * info added to `settings.py` in Django format:
+ `EMAIL_HOST_USER = 'weblate'`
+ (`EMAIL_HOST` and `EMAIL_PORT` not required re: defaults to localhost and 25)
+ * Test E-mail from `/home/weblate`:
+
+ ```
+ # telnet localhost 25
+ Trying 127.0.0.1...
+ Connected to localhost.
+ Escape character is '^]'.
+ 220 gv.taler.net ESMTP Postfix
+ HELO localhost
+ 250 gv.taler.net
+ MAIL From: weblate@taler.net
+ 250 2.1.0 Ok
+ RCPT To: weblate@gnunet.org
+ 250 2.1.5 Ok
+ DATA
+ 354 End data with <CR><LF>.<CR><LF>
+ hello
+ .
+ 250 2.0.0 Ok: queued as xxxxx
+ quit
+ 221 2.0.0 Bye
+ Connection closed by foreign host.
+ ```
+
+#### Python modules
+
+From https://docs.weblate.org/en/latest/admin/install/venv-debian.html#python-modules
+
+All-day modules installed:
+
+`$ pip install Weblate aeidon psycopg2-binary`
+
+#### nginx
+
+This root-level service can be found in the `root` repository.
+
+#### uwsgi
+
+uwsgi: https://docs.weblate.org/en/latest/admin/install.html?highlight=uwsgi#sample-configuration-for-nginx-and-uwsgi
+
+See **systemd** below for customization information.
+
+#### celery
+
+Celery: https://docs.weblate.org/en/latest/admin/install.html#celery
+
+See **systemd** below for customization information.
+
+#### systemd
+
+Our needs require running weblate under `weblate` user as a non-priv service. This requires running celery-weblate and uwsgi-weblate services as user-level systemd services.
+
+* See service files under `systemd-nonpriv/` in this repo.
+* On server, non-priv `systemd` files live in `/home/weblate/.config/systemd/user/`
+* Commands:
+ `$ systemctl --user enable | disable | start | stop | status *servicename*`
+
+#### rollbar
+
+For error collection: https://docs.weblate.org/en/weblate-4.0.2/admin/install.html#collecting-errors
+
+(in virtualenv): `$ pip install rollbar`
+
+
+
+### Running Weblate
+
+After installing and customizing, log into `weblate` shell account, and invoke virtualenv:
+
+`$ . ~/weblate-env/bin/activate`
+
+Now run Django static files collection (required once):
+(https://docs.weblate.org/en/latest/admin/install.html?highlight=uwsgi#serving-static-files)
+
+`$ weblate collectstatic --noinput`
+
+Weblate server should now be set up and visible at the location specified in the nginx `weblate.site` file. If the site is visible but looks like it's missing CSS styles, that's a problem with the static files. Common causes:
+
+* static files were not collected
+* nginx is not pointing to the correct location
+ * maybe the `/home/weblate/DATA_DIR` symlink is broken?