diff --git a/cmtd.conf b/cmtd.conf deleted file mode 100644 index 0967ef4..0000000 --- a/cmtd.conf +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/docs/cmtd.conf.sample b/docs/cmtd.conf.sample new file mode 100644 index 0000000..b64f810 --- /dev/null +++ b/docs/cmtd.conf.sample @@ -0,0 +1,9 @@ +{ + db => ['dbi:SQLite:dbname=data/data.db'], + captcha => { + table => 'captcha', + tries => 5, + limit => 500, + ft_file => '/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf' + }, +} diff --git a/docs/schema.sqlite3.sql b/docs/schema.sqlite3.sql new file mode 100644 index 0000000..88265a9 --- /dev/null +++ b/docs/schema.sqlite3.sql @@ -0,0 +1,42 @@ +BEGIN TRANSACTION; + +CREATE TABLE "sites" ( + "id" INTEGER PRIMARY KEY NOT NULL, + "site" varchar(4) NOT NULL +); + +CREATE UNIQUE INDEX "sites_uniq" ON "sites" ("site"); + +CREATE TABLE "pages" ( + "id" INTEGER PRIMARY KEY NOT NULL, + "sid" int(11) NOT NULL, + "hash" varchar(32) NOT NULL, + "path" text NULL DEFAULT '', + FOREIGN KEY ("id") REFERENCES "sites" ("id") + ON DELETE CASCADE ON UPDATE CASCADE +); + +CREATE UNIQUE INDEX "pages_uniq" ON "pages" ("hash"); + +CREATE TABLE "comments" ( + "id" INTEGER PRIMARY KEY NOT NULL, + "pid" int(11) NOT NULL, + "seq" int(11) NOT NULL, + "name" varchar(255) NOT NULL DEFAULT '', + "email" varchar(255) NOT NULL DEFAULT '', + "text" text NOT NULL, + FOREIGN KEY ("pid") REFERENCES "pages" ("id") + ON DELETE CASCADE ON UPDATE CASCADE +); + +CREATE UNIQUE INDEX "page_comments" ON "comments" ("pid", "seq"); + +CREATE TABLE "captcha" ( + "id" INTEGER PRIMARY KEY NOT NULL, + "tries" INTEGER NOT NULL DEFAULT 0, + "shown" INTEGER NOT NULL DEFAULT 0, + "code" varchar(16) NOT NULL, + "data" TEXT NOT NULL +); + +COMMIT;