Discourse Operations

Inofficial User Guide

von Ben Hest, An Unofficial Discourse User Reference Guide - TechForum Site and Post Help - DigiKey TechForum - An Electronic Component and Engineering Solution Forum

Operations

forum.netzwissen.de läuft mit separaten Containern für die Redis Caching Datenbank und die Web-Applikation. Siehe href="Move from standalone container to separate web and data containers - Sysadmins - Discourse Meta Entsprechend gibt es separate *.yaml Konfigurationen für den Daten-Container und für den Web-Container. Die postgresql Datenbank läuft nicht im data Container, sondern auf einem externen lxc Container.

root@develd:/var/discourse/containers# ls -la
total 28
drwxr-xr-x  2 root root 4096 Aug 20 10:11 .
drwxr-xr-x 12 root root 4096 Apr 30 05:37 ..
-rw-r--r--  1 root root 4637 Nov 11  2020 app.yml.inactive
-rw-r--r--  1 root root 1124 Nov 11  2020 data.yml
-rw-r--r--  1 root root    0 Nov 11  2020 .gitkeep
-rw-r--r--  1 root root 5059 Aug 20 10:11 web_only.yml

Launcher

root@develd:/var/discourse# ./launcher
Usage: launcher COMMAND CONFIG [--skip-prereqs] [--docker-args STRING]
Commands:
    start:       Start/initialize a container
    stop:        Stop a running container
    restart:     Restart a container
    destroy:     Stop and remove a container
    enter:       Open a shell to run commands inside the container
    logs:        View the Docker logs for a container
    bootstrap:   Bootstrap a container for the config based on a template
    run:         Run the given command with the config in the context of the last bootstrapped image
    rebuild:     Rebuild a container (destroy old, bootstrap, start new)
    cleanup:     Remove all containers that have stopped for> 24 hours
    start-cmd:   Generate docker command used to start container

Options:
–skip-prereqs Don't check launcher prerequisites
–docker-args Extra arguments to pass when running docker
–skip-mac-address Don't assign a mac address
–run-image Override the image used for running the container

Logs

/var/discourse/shared/standalone/log/

Allgemeine Debug Infos

/var/discourse/discourse-doctor

Found containers/app.yml

====== YAML SETTINGS ======

DISCOURSE_HOSTNAME=forum.netzwissen.de
SMTP_ADDRESS=mail.netzwissen.de
DEVELOPER_EMAILS=REDACTED
SMTP_PASSWORD=REDACTED
SMTP_PORT=587
SMTP_USER_NAME=noreply-discourse@netzwissen.de
LETSENCRYPT_ACCOUNT_EMAIL=REDACTED

====== DOCKER INFO ======

DOCKER VERSION: Docker version 19.03.8, build afacb8b7f0

DOCKER PROCESSES (docker ps -a)

CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                    PORTS                   NAMES
7333f3210491        local_discourse/app   "/sbin/boot"             16 hours ago        Up 16 hours               127.0.0.1:884->80/tcp   app
539c78cffb6a        0dbf6b4c454b          "docker-entrypoint.s…"   5 weeks ago         Exited (0) 17 hours ago                           zammad-docker-compose_zammad-memcached_1

Discourse container app is running

Deployment, Upgrade

Beide Container>

./launcher stop web_only; ./launcher rebuild data; ./launcher rebuild web_only

Nur web_only Appserver

./launcher stop web_only; ./launcher rebuild web_only

Plugin Installation

https://meta.discourse.org/t/install-plugins-in-discourse/19157

Maintenance

One CPU and 1GB of memory, with swap, is the minimum for a basic Discourse community. As your community grows you may need more memory or CPU resources.nofollow" title="Configure automatic backups for Discourse - Self-Hosting - Discourse Meta

