aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to 'install')
-rw-r--r--install/INSTALL.txt40
-rw-r--r--install/schema_mysql.sql11
-rw-r--r--install/schema_postgres.sql9
-rw-r--r--install/update.php27
4 files changed, 64 insertions, 23 deletions
diff --git a/install/INSTALL.txt b/install/INSTALL.txt
index f5edf009f..36d112086 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.3+. 5.4 or 5.5 is highly recommended. 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.
@@ -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/friendica/red-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 247b33814..b3f992500 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;
-- --------------------------------------------------------
@@ -940,6 +941,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`),
@@ -947,7 +949,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;
-- --------------------------------------------------------
@@ -1256,6 +1259,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`),
@@ -1264,7 +1268,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 d852f38e9..bc72be445 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,
@@ -528,7 +529,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(1) NOT NULL DEFAULT '0',
+ "item_unseen" smallint NOT NULL DEFAULT '0',
"item_search_vector" tsvector,
PRIMARY KEY ("id")
);
@@ -725,6 +726,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");
@@ -734,6 +736,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,
@@ -959,6 +962,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");
@@ -968,6 +972,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,
@@ -1161,7 +1166,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 86731e165..75805513d 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1137 );
+define( 'UPDATE_VERSION' , 1139 );
/**
*
@@ -26,10 +26,14 @@ define( 'UPDATE_VERSION' , 1137 );
* 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.
*
@@ -1568,3 +1572,20 @@ function update_r1136() {
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;
+}