[various] Remove config/addon.config.php in favor of per-addon configuration file

This commit is contained in:
Hypolite Petovan 2022-11-20 11:43:42 -05:00
parent 5b25b03ea3
commit 46d4d0b51e
29 changed files with 137 additions and 206 deletions

View file

@ -7,10 +7,12 @@ Use [Geonames service](https://www.geonames.org) to resolve nearest populated lo
## Installation ## Installation
Pre-requisite: Register a username at https://www.geonames.org/login and set it in `config/addon.config.php` Pre-requisite: Register a username at https://www.geonames.org/login and set it in `config/geonames.config.php`:
return [
'geonames' => [ 'geonames' => [
'username' => 'your_username' 'username' => 'your_username'
], ],
];
Also visit https://geonames.org/manageaccount and enable access to the free web services. Also visit https://geonames.org/manageaccount and enable access to the free web services.

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/geonames.config.php in your Friendica directory and set the correct values there
return [ return [
'geonames' => [ 'geonames' => [

View file

@ -38,11 +38,13 @@ Open the `config/local.config.php` file and add "gravatar" to the list of activa
... ...
] ]
You can add two configuration variables for the addon to the `config/addon.config.php` file: You can add two configuration variables for the addon to the `config/gravatar.config.php` file:
return [
'gravatar' => [ 'gravatar' => [
'default_avatar' => 'identicon', 'default_avatar' => 'identicon',
'rating' => 'g', 'rating' => 'g',
], ],
];
[1]: http://www.gravatar.com/site/implement/images/ "See documentation at Gravatar for more information" [1]: http://www.gravatar.com/site/implement/images/ "See documentation at Gravatar for more information"

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/gravatar.config.php in your Friendica directory and set the correct values there
return [ return [
'gravatar' => [ 'gravatar' => [

View file

@ -16,14 +16,16 @@ Simply fill in the fields in the impressium settings page in the addons area of
Manual Configuration Manual Configuration
-------------------- --------------------
If you for any reason you prefer to use a configuration file instead, you can set the following variables in the `config/addon.config.php` file If you for any reason you prefer to use a configuration file instead, you can set the following variables in the `config/impressum.config.php` file
return [
'impressum' => [ 'impressum' => [
'owner' => '', This is the Name of the Operator 'owner' => '', // This is the Name of the Operator
'ownerprofile' => '', This is an optional Friendica account where the above owner name will link to 'ownerprofile' => '', // This is an optional Friendica account where the above owner name will link to
'email' => '', A contact email address (optional) 'email' => '', // A contact email address (optional)
Will be displayed slightly obfuscated as name(at)example(dot)com // Will be displayed slightly obfuscated as name(at)example(dot)com
'postal' => '', Should contain a postal address where you can be reached at (optional) 'postal' => '', // Should contain a postal address where you can be reached at (optional)
'notes' => '', Additional informations that should be displayed in the Impressum block 'notes' => '', // Additional informations that should be displayed in the Impressum block
'footer_text' => '', Text that will be displayed at the bottom of the pages. 'footer_text' => '', // Text that will be displayed at the bottom of the pages.
], ],
];

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/impressum.config.php in your Friendica directory and set the correct values there
return [ return [
'impressum' => [ 'impressum' => [

View file

@ -12,38 +12,4 @@ However, it's possible with an option to automate the creation of a Friendica ba
Note when using with Windows Active Directory: you may need to set TLS_CACERT in your site Note when using with Windows Active Directory: you may need to set TLS_CACERT in your site
ldap.conf file to the signing cert for your LDAP server. ldap.conf file to the signing cert for your LDAP server.
The configuration options for this module may be set in the `config/addon.config.php` file The configuration options for this module are described in the `config/ldapauth.config.php` file.
e.g.:
'ldapauth' => [
// ldap hostname server - required
'ldap_server' => '',
// admin dn - optional - only if ldap server dont have anonymous access
'ldap_binddn' => '',
// admin password - optional - only if ldap server dont have anonymous access
'ldap_bindpw' => '',
// dn to search users - required
'ldap_searchdn' => '',
// attribute to find username - required
'ldap_userattr' => '',
// DN of the group whose member can auth on Friendica - optional
'ldap_group' => '',
// To create Friendica account if user exists in ldap
// Requires an email and a simple (beautiful) nickname on user ldap object
// active account creation - optional - default true
'ldap_autocreateaccount' => true,
// attribute to get email - optional - default : 'mail'
'ldap_autocreateaccount_emailattribute' => 'mail',
// attribute to get nickname - optional - default : 'givenName'
'ldap_autocreateaccount_nameattribute' => 'givenName',
],
...etc.

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/ldapauth.config.php in your Friendica directory and set the correct values there
return [ return [
'ldapauth' => [ 'ldapauth' => [

View file

@ -26,32 +26,7 @@
* Note when using with Windows Active Directory: you may need to set TLS_CACERT in your site * Note when using with Windows Active Directory: you may need to set TLS_CACERT in your site
* ldap.conf file to the signing cert for your LDAP server. * ldap.conf file to the signing cert for your LDAP server.
* *
* The configuration options for this module may be set in the config/addon.config.php file * The configuration options for this module are described in the config/ldapauth.config.php file
* e.g.:
*
* [ldapauth]
* ; ldap hostname server - required
* ldap_server = host.example.com
* ; dn to search users - required
* ldap_searchdn = ou=users,dc=example,dc=com
* ; attribute to find username - required
* ldap_userattr = uid
*
* ; admin dn - optional - only if ldap server dont have anonymous access
* ldap_binddn = cn=admin,dc=example,dc=com
* ; admin password - optional - only if ldap server dont have anonymous access
* ldap_bindpw = password
*
* ; for create Friendica account if user exist in ldap
* ; required an email and a simple (beautiful) nickname on user ldap object
* ; active account creation - optional - default none
* ldap_autocreateaccount = true
* ; attribute to get email - optional - default : 'mail'
* ldap_autocreateaccount_emailattribute = mail
* ; attribute to get nickname - optional - default : 'givenName'
* ldap_autocreateaccount_nameattribute = cn
*
* ...etc.
*/ */
use Friendica\App; use Friendica\App;

View file

@ -1,16 +1,17 @@
Leistungsschutzrecht Addon Leistungsschutzrecht Addon
========================== ==========================
Main author Michael Vogel Main author: Michael Vogel
This addon handles legal problems with the German link tax, named "Leistungsschutzrecht" by shortening preview texts. This addon handles legal problems with the German link tax, named "Leistungsschutzrecht" by shortening preview texts.
Additionally it is possibly to suppress preview pictures completely to avoid any legal problems. Additionally, it is possibly to suppress preview pictures completely to avoid any legal problems.
## configuration ## Configuration
If you want to suppress pictures in previews, add this to your global `config/addon.config.php`: If you want to suppress pictures in previews, add this to your global `config/leistungsschutzrecht.config.php`:
return [
'leistungsschutzrecht' => [ 'leistungsschutzrecht' => [
'suppress_photos' => true, 'suppress_photos' => true,
], ],
];

View file

@ -31,10 +31,12 @@ Open the `config/local.config.php` file and add "libravatar" to the list of acti
... ...
] ]
You can add one configuration variables for the addon to the `config/addon.config.php` file: You can add one configuration variables for the addon to the `config/libravatar.config.php` file:
return [
'libravatar' => [ 'libravatar' => [
'default_avatar' => 'identicon', 'default_avatar' => 'identicon',
], ],
];
[1]: http://wiki.libravatar.org/api/ "See API documentation at Libravatar for more information" [1]: http://wiki.libravatar.org/api/ "See API documentation at Libravatar for more information"

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/libravatar.config.php in your Friendica directory and set the correct values there
return [ return [
'libravatar' => [ 'libravatar' => [

View file

@ -29,11 +29,13 @@ the addon by adding _mathjax_ to the list in your `config/local.config.php` file
... ...
] ]
and then providing the base URL after that in the `config/addon.config.php` file and then providing the base URL after that in the `config/mathjax.config.php` file
return [
'mathjax' => [ 'mathjax' => [
'baseurl' => '[the URL to your MathJax installation]', 'baseurl' => '[the URL to your MathJax installation]',
], ],
];
Usage Usage
===== =====

View file

@ -42,14 +42,16 @@ Open the `config/local.config.php` file and add "openstreetmap" to the list of a
... ...
] ]
You can set configuration variables for the addon in the `config/addon.config.php` file: You can set configuration variables for the addon in the `config/openstreetmap.config.php` file:
return [
'openstreetmap' => [ 'openstreetmap' => [
'tmsserver' => 'https://www.openstreetmap.org', 'tmsserver' => 'https://www.openstreetmap.org',
'nomserver' => 'https://nominatim.openstreetmap.org/search.php', 'nomserver' => 'https://nominatim.openstreetmap.org/search.php',
'zoom' => 16, 'zoom' => 16,
'marker' => 0, 'marker' => 0,
], ],
];
The *tmsserver* points to the tile server you want to use. Use the full URL, The *tmsserver* points to the tile server you want to use. Use the full URL,
with protocol (http/s) and trailing slash. You can configure the default zoom with protocol (http/s) and trailing slash. You can configure the default zoom

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/openstreetmap.config.php in your Friendica directory and set the correct values there
return [ return [
'openstreetmap' => [ 'openstreetmap' => [

View file

@ -8,45 +8,7 @@ This addon replaces the default `mail()` function by the `PHPMailer` library, al
Configuration Configuration
------------- -------------
You can override the default value of the following config keys in your base Friendica install `config/addon.config.php` file: The configuration options for this module are described in the `config/phpmailer.config.php` file.
'phpmailer' => [
// smtp (Boolean)
// Enables SMTP relaying for outbound emails
'smtp' => false,
// smtp_server (String)
// SMTP server host name
'smtp_server' => 'smtp.example.com',
// smtp_port (Integer)
// SMTP server port number
'smtp_port' => 25,
// smtp_secure (String)
// What kind of encryption to use on the SMTP connection.
// Options: '', 'ssl' or 'tls'.
'smtp_secure' => '',
// smtp_port_s (Integer)
// Secure SMTP server port number
'smtp_port_s' => 465,
// smtp_username (String)
// SMTP server authentication user name
// Empty string disables authentication
'smtp_username' => '',
// smtp_password (String)
// SMTP server authentication password
// Empty string disables authentication
'smtp_password' => '',
// smtp_from (String)
// From address used when using the SMTP server
// Example: no-reply@example.com
'smtp_from' => '',
],
License License
======= =======

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/phpmailer.config.php in your Friendica directory and set the correct values there
return [ return [
'phpmailer' => [ 'phpmailer' => [

View file

@ -30,14 +30,16 @@ Open the `config/local.config.php` file and add "piwik" to the list of activated
... ...
] ]
You can change 4 more configuration variables for the addon in the `config/addon.config.php` file: You can change 4 more configuration variables for the addon in the `config/piwik.config.php` file:
return [
'piwik' => [ 'piwik' => [
'baseurl' => 'example.com/piwik/', 'baseurl' => 'example.com/piwik/',
'sideid' => 1, 'sideid' => 1,
'optout' => true, 'optout' => true,
'async' => false, 'async' => false,
], ],
];
Configuration fields Configuration fields
--------------------- ---------------------

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/piwik.config.php in your Friendica directory and set the correct values there
return [ return [
'piwik' => [ 'piwik' => [

View file

@ -16,14 +16,17 @@
* *
* Configuration: * Configuration:
* Use the administration panel to configure the Piwik tracking addon, or * Use the administration panel to configure the Piwik tracking addon, or
* in case you don't use this add the following lines to your config/addon.config.php * in case you don't use this, add the following lines to your config/piwik.config.php
* file: * file:
* *
* [piwik] * return [
* baseurl = example.com/piwik/ * 'piwik' => [
* sideid = 1 * 'baseurl' => '',
* optout = true ;set to false to disable * 'sideid' => '',
* async = false ;set to true to enable * 'optout' => true,
* 'async' => false,
* ],
* ];
* *
* Change the siteid to the ID that the Piwik tracker for your Friendica * Change the siteid to the ID that the Piwik tracker for your Friendica
* installation has. Alter the baseurl to fit your needs, don't care * installation has. Alter the baseurl to fit your needs, don't care
@ -60,7 +63,7 @@ function piwik_analytics(App $a, string &$b)
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/piwik/piwik.css' . '" media="all" />'; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/piwik/piwik.css' . '" media="all" />';
/* /*
* Get the configuration variables from the config/addon.config.php file. * Get the configuration values.
*/ */
$baseurl = DI::config()->get('piwik', 'baseurl'); $baseurl = DI::config()->get('piwik', 'baseurl');
$siteid = DI::config()->get('piwik', 'siteid'); $siteid = DI::config()->get('piwik', 'siteid');

View file

@ -6,6 +6,7 @@ Public Server is a Friendica addon which implements automatic account & post exp
This is a modified version of the testdrive addon, DO NOT ACTIVATE AT THE SAME TIME AS THE TESTDRIVE ADDON. This is a modified version of the testdrive addon, DO NOT ACTIVATE AT THE SAME TIME AS THE TESTDRIVE ADDON.
return [
'public_server' => [ 'public_server' => [
// When an account is created on the site, it is given a hard expiration date of. 0 to disable. // When an account is created on the site, it is given a hard expiration date of. 0 to disable.
'expiredays' => 0, 'expiredays' => 0,
@ -19,8 +20,9 @@ This is a modified version of the testdrive addon, DO NOT ACTIVATE AT THE SAME T
'flagposts' => 0, 'flagposts' => 0,
'flagpostsexpire' => 0, 'flagpostsexpire' => 0,
], ],
];
Set these in your `config/addon.config.php` file. By default nothing is defined in case the addon is activated accidentally. Set these in your `config/public_server.config.php` file. By default, nothing is defined in case the addon is activated accidentally.
They can be ommitted or set to 0 to disable each option. They can be ommitted or set to 0 to disable each option.
The default values are those used by friendica.eu, change these as desired. The default values are those used by friendica.eu, change these as desired.

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/public_server.config.php in your Friendica directory and set the correct values there
return [ return [
'public_server' => [ 'public_server' => [

View file

@ -1,5 +1,6 @@
To let the connector work properly you should define an application name in `config/addon.config.php`: To let the connector work properly you should define an application name in `config/pumpio.config.php`:
return [
'pumpio' => [ 'pumpio' => [
'application_name' => '', 'application_name' => '',
// Displays forwarded posts like "wall-to-wall" posts. // Displays forwarded posts like "wall-to-wall" posts.
@ -7,5 +8,6 @@ To let the connector work properly you should define an application name in `con
// Given in minutes // Given in minutes
'poll_interval' => 5, 'poll_interval' => 5,
], ],
];
This name appears at pump.io and is important for not mirroring back posts that came from Friendica. This name appears at pump.io and is important for not mirroring back posts that came from Friendica.

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/pumpio.config.php in your Friendica directory and set the correct values there
return [ return [
'pumpio' => [ 'pumpio' => [

View file

@ -6,12 +6,14 @@ Testdrive is a Friendica addon which implements automatic account expiration so
When an account is created on the site, it is given a hard expiration date of When an account is created on the site, it is given a hard expiration date of
return [
'testdrive' => [ 'testdrive' => [
'expiredays' => 30, 'expiredays' => 30,
], ],
];
Set this in your `config/addon.config.php` file to allow a 30 day test drive period. Set this in your `config/testdrive.config.php` file to allow a 30-day test drive period.
By default no expiration period is defined in case the addon is activated accidentally. By default, no expiration period is defined in case the addon is activated accidentally.
There is no opportunity to extend an expired account using this addon. There is no opportunity to extend an expired account using this addon.
Expiration is final. Expiration is final.

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/testdrive.config.php in your Friendica directory and set the correct values there
return [ return [
'testdrive' => [ 'testdrive' => [

View file

@ -24,12 +24,14 @@ Open the `config/local.config.php` file and add "twitter" to the list of activat
... ...
] ]
Add your key pair to your global `config/addon.config.php`. Add your key pair to your `config/twitter.config.php` file.
return [
'twitter' => [ 'twitter' => [
'consumerkey' => 'your consumer_key here', 'consumerkey' => 'your consumer_key here',
'consumersecret' => 'your consumer_secret here', 'consumersecret' => 'your consumer_secret here',
], ],
];
After this, users can configure their Twitter account settings from "Settings -> Addon Settings". After this, users can configure their Twitter account settings from "Settings -> Addon Settings".

View file

@ -1,7 +1,7 @@
<?php <?php
// Warning: Don't change this file! It only holds the default config values for this addon. // Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory // Instead, copy this file to config/twitter.config.php in your Friendica directory and set the correct values there
return [ return [
'twitter' => [ 'twitter' => [

View file

@ -48,12 +48,14 @@
* we do not need "Twitter as login". When you've registered the app you get the * we do not need "Twitter as login". When you've registered the app you get the
* OAuth Consumer key and secret pair for your application/site. * OAuth Consumer key and secret pair for your application/site.
* *
* Add this key pair to your global config/addon.config.php or use the admin panel. * Add this key pair to your config/twitter.config.php file or use the admin panel.
* *
* return [
* 'twitter' => [ * 'twitter' => [
* 'consumerkey' => '', * 'consumerkey' => '',
* 'consumersecret' => '', * 'consumersecret' => '',
* ], * ],
* ];
* *
* To activate the addon itself add it to the system.addon * To activate the addon itself add it to the system.addon
* setting. After this, your user can configure their Twitter account settings * setting. After this, your user can configure their Twitter account settings