configure-automatic-backups-for-discourse/14855))

	<li class="level2">* - - [[https://meta.discourse.org/t/allowing-ssl-for-your-discourse-docker-setup/13847|HTTPS support]][HTTPS support]((<a class="urlextern" href="https://meta.discourse.org/t/allowing-ssl-for-your-discourse-docker-setup/13847" rel="ugc nofollow" title="https://meta.discourse.org/t/allowing-ssl-for-your-discourse-docker-setup/13847">https://meta.discourse.org/t/allowing-ssl-for-your-discourse-docker-setup/13847</a>))</li>
	<li class="level2">* - - [[https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857|Content Delivery Network support]][Content Delivery Network support]((<a class="urlextern" href="https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857" rel="ugc nofollow" title="https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857">https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857</a>))</li>
	<li class="level2">* - - [[https://meta.discourse.org/t/set-up-reply-via-email-support/14003|Reply via Email]][Reply via Email]((<a class="urlextern" href="https://meta.discourse.org/t/set-up-reply-via-email-support/14003" rel="ugc nofollow" title="https://meta.discourse.org/t/set-up-reply-via-email-support/14003">https://meta.discourse.org/t/set-up-reply-via-email-support/14003</a>))</li>
	<li class="level2">* - - [[https://meta.discourse.org/t/move-your-discourse-instance-to-a-different-server/15721|Import and Export your data]][Import and Export your data]((<a class="urlextern" href="https://meta.discourse.org/t/move-your-discourse-instance-to-a-different-server/15721" rel="ugc nofollow" title="https://meta.discourse.org/t/move-your-discourse-instance-to-a-different-server/15721">https://meta.discourse.org/t/move-your-discourse-instance-to-a-different-server/15721</a>))</li>
	<li class="level2">* - - [[https://meta.discourse.org/t/how-do-i-change-the-domain-name/16098|Change the domain name]][Change the domain name]((<a class="urlextern" href="https://meta.discourse.org/t/how-do-i-change-the-domain-name/16098" rel="ugc nofollow" title="https://meta.discourse.org/t/how-do-i-change-the-domain-name/16098">https://meta.discourse.org/t/how-do-i-change-the-domain-name/16098</a>))</li>
	<li class="level2">* - - [[https://meta.discourse.org/t/multisite-configuration-with-docker/14084|Multiple Discourse instances on the same server]][Multiple Discourse instances on the same server]((<a class="urlextern" href="https://meta.discourse.org/t/multisite-configuration-with-docker/14084" rel="ugc nofollow" title="https://meta.discourse.org/t/multisite-configuration-with-docker/14084">https://meta.discourse.org/t/multisite-configuration-with-docker/14084</a>))</li>
	<li class="level2">* - - [[https://github.com/discourse/discourse/tree/master/script/import_scripts|Import old content from vBulletin, PHPbb, Vanilla, Drupal, BBPress, etc]][Import old content from vBulletin, PHPbb, Vanilla, Drupal, BBPress, etc]((<a class="urlextern" href="https://github.com/discourse/discourse/tree/master/script/import_scripts" rel="ugc nofollow" title="https://github.com/discourse/discourse/tree/master/script/import_scripts">https://github.com/discourse/discourse/tree/master/script/import_scripts</a>))</li>
	<li class="level2">* - A firewall on your server? A firewall on your server? - A firewall on your server? A firewall on your server? [[https://meta.discourse.org/t/configure-a-firewall-for-discourse/20584|Configure firewall]][Configure firewall]((<a class="urlextern" href="https://meta.discourse.org/t/configure-a-firewall-for-discourse/20584" rel="ugc nofollow" title="https://meta.discourse.org/t/configure-a-firewall-for-discourse/20584">https://meta.discourse.org/t/configure-a-firewall-for-discourse/20584</a>)..)..</li>
	<li class="level2">* - A user friendly A user friendly - A user friendly A user friendly [[https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238|offline page when rebuilding or upgrading?]][offline page when rebuilding or upgrading?]((<a class="urlextern" href="https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238" rel="ugc nofollow" title="https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238">https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238</a>))</li>
	<li class="level2">* - Embed Discourse Embed Discourse - Embed Discourse Embed Discourse [[https://github.com/discourse/wp-discourse|in your WordPress install]][in your WordPress install]((<a class="urlextern" href="https://github.com/discourse/wp-discourse" rel="ugc nofollow" title="https://github.com/discourse/wp-discourse">https://github.com/discourse/wp-discourse</a>), or , or ), or , or [[https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963|on your static HTML site]][on your static HTML site]((<a class="urlextern" href="https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963" rel="ugc nofollow" title="https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963">https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963</a>))</li>
</ul>
<code><code> </code></code></li>

cd /var/discourse git pull ./launcher rebuild app

 

URls

**User Profile:** `https://your-discourse.com/my/preferences` (for preferences), `https://your-discourse.com/my/activity` (for profile activity), `https://your-discourse.com/my/messages` (for messages), and `https://your-discourse.com/my/bookmarks` (for bookmarks).

  • - **Categories:** `https://your-discourse.com/c/category_name/category_id` or or `https://your-discourse.com/c/category_id`..
  • - **Topics:** `https://your-discourse.com/t/topic_title/topic_id` or or `https://your-discourse.com/t/topic_id`..
  • - **Specific Posts:** `https://your-discourse.com/t/topic_title/topic_id/post_id`..
  • - **Admin Area:** `https://your-discourse.com/admin`

User Operations

**Mass invite**

  • * - One user per line.One user per line.- One user per line.One user per line.
  • * - Email is required in the first column, and the email must be valid.Email is required in the first column, and the email must be valid.- Email is required in the first column, and the email must be valid.Email is required in the first column, and the email must be valid.
  • * - Any permissions groups you want this user to be a member of should be in second column. For multiple groups, separate group names with a semicolon groupAny permissions groups you want this user to be a member of should be in second column. For multiple groups, separate group names with a semicolon group- Any permissions groups you want this user to be a member of should be in second column. For multiple groups, separate group names with a semicolon groupAny permissions groups you want this user to be a member of should be in second column. For multiple groups, separate group names with a semicolon group_1;group_2;group2;group_32;group_33
  • * - Normally invited users arrive at the homepage. If you would rather invited users end up on a specific topic, enter that Topic ID in the third column.Normally invited users arrive at the homepage. If you would rather invited users end up on a specific topic, enter that Topic ID in the third column.- Normally invited users arrive at the homepage. If you would rather invited users end up on a specific topic, enter that Topic ID in the third column.Normally invited users arrive at the homepage. If you would rather invited users end up on a specific topic, enter that Topic ID in the third column.

name@example.com,group_1;group_2,topic_id

Statistics

Plugin: Data Explorer

https://github.com/SidVal/discourse-data-explorer/blob/queries/querys.md

Zutritt zum Container


docker exec -it e6fe156e2091 /bin/bash

Special settings

Send personal message to all users on a Discourse site

Backup & Restore

 

Backup


root@docker2:/var/discourse# ./launcher enter web_only

discourse backup
<code>

Beim Backup übers UI wird ein Link an die Admin Adresse geschickt. Der Link enthält einen passenden token, der zeitlich begrenzt und nur im gleichen Auth Kontext funktioniert.

Restore

Die Restore Datei muss nach /var/discourse/shared/web-only/backups/default

Um "aus Versehen" überschreiben zu vermeinden, muss enable_restore explizit aktiviert sein.

root@docker2:/var/discourse# ./launcher enter web_only

discourse enable_restore

discourse restore netzwissen-forum-2023-10-07-125819-v20230913194832.tar.gz