witten
/
luminotes
Archived
1
0
Fork 0

Updated INSTALL document and schema dump for new full-text search.

This commit is contained in:
Dan Helfman 2007-11-02 20:57:11 +00:00
parent 37e886f27c
commit 3124e97e47
2 changed files with 63 additions and 33 deletions

59
INSTALL
View File

@ -18,15 +18,11 @@ packages:
postgresql-contrib-8.1 python-psycopg2 python-simplejson python-tz
development mode
----------------
database setup
--------------
Running the Luminotes server in development mode is convenient for testing out
changes, because it uses CherryPy's built-in web server with auto-reload
enabled, so the server will automatically reload any modified source files as
soon as they're modified.
Configure PostgreSQL's pg_hba.conf to require passwords for local connections:
Configure PostgreSQL's pg_hba.conf (usually found under /etc/postgresql/) to
require passwords for local connections:
local all all md5
@ -35,16 +31,37 @@ Restart postgresql so these changes take effect:
/etc/init.d/postgresql restart
As the PostgreSQL superuser (usually "postgres"), create a new database user
and set the password to "dev".
and set a new password, for instance, "mypassword".
createuser -S -d -R -P -E luminotes
createdb -E UTF8 luminotes
echo "alter database luminotes owner to luminotes;" | psql luminotes
Also as the PostgreSQL superuser, setup full-text searching. The path to the
tsearch2.sql file may be different depending on your Linux distribution or
PostgreSQL version:
psql luminotes < /usr/share/postgresql/8.1/contrib/tsearch2.sql
echo "grant all on pg_ts_cfg to luminotes;" | psql luminotes
echo "grant all on pg_ts_cfgmap to luminotes;" | psql luminotes
echo "grant all on pg_ts_dict to luminotes;" | psql luminotes
echo "grant all on pg_ts_parser to luminotes;" | psql luminotes
Initialize the database with the starting schema and default data:
createdb -W -E UTF8 -U luminotes luminotes
export PYTHONPATH=.
export PGPASSWORD=mypassword
python2.4 tools/initdb.py
development mode
----------------
Running the Luminotes server in development mode is convenient for testing out
changes, because it uses CherryPy's built-in web server with auto-reload
enabled, so the server will automatically reload any modified source files as
soon as they're modified.
To start the server in development mode, run:
python2.4 luminotes.py -d
@ -106,26 +123,6 @@ domain you're using. For instance:
"luminotes.http_url": "http://luminotes.com",
"luminotes.https_url": "https://luminotes.com",
Configure PostgreSQL's pg_hba.conf to require passwords for local connections:
local all all md5
Restart postgresql so these changes take effect:
/etc/init.d/postgresql restart
As the PostgreSQL superuser (usually "postgres"), create a new database user
and set a new password, for instance, "mypassword".
createuser -S -d -R -P -E luminotes
Initialize the database with the starting schema and default data:
createdb -W -E UTF8 -U luminotes luminotes
export PYTHONPATH=.
export PGPASSWORD=mypassword
python2.4 tools/initdb.py
Then to actually start the production mode server, run:
python2.4 luminotes.py
@ -139,7 +136,7 @@ sending email
If you would like Luminotes to be able to send password reset emails, then
you'll need a mail server running on the same machine that is capabable of
receiving local SMTP connections and sending email. Either way, please change
receiving local SMTP connections and sending email. Either way, please set
the luminotes.support_email address in config/Common.py to the email address
you'd like in the From field of all outgoing emails. This email address also
shows up in various error messages and other places for a support contact

View File

@ -19,6 +19,18 @@ SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: drop_html_tags(text); Type: FUNCTION; Schema: public; Owner: luminotes
--
CREATE FUNCTION drop_html_tags(text) RETURNS text
AS $_$select regexp_replace( regexp_replace( $1, '</?(div|p|br|ul|ol|li|h3)( [^>]*?)?>', ' ', 'gi' ), '<[^>]+?>', '', 'g' );$_$
LANGUAGE sql;
ALTER FUNCTION public.drop_html_tags(text) OWNER TO luminotes;
--
-- Name: luminotes_user; Type: TABLE; Schema: public; Owner: luminotes; Tablespace:
--
@ -59,7 +71,8 @@ CREATE TABLE note (
notebook_id text,
startup boolean DEFAULT false,
deleted_from_id text,
rank numeric
rank numeric,
search tsvector
);
@ -70,7 +83,7 @@ ALTER TABLE public.note OWNER TO luminotes;
--
CREATE VIEW note_current AS
SELECT note.id, note.revision, note.title, note.contents, note.notebook_id, note.startup, note.deleted_from_id, note.rank FROM note WHERE (note.revision IN (SELECT max(sub_note.revision) AS max FROM note sub_note WHERE (sub_note.id = note.id)));
SELECT note.id, note.revision, note.title, note.contents, note.notebook_id, note.startup, note.deleted_from_id, note.rank, note.search FROM note WHERE (note.revision IN (SELECT max(sub_note.revision) AS max FROM note sub_note WHERE (sub_note.id = note.id)));
ALTER TABLE public.note_current OWNER TO luminotes;
@ -201,6 +214,26 @@ CREATE INDEX note_notebook_id_title_index ON note USING btree (notebook_id, titl
CREATE INDEX password_reset_email_address_index ON password_reset USING btree (email_address);
--
-- Name: search_index; Type: INDEX; Schema: public; Owner: luminotes; Tablespace:
--
CREATE INDEX search_index ON note USING gist (search);
--
-- Name: search_update; Type: TRIGGER; Schema: public; Owner: luminotes
--
CREATE TRIGGER search_update
BEFORE INSERT OR UPDATE ON note
FOR EACH ROW
EXECUTE PROCEDURE tsearch2('search', 'drop_html_tags', 'title', 'contents');
UPDATE pg_ts_cfg SET locale = 'en_US.UTF-8' WHERE ts_name = 'default';
--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--