diff options
Diffstat (limited to 'install')
-rw-r--r-- | install/INSTALL.txt | 99 | ||||
-rw-r--r-- | install/database.sql | 195 | ||||
-rwxr-xr-x[-rw-r--r--] | install/htconfig.sample.php | 49 | ||||
-rw-r--r-- | install/update.php | 295 |
4 files changed, 456 insertions, 182 deletions
diff --git a/install/INSTALL.txt b/install/INSTALL.txt index e6adbba7d..3f135c349 100644 --- a/install/INSTALL.txt +++ b/install/INSTALL.txt @@ -1,31 +1,28 @@ -Friendica Installation +Red Matrix Installation -We've tried very hard to ensure that Friendica will run on commodity hosting -platforms - such as those used to host Wordpress blogs and Drupal websites. -But be aware that Friendica is more than a simple web application. It is a +We've tried very hard to ensure that the Red Matrix will run on commodity +hosting platforms - such as those used to host Wordpress blogs and Drupal +websites. It will run on most any Linux VPS system. Windows LAMP platforms +such as XAMPP and WAMP are not officially supported at this time - however +we welcome patches if you manage to get it working. + +Be aware that the Red Matrix is more than a simple web application. It is a complex communications system which more closely resembles an email server than a web server. For reliability and performance, messages are delivered in the background and are queued for later delivery when sites are down. This kind of functionality requires a bit more of the host system than the typical -blog. Not every PHP/MySQL hosting provider will be able to support Friendica. -Many will. But please review the requirements and confirm these with your -hosting provider prior to installation. +blog. Not every PHP/MySQL hosting provider will be able to support the +Red Matrix. Many will - but please review the requirements and confirm these +with your hosting provider prior to installation. (And preferably before +entering into a long-term contract.) Before you begin: Choose a domain name or subdomain name for your server. Put some thought into this - because changing it is currently not-supported. Things will break, and some of your friends may have difficulty communicating -with you. We plan to address this limitation in a future release. Also decide -if you wish to connect with members of the Diaspora network, as this will -impact the installation requirements. - -Decide if you will use SSL and obtain an SSL cert. Communications with the -Diaspora network MAY require both SSL AND an SSL cert signed by a CA which is -recognised by the major browsers. Friendica will work with self-signed certs -but Diaspora communication may not. For best results, install your cert PRIOR -to installing Friendica and when visiting your site for the initial -installation in step 5, please use the https: link. (Use the http: or non-SSL -link if your cert is self-signed). +with you. We plan to address this limitation in a future release. + +Decide if you will use SSL and obtain an SSL cert before software installation. You SHOULD use SSL. If you use SSL, you MUST use a "browser-valid" certificate. Please test your certificate prior to installation. A web tool for testing your certificate is available at "http://www.digicert.com/help/". When visiting your site for the first time, please use the SSL ("https://") URL if SSL is available. This will avoid problems later. 1. Requirements @@ -35,22 +32,21 @@ local .htaccess file - PHP 5.3+. The later the better. - PHP *command line* access with register_argc_argv set to true in the -php.ini file [or see 'poormancron' in section 8] +php.ini file - and with no hosting provider restrictions on the use of exec() +and proc_open(). - - curl, gd (with at least jpeg support), mysql, mbstring, mcrypt, and openssl extensions + - curl, gd (with at least jpeg support), mysqli, mbstring, mcrypt, and openssl extensions. The imagick extension is not required but desirable. - some form of email server or email gateway such that PHP mail() works - - Mysql 5.x + - Mysql 5.x or MariaDB - - ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks -(Windows) [Note: other options are presented in Section 8 of this document] + - ability to schedule jobs with cron. - Installation into a top-level domain or sub-domain (without a -directory/path component in the URL) is preferred. This is REQUIRED if -you wish to communicate with the Diaspora network. +directory/path component in the URL) is REQUIRED. -2. Unpack the Friendica files into the root of your web server document area. +2. Unpack the Red Matrix files into the root of your web server document area. - If you copy the directory tree to your webserver, make sure that you also copy .htaccess - as "dot" files are often hidden @@ -66,8 +62,8 @@ write or create files in your web directory, create an empty file called 5. Visit your website with a web browser and follow the instructions. Please note any error messages and correct these before continuing. If you are using -SSL with a known signature authority (recommended), use the https: link to your -website. If you are using a self-signed cert or no cert, use the http: link. +SSL with a known signature authority, use the https: link to your +website. 6. *If* the automated installation fails for any reason, check the following: @@ -107,29 +103,11 @@ You can generally find the location of PHP by executing "which php". If you have troubles with this section please contact your hosting provider for assistance. Friendica will not work correctly if you cannot perform this step. -You should also be sure that $a->config['php_path'] is set correctly, it should +You should also be sure that $a->config['system']['php_path'] is set correctly, it should look like (changing it to the correct PHP location) -$a->config['php_path'] = '/usr/local/php53/bin/php' +$a->config['system']['php_path'] = '/usr/local/php53/bin/php'; -Alternative: You may be able to use the 'poormancron' plugin to perform this -step if you are using a recent Friendica release. 'poormancron' may result in -perfomance and memory issues and is only suitable for small sites with one or -two users and a handful of contacts. To do this, edit the file -".htconfig.php" and look for a line describing your plugins. On a fresh -installation, it will look like - -$a->config['system']['addon'] = 'js_upload'; - -This indicates the "js_upload" addon module is enabled. You may add additional -addons/plugins using this same line in the configuration file. Change it to -read - -$a->config['system']['addon'] = 'js_upload,poormancron'; - -and save your changes. - - ##################################################################### @@ -153,8 +131,6 @@ the database server name is "localhost". This could be the result of one of our Apache directives not being supported by your version of Apache. Examine your apache server logs. - You might remove the line "Options -Indexes" from the .htaccess file if -you are using a Windows server as this has been known to cause problems. Also check your file permissions. Your website and all contents must generally be world-readable. @@ -200,8 +176,7 @@ likely that mod-rewrite is not installed in your web server or is not working. distribution or (if Windows) the provider of your Apache server software if you need to change either of these and can not figure out how. There is a lot of help available on the web. Google "mod-rewrite" along with the -name of your operating system distribution or Apache package (if using -Windows). +name of your operating system distribution or Apache package. ##################################################################### @@ -223,7 +198,7 @@ Retry the installation. As soon as the database has been created, ##################################################################### - Some configurations with "suhosin" security are configured without -an ability to run external processes. Friendica requires this ability. +an ability to run external processes. The Red Matrix requires this ability. Following are some notes provided by one of our members. ##################################################################### @@ -233,26 +208,26 @@ certain functions like proc_open, as configured in /etc/php5/conf.d/suhosin.ini: suhosin.executor.func.blacklist = proc_open, ... -For those sites like Friendica that really need these functions they can be -enabled, e.g. in /etc/apache2/sites-available/friendica: +For those sites like Red Matrix that really need these functions they can be +enabled, e.g. in /etc/apache2/sites-available/redmatrix: - <Directory /var/www/friendica/> + <Directory /var/www/redmatrix/> php_admin_value suhosin.executor.func.blacklist none php_admin_value suhosin.executor.eval.blacklist none </Directory> -This enables every function for Friendica if accessed via browser, but not for +This enables every function for Red Matrix if accessed via browser, but not for the cronjob that is called via php command line. I attempted to enable it for cron by using something like - */10 * * * * cd /var/www/friendica/friendica/ && sudo -u www-data /usr/bin/php + */10 * * * * cd /var/www/redmatrix/ && sudo -u www-data /usr/bin/php -d suhosin.executor.func.blacklist=none -d suhosin.executor.eval.blacklist=none -f include/poller.php -This worked well for simple test cases, but the friendica-cron still failed with +This worked well for simple test cases, but the cron job still failed with a fatal error: suhosin[22962]: ALERT - function within blacklist called: proc_open() (attacker -'REMOTE_ADDR not set', file '/var/www/friendica/friendica/boot.php', line 1341) +'REMOTE_ADDR not set', file '/var/www/redmatrix/boot.php', line 1341) After a while I noticed, that include/poller.php calls further php script via proc_open. These scripts themselves also use proc_open and fail, because they @@ -260,11 +235,11 @@ are NOT called with -d suhosin.executor.func.blacklist=none. So the simple solution is to put the correct parameters into .htconfig.php: // Location of PHP command line processor - $a->config['php_path'] = '/usr/bin/php -d suhosin.executor.func.blacklist=none + $a->config['system']['php_path'] = '/usr/bin/php -d suhosin.executor.func.blacklist=none -d suhosin.executor.eval.blacklist=none'; -This is obvious as soon as you notice that the friendica-cron uses proc_open to +This is obvious as soon as you notice that the cron uses proc_open to execute php-scripts that also use proc_open, but it took me quite some time to find that out. I hope this saves some time for other people using suhosin with function blacklists. diff --git a/install/database.sql b/install/database.sql index 3dcbb7be0..cd1c72ac6 100644 --- a/install/database.sql +++ b/install/database.sql @@ -44,6 +44,7 @@ CREATE TABLE IF NOT EXISTS `account` ( `account_salt` char(32) NOT NULL DEFAULT '', `account_password` char(255) NOT NULL DEFAULT '', `account_email` char(255) NOT NULL DEFAULT '', + `account_external` char(255) NOT NULL DEFAULT '', `account_language` char(16) NOT NULL DEFAULT 'en', `account_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `account_lastlog` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -61,7 +62,8 @@ CREATE TABLE IF NOT EXISTS `account` ( KEY `account_roles` (`account_roles`), KEY `account_lastlog` (`account_lastlog`), KEY `account_expires` (`account_expires`), - KEY `account_default_channel` (`account_default_channel`) + KEY `account_default_channel` (`account_default_channel`), + KEY `account_external` (`account_external`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `addon` ( @@ -158,7 +160,7 @@ CREATE TABLE IF NOT EXISTS `channel` ( `channel_max_friend_req` int(10) unsigned NOT NULL DEFAULT '10', `channel_expire_days` int(11) NOT NULL DEFAULT '0', `channel_passwd_reset` char(255) NOT NULL DEFAULT '', - `channel_default_gid` int(10) unsigned NOT NULL DEFAULT '0', + `channel_default_group` char(255) NOT NULL DEFAULT '', `channel_allow_cid` mediumtext NOT NULL, `channel_allow_gid` mediumtext NOT NULL, `channel_deny_cid` mediumtext NOT NULL, @@ -180,10 +182,10 @@ CREATE TABLE IF NOT EXISTS `channel` ( `channel_r_pages` int(10) unsigned NOT NULL DEFAULT '128', `channel_w_pages` int(10) unsigned NOT NULL DEFAULT '128', PRIMARY KEY (`channel_id`), + UNIQUE KEY `channel_address_unique` (`channel_address`), KEY `channel_account_id` (`channel_account_id`), KEY `channel_primary` (`channel_primary`), KEY `channel_name` (`channel_name`), - KEY `channel_address` (`channel_address`), KEY `channel_timezone` (`channel_timezone`), KEY `channel_location` (`channel_location`), KEY `channel_theme` (`channel_theme`), @@ -191,7 +193,7 @@ CREATE TABLE IF NOT EXISTS `channel` ( KEY `channel_pageflags` (`channel_pageflags`), KEY `channel_max_anon_mail` (`channel_max_anon_mail`), KEY `channel_max_friend_req` (`channel_max_friend_req`), - KEY `channel_default_gid` (`channel_default_gid`), + KEY `channel_default_gid` (`channel_default_group`), KEY `channel_r_stream` (`channel_r_stream`), KEY `channel_r_profile` (`channel_r_profile`), KEY `channel_r_photos` (`channel_r_photos`), @@ -307,7 +309,6 @@ CREATE TABLE IF NOT EXISTS `fserver` ( `key` text NOT NULL, PRIMARY KEY (`id`), KEY `server` (`server`), - KEY `server_2` (`server`), KEY `posturl` (`posturl`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; @@ -324,43 +325,6 @@ CREATE TABLE IF NOT EXISTS `fsuggest` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `gcign` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `uid` int(11) NOT NULL, - `gcid` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `uid` (`uid`), - KEY `gcid` (`gcid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `gcontact` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` char(255) NOT NULL, - `url` char(255) NOT NULL, - `nurl` char(255) NOT NULL, - `photo` char(255) NOT NULL, - `connect` char(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `nurl` (`nurl`), - KEY `name` (`name`), - KEY `url` (`url`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `glink` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `cid` int(11) NOT NULL, - `uid` int(11) NOT NULL, - `gcid` int(11) NOT NULL, - `zcid` int(11) NOT NULL, - `updated` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `cid` (`cid`), - KEY `uid` (`uid`), - KEY `gcid` (`gcid`), - KEY `zcid` (`zcid`), - KEY `updated` (`updated`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - CREATE TABLE IF NOT EXISTS `group` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `hash` char(255) NOT NULL DEFAULT '', @@ -409,35 +373,17 @@ CREATE TABLE IF NOT EXISTS `hubloc` ( `hubloc_callback` char(255) NOT NULL DEFAULT '', `hubloc_connect` char(255) NOT NULL DEFAULT '', `hubloc_sitekey` text NOT NULL, + `hubloc_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `hubloc_connected` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`hubloc_id`), KEY `hubloc_url` (`hubloc_url`), KEY `hubloc_guid` (`hubloc_guid`), KEY `hubloc_flags` (`hubloc_flags`), KEY `hubloc_connect` (`hubloc_connect`), KEY `hubloc_host` (`hubloc_host`), - KEY `hubloc_addr` (`hubloc_addr`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `intro` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `uid` int(10) unsigned NOT NULL, - `fid` int(11) NOT NULL DEFAULT '0', - `contact-id` int(11) NOT NULL, - `knowyou` tinyint(1) NOT NULL, - `duplex` tinyint(1) NOT NULL DEFAULT '0', - `note` text NOT NULL, - `hash` char(255) NOT NULL, - `datetime` datetime NOT NULL, - `blocked` tinyint(1) NOT NULL DEFAULT '1', - `ignore` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `uid` (`uid`), - KEY `fid` (`fid`), - KEY `hash` (`hash`), - KEY `datetime` (`datetime`), - KEY `blocked` (`blocked`), - KEY `ignore` (`ignore`), - KEY `contact-id` (`contact-id`) + KEY `hubloc_addr` (`hubloc_addr`), + KEY `hubloc_updated` (`hubloc_updated`), + KEY `hubloc_connected` (`hubloc_connected`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `issue` ( @@ -459,12 +405,12 @@ CREATE TABLE IF NOT EXISTS `issue` ( CREATE TABLE IF NOT EXISTS `item` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `uri` char(255) CHARACTER SET ascii NOT NULL DEFAULT '', + `mid` char(255) CHARACTER SET ascii NOT NULL DEFAULT '', `aid` int(10) unsigned NOT NULL DEFAULT '0', `uid` int(10) unsigned NOT NULL DEFAULT '0', `wall` tinyint(1) NOT NULL DEFAULT '0', `parent` int(10) unsigned NOT NULL DEFAULT '0', - `parent_uri` char(255) CHARACTER SET ascii NOT NULL DEFAULT '', + `parent_mid` char(255) CHARACTER SET ascii NOT NULL DEFAULT '', `thr_parent` char(255) NOT NULL DEFAULT '', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -475,7 +421,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `owner_xchan` char(255) NOT NULL DEFAULT '', `author_xchan` char(255) NOT NULL DEFAULT '', `mimetype` char(255) NOT NULL DEFAULT '', - `title` char(255) NOT NULL DEFAULT '', + `title` text NOT NULL DEFAULT '', `body` mediumtext NOT NULL, `app` char(255) NOT NULL DEFAULT '', `lang` char(64) NOT NULL DEFAULT '', @@ -494,6 +440,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `inform` mediumtext NOT NULL, `location` char(255) NOT NULL DEFAULT '', `coord` char(255) NOT NULL DEFAULT '', + `comment_policy` char(255) NOT NULL DEFAULT '', `allow_cid` mediumtext NOT NULL, `allow_gid` mediumtext NOT NULL, `deny_cid` mediumtext NOT NULL, @@ -502,7 +449,6 @@ CREATE TABLE IF NOT EXISTS `item` ( `item_flags` int(11) NOT NULL DEFAULT '0', `item_private` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `uri` (`uri`), KEY `uid` (`uid`), KEY `parent` (`parent`), KEY `created` (`created`), @@ -511,14 +457,12 @@ CREATE TABLE IF NOT EXISTS `item` ( KEY `wall` (`wall`), KEY `uid_commented` (`uid`,`commented`), KEY `uid_created` (`uid`,`created`), - KEY `parent_uri` (`parent_uri`), KEY `aid` (`aid`), KEY `owner_xchan` (`owner_xchan`), KEY `author_xchan` (`author_xchan`), KEY `resource_type` (`resource_type`), KEY `item_restrict` (`item_restrict`), KEY `item_flags` (`item_flags`), - KEY `uid_uri` (`uri`,`uid`), KEY `commented` (`commented`), KEY `verb` (`verb`), KEY `item_private` (`item_private`), @@ -526,6 +470,10 @@ CREATE TABLE IF NOT EXISTS `item` ( KEY `expires` (`expires`), KEY `revision` (`revision`), KEY `mimetype` (`mimetype`), + KEY `mid` (`mid`), + KEY `parent_mid` (`parent_mid`), + KEY `uid_mid` (`mid`,`uid`), + KEY `comment_policy` (`comment_policy`), FULLTEXT KEY `title` (`title`), FULLTEXT KEY `body` (`body`), FULLTEXT KEY `allow_cid` (`allow_cid`), @@ -554,29 +502,29 @@ CREATE TABLE IF NOT EXISTS `mail` ( `to_xchan` char(255) NOT NULL DEFAULT '', `account_id` int(10) unsigned NOT NULL DEFAULT '0', `channel_id` int(10) unsigned NOT NULL, - `title` char(255) NOT NULL, + `title` text NOT NULL, `body` mediumtext NOT NULL, - `uri` char(255) NOT NULL, - `parent_uri` char(255) NOT NULL, + `mid` char(255) NOT NULL, + `parent_mid` char(255) NOT NULL, `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), - KEY `uri` (`uri`), KEY `created` (`created`), KEY `mail_flags` (`mail_flags`), KEY `account_id` (`account_id`), KEY `channel_id` (`channel_id`), - KEY `parent_uri` (`parent_uri`), KEY `from_xchan` (`from_xchan`), - KEY `to_xchan` (`to_xchan`) + KEY `to_xchan` (`to_xchan`), + KEY `mid` (`mid`), + KEY `parent_mid` (`parent_mid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `manage` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL, - `mid` int(11) NOT NULL, + `xchan` char(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `uid` (`uid`), - KEY `mid` (`mid`) + KEY `xchan` (`xchan`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `menu` ( @@ -629,10 +577,26 @@ CREATE TABLE IF NOT EXISTS `notify` ( KEY `otype` (`otype`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `obj` ( + `obj_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `obj_page` char(64) NOT NULL DEFAULT '', + `obj_verb` char(255) NOT NULL DEFAULT '', + `obj_type` int(10) unsigned NOT NULL DEFAULT '0', + `obj_obj` char(255) NOT NULL DEFAULT '', + `obj_channel` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`obj_id`), + KEY `obj_verb` (`obj_verb`), + KEY `obj_page` (`obj_page`), + KEY `obj_type` (`obj_type`), + KEY `obj_channel` (`obj_channel`), + KEY `obj_obj` (`obj_obj`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `outq` ( `outq_hash` char(255) NOT NULL, `outq_account` int(10) unsigned NOT NULL DEFAULT '0', `outq_channel` int(10) unsigned NOT NULL DEFAULT '0', + `outq_driver` char(32) NOT NULL DEFAULT '', `outq_posturl` char(255) NOT NULL DEFAULT '', `outq_async` tinyint(1) NOT NULL DEFAULT '0', `outq_delivered` tinyint(1) NOT NULL DEFAULT '0', @@ -679,6 +643,7 @@ CREATE TABLE IF NOT EXISTS `photo` ( `data` mediumblob NOT NULL, `scale` tinyint(3) NOT NULL, `profile` tinyint(1) NOT NULL DEFAULT '0', + `photo_flags` int(10) unsigned NOT NULL DEFAULT '0', `allow_cid` mediumtext NOT NULL, `allow_gid` mediumtext NOT NULL, `deny_cid` mediumtext NOT NULL, @@ -688,6 +653,7 @@ CREATE TABLE IF NOT EXISTS `photo` ( KEY `album` (`album`), KEY `scale` (`scale`), KEY `profile` (`profile`), + KEY `photo_flags` (`photo_flags`), KEY `type` (`type`), KEY `aid` (`aid`), KEY `xchan` (`xchan`), @@ -705,6 +671,7 @@ CREATE TABLE IF NOT EXISTS `profile` ( `hide_friends` tinyint(1) NOT NULL DEFAULT '0', `name` char(255) NOT NULL, `pdesc` char(255) NOT NULL, + `chandesc` text NOT NULL DEFAULT '', `dob` char(32) NOT NULL DEFAULT '0000-00-00', `dob_tz` char(255) NOT NULL DEFAULT 'UTC', `address` char(255) NOT NULL, @@ -734,6 +701,7 @@ CREATE TABLE IF NOT EXISTS `profile` ( `work` text NOT NULL, `education` text NOT NULL, `contact` text NOT NULL, + `channels` text NOT NULL, `homepage` char(255) NOT NULL, `photo` char(255) NOT NULL, `thumb` char(255) NOT NULL, @@ -803,21 +771,34 @@ CREATE TABLE IF NOT EXISTS `session` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `sid` char(255) NOT NULL, `data` text NOT NULL, - `expire` int(10) unsigned NOT NULL, + `expire` bigint(20) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `sid` (`sid`), KEY `expire` (`expire`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `shares` ( + `share_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `share_type` int(11) NOT NULL DEFAULT '0', + `share_target` int(10) unsigned NOT NULL DEFAULT '0', + `share_xchan` char(255) NOT NULL DEFAULT '', + PRIMARY KEY (`share_id`), + KEY `share_type` (`share_type`), + KEY `share_target` (`share_target`), + KEY `share_xchan` (`share_xchan`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `site` ( `site_url` char(255) NOT NULL, `site_flags` int(11) NOT NULL DEFAULT '0', `site_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `site_directory` char(255) NOT NULL DEFAULT '', + `site_register` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`site_url`), KEY `site_flags` (`site_flags`), KEY `site_update` (`site_update`), - KEY `site_directory` (`site_directory`) + KEY `site_directory` (`site_directory`), + KEY `site_register` (`site_register`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `spam` ( @@ -843,20 +824,26 @@ CREATE TABLE IF NOT EXISTS `term` ( `type` tinyint(3) unsigned NOT NULL, `term` char(255) NOT NULL, `url` char(255) NOT NULL, + `imgurl` char(255) NOT NULL, + `term_hash` char(255) NOT NULL DEFAULT '', + `parent_hash` char(255) NOT NULL DEFAULT '', PRIMARY KEY (`tid`), KEY `oid` (`oid`), KEY `otype` (`otype`), KEY `type` (`type`), KEY `term` (`term`), KEY `uid` (`uid`), - KEY `aid` (`aid`) + KEY `aid` (`aid`), + KEY `imgurl` (`imgurl`), + KEY `term_hash` (`term_hash`), + KEY `parent_hash` (`parent_hash`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `tokens` ( `id` varchar(40) NOT NULL, `secret` text NOT NULL, `client_id` varchar(20) NOT NULL, - `expires` int(11) NOT NULL, + `expires` bigint(20) unsigned NOT NULL, `scope` varchar(200) NOT NULL, `uid` int(11) NOT NULL, PRIMARY KEY (`id`), @@ -865,6 +852,13 @@ CREATE TABLE IF NOT EXISTS `tokens` ( KEY `uid` (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `updates` ( + `ud_hash` char(128) NOT NULL, + `ud_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`ud_hash`), + KEY `ud_date` (`ud_date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `verify` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `channel` int(10) unsigned NOT NULL DEFAULT '0', @@ -894,6 +888,7 @@ CREATE TABLE IF NOT EXISTS `xchan` ( `xchan_connurl` char(255) NOT NULL DEFAULT '', `xchan_name` char(255) NOT NULL DEFAULT '', `xchan_network` char(255) NOT NULL DEFAULT '', + `xchan_instance_url` char(255) NOT NULL DEFAULT '', `xchan_flags` int(10) unsigned NOT NULL DEFAULT '0', `xchan_photo_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `xchan_name_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -902,11 +897,33 @@ CREATE TABLE IF NOT EXISTS `xchan` ( KEY `xchan_addr` (`xchan_addr`), KEY `xchan_name` (`xchan_name`), KEY `xchan_network` (`xchan_network`), + KEY `xchan_instance_url` (`xchan_instance_url`), KEY `xchan_url` (`xchan_url`), KEY `xchan_flags` (`xchan_flags`), KEY `xchan_connurl` (`xchan_connurl`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `xconfig` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `xchan` char(255) NOT NULL, + `cat` char(255) NOT NULL, + `k` char(255) NOT NULL, + `v` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `xchan` (`xchan`), + KEY `cat` (`cat`), + KEY `k` (`k`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `xign` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL DEFAULT '0', + `xchan` char(255) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `uid` (`uid`), + KEY `xchan` (`xchan`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `xlink` ( `xlink_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `xlink_xchan` char(255) NOT NULL DEFAULT '', @@ -918,10 +935,11 @@ CREATE TABLE IF NOT EXISTS `xlink` ( KEY `xlink_link` (`xlink_link`), KEY `xlink_updated` (`xlink_updated`), KEY `xlink_rating` (`xlink_rating`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `xprof` ( `xprof_hash` char(255) NOT NULL, + `xprof_age` tinyint(3) unsigned NOT NULL DEFAULT '0', `xprof_desc` char(255) NOT NULL DEFAULT '', `xprof_dob` char(12) NOT NULL DEFAULT '', `xprof_gender` char(255) NOT NULL DEFAULT '', @@ -941,12 +959,15 @@ CREATE TABLE IF NOT EXISTS `xprof` ( KEY `xprof_locale` (`xprof_locale`), KEY `xprof_region` (`xprof_region`), KEY `xprof_postcode` (`xprof_postcode`), - KEY `xprof_country` (`xprof_country`) + KEY `xprof_country` (`xprof_country`), + KEY `xprof_age` (`xprof_age`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `xtag` ( + `xtag_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `xtag_hash` char(255) NOT NULL, `xtag_term` char(255) NOT NULL DEFAULT '', - PRIMARY KEY (`xtag_hash`), - KEY `xtag_term` (`xtag_term`) + PRIMARY KEY (`xtag_id`), + KEY `xtag_term` (`xtag_term`), + KEY `xtag_hash` (`xtag_hash`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/install/htconfig.sample.php b/install/htconfig.sample.php index ebfc84543..14ae23676 100644..100755 --- a/install/htconfig.sample.php +++ b/install/htconfig.sample.php @@ -12,11 +12,26 @@ // Then set the following for your MySQL installation -$db_host = 'your.mysqlhost.com'; +$db_host = 'your.mysqlhost.com'; // Use 'localhost' if you aren't using a remote server +$db_port = 0; // leave 0 for default or set your port $db_user = 'mysqlusername'; $db_pass = 'mysqlpassword'; $db_data = 'mysqldatabasename'; + +/* + * Notice: Many of the following settings will be available in the admin panel + * after a successful site install. Once they are set in the admin panel, they + * are stored in the DB - and the DB setting will over-ride any corresponding + * setting in this file + * + * The command-line tool util/config is able to query and set the DB items + * directly if for some reason the admin panel is not available and a system + * setting requires modification. + * + */ + + // Choose a legal default timezone. If you are unsure, use "America/Los_Angeles". // It can be changed later and only applies to timestamps for anonymous viewers. @@ -24,7 +39,10 @@ $default_timezone = 'America/Los_Angeles'; // What is your site name? -$a->config['sitename'] = "Friendica Social Network"; +$a->config['system']['baseurl'] = 'https://myredsite.example'; +$a->config['system']['sitename'] = "Red Matrix"; +$a->config['system']['location_hash'] = 'if the auto install failed, put a unique random string here'; + // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting @@ -37,20 +55,12 @@ $a->config['sitename'] = "Friendica Social Network"; // must precisely match the email address of the person logged in. $a->config['system']['register_policy'] = REGISTER_OPEN; -$a->config['register_text'] = ''; +$a->config['system']['register_text'] = ''; $a->config['system']['admin_email'] = ''; -// Maximum size of an imported message, 0 is unlimited - -$a->config['max_import_size'] = 200000; - -// maximum size of uploaded photos - -$a->config['system']['maximagesize'] = 800000; - // Location of PHP command line processor -$a->config['php_path'] = 'php'; +$a->config['system']['php_path'] = 'php'; // Configure how we communicate with directory servers. @@ -61,18 +71,3 @@ $a->config['php_path'] = 'php'; $a->config['system']['directory_mode'] = DIRECTORY_MODE_NORMAL; - -// PuSH - aka pubsubhubbub URL. This makes delivery of public posts as fast as private posts - -$a->config['system']['huburl'] = 'http://pubsubhubbub.appspot.com'; - -// allowed themes (change this from admin panel after installation) - -$a->config['system']['allowed_themes'] = 'redbasic'; - -// default system theme - -$a->config['system']['theme'] = 'redbasic'; - - - diff --git a/install/update.php b/install/update.php index c40dd1982..c09bc9d64 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1031 ); +define( 'UPDATE_VERSION' , 1058 ); /** * @@ -52,7 +52,7 @@ function update_r1001() { `meta` CHAR( 255 ) NOT NULL DEFAULT '', `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY ( `id` ) - ) ENGINE = MYISAM "); + ) ENGINE = MYISAM DEFAULT CHARSET=utf8"); $r2 = q("alter table `verify` add index (`channel`), add index (`type`), add index (`token`), add index (`meta`), add index (`created`)"); @@ -91,7 +91,7 @@ function update_r1004() { `site_update` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `site_directory` CHAR( 255 ) NOT NULL DEFAULT '', PRIMARY KEY ( `site_url` ) -) ENGINE = MYISAM "); +) ENGINE = MYISAM DEFAULT CHARSET=utf8"); $r2 = q("alter table site add index (site_flags), add index (site_update), add index (site_directory) "); @@ -204,7 +204,7 @@ function update_r1013() { `xlink_xchan` CHAR( 255 ) NOT NULL DEFAULT '', `xlink_link` CHAR( 255 ) NOT NULL DEFAULT '', `xlink_updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' -) ENGINE = MYISAM "); +) ENGINE = MYISAM DEFAULT CHARSET=utf8"); $r2 = q("alter table xlink add index ( xlink_xchan ), add index ( xlink_link ), add index ( xlink_updated ) "); if($r && $r2) @@ -367,7 +367,7 @@ ADD INDEX ( `channel_deleted` ) "); } function update_r1030() { - $r = q("CREATE TABLE IF NOT EXISTS`issue` ( + $r = q("CREATE TABLE IF NOT EXISTS `issue` ( `issue_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , `issue_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `issue_updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -381,9 +381,292 @@ KEY `issue_assigned` (`issue_assigned`), KEY `issue_priority` (`issue_priority`), KEY `issue_status` (`issue_status`), KEY `issue_component` (`issue_component`) -) ENGINE = MYISAM "); +) ENGINE = MYISAM DEFAULT CHARSET=utf8"); if($r) return UPDATE_SUCCESS; return UPDATE_FAILED; } + +function update_r1031() { + $r = q("ALTER TABLE `account` ADD `account_external` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `account_email` , +ADD INDEX ( `account_external` )"); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + + +function update_r1032() { + $r = q("CREATE TABLE if not exists `xign` ( +`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , +`uid` INT NOT NULL DEFAULT '0', +`xchan` CHAR( 255 ) NOT NULL DEFAULT '', +KEY `uid` (`uid`), +KEY `xchan` (`xchan`) +) ENGINE = MYISAM DEFAULT CHARSET = utf8"); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1033() { + $r = q("CREATE TABLE if not exists `shares` ( +`share_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , +`share_type` INT NOT NULL DEFAULT '0', +`share_target` INT UNSIGNED NOT NULL DEFAULT '0', +`share_xchan` CHAR( 255 ) NOT NULL DEFAULT '', +KEY `share_type` (`share_type`), +KEY `share_target` (`share_target`), +KEY `share_xchan` (`share_xchan`) +) ENGINE = MYISAM DEFAULT CHARSET = utf8"); + + // if these fail don't bother reporting it + + q("drop table gcign"); + q("drop table gcontact"); + q("drop table glink"); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1034() { + $r = q("CREATE TABLE if not exists `updates` ( +`ud_hash` CHAR( 128 ) NOT NULL , +`ud_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', +PRIMARY KEY ( `ud_hash` ), +KEY `ud_date` ( `ud_date` ) +) ENGINE = MYISAM DEFAULT CHARSET = utf8"); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1035() { + $r = q("CREATE TABLE if not exists `xconfig` ( +`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , +`xchan` CHAR( 255 ) NOT NULL , +`cat` CHAR( 255 ) NOT NULL , +`k` CHAR( 255 ) NOT NULL , +`v` MEDIUMTEXT NOT NULL, +KEY `xchan` ( `xchan` ), +KEY `cat` ( `cat` ), +KEY `k` ( `k` ) +) ENGINE = MYISAM DEFAULT CHARSET = utf8"); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1036() { + $r = q("ALTER TABLE `profile` ADD `channels` TEXT NOT NULL AFTER `contact` "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} + + +function update_r1037() { + $r1 = q("ALTER TABLE `item` CHANGE `uri` `mid` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '', +CHANGE `parent_uri` `parent_mid` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '', + DROP INDEX `uri` , +ADD INDEX `mid` ( `mid` ), +DROP INDEX `parent_uri` , +ADD INDEX `parent_mid` ( `parent_mid` ), + DROP INDEX `uid_uri` , +ADD INDEX `uid_mid` ( `mid` , `uid` ) "); + + $r2 = q("ALTER TABLE `mail` CHANGE `uri` `mid` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , +CHANGE `parent_uri` `parent_mid` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , +DROP INDEX `uri` , +ADD INDEX `mid` ( `mid` ), + DROP INDEX `parent_uri` , +ADD INDEX `parent_mid` ( `parent_mid` ) "); + + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + + +function update_r1038() { + $r = q("ALTER TABLE `manage` CHANGE `mid` `xchan` CHAR( 255 ) NOT NULL DEFAULT '', drop index `mid`, ADD INDEX ( `xchan` )"); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} + + +function update_r1039() { + $r = q("ALTER TABLE `channel` CHANGE `channel_default_gid` `channel_default_group` CHAR( 255 ) NOT NULL DEFAULT ''"); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} + +function update_r1040() { + $r1 = q("ALTER TABLE `session` CHANGE `expire` `expire` BIGINT UNSIGNED NOT NULL "); + $r2 = q("ALTER TABLE `tokens` CHANGE `expires` `expires` BIGINT UNSIGNED NOT NULL "); + + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1041() { + $r = q("ALTER TABLE `outq` ADD `outq_driver` CHAR( 32 ) NOT NULL DEFAULT '' AFTER `outq_channel` "); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + + +function update_r1042() { + $r = q("ALTER TABLE `hubloc` ADD `hubloc_updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', +ADD `hubloc_connected` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', ADD INDEX ( `hubloc_updated` ), ADD INDEX ( `hubloc_connected` )"); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + + +function update_r1043() { + $r = q("ALTER TABLE `item` ADD `comment_policy` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `coord` , +ADD INDEX ( `comment_policy` ) "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1044() { + $r = q("ALTER TABLE `term` ADD `imgurl` CHAR( 255 ) NOT NULL , +ADD INDEX ( `imgurl` ) "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1045() { + $r = q("ALTER TABLE `site` ADD `site_register` INT NOT NULL DEFAULT '0', +ADD INDEX ( `site_register` ) "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1046() { + $r = q("ALTER TABLE `term` ADD `term_hash` CHAR( 255 ) NOT NULL DEFAULT '', +ADD INDEX ( `term_hash` ) "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1047() { + $r = q("ALTER TABLE `xprof` ADD `xprof_age` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `xprof_hash` , +ADD INDEX ( `xprof_age` ) "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1048() { + $r = q("CREATE TABLE IF NOT EXISTS `obj` ( + `obj_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `obj_page` char(64) NOT NULL DEFAULT '', + `obj_verb` char(255) NOT NULL DEFAULT '', + `obj_type` int(10) unsigned NOT NULL DEFAULT '0', + `obj_obj` char(255) NOT NULL DEFAULT '', + `obj_channel` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`obj_id`), + KEY `obj_verb` (`obj_verb`), + KEY `obj_page` (`obj_page`), + KEY `obj_type` (`obj_type`), + KEY `obj_channel` (`obj_channel`), + KEY `obj_obj` (`obj_obj`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 "); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + + +function update_r1049() { + $r = q("ALTER TABLE `term` ADD `parent_hash` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `term_hash` , ADD INDEX ( `parent_hash` ) "); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1050() { + $r = q("ALTER TABLE `xtag` DROP PRIMARY KEY , ADD `xtag_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST , ADD INDEX ( `xtag_hash` ) "); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1051() { + $r = q("ALTER TABLE `photo` ADD `photo_flags` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `profile` , ADD INDEX ( `photo_flags` ) "); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + + +function update_r1052() { + $r = q("ALTER TABLE `channel` ADD UNIQUE (`channel_address`) "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1053() { + $r = q("ALTER TABLE `profile` ADD `chandesc` TEXT NOT NULL DEFAULT '' AFTER `pdesc` "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1054() { + $r = q("ALTER TABLE `item` CHANGE `title` `title` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1055() { + $r = q("ALTER TABLE `mail` CHANGE `title` `title` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1056() { + $r = q("ALTER TABLE `xchan` ADD `xchan_instance_url` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `xchan_network` , +ADD INDEX ( `xchan_instance_url` ) "); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + +function update_r1057() { + $r = q("drop table intro"); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} |