Installation - xnamed/isida4 GitHub Wiki
Installation
Requirements
Everything is pretty much simple.
The following programs are required for isida installation:
- python >= 2.7 < 3.x
- git-core >= 1.7.1 or subversion* >= 1.6.12
- postgresql >= 8.4 or mysql* >= 5.1
- openssl >= 1.0.0e
- python-psycopg2 >= 2.4.2 or mysqldb-python* (libpq-dev and python-dev may also be additionally required)
- python-crontab >= 0.12
- pysqlite3 from the current pyton distribution
This option is not recommended
Example of how to build an install python:
... # build and install the dependencies first
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar xjf Python-2.7.3.tar.bz2
cd Python-2.7.3
./configure && make -j4 && sudo checkinstall
Before trying to build python you have to install its dependencies
Warning!
- Some FreeBSD builds have a pared-down version of python with pared-down sqlite3. If this is your case, you'll have to install py-sqlite3 from ports.
- To build Python under FreeBSD apply this patch first
- Bot only works with Python 2.7
- In order for bot to fully work a Linux/BSD system is required. Other options are not supported.
Bot install
git clone git://github.com/xnamed/isida3.git isida
A folder named isida will be created containing the latest version of bot's source code.
Setting up bot
In isida/settings folder copy demo_config.py to config.py and edit it:
Settings = {
'nickname': u'<bot nickname goes here>', # Bot's nickname
'jid': u'[email protected]/isida-bot', # Bot's JID
'password': u'********', # Password
'status': u'online', # Bot's status chat|online|away|xa|dnd
'priority': 0, # Priority
'message': u'I am an infernal piece of software'} # Status message
SuperAdmin = u'[email protected]' # Bot's owner JID
defaultConf = u'[email protected]' # Start-up conference
prefix = u'_' # Default prefix for commands
msg_limit = 2048 # Message length limit
The following additional settings might help if you need to debug the bot. (The listed below values are the defaults for regular bot functioning)
#ignore_owner = True # Do not execute the disabled commands for bot owner
#halt_on_exception = True # Exit bot's process when getting an exception
#debug_xmpppy = True # xmpppy debug mode
#debug_console = True # printing bot actions in the console mode
#database_debug = True # PostgreSQL debug mode
CommandsLog = True # Logging bot's commands
#thread_type = None # Threads type: thread/threading. Default value is threading
#ENABLE_TLS = False # Forced TLS deactivating
Database settings:
base_type = 'pgsql' # DB type: pgsql, mysql, sqlite3
base_name = 'isidabot' # DB name
base_user = 'isidabot' # DB user
base_host = 'localhost' # DB host
base_pass = '******' # DB password
base_port = '5432' # Connection port. Default for postgresql is 5432, for mysql 3306
Do not change other settings in bot's config, unless you're sure what they do.
Warning! Some versions of mysqldb-python require port to be set as integer value (i.e. without quotes). Example:
base_port = 3306
Warning! SQLite3 and MySQL modes are currently being tested. Different problems might exist. Bug reports on these modes are welcome.
Warning! Many bot settings are available via ad-hoc commands or via service discovery.
Preparations required to run bot
You have to follow these steps in order to set up bot running:
- Create the database in PostgreSQL, MySQL or SQLite3;
- Import database dump to PostgreSQL, MySQL or SQLite3.
Preparations for PostgreSQL:
su postgres # change user to postgres
createuser -P isidabot # create a user having password
createdb isidabot -E UTF8 -T template0 # create a database having UTF8 encoding from template template0
psql -U isidabot isidabot -f scripts/pgsql.schema # create tables and indexes
psql -U isidabot isidabot -f data/db/defcodes.dump # import database dumps
psql -U isidabot isidabot -f data/db/dist.dump
psql -U isidabot isidabot -f data/db/gis.dump
psql -U isidabot isidabot -f data/db/wz.dump
psql -U isidabot isidabot -f data/db/ru_alias.dump # import dump with global aliases in Russian if needed
exit # back to bot use
Important! After creating the database and importing dumps it is advisable to clean the database from duplicates using the following command:
psql -U isidabot isidabot -f pgsql_remove_duplicates.schema
Important! If you're getting authentication error when trying to connect to PostgreSQL checkout F.A.Q. page
Preparations for SQLite3:
cat scripts/sqlite3.schema | sqlite3 data/sqlite3.db # create tables and indexes
cat data/db/defcodes.dump | sqlite3 data/sqlite3.db # import database dumps
cat data/db/dist.dump | sqlite3 data/sqlite3.db
cat data/db/gis.dump | sqlite3 data/sqlite3.db
cat data/db/wz.dump | sqlite3 data/sqlite3.db
cat data/db/ru_alias.dump | sqlite3 data/sqlite3.db # import dump with global aliases in Russian if needed
Preparations for MySQL:
mysql -u isidabot
SOURCE scripts/mysql.schema # create tables and indexes
SOURCE data/db/defcodes.dump # import database dumps
SOURCE data/db/dist.dump
SOURCE data/db/gis.dump
SOURCE data/db/wz.dump
SOURCE data/db/ru_alias.dump # import dump with global aliases in Russian if needed
Running the bot
cd isida
sh launch.sh &
Warning! Notice the & symbol in the launch command
Troubleshooting
Most problems can be solved after reading wiki and updating bot to the latest revision ;)
You can update by executing the following command in the bot folder:
git pull
When version number is changed, e.g. from X.Y to X.Y+1, it's obligatory to read the wiki before updating!!!