diff --git a/plugins/discourse-nginx-performance-report/app/jobs/scheduled/daily_performance_report.rb b/plugins/discourse-nginx-performance-report/app/jobs/scheduled/daily_performance_report.rb deleted file mode 100644 index f79c3a20d5a..00000000000 --- a/plugins/discourse-nginx-performance-report/app/jobs/scheduled/daily_performance_report.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -module Jobs - class DailyPerformanceReport < ::Jobs::Scheduled - every 1.day - per_host - - def execute(args) - if SiteSetting.daily_performance_report && - RailsMultisite::ConnectionManagement.current_db == "default" - result = `ruby #{Rails.root}/plugins/discourse-nginx-performance-report/script/nginx_analyze.rb --limit 1440` - - report_data = - if result.strip.empty? - <<~TEXT - Report is only available in latest image, please run: - - ```text - cd /var/discourse - ./launcher rebuild app - ``` - TEXT - else - "```text\n#{result}\n```" - end - - PostCreator.create(Discourse.system_user, - topic_id: performance_topic_id, - raw: report_data, - skip_validations: true) - - end - end - - def performance_topic_id - if SiteSetting.performance_report_topic_id > 0 - topic = Topic.find_by(id: SiteSetting.performance_report_topic_id) - return topic.id if topic - end - - staff_category = Category.find_by(id: SiteSetting.staff_category_id) - raise StandardError, "Staff category was not found" unless staff_category - - post = PostCreator.create(Discourse.system_user, - raw: I18n.t('performance_report.initial_post_raw'), - category: staff_category.name, - title: I18n.t('performance_report.initial_topic_title'), - skip_validations: true) - - unless post && post.topic_id - raise StandardError, "Could not create or retrieve performance report topic id" - end - - SiteSetting.performance_report_topic_id = post.topic_id - end - - end -end diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.ar.yml b/plugins/discourse-nginx-performance-report/config/locales/server.ar.yml deleted file mode 100644 index 6d72a5333e5..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.ar.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -ar: - site_settings: - daily_performance_report: "تحليل سجلّات الخادم NGINX يوميًا ونشر موضوع مفصّل مع طاقم الموقع" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.be.yml b/plugins/discourse-nginx-performance-report/config/locales/server.be.yml deleted file mode 100644 index 59ac412bb75..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.be.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -be: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.bg.yml b/plugins/discourse-nginx-performance-report/config/locales/server.bg.yml deleted file mode 100644 index 2d50be1373e..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.bg.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -bg: - site_settings: - daily_performance_report: "Ежедневно анализирай на NGINX логовете в публиковай в темата която е само за екипа с детайли." diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.bs_BA.yml b/plugins/discourse-nginx-performance-report/config/locales/server.bs_BA.yml deleted file mode 100644 index 3e17cc6c54f..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.bs_BA.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -bs_BA: - site_settings: - daily_performance_report: "Analiziraj NGINX logove dnevno i objavljuj u Staff Only temu sa detaljima" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.ca.yml b/plugins/discourse-nginx-performance-report/config/locales/server.ca.yml deleted file mode 100644 index fa9817a01b8..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.ca.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -ca: - site_settings: - daily_performance_report: "Analitza els registres (logs) de NGINX diàriament, i publica un tema sols per a l'equip responsable amb els detalls." diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.cs.yml b/plugins/discourse-nginx-performance-report/config/locales/server.cs.yml deleted file mode 100644 index 3ee9703c97c..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.cs.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -cs: - site_settings: - daily_performance_report: "Analyzovat denní logy NGINX a zaslat téma s podrobnostmi přístupné pouze členům redakce." diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.da.yml b/plugins/discourse-nginx-performance-report/config/locales/server.da.yml deleted file mode 100644 index c5fd58f56d2..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.da.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -da: - site_settings: - daily_performance_report: "Analysér NGINX-logfiler dagligt, og send et 'kun hjælperteam'-emne med detaljer" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.de.yml b/plugins/discourse-nginx-performance-report/config/locales/server.de.yml deleted file mode 100644 index d03cf194457..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.de.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -de: - site_settings: - daily_performance_report: "Analysiere die NGINX-Logs täglich. Poste anschließend eine Zusammenfassung als Beitrag, welcher nur für Moderatoren oder Administratoren zugänglich ist." diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.el.yml b/plugins/discourse-nginx-performance-report/config/locales/server.el.yml deleted file mode 100644 index 63bf4b0e2fe..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.el.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -el: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.en.yml b/plugins/discourse-nginx-performance-report/config/locales/server.en.yml deleted file mode 100644 index ba3f80b0f7b..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.en.yml +++ /dev/null @@ -1,3 +0,0 @@ -en: - site_settings: - daily_performance_report: "Analyze NGINX logs daily and post a Staff Only topic with details" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.es.yml b/plugins/discourse-nginx-performance-report/config/locales/server.es.yml deleted file mode 100644 index b304e80445f..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.es.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -es: - site_settings: - daily_performance_report: "Analizar los registros de NGINX diariamente y publicar un tema solo para el staff con detalles" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.et.yml b/plugins/discourse-nginx-performance-report/config/locales/server.et.yml deleted file mode 100644 index 8c601aa1ed9..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.et.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -et: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.fa_IR.yml b/plugins/discourse-nginx-performance-report/config/locales/server.fa_IR.yml deleted file mode 100644 index a2a48af4a4d..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.fa_IR.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -fa_IR: - site_settings: - daily_performance_report: "تحلیل لاگ‌های NGINX و ارسال یک پست شامل جزئیات ویژه مدیران" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.fi.yml b/plugins/discourse-nginx-performance-report/config/locales/server.fi.yml deleted file mode 100644 index e438a7bf682..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.fi.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -fi: - site_settings: - daily_performance_report: "Analysoi NGINX lokit päivittäin ja julkaise vain henkilökunnalle näkyvä ketju yksityiskohdista" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.fr.yml b/plugins/discourse-nginx-performance-report/config/locales/server.fr.yml deleted file mode 100644 index 6867c869755..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.fr.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -fr: - site_settings: - daily_performance_report: "Analyser les logs de NGINX quotidiennement et poster un sujet Responsables Uniquement avec les détails" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.gl.yml b/plugins/discourse-nginx-performance-report/config/locales/server.gl.yml deleted file mode 100644 index 695b5cf2879..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.gl.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -gl: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.he.yml b/plugins/discourse-nginx-performance-report/config/locales/server.he.yml deleted file mode 100644 index 8a96541962a..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.he.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -he: - site_settings: - daily_performance_report: "Analyze NGINX logs daily and post a Staff Only topic with details" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.hu.yml b/plugins/discourse-nginx-performance-report/config/locales/server.hu.yml deleted file mode 100644 index 636956c5867..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.hu.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -hu: - site_settings: - daily_performance_report: "NGINX naplók napi elemzése és egy csak stábtagoknak téma létrehozása a részletekkel" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.hy.yml b/plugins/discourse-nginx-performance-report/config/locales/server.hy.yml deleted file mode 100644 index 81e891a73f7..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.hy.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -hy: - site_settings: - daily_performance_report: "Վերլուծեք NGINX-ի գրառումներն ամեն օր և մանրամասները հրապարակեք Միայն ԱՆձնակազմի համար թեմայում" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.id.yml b/plugins/discourse-nginx-performance-report/config/locales/server.id.yml deleted file mode 100644 index 2112cad6a27..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.id.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -id: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.it.yml b/plugins/discourse-nginx-performance-report/config/locales/server.it.yml deleted file mode 100644 index 1baea30d06d..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.it.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -it: - site_settings: - daily_performance_report: "Analizza i log di NGINX giornalmente, e pubblica un argomento con i dettagli visibile solo allo Staff" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.ja.yml b/plugins/discourse-nginx-performance-report/config/locales/server.ja.yml deleted file mode 100644 index 12af1da55f8..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.ja.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -ja: - site_settings: - daily_performance_report: "日別のNGINXのログを解析し、Staff Onlyトピックへ詳細を投稿する" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.ko.yml b/plugins/discourse-nginx-performance-report/config/locales/server.ko.yml deleted file mode 100644 index 7e6a71596bc..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.ko.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -ko: - site_settings: - daily_performance_report: "NGINX 일별 로그를 분석하고 상세정보를 스태프들에게 글타래 게시" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.lt.yml b/plugins/discourse-nginx-performance-report/config/locales/server.lt.yml deleted file mode 100644 index 85415879128..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.lt.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -lt: - site_settings: - daily_performance_report: "Analizuokite NGINX logs kasdien ir paskelbkite \"Staff Only\" temą su detalėmis" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.lv.yml b/plugins/discourse-nginx-performance-report/config/locales/server.lv.yml deleted file mode 100644 index dc48bb58eef..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.lv.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -lv: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.nb_NO.yml b/plugins/discourse-nginx-performance-report/config/locales/server.nb_NO.yml deleted file mode 100644 index 9beb50d498f..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.nb_NO.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -nb_NO: - site_settings: - daily_performance_report: "Analyser NGINX logger hver dag og opprett et emne for Staben med detaljer " diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.nl.yml b/plugins/discourse-nginx-performance-report/config/locales/server.nl.yml deleted file mode 100644 index e9b5e384e05..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.nl.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -nl: - site_settings: - daily_performance_report: "Analyseer elke dag NGINX logs en post een Alleen Voor Medewerkers topic met de details" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.pl_PL.yml b/plugins/discourse-nginx-performance-report/config/locales/server.pl_PL.yml deleted file mode 100644 index 8642c1a2b11..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.pl_PL.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -pl_PL: - site_settings: - daily_performance_report: "Analizuj logi NGINX codziennie i umieszczaj szczegóły w temacie widocznym tylko dla członków zespołu" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.pt.yml b/plugins/discourse-nginx-performance-report/config/locales/server.pt.yml deleted file mode 100644 index 894545936ba..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.pt.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -pt: - site_settings: - daily_performance_report: "Analise os logs diários NGINX e publique um tópico visível apenas para o pessoal com detalhes" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.pt_BR.yml b/plugins/discourse-nginx-performance-report/config/locales/server.pt_BR.yml deleted file mode 100644 index d082901b20c..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.pt_BR.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -pt_BR: - site_settings: - daily_performance_report: "Analizar logs do NGINX diariamente e postar um tópico somente para a Staff com os detalhes" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.ro.yml b/plugins/discourse-nginx-performance-report/config/locales/server.ro.yml deleted file mode 100644 index 31d1c440135..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.ro.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -ro: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.ru.yml b/plugins/discourse-nginx-performance-report/config/locales/server.ru.yml deleted file mode 100644 index c4212530c44..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.ru.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -ru: - site_settings: - daily_performance_report: "Ежедневно анализировать логи сервера NGINX и отправлять сообщение с результатами анализа в тему, видимую только персоналу." diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.sk.yml b/plugins/discourse-nginx-performance-report/config/locales/server.sk.yml deleted file mode 100644 index d2b1d85b8de..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.sk.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -sk: - site_settings: - daily_performance_report: "Denne analyzuj NGINX logy a z detailov vytváraj témy iba pre zamestnancov." diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.sl.yml b/plugins/discourse-nginx-performance-report/config/locales/server.sl.yml deleted file mode 100644 index 154d194f86c..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.sl.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -sl: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.sq.yml b/plugins/discourse-nginx-performance-report/config/locales/server.sq.yml deleted file mode 100644 index 463900e4fb4..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.sq.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -sq: - site_settings: - daily_performance_report: "Analyze NGINX logs daily and post a Staff Only topic with details" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.sr.yml b/plugins/discourse-nginx-performance-report/config/locales/server.sr.yml deleted file mode 100644 index 7e57a61dd21..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.sr.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -sr: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.sv.yml b/plugins/discourse-nginx-performance-report/config/locales/server.sv.yml deleted file mode 100644 index 5b71c8af104..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.sv.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -sv: - site_settings: - daily_performance_report: "Analysera NGINX-loggar dagligen och skriv ett inlägg för personalen med detaljerna" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.sw.yml b/plugins/discourse-nginx-performance-report/config/locales/server.sw.yml deleted file mode 100644 index e32f7126893..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.sw.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -sw: - site_settings: - daily_performance_report: "Pitia batli za NGINX kila siku na chapisha mada za wasaidizi tu pamoja na maelezo" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.te.yml b/plugins/discourse-nginx-performance-report/config/locales/server.te.yml deleted file mode 100644 index 49141baa040..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.te.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -te: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.th.yml b/plugins/discourse-nginx-performance-report/config/locales/server.th.yml deleted file mode 100644 index 7ed98e15d8c..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.th.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -th: {} diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.tr_TR.yml b/plugins/discourse-nginx-performance-report/config/locales/server.tr_TR.yml deleted file mode 100644 index c6ce04582fb..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.tr_TR.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -tr_TR: - site_settings: - daily_performance_report: "NGINX kayıtlarını analiz edip detaylı bir şekilde günlük Yetkili kategorisinde bir konu içerisinde paylaş." diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.uk.yml b/plugins/discourse-nginx-performance-report/config/locales/server.uk.yml deleted file mode 100644 index 4e6ab0d32fd..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.uk.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -uk: - site_settings: - daily_performance_report: "Щодня аналізуйте журнали NGINX та публікуйте тему лише для персоналу з деталями" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.ur.yml b/plugins/discourse-nginx-performance-report/config/locales/server.ur.yml deleted file mode 100644 index 0d61b8f9d59..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.ur.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -ur: - site_settings: - daily_performance_report: "Analyze NGINX logs daily and post a Staff Only topic with details" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.vi.yml b/plugins/discourse-nginx-performance-report/config/locales/server.vi.yml deleted file mode 100644 index 0ad2a948e21..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.vi.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -vi: - site_settings: - daily_performance_report: "Phân tích nhật ký NGINX hàng ngày và gửi cho BQT thông tin chi tiết" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.zh_CN.yml b/plugins/discourse-nginx-performance-report/config/locales/server.zh_CN.yml deleted file mode 100644 index b3ee6f8f270..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.zh_CN.yml +++ /dev/null @@ -1,10 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -zh_CN: - site_settings: - daily_performance_report: "每日分析 NGINX 日志并且发布详情主题到管理人员才能看到的主题" diff --git a/plugins/discourse-nginx-performance-report/config/locales/server.zh_TW.yml b/plugins/discourse-nginx-performance-report/config/locales/server.zh_TW.yml deleted file mode 100644 index 92c18de9aec..00000000000 --- a/plugins/discourse-nginx-performance-report/config/locales/server.zh_TW.yml +++ /dev/null @@ -1,8 +0,0 @@ -# encoding: utf-8 -# -# Never edit this file. It will be overwritten when translations are pulled from Transifex. -# -# To work with us on translations, join this project: -# https://www.transifex.com/projects/p/discourse-org/ - -zh_TW: {} diff --git a/plugins/discourse-nginx-performance-report/config/settings.yml b/plugins/discourse-nginx-performance-report/config/settings.yml deleted file mode 100644 index 352b5fbe940..00000000000 --- a/plugins/discourse-nginx-performance-report/config/settings.yml +++ /dev/null @@ -1,6 +0,0 @@ -plugins: - # Reporting - daily_performance_report: false - performance_report_topic_id: - default: -1 - hidden: true diff --git a/plugins/discourse-nginx-performance-report/lib/log_analyzer.rb b/plugins/discourse-nginx-performance-report/lib/log_analyzer.rb deleted file mode 100644 index 19a299a8e29..00000000000 --- a/plugins/discourse-nginx-performance-report/lib/log_analyzer.rb +++ /dev/null @@ -1,158 +0,0 @@ -# frozen_string_literal: true - -class LogAnalyzer - - class LineParser - - # log_format log_discourse '[$time_local] "$http_host" $remote_addr "$request" "$http_user_agent" "$sent_http_x_discourse_route" $status $bytes_sent "$http_referer" $upstream_response_time $request_time "$sent_http_x_discourse_username"'; - - attr_accessor :time, :ip_address, :url, :route, :user_agent, :rails_duration, :total_duration, - :username, :status, :bytes_sent, :referer - - PATTERN = /\[(.*)\](?: ".*")? (\S+) \"(.*)\" \"(.*)\" \"(.*)\" ([0-9]+) ([0-9]+) \"(.*)\" ([0-9.]+) ([0-9.]+) "(.*)"/ - - TIME_FORMAT = "%d/%b/%Y:%H:%M:%S %Z" - - def self.parse(line) - - result = new - _, result.time, result.ip_address, result.url, result.user_agent, - result.route, result.status, result.bytes_sent, result.referer, - result.rails_duration, result.total_duration, result.username = line.match(PATTERN).to_a - - result.rails_duration = result.rails_duration.to_f - result.total_duration = result.total_duration.to_f - - verb = result.url[0..3] if result.url - if verb && verb == "POST" - result.route += " (POST)" - end - - if verb && verb == "PUT" - result.route += " (PUT)" - end - - result.url = self.sanitize_url(result.url) if result.url - - result - end - - def is_mobile? - user_agent =~ /Mobile|Android|webOS/ && !(user_agent =~ /iPad|Nexus (7|10)/) - end - - def parsed_time - DateTime.strptime(time, TIME_FORMAT) if time - end - - private - - def self.sanitize_url(url) - url.gsub(/api_key=([\w.\-]+)/, 'api_key=[FILTERED]') - end - end - - attr_reader :total_requests, :message_bus_requests, :filenames, - :ip_to_rails_duration, :username_to_rails_duration, - :route_to_rails_duration, :url_to_rails_duration, - :status_404_to_count, :from_time, :to_time - - def self.analyze(filenames, args) - new(filenames, args).analyze - end - - class Aggeregator - - attr_accessor :aggregate_type - - def initialize - @data = {} - @aggregate_type = :duration - end - - def add(id, duration, aggregate = nil) - ary = (@data[id] ||= [0, 0]) - ary[0] += duration - ary[1] += 1 - unless aggregate.nil? - ary[2] ||= Hash.new(0) - if @aggregate_type == :duration - ary[2][aggregate] += duration - elsif @aggregate_type == :count - ary[2][aggregate] += 1 - end - end - end - - def top(n, aggregator_formatter = nil) - @data.sort { |a, b| b[1][0] <=> a[1][0] }.first(n).map do |metric, ary| - metric = metric.to_s - metric = "[empty]" if metric.length == 0 - result = [metric, ary[0], ary[1]] - # handle aggregate - if ary[2] - if aggregator_formatter - result.push aggregator_formatter.call(ary[2], ary[0], ary[1]) - else - result.push ary[2].sort { |a, b| b[1] <=> a[1] }.first(5).map { |k, v| - v = "%.2f" % v if Float === v - "#{k}(#{v})"}.join(" ") - end - end - - result - end - end - end - - def initialize(filenames, args = {}) - @filenames = filenames - @ip_to_rails_duration = Aggeregator.new - @username_to_rails_duration = Aggeregator.new - - @route_to_rails_duration = Aggeregator.new - @route_to_rails_duration.aggregate_type = :count - - @url_to_rails_duration = Aggeregator.new - @status_404_to_count = Aggeregator.new - - @total_requests = 0 - @message_bus_requests = 0 - @limit = args[:limit] - end - - def analyze - now = DateTime.now - - @filenames.each do |filename| - File.open(filename).each_line do |line| - @total_requests += 1 - parsed = LineParser.parse(line) - - next unless parsed.time - next if @limit && ((now - parsed.parsed_time) * 24 * 60).to_i > @limit - - @from_time ||= parsed.time - @to_time = parsed.time - - if parsed.url =~ /(POST|GET) \/message-bus/ - @message_bus_requests += 1 - next - end - - @ip_to_rails_duration.add(parsed.ip_address, parsed.rails_duration) - - username = parsed.username == "-" ? "[Anonymous]" : parsed.username - @username_to_rails_duration.add(username, parsed.rails_duration, parsed.route) - - @route_to_rails_duration.add(parsed.route, parsed.rails_duration, parsed.is_mobile? ? "mobile" : "desktop") - - @url_to_rails_duration.add(parsed.url, parsed.rails_duration) - - @status_404_to_count.add(parsed.url, 1) if parsed.status == "404" - end - end - self - end - -end diff --git a/plugins/discourse-nginx-performance-report/plugin.rb b/plugins/discourse-nginx-performance-report/plugin.rb deleted file mode 100644 index 92531a5004d..00000000000 --- a/plugins/discourse-nginx-performance-report/plugin.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -# name: discourse-nginx-performance-report -# about: Analyzing Discourse Performance using NGINX logs -# version: 0.1 -# url: https://github.com/discourse/discourse/tree/master/plugins/discourse-nginx-performance-report - -enabled_site_setting :daily_performance_report -enabled_site_setting_filter "daily_performance_report" -hide_plugin if self.respond_to?(:hide_plugin) - -after_initialize do - load File.expand_path("../app/jobs/scheduled/daily_performance_report.rb", __FILE__) -end diff --git a/plugins/discourse-nginx-performance-report/script/nginx_analyze.rb b/plugins/discourse-nginx-performance-report/script/nginx_analyze.rb deleted file mode 100644 index 2f8d57d9c6f..00000000000 --- a/plugins/discourse-nginx-performance-report/script/nginx_analyze.rb +++ /dev/null @@ -1,141 +0,0 @@ -# frozen_string_literal: true - -require 'date' -require_relative '../lib/log_analyzer' - -args = ARGV.dup - -if args[0] == "--limit" - args.shift - limit = args.shift.to_i -end - -filenames = args if args[0] -filenames ||= ["/var/log/nginx/access.log", "/var/log/nginx/access.log.1"] - -analyzer = LogAnalyzer.analyze(filenames, limit: limit) - -SPACER = "-" * 100 - -# don't feel like pulling in active support -def map_with_index(ary, &block) - idx = 0 - ary.map do |item| - v = block.call(item, idx) - idx += 1 - v - end -end - -def top(cols, aggregator, count, aggregator_formatter = nil) - sorted = aggregator.top(count, aggregator_formatter) - - col_just = [] - - col_widths = map_with_index(cols) do |name, idx| - max_width = name.length - - if cols[idx].respond_to? :align - col_just[idx] = cols[idx].align - skip_just_detection = true - else - col_just[idx] = :ljust - end - - sorted.each do |row| - col_just[idx] = :rjust unless (String === row[idx] || row[idx].nil?) && !skip_just_detection - row[idx] = '%.2f' % row[idx] if Float === row[idx] - row[idx] = row[idx].to_s - max_width = row[idx].length if row[idx].length > max_width - end - [max_width, 80].min - end - - puts(map_with_index(cols) do |name, idx| - name.ljust(col_widths[idx]) - end.join(" ")) - - puts(map_with_index(cols) do |name, idx| - ("-" * name.length).ljust(col_widths[idx]) - end.join(" ")) - - sorted.each do |raw_row| - - rows = [] - idx = 0 - raw_row.each do |col| - j = 0 - col.to_s.scan(/(.{1,80}($|\s)|.{1,80})/).each do |r| - rows[j] ||= [] - rows[j][idx] = r[0] - j += 1 - end - idx += 1 - end - - if rows.length > 1 - puts - end - - rows.each do |row| - cols.length.times do |i| - print row[i].to_s.public_send(col_just[i], col_widths[i]) - print " " - end - puts - end - - if rows.length > 1 - puts - end - - end -end - -class Column < String - attr_accessor :align - - def initialize(val, align) - super(val) - @align = align - end -end - -puts -puts "Analyzed: #{analyzer.filenames.join(",")} on #{`hostname`}" -if limit - puts "Limited to #{DateTime.now - (limit.to_f / (60 * 24.0))} - #{DateTime.now}" -end -puts SPACER -puts "#{analyzer.from_time} - #{analyzer.to_time}" -puts SPACER -puts "Total Requests: #{analyzer.total_requests} ( MessageBus: #{analyzer.message_bus_requests} )" -puts SPACER -puts "Top 30 IPs by Server Load" -puts -top(["IP Address", "Duration", "Reqs"], analyzer.ip_to_rails_duration, 30) -puts SPACER -puts -puts "Top 30 users by Server Load" -puts -top(["Username", "Duration", "Reqs", "Routes"], analyzer.username_to_rails_duration, 30) -puts SPACER -puts -puts "Top 100 routes by Server Load" -puts -top(["Route", "Duration", "Reqs", Column.new("Mobile", :rjust)], analyzer.route_to_rails_duration, 100, lambda { - |hash, name, total| - "#{hash["mobile"] || 0} (#{"%.2f" % (((hash["mobile"] || 0) / (total + 0.0)) * 100)})%"} -) -puts SPACER -puts -puts "Top 30 urls by Server Load" -puts -top(["Url", "Duration", "Reqs"], analyzer.url_to_rails_duration, 30) - -puts "(all durations in seconds)" -puts SPACER -puts -puts "Top 30 not found urls (404s)" -puts -top(["Url", "Count"], analyzer.status_404_to_count, 30) diff --git a/plugins/discourse-nginx-performance-report/spec/line_parser_spec.rb b/plugins/discourse-nginx-performance-report/spec/line_parser_spec.rb deleted file mode 100644 index 6fe38ba8d97..00000000000 --- a/plugins/discourse-nginx-performance-report/spec/line_parser_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' -require_relative '../lib/log_analyzer' - -describe LogAnalyzer::LineParser do - describe '.parse' do - let(:line) { '[22/Sep/2016:07:32:00 +0000] 172.0.0.1 "GET /about.json?api_username=system&api_key=1234567 HTTP/1.1" "Some usename" "about/index" 200 1641 "-" 0.014 0.014 "system"' } - - it "should filter out the api_key" do - result = described_class.parse(line) - expect(result.url).to eq('GET /about.json?api_username=system&api_key=[FILTERED] HTTP/1.1') - end - end -end