{"config":{"indexing":"full","lang":["en","de"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"admin/config/","tags":["admin","configuration"],"text":"Config values that can only be set in config/local.config.php # Friendica's configuration is done in two places: in PHP array configuration files and in the config database table. Database config values overwrite the same file config values. File configuration # The configuration format for file configuration is an array returned from a PHP file. This prevents your webserver from displaying your private configuration. It interprets the configuration files and displays nothing. A typical configuration file looks like this: [ // Comment line 'key' => 'value' , ], 'section2' => [ 'array' => [ 'value0' , 'value1' , 'value2' ], ], ]; Configuration location # The config directory holds key configuration files and can have different config files. All of them have to end with .config.php and must not include -sample in their name. Some examples of common known configuration files: - local.config.php holds the current node custom configuration. - addon.config.php is optional and holds the custom configuration for specific addons. Addons can define their own default configuration values in addon/[addon]/config/[addon].config.php which is loaded when the addon is activated. If needed, an alternative config path can be used by using the FRIENDICA_CONFIG_DIR environment variable (full path required!). This is useful in case of hardening the system by separating configuration from program binaries. Static Configuration location # The static directory holds the codebase default configurations files. They must not be changed by users, because they can get changed from release to release. Currently, the following configurations are included: - defaults.config.php holds the default values for all the configuration keys that can only be set in local.config.php . - settings.config.php holds the default values for some configuration keys that are set through the admin settings page. Migrating from .htconfig.php to config/local.config.php # The legacy .htconfig.php configuration file is still supported, but is deprecated and will be removed in a subsequent Friendica release. The migration is pretty straightforward: If you had any addon-specific configuration in your .htconfig.php , just copy config/addon-sample.config.php to config/addon.config.php and move your configuration values. Afterwards, copy config/local-sample.config.php to config/local.config.php , move the remaining configuration values to it according to the following conversion chart, then rename your .htconfig.php to check your node is working as expected before deleting it. table.config { margin: 1em 0; background-color: #f9f9f9; border: 1px solid #aaa; border-collapse: collapse; color: #000; width: 100%; } table.config > tr > th, table.config > tr > td, table.config > * > tr > th, table.config > * > tr > td { border: 1px solid #aaa; padding: 0.2em 0.4em } table.config > tr > th, table.config > * > tr > th { background-color: #f2f2f2; text-align: center; width: 50% } .htconfig.php config/local.config.php $db_host = 'localhost'; $db_user = 'mysqlusername'; $db_pass = 'mysqlpassword'; $db_data = 'mysqldatabasename'; $a->config[\"system\"][\"db_charset\"] = 'utf8mb4'; 'database' => [ 'hostname' => 'localhost', 'username' => 'mysqlusername', 'password' => 'mysqlpassword', 'database' => 'database', 'charset' => 'utf8mb4', ], $a->config[\"section\"][\"key\"] = \"value\"; 'section' => [ 'key' => 'value', ], $a->config[\"section\"][\"key\"] = array( \"value1\", \"value2\", \"value3\" ); 'section' => [ 'key' => ['value1', 'value2', 'value3'], ], $a->config[\"key\"] = \"value\"; 'config' => [ 'key' => 'value', ], $a->config['register_policy'] = REGISTER_CLOSED; 'config' => [ 'register_policy' => \\Friendica\\Module\\Register::CLOSED, ], $a->path = \"value\"; 'system' => [ 'urlpath' => 'value', ], $default_timezone = \"value\"; 'system' => [ 'default_timezone' => 'value', ], $pidfile = \"value\"; 'system' => [ 'pidfile' => 'value', ], $lang = \"value\"; 'system' => [ 'language' => 'value', ], Migrating from config/local.ini.php to config/local.config.php # The legacy config/local.ini.php configuration file is still supported, but is deprecated and will be removed in a subsequent Friendica release. The migration is pretty straightforward: If you had any addon-specific configuration in your config/addon.ini.php , just copy config/addon-sample.config.php to config/addon.config.php and move your configuration values. Afterwards, copy config/local-sample.config.php to config/local.config.php , move the remaining configuration values to it according to the following conversion chart, then rename your config/local.ini.php file to check your node is working as expected before deleting it. config/local.ini.php config/local.config.php [database] hostname = localhost username = mysqlusername password = mysqlpassword database = mysqldatabasename charset = utf8mb4 'database' => [ 'hostname' => 'localhost', 'username' => 'mysqlusername', 'password' => 'mysqlpassword', 'database' => 'database', 'charset' => 'utf8mb4', ], [section] key = value 'section' => [ 'key' => 'value', ], [config] register_policty = REGISTER_CLOSED 'config' => [ 'register_policy' => \\Friendica\\Module\\Register::CLOSED, ], [section] key[] = value1 key[] = value2 key[] = value3 'section' => [ 'key' => ['value1', 'value2', 'value3'], ], Database Settings # The configuration variables database.hostname , database.username , database.password , database.database and database.charset are holding your credentials for the database connection. If you need to specify a port to access the database, you can do so by appending :portnumber to the database.hostname variable. 'database' => [ 'hostname' => 'your.mysqlhost.com:123456', ] If all the following environment variables are set, Friendica will use them instead of the previously configured variables for the db: MYSQL_HOST MYSQL_PORT MYSQL_USERNAME MYSQL_PASSWORD MYSQL_DATABASE Config values that can only be set in config/local.config.php # There are some config values that haven't found their way into the administration page. This has several reasons. Maybe they are part of a current development that isn't considered stable and will be added later in the administration page when it is considered safe. Or it triggers something that isn't expected to be of public interest. Or it is for testing purposes only. Attention: Please be warned that you shouldn't use one of these values without the knowledge what it could trigger. Especially don't do that with undocumented values. These configurations keys and their default value are listed in static/defaults.config.php and should be overwritten in config/local.config.php . Administrator Options # Enabling the admin panel for an account, and thus making the account holder admin of the node, is done by setting the variable 'config' => [ 'admin_email' => 'someone@example.com', ] Where you have to match the email address used for the account with the one you enter to the config/local.config.php file. If more than one account should be able to access the admin panel, separate the email addresses with a comma. 'config' => [ 'admin_email' => 'someone@example.com,someoneelse@example.com', ] If you want to have a more personalized closing line for the notification emails you can set a variable for the admin_name . 'config' => [ 'admin_name' => 'Marvin', ]","title":"Config Values"},{"location":"admin/config/#config-values-that-can-only-be-set-in-configlocalconfigphp","text":"Friendica's configuration is done in two places: in PHP array configuration files and in the config database table. Database config values overwrite the same file config values.","title":"Config values that can only be set in config/local.config.php"},{"location":"admin/config/#file-configuration","text":"The configuration format for file configuration is an array returned from a PHP file. This prevents your webserver from displaying your private configuration. It interprets the configuration files and displays nothing. A typical configuration file looks like this: [ // Comment line 'key' => 'value' , ], 'section2' => [ 'array' => [ 'value0' , 'value1' , 'value2' ], ], ];","title":"File configuration"},{"location":"admin/config/#configuration-location","text":"The config directory holds key configuration files and can have different config files. All of them have to end with .config.php and must not include -sample in their name. Some examples of common known configuration files: - local.config.php holds the current node custom configuration. - addon.config.php is optional and holds the custom configuration for specific addons. Addons can define their own default configuration values in addon/[addon]/config/[addon].config.php which is loaded when the addon is activated. If needed, an alternative config path can be used by using the FRIENDICA_CONFIG_DIR environment variable (full path required!). This is useful in case of hardening the system by separating configuration from program binaries.","title":"Configuration location"},{"location":"admin/config/#static-configuration-location","text":"The static directory holds the codebase default configurations files. They must not be changed by users, because they can get changed from release to release. Currently, the following configurations are included: - defaults.config.php holds the default values for all the configuration keys that can only be set in local.config.php . - settings.config.php holds the default values for some configuration keys that are set through the admin settings page.","title":"Static Configuration location"},{"location":"admin/config/#migrating-from-htconfigphp-to-configlocalconfigphp","text":"The legacy .htconfig.php configuration file is still supported, but is deprecated and will be removed in a subsequent Friendica release. The migration is pretty straightforward: If you had any addon-specific configuration in your .htconfig.php , just copy config/addon-sample.config.php to config/addon.config.php and move your configuration values. Afterwards, copy config/local-sample.config.php to config/local.config.php , move the remaining configuration values to it according to the following conversion chart, then rename your .htconfig.php to check your node is working as expected before deleting it. table.config { margin: 1em 0; background-color: #f9f9f9; border: 1px solid #aaa; border-collapse: collapse; color: #000; width: 100%; } table.config > tr > th, table.config > tr > td, table.config > * > tr > th, table.config > * > tr > td { border: 1px solid #aaa; padding: 0.2em 0.4em } table.config > tr > th, table.config > * > tr > th { background-color: #f2f2f2; text-align: center; width: 50% } .htconfig.php config/local.config.php $db_host = 'localhost'; $db_user = 'mysqlusername'; $db_pass = 'mysqlpassword'; $db_data = 'mysqldatabasename'; $a->config[\"system\"][\"db_charset\"] = 'utf8mb4'; 'database' => [ 'hostname' => 'localhost', 'username' => 'mysqlusername', 'password' => 'mysqlpassword', 'database' => 'database', 'charset' => 'utf8mb4', ], $a->config[\"section\"][\"key\"] = \"value\"; 'section' => [ 'key' => 'value', ], $a->config[\"section\"][\"key\"] = array( \"value1\", \"value2\", \"value3\" ); 'section' => [ 'key' => ['value1', 'value2', 'value3'], ], $a->config[\"key\"] = \"value\"; 'config' => [ 'key' => 'value', ], $a->config['register_policy'] = REGISTER_CLOSED; 'config' => [ 'register_policy' => \\Friendica\\Module\\Register::CLOSED, ], $a->path = \"value\"; 'system' => [ 'urlpath' => 'value', ], $default_timezone = \"value\"; 'system' => [ 'default_timezone' => 'value', ], $pidfile = \"value\"; 'system' => [ 'pidfile' => 'value', ], $lang = \"value\"; 'system' => [ 'language' => 'value', ],","title":"Migrating from .htconfig.php to config/local.config.php"},{"location":"admin/config/#migrating-from-configlocaliniphp-to-configlocalconfigphp","text":"The legacy config/local.ini.php configuration file is still supported, but is deprecated and will be removed in a subsequent Friendica release. The migration is pretty straightforward: If you had any addon-specific configuration in your config/addon.ini.php , just copy config/addon-sample.config.php to config/addon.config.php and move your configuration values. Afterwards, copy config/local-sample.config.php to config/local.config.php , move the remaining configuration values to it according to the following conversion chart, then rename your config/local.ini.php file to check your node is working as expected before deleting it. config/local.ini.php config/local.config.php [database] hostname = localhost username = mysqlusername password = mysqlpassword database = mysqldatabasename charset = utf8mb4 'database' => [ 'hostname' => 'localhost', 'username' => 'mysqlusername', 'password' => 'mysqlpassword', 'database' => 'database', 'charset' => 'utf8mb4', ], [section] key = value 'section' => [ 'key' => 'value', ], [config] register_policty = REGISTER_CLOSED 'config' => [ 'register_policy' => \\Friendica\\Module\\Register::CLOSED, ], [section] key[] = value1 key[] = value2 key[] = value3 'section' => [ 'key' => ['value1', 'value2', 'value3'], ],","title":"Migrating from config/local.ini.php to config/local.config.php"},{"location":"admin/config/#database-settings","text":"The configuration variables database.hostname , database.username , database.password , database.database and database.charset are holding your credentials for the database connection. If you need to specify a port to access the database, you can do so by appending :portnumber to the database.hostname variable. 'database' => [ 'hostname' => 'your.mysqlhost.com:123456', ] If all the following environment variables are set, Friendica will use them instead of the previously configured variables for the db: MYSQL_HOST MYSQL_PORT MYSQL_USERNAME MYSQL_PASSWORD MYSQL_DATABASE","title":"Database Settings"},{"location":"admin/config/#config-values-that-can-only-be-set-in-configlocalconfigphp_1","text":"There are some config values that haven't found their way into the administration page. This has several reasons. Maybe they are part of a current development that isn't considered stable and will be added later in the administration page when it is considered safe. Or it triggers something that isn't expected to be of public interest. Or it is for testing purposes only. Attention: Please be warned that you shouldn't use one of these values without the knowledge what it could trigger. Especially don't do that with undocumented values. These configurations keys and their default value are listed in static/defaults.config.php and should be overwritten in config/local.config.php .","title":"Config values that can only be set in config/local.config.php"},{"location":"admin/config/#administrator-options","text":"Enabling the admin panel for an account, and thus making the account holder admin of the node, is done by setting the variable 'config' => [ 'admin_email' => 'someone@example.com', ] Where you have to match the email address used for the account with the one you enter to the config/local.config.php file. If more than one account should be able to access the admin panel, separate the email addresses with a comma. 'config' => [ 'admin_email' => 'someone@example.com,someoneelse@example.com', ] If you want to have a more personalized closing line for the notification emails you can set a variable for the admin_name . 'config' => [ 'admin_name' => 'Marvin', ]","title":"Administrator Options"},{"location":"admin/install-ejabberd/","tags":["admin","ejabberd"],"text":"Install an ejabberd with synchronized credentials # Ejabberd is a chat server that uses XMPP as messaging protocol that you can use with a large amount of clients. In conjunction with the \"xmpp\" addon it can be used for a web based chat solution for your users. Installation # Change its owner to whichever user is running the server, i.e. ejabberd $ chown ejabberd:ejabberd /path/to/friendica/bin/auth_ejabberd.php Change the access mode, so it is readable only to the user ejabberd and has exec $ chmod 700 /path/to/friendica/bin/auth_ejabberd.php Edit your ejabberd.cfg file, comment out your auth_method and add: {auth_method, external}. {extauth_program, \"/path/to/friendica/bin/auth_ejabberd.php\"}. Disable the module \"mod_register\" and disable the registration: {access, register, [{deny, all}]}. Enable BOSH: Enable the module \"mod_http_bind\" Edit this line: {5280, ejabberd_http, [captcha, http_poll, http_bind]} In your apache configuration for your site add this line: ProxyPass /http-bind http://127.0.0.1:5280/http-bind retry=0 Restart your ejabberd service, you should be able to log in with your friendica credentials Other hints # if a user has a space or a @ in the nickname, the user has to replace these characters: \" \" (space) is replaced with \"%20\" \"@\" is replaced with \"(a)\"","title":"Install ejabberd"},{"location":"admin/install-ejabberd/#install-an-ejabberd-with-synchronized-credentials","text":"Ejabberd is a chat server that uses XMPP as messaging protocol that you can use with a large amount of clients. In conjunction with the \"xmpp\" addon it can be used for a web based chat solution for your users.","title":"Install an ejabberd with synchronized credentials"},{"location":"admin/install-ejabberd/#installation","text":"Change its owner to whichever user is running the server, i.e. ejabberd $ chown ejabberd:ejabberd /path/to/friendica/bin/auth_ejabberd.php Change the access mode, so it is readable only to the user ejabberd and has exec $ chmod 700 /path/to/friendica/bin/auth_ejabberd.php Edit your ejabberd.cfg file, comment out your auth_method and add: {auth_method, external}. {extauth_program, \"/path/to/friendica/bin/auth_ejabberd.php\"}. Disable the module \"mod_register\" and disable the registration: {access, register, [{deny, all}]}. Enable BOSH: Enable the module \"mod_http_bind\" Edit this line: {5280, ejabberd_http, [captcha, http_poll, http_bind]} In your apache configuration for your site add this line: ProxyPass /http-bind http://127.0.0.1:5280/http-bind retry=0 Restart your ejabberd service, you should be able to log in with your friendica credentials","title":"Installation"},{"location":"admin/install-ejabberd/#other-hints","text":"if a user has a space or a @ in the nickname, the user has to replace these characters: \" \" (space) is replaced with \"%20\" \"@\" is replaced with \"(a)\"","title":"Other hints"},{"location":"admin/installing-connectors/","tags":["admin","connectors","twitter","gnu social"],"text":"Installing Connectors (Twitter/GNU Social) # Friendica uses addons to provide connectivity to some networks, such as Twitter. There is also an addon to post through to an existing account on a GNU Social service. You only need this to post to an already existing GNU Social account, but not to communicate with GNU Social members in general. All three addons require an account on the target network. In addition, you (or typically the server administrator) will need to obtain an API key to provide authenticated access to your Friendica server. Site Configuration # Addons must be installed by the site administrator before they can be used. This is accomplished through the site administration panel. Each of the connectors also requires an \"API key\" from the service you wish to connect with. Some addons allow you to enter this information in the site administration pages, while others may require you to edit your configuration file (config/local.config.php). The ways to obtain these keys vary between the services, but they all require an existing account on the target service. Once installed, these API keys can usually be shared by all site members. The details of configuring each service follow (much of this information comes directly from the addon source files): Twitter Addon for Friendica # Author: Tobias Diekershoff tobias.diekershoff@gmx.net License: 3-clause BSD license Configuration # To use this addon you need a OAuth Consumer key pair (key & secret). You can get it from Twitter . Register your Friendica site as \"Client\" application with \"Read & Write\" access. We do not need \"Twitter as login\". When you've registered the app you get a key pair with an OAuth Consumer key and a secret key for your application/site. Add this key pair to your config/local.config.php: [twitter] consumerkey = your consumer_key here consumersecret = your consumer_secret here After this, your users can configure their Twitter account settings from \"Settings -> Connector Settings\". More documentation # Find the author's documentation here: http://diekershoff.homeunix.net/redmine/wiki/friendikaplugin/Twitter_Plugin GNU Social Addon for Friendica # Author: Tobias Diekershoff tobias.diekershoff@gmx.net License: 3-clause BSD license Configuration # When the addon is activated the user has to acquire the following in order to connect to the GNU Social account of choice. The base URL for the GNU Social API, for quitter.se this is https://quitter.se/api/ OAuth Consumer key & secret To get the OAuth Consumer key pair the user has to 1 ask her Friendica admin if a pair already exists or 2 has to register the Friendica server as a client application on the GNU Social server. This can be done from the account settings under \"Settings -> Connections -> Register an OAuth client application -> Register a new application\" on the GNU Social server. During the registration of the OAuth client remember the following: Application names must be unique on the GNU Social site, so we recommend a Name of 'friendica-nnnn', replace 'nnnn' with a random number or your website name. there is no callback url register a desktop client with read & write access the Source URL should be the URL of your Friendica server After the required credentials for the application are stored in the configuration you have to actually connect your Friendica account with GNU Social. This is done from the Settings -> Connector Settings page. Follow the Sign in with GNU Social button, allow access and then copy the security code into the box provided. Friendica will then try to acquire the final OAuth credentials from the API. If successful, the addon settings will allow you to select to post your public messages to your GNU Social account (have a look behind the little lock symbol beneath the status \"editor\" on your Home or Network pages).","title":"Connectors"},{"location":"admin/installing-connectors/#installing-connectors-twittergnu-social","text":"Friendica uses addons to provide connectivity to some networks, such as Twitter. There is also an addon to post through to an existing account on a GNU Social service. You only need this to post to an already existing GNU Social account, but not to communicate with GNU Social members in general. All three addons require an account on the target network. In addition, you (or typically the server administrator) will need to obtain an API key to provide authenticated access to your Friendica server.","title":"Installing Connectors (Twitter/GNU Social)"},{"location":"admin/installing-connectors/#site-configuration","text":"Addons must be installed by the site administrator before they can be used. This is accomplished through the site administration panel. Each of the connectors also requires an \"API key\" from the service you wish to connect with. Some addons allow you to enter this information in the site administration pages, while others may require you to edit your configuration file (config/local.config.php). The ways to obtain these keys vary between the services, but they all require an existing account on the target service. Once installed, these API keys can usually be shared by all site members. The details of configuring each service follow (much of this information comes directly from the addon source files):","title":"Site Configuration"},{"location":"admin/installing-connectors/#twitter-addon-for-friendica","text":"Author: Tobias Diekershoff tobias.diekershoff@gmx.net License: 3-clause BSD license","title":"Twitter Addon for Friendica"},{"location":"admin/installing-connectors/#configuration","text":"To use this addon you need a OAuth Consumer key pair (key & secret). You can get it from Twitter . Register your Friendica site as \"Client\" application with \"Read & Write\" access. We do not need \"Twitter as login\". When you've registered the app you get a key pair with an OAuth Consumer key and a secret key for your application/site. Add this key pair to your config/local.config.php: [twitter] consumerkey = your consumer_key here consumersecret = your consumer_secret here After this, your users can configure their Twitter account settings from \"Settings -> Connector Settings\".","title":"Configuration"},{"location":"admin/installing-connectors/#more-documentation","text":"Find the author's documentation here: http://diekershoff.homeunix.net/redmine/wiki/friendikaplugin/Twitter_Plugin","title":"More documentation"},{"location":"admin/installing-connectors/#gnu-social-addon-for-friendica","text":"Author: Tobias Diekershoff tobias.diekershoff@gmx.net License: 3-clause BSD license","title":"GNU Social Addon for Friendica"},{"location":"admin/installing-connectors/#configuration_1","text":"When the addon is activated the user has to acquire the following in order to connect to the GNU Social account of choice. The base URL for the GNU Social API, for quitter.se this is https://quitter.se/api/ OAuth Consumer key & secret To get the OAuth Consumer key pair the user has to 1 ask her Friendica admin if a pair already exists or 2 has to register the Friendica server as a client application on the GNU Social server. This can be done from the account settings under \"Settings -> Connections -> Register an OAuth client application -> Register a new application\" on the GNU Social server. During the registration of the OAuth client remember the following: Application names must be unique on the GNU Social site, so we recommend a Name of 'friendica-nnnn', replace 'nnnn' with a random number or your website name. there is no callback url register a desktop client with read & write access the Source URL should be the URL of your Friendica server After the required credentials for the application are stored in the configuration you have to actually connect your Friendica account with GNU Social. This is done from the Settings -> Connector Settings page. Follow the Sign in with GNU Social button, allow access and then copy the security code into the box provided. Friendica will then try to acquire the final OAuth credentials from the API. If successful, the addon settings will allow you to select to post your public messages to your GNU Social account (have a look behind the little lock symbol beneath the status \"editor\" on your Home or Network pages).","title":"Configuration"},{"location":"admin/migrate/","tags":["admin"],"text":"Migrating to a new server installation # Preparation # New server # Set up your new server as described here ; follow the installation procedure until you have created a database. Heads up to users # Inform your users of an upcoming interruption to your service. To ensure data consistency, your server needs to be offline during some steps of the migration processes. You may also find these addons useful for communicating with your users prior to the migration process: * blackout * notifyall Storage # Check your storage backend with bin/console storage list in the root folder. The output should look like this: Sel | Name ----------------------- | Filesystem * | Database If you are not using Database run the following commands: 1. bin/console storage set Database to activate the database backend. 2. bin/console storage move to initiate moving the stored image files. This process may take a long time depending on the size of your storage and your server's capacity. Prior to initiating this process, you may want to check the number of files in the storage with the following command: tree -if -I index.html /path/to/storage/ . Cleaning up # Before transferring your database, you may want to clean it up; ensure the expiration of database items is set to a reasonable value and activated via the administrator panel. Admin > Site > Performance > Enable \"Clean up database\" After adjusting these settings, the database cleaning up processes will be initiated according to your configured daily cron job. To review the size of your database, log into MySQL with mysql -p run the following query: SELECT table_schema AS \"Database\" , SUM ( data_length + index_length ) / 1024 / 1024 / 1024 AS \"Size (GB)\" FROM information_schema . TABLES GROUP BY table_schema ; You should see an output like this: +--------------------+----------------+ | Database | Size (GB) | +--------------------+----------------+ | friendica_db | 8.054092407227 | | [..........] | [...........] | +--------------------+----------------+ Finally, you may also want to optimise your database with the following command: mysqloptimize -p friendica-db Going offline # Stop background tasks and put your server in maintenance mode. 1. If you had set up a worker cron job like this */10 * * * * cd /var/www/friendica; /usr/bin/php bin/worker.php run crontab -e and comment out this line. Alternatively if you deploy a worker daemon, disable this instead. 2. Put your server into maintenance mode: bin/console maintenance 1 \"We are currently upgrading our system and will be back soon.\" Dumping DB # Export your database: mysqldump -p friendica_db > friendica_db-$(date +%Y%m%d).sql and possibly compress it. Transferring to new server # Transfer your database and a copy of your configuration file config/local.config.php.copy to your new server installation. Restoring your DB # Import your database on your new server: mysql -p friendica_db < your-friendica_db-file.sql Completing migration # Configuration file # Copy your old server's configuration file to config/local.config.php . Ensure the newly created database credentials are identical to the setting in the configuration file; otherwise update them accordingly. Cron job for worker # Set up the required daily cron job. Run crontab -e and add the following line according to your system specification */10 * * * * cd /var/www/friendica; /usr/bin/php bin/worker.php DNS settings # Adjust your DNS records by pointing them to your new server. Troubleshooting # If you are unable to log in to your newly migrated Friendica installation, check your web server's error and access logs and mysql logs for obvious issues. If still unable to resolve the problem, it's likely an issue with your installation . In this case, you may try to an entirely new Friendica installation on your new server, but use a different FQDN and DNS name. Once you have this up and running, take it offline and purge the database and configuration file and try migrating to this installation.","title":"Migrate"},{"location":"admin/migrate/#migrating-to-a-new-server-installation","text":"","title":"Migrating to a new server installation"},{"location":"admin/migrate/#preparation","text":"","title":"Preparation"},{"location":"admin/migrate/#new-server","text":"Set up your new server as described here ; follow the installation procedure until you have created a database.","title":"New server"},{"location":"admin/migrate/#heads-up-to-users","text":"Inform your users of an upcoming interruption to your service. To ensure data consistency, your server needs to be offline during some steps of the migration processes. You may also find these addons useful for communicating with your users prior to the migration process: * blackout * notifyall","title":"Heads up to users"},{"location":"admin/migrate/#storage","text":"Check your storage backend with bin/console storage list in the root folder. The output should look like this: Sel | Name ----------------------- | Filesystem * | Database If you are not using Database run the following commands: 1. bin/console storage set Database to activate the database backend. 2. bin/console storage move to initiate moving the stored image files. This process may take a long time depending on the size of your storage and your server's capacity. Prior to initiating this process, you may want to check the number of files in the storage with the following command: tree -if -I index.html /path/to/storage/ .","title":"Storage"},{"location":"admin/migrate/#cleaning-up","text":"Before transferring your database, you may want to clean it up; ensure the expiration of database items is set to a reasonable value and activated via the administrator panel. Admin > Site > Performance > Enable \"Clean up database\" After adjusting these settings, the database cleaning up processes will be initiated according to your configured daily cron job. To review the size of your database, log into MySQL with mysql -p run the following query: SELECT table_schema AS \"Database\" , SUM ( data_length + index_length ) / 1024 / 1024 / 1024 AS \"Size (GB)\" FROM information_schema . TABLES GROUP BY table_schema ; You should see an output like this: +--------------------+----------------+ | Database | Size (GB) | +--------------------+----------------+ | friendica_db | 8.054092407227 | | [..........] | [...........] | +--------------------+----------------+ Finally, you may also want to optimise your database with the following command: mysqloptimize -p friendica-db","title":"Cleaning up"},{"location":"admin/migrate/#going-offline","text":"Stop background tasks and put your server in maintenance mode. 1. If you had set up a worker cron job like this */10 * * * * cd /var/www/friendica; /usr/bin/php bin/worker.php run crontab -e and comment out this line. Alternatively if you deploy a worker daemon, disable this instead. 2. Put your server into maintenance mode: bin/console maintenance 1 \"We are currently upgrading our system and will be back soon.\"","title":"Going offline"},{"location":"admin/migrate/#dumping-db","text":"Export your database: mysqldump -p friendica_db > friendica_db-$(date +%Y%m%d).sql and possibly compress it.","title":"Dumping DB"},{"location":"admin/migrate/#transferring-to-new-server","text":"Transfer your database and a copy of your configuration file config/local.config.php.copy to your new server installation.","title":"Transferring to new server"},{"location":"admin/migrate/#restoring-your-db","text":"Import your database on your new server: mysql -p friendica_db < your-friendica_db-file.sql","title":"Restoring your DB"},{"location":"admin/migrate/#completing-migration","text":"","title":"Completing migration"},{"location":"admin/migrate/#configuration-file","text":"Copy your old server's configuration file to config/local.config.php . Ensure the newly created database credentials are identical to the setting in the configuration file; otherwise update them accordingly.","title":"Configuration file"},{"location":"admin/migrate/#cron-job-for-worker","text":"Set up the required daily cron job. Run crontab -e and add the following line according to your system specification */10 * * * * cd /var/www/friendica; /usr/bin/php bin/worker.php","title":"Cron job for worker"},{"location":"admin/migrate/#dns-settings","text":"Adjust your DNS records by pointing them to your new server.","title":"DNS settings"},{"location":"admin/migrate/#troubleshooting","text":"If you are unable to log in to your newly migrated Friendica installation, check your web server's error and access logs and mysql logs for obvious issues. If still unable to resolve the problem, it's likely an issue with your installation . In this case, you may try to an entirely new Friendica installation on your new server, but use a different FQDN and DNS name. Once you have this up and running, take it offline and purge the database and configuration file and try migrating to this installation.","title":"Troubleshooting"},{"location":"admin/tools/","tags":["admin","tools"],"text":"Admin Tools # Friendica Tools # Friendica has a build in command console you can find in the bin directory. The console provides the following commands: cache: Manage node cache config: Edit site config createdoxygen: Generate Doxygen headers dbstructure: Do database updates docbloxerrorchecker: Check the file tree for DocBlox errors extract: Generate translation string file for the Friendica project (deprecated) globalcommunityblock: Block remote profile from interacting with this node globalcommunitysilence: Silence remote profile from global community page archivecontact: Archive a contact when you know that it isn't existing anymore help: Show help about a command, e.g (bin/console help config) autoinstall: Starts automatic installation of friendica based on values from htconfig.php maintenance: Set maintenance mode for this node newpassword: Set a new password for a given user php2po: Generate a messages.po file from a strings.php file po2php: Generate a strings.php file from a messages.po file typo: Checks for parse errors in Friendica files postupdate: Execute pending post update scripts (can last days) storage: Manage storage backend relay: Manage ActivityPub relay servers Please consult bin/console help on the command line interface of your server for details about the commands. 3rd Party Tools # In addition to the tools Friendica includes, some 3rd party tools can make your admin days easier. Fail2ban # Fail2ban is an intrusion prevention framework ( see Wikipedia ) that you can use to forbid access to a server under certain conditions, e.g. 3 failed attempts to log in, for a certain amount of time. The following configuration was provided by Steffen K9 using Debian. You need to adjust the logpath in the jail.local file and the bantime (value is in seconds). In /etc/fail2ban/jail.local create a section for Friendica: [friendica] enabled = true findtime = 300 bantime = 900 filter = friendica port = http,https logpath = /var/log/friend.log logencoding = utf-8 And create a filter definition in /etc/fail2ban/filter.d/friendica.conf : [Definition] failregex = ^.*authenticate\\: failed login attempt.*\\\"ip\\\"\\:\\\"\\\".*$ ignoreregex = Additionally, you have to define the number of failed logins before the ban should be activated. This is done either in the global configuration or for each jail separately. You should inform your users about the number of failed login attempts you grant them. Otherwise, you'll get many reports about the server not functioning if the number is too low. Log rotation # If you have activated the logs in Friendica, be aware that they can grow to a significant size. To keep them in control you should add them to the automatic log rotation , e.g. using the logrotate command. In /etc/logrotate.d/ add a file called friendica that contains the configuration. The following will compress /var/log/friendica (assuming this is the location of the log file) on a daily basis and keep 2 days of back-log. /var/log/friendica.log { compress daily rotate 2 }","title":"Tools"},{"location":"admin/tools/#admin-tools","text":"","title":"Admin Tools"},{"location":"admin/tools/#friendica-tools","text":"Friendica has a build in command console you can find in the bin directory. The console provides the following commands: cache: Manage node cache config: Edit site config createdoxygen: Generate Doxygen headers dbstructure: Do database updates docbloxerrorchecker: Check the file tree for DocBlox errors extract: Generate translation string file for the Friendica project (deprecated) globalcommunityblock: Block remote profile from interacting with this node globalcommunitysilence: Silence remote profile from global community page archivecontact: Archive a contact when you know that it isn't existing anymore help: Show help about a command, e.g (bin/console help config) autoinstall: Starts automatic installation of friendica based on values from htconfig.php maintenance: Set maintenance mode for this node newpassword: Set a new password for a given user php2po: Generate a messages.po file from a strings.php file po2php: Generate a strings.php file from a messages.po file typo: Checks for parse errors in Friendica files postupdate: Execute pending post update scripts (can last days) storage: Manage storage backend relay: Manage ActivityPub relay servers Please consult bin/console help on the command line interface of your server for details about the commands.","title":"Friendica Tools"},{"location":"admin/tools/#3rd-party-tools","text":"In addition to the tools Friendica includes, some 3rd party tools can make your admin days easier.","title":"3rd Party Tools"},{"location":"admin/tools/#fail2ban","text":"Fail2ban is an intrusion prevention framework ( see Wikipedia ) that you can use to forbid access to a server under certain conditions, e.g. 3 failed attempts to log in, for a certain amount of time. The following configuration was provided by Steffen K9 using Debian. You need to adjust the logpath in the jail.local file and the bantime (value is in seconds). In /etc/fail2ban/jail.local create a section for Friendica: [friendica] enabled = true findtime = 300 bantime = 900 filter = friendica port = http,https logpath = /var/log/friend.log logencoding = utf-8 And create a filter definition in /etc/fail2ban/filter.d/friendica.conf : [Definition] failregex = ^.*authenticate\\: failed login attempt.*\\\"ip\\\"\\:\\\"\\\".*$ ignoreregex = Additionally, you have to define the number of failed logins before the ban should be activated. This is done either in the global configuration or for each jail separately. You should inform your users about the number of failed login attempts you grant them. Otherwise, you'll get many reports about the server not functioning if the number is too low.","title":"Fail2ban"},{"location":"admin/tools/#log-rotation","text":"If you have activated the logs in Friendica, be aware that they can grow to a significant size. To keep them in control you should add them to the automatic log rotation , e.g. using the logrotate command. In /etc/logrotate.d/ add a file called friendica that contains the configuration. The following will compress /var/log/friendica (assuming this is the location of the log file) on a daily basis and keep 2 days of back-log. /var/log/friendica.log { compress daily rotate 2 }","title":"Log rotation"},{"location":"admin/update/","tags":["admin"],"text":"Updating Friendica # Using a Friendica archive # If you installed Friendica in the path/to/friendica folder: Unpack the new Friendica archive in path/to/friendica_new . Copy the following items from path/to/friendica to path/to/friendica_new : config/local.config.php proxy/ The following items only need to be copied if they are located inside your friendica path: your storage folder as set in Admin -> Site -> File Upload -> Storage base path your item cache as set in Admin -> Site -> Performance -> Path to item cache your temp folder as set in Admin -> Site -> Advanced -> Temp path Rename the path/to/friendica folder to path/to/friendica_old . Rename the path/to/friendica_new folder to path/to/friendica . Check your site. Note: it may go into maintenance mode to update the database schema. If everything works, just delete the path/to/friendica_old folder. To update Addons from an archive, simply delete the path/to/friendica/addon and replace it with the provided archive. Using Git # You can get the latest changes at any time with cd path/to/friendica git pull bin/composer.phar install --no-dev The addon tree has to be updated separately like so: cd path/to/friendica/addon git pull For both repositories: The default branch to use is the stable branch, which is the stable version of Friendica. It is updated about four times a year on a fixed schedule. If you want to use and test bleeding edge code please check out the develop branch. The new features and fixes will be merged from develop into stable after a release candidate period before each release. Warning: The develop branch is unstable, and breaks on average once a month for at most 24 hours until a patch is submitted and merged. Be sure to pull frequently if you choose the develop branch. Considerations before upgrading Friendica # MySQL >= 5.7.4 # Starting from MySQL version 5.7.4, the IGNORE keyword in ALTER TABLE statements is ignored. This prevents automatic table deduplication if a UNIQUE index is added to a Friendica table's structure. If a DB update fails for you while creating a UNIQUE index, make sure to manually deduplicate the table before trying the update again. Manual deduplication # There are two main ways of doing it, either by manually removing the duplicates or by recreating the table. Manually removing the duplicates is usually faster if they're not too numerous. To manually remove the duplicates, you need to know the UNIQUE index columns available in database.sql . SELECT GROUP_CONCAT ( id ), < index columns > , count ( * ) as count FROM users GROUP BY < index columns > HAVING count >= 2 ; /* delete or merge duplicate from above query */ ; If there are too many rows to handle manually, you can create a new table with the same structure as the table with duplicates and insert the existing content with INSERT IGNORE. To recreate the table you need to know the table structure available in database.sql . CREATE TABLE < table_name > _new < rest of the CREATE TABLE > ; INSERT IGNORE INTO < table_name > _new SELECT * FROM < table_name > ; DROP TABLE < table_name > ; RENAME TABLE < table_name > _new TO < table_name > ; This method is slower overall, but it is better suited for large numbers of duplicates. Resolving Possible Database Issues Post Upgrading # Foreign Keys # Some updates include the use of foreign keys now that will bump into issues with previous versions, which would sometimes shove bad data into tables, preventing, causing errors such as below. Error 1452 occurred during database update: Cannot add or update a child row: a foreign key constraint fails (`friendica`.`#sql-10ea6_5a6d`, CONSTRAINT `#sql-10ea6_5a6d_ibfk_1` FOREIGN KEY (`contact-id`) REFERENCES `contact` (`id`)) ALTER TABLE `thread` ADD FOREIGN KEY (`iid`) REFERENCES `item` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE; All current known fixes for possible items that can go wrong are as below. DELETE FROM ` item ` WHERE ` owner - id ` NOT IN ( SELECT ` id ` FROM ` contact ` ); DELETE FROM ` item ` WHERE ` contact - id ` NOT IN ( SELECT ` id ` FROM ` contact ` ); DELETE FROM ` notify ` WHERE ` uri - id ` NOT IN ( SELECT ` id ` FROM ` item - uri ` ); DELETE FROM ` photo ` WHERE ` contact - id ` NOT IN ( SELECT ` id ` FROM ` contact ` ); DELETE FROM ` thread ` WHERE ` iid ` NOT IN ( SELECT ` id ` FROM ` item ` ); DELETE FROM ` item ` WHERE ` author - id ` NOT IN ( SELECT ` id ` FROM ` contact ` ); DELETE FROM ` diaspora - interaction ` WHERE ` uri - id ` NOT IN ( SELECT ` id ` FROM ` item - uri ` ); This all has been compiled as of currently from issue #9746, #9753, and #9878.","title":"Update"},{"location":"admin/update/#updating-friendica","text":"","title":"Updating Friendica"},{"location":"admin/update/#using-a-friendica-archive","text":"If you installed Friendica in the path/to/friendica folder: Unpack the new Friendica archive in path/to/friendica_new . Copy the following items from path/to/friendica to path/to/friendica_new : config/local.config.php proxy/ The following items only need to be copied if they are located inside your friendica path: your storage folder as set in Admin -> Site -> File Upload -> Storage base path your item cache as set in Admin -> Site -> Performance -> Path to item cache your temp folder as set in Admin -> Site -> Advanced -> Temp path Rename the path/to/friendica folder to path/to/friendica_old . Rename the path/to/friendica_new folder to path/to/friendica . Check your site. Note: it may go into maintenance mode to update the database schema. If everything works, just delete the path/to/friendica_old folder. To update Addons from an archive, simply delete the path/to/friendica/addon and replace it with the provided archive.","title":"Using a Friendica archive"},{"location":"admin/update/#using-git","text":"You can get the latest changes at any time with cd path/to/friendica git pull bin/composer.phar install --no-dev The addon tree has to be updated separately like so: cd path/to/friendica/addon git pull For both repositories: The default branch to use is the stable branch, which is the stable version of Friendica. It is updated about four times a year on a fixed schedule. If you want to use and test bleeding edge code please check out the develop branch. The new features and fixes will be merged from develop into stable after a release candidate period before each release. Warning: The develop branch is unstable, and breaks on average once a month for at most 24 hours until a patch is submitted and merged. Be sure to pull frequently if you choose the develop branch.","title":"Using Git"},{"location":"admin/update/#considerations-before-upgrading-friendica","text":"","title":"Considerations before upgrading Friendica"},{"location":"admin/update/#mysql-574","text":"Starting from MySQL version 5.7.4, the IGNORE keyword in ALTER TABLE statements is ignored. This prevents automatic table deduplication if a UNIQUE index is added to a Friendica table's structure. If a DB update fails for you while creating a UNIQUE index, make sure to manually deduplicate the table before trying the update again.","title":"MySQL >= 5.7.4"},{"location":"admin/update/#manual-deduplication","text":"There are two main ways of doing it, either by manually removing the duplicates or by recreating the table. Manually removing the duplicates is usually faster if they're not too numerous. To manually remove the duplicates, you need to know the UNIQUE index columns available in database.sql . SELECT GROUP_CONCAT ( id ), < index columns > , count ( * ) as count FROM users GROUP BY < index columns > HAVING count >= 2 ; /* delete or merge duplicate from above query */ ; If there are too many rows to handle manually, you can create a new table with the same structure as the table with duplicates and insert the existing content with INSERT IGNORE. To recreate the table you need to know the table structure available in database.sql . CREATE TABLE < table_name > _new < rest of the CREATE TABLE > ; INSERT IGNORE INTO < table_name > _new SELECT * FROM < table_name > ; DROP TABLE < table_name > ; RENAME TABLE < table_name > _new TO < table_name > ; This method is slower overall, but it is better suited for large numbers of duplicates.","title":"Manual deduplication"},{"location":"admin/update/#resolving-possible-database-issues-post-upgrading","text":"","title":"Resolving Possible Database Issues Post Upgrading"},{"location":"admin/update/#foreign-keys","text":"Some updates include the use of foreign keys now that will bump into issues with previous versions, which would sometimes shove bad data into tables, preventing, causing errors such as below. Error 1452 occurred during database update: Cannot add or update a child row: a foreign key constraint fails (`friendica`.`#sql-10ea6_5a6d`, CONSTRAINT `#sql-10ea6_5a6d_ibfk_1` FOREIGN KEY (`contact-id`) REFERENCES `contact` (`id`)) ALTER TABLE `thread` ADD FOREIGN KEY (`iid`) REFERENCES `item` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE; All current known fixes for possible items that can go wrong are as below. DELETE FROM ` item ` WHERE ` owner - id ` NOT IN ( SELECT ` id ` FROM ` contact ` ); DELETE FROM ` item ` WHERE ` contact - id ` NOT IN ( SELECT ` id ` FROM ` contact ` ); DELETE FROM ` notify ` WHERE ` uri - id ` NOT IN ( SELECT ` id ` FROM ` item - uri ` ); DELETE FROM ` photo ` WHERE ` contact - id ` NOT IN ( SELECT ` id ` FROM ` contact ` ); DELETE FROM ` thread ` WHERE ` iid ` NOT IN ( SELECT ` id ` FROM ` item ` ); DELETE FROM ` item ` WHERE ` author - id ` NOT IN ( SELECT ` id ` FROM ` contact ` ); DELETE FROM ` diaspora - interaction ` WHERE ` uri - id ` NOT IN ( SELECT ` id ` FROM ` item - uri ` ); This all has been compiled as of currently from issue #9746, #9753, and #9878.","title":"Foreign Keys"},{"location":"developer/addon-storage-backend/","tags":["addon","developer"],"text":"Friendica Storage Backend Addon development # Storage backends can be added via addons. A storage backend is implemented as a class, and the plugin register the class to make it available to the system. The Storage Backend Class # The class must live in Friendica\\Addon\\youraddonname namespace, where youraddonname the folder name of your addon. There are two different interfaces you need to implement. ICanWriteToStorage # The class must implement Friendica\\Core\\Storage\\Capability\\ICanWriteToStorage interface. All method in the interface must be implemented: [ ..info.. ], 'option2name' => [ ..info.. ], ... ] An empty array can be returned if backend doesn't have any options. The info array for each option is defined as: [ 'type', define the field used in form, and the type of data. one of 'checkbox', 'combobox', 'custom', 'datetime', 'input', 'intcheckbox', 'password', 'radio', 'richtext', 'select', 'select_raw', 'textarea' 'label', Translatable label of the field. This label will be shown in admin page value, Current value of the option 'help text', Translatable description for the field. Will be shown in admin page extra data Optional. Depends on which 'type' this option is: 'select': array [ value => label ] of choices 'intcheckbox': value of input element 'select_raw': prebuild html string of