From 24e9ec6e752145141348dffc24e99395005b1a89 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Fri, 26 Jun 2020 11:01:56 +0200 Subject: [PATCH] adjust doc for 0.98 release --- README.html | 4 ++-- README.md | 4 ++-- README.txt | 5 ++--- doc/0_install.md | 40 ++++++++++++++++++++++++++++++++-------- 4 files changed, 38 insertions(+), 15 deletions(-) diff --git a/README.html b/README.html index 01a60c9..2cb58e7 100644 --- a/README.html +++ b/README.html @@ -90,7 +90,7 @@ Written by Drew (@topkecleon), Daniil Gentili (@danogentili), and Kay M (@gnadel

Contributions by JuanPotato, BigNerd95, TiagoDanin, and iicc1.

Released to the public domain wherever applicable. Elsewhere, consider it released under the WTFPLv2.

Prerequisites

-

Uses JSON.sh and the magic of (gnu) sed.

+

Uses JSON.sh and the magic of sed.

Even bashbot is written in bash, it depends on commands typically available in a Unix/Linux Environment. More concret on the common commands provided by recent versions of coreutils, busybox or toybox, see Developer Notes

Note for MacOS and BSD Users: As bashbot heavily uses modern bash and (gnu) grep/sed features, bashbot will not run without installing additional software, see Install Bashbot

Bashbot Documentation and Downloads are available on www.github.com

@@ -257,6 +257,6 @@ It features background tasks and interactive chats, and can serve as an interfac

@Gnadelwartz

That's it!

If you feel that there's something missing or if you found a bug, feel free to submit a pull request!

-

$$VERSION$$ v0.98-pre-3-g0f24eb8

+

$$VERSION$$ v0.962-88-g5afe05a

diff --git a/README.md b/README.md index 4920d50..7c886cc 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Released to the public domain wherever applicable. Elsewhere, consider it released under the [WTFPLv2](http://www.wtfpl.net/txt/copying/). ## Prerequisites -Uses [JSON.sh](http://github.com/dominictarr/JSON.sh) and the magic of (gnu) sed. +Uses [JSON.sh](http://github.com/dominictarr/JSON.sh) and the magic of sed. Even bashbot is written in bash, it depends on commands typically available in a Unix/Linux Environment. More concret on the common commands provided by recent versions of [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), see [Developer Notes](doc/7_develop.md#common-commands) @@ -239,4 +239,4 @@ wget -t 1 -T 10 https://api.telegram.org/bot If you feel that there's something missing or if you found a bug, feel free to submit a pull request! -#### $$VERSION$$ v0.98-pre-3-g0f24eb8 +#### $$VERSION$$ v0.962-88-g5afe05a diff --git a/README.txt b/README.txt index e955d4c..c52e630 100644 --- a/README.txt +++ b/README.txt @@ -13,8 +13,7 @@ Elsewhere, consider it released under the [WTFPLv2](http://www.wtfpl.net/txt/copying/). ## Prerequisites -Uses [JSON.sh](http://github.com/dominictarr/JSON.sh) and the magic of (gnu) -sed. +Uses [JSON.sh](http://github.com/dominictarr/JSON.sh) and the magic of sed. Even bashbot is written in bash, it depends on commands typically available in a Unix/Linux Environment. @@ -328,4 +327,4 @@ failed: Connection timed out. If you feel that there's something missing or if you found a bug, feel free to submit a pull request! -#### $$VERSION$$ v0.98-pre-3-g0f24eb8 +#### $$VERSION$$ v0.962-88-g5afe05a diff --git a/doc/0_install.md b/doc/0_install.md index adce11d..672e43b 100644 --- a/doc/0_install.md +++ b/doc/0_install.md @@ -39,7 +39,7 @@ As an alternative to download the zip files, you can clone the github repository 4. Extract all files to your existing bashbot dir 5. Run ```sudo ./bashbot.sh init``` to setup your environment after the update -If you modified ```commands.sh``` move your changes to ```mycommands.sh```, this avoids overwrrite of you changes on updates. +If you modified ```commands.sh``` move your changes to ```mycommands.sh```, this avoids overwriting your commands on update. Now you can restart your bashbot instances. @@ -48,22 +48,46 @@ Now you can restart your bashbot instances. **On MacOS** you must install a more recent version of bash, as the default bash is way to old, see e.g. [Install Bash on Mac](http://macappstore.org/bash/) -**On BSD and MacOS** I recommend to install gnu coreutils and include them in front of your PATH +**On BSD and MacOS** I recommend to install gnu coreutils and include them in your PATH environment variable before running bashbot, e.g. the gnu versions of sed, grep, find ... +On BSDand MacOS you must adjust the shebang line of the scripts ```bashbot.sh``` and ```json.sh``` to point to to the correct bash +or use the script: ```examples/bash2env *.sh */*.sh``` to convert them for you. + +Bashbot will stay with /bin/bash shebang, as using a fixed path is more secure than the portable /usr/bin/env variant, see +[Security Considerations](../README.md#Security-Considerations) + I considered to make bashbot BSD sed compatible, but much of the bashbot "magic" relies on (gnu) sed features, e.g. alternation ```|```, non printables ```\n\t\<``` or repeat ```?+``` pattern, not supported by BSD sed. BSD/MacOS sed compatibility will result in a rewrite of all grep/sed commands with an uncertain outcome, see [BSD/MacOS vs. GNU sed](https://riptutorial.com/sed/topic/9436/bsd-macos-sed-vs--gnu-sed-vs--the-posix-sed-specification) to get an impression how different they are. -In adition you must adjust the shebang line of the scripts ```bashbot.sh``` and ```json.sh``` to point to to the correct bash -or use the example script: ```examples/bash2env *.sh */*.sh``` +If you are a sed guru and can convert the following examples to work correct with gnu and BSD sed, contact me. -Bashbot will stay with /bin/bash shebang, as using a fixed path is more secure than the portable /usr/bin/env variant, see -[Security Considerations](../README.md#Security-Considerations) +```bash + # easy start + sed -n -e '0,/\['"$1"'\]/ s/\['"$1"'\][ \t]\([0-9.,]*\).*/\1/p' + OUT="$(sed -e ':a;N;$!ba;s/\r\n/ mynewlinestartshere /g' <<<"$1"| iconv -f utf-8 -t utf-8 -c)" -### Notes on Updates + # more complex + address="$(sed <<< "${2}" '/myaddressstartshere /!d;s/.*myaddressstartshere //;s/ *my[nkfltab][a-z]\{2,13\}startshere.*//;s/ *mykeyboardendshere.*//')" + + # for experts? + source <( printf "$1"'=( %s )' "$(sed -E -n -e ':x /"text"\]/ { N; s/([^"])\n/\1\\n/g ; tx }' -e '/\["[-0-9a-zA-Z_,."]+"\]\+*\t/ s/\t/=/gp' -e 's/=(true|false)/="\1"/')" ) +``` + +### Notes per Version + +#### Change in storing config values + +Up to version 0.94 bashbot stores config values as values in ```token```, ```botadmin``` and ```count```. Since version 0.96 bashbot +uses jsonDB key/value store. Config is stored in ```botconfig.jssh```, counting of users is done in ```count.jssh```. +The acl file ```botacl``` stay as is. On first run of bashbot.sh after an update bashbot converts bashbot converts +the files to the new config format. Afterwards the files ```token```, ```botadmin``` and ```count``` can be deleted. + +You may notice the new file ```blocked.jssh```, every telegram user and chat id stored ihere will be blocked from +using your bot. #### removal of TMUX From version 0.80 on TMUX is no longer needed and the bachsbot command 'attach' is deleted. Old function 'inproc' @@ -107,5 +131,5 @@ The old format is supported for backward compatibility, but may fail for corner #### [Next Create Bot](1_firstbot.md) -#### $$VERSION$$ v0.98-dev-70-g694ee61 +#### $$VERSION$$ v0.962-88-g5afe05a