[BEZAHLT] Discourse im Unterordner auf Ubuntu Server installieren

Wir haben diese Website this. Wir müssen ein Discourse-Docker-Forum in einem Unterordner auf Ubuntu einrichten. Wir möchten Discourse unter TalkWithStranger Ask - Ask and chat random strangers and meet new people in online free chat rooms. bereitstellen, ohne ein CDN zu verwenden.

Ich habe versucht, es gemäß diesem Tutorial this tutorial einzurichten, habe jedoch folgende Probleme:

  1. Avatare verschwinden nach 2 oder 3 Neubuilds.
  2. Bilder, die in Themen hochgeladen wurden, ergeben nach einigen Neubuilds einen 404-Fehler.

Sie müssen Fehler auf dieser Testdomain this test domain beheben, damit ich dieselben Fehler auf meiner Live-Website beheben kann. 95 % der Arbeit sind erledigt; Sie müssen nur noch einige Fehler beheben.

Meine app.yml

##   Unterordner-Unterstützung mit Docker   https://meta.discourse.org/t/subfolder-support-with-docker/30507

## discourse-terraform Docker-Konfigurationsvorlage

##

## Nach Änderungen an dieser Datei MÜSSEN Sie neu erstellen, damit alle Änderungen

## in Ihrer Live-Discourse-Instanz wirksam werden:

##

## /var/discourse/launcher rebuild app

##

## Dies ist die All-in-One, eigenständige Discourse-Docker-Container-Vorlage

# Sie können eine Ratenbegrenzung hinzufügen, indem Sie die ratelimited-Vorlage auskommentieren.

# Standardmäßig sind 12 Anfragen pro Sekunde pro IP und 100 pro Minute pro IP erlaubt.

# Dies kann durch Ändern der Parameter in dieser Datei konfiguriert werden.

templates:

  - "templates/postgres.template.yml"

  - "templates/redis.template.yml"

  - "templates/web.template.yml"

  - "templates/sshd.template.yml"

## Welche TCP/IP-Ports soll dieser Container exponieren?

expose:

  - "1357:80" # Ändern Sie diesen Port in den Port, unter dem Sie Discourse ausführen möchten # Weiterleitung des Host-Ports 80 an den Container-Port 80 (HTTP)

  #- "2222:22" # Weiterleitung des Host-Ports 2222 an den Container-Port 22 (SSH)

params:

  db_default_text_search_config: "pg_catalog.english"

  ## Setzen Sie db_shared_buffers auf 1/3 des Speichers, den Sie PostgreSQL zuweisen möchten.

  ## Bei einer 1-GB-Installation auf 128 MB setzen, bei einer 4-GB-Instanz können Sie auf 1 GB erhöhen.

  db_shared_buffers: "512MB"

  #

  ## Welche Git-Revision soll dieser Container verwenden? (Standard: tests-passed)

  #version: tests-passed

env:

  LANG: en_US.UTF-8

  ## TODO: Wie viele gleichzeitige Webanfragen werden unterstützt?

  ## Bei 2 GB empfehlen wir 3–4 Worker, bei 1 GB nur 2.

  UNICORN_WORKERS: 3

  ##

  ## TODO: Liste der durch Kommas getrennten E-Mail-Adressen, die bei der ersten Anmeldung zu Admins und Entwicklern werden.

  ## Beispiel: 'user1@example.com, user2@example.com'

  DISCOURSE_DEVELOPER_EMAILS: "ahmeds.works@gmail.com" # Ändern Sie diese E-Mails in die E-Mails der Site-Administratoren.

  ##

  ## TODO: Der Domainname, auf den diese Discourse-Instanz antwortet.

  DISCOURSE_RELATIVE_URL_ROOT: /ask 

  DISCOURSE_HOSTNAME: "privitevps.ga" # Ändern Sie diese Domain in Ihre Website-Domain.

  ##

  ## TODO: Der Mailserver, den diese Discourse-Instanz verwendet.

  # Ändern Sie die SMTP-Einstellungen in Ihre eigenen SMTP-Einstellungen.

  DISCOURSE_SMTP_ADDRESS: smtp.example.com

  DISCOURSE_SMTP_PORT: 587

  DISCOURSE_SMTP_USER_NAME: example@example.com

  DISCOURSE_SMTP_PASSWORD: example_password

##

  ## Die CDN-Adresse für diese Discourse-Instanz (konfiguriert zum Abrufen).

  #DISCOURSE_CDN_URL: //discourse-cdn.example.com

## Diese Container sind zustandslos; alle Daten werden in /shared gespeichert.

volumes:

  - volume:

      host: /var/discourse/shared/standalone

      guest: /shared

  - volume:

      host: /var/discourse/shared/standalone/log/var-log

      guest: /var/log

## Das Docker-Manager-Plugin ermöglicht ein One-Click-Upgrade von Discourse.

## http://discourse.example.com/admin/docker

hooks:

  after_code:

    - exec:

        cd: $home/plugins

        cmd:

          - mkdir -p plugins

          - git clone https://github.com/discourse/docker_manager.git

          - git clone https://github.com/discourse/discourse-voting.git

## Denken Sie daran: Dies ist YAML-Syntax – Sie können nur einen Block mit einem Namen haben.

run:

    - exec:

        cd: $home

        cmd:

          - rm -fr public/assets

          - sudo -E -u discourse bundle exec rake assets:precompile

          - mkdir -p public/ask

          - cd public/ask && ln -s ../uploads && ln -s ../backups

          - rm public/uploads

          - rm public/backups

    - replace:

       global: true

       filename: /etc/nginx/conf.d/discourse.conf

       from: proxy_pass http://discourse;

       to: |

          rewrite ^/(.*)$ /ask/$1 break;

          proxy_pass http://discourse;

    - replace:

       filename: /etc/nginx/conf.d/discourse.conf

       from: etag off;

       to: |

          etag off;

          location /ask {

             rewrite ^/ask/?(.*)$ /$1;

          }

    - replace:

         filename: /etc/nginx/conf.d/discourse.conf

         from: $proxy_add_x_forwarded_for

         to: $http_fastly_client_ip

         global: true

    - exec: echo „Ende der benutzerdefinierten Befehle"

    - exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print „Zugelassene SSH-Schlüssel für diesen Container:"; } NF>=2 {print $NF;}'

nginx-Konfiguration

location /ask {
    proxy_pass      http://localhost:1357;
    proxy_read_timeout      90;
    proxy_redirect  http://localhost:1357 https://privitevps.ga;
}

Discourse-Fehlerprotokoll

    /var/www/discourse/app/models/report.rb:267:in `rescue in find'

    /var/www/discourse/app/models/report.rb:234:in `find'

    /var/www/discourse/app/controllers/admin/reports_controller.rb:42:in `block (2 levels) in bulk'

    actionpack-6.0.3.5/lib/action_controller/metal/strong_parameters.rb:345:in `block in each_pair'

    actionpack-6.0.3.5/lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'

    actionpack-6.0.3.5/lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'

    /var/www/discourse/app/controllers/admin/reports_controller.rb:31:in `block in bulk'

    /var/www/discourse/lib/hijack.rb:56:in `instance_eval'

    /var/www/discourse/lib/hijack.rb:56:in `block in hijack'

    /var/www/discourse/lib/scheduler/defer.rb:94:in `block in do_work'

    rails_multisite-2.5.0/lib/rails_multisite/connection_management.rb:76:in `with_connection'

    /var/www/discourse/lib/scheduler/defer.rb:89:in `do_work'

    /var/www/discourse/lib/scheduler/defer.rb:79:in `block (2 levels) in start_thread'

PostgreSQL-Protokoll

2021-04-01 18:33:04.209 UTC [51] LOG:  starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-04-01 18:33:04.210 UTC [51] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-04-01 18:33:04.211 UTC [51] LOG:  listening on IPv6 address "::", port 5432
2021-04-01 18:33:04.211 UTC [51] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-04-01 18:33:04.223 UTC [73] LOG:  database system was shut down at 2021-04-01 18:32:19 UTC
2021-04-01 18:33:04.230 UTC [51] LOG:  database system is ready to accept connections
2021-04-01 18:44:16.543 UTC [1155] discourse@discourse LOG:  provided user name (discourse) and authenticated user name (root) do not match
2021-04-01 18:44:16.544 UTC [1155] discourse@discourse FATAL:  Peer authentication failed for user "discourse"
2021-04-01 18:44:16.544 UTC [1155] discourse@discourse DETAIL:  Connection matched pg_hba.conf line 94: "local   all             all                                     peer"
2021-04-02 03:33:33.893 UTC [36640] discourse@discourse LOG:  duration: 141.998 ms  statement: COPY public.stylesheet_cache (id, target, digest, content, created_at, updated_at, theme_id, source_map) TO stdout;
2021-04-02 17:49:50.676 UTC [92100] discourse@discourse LOG:  duration: 156.461 ms  statement: DO $$DECLARE row record;
        BEGIN
          -- create <destination> schema if it does not exists already
          -- NOTE: DROP & CREATE SCHEMA is easier, but we don't want to drop the public schema
          -- otherwise extensions (like hstore & pg_trgm) won't work anymore...
          CREATE SCHEMA IF NOT EXISTS backup;
          -- move all <source> tables to <destination> schema
          FOR row IN SELECT tablename FROM pg_tables WHERE schemaname = 'public'  AND tableowner = 'discourse'
          LOOP
            EXECUTE 'DROP TABLE IF EXISTS backup.' || quote_ident(row.tablename) || ' CASCADE;';
            EXECUTE 'ALTER TABLE public.' || quote_ident(row.tablename) || ' SET SCHEMA backup;';
          END LOOP;
          -- move all <source> views to <destination> schema
          FOR row IN SELECT viewname FROM pg_views WHERE schemaname = 'public' AND viewowner = 'discourse'
          LOOP
            EXECUTE 'DROP VIEW IF EXISTS backup.' || quote_ident(row.viewname) || ' CASCADE;';
            EXECUTE 'ALTER VIEW public.' || quote_ident(row.viewname) || ' SET SCHEMA backup;';
          END LOOP;
        END$$;

2021-04-02 17:49:52.092 UTC [92128] discourse@discourse LOG:  duration: 114.918 ms  statement: COPY public.scheduler_stats (id, name, hostname, pid, duration_ms, live_slots_start, live_slots_finish, started_at, success, error) FROM stdin;
2021-04-02 17:49:53.398 UTC [92128] discourse@discourse LOG:  duration: 1266.208 ms  statement: COPY public.stylesheet_cache (id, target, digest, content, created_at, updated_at, theme_id, source_map) FROM stdin;
2021-04-02 17:51:24.451 UTC [51] LOG:  received smart shutdown request
2021-04-02 17:51:26.828 UTC [51] LOG:  background worker "logical replication launcher" (PID 79) exited with exit code 1
2021-04-02 17:51:26.836 UTC [74] LOG:  shutting down
2021-04-02 17:51:26.948 UTC [51] LOG:  database system is shut down
2021-04-02 18:00:56.877 UTC [52] LOG:  starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-04-02 18:00:56.879 UTC [52] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-04-02 18:00:56.879 UTC [52] LOG:  listening on IPv6 address "::", port 5432
2021-04-02 18:00:56.880 UTC [52] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-04-02 18:00:56.893 UTC [73] LOG:  database system was shut down at 2021-04-02 18:00:11 UTC
2021-04-02 18:00:56.909 UTC [52] LOG:  database system is ready to accept connections
2021-04-02 18:03:23.275 UTC [343] discourse@discourse LOG:  duration: 172.267 ms  statement: UPDATE "stylesheet_cache"
           SET "content" = REPLACE("content", '/uploads', '/../uploads'), "digest" = REPLACE("digest", '/uploads', '/../uploads'), "source_map" = REPLACE("source_map", '/uploads', '/../uploads'), "target" = REPLACE("target", '/uploads', '/../uploads')
         WHERE "content" IS NOT NULL AND "content" LIKE '%/uploads%' OR "digest" IS NOT NULL AND "digest" LIKE '%/uploads%' OR "source_map" IS NOT NULL AND "source_map" LIKE '%/uploads%' OR "target" IS NOT NULL AND "target" LIKE '%/uploads%'

2021-04-02 18:03:55.952 UTC [52] LOG:  received smart shutdown request
2021-04-02 18:03:57.185 UTC [52] LOG:  background worker "logical replication launcher" (PID 79) exited with exit code 1
2021-04-02 18:03:57.189 UTC [74] LOG:  shutting down
2021-04-02 18:03:57.308 UTC [52] LOG:  database system is shut down
2021-04-02 18:04:00.354 UTC [47] LOG:  starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-04-02 18:04:00.355 UTC [47] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-04-02 18:04:00.356 UTC [47] LOG:  listening on IPv6 address "::", port 5432
2021-04-02 18:04:00.359 UTC [47] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-04-02 18:04:00.375 UTC [66] LOG:  database system was shut down at 2021-04-02 18:03:57 UTC
2021-04-02 18:04:00.380 UTC [47] LOG:  database system is ready to accept connections
2021-04-02 18:13:27.137 UTC [47] LOG:  received smart shutdown request
2021-04-02 18:13:27.980 UTC [47] LOG:  background worker "logical replication launcher" (PID 72) exited with exit code 1
2021-04-02 18:13:27.982 UTC [67] LOG:  shutting down
2021-04-02 18:13:28.009 UTC [47] LOG:  database system is shut down
2021-04-02 18:13:31.497 UTC [45] LOG:  starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-04-02 18:13:31.499 UTC [45] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-04-02 18:13:31.499 UTC [45] LOG:  listening on IPv6 address "::", port 5432
2021-04-02 18:13:31.500 UTC [45] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-04-02 18:13:31.515 UTC [67] LOG:  database system was shut down at 2021-04-02 18:13:27 UTC
2021-04-02 18:13:31.520 UTC [45] LOG:  database system is ready to accept connections

Nginx-Fehlerprotokoll

2021/04/02 18:01:06 [error] 69#69: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.17.0.1, server: _, request: "GET /ask/ HTTP/1.0", upstream: "http://127.0.0.1:3000/ask/", host: "localhost:1357"
2021/04/02 18:13:38 [error] 64#64: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.17.0.1, server: _, request: "POST /ask/message-bus/c734a550b6e54923aff3e0c6fdf1b014/poll HTTP/1.0", upstream: "http://127.0.0.1:3000/ask/message-bus/c734a550b6e54923aff3e0c6fdf1b014/poll", host: "localhost:1357", referrer: "https://privitevps.ga/ask/latest"

Wann benötigen Sie die Lösung?

SOFORT

Was ist Ihr Budget in USD, das Sie für diese Aufgabe anbieten können?

Offen für Vorschläge. Bitte schreiben Sie mir eine PN mit Ihrem Ansatz und Ihrer Schätzung.

1 „Gefällt mir“

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.