install:
- composer install
before_script:
- - cp config/local-sample.ini.php config/local.ini.php
+ - cp config/local-sample.config.php config/local.config.php
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
- mysql -utravis test < database.sql
- echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
4. If you know in advance that it will be impossible for the web server to
write or create files in the config/ subfolder, create an empty file called
-local.ini.php and make it writable by the web server.
+local.config.php and make it writable by the web server.
5. Visit your website with a web browser and follow the instructions. Please
note any error messages and correct these before continuing.
6. *If* the automated installation fails for any reason, check the following:
- - "config/local.ini.php" exists
- If not, edit local-sample.ini.php and change system settings. Rename
-to local.ini.php
+ - "config/local.config.php" exists
+ If not, edit local-sample.config.php and change system settings. Rename
+to local.config.php
- Database is populated.
If not, import the contents of "database.sql" with phpmyadmin
or mysql command line
Registration errors should all be recoverable automatically.
If you get any *critical* failure at this point, it generally indicates the
database was not installed correctly. You might wish to move/rename
-local.ini.php to another name and empty (called 'dropping') the database
+local.config.php to another name and empty (called 'dropping') the database
tables, so that you can start fresh.
****************************************************************************
database or whatever you can think of. So once the installation of your
Friendica node is done, you should make yoursef a backup plan.
-The most important file is the `config/local.ini.php` file in the base directory.
+The most important file is the `config/local.config.php` file in the base directory.
As it stores all your data, you should also have a recent dump of your
Friendica database at hand, should you have to recover your node.
#####################################################################
-- If you are unable to write the file config/local.ini.php during installation
+- If you are unable to write the file config/local.config.php during installation
due to permissions issues:
#####################################################################
create an empty file with that name and give it world-write permission.
For Linux:
-% touch config/local.ini.php
-% chmod 664 config/local.ini.php
+% touch config/local.config.php
+% chmod 664 config/local.config.php
Retry the installation. As soon as the database has been created,
******* this is important *********
-% chmod 644 config/local.ini.php
+% chmod 644 config/local.config.php
#####################################################################
- Some configurations with "suhosin" security are configured without
proc_open. These scripts themselves also use proc_open and fail, because they
are NOT called with -d suhosin.executor.func.blacklist=none.
-So the simple solution is to put the correct parameters into config/local.ini.php:
+So the simple solution is to put the correct parameters into config/local.config.php:
-[config]
-; Location of PHP command line processor
-php_path = "/usr/bin/php -d suhosin.executor.func.blacklist=none -d suhosin.executor.eval.blacklist=none"
+ 'config' => [
+ //Location of PHP command line processor
+ '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
execute php-scripts that also use proc_open, but it took me quite some time to
php bin/composer.phar install
# initial config file for friendica in vagrant
-#cp /vagrant/util/htconfig.vagrant.php /vagrant/.htconfig.php
-cp /vagrant/util/local.ini.vagrant.php /vagrant/config/local.ini.php
+cp /vagrant/util/local.config.vagrant.php /vagrant/config/local.config.php
# copy the .htaccess-dist file to .htaccess so that rewrite rules work
cp /vagrant/.htaccess-dist /vagrant/.htaccess
$this->mode = 0;
- if (!file_exists($this->basepath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'local.ini.php')
- && !file_exists($this->basepath . DIRECTORY_SEPARATOR . '.htconfig.php')) {
+ if (!file_exists($this->basepath . '/config/local.config.php')
+ && !file_exists($this->basepath . '/config/local.ini.php')
+ && !file_exists($this->basepath . '/.htconfig.php')) {
return;
}
bin/console autoinstall [-h|--help|-?] [-v] [-a] [-f]
Description
- Installs Friendica with data based on the local.ini.php file or environment variables
+ Installs Friendica with data based on the local.config.php file or environment variables
Notes
Not checking .htaccess/URL-Rewrite during CLI installation.
-h|--help|-? Show help information
-v Show more debug information.
-a All setup checks are required (except .htaccess)
- -f|--file <config> prepared config file (e.g. "config/local.ini.php" itself) which will override every other config option - except the environment variables)
+ -f|--file <config> prepared config file (e.g. "config/local.config.php" itself) which will override every other config option - except the environment variables)
-s|--savedb Save the DB credentials to the file (if environment variables is used)
-H|--dbhost <host> The host of the mysql/mariadb database (env MYSQL_HOST)
-p|--dbport <port> The port of the mysql/mariadb database (env MYSQL_PORT)
FRIENDICA_LANG The langauge of Friendica
Examples
- bin/console autoinstall -f 'input.ini.php
- Installs Friendica with the prepared 'input.ini.php' file
+ bin/console autoinstall -f 'input.config.php
+ Installs Friendica with the prepared 'input.config.php' file
bin/console autoinstall --savedb
- Installs Friendica with environment variables and saves them to the 'config/local.ini.php' file
+ Installs Friendica with environment variables and saves them to the 'config/local.config.php' file
bin/console autoinstall -h localhost -p 3365 -U user -P passwort1234 -d friendica
Installs Friendica with a local mysql database with credentials
$config_file = $this->getOption(['f', 'file']);
if (!empty($config_file)) {
- if ($config_file != 'config' . DIRECTORY_SEPARATOR . 'local.ini.php') {
+ if ($config_file != 'config' . DIRECTORY_SEPARATOR . 'local.config.php') {
// Copy config file
$this->out("Copying config file...\n");
- if (!copy($a->getBasePath() . DIRECTORY_SEPARATOR . $config_file, $a->getBasePath() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'local.ini.php')) {
- throw new RuntimeException("ERROR: Saving config file failed. Please copy '$config_file' to '" . $a->getBasePath() . "'" . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "local.ini.php' manually.\n");
+ if (!copy($a->getBasePath() . DIRECTORY_SEPARATOR . $config_file, $a->getBasePath() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'local.config.php')) {
+ throw new RuntimeException("ERROR: Saving config file failed. Please copy '$config_file' to '" . $a->getBasePath() . "'" . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "local.config.php' manually.\n");
}
}
Theme::install(Config::get('system', 'theme'));
$this->out(" Complete\n\n");
} else {
- $this->out(" Theme setting is empty. Please check the file 'config/local.ini.php'\n\n");
+ $this->out(" Theme setting is empty. Please check the file 'config/local.config.php'\n\n");
}
$this->out("\nInstallation is finished\n");
/**
* Executes the installation of Friendica in the given environment.
- * - Creates `config/local.ini.php`
+ * - Creates `config/local.config.php`
* - Installs Database Structure
*
* @param string $phppath Path to the PHP-Binary (optional, if not set e.g. 'php' or '/usr/bin/php')
*/
public function createConfig($phppath, $urlpath, $dbhost, $dbuser, $dbpass, $dbdata, $timezone, $language, $adminmail, $basepath)
{
- $tpl = Renderer::getMarkupTemplate('local.ini.tpl');
+ $tpl = Renderer::getMarkupTemplate('local.config.tpl');
$txt = Renderer::replaceMacros($tpl, [
'$phpath' => $phppath,
'$dbhost' => $dbhost,
'$adminmail' => $adminmail,
]);
- $result = file_put_contents($basepath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'local.ini.php', $txt);
+ $result = file_put_contents($basepath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'local.config.php', $txt);
if (!$result) {
- $this->addCheck(L10n::t('The database configuration file "config/local.ini.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.'), false, false, htmlentities($txt, ENT_COMPAT, 'UTF-8'));
+ $this->addCheck(L10n::t('The database configuration file "config/local.config.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.'), false, false, htmlentities($txt, ENT_COMPAT, 'UTF-8'));
}
return $result;
}
/**
- * "config/local.ini.php" - Check
+ * "config/local.config.php" - Check
*
- * Checks if it's possible to create the "config/local.ini.php"
+ * Checks if it's possible to create the "config/local.config.php"
*
* @return bool false if something required failed
*/
{
$status = true;
$help = "";
- if ((file_exists('config/local.ini.php') && !is_writable('config/local.ini.php')) ||
- (!file_exists('config/local.ini.php') && !is_writable('.'))) {
+ if ((file_exists('config/local.config.php') && !is_writable('config/local.config.php')) ||
+ (!file_exists('config/local.config.php') && !is_writable('.'))) {
$status = false;
- $help = L10n::t('The web installer needs to be able to create a file called "local.ini.php" in the "config" folder of your web server and it is unable to do so.') . EOL;
+ $help = L10n::t('The web installer needs to be able to create a file called "local.config.php" in the "config" folder of your web server and it is unable to do so.') . EOL;
$help .= L10n::t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.') . EOL;
- $help .= L10n::t('At the end of this procedure, we will give you a text to save in a file named local.ini.php in your Friendica "config" folder.') . EOL;
+ $help .= L10n::t('At the end of this procedure, we will give you a text to save in a file named local.config.php in your Friendica "config" folder.') . EOL;
$help .= L10n::t('You can alternatively skip this procedure and perform a manual installation. Please see the file "INSTALL.txt" for instructions.') . EOL;
}
- $this->addCheck(L10n::t('config/local.ini.php is writable'), $status, false, $help);
+ $this->addCheck(L10n::t('config/local.config.php is writable'), $status, false, $help);
// Local INI File is not required
return true;
// create a virtual directory and copy all needed files and folders to it
$this->root = vfsStream::setup('friendica', null, $structure);
- $this->setConfigFile('config.ini.php');
- $this->setConfigFile('settings.ini.php');
- $this->setConfigFile('local.ini.php');
+ $this->setConfigFile('defaults.config.php');
+ $this->setConfigFile('settings.config.php');
+ $this->setConfigFile('local.config.php');
$this->setConfigFile('dbstructure.config.php');
}
{
$mode = new Mode($this->root->url());
- $this->assertTrue($this->root->hasChild('config/local.ini.php'));
+ $this->assertTrue($this->root->hasChild('config/local.config.php'));
- $this->delConfigFile('local.ini.php');
+ $this->delConfigFile('local.config.php');
- $this->assertFalse($this->root->hasChild('config/local.ini.php'));
+ $this->assertFalse($this->root->hasChild('config/local.config.php'));
$mode->determine();
{
parent::setUp();
- if ($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.ini.php')) {
+ if ($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.config.php')) {
$this->root->getChild('config')
- ->removeChild('local.ini.php');
+ ->removeChild('local.config.php');
}
$this->db_host = getenv('MYSQL_HOST');
}
/**
- * Creates the arguments which is asserted to be passed to 'replaceMacros()' for creating the local.ini.php
+ * Creates the arguments which is asserted to be passed to 'replaceMacros()' for creating the local.config.php
*
* @param bool $withDb if true, DB will get saved too
*
$this->mockUpdate([false, true, true], null, 1);
$config = <<<CONF
-<?php return <<<INI
-
-[database]
-hostname =
-username =
-password =
-database =
-charset = utf8mb4
-
-
-; ****************************************************************
-; The configuration below will be overruled by the admin panel.
-; Changes made below will only have an effect if the database does
-; not contain any configuration for the friendica system.
-; ****************************************************************
-
-[config]
-admin_email =
-
-sitename = Friendica Social Network
-
-register_policy = REGISTER_OPEN
-register_text =
-
-[system]
-default_timezone = UTC
-
-language = en
-INI;
-// Keep this line
+<?php
+// Local configuration
+
+// If you're unsure about what any of the config keys below do, please check the config/defaults.config.php for detailed
+// documentation of their data type and behavior.
+
+return [
+ 'database' => [
+ 'hostname' => '',
+ 'username' => '',
+ 'password' => '',
+ 'database' => '',
+ 'charset' => 'utf8mb4',
+ ],
+
+ // ****************************************************************
+ // The configuration below will be overruled by the admin panel.
+ // Changes made below will only have an effect if the database does
+ // not contain any configuration for the friendica system.
+ // ****************************************************************
+
+ 'config' => [
+ 'admin_email' => '',
+ 'sitename' => 'Friendica Social Network',
+ 'register_policy' => 'REGISTER_OPEN',
+ 'register_text' => '',
+ ],
+ 'system' => [
+ 'default_timezone' => 'UTC',
+ 'language' => 'en',
+ ],
+];
CONF;
- vfsStream::newFile('prepared.ini.php')
+ vfsStream::newFile('prepared.config.php')
->at($this->root)
->setContent($config);
$console = new AutomaticInstallation($this->consoleArgv);
- $console->setOption('f', 'prepared.ini.php');
+ $console->setOption('f', 'prepared.config.php');
$txt = $this->dumpExecute($console);
$this->assertFinished($txt, false, true);
- $this->assertTrue($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.ini.php'));
+ $this->assertTrue($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.config.php'));
}
/**
$this->mockExistsTable('user', false, 1);
$this->mockUpdate([false, true, true], null, 1);
- $this->mockGetMarkupTemplate('local.ini.tpl', 'testTemplate', 1);
+ $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
$this->mockReplaceMacros('testTemplate', $this->createArgumentsForMacro(true), '', 1);
$this->assertTrue(putenv('FRIENDICA_ADMIN_MAIL=admin@friendica.local'));
$this->mockExistsTable('user', false, 1);
$this->mockUpdate([false, true, true], null, 1);
- $this->mockGetMarkupTemplate('local.ini.tpl', 'testTemplate', 1);
+ $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
$this->mockReplaceMacros('testTemplate', $this->createArgumentsForMacro(false), '', 1);
$this->assertTrue(putenv('FRIENDICA_ADMIN_MAIL=admin@friendica.local'));
$this->mockExistsTable('user', false, 1);
$this->mockUpdate([false, true, true], null, 1);
- $this->mockGetMarkupTemplate('local.ini.tpl', 'testTemplate', 1);
+ $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
$this->mockReplaceMacros('testTemplate', $this->createArgumentsForMacro(true), '', 1);
$console = new AutomaticInstallation($this->consoleArgv);
{
$this->mockConnect(false, 1);
- $this->mockGetMarkupTemplate('local.ini.tpl', 'testTemplate', 1);
+ $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
$this->mockReplaceMacros('testTemplate', $this->createArgumentsForMacro(false), '', 1);
$this->assertTrue(putenv('FRIENDICA_ADMIN_MAIL=admin@friendica.local'));
bin/console autoinstall [-h|--help|-?] [-v] [-a] [-f]
Description
- Installs Friendica with data based on the local.ini.php file or environment variables
+ Installs Friendica with data based on the local.config.php file or environment variables
Notes
Not checking .htaccess/URL-Rewrite during CLI installation.
-h|--help|-? Show help information
-v Show more debug information.
-a All setup checks are required (except .htaccess)
- -f|--file <config> prepared config file (e.g. "config/local.ini.php" itself) which will override every other config option - except the environment variables)
+ -f|--file <config> prepared config file (e.g. "config/local.config.php" itself) which will override every other config option - except the environment variables)
-s|--savedb Save the DB credentials to the file (if environment variables is used)
-H|--dbhost <host> The host of the mysql/mariadb database (env MYSQL_HOST)
-p|--dbport <port> The port of the mysql/mariadb database (env MYSQL_PORT)
FRIENDICA_LANG The langauge of Friendica
Examples
- bin/console autoinstall -f 'input.ini.php
- Installs Friendica with the prepared 'input.ini.php' file
+ bin/console autoinstall -f 'input.config.php
+ Installs Friendica with the prepared 'input.config.php' file
bin/console autoinstall --savedb
- Installs Friendica with environment variables and saves them to the 'config/local.ini.php' file
+ Installs Friendica with environment variables and saves them to the 'config/local.config.php' file
bin/console autoinstall -h localhost -p 3365 -U user -P passwort1234 -d friendica
Installs Friendica with a local mysql database with credentials
*/
public function testCheckLocalIni()
{
- $this->assertTrue($this->root->hasChild('config/local.ini.php'));
+ $this->assertTrue($this->root->hasChild('config/local.config.php'));
$install = new Installer();
$this->assertTrue($install->checkLocalIni());
- $this->delConfigFile('local.ini.php');
+ $this->delConfigFile('local.config.php');
- $this->assertFalse($this->root->hasChild('config/local.ini.php'));
+ $this->assertFalse($this->root->hasChild('config/local.config.php'));
$install = new Installer();
$this->assertTrue($install->checkLocalIni());
--- /dev/null
+<?php\r
+\r
+// Local configuration\r
+\r
+/* If automatic system installation fails:\r
+ *\r
+ * Copy this file to local.config.php\r
+ *\r
+ * Why local.config.php? Because it contains sensitive information which could\r
+ * give somebody complete control of your database. Apache's default\r
+ * configuration will interpret any .php file as a script and won't show the values\r
+ *\r
+ * Then set the following for your MySQL installation\r
+ */\r
+\r
+return [\r
+ 'database' => [\r
+ 'hostname' => 'localhost',\r
+ 'username' => 'mysqlusername',\r
+ 'password' => 'mysqlpassword',\r
+ 'database' => 'mysqldatabasename',\r
+ 'charset' => 'utf8mb4',\r
+ ],\r
+\r
+ // ****************************************************************\r
+ // The configuration below will be overruled by the admin panel.\r
+ // Changes made below will only have an effect if the database does\r
+ // not contain any configuration for the friendica system.\r
+ // ****************************************************************\r
+\r
+ 'config' => [\r
+ 'admin_email' => 'admin@friendica.local',\r
+ 'sitename' => 'Friendica Social Network',\r
+ 'register_policy' => 'REGISTER_OPEN',\r
+ 'register_text' => '',\r
+ ],\r
+ 'system' => [\r
+ 'default_timezone' => 'UTC',\r
+ 'language' => 'en',\r
+ ],\r
+];\r
--- /dev/null
+<?php
+
+// Local configuration
+
+// If you're unsure about what any of the config keys below do, please check the config/defaults.config.php for detailed
+// documentation of their data type and behavior.
+
+return [
+ 'database' => [
+ 'hostname' => '{{$dbhost}}',
+ 'username' => '{{$dbuser}}',
+ 'password' => '{{$dbpass}}',
+ 'database' => '{{$dbdata}}',
+ 'charset' => 'utf8mb4',
+ ],
+
+ // ****************************************************************
+ // The configuration below will be overruled by the admin panel.
+ // Changes made below will only have an effect if the database does
+ // not contain any configuration for the friendica system.
+ // ****************************************************************
+
+ 'config' => [
+ 'php_path' => '{{$phpath}}',
+ 'admin_email' => '{{$adminmail}}',
+ 'sitename' => 'Friendica Social Network',
+ 'register_policy' => 'REGISTER_OPEN',
+ 'max_import_size' => 200000,
+ ],
+ 'system' => [
+ 'urlpath' => '{{$urlpath}}',
+ 'default_timezone' => '{{$timezone}}',
+ 'language' => '{{$language}}',
+ ],
+];