diff --git a/daemon.py b/daemon.py index 959e60a06..c0e0e7a74 100644 --- a/daemon.py +++ b/daemon.py @@ -178,6 +178,7 @@ from webapp_calendar import html_calendar_delete_confirm from webapp_calendar import html_calendar from webapp_about import html_about from webapp_specification import html_specification +from webapp_manual import html_manual from webapp_accesskeys import html_access_keys from webapp_accesskeys import load_access_keys_for_accounts from webapp_confirm import html_confirm_delete @@ -16473,6 +16474,36 @@ class PubServer(BaseHTTPRequestHandler): self.server.debug) return + if self.path in ('/manual', '/usermanual', '/userguide'): + if calling_domain.endswith('.onion'): + msg = \ + html_manual(self.server.base_dir, 'http', + self.server.onion_domain, + None, self.server.translate, + self.server.system_language) + elif calling_domain.endswith('.i2p'): + msg = \ + html_manual(self.server.base_dir, 'http', + self.server.i2p_domain, + None, self.server.translate, + self.server.system_language) + else: + msg = \ + html_manual(self.server.base_dir, + self.server.http_prefix, + self.server.domain_full, + self.server.onion_domain, + self.server.translate, + self.server.system_language) + msg = msg.encode('utf-8') + msglen = len(msg) + self._login_headers('text/html', msglen, calling_domain) + self._write(msg) + fitness_performance(getreq_start_time, self.server.fitness, + '_GET', 'show user manual screen', + self.server.debug) + return + if html_getreq and users_in_path and authorized and \ self.path.endswith('/accesskeys'): nickname = self.path.split('/users/')[1] diff --git a/manual/manual.md b/manual/manual.md index 015a18913..1f0052040 100644 --- a/manual/manual.md +++ b/manual/manual.md @@ -239,7 +239,7 @@ git pull chown -R epicyon:epicyon * systemctl restart epicyon ``` -# Configuration +# Registering accounts # Following # Creating posts ## Post scopes diff --git a/translations/ar.json b/translations/ar.json index 5b94f68fd..7bc139782 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -594,5 +594,6 @@ "Site DevOps": "DevOps الموقع", "A list of devops nicknames. One per line.": "قائمة بأسماء المطورين. واحد في كل سطر.", "devops": "devops", - "Reject spam accounts": "رفض حسابات البريد العشوائي" + "Reject spam accounts": "رفض حسابات البريد العشوائي", + "User Manual": "دليل الاستخدام" } diff --git a/translations/bn.json b/translations/bn.json index bdd4de2eb..b455a0a9c 100644 --- a/translations/bn.json +++ b/translations/bn.json @@ -594,5 +594,6 @@ "Site DevOps": "সাইট DevOps", "A list of devops nicknames. One per line.": "ডেভপস ডাকনামের একটি তালিকা। প্রতি লাইনে একটি।", "devops": "devops", - "Reject spam accounts": "স্প্যাম অ্যাকাউন্ট প্রত্যাখ্যান করুন" + "Reject spam accounts": "স্প্যাম অ্যাকাউন্ট প্রত্যাখ্যান করুন", + "User Manual": "ব্যবহার বিধি" } diff --git a/translations/ca.json b/translations/ca.json index 1384007cc..c3737d855 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -594,5 +594,6 @@ "Site DevOps": "Lloc DevOps", "A list of devops nicknames. One per line.": "Una llista de sobrenoms de devops. Un per línia.", "devops": "devops", - "Reject spam accounts": "Rebutja els comptes de correu brossa" + "Reject spam accounts": "Rebutja els comptes de correu brossa", + "User Manual": "Manual d'usuari" } diff --git a/translations/cy.json b/translations/cy.json index 1f7245ab7..3414d01be 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -594,5 +594,6 @@ "Site DevOps": "Gwefan DevOps", "A list of devops nicknames. One per line.": "Mae rhestr o devops llysenwau. Un i bob llinell.", "devops": "devops", - "Reject spam accounts": "Gwrthod cyfrifon sbam" + "Reject spam accounts": "Gwrthod cyfrifon sbam", + "User Manual": "Llawlyfr Defnyddiwr" } diff --git a/translations/de.json b/translations/de.json index 3e9b6f24b..cdd124108 100644 --- a/translations/de.json +++ b/translations/de.json @@ -594,5 +594,6 @@ "Site DevOps": "Site-DevOps", "A list of devops nicknames. One per line.": "Eine Liste von Entwickler-Spitznamen. Eine pro Zeile.", "devops": "devops", - "Reject spam accounts": "Gwrthod cyfrifon sbam" + "Reject spam accounts": "Gwrthod cyfrifon sbam", + "User Manual": "Benutzerhandbuch" } diff --git a/translations/el.json b/translations/el.json index 809695903..c966954d5 100644 --- a/translations/el.json +++ b/translations/el.json @@ -594,5 +594,6 @@ "Site DevOps": "DevOps ιστότοπου", "A list of devops nicknames. One per line.": "Μια λίστα με ψευδώνυμα devops. Ένα ανά γραμμή.", "devops": "devops", - "Reject spam accounts": "Gwrthod cyfrifon sbam" + "Reject spam accounts": "Gwrthod cyfrifon sbam", + "User Manual": "Εγχειρίδιο χρήστη" } diff --git a/translations/en.json b/translations/en.json index 95bf94265..584084820 100644 --- a/translations/en.json +++ b/translations/en.json @@ -594,5 +594,6 @@ "Site DevOps": "Site DevOps", "A list of devops nicknames. One per line.": "A list of devops nicknames. One per line.", "devops": "devops", - "Reject spam accounts": "Reject spam accounts" + "Reject spam accounts": "Reject spam accounts", + "User Manual": "User Manual" } diff --git a/translations/es.json b/translations/es.json index bb1a16ffe..7447e5b94 100644 --- a/translations/es.json +++ b/translations/es.json @@ -594,5 +594,6 @@ "Site DevOps": "DevOps del sitio", "A list of devops nicknames. One per line.": "Una lista de apodos de devops. Uno por línea.", "devops": "devops", - "Reject spam accounts": "Rechazar cuentas de spam" + "Reject spam accounts": "Rechazar cuentas de spam", + "User Manual": "Manual de usuario" } diff --git a/translations/fr.json b/translations/fr.json index 80924412a..0e07445c5 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -594,5 +594,6 @@ "Site DevOps": "DevOps du site", "A list of devops nicknames. One per line.": "Une liste de surnoms de devops. Un par ligne.", "devops": "devops", - "Reject spam accounts": "Rejeter les comptes de spam" + "Reject spam accounts": "Rejeter les comptes de spam", + "User Manual": "Manuel de l'Utilisateur" } diff --git a/translations/ga.json b/translations/ga.json index 6109f82a2..17551e459 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -594,5 +594,6 @@ "Site DevOps": "Suíomh DevOps", "A list of devops nicknames. One per line.": "Tá liosta devops leasainmneacha. Ceann in aghaidh an líne.", "devops": "devops", - "Reject spam accounts": "Diúltaigh cuntais turscair" + "Reject spam accounts": "Diúltaigh cuntais turscair", + "User Manual": "Lámhleabhar Úsáideora" } diff --git a/translations/hi.json b/translations/hi.json index 6c6bf7d86..8dd495d9d 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -594,5 +594,6 @@ "Site DevOps": "साइट देवऑप्स", "A list of devops nicknames. One per line.": "देवोप्स उपनामों की एक सूची। प्रति पंक्ति एक।", "devops": "devops", - "Reject spam accounts": "स्पैम खातों को अस्वीकार करें" + "Reject spam accounts": "स्पैम खातों को अस्वीकार करें", + "User Manual": "उपयोगकर्ता पुस्तिका" } diff --git a/translations/it.json b/translations/it.json index aa501515f..313e8edb8 100644 --- a/translations/it.json +++ b/translations/it.json @@ -594,5 +594,6 @@ "Site DevOps": "Sito DevOps", "A list of devops nicknames. One per line.": "Un elenco di soprannomi devops. Uno per riga.", "devops": "devops", - "Reject spam accounts": "Rifiuta gli account spam" + "Reject spam accounts": "Rifiuta gli account spam", + "User Manual": "Manuale d'uso" } diff --git a/translations/ja.json b/translations/ja.json index 7ad0ff780..56e567ad8 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -594,5 +594,6 @@ "Site DevOps": "サイト DevOps", "A list of devops nicknames. One per line.": "DevOps ニックネームのリスト。 1 行に 1 つ。", "devops": "devops", - "Reject spam accounts": "スパムアカウントを拒否" + "Reject spam accounts": "スパムアカウントを拒否", + "User Manual": "ユーザーマニュアル" } diff --git a/translations/ko.json b/translations/ko.json index a287d2f72..833fef494 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -594,5 +594,6 @@ "Site DevOps": "사이트 DevOps", "A list of devops nicknames. One per line.": "데브옵스 닉네임 목록입니다. 한 줄에 하나씩.", "devops": "devops", - "Reject spam accounts": "스팸 계정 거부" + "Reject spam accounts": "스팸 계정 거부", + "User Manual": "사용자 매뉴얼" } diff --git a/translations/ku.json b/translations/ku.json index 4e915e40e..5de6b24a0 100644 --- a/translations/ku.json +++ b/translations/ku.json @@ -594,5 +594,6 @@ "Site DevOps": "Malpera DevOps", "A list of devops nicknames. One per line.": "Lîsteya navên devops. Her rêzek yek.", "devops": "devops", - "Reject spam accounts": "Hesabên spam red bikin" + "Reject spam accounts": "Hesabên spam red bikin", + "User Manual": "Manual Bikarhêner" } diff --git a/translations/nl.json b/translations/nl.json index dc6b7eb64..96e70b4a7 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -594,5 +594,6 @@ "Site DevOps": "Site DevOps", "A list of devops nicknames. One per line.": "Een lijst met devops-bijnamen. Een per regel.", "devops": "devops", - "Reject spam accounts": "Spamaccounts afwijzen" + "Reject spam accounts": "Spamaccounts afwijzen", + "User Manual": "Handleiding" } diff --git a/translations/oc.json b/translations/oc.json index 25bfd8613..cd42bc632 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -590,5 +590,6 @@ "Site DevOps": "Site DevOps", "A list of devops nicknames. One per line.": "A list of devops nicknames. One per line.", "devops": "devops", - "Reject spam accounts": "Reject spam accounts" + "Reject spam accounts": "Reject spam accounts", + "User Manual": "User Manual" } diff --git a/translations/pl.json b/translations/pl.json index 077724aad..5251a3ba0 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -594,5 +594,6 @@ "Site DevOps": "Deweloperzy witryny", "A list of devops nicknames. One per line.": "Lista pseudonimów Devopa. Jeden na linię.", "devops": "devops", - "Reject spam accounts": "Odrzuć konta spamowe" + "Reject spam accounts": "Odrzuć konta spamowe", + "User Manual": "Instrukcja obsługi" } diff --git a/translations/pt.json b/translations/pt.json index ae1b929c0..cdb49560d 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -594,5 +594,6 @@ "Site DevOps": "Site DevOps", "A list of devops nicknames. One per line.": "Uma lista de apelidos de devops. Um por linha.", "devops": "devops", - "Reject spam accounts": "Rejeitar contas de spam" + "Reject spam accounts": "Rejeitar contas de spam", + "User Manual": "Manual do usuário" } diff --git a/translations/ru.json b/translations/ru.json index 5553be1a6..c3dbdfb8b 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -594,5 +594,6 @@ "Site DevOps": "DevOps сайта", "A list of devops nicknames. One per line.": "Список псевдонимов devops. По одному на строку.", "devops": "devops", - "Reject spam accounts": "Отклонить спам-аккаунты" + "Reject spam accounts": "Отклонить спам-аккаунты", + "User Manual": "Руководство пользователя" } diff --git a/translations/sw.json b/translations/sw.json index 19797f9c9..5fa4afbd3 100644 --- a/translations/sw.json +++ b/translations/sw.json @@ -594,5 +594,6 @@ "Site DevOps": "Tovuti ya DevOps", "A list of devops nicknames. One per line.": "Orodha ya majina ya utani ya devops. Moja kwa kila mstari.", "devops": "devops", - "Reject spam accounts": "Kataa akaunti za barua taka" + "Reject spam accounts": "Kataa akaunti za barua taka", + "User Manual": "Mwongozo wa mtumiaji" } diff --git a/translations/tr.json b/translations/tr.json index 10a912f0e..9bc1e42d7 100644 --- a/translations/tr.json +++ b/translations/tr.json @@ -594,5 +594,6 @@ "Site DevOps": "Site DevOps", "A list of devops nicknames. One per line.": "Devops takma adlarının listesi. Her satıra bir tane.", "devops": "devops", - "Reject spam accounts": "Spam hesapları reddet" + "Reject spam accounts": "Spam hesapları reddet", + "User Manual": "Kullanım kılavuzu" } diff --git a/translations/uk.json b/translations/uk.json index f878b705d..cf338ecbc 100644 --- a/translations/uk.json +++ b/translations/uk.json @@ -594,5 +594,6 @@ "Site DevOps": "Сайт DevOps", "A list of devops nicknames. One per line.": "Список ніків devops. По одному на рядок.", "devops": "devops", - "Reject spam accounts": "Відхилити спам-акаунти" + "Reject spam accounts": "Відхилити спам-акаунти", + "User Manual": "Посібник користувача" } diff --git a/translations/yi.json b/translations/yi.json index 90008d839..c1207aa94 100644 --- a/translations/yi.json +++ b/translations/yi.json @@ -594,5 +594,6 @@ "Site DevOps": "וועבזייטל DevOps", "A list of devops nicknames. One per line.": "א רשימה פון דיוואָפּס ניקניימז. איינער פּער שורה.", "devops": "devops", - "Reject spam accounts": "אָפּוואַרפן ספּאַם אַקאַונץ" + "Reject spam accounts": "אָפּוואַרפן ספּאַם אַקאַונץ", + "User Manual": "באנוצער אנווייזער" } diff --git a/translations/zh.json b/translations/zh.json index 1d435f276..3ccbda6ca 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -594,5 +594,6 @@ "Site DevOps": "站点 DevOps", "A list of devops nicknames. One per line.": "devops 昵称列表。 每行一个。", "devops": "devops", - "Reject spam accounts": "拒绝垃圾邮件帐户" + "Reject spam accounts": "拒绝垃圾邮件帐户", + "User Manual": "用户手册" } diff --git a/webapp_column_left.py b/webapp_column_left.py index 6d7225e2a..4a1e76df7 100644 --- a/webapp_column_left.py +++ b/webapp_column_left.py @@ -346,6 +346,9 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str, html_str += \ '

' + \ translate['About this Instance'] + '

' + html_str += \ + '

' + \ + translate['User Manual'] + '

' html_str += \ '

' + \ translate['ActivityPub Specification'] + '

' diff --git a/webapp_manual.py b/webapp_manual.py new file mode 100644 index 000000000..59a6c1868 --- /dev/null +++ b/webapp_manual.py @@ -0,0 +1,69 @@ +__filename__ = "webapp_about.py" +__author__ = "Bob Mottram" +__license__ = "AGPL3+" +__version__ = "1.3.0" +__maintainer__ = "Bob Mottram" +__email__ = "bob@libreserver.org" +__status__ = "Production" +__module_group__ = "Web Interface" + +import os +from shutil import copyfile +from utils import get_config_param +from webapp_utils import html_header_with_website_markup +from webapp_utils import html_footer +from markdown import markdown_example_numbers +from markdown import markdown_to_html + + +def html_manual(base_dir: str, http_prefix: str, + domain_full: str, onion_domain: str, translate: {}, + system_language: str) -> str: + """Show the user manual screen + """ + manual_filename = base_dir + '/manual/manual.md' + admin_nickname = get_config_param(base_dir, 'admin') + if os.path.isfile(base_dir + '/accounts/manual.md'): + manual_filename = base_dir + '/accounts/manual.md' + + if os.path.isfile(base_dir + '/accounts/login-background-custom.jpg'): + if not os.path.isfile(base_dir + '/accounts/login-background.jpg'): + copyfile(base_dir + '/accounts/login-background-custom.jpg', + base_dir + '/accounts/login-background.jpg') + + manual_text = 'User Manual.' + if os.path.isfile(manual_filename): + with open(manual_filename, 'r', + encoding='utf-8') as fp_manual: + md_text = markdown_example_numbers(fp_manual.read()) + manual_text = markdown_to_html(md_text) + + manual_form = '' + css_filename = base_dir + '/epicyon-profile.css' + if os.path.isfile(base_dir + '/epicyon.css'): + css_filename = base_dir + '/epicyon.css' + + instance_title = \ + get_config_param(base_dir, 'instanceTitle') + manual_form = \ + html_header_with_website_markup(css_filename, instance_title, + http_prefix, domain_full, + system_language) + manual_form += \ + '
' + manual_text + '
' + if onion_domain: + manual_form += \ + '
\n' + \ + '

' + \ + 'http://' + onion_domain + '

\n
\n' + if admin_nickname: + admin_actor = '/users/' + admin_nickname + manual_form += \ + '
\n' + \ + '

' + \ + translate['Administered by'] + ' ' + admin_nickname + '. ' + \ + translate['Version'] + ' ' + __version__ + \ + '

\n
\n' + manual_form += html_footer() + return manual_form