Merge pull request #12225 from MrPetovan/bug/10188-addon-config

Remove config/addon-sample.config.php file in favor of per-addon configuration files
This commit is contained in:
Philipp 2022-11-21 00:16:26 +01:00 committed by GitHub
commit 41be03a7c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 25 deletions

7
.gitignore vendored
View file

@ -10,10 +10,9 @@ home.html
robots.txt robots.txt
#ignore local config #ignore local config
/config/local.config.php !/config/local-sample.config.php
/config/addon.config.php /config/*.config.php
/config/local.ini.php /config/*.ini.php
/config/addon.ini.php
#ignore documentation, it should be newly built #ignore documentation, it should be newly built
/doc/api /doc/api

View file

@ -1,12 +0,0 @@
<?php
// Addon configuration
// Copy this configuration file to addon.config.php and edit it if you want to configure addons, see below example for the twitter addon
return [
'twitter' => [
'consumerkey' => '1234567890',
'consumersecret' => 'ABCDEFGHIJKLMONPQRSTUVWXYZ',
],
];

View file

@ -37,8 +37,8 @@ The `config` directory holds key configuration files and can have different conf
All of them have to end with `.config.php` and must not include `-sample` in their name. All of them have to end with `.config.php` and must not include `-sample` in their name.
Some examples of common known configuration files: Some examples of common known configuration files:
- `local.config.php` holds the current node custom configuration. - `local.config.php` holds the base node custom configuration.
- `addon.config.php` is optional and holds the custom configuration for specific addons. - Any other file in this folder is meant for additional configuration (e.g. for addons).
Addons can define their own default configuration values in `addon/[addon]/config/[addon].config.php` which is loaded when the addon is activated. Addons can define their own default configuration values in `addon/[addon]/config/[addon].config.php` which is loaded when the addon is activated.
@ -59,7 +59,7 @@ Currently, the following configurations are included:
The legacy `.htconfig.php` configuration file is still supported, but is deprecated and will be removed in a subsequent Friendica release. 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: 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. If you had any addon-specific configuration in your `.htconfig.php`, copy `config/local-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. 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.
<style> <style>
@ -206,7 +206,7 @@ $lang = "value";
The legacy `config/local.ini.php` configuration file is still supported, but is deprecated and will be removed in a subsequent Friendica release. 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: 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. If you had any addon-specific configuration in your `config/addon.ini.php`, copy `config/local-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. 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.
<table class="config"> <table class="config">
@ -278,16 +278,16 @@ key[] = value3
### Database Settings ### Database Settings
The configuration variables database.hostname, database.username, database.password, database.database and database.charset are holding your credentials for the database connection. The configuration variables `database.hostname` (or `database.socket`), `database.username`, `database.password`, `database.database` and optionally `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. If you need to specify a port to access the database, you can do so by appending ":portnumber" to the `database.hostname` variable.
'database' => [ 'database' => [
'hostname' => 'your.mysqlhost.com:123456', 'hostname' => 'your.mysqlhost.com:123456',
] ]
If all of the following environment variables are set, Friendica will use them instead of the previously configured variables for the db: If all the following environment variables are set, Friendica will use them instead of the previously configured variables for the db:
MYSQL_HOST MYSQL_HOST or MYSQL_SOCKET
MYSQL_PORT MYSQL_PORT
MYSQL_USERNAME MYSQL_USERNAME
MYSQL_PASSWORD MYSQL_PASSWORD
@ -316,7 +316,7 @@ Enabling the admin panel for an account, and thus making the account holder admi
Where you have to match the email address used for the account with the one you enter to the `config/local.config.php` file. 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 then one account should be able to access the admin panel, separate the email addresses with a comma. If more than one account should be able to access the admin panel, separate the email addresses with a comma.
'config' => [ 'config' => [
'admin_email' => 'someone@example.com,someoneelse@example.com', 'admin_email' => 'someone@example.com,someoneelse@example.com',