Changeset 153

Show
Ignore:
Timestamp:
04/09/07 14:07:57 (17 months ago)
Author:
smoku
Message:

Integrated full SQLite3 support for SM by Reinhard Max. Closes #43

Location:
trunk
Files:
1 added
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/c2s/authreg.c

    r144 r153  
    5050extern int ar_anon_init(authreg_t); 
    5151#endif 
     52#ifdef STORAGE_SQLITE 
     53extern int ar_sqlite_init(authreg_t); 
     54#endif 
    5255 
    5356char *module_names[] = { 
     
    7376    "anon", 
    7477#endif 
     78#ifdef STORAGE_SQLITE 
     79    "sqlite", 
     80#endif 
    7581    NULL 
    7682}; 
     
    97103#ifdef STORAGE_ANON 
    98104    ar_anon_init, 
     105#endif 
     106#ifdef STORAGE_SQLITE 
     107    ar_sqlite_init, 
    99108#endif 
    100109    NULL 
  • trunk/c2s/Makefile.am

    r77 r153  
    33bin_PROGRAMS = c2s 
    44 
    5 c2s_SOURCES = authreg.c authreg_anon.c authreg_db.c authreg_ldap.c authreg_mysql.c authreg_pam.c authreg_pgsql.c authreg_pipe.c bind.c c2s.c main.c sm.c 
     5c2s_SOURCES = authreg.c authreg_anon.c authreg_db.c authreg_ldap.c authreg_mysql.c authreg_pam.c authreg_pgsql.c authreg_pipe.c authreg_sqlite.c bind.c c2s.c main.c sm.c 
    66noinst_HEADERS = c2s.h 
    77 
  • trunk/etc/c2s.xml.dist.in

    r144 r153  
    388388    </pipe> 
    389389 
     390    <!-- SQLite driver configuration --> 
     391    <sqlite> 
     392      <!-- Database name --> 
     393      <dbname>@localstatedir@/jabberd/db/sqlite.db</dbname> 
     394 
     395      <!-- Transacation support. If this is commented out, transactions 
     396           will be disabled. This might make database accesses faster, 
     397           but data may be lost if jabberd crashes. --> 
     398      <transactions/> 
     399 
     400      <!-- SQLite busy-timeout in milliseconds. --> 
     401      <busy-timeout>2000</busy-timeout> 
     402    </sqlite> 
     403 
    390404  </authreg> 
    391405 
  • trunk/etc/sm.xml.dist.in

    r150 r153  
    146146    <sqlite> 
    147147      <!-- Database name --> 
    148       <dbname>/var/lib/jabberd/sm.db</dbname> 
     148      <dbname>@localstatedir@/jabberd/db/sqlite.db</dbname> 
    149149 
    150150      <!-- Transacation support. If this is commented out, transactions 
  • trunk/tools/db-setup.sqlite

    r106 r153  
     1-- 
     2-- This is the required schema for sqlite. 
     3-- 
     4--     sqlite jabberd2.db <  db-setup.sqlite 
     5-- 
     6 
     7-- 
     8-- c2s authentication/registration table 
     9-- 
     10CREATE TABLE 'authreg' ( 
     11    'username' TEXT, 
     12    'realm' TEXT, 
     13    'password' TEXT, 
     14    'token' VARCHAR(10), 
     15    'sequence' INTEGER, 
     16    'hash' VARCHAR(40) ); 
     17 
     18-- 
     19-- Session manager tables  
     20-- 
     21 
     22-- 
     23-- Active (seen) users 
     24-- Used by: core 
     25-- 
     26CREATE TABLE 'active' ( 
     27    'collection-owner' TEXT NOT NULL, 
     28    'object-sequence' INTEGER PRIMARY KEY, 
     29    'time' INT ); 
     30 
     31-- 
     32-- Logout times 
     33-- Used by: mod_iq_last 
     34-- 
     35CREATE TABLE 'logout' ( 
     36    'collection-owner' TEXT NOT NULL, 
     37    'object-sequence' INTEGER PRIMARY KEY, 
     38    'time' INT ); 
     39 
     40-- 
     41-- Roster items 
     42-- Used by: mod_roster 
     43-- 
     44CREATE TABLE 'roster-items' ( 
     45    'collection-owner' TEXT NOT NULL, 
     46    'object-sequence' INTEGER PRIMARY KEY, 
     47    'jid' TEXT, 
     48    'name' TEXT, 
     49    'to' BOOL, 
     50    'from' BOOL, 
     51    'ask' INTEGER ); 
     52 
     53-- 
     54-- Roster groups 
     55-- Used by: mod_roster 
     56-- 
     57CREATE TABLE 'roster-groups' ( 
     58    'collection-owner' TEXT NOT NULL, 
     59    'object-sequence' INTEGER PRIMARY KEY, 
     60    'jid' TEXT, 
     61    'group' TEXT ); 
     62 
     63-- 
     64-- vCard (user profile information) 
     65-- Used by: mod_iq_vcard 
     66-- 
     67CREATE TABLE 'vcard' ( 
     68    'collection-owner' TEXT NOT NULL, 
     69    'object-sequence' INTEGER PRIMARY KEY, 
     70    'fn' TEXT, 
     71    'nickname' TEXT, 
     72    'url' TEXT, 
     73    'tel' TEXT, 
     74    'email' TEXT, 
     75    'title' TEXT, 
     76    'role' TEXT, 
     77    'bday' TEXT, 
     78    'desc' TEXT, 
     79    'n-given' TEXT, 
     80    'n-family' TEXT, 
     81    'adr-street' TEXT, 
     82    'adr-extadd' TEXT, 
     83    'adr-locality' TEXT, 
     84    'adr-region' TEXT, 
     85    'adr-pcode' TEXT, 
     86    'adr-country' TEXT, 
     87    'org-orgname' TEXT, 
     88    'org-orgunit' TEXT ); 
     89 
     90-- 
     91-- Offline message queue 
     92-- Used by: mod_offline 
     93-- 
     94CREATE TABLE 'queue' ( 
     95    'collection-owner' TEXT NOT NULL, 
     96    'object-sequence' INTEGER PRIMARY KEY, 
     97    'xml' TEXT ); 
     98 
     99-- 
     100-- Private XML storage 
     101-- Used by: mod_iq_private 
     102-- 
     103CREATE TABLE 'private' ( 
     104    'collection-owner' TEXT NOT NULL, 
     105    'object-sequence' INTEGER PRIMARY KEY, 
     106    'ns' TEXT, 
     107    'xml' TEXT ); 
     108 
     109-- 
     110-- Message Of The Day (MOTD) messages (announcements) 
     111-- Used by: mod_announce 
     112-- 
     113CREATE TABLE 'motd-message' ( 
     114    'collection-owner' TEXT NOT NULL, 
     115    'object-sequence' INTEGER PRIMARY KEY, 
     116    'xml' TEXT ); 
     117 
     118-- 
     119-- Times of last MOTD message for each user 
     120-- Used by: mod_announce 
     121-- 
     122CREATE TABLE 'motd-times' ( 
     123    'collection-owner' TEXT NOT NULL, 
     124    'object-sequence' INTEGER PRIMARY KEY, 
     125    'time' INTEGER ); 
     126 
     127-- 
     128-- User-published discovery items 
     129-- Used by: mod_disco_publish 
     130-- 
     131CREATE TABLE 'disco-items' ( 
     132    'collection-owner' TEXT NOT NULL, 
     133    'object-sequence' INTEGER PRIMARY KEY, 
     134    'jid' TEXT, 
     135    'name' TEXT, 
     136    'node' TEXT ); 
     137 
     138-- 
     139-- Default privacy list 
     140-- Used by: mod_privacy 
     141-- 
     142CREATE TABLE 'privacy-default' ( 
     143    'collection-owner' TEXT NOT NULL, 
     144    'object-sequence' INTEGER PRIMARY KEY, 
     145    'default' TEXT ); 
     146 
     147-- 
     148-- Privacy lists 
     149-- Used by: mod_privacy 
     150-- 
     151CREATE TABLE 'privacy-items' ( 
     152    'collection-owner' TEXT NOT NULL, 
     153    'object-sequence' INTEGER PRIMARY KEY, 
     154    'list' TEXT, 
     155    'type' TEXT, 
     156    'value' TEXT, 
     157    'deny' BOOL, 
     158    'order' INTEGER, 
     159    'block' INTEGER ); 
     160 
     161-- 
     162-- Vacation settings 
     163-- Used by: mod_vacation 
     164-- 
     165CREATE TABLE 'vacation-settings' ( 
     166    'collection-owner' TEXT NOT NULL, 
     167    'object-sequence' INTEGER PRIMARY KEY, 
     168    'start' INTEGER, 
     169    'end' INTEGER, 
     170    'message' TEXT ); 
    1171-- 
    2172-- This is the required schema for sqlite. 
  • trunk/tools/Makefile.am

    r2 r153  
    11bin_SCRIPTS = jabberd 
    2 EXTRA_DIST = db-setup.mysql db-setup.pgsql jabberd.in jabberd.rc pipe-auth.pl migrate.pl db-update.mysql db-setup.oracle 
     2EXTRA_DIST = db-setup.mysql db-setup.pgsql jabberd.in jabberd.rc pipe-auth.pl migrate.pl db-update.mysql db-setup.oracle db-setup.sqlite 
    33 
    44edit = sed \