From b5aff67712ae7fb4f1d20e85ca46db3de7afe344 Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Sun, 25 Jul 2021 00:44:01 +0500 Subject: [PATCH] Write the Telegram help article --- help/en/telegram.myco | 39 +++++ help/en/whitelist.myco | 2 + views/stuff.qtpl | 21 +-- views/stuff.qtpl.go | 325 ++++++++++++++++++++--------------------- 4 files changed, 207 insertions(+), 180 deletions(-) create mode 100644 help/en/telegram.myco diff --git a/help/en/telegram.myco b/help/en/telegram.myco new file mode 100644 index 0000000..e396b51 --- /dev/null +++ b/help/en/telegram.myco @@ -0,0 +1,39 @@ +# Telegram authorization +//This article is intended for wiki administrators.// + +If you want, you can let users log in to your wiki using **Telegram**. + +Telegram is a proprietary messaging application used by half a billion people. Learn more at [[https://telegram.org]]. + +## Setting up Telegram integration +In order to enable Telegram authorization, you need to create a Telegram bot and link it with your wiki. + +### Creating a bot +Open the chat with [[https://t.me/botfather | @BotFather]], the bot for creating other bots. Create a new bot there. You will need the bot username and token later. You can set the bot's userpic. It would be great if it matches your wiki's logo. + +After creating the bot, send the `/setdomain` command and then send your wiki's domain. + +You do not need to actually //host// the bot. It is enough for it just to be created in BotFather. You can also reuse a previously existing bot. + +### Configuring +In `config.ini`, in `[Telegram]` section, fill in the bot's username (without @) and token: + +``` +[Telegram] +TelegramBotName = your_bot +TelegramBotToken = 0000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +``` + +Reload the wiki. + +If both fields are both set, the engine will enable Telegram authorization. + +## Using +On login and register pages there is a blue button. If a user clicks it, they are prompted to give the authorization permission to your bot. The user's @username will be used as wiki username. Telegram users are part of the //editor// user group by default. Telegram users can use the wiki just like everyone else. + +## Limitations +* Telegram does not support HTTP wikis, you //must// use HTTPS. +** One way of setting up HTTPS is using [[https://certbot.eff.org | certbot]] and a reverse proxy such as [[https://nginx.org | nginx]]. +* Telegram users without @username cannot authorize. +* Telegram users with usernames that are already taken on the wiki cannot authorize. +* Overall, this is an experimental feature. Use on your own risk. diff --git a/help/en/whitelist.myco b/help/en/whitelist.myco index 7190d7e..8f5258f 100644 --- a/help/en/whitelist.myco +++ b/help/en/whitelist.myco @@ -1,4 +1,6 @@ # Whitelist +//This article is intended for wiki administrators.// + If you want to limit what people can authorize to your wiki, you may want to use the **whitelist**. In `config.ini`, in the `[Authorization]` section, enable the white list in `UseWhiteList` and list all allowed usernames in the `WhiteList` field separated by comma: diff --git a/views/stuff.qtpl b/views/stuff.qtpl index 84be5d1..94bbd0e 100644 --- a/views/stuff.qtpl +++ b/views/stuff.qtpl @@ -141,23 +141,16 @@ It outputs a poorly formatted JSON, but it works and is valid.