forked from eppye-bots/bots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
138 lines (104 loc) · 4.94 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Bots sourceforge web site: http://bots.sourceforge.net
Wiki/documentation: http://http://bots.readthedocs.io
Wiki/documentation: http://skilchen.github.io/bots_doc_b/
Bots is licenced under GNU GENERAL PUBLIC LICENSE Version 3; for full text: http://www.gnu.org/copyleft/gpl.html
Commercial support by EbberConsult, http://www.ebbersconsult.com
To make bots a little more modern I upgraded the user interface and all other packages to be current versions.
Tested on Centos 8 server running:
-Python version 3.8.0
-Django version (3, 0, 8, 'final', 0)
-CherryPy version 18.6.0
Therefor this version is called Bots 3.8
install on Linux:
python3 setup_rpm.py install
pip3 install -r requirements.txt
setup database SQLite in:
/bots/config/settings.py
mkdir /usr/local/lib/python3.8/site-packages/bots/botssys/sqlitedb
cp /usr/local/lib/python3.8/site-packages/bots/install/botsdb /usr/local/lib/python3.8/site-packages/bots/botssys/sqlitedb/botsdb
If you are migrating from old bots version you need to update your databasefile. For sqllite use for example https://sqlitebrowser.org/dl/
Since Django 1.8 AbstractUser.last_login allows null values, so whe need to update the database.
go to auth_user table and modify the tabel go to last_login an remove the Not Null (NN) and press ok. then its saved.
Test bots engine:
bots-engine.py
==Full install instruction Redhat 3.8==
#during install of redhat i created a user ediflex
#install all packeages neede to install latest version of python.
dnf install git make gcc gcc-c++ openssl-devel libffi-devel sqlite-devel
cd /home/ediflex/
git clone https://github.com/bjorns163/bots
cd /tmp/
wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz
tar xzf Python-3.10.0.tgz
cd Python-3.10.0/
sudo ./configure --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions
sudo make -j ${nproc}
sudo make altinstall
#test python
python3.10 -V
pip3.10 -V
##clean up
cd /tmp/
rm -rf Python-3.10.0/
rm -f Python-3.10.0.tgz
#optional
#link command python / pip and python3 / pip3 to this version of python and pip
sudo ln -fs /usr/local/bin/python3.10 /usr/bin/python
sudo ln -fs /usr/local/bin/python3.10 /usr/bin/python3
sudo ln -fs /usr/local/bin/pip3.10 /usr/bin/pip
sudo ln -fs /usr/local/bin/pip3.10 /usr/bin/pip3
cd /home/ediflex/bots/
python3 setup_rpm.py install
#test bots
bots-engine.py
#if all goes well you will see:
INFO served at port: "9000".
INFO platform: "Linux-4.18.0-348.el8.x86_64-x86_64-with-glibc2.28".
INFO machine: "x86_64".
INFO python version: "3.10.0".
INFO django version: "(3, 0, 8, 'final', 0)".
INFO bots version: "3.8.0".
INFO bots installation path: "/usr/local/lib/python3.10/site-packages/bots".
INFO config path: "/usr/local/lib/python3.10/site-packages/bots/config".
INFO botssys path: "/usr/local/lib/python3.10/site-packages/bots/botssys".
INFO usersys path: "/usr/local/lib/python3.10/site-packages/bots/usersys".
INFO DATABASE_ENGINE: "django.db.backends.sqlite3".
INFO DATABASE_NAME: "/usr/local/lib/python3.10/site-packages/bots/botssys/sqlitedb/botsdb".
INFO DATABASE_USER: "".
INFO DATABASE_HOST: "".
INFO DATABASE_PORT: "".
INFO DATABASE_OPTIONS: "{}".
INFO Connected to database.
INFO This run is an acceptance test - as indicated in option "runacceptancetest" in bots.ini.
INFO In acceptance test there is no script file "bots_acceptancetest.py" to check the results of the acceptance test.
INFO Run "new".
INFO Run active routes from database that are in default run: "[]".
INFO Bots Report; type: new, time: 2021-11-23 16:16:46
0 files received/processed in run.
0 files send in run.
#now check if webserver will run
/usr/local/bin/bots-webserver.py
#if you get this all is working:
20211123 16:19:28 STARTINFO: Bots webserver started.
20211123 16:19:28 STARTINFO: Bots webserver configdir: "/usr/local/lib/python3.10/site-packages/bots/config".
20211123 16:19:28 STARTINFO: Bots webserver serving at port: "9000".
20211123 16:19:28 STARTINFO: Bots webserver uses plain http (no ssl).
#configure the port number:
vim /usr/local/lib/python3.10/site-packages/bots/config/bots.ini
[webserver]
#webserver in development or production. default is production
environment = production
#port at which at bots-gui is server. default is 8080
port = 8080
#open this port in the firewall:
firewall-cmd --zone=public --permanent --add-port 8080/tcp
firewall-cmd --reload
#run the webserver again and its up and running.
/usr/local/bin/bots-webserver.py
#check your ip if you get login page.
http://192.168.70.2:8080/
#make bots webserver run automaticly on boot and let bots run every 30 seconds
crontab -e
@reboot sleep 5 && /usr/local/bin/bots-webserver.py
*/1 * * * * /usr/local/bin/bots-engine.py
*/1 * * * * ( sleep 30 ; /usr/local/bin/bots-engine.py)