aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to 'install')
-rw-r--r--install/INSTALL.txt42
-rw-r--r--install/schema_mysql.sql15
-rw-r--r--install/schema_postgres.sql11
-rw-r--r--install/update.php53
4 files changed, 97 insertions, 24 deletions
diff --git a/install/INSTALL.txt b/install/INSTALL.txt
index f5edf009f..58ec365cb 100644
--- a/install/INSTALL.txt
+++ b/install/INSTALL.txt
@@ -42,10 +42,16 @@ site for the first time, please use the SSL ("https://") URL if SSL is
available. This will avoid problems later. The installation routine will not
allow you to use a non browser-valid certificate.
-This restriction is incorporated because public posts from you may for example
-contain references to images on your own hub. If your certificate is not known
-by the internet browser of users they get a warning message complaining about
-the invalid certificate.
+This restriction is incorporated because public posts from you may contain
+references to images on your own hub. Other members viewing their stream on
+other hubs will get warnings if your certificate is not trusted by their web
+browser. This will confuse many people because this is a decentralised network
+and they will get the warning about your hub while viewing their own hub and may
+think their own hub has an issue. These warnings are very technical and scary to
+some folks, many of whom will not know how to proceed except to follow the browser
+advice. This is disruptive to the community. That said, we recognise the issues
+surrounding the current certificate infrastructure and agree there are many
+problems, but that doesn't change the requirement.
Free "browser-valid" certificates are available from providers such as StartSSL.
@@ -57,9 +63,11 @@ use SSL, your webserver must not listen on port 443 at all.
1. Requirements
- Apache with mod-rewrite enabled and "AllowOverride All" so you can use a
- local .htaccess file
+ local .htaccess file. Some folks have successfully used nginx and lighttpd.
+ Example config scripts are available for these platforms in doc/install.
+ Apache and nginx have the most support.
- - PHP 5.3+. The later the better.
+ - PHP 5.4 or later. The later the better.
- PHP *command line* access with register_argc_argv set to true in the
php.ini file - and with no hosting provider restrictions on the use of
@@ -70,7 +78,7 @@ use SSL, your webserver must not listen on port 443 at all.
- some form of email server or email gateway such that PHP mail() works
- - Mysql 5.x or MariaDB
+ - Mysql 5.x or MariaDB or postgres database server.
- ability to schedule jobs with cron.
@@ -88,7 +96,7 @@ use SSL, your webserver must not listen on port 443 at all.
software much easier to update. The Linux command to clone the repository
into a directory "mywebsite" would be
- git clone https://github.com/friendica/red.git mywebsite
+ git clone https://github.com/redmatrix/redmatrix.git mywebsite
- and then you can pick up the latest changes at any time with
@@ -115,15 +123,17 @@ use SSL, your webserver must not listen on port 443 at all.
cd mywebsite
- - Then you should clone the addon repository (separately)
+ - Then you should clone the addon repository (separately). We'll give this repository
+ a nickname of 'matrix'. You can pull in other redmatrix addon repositories by
+ giving them different nicknames.
- git clone https://github.com/friendica/red-addons.git addon
+ util/add_addon_repo https://github.com/redmatrix/redmatrix-addons.git matrix
- - For keeping the addon tree updated, you should be on you addon tree and
- issue a git pull
+ - For keeping the addon tree updated, you should be on your top level website
+ directory and issue an update command for that repository.
- cd mywebsite/addon
- git pull
+ cd mywebsite
+ util/update_addon_repo matrix
3. Create an empty database and note the access details (hostname, username,
@@ -144,8 +154,8 @@ website.
If not, edit htconfig.php and change system settings. Rename
to .htconfig.php
- Database is populated.
- If not, import the contents of "database.sql" with phpmyadmin
- or mysql command line
+ If not, import the contents of "install/schema_xxxxx.sql" with phpmyadmin
+ or mysql command line (replace 'xxxxx' with your DB type).
7. At this point visit your website again, and register your personal account.
Registration errors should all be recoverable automatically.
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 8addc0af9..c2cefd07d 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -33,7 +33,8 @@ CREATE TABLE IF NOT EXISTS `abook` (
KEY `abook_profile` (`abook_profile`),
KEY `abook_dob` (`abook_dob`),
KEY `abook_connected` (`abook_connected`),
- KEY `abook_rating` (`abook_rating`)
+ KEY `abook_rating` (`abook_rating`),
+ KEY `abook_channel_closeness` (`abook_channel`,`abook_closeness`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
@@ -218,6 +219,7 @@ CREATE TABLE IF NOT EXISTS `channel` (
`channel_notifyflags` int(10) unsigned NOT NULL DEFAULT '65535',
`channel_pageflags` int(10) unsigned NOT NULL DEFAULT '0',
`channel_dirdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `channel_lastpost` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`channel_deleted` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`channel_max_anon_mail` int(10) unsigned NOT NULL DEFAULT '10',
`channel_max_friend_req` int(10) unsigned NOT NULL DEFAULT '10',
@@ -281,6 +283,7 @@ CREATE TABLE IF NOT EXISTS `channel` (
KEY `channel_deleted` (`channel_deleted`),
KEY `channel_a_republish` (`channel_a_republish`),
KEY `channel_dirdate` (`channel_dirdate`),
+ KEY `channel_lastpost` (`channel_lastpost`),
KEY `channel_w_like` (`channel_w_like`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -688,6 +691,7 @@ CREATE TABLE IF NOT EXISTS `item` (
`item_restrict` int(11) NOT NULL DEFAULT '0',
`item_flags` int(11) NOT NULL DEFAULT '0',
`item_private` tinyint(4) NOT NULL DEFAULT '0',
+ `item_unseen` smallint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
KEY `parent` (`parent`),
@@ -717,6 +721,7 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `public_policy` (`public_policy`),
KEY `comments_closed` (`comments_closed`),
KEY `changed` (`changed`),
+ KEY `item_unseen` (`item_unseen`),
FULLTEXT KEY `title` (`title`),
FULLTEXT KEY `body` (`body`),
FULLTEXT KEY `allow_cid` (`allow_cid`),
@@ -938,6 +943,7 @@ CREATE TABLE IF NOT EXISTS `outq` (
`outq_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`outq_notify` mediumtext NOT NULL,
`outq_msg` mediumtext NOT NULL,
+ `outq_priority` smallint NOT NULL DEFAULT '0',
PRIMARY KEY (`outq_hash`),
KEY `outq_account` (`outq_account`),
KEY `outq_channel` (`outq_channel`),
@@ -945,7 +951,8 @@ CREATE TABLE IF NOT EXISTS `outq` (
KEY `outq_created` (`outq_created`),
KEY `outq_updated` (`outq_updated`),
KEY `outq_async` (`outq_async`),
- KEY `outq_delivered` (`outq_delivered`)
+ KEY `outq_delivered` (`outq_delivered`),
+ KEY `outq_priority` (`outq_priority`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
@@ -1254,6 +1261,7 @@ CREATE TABLE IF NOT EXISTS `site` (
`site_sellpage` char(255) NOT NULL DEFAULT '',
`site_location` char(255) NOT NULL DEFAULT '',
`site_realm` char(255) NOT NULL DEFAULT '',
+ `site_valid` smallint NOT NULL DEFAULT '0',
PRIMARY KEY (`site_url`),
KEY `site_flags` (`site_flags`),
KEY `site_update` (`site_update`),
@@ -1262,7 +1270,8 @@ CREATE TABLE IF NOT EXISTS `site` (
KEY `site_access` (`site_access`),
KEY `site_sellpage` (`site_sellpage`),
KEY `site_pull` (`site_pull`),
- KEY `site_realm` (`site_realm`)
+ KEY `site_realm` (`site_realm`),
+ KEY `site_valid` (`site_valid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index b68a7cb97..438b29d49 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -29,6 +29,7 @@ CREATE TABLE "abook" (
create index "abook_dob" on abook ("abook_dob");
create index "abook_connected" on abook ("abook_connected");
create index "abook_rating" on abook ("abook_rating");
+ create index "abook_channel_closeness" on abook ("abook_channel", "abook_closeness");
CREATE TABLE "account" (
"account_id" serial NOT NULL,
@@ -165,6 +166,7 @@ CREATE TABLE "channel" (
"channel_notifyflags" bigint NOT NULL DEFAULT '65535',
"channel_pageflags" bigint NOT NULL DEFAULT '0',
"channel_dirdate" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
+ "channel_lastpost" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
"channel_deleted" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
"channel_max_anon_mail" bigint NOT NULL DEFAULT '10',
"channel_max_friend_req" bigint NOT NULL DEFAULT '10',
@@ -230,6 +232,7 @@ create index "channel_deleted" on channel ("channel_deleted");
create index "channel_a_republish" on channel ("channel_a_republish");
create index "channel_w_like" on channel ("channel_w_like");
create index "channel_dirdate" on channel ("channel_dirdate");
+create index "channel_lastpost" on channel ("channel_lastpost");
CREATE TABLE "chat" (
"chat_id" serial NOT NULL,
"chat_room" bigint NOT NULL DEFAULT '0',
@@ -528,6 +531,7 @@ CREATE TABLE "item" (
"item_restrict" bigint NOT NULL DEFAULT '0',
"item_flags" bigint NOT NULL DEFAULT '0',
"item_private" numeric(4) NOT NULL DEFAULT '0',
+ "item_unseen" smallint NOT NULL DEFAULT '0',
"item_search_vector" tsvector,
PRIMARY KEY ("id")
);
@@ -559,6 +563,7 @@ create index "item_uid_mid" on item ("mid","uid");
create index "item_public_policy" on item ("public_policy");
create index "item_comment_policy" on item ("comment_policy");
create index "item_layout_mid" on item ("layout_mid");
+create index "item_unseen" on item ("item_unseen");
-- fulltext indexes
create index "item_search_idx" on item USING gist("item_search_vector");
@@ -723,6 +728,7 @@ CREATE TABLE "outq" (
"outq_updated" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
"outq_notify" text NOT NULL,
"outq_msg" text NOT NULL,
+ "outq_priority" smallint NOT NULL DEFAULT '0',
PRIMARY KEY ("outq_hash")
);
create index "outq_account" on outq ("outq_account");
@@ -732,6 +738,7 @@ create index "outq_created" on outq ("outq_created");
create index "outq_updated" on outq ("outq_updated");
create index "outq_async" on outq ("outq_async");
create index "outq_delivered" on outq ("outq_delivered");
+create index "outq_priority" on outq ("outq_priority");
CREATE TABLE "pconfig" (
"id" serial NOT NULL,
@@ -957,6 +964,7 @@ CREATE TABLE "site" (
"site_sellpage" text NOT NULL DEFAULT '',
"site_location" text NOT NULL DEFAULT '',
"site_realm" text NOT NULL DEFAULT '',
+ "site_valid" smallint NOT NULL DEFAULT '0',
PRIMARY KEY ("site_url")
);
create index "site_flags" on site ("site_flags");
@@ -966,6 +974,7 @@ create index "site_register" on site ("site_register");
create index "site_access" on site ("site_access");
create index "site_sellpage" on site ("site_sellpage");
create index "site_realm" on site ("site_realm");
+create index "site_valid" on site ("site_valid");
CREATE TABLE "source" (
"src_id" serial NOT NULL,
@@ -1159,7 +1168,7 @@ CREATE TABLE "xperm" (
"xp_client" varchar( 20 ) NOT NULL DEFAULT '',
"xp_channel" bigint NOT NULL DEFAULT '0',
"xp_perm" varchar( 64 ) NOT NULL DEFAULT '',
- PRIMARY_KEY ("xp_id")
+ PRIMARY KEY ("xp_id")
);
create index "xp_client" on xperm ("xp_client");
create index "xp_channel" on xperm ("xp_channel");
diff --git a/install/update.php b/install/update.php
index 8ce50926a..36aa20373 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1136 );
+define( 'UPDATE_VERSION' , 1140 );
/**
*
@@ -26,10 +26,14 @@ define( 'UPDATE_VERSION' , 1136 );
* The DB_UPDATE_VERSION will always be one greater than the last numbered script in this file.
*
* If you change the database schema, the following are required:
- * 1. Update the file database.sql to match the new schema.
+ * 1. Update the files schema_mysql.sql and schema_postgres.sql to match the new schema.
+ * Be sure to read doc/sql_conventions.bb ($yoururl/help/sql_conventions) use only standard
+ * SQL data types where possible to keep differences in the files to a minimum
* 2. Update this file by adding a new function at the end with the number of the current DB_UPDATE_VERSION.
* This function should modify the current database schema and perform any other steps necessary
- * to ensure that upgrade is silent and free from requiring interaction.
+ * to ensure that upgrade is silent and free from requiring interaction. Review to ensure that it
+ * will run correctly on both postgres and MySQL/Mariadb. It is very difficult and messy to fix DB update
+ * errors. Once pushed, it requires a new update which undoes any damage and performs the corrected updated.
* 3. Increment the DB_UPDATE_VERSION in boot.php *AND* the UPDATE_VERSION in this file to match it
* 4. TEST the upgrade prior to checkin and filing a pull request.
*
@@ -1518,7 +1522,7 @@ function update_r1133() {
PRIMARY KEY (xp_id) )");
$r2 = 0;
foreach(array('xp_client', 'xp_channel', 'xp_perm') as $fld)
- $r2 += (empty(q("create index $fld on xperm ($fld)")) ? 0 : 1);
+ $r2 += ((q("create index $fld on xperm ($fld)") == false) ? 0 : 1);
$r = (($r1 && $r2) ? true : false);
}
@@ -1558,3 +1562,44 @@ function update_r1135() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1136() {
+ $r1 = q("alter table item add item_unseen smallint not null default '0' ");
+ $r2 = q("create index item_unseen on item ( item_unseen ) ");
+ $r3 = q("update item set item_unseen = 1 where ( item_flags & 2 ) > 0 ");
+
+ if($r1 && $r2 && $r3)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1137() {
+ $r1 = q("alter table site add site_valid smallint not null default '0' ");
+ $r2 = q("create index site_valid on site ( site_valid ) ");
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1138() {
+ $r1 = q("alter table outq add outq_priority smallint not null default '0' ");
+ $r2 = q("create index outq_priority on outq ( outq_priority ) ");
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1139() {
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("ALTER TABLE channel ADD channel_lastpost timestamp NOT NULL DEFAULT '0001-01-01 00:00:00'");
+ $r2 = q("create index channel_lastpost on channel ( channel_lastpost ) ");
+ $r = $r1 && $r2;
+ }
+ else
+ $r = q("ALTER TABLE `channel` ADD `channel_lastpost` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `channel_dirdate` , ADD INDEX ( `channel_lastpost` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+} \ No newline at end of file