Commit bad7dd3c authored by Dmitry Shelepnev's avatar Dmitry Shelepnev
Browse files

Update README

parent 797cbd95
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -72,6 +72,25 @@ is one-user. Therefore, until the scanning process is completed, the attempts to
"A server error occurred." Please contact the administrator. "
To eliminate this problem, you need to use multi-user databases, for example MYSQL.

1.10 If necessary, configure and run Telegram-bot

The process of creating bots in telegrams is very simple, to create your bot in Telegram, you need to connect to
channel [@BotFather] (https://telegram.me/botfather) and give the command to create a new bot **/newbot**. Then enter the name of the bot
(for example: **myopds**), and then the user name for this bot, which necessarily ends with "bot" (for example: **myopds_bot**).
As a result, you will be given API_TOKEN, which you need to use in the following commands that will start your personal
telegram-bot, which will allow you, using the Telegram instant messenger to get quick access to your personal library.

    python3 manage.py sopds_util setconf SOPDS_TELEBOT_API_TOKEN "<Telegram API Token>"
    python3 manage.py sopds_util setconf SOPDS_TELEBOT_AUTH False
    python3 manage.py sopds_telebot start --daemon
    
Team,

    python3 manage.py sopds_util setconf SOPDS_TELEBOT_AUTH True
    
you can limit the use of your bot by Telegram users. In this case, your bot will serve only those
users whose name in the telegram matches the existing user name in your Simple OPDS database.

#### 2. Configuring the MySQL database (optional, but very desirable for increasing performance).
2.1 To work with a large number of books, it is highly advisable not to use sqlite, but to configure MySQL databases to work. MySQL is much faster than sqlite. In addition, SQLite is a single-user database, i.e. during scanning access to a DB it will be impossible.

@@ -366,3 +385,12 @@ an extraordinary scan of the collection will be launched, and the specified flag

**SOPDS_CACHE_TIME** - Pages cache time
(default is SOPDS_CACHE_TIME = 1200)

**SOPDS_TELEBOT_API_TOKEN** - API TOKEN for Telegram Bot

**SOPDS_TELEBOT_AUTH** - If True, the Bot will grant access to the library, only to users whose name in the Telegram matches the name
existing user in the Simple OPDS database.
(by default SOPDS_TELEBOT_AUTH = True)

**SOPDS_TELEBOT_MAXITEMS** - The maximum number of simultaneously displayed items in the Telegram message
(by default SOPDS_TELEBOT_MAXITEMS = 10)
+31 −4
Original line number Diff line number Diff line
@@ -49,9 +49,6 @@

	python3 manage.py sopds_server start --daemon
	
Однако наилучшим способом, все же является настройка в качестве HTTP/OPDS серверов Apache или Nginx 
(точка входа ./sopds/wsgi.py)
	
1.8 Чтобы не дожидаться начала сканирования по расписанию, можно сообщить процессу sopds_scanner о необходимости
    немедленного сканирования. Сделать это можно, установив конфигурационный параметр SOPDS_SCAN_START_DIRECTLY = True 
    двумя способами:
@@ -75,6 +72,29 @@
"A server error occurred.  Please contact the administrator."  
Для устранения указанной проблемы необходимо ипользовать многопользовательские БД, Например MYSQL.

1.10 При необходимости настраиваем и запускаем Telegram-бот    

Процесс создания ботов в телеграм очень прост, для создания своего бота в мессенджере Telegram необходимо подключиться к
каналу [@BotFather](https://telegram.me/botfather) и дать команду создания нового бота **/newbot**. После чего ввести имя бота 
(например: **myopds**), а затем имя пользователя для этого бота, обязательно заканчивающегося на "bot" (например: **myopds_bot**).
В результате, вам будет выдан API_TOKEN, который нужно использовать в следующих командах, которые запустят Вашего личного 
телеграм-бота, который позволит Вам, используя мессенджер Telegram получать быстрый доступ к личной библиотеке.    

    python3 manage.py sopds_util setconf SOPDS_TELEBOT_API_TOKEN  "<Telegram API Token>"
    python3 manage.py sopds_util setconf SOPDS_TELEBOT_AUTH False
    python3 manage.py sopds_telebot start --daemon
    
Командой,    

    python3 manage.py sopds_util setconf SOPDS_TELEBOT_AUTH True
    
можно ограничить использование Вашего бота пользователями Telegram. В этом случае Ваш бот будет обслуживать запросы только таких 
пользователей, чье имя в telegram совпадает с существующим имененм пользователей в вашей БД Simple OPDS.
    
	
Однако наилучшим способом, все же является настройка в качестве HTTP/OPDS серверов Apache или Nginx 
(точка входа ./sopds/wsgi.py)
	
#### 2. Настройка базы данных MySQL (опционально, но очень желательно для увеличения производительности).
2.1 Для работы с большим количеством книг, очень желательно не использовать sqlite, а настроить для работы БД MySQL.
MySQL по сравнению с sqlite работает гораздо быстрее. Кроме того SQLite - однопользователская БД, т.е. во время сканирования доступ
@@ -379,5 +399,12 @@ MySQL по сравнению с sqlite работает гораздо быст
запустится внеочередное сканированеи коллекции, а указаный флаг вновь сброситься в False.

**SOPDS_CACHE_TIME** - Время хранения страницы в кэше
(default is SOPDS_CACHE_TIME = 1200)
(по умолчанию SOPDS_CACHE_TIME = 1200)

**SOPDS_TELEBOT_API_TOKEN** - API TOKEN для Telegram Бота
**SOPDS_TELEBOT_AUTH** - Если True, то Бот будет предоставлять доступ к библиотеке, только пользователям, чье имя в Telegram совпадает с именем
существующего пользователя в БД Simple OPDS.
(по умолчанию SOPDS_TELEBOT_AUTH = True)

**SOPDS_TELEBOT_MAXITEMS** - Максимальное число одновременно выводимых элеменов в сообщении Telegram
(по умолчанию SOPDS_TELEBOT_MAXITEMS = 10)
 No newline at end of file