add documentaion and ENV for wget and Telegram URL

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2019-05-14 19:58:59 +02:00
parent aacdc76af2
commit eb0cde55df
5 changed files with 39 additions and 19 deletions

View File

@ -18,7 +18,7 @@
<p>Released to the public domain wherever applicable. Elsewhere, consider it released under the <a href="http://www.wtfpl.net/txt/copying/">WTFPLv2</a>.</p>
<h2 id="prerequisites">Prerequisites</h2>
<p>Depends on <a href="http://github.com/tmux/tmux">tmux</a>. Uses <a href="http://github.com/dominictarr/JSON.sh">JSON.sh</a>.</p>
<p>Most complete <a href="doc/4_expert.md#Bashbot-UTF-8-Support">UTF-8 support for bashbot</a> is availible if phyton is installed (optional).</p>
<p>Even bashbot is written in bash, it depends on commands typically availible in a Unix/Linux Environment. More concret on the command set provided by <a href="https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands">coreutils</a>, <a href="https://en.wikipedia.org/wiki/BusyBox#Commands">busybox</a> or <a href="https://landley.net/toybox/help.html">toybox</a>.</p>
<p>Bashbot <a href="https://github.com/topkecleon/telegram-bot-bash">Documentation</a> and <a href="https://github.com/topkecleon/telegram-bot-bash/releases">Downloads</a> are availible on www.github.com</p>
<h2 id="documentation">Documentation</h2>
<ul>
@ -106,6 +106,6 @@
<p><span class="citation">@Gnadelwartz</span></p>
<h2 id="thats-it">Thats it!</h2>
<p>If you feel that theres something missing or if you found a bug, feel free to submit a pull request!</p>
<h4 id="version-v0.80-dev2-5-gd08d912"><br /><span class="math display"><em>V</em><em>E</em><em>R</em><em>S</em><em>I</em><em>O</em><em>N</em></span><br /> v0.80-dev2-5-gd08d912</h4>
<h4 id="version-v0.80-dev2-14-gaacdc76"><br /><span class="math display"><em>V</em><em>E</em><em>R</em><em>S</em><em>I</em><em>O</em><em>N</em></span><br /> v0.80-dev2-14-gaacdc76</h4>
</body>
</html>

View File

@ -12,7 +12,9 @@ Elsewhere, consider it released under the [WTFPLv2](http://www.wtfpl.net/txt/cop
Depends on [tmux](http://github.com/tmux/tmux).
Uses [JSON.sh](http://github.com/dominictarr/JSON.sh).
Most complete [UTF-8 support for bashbot](doc/4_expert.md#Bashbot-UTF-8-Support) is availible if phyton is installed (optional).
Even bashbot is written in bash, it depends on commands typically availible in a Unix/Linux Environment.
More concret on the command set provided by [coreutils](https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands), [busybox](https://en.wikipedia.org/wiki/BusyBox#Commands) or [toybox](https://landley.net/toybox/help.html).
Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Downloads](https://github.com/topkecleon/telegram-bot-bash/releases) are availible on www.github.com
@ -105,4 +107,4 @@ Well, thats a damn good question ... may be because I'm an Unix/Linux admin from
If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
#### $$VERSION$$ v0.80-dev2-5-gd08d912
#### $$VERSION$$ v0.80-dev2-14-gaacdc76

View File

@ -14,9 +14,13 @@ Elsewhere, consider it released under the
Depends on [tmux](http://github.com/tmux/tmux).
Uses [JSON.sh](http://github.com/dominictarr/JSON.sh).
Most complete [UTF-8 support for
bashbot](doc/4_expert.md#Bashbot-UTF-8-Support) is availible if phyton is
installed (optional).
Even bashbot is written in bash, it depends on commands typically availible in
a Unix/Linux Environment.
More concret on the command set provided by
[coreutils](https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands),
[busybox](https://en.wikipedia.org/wiki/BusyBox#Commands) or
[toybox](https://landley.net/toybox/help.html).
Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and
[Downloads](https://github.com/topkecleon/telegram-bot-bash/releases) are
@ -148,4 +152,4 @@ health status
If you feel that there's something missing or if you found a bug, feel free to
submit a pull request!
#### $$VERSION$$ v0.80-dev2-5-gd08d912
#### $$VERSION$$ v0.80-dev2-14-gaacdc76

View File

@ -12,7 +12,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ v0.80-dev2-13-gbce7f1a
#### $$VERSION$$ v0.80-dev2-14-gaacdc76
#
# Exit Codes:
# - 0 sucess (hopefully)
@ -110,7 +110,7 @@ fi
BOTTOKEN="$(< "${TOKENFILE}")"
URL='https://api.telegram.org/bot'$BOTTOKEN
URL="${BASHBOT_URL:-https://api.telegram.org/bot}${BOTTOKEN}"
ME_URL=$URL'/getMe'

View File

@ -48,17 +48,31 @@ Full path to JSON.sh script, default: './JSON.sh/JSON.sh', must end with '/JSON.
### Change config values
#### BASHBOT_DECODE
Bashbot offers two variants for decoding JSON UTF format to UTF-8. By default bashbot uses 'json.encode' if python is installed.
If 'BASHBOT_DECODE' is set to any value (not undefined or not empty) the bash only implementation will be used.
```bash
unset BASHBOT_DECODE # autodetect python (default)
export BASHBOT_DECODE "" # autodetect python
#### BASHBOT_URL
Uses given URL instead of offical telegram API URL, useful if you have your own telegram server or for testing.
```bash
unset BASHBOT_URL # use Telegram URL https://api.telegram.org/bot<token> (default)
export BASHBOT_URL "" # use use Telegram https://api.telegram.org/bot<token>
export BASHBOT_URL "https://my.url.com/bot" # use your URL https://my.url.com/bot<token>
export BASHBOT_DECODE "yes" # force internal
export BASHBOT_DECODE "no" # also force internal!
```
#### BASHBOT_TOKEN
#### BASHBOT_WGET
Bashbot uses ```curl``` to communicate with telegram server. if ```curl``` is not availible ```wget``` is used.
If 'BASHBOT_WGET' is set to any value (not undefined or not empty) wget is used even is curl is availible.
```bash
unset BASHBOT_WGET # use curl (default)
export BASHBOT_WGET "" # use curl
export BASHBOT_WGET "yes" # use wget
export BASHBOT_WGET "no" # use wget!
```
#### BASHBOT_SLEEP
Instead of polling permanently or with a fixed delay, bashbot offers a simple adaptive polling.
@ -117,5 +131,5 @@ for every poll until the maximum of BASHBOT_SLEEP ms.
#### [Prev Notes for Developers](7_develop.md)
#### $$VERSION$$ v0.80-dev2-1-g0b36bc5
#### $$VERSION$$ v0.80-dev2-14-gaacdc76