1

Update readmes about runtime environment

This commit is contained in:
eleksir
2022-01-29 18:07:03 +03:00
parent e552ecbf00
commit c9e664b4e5
2 changed files with 71 additions and 93 deletions

View File

@@ -2,35 +2,31 @@
## Disclaimer
This version - 3 (something) - considered stable. It means that further
development of new features kind of frosen. Most effort will be targeted to
future 4-th version development. If you have some ideas or fixes to this version
This version - 3 (something) - considered stable. It means that further development of new features kind of frosen.
Most effort will be targeted to future 4-th version development. If you have some ideas or fixes to this version
feel free PR them, they will be merged as soon as being reviewed.
## About
It is based on Perl modules [Telegram::Bot][1] and [Hailo][2] as conversation
generator.
It is based on Perl modules [Telegram::Bot][1] and [Hailo][2] as conversation generator.
I have to fork [Telegram::Bot][1] and update it according to features appeared
in [Telegram Bot API v5][3]. Also, I decide to rename it to avoid collision in
the future, now it is Teapot::Bot and is bundled with bot. When lib becomes
I have to fork [Telegram::Bot][1] and update it according to features appeared in [Telegram Bot API v5][3]. Also,
I decide to rename it to avoid collision in the future, now it is Teapot::Bot and is bundled with bot. When lib becomes
mature enough, maybe I release it separately.
Bot config located in **data/config.json**, sample config provided as
**data/sample_config.json**.
Bot config located in **data/config.json**, sample config provided as **data/sample_config.json**.
Bot can be run via **bin/aleesa-telegram-bot** and acts as daemon (double fork()
and detaches stdio).
Bot can be run via **bin/aleesa-telegram-bot** and acts as daemon (double fork() and detaches stdio).
## Installation
In order to run this application, you need to "bootstrap" it - download and build
all required dependencies and libraries.
Application have been tested on alpine linux x86_64 3.12, with perl-5.32.1 builtin.
You'll need perl-5.18 or newer, "Development Tools" or similar group of
packages, perl, perl-devel, perl-local-lib, perl-app-cpanm, sqlite-devel,
zlib-devel, openssl-devel, libdb4-devel (Berkeley DB devel), make.
In order to run this application, you need to "bootstrap" it - download and build all required dependencies and
libraries.
You'll need perl-5.18 or newer, "Development Tools" or similar group of packages, perl, perl-devel, perl-local-lib,
perl-app-cpanm, sqlite-devel, zlib-devel, openssl-devel, libdb4-devel (Berkeley DB devel), make.
After installing required dependencies it is possible to run:
@@ -44,56 +40,49 @@ and all libraries should be downloaded, built, tested and installed.
## Running
This bot does not [ultilize][4] webhooks, so in order to run it only well
internet connection is required, no public-available ip address is needed.
This bot does not [ultilize][4] webhooks, so in order to run it only well internet connection is required, no
public-available ip address is needed.
### Additional Settings to be performed in order to run bot as it designed
There are some "plugins" that requires registration on third party services
and API keys and secrets in order to work.
There are some "plugins" that requires registration on third party services and API keys and secrets in order to work.
#### OpenWeatherMap
You should [register][5], [login][6] and [create][7] api key. Free plan have
all required features to run this "plugin".
You should [register][5], [login][6] and [create][7] api key. Free plan have all required features to run this "plugin".
Once key is created you should put it in **config.json** under openweathermap
section as appid. Thats it.
Once key is created you should put it in **config.json** under openweathermap section as appid. Thats it.
It is still impossible to disable this plugin, but "I'm working on it".
#### Imgur
This plugin "just exists" and is actually used nowhere around the code.
Anyway, to make use of it besides registering appropriate handler in code, you
should sign in imgur and get access token.
This plugin "just exists" and is actually used nowhere around the code. Anyway, to make use of it besides registering
appropriate handler in code, you should sign in imgur and get access token.
Actually at this time this "plugin" can be stub-ed with default config values.
Anyway, to fetch access token you should [login][8] and perform [registration][9]
of your app. Then you should authorize your app according to [this][10] manual. Or
[this][11] one.
Anyway, to fetch access token you should [login][8] and perform [registration][9] of your app. Then you should
authorize your app according to [this][10] manual. Or [this][11] one.
#### Flickr
This "plugin" is really used to implement random picture link retrival plugins.
There is helper script in **bin/flickr_init.pl** that helps to get all required keys
and secrets from flickr api.
There is helper script in **bin/flickr_init.pl** that helps to get all required keys and secrets from flickr api.
Before using it bot must be bootstrapped via **`bootstrap.sh`**.
[Login][11] and create an [app][12] in your flickr account. Then *logout* flickr account.
(It is required in order to properly get "verifier" parameter later).
[Login][11] and create an [app][12] in your flickr account. Then *logout* flickr account. (It is required in order to
properly get "verifier" parameter later).
Put your [app key and secret][13] to **config.json**. Ensure that "verifier" parameter
in Flickr-related part of config either absent or commented out.
Put your [app key and secret][13] to **config.json**. Ensure that "verifier" parameter in Flickr-related part of config
either absent or commented out.
Run **bin/flickr_init.pl** first time and follow on screen instructions - copy and
paste given link to browser login to flickr account and you'll be redirected to
example.com. Check address bar in browser to get so-called "verifier", put it in
**config.json**. Then run **bin/flickr_init.pl** again to store API access token in db
under data/image directory (in default config). You're done.
Run **bin/flickr_init.pl** first time and follow on screen instructions - copy and paste given link to browser login to
flickr account and you'll be redirected to example.com. Check address bar in browser to get so-called "verifier", put
it in **config.json**. Then run **bin/flickr_init.pl** again to store API access token in db under data/image directory
(in default config). You're done.
[1]: https://metacpan.org/pod/Telegram::Bot
[2]: https://metacpan.org/pod/Hailo