Merge branch '2018.08-rc'
|
@ -0,0 +1,36 @@
|
||||||
|
codecov:
|
||||||
|
branch: develop
|
||||||
|
|
||||||
|
comment: off
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
status:
|
||||||
|
patch:
|
||||||
|
default: off
|
||||||
|
source:
|
||||||
|
target: 80%
|
||||||
|
flags: source
|
||||||
|
backend:
|
||||||
|
target: 80%
|
||||||
|
flags: backend
|
||||||
|
project:
|
||||||
|
default: off
|
||||||
|
source:
|
||||||
|
flags: source
|
||||||
|
backend:
|
||||||
|
flags: backend
|
||||||
|
|
||||||
|
flags:
|
||||||
|
source:
|
||||||
|
paths:
|
||||||
|
- src/
|
||||||
|
backend:
|
||||||
|
paths:
|
||||||
|
- mod/
|
||||||
|
- include/
|
||||||
|
binary:
|
||||||
|
paths:
|
||||||
|
- bin/
|
||||||
|
tests:
|
||||||
|
paths:
|
||||||
|
- tests/
|
|
@ -2,21 +2,22 @@ favicon.*
|
||||||
.htconfig.php
|
.htconfig.php
|
||||||
.htpreconfig.php
|
.htpreconfig.php
|
||||||
\#*
|
\#*
|
||||||
include/jquery-1.4.2.min.js
|
|
||||||
*.log
|
*.log
|
||||||
*.out
|
*.out
|
||||||
*.version*
|
*.version*
|
||||||
favicon.*
|
|
||||||
home.html
|
home.html
|
||||||
addon
|
|
||||||
*.orig
|
|
||||||
*~
|
*~
|
||||||
robots.txt
|
robots.txt
|
||||||
|
|
||||||
#ignore documentation, it should be newly built
|
#ignore local config
|
||||||
doc/html
|
/config/local.ini.php
|
||||||
|
/config/addon.ini.php
|
||||||
|
|
||||||
#ignore reports, should be generted with every build
|
#ignore documentation, it should be newly built
|
||||||
|
/doc/html
|
||||||
|
|
||||||
|
#ignore reports, should be generated with every build
|
||||||
report/
|
report/
|
||||||
|
|
||||||
#ignore config files from eclipse, we don't want IDE files in our repository
|
#ignore config files from eclipse, we don't want IDE files in our repository
|
||||||
|
@ -24,9 +25,11 @@ report/
|
||||||
.buildpath
|
.buildpath
|
||||||
.externalToolBuilders
|
.externalToolBuilders
|
||||||
.settings
|
.settings
|
||||||
|
|
||||||
#ignore OSX .DS_Store files
|
#ignore OSX .DS_Store files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
#ignore NetBeans IDE's private files (at least)
|
||||||
/nbproject/private/
|
/nbproject/private/
|
||||||
|
|
||||||
#ignore smarty cache
|
#ignore smarty cache
|
||||||
|
@ -59,3 +62,10 @@ venv/
|
||||||
|
|
||||||
#ignore config files from JetBrains
|
#ignore config files from JetBrains
|
||||||
/.idea
|
/.idea
|
||||||
|
|
||||||
|
#ignore addons directory
|
||||||
|
/addons
|
||||||
|
/addon
|
||||||
|
|
||||||
|
#ignore .htaccess
|
||||||
|
.htaccess
|
||||||
|
|
|
@ -38,4 +38,3 @@ AddType audio/ogg .oga
|
||||||
RewriteRule ^(.*)$ index.php?pagename=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
|
RewriteRule ^(.*)$ index.php?pagename=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
|
||||||
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
19
.travis.yml
|
@ -1,10 +1,25 @@
|
||||||
---
|
---
|
||||||
language: php
|
language: php
|
||||||
## Friendica supports PHP version >= 5.6
|
## Friendica supports PHP version >= 5.6.1
|
||||||
php:
|
php:
|
||||||
- 5.6
|
- 5.6
|
||||||
- 7.0
|
- 7.0
|
||||||
- 7.1
|
- 7.1
|
||||||
- 7.2
|
- 7.2
|
||||||
|
|
||||||
install: composer install
|
services:
|
||||||
|
- mysql
|
||||||
|
- redis-server
|
||||||
|
- memcached
|
||||||
|
env:
|
||||||
|
- MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_USERNAME=travis MYSQL_PASSWORD= MYSQL_DATABASE=test
|
||||||
|
|
||||||
|
install:
|
||||||
|
- composer install
|
||||||
|
before_script:
|
||||||
|
- cp config/local-sample.ini.php config/local.ini.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
|
||||||
|
- echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||||
|
after_success: bash <(curl -s https://codecov.io/bash)
|
||||||
|
|
131
CHANGELOG
|
@ -1,3 +1,134 @@
|
||||||
|
Version 2018.09 (2018-09-23)
|
||||||
|
Friendica Core:
|
||||||
|
Update to the translation (CS, DE, EN-US, FI, IT, NL, PL, ZH-CN) [translation teams]
|
||||||
|
Update to the documentation [Aditoo17, annando, astifter, rebeka-catalina, fabrixxm, M-arcus, microgroove, nupplaphil, tobiasd]
|
||||||
|
Enhancements to the database structure, handling and documentation [abanink, Angristan, annando, miqrogroove, tobiasd]
|
||||||
|
Enhancements of unit testing [abanink, nupplaphil, rudloff]
|
||||||
|
Enhancements to labelling of UI elements [andyhee, tobiasd]
|
||||||
|
Enhancements to the background workers [annando, miqrogroove, rabuzarus]
|
||||||
|
Enhancements to the PHP7.2 compatibility [annando, miqrogroove, MrPetovan]
|
||||||
|
Enhancements to the content filter [MrPetovan]
|
||||||
|
Enhancements to the hooks provided for addons [abanink]
|
||||||
|
Enhancements to the interaction with public postings [annando]
|
||||||
|
Enhancements to the config storage [frabrixxm]
|
||||||
|
Enhancements to the themes (frio, quattro, smoothly, vier) [annando, astifter, hoergen, MrPetovan, rabuzarus, tobiasd]
|
||||||
|
Enhancements to the handling of locks [nupplaphil]
|
||||||
|
Enhancements to the redis integration [nupplaphil]
|
||||||
|
Enhancements to the admin panel [JeroenED, tobiasd]
|
||||||
|
Enhancements to the user import process [annando]
|
||||||
|
Enhancements to the display of invitation information [JeroenED]
|
||||||
|
Enhancements to the automatic installation process [nupplaphil]
|
||||||
|
Enhancements to the contact group UI [annando, astifter]
|
||||||
|
Enhancements to the call of JS [hypolite]
|
||||||
|
Enhancements to the storage of items in the database [annando]
|
||||||
|
Enhancements to the process of changing relationships [annando]
|
||||||
|
Enhancements to the OEmbed of data [MrPetovan]
|
||||||
|
Fixed various PHP notice occurrences [annando, MrPetovan]
|
||||||
|
Fixed a bug that could lead to the display of posts from deleted accounts on the community page for a short period [annando]
|
||||||
|
Fixed a bug that prevented email notification to be send out [annando]
|
||||||
|
Fixed a bug in database optimisation [annando]
|
||||||
|
Fixed a bug during removing contacts [annando]
|
||||||
|
Fixed a bug in the tag-cloud widget [annando]
|
||||||
|
Fixed a bug in the daemon mode of the background worker [annando]
|
||||||
|
Fixed a bug in the frio theme that contact filtering [rabuzarus]
|
||||||
|
Fixed a bug that mangled the display of some additional smileys [abanink]
|
||||||
|
Fixed a bug in generating registration mails [MrPetovan]
|
||||||
|
Fixed a bug that caused blank re-share bodies [MrPetovon]
|
||||||
|
Fixed a bug in the API handling of private mails [fabrixxm]
|
||||||
|
Fixed a bug when calling the mail() function [miqrogroove]
|
||||||
|
Fixed a bug that caused deleted accounts being displayed in the local directory [miqrogroove]
|
||||||
|
Fixed a bug when checking the domain of an email address [VVelox]
|
||||||
|
Fixed a bug that prevented re-shares from Twitter to be shown as this [annando]
|
||||||
|
Fixed a bug that caused broken profile links [miqrogroove]
|
||||||
|
Fixed a bug that caused content from unknown accounts appearing in the timeline [annando]
|
||||||
|
Fixed a bug with the ignoring and blocking of contacts [annando]
|
||||||
|
Fixed a bug with showing hidden contacts in some places [annando]
|
||||||
|
Fixed a bug that prevented the deletion of events by contacts [annando]
|
||||||
|
Fixed a bug that prevented email contacts from being added [annando]
|
||||||
|
Fixed a bug in the notification/seen API call [fabrixxm]
|
||||||
|
Fixed a bug that prevented a refresh after un-/ignoring a conversation [annando]
|
||||||
|
Fixed a bug in the handling of some language translations [anndno]
|
||||||
|
Fixed a bug in the hook handling [annando]
|
||||||
|
Fixed the handling of too long tags [annando]
|
||||||
|
Fixed a bug that prevented the unliking of dis-/likes [annando]
|
||||||
|
Fixed bugs with the handling of private nodes [annando]
|
||||||
|
Fixed a bug in the session initialisation [annando]
|
||||||
|
Fixed bugs in the execution of the background processes [annando, Quix0r]
|
||||||
|
Fixed a problem with the notification page [MrPetovan]
|
||||||
|
Fixed a bug with wrong dates in importing some Atom feeds [annando]
|
||||||
|
Fixed forum exclusive distribution of postings using the !notation [annando]
|
||||||
|
Fixed a bug that lead to empty notifications [MrPetovan]
|
||||||
|
Fixed a problem that could sometimes prevent the execution of the relocation [annando]
|
||||||
|
Fixed a bug with the handling of images in postings over the connectors [annando]
|
||||||
|
Added conversation cleanup configuration [miqrogroove]
|
||||||
|
Added support of the usage of internal diaspora links to accounts [annando]
|
||||||
|
Added the possibility for admins to block certain nicknames (e.g. role names) [tobiasd]
|
||||||
|
Added the generation of system guid [nupplaphil]
|
||||||
|
Added the possibility for admins to mark a node for explicit content [tobiasd]
|
||||||
|
Added filter by account type to the community page [annando]
|
||||||
|
Added private flag to API results [fabrixxm]
|
||||||
|
Added post update checks to the console utility [annando]
|
||||||
|
Added codecov analysis [nupplaphil]
|
||||||
|
Added access-keys to the frio theme [tobiasd]
|
||||||
|
Added the profile settings to the user settings [tobiasd]
|
||||||
|
General code refactoring and beautification work [annando, MrPetovan, Quix0r, tobiasd]
|
||||||
|
Fixation of the position on the network page when new posts arrive [rabuzarus]
|
||||||
|
Ported OpenWebAuth from Hubzilla [annando, rabuzarus]
|
||||||
|
Removed hard coded syntax highlighting from code blocks [MrPetovan]
|
||||||
|
Removed (temporarily) the possibility to add pictures to private messages [annando]
|
||||||
|
New INI style config file format in /config [MrPetovan, tobiasd]
|
||||||
|
The .htaccess file is not part of the git repository anymore [annando, Quix0r]
|
||||||
|
|
||||||
|
Friendica Addons:
|
||||||
|
Update to the translations (CS, DE, EN-US, NL, PL, ZH-CN) [translation teams]
|
||||||
|
General update to adopt changes in core [annando, MrPetovan, Quix0r, tobiasd]
|
||||||
|
advancedcontentfilter:
|
||||||
|
Enhancement to the error handling [MrPetovan]
|
||||||
|
Honour the CSP settings [MrPetovan]
|
||||||
|
Fixed translation problems [annando]
|
||||||
|
blockem:
|
||||||
|
Enhancement of the settings [AlfredSK]
|
||||||
|
buffer:
|
||||||
|
support for app.net removed [annando]
|
||||||
|
js_upload:
|
||||||
|
Enhancement of the album name handling [rabuzarus]
|
||||||
|
Enhancement to the wording of the labels [astifter]
|
||||||
|
langfilter:
|
||||||
|
Fixed a problem with default values of the filtered languages [tobiasd]
|
||||||
|
libravatar:
|
||||||
|
The service wont shutdown, so we can keep the addon [tobiasd]
|
||||||
|
pumpio:
|
||||||
|
Fixed a problem that prevented new connections [annando]
|
||||||
|
superblock:
|
||||||
|
Fixed a bug that prevented the addon to block accounts [annando]
|
||||||
|
Enhancements of the settings [AlfredSK]
|
||||||
|
twitter:
|
||||||
|
Use rich text for quote tweets [MrPetovan]
|
||||||
|
Prevent empty quotes from being created [annando]
|
||||||
|
Fixed a problem with re-shares from remote_self contacts [annando]
|
||||||
|
Changed URL display after link expansion [MrPetovan]
|
||||||
|
Fixed a problem with EXIF handling [MrPetovan]
|
||||||
|
added addons:
|
||||||
|
mastodoncustomemojis [MrPetovan]
|
||||||
|
deprecated addons:
|
||||||
|
notimeline, retriver, remote_permissions, widgets
|
||||||
|
|
||||||
|
Directory:
|
||||||
|
Enhancements of the health summary [andyhee]
|
||||||
|
Enhancements of the PHP7 compatibility [MrPetovan]
|
||||||
|
|
||||||
|
Closed Issues:
|
||||||
|
901, 1034, 1074, 1303, 1308, 1391, 1490, 1470, 1559, 2093, 2337,
|
||||||
|
2340, 2381, 2396, 2675, 3291, 3299, 3493, 3501, 3535, 3643, 3840,
|
||||||
|
4148, 4419, 4475, 4507, 4655, 4659, 4710, 4726, 4739, 4753, 4814,
|
||||||
|
4830, 4868, 4889, 4923, 4971, 4950, 4985, 5066, 5099, 5137, 5148,
|
||||||
|
5158, 5168, 5188, 5202, 5211, 5222, 5233, 5243, 5247, 5252, 5257,
|
||||||
|
5260, 5262, 5268, 5274, 5275, 5276, 5278, 5298, 5318, 5319, 5320,
|
||||||
|
5321, 5322, 5330, 5333, 5341, 5365, 5405, 5407, 5411, 5423, 5432,
|
||||||
|
5434, 5436, 5443, 5455, 5464, 5467, 5469, 5486, 5496, 5497, 5514,
|
||||||
|
5539, 5524, 5541, 5544, 5550, 5564, 5566, 5605, 5630, 5638, 5651,
|
||||||
|
5653, 5660, 5670, 5691, 5733, 5745, 5768
|
||||||
|
|
||||||
Version 2018.05 (2018-06-01)
|
Version 2018.05 (2018-06-01)
|
||||||
Friendica Core:
|
Friendica Core:
|
||||||
Update to the translations (DE, EN-GB, EN-US, FI, IS, IT, NL, PL, RU, ZN CH) [translation teams]
|
Update to the translations (DE, EN-GB, EN-US, FI, IS, IT, NL, PL, RU, ZN CH) [translation teams]
|
||||||
|
|
63
INSTALL.txt
|
@ -32,7 +32,7 @@ link if your cert is self-signed).
|
||||||
- Apache with mod-rewrite enabled and "Options All" so you can use a
|
- Apache with mod-rewrite enabled and "Options All" so you can use a
|
||||||
local .htaccess file
|
local .htaccess file
|
||||||
|
|
||||||
- PHP 5.6+ (PHP 7 recommended for performance).
|
- PHP 5.6.1+ (PHP 7 recommended for performance).
|
||||||
|
|
||||||
- PHP *command line* access with register_argc_argv set to true in the
|
- PHP *command line* access with register_argc_argv set to true in the
|
||||||
php.ini file [or see 'poormancron' in section 8]
|
php.ini file [or see 'poormancron' in section 8]
|
||||||
|
@ -66,10 +66,39 @@ OR
|
||||||
|
|
||||||
2b. Clone the friendica/friendica GitHub repository and import dependencies
|
2b. Clone the friendica/friendica GitHub repository and import dependencies
|
||||||
|
|
||||||
git clone https://github.com/friendica/friendica [web server folder]
|
git clone https://github.com/friendica/friendica -b master [web server folder]
|
||||||
cd [web server folder]
|
cd [web server folder]
|
||||||
php bin/composer.phar install
|
php bin/composer.phar install
|
||||||
|
|
||||||
|
Make sure the folder view/smarty3 exists and is writable by the webserver
|
||||||
|
user, in this case `www-data`
|
||||||
|
|
||||||
|
mkdir view/smarty3
|
||||||
|
chown www-data:www-data view/smarty3
|
||||||
|
chmod 775 view/smarty3
|
||||||
|
|
||||||
|
Get the addons by going into your website folder.
|
||||||
|
|
||||||
|
cd mywebsite
|
||||||
|
|
||||||
|
Clone the addon repository (separately):
|
||||||
|
|
||||||
|
git clone https://github.com/friendica/friendica-addons.git -b master addon
|
||||||
|
|
||||||
|
If you copy the directory tree to your webserver, make sure that you also
|
||||||
|
copy .htaccess - as "dot" files are often hidden and aren't normally copied.
|
||||||
|
|
||||||
|
If you want to use the development version of Friendica you can switch to
|
||||||
|
the devel branch in the repository by running
|
||||||
|
|
||||||
|
git checkout develop
|
||||||
|
bin/composer.phar install
|
||||||
|
cd addon
|
||||||
|
git checkout develop
|
||||||
|
|
||||||
|
please be aware that the develop branch may break your Friendica node at any
|
||||||
|
time. If you encounter a bug, please let us know.
|
||||||
|
|
||||||
3. Create an empty database and note the access details (hostname, username,
|
3. Create an empty database and note the access details (hostname, username,
|
||||||
password, database name).
|
password, database name).
|
||||||
|
|
||||||
|
@ -77,8 +106,8 @@ password, database name).
|
||||||
- Please check the additional notes if running on MySQ 5.7.17 or newer
|
- Please check the additional notes if running on MySQ 5.7.17 or newer
|
||||||
|
|
||||||
4. If you know in advance that it will be impossible for the web server to
|
4. If you know in advance that it will be impossible for the web server to
|
||||||
write or create files in your web directory, create an empty file called
|
write or create files in the config/ subfolder, create an empty file called
|
||||||
.htconfig.php and make it writable by the web server.
|
local.ini.php and make it writable by the web server.
|
||||||
|
|
||||||
5. Visit your website with a web browser and follow the instructions. Please
|
5. Visit your website with a web browser and follow the instructions. Please
|
||||||
note any error messages and correct these before continuing.
|
note any error messages and correct these before continuing.
|
||||||
|
@ -92,9 +121,9 @@ so in the host name setting for the database.
|
||||||
|
|
||||||
6. *If* the automated installation fails for any reason, check the following:
|
6. *If* the automated installation fails for any reason, check the following:
|
||||||
|
|
||||||
- ".htconfig.php" exists
|
- "config/local.ini.php" exists
|
||||||
If not, edit htconfig.php and change system settings. Rename
|
If not, edit local-sample.ini.php and change system settings. Rename
|
||||||
to .htconfig.php
|
to local.ini.php
|
||||||
- Database is populated.
|
- Database is populated.
|
||||||
If not, import the contents of "database.sql" with phpmyadmin
|
If not, import the contents of "database.sql" with phpmyadmin
|
||||||
or mysql command line
|
or mysql command line
|
||||||
|
@ -103,7 +132,7 @@ or mysql command line
|
||||||
Registration errors should all be recoverable automatically.
|
Registration errors should all be recoverable automatically.
|
||||||
If you get any *critical* failure at this point, it generally indicates the
|
If you get any *critical* failure at this point, it generally indicates the
|
||||||
database was not installed correctly. You might wish to move/rename
|
database was not installed correctly. You might wish to move/rename
|
||||||
.htconfig.php to another name and empty (called 'dropping') the database
|
local.ini.php to another name and empty (called 'dropping') the database
|
||||||
tables, so that you can start fresh.
|
tables, so that you can start fresh.
|
||||||
|
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
|
@ -148,7 +177,7 @@ Bad things will happen. Let there be a hardware failure, a corrupted
|
||||||
database or whatever you can think of. So once the installation of your
|
database or whatever you can think of. So once the installation of your
|
||||||
Friendica node is done, you should make yoursef a backup plan.
|
Friendica node is done, you should make yoursef a backup plan.
|
||||||
|
|
||||||
The most important file is the `.htconfig.php` file in the base directory.
|
The most important file is the `config/local.ini.php` file in the base directory.
|
||||||
As it stores all your data, you should also have a recent dump of your
|
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.
|
Friendica database at hand, should you have to recover your node.
|
||||||
|
|
||||||
|
@ -245,21 +274,21 @@ Windows).
|
||||||
|
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
- If you are unable to write the file .htconfig.php during installation
|
- If you are unable to write the file config/local.ini.php during installation
|
||||||
due to permissions issues:
|
due to permissions issues:
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
create an empty file with that name and give it world-write permission.
|
create an empty file with that name and give it world-write permission.
|
||||||
For Linux:
|
For Linux:
|
||||||
|
|
||||||
% touch .htconfig.php
|
% touch config/local.ini.php
|
||||||
% chmod 777 .htconfig.php
|
% chmod 664 config/local.ini.php
|
||||||
|
|
||||||
Retry the installation. As soon as the database has been created,
|
Retry the installation. As soon as the database has been created,
|
||||||
|
|
||||||
******* this is important *********
|
******* this is important *********
|
||||||
|
|
||||||
% chmod 755 .htconfig.php
|
% chmod 644 config/local.ini.php
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
- Some configurations with "suhosin" security are configured without
|
- Some configurations with "suhosin" security are configured without
|
||||||
|
@ -298,11 +327,11 @@ After a while I noticed, that bin/worker.php calls further php script via
|
||||||
proc_open. These scripts themselves also use proc_open and fail, because they
|
proc_open. These scripts themselves also use proc_open and fail, because they
|
||||||
are NOT called with -d suhosin.executor.func.blacklist=none.
|
are NOT called with -d suhosin.executor.func.blacklist=none.
|
||||||
|
|
||||||
So the simple solution is to put the correct parameters into .htconfig.php:
|
So the simple solution is to put the correct parameters into config/local.ini.php:
|
||||||
// Location of PHP command line processor
|
|
||||||
$a->config['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
|
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
|
execute php-scripts that also use proc_open, but it took me quite some time to
|
||||||
|
|
|
@ -33,8 +33,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\BaseObject;
|
|
||||||
use Friendica\Core\Config;
|
|
||||||
use Friendica\Util\ExAuth;
|
use Friendica\Util\ExAuth;
|
||||||
|
|
||||||
if (sizeof($_SERVER["argv"]) == 0) {
|
if (sizeof($_SERVER["argv"]) == 0) {
|
||||||
|
@ -55,12 +53,8 @@ require_once "boot.php";
|
||||||
require_once "include/dba.php";
|
require_once "include/dba.php";
|
||||||
|
|
||||||
$a = new App(dirname(__DIR__));
|
$a = new App(dirname(__DIR__));
|
||||||
BaseObject::setApp($a);
|
|
||||||
|
|
||||||
@include ".htconfig.php";
|
if ($a->mode === App::MODE_NORMAL) {
|
||||||
dba::connect($db_host, $db_user, $db_pass, $db_data);
|
$oAuth = new ExAuth();
|
||||||
unset($db_host, $db_user, $db_pass, $db_data);
|
$oAuth->readStdin();
|
||||||
|
}
|
||||||
$oAuth = new ExAuth();
|
|
||||||
|
|
||||||
$oAuth->readStdin();
|
|
180
bin/daemon.php
|
@ -6,10 +6,48 @@
|
||||||
*
|
*
|
||||||
* This script was taken from http://php.net/manual/en/function.pcntl-fork.php
|
* This script was taken from http://php.net/manual/en/function.pcntl-fork.php
|
||||||
*/
|
*/
|
||||||
function shutdown() {
|
|
||||||
posix_kill(posix_getpid(), SIGHUP);
|
use Friendica\App;
|
||||||
|
use Friendica\Core\Config;
|
||||||
|
use Friendica\Core\Worker;
|
||||||
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
|
// Get options
|
||||||
|
$shortopts = 'f';
|
||||||
|
$longopts = ['foreground'];
|
||||||
|
$options = getopt($shortopts, $longopts);
|
||||||
|
|
||||||
|
// Ensure that daemon.php is executed from the base path of the installation
|
||||||
|
if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
|
||||||
|
$directory = dirname($_SERVER["argv"][0]);
|
||||||
|
|
||||||
|
if (substr($directory, 0, 1) != "/") {
|
||||||
|
$directory = $_SERVER["PWD"] . "/" . $directory;
|
||||||
|
}
|
||||||
|
$directory = realpath($directory . "/..");
|
||||||
|
|
||||||
|
chdir($directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once "boot.php";
|
||||||
|
require_once "include/dba.php";
|
||||||
|
|
||||||
|
$a = new App(dirname(__DIR__));
|
||||||
|
|
||||||
|
if ($a->isInstallMode()) {
|
||||||
|
die("Friendica isn't properly installed yet.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
Config::load();
|
||||||
|
|
||||||
|
if (empty(Config::get('system', 'pidfile'))) {
|
||||||
|
die('Please set system.pidfile in config/local.ini.php. For example:'."\n".
|
||||||
|
'[system]'."\n".
|
||||||
|
'pidfile = /path/to/daemon.pid'."\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
$pidfile = Config::get('system', 'pidfile');
|
||||||
|
|
||||||
if (in_array("start", $_SERVER["argv"])) {
|
if (in_array("start", $_SERVER["argv"])) {
|
||||||
$mode = "start";
|
$mode = "start";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +60,8 @@ if (in_array("status", $_SERVER["argv"])) {
|
||||||
$mode = "status";
|
$mode = "status";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$foreground = array_key_exists('f', $options) || array_key_exists('foreground', $options);
|
||||||
|
|
||||||
if (!isset($mode)) {
|
if (!isset($mode)) {
|
||||||
die("Please use either 'start', 'stop' or 'status'.\n");
|
die("Please use either 'start', 'stop' or 'status'.\n");
|
||||||
}
|
}
|
||||||
|
@ -30,27 +70,15 @@ if (empty($_SERVER["argv"][0])) {
|
||||||
die("Unexpected script behaviour. This message should never occur.\n");
|
die("Unexpected script behaviour. This message should never occur.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch the base directory
|
$pid = null;
|
||||||
$directory = dirname($_SERVER["argv"][0]);
|
|
||||||
|
|
||||||
if (substr($directory, 0, 1) != "/") {
|
if (is_readable($pidfile)) {
|
||||||
$directory = $_SERVER["PWD"]."/".$directory;
|
$pid = intval(file_get_contents($pidfile));
|
||||||
}
|
|
||||||
$directory = realpath($directory."/..");
|
|
||||||
|
|
||||||
@include($directory."/.htconfig.php");
|
|
||||||
|
|
||||||
if (!isset($pidfile)) {
|
|
||||||
die('Please specify a pid file in the variable $pidfile in the .htconfig.php. For example:'."\n".
|
|
||||||
'$pidfile = "/path/to/daemon.pid";'."\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($mode, array("stop", "status"))) {
|
if (empty($pid) && in_array($mode, ["stop", "status"])) {
|
||||||
$pid = @file_get_contents($pidfile);
|
Config::set('system', 'worker_daemon_mode', false);
|
||||||
|
|
||||||
if (!$pid) {
|
|
||||||
die("Pidfile wasn't found. Is the daemon running?\n");
|
die("Pidfile wasn't found. Is the daemon running?\n");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == "status") {
|
if ($mode == "status") {
|
||||||
|
@ -60,6 +88,7 @@ if ($mode == "status") {
|
||||||
|
|
||||||
unlink($pidfile);
|
unlink($pidfile);
|
||||||
|
|
||||||
|
Config::set('system', 'worker_daemon_mode', false);
|
||||||
die("Daemon process $pid isn't running.\n");
|
die("Daemon process $pid isn't running.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,59 +97,102 @@ if ($mode == "stop") {
|
||||||
|
|
||||||
unlink($pidfile);
|
unlink($pidfile);
|
||||||
|
|
||||||
|
logger("Worker daemon process $pid was killed.", LOGGER_DEBUG);
|
||||||
|
|
||||||
|
Config::set('system', 'worker_daemon_mode', false);
|
||||||
die("Worker daemon process $pid was killed.\n");
|
die("Worker daemon process $pid was killed.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Starting worker daemon.\n";
|
if (!empty($pid) && posix_kill($pid, 0)) {
|
||||||
|
die("Daemon process $pid is already running.\n");
|
||||||
if (isset($a->config['php_path'])) {
|
|
||||||
$php = $a->config['php_path'];
|
|
||||||
} else {
|
|
||||||
$php = "php";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch over to daemon mode.
|
logger('Starting worker daemon.', LOGGER_DEBUG);
|
||||||
if ($pid = pcntl_fork())
|
|
||||||
|
if (!$foreground) {
|
||||||
|
echo "Starting worker daemon.\n";
|
||||||
|
|
||||||
|
// Switch over to daemon mode.
|
||||||
|
if ($pid = pcntl_fork()) {
|
||||||
return; // Parent
|
return; // Parent
|
||||||
|
}
|
||||||
|
|
||||||
fclose(STDIN); // Close all of the standard
|
fclose(STDIN); // Close all of the standard
|
||||||
fclose(STDOUT); // file descriptors as we
|
|
||||||
fclose(STDERR); // are running as a daemon.
|
|
||||||
|
|
||||||
register_shutdown_function('shutdown');
|
// Enabling this seem to block a running php process with 100% CPU usage when there is an outpout
|
||||||
|
// fclose(STDOUT); // file descriptors as we
|
||||||
|
// fclose(STDERR); // are running as a daemon.
|
||||||
|
|
||||||
if (posix_setsid() < 0)
|
DBA::disconnect();
|
||||||
|
|
||||||
|
register_shutdown_function('shutdown');
|
||||||
|
|
||||||
|
if (posix_setsid() < 0) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($pid = pcntl_fork())
|
if ($pid = pcntl_fork()) {
|
||||||
return; // Parent
|
return; // Parent
|
||||||
|
}
|
||||||
|
|
||||||
$pid = getmypid();
|
$pid = getmypid();
|
||||||
file_put_contents($pidfile, $pid);
|
file_put_contents($pidfile, $pid);
|
||||||
|
|
||||||
|
// We lose the database connection upon forking
|
||||||
|
$a->loadDatabase();
|
||||||
|
}
|
||||||
|
|
||||||
|
Config::set('system', 'worker_daemon_mode', true);
|
||||||
|
|
||||||
|
// Just to be sure that this script really runs endlessly
|
||||||
|
set_time_limit(0);
|
||||||
|
|
||||||
|
$wait_interval = intval(Config::get('system', 'cron_interval', 5)) * 60;
|
||||||
|
|
||||||
|
$do_cron = true;
|
||||||
|
$last_cron = 0;
|
||||||
|
|
||||||
// Now running as a daemon.
|
// Now running as a daemon.
|
||||||
while (true) {
|
while (true) {
|
||||||
// Just to be sure that this script really runs endlessly
|
if (!$do_cron && ($last_cron + $wait_interval) < time()) {
|
||||||
set_time_limit(0);
|
logger('Forcing cron worker call.', LOGGER_DEBUG);
|
||||||
|
$do_cron = true;
|
||||||
// Call the worker
|
|
||||||
$cmdline = $php.' bin/worker.php';
|
|
||||||
|
|
||||||
$executed = false;
|
|
||||||
|
|
||||||
if (function_exists('proc_open')) {
|
|
||||||
$resource = proc_open($cmdline . ' &', array(), $foo, $directory);
|
|
||||||
|
|
||||||
if (is_resource($resource)) {
|
|
||||||
$executed = true;
|
|
||||||
proc_close($resource);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$executed) {
|
Worker::spawnWorker($do_cron);
|
||||||
exec($cmdline.' spawn');
|
|
||||||
|
if ($do_cron) {
|
||||||
|
// We force a reconnect of the database connection.
|
||||||
|
// This is done to ensure that the connection don't get lost over time.
|
||||||
|
DBA::reconnect();
|
||||||
|
|
||||||
|
$last_cron = time();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now sleep for 5 minutes
|
logger("Sleeping", LOGGER_DEBUG);
|
||||||
sleep(300);
|
$start = time();
|
||||||
|
do {
|
||||||
|
$seconds = (time() - $start);
|
||||||
|
|
||||||
|
// logarithmic wait time calculation.
|
||||||
|
// Background: After jobs had been started, they often fork many workers.
|
||||||
|
// To not waste too much time, the sleep period increases.
|
||||||
|
$arg = (($seconds + 1) / ($wait_interval / 9)) + 1;
|
||||||
|
$sleep = round(log10($arg) * 1000000, 0);
|
||||||
|
usleep($sleep);
|
||||||
|
|
||||||
|
$timeout = ($seconds >= $wait_interval);
|
||||||
|
} while (!$timeout && !Worker::IPCJobsExists());
|
||||||
|
|
||||||
|
if ($timeout) {
|
||||||
|
$do_cron = true;
|
||||||
|
logger("Woke up after $wait_interval seconds.", LOGGER_DEBUG);
|
||||||
|
} else {
|
||||||
|
$do_cron = false;
|
||||||
|
logger("Worker jobs are calling to be forked.", LOGGER_DEBUG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function shutdown() {
|
||||||
|
posix_kill(posix_getpid(), SIGHUP);
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ if not os.path.exists(outpath):
|
||||||
|
|
||||||
files = os.listdir(path)
|
files = os.listdir(path)
|
||||||
for a_file in files:
|
for a_file in files:
|
||||||
if a_file == 'htconfig.tpl':
|
if a_file == 'local.ini.tpl':
|
||||||
php_tpl = True
|
php_tpl = True
|
||||||
else:
|
else:
|
||||||
php_tpl = False
|
php_tpl = False
|
||||||
|
|
|
@ -86,7 +86,8 @@ cd /var/www
|
||||||
php bin/composer.phar install
|
php bin/composer.phar install
|
||||||
|
|
||||||
# initial config file for friendica in vagrant
|
# initial config file for friendica in vagrant
|
||||||
cp /vagrant/util/htconfig.vagrant.php /vagrant/.htconfig.php
|
#cp /vagrant/util/htconfig.vagrant.php /vagrant/.htconfig.php
|
||||||
|
cp /vagrant/util/local.ini.vagrant.php /vagrant/config/local.ini.php
|
||||||
|
|
||||||
# create the friendica database
|
# create the friendica database
|
||||||
echo "create database friendica DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" | $MYSQL -u root -proot
|
echo "create database friendica DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" | $MYSQL -u root -proot
|
||||||
|
|
|
@ -6,10 +6,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\BaseObject;
|
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
|
use Friendica\Core\L10n;
|
||||||
|
|
||||||
|
// Get options
|
||||||
|
$shortopts = 'sn';
|
||||||
|
$longopts = ['spawn', 'no_cron'];
|
||||||
|
$options = getopt($shortopts, $longopts);
|
||||||
|
|
||||||
// Ensure that worker.php is executed from the base path of the installation
|
// Ensure that worker.php is executed from the base path of the installation
|
||||||
if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
|
if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
|
||||||
|
@ -24,17 +29,14 @@ if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once "boot.php";
|
require_once "boot.php";
|
||||||
require_once "include/dba.php";
|
|
||||||
|
|
||||||
$a = new App(dirname(__DIR__));
|
$a = new App(dirname(__DIR__));
|
||||||
BaseObject::setApp($a);
|
|
||||||
|
|
||||||
require_once ".htconfig.php";
|
|
||||||
dba::connect($db_host, $db_user, $db_pass, $db_data);
|
|
||||||
unset($db_host, $db_user, $db_pass, $db_data);
|
|
||||||
|
|
||||||
Config::load();
|
Config::load();
|
||||||
|
|
||||||
|
$lang = L10n::getBrowserLanguage();
|
||||||
|
L10n::loadTranslationTable($lang);
|
||||||
|
|
||||||
// Check the database structure and possibly fixes it
|
// Check the database structure and possibly fixes it
|
||||||
check_db(true);
|
check_db(true);
|
||||||
|
|
||||||
|
@ -47,14 +49,14 @@ $a->set_baseurl(Config::get('system', 'url'));
|
||||||
|
|
||||||
Addon::loadHooks();
|
Addon::loadHooks();
|
||||||
|
|
||||||
$spawn = (($_SERVER["argc"] == 2) && ($_SERVER["argv"][1] == "spawn"));
|
$spawn = array_key_exists('s', $options) || array_key_exists('spawn', $options);
|
||||||
|
|
||||||
if ($spawn) {
|
if ($spawn) {
|
||||||
Worker::spawnWorker();
|
Worker::spawnWorker();
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
$run_cron = (($_SERVER["argc"] <= 1) || ($_SERVER["argv"][1] != "no_cron"));
|
$run_cron = !array_key_exists('n', $options) && !array_key_exists('no_cron', $options);
|
||||||
|
|
||||||
Worker::processQueue($run_cron);
|
Worker::processQueue($run_cron);
|
||||||
|
|
||||||
|
@ -63,4 +65,3 @@ Worker::unclaimProcess();
|
||||||
Worker::endProcess();
|
Worker::endProcess();
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
|
|
347
boot.php
|
@ -29,7 +29,7 @@ use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBStructure;
|
use Friendica\Database\DBStructure;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Conversation;
|
use Friendica\Model\Conversation;
|
||||||
|
@ -39,9 +39,9 @@ require_once 'include/text.php';
|
||||||
|
|
||||||
define('FRIENDICA_PLATFORM', 'Friendica');
|
define('FRIENDICA_PLATFORM', 'Friendica');
|
||||||
define('FRIENDICA_CODENAME', 'The Tazmans Flax-lily');
|
define('FRIENDICA_CODENAME', 'The Tazmans Flax-lily');
|
||||||
define('FRIENDICA_VERSION', '2018.05');
|
define('FRIENDICA_VERSION', '2018.08-rc');
|
||||||
define('DFRN_PROTOCOL_VERSION', '2.23');
|
define('DFRN_PROTOCOL_VERSION', '2.23');
|
||||||
define('DB_UPDATE_VERSION', 1266);
|
define('DB_UPDATE_VERSION', 1283);
|
||||||
define('NEW_UPDATE_ROUTINE_VERSION', 1170);
|
define('NEW_UPDATE_ROUTINE_VERSION', 1170);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,15 +64,13 @@ define('EOL', "<br />\r\n");
|
||||||
* @brief Image storage quality.
|
* @brief Image storage quality.
|
||||||
*
|
*
|
||||||
* Lower numbers save space at cost of image detail.
|
* Lower numbers save space at cost of image detail.
|
||||||
* For ease of upgrade, please do not change here. Change jpeg quality with
|
* For ease of upgrade, please do not change here. Set [system] jpegquality = n in config/local.ini.php,
|
||||||
* $a->config['system']['jpeg_quality'] = n;
|
* where n is between 1 and 100, and with very poor results below about 50
|
||||||
* in .htconfig.php, where n is netween 1 and 100, and with very poor results
|
|
||||||
* below about 50
|
|
||||||
*/
|
*/
|
||||||
define('JPEG_QUALITY', 100);
|
define('JPEG_QUALITY', 100);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $a->config['system']['png_quality'] from 0 (uncompressed) to 9
|
* [system] png_quality = n where is between 0 (uncompressed) to 9
|
||||||
*/
|
*/
|
||||||
define('PNG_QUALITY', 8);
|
define('PNG_QUALITY', 8);
|
||||||
|
|
||||||
|
@ -83,9 +81,10 @@ define('PNG_QUALITY', 8);
|
||||||
* this length (on the longest side, the other side will be scaled appropriately).
|
* this length (on the longest side, the other side will be scaled appropriately).
|
||||||
* Modify this value using
|
* Modify this value using
|
||||||
*
|
*
|
||||||
* $a->config['system']['max_image_length'] = n;
|
* [system]
|
||||||
|
* max_image_length = n;
|
||||||
*
|
*
|
||||||
* in .htconfig.php
|
* in config/local.ini.php
|
||||||
*
|
*
|
||||||
* If you don't want to set a maximum length, set to -1. The default value is
|
* If you don't want to set a maximum length, set to -1. The default value is
|
||||||
* defined by 'MAX_IMAGE_LENGTH' below.
|
* defined by 'MAX_IMAGE_LENGTH' below.
|
||||||
|
@ -114,11 +113,12 @@ define('SSL_POLICY_SELFSIGN', 2);
|
||||||
* log levels
|
* log levels
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
define('LOGGER_NORMAL', 0);
|
define('LOGGER_WARNING', 0);
|
||||||
define('LOGGER_TRACE', 1);
|
define('LOGGER_INFO', 1);
|
||||||
define('LOGGER_DEBUG', 2);
|
define('LOGGER_TRACE', 2);
|
||||||
define('LOGGER_DATA', 3);
|
define('LOGGER_DEBUG', 3);
|
||||||
define('LOGGER_ALL', 4);
|
define('LOGGER_DATA', 4);
|
||||||
|
define('LOGGER_ALL', 5);
|
||||||
/* @}*/
|
/* @}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -152,19 +152,6 @@ define('REGISTER_OPEN', 2);
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @name Contact_is
|
|
||||||
*
|
|
||||||
* Relationship types
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
define('CONTACT_IS_FOLLOWER', 1);
|
|
||||||
define('CONTACT_IS_SHARING', 2);
|
|
||||||
define('CONTACT_IS_FRIEND', 3);
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Update
|
* @name Update
|
||||||
*
|
*
|
||||||
|
@ -177,55 +164,6 @@ define('UPDATE_FAILED', 1);
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @name page/profile types
|
|
||||||
*
|
|
||||||
* PAGE_NORMAL is a typical personal profile account
|
|
||||||
* PAGE_SOAPBOX automatically approves all friend requests as CONTACT_IS_SHARING, (readonly)
|
|
||||||
* PAGE_COMMUNITY automatically approves all friend requests as CONTACT_IS_SHARING, but with
|
|
||||||
* write access to wall and comments (no email and not included in page owner's ACL lists)
|
|
||||||
* PAGE_FREELOVE automatically approves all friend requests as full friends (CONTACT_IS_FRIEND).
|
|
||||||
*
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
define('PAGE_NORMAL', 0);
|
|
||||||
define('PAGE_SOAPBOX', 1);
|
|
||||||
define('PAGE_COMMUNITY', 2);
|
|
||||||
define('PAGE_FREELOVE', 3);
|
|
||||||
define('PAGE_BLOG', 4);
|
|
||||||
define('PAGE_PRVGROUP', 5);
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name account types
|
|
||||||
*
|
|
||||||
* ACCOUNT_TYPE_PERSON - the account belongs to a person
|
|
||||||
* Associated page types: PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE
|
|
||||||
*
|
|
||||||
* ACCOUNT_TYPE_ORGANISATION - the account belongs to an organisation
|
|
||||||
* Associated page type: PAGE_SOAPBOX
|
|
||||||
*
|
|
||||||
* ACCOUNT_TYPE_NEWS - the account is a news reflector
|
|
||||||
* Associated page type: PAGE_SOAPBOX
|
|
||||||
*
|
|
||||||
* ACCOUNT_TYPE_COMMUNITY - the account is community forum
|
|
||||||
* Associated page types: PAGE_COMMUNITY, PAGE_PRVGROUP
|
|
||||||
*
|
|
||||||
* ACCOUNT_TYPE_RELAY - the account is a relay
|
|
||||||
* This will only be assigned to contacts, not to user accounts
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
define('ACCOUNT_TYPE_PERSON', 0);
|
|
||||||
define('ACCOUNT_TYPE_ORGANISATION', 1);
|
|
||||||
define('ACCOUNT_TYPE_NEWS', 2);
|
|
||||||
define('ACCOUNT_TYPE_COMMUNITY', 3);
|
|
||||||
define('ACCOUNT_TYPE_RELAY', 4);
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name CP
|
* @name CP
|
||||||
*
|
*
|
||||||
|
@ -241,84 +179,32 @@ define('CP_USERS_AND_GLOBAL', 2);
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @name Protocols
|
|
||||||
* @deprecated since version 3.6
|
|
||||||
* @see Conversation
|
|
||||||
*
|
|
||||||
* Different protocols that we are storing
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
define('PROTOCOL_UNKNOWN' , Conversation::PROTOCOL_UNKNOWN);
|
|
||||||
define('PROTOCOL_DFRN' , Conversation::PROTOCOL_DFRN);
|
|
||||||
define('PROTOCOL_DIASPORA' , Conversation::PROTOCOL_DIASPORA);
|
|
||||||
define('PROTOCOL_OSTATUS_SALMON' , Conversation::PROTOCOL_OSTATUS_SALMON);
|
|
||||||
define('PROTOCOL_OSTATUS_FEED' , Conversation::PROTOCOL_OSTATUS_FEED); // Deprecated
|
|
||||||
define('PROTOCOL_GS_CONVERSATION', Conversation::PROTOCOL_GS_CONVERSATION); // Deprecated
|
|
||||||
define('PROTOCOL_SPLITTED_CONV' , Conversation::PROTOCOL_SPLITTED_CONV);
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name Network constants
|
|
||||||
* @deprecated since version 3.6
|
|
||||||
* @see Protocol
|
|
||||||
*
|
|
||||||
* Network and protocol family types
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
define('NETWORK_DFRN' , Protocol::DFRN); // Friendica, Mistpark, other DFRN implementations
|
|
||||||
define('NETWORK_ZOT' , Protocol::ZOT); // Zot! - Currently unsupported
|
|
||||||
define('NETWORK_OSTATUS' , Protocol::OSTATUS); // GNU-social, Pleroma, Mastodon, other OStatus implementations
|
|
||||||
define('NETWORK_FEED' , Protocol::FEED); // RSS/Atom feeds with no known "post/notify" protocol
|
|
||||||
define('NETWORK_DIASPORA' , Protocol::DIASPORA); // Diaspora
|
|
||||||
define('NETWORK_MAIL' , Protocol::MAIL); // IMAP/POP
|
|
||||||
define('NETWORK_FACEBOOK' , Protocol::FACEBOOK); // Facebook API
|
|
||||||
define('NETWORK_LINKEDIN' , Protocol::LINKEDIN); // LinkedIn
|
|
||||||
define('NETWORK_XMPP' , Protocol::XMPP); // XMPP - Currently unsupported
|
|
||||||
define('NETWORK_MYSPACE' , Protocol::MYSPACE); // MySpace - Currently unsupported
|
|
||||||
define('NETWORK_GPLUS' , Protocol::GPLUS); // Google+
|
|
||||||
define('NETWORK_PUMPIO' , Protocol::PUMPIO); // pump.io
|
|
||||||
define('NETWORK_TWITTER' , Protocol::TWITTER); // Twitter
|
|
||||||
define('NETWORK_DIASPORA2', Protocol::DIASPORA2); // Diaspora connector
|
|
||||||
define('NETWORK_STATUSNET', Protocol::STATUSNET); // Statusnet connector
|
|
||||||
define('NETWORK_APPNET' , Protocol::APPNET); // app.net - Dead protocol
|
|
||||||
define('NETWORK_NEWS' , Protocol::NEWS); // Network News Transfer Protocol - Currently unsupported
|
|
||||||
define('NETWORK_ICALENDAR', Protocol::ICALENDAR); // iCalendar - Currently unsupported
|
|
||||||
define('NETWORK_PNUT' , Protocol::PNUT); // pnut.io - Currently unsupported
|
|
||||||
define('NETWORK_PHANTOM' , Protocol::PHANTOM); // Place holder
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These numbers are used in stored permissions
|
* These numbers are used in stored permissions
|
||||||
* and existing allocations MUST NEVER BE CHANGED
|
* and existing allocations MUST NEVER BE CHANGED
|
||||||
* OR RE-ASSIGNED! You may only add to them.
|
* OR RE-ASSIGNED! You may only add to them.
|
||||||
*/
|
*/
|
||||||
$netgroup_ids = [
|
$netgroup_ids = [
|
||||||
NETWORK_DFRN => (-1),
|
Protocol::DFRN => (-1),
|
||||||
NETWORK_ZOT => (-2),
|
Protocol::ZOT => (-2),
|
||||||
NETWORK_OSTATUS => (-3),
|
Protocol::OSTATUS => (-3),
|
||||||
NETWORK_FEED => (-4),
|
Protocol::FEED => (-4),
|
||||||
NETWORK_DIASPORA => (-5),
|
Protocol::DIASPORA => (-5),
|
||||||
NETWORK_MAIL => (-6),
|
Protocol::MAIL => (-6),
|
||||||
NETWORK_FACEBOOK => (-8),
|
Protocol::FACEBOOK => (-8),
|
||||||
NETWORK_LINKEDIN => (-9),
|
Protocol::LINKEDIN => (-9),
|
||||||
NETWORK_XMPP => (-10),
|
Protocol::XMPP => (-10),
|
||||||
NETWORK_MYSPACE => (-11),
|
Protocol::MYSPACE => (-11),
|
||||||
NETWORK_GPLUS => (-12),
|
Protocol::GPLUS => (-12),
|
||||||
NETWORK_PUMPIO => (-13),
|
Protocol::PUMPIO => (-13),
|
||||||
NETWORK_TWITTER => (-14),
|
Protocol::TWITTER => (-14),
|
||||||
NETWORK_DIASPORA2 => (-15),
|
Protocol::DIASPORA2 => (-15),
|
||||||
NETWORK_STATUSNET => (-16),
|
Protocol::STATUSNET => (-16),
|
||||||
NETWORK_APPNET => (-17),
|
Protocol::NEWS => (-18),
|
||||||
NETWORK_NEWS => (-18),
|
Protocol::ICALENDAR => (-19),
|
||||||
NETWORK_ICALENDAR => (-19),
|
Protocol::PNUT => (-20),
|
||||||
NETWORK_PNUT => (-20),
|
|
||||||
|
|
||||||
NETWORK_PHANTOM => (-127),
|
Protocol::PHANTOM => (-127),
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -451,8 +337,9 @@ define('ACTIVITY_OBJ_QUESTION', 'http://activityschema.org/object/question');
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
define('GRAVITY_PARENT', 0);
|
define('GRAVITY_PARENT', 0);
|
||||||
define('GRAVITY_LIKE', 3);
|
define('GRAVITY_ACTIVITY', 3);
|
||||||
define('GRAVITY_COMMENT', 6);
|
define('GRAVITY_COMMENT', 6);
|
||||||
|
define('GRAVITY_UNKNOWN', 9);
|
||||||
/* @}*/
|
/* @}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -498,36 +385,6 @@ if (!defined("SIGTERM")) {
|
||||||
if (!defined('CURLE_OPERATION_TIMEDOUT')) {
|
if (!defined('CURLE_OPERATION_TIMEDOUT')) {
|
||||||
define('CURLE_OPERATION_TIMEDOUT', CURLE_OPERATION_TIMEOUTED);
|
define('CURLE_OPERATION_TIMEDOUT', CURLE_OPERATION_TIMEOUTED);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Reverse the effect of magic_quotes_gpc if it is enabled.
|
|
||||||
* Please disable magic_quotes_gpc so we don't have to do this.
|
|
||||||
* See http://php.net/manual/en/security.magicquotes.disabling.php
|
|
||||||
*/
|
|
||||||
function startup()
|
|
||||||
{
|
|
||||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
|
||||||
|
|
||||||
set_time_limit(0);
|
|
||||||
|
|
||||||
// This has to be quite large to deal with embedded private photos
|
|
||||||
ini_set('pcre.backtrack_limit', 500000);
|
|
||||||
|
|
||||||
if (get_magic_quotes_gpc()) {
|
|
||||||
$process = [&$_GET, &$_POST, &$_COOKIE, &$_REQUEST];
|
|
||||||
while (list($key, $val) = each($process)) {
|
|
||||||
foreach ($val as $k => $v) {
|
|
||||||
unset($process[$key][$k]);
|
|
||||||
if (is_array($v)) {
|
|
||||||
$process[$key][stripslashes($k)] = $v;
|
|
||||||
$process[] = &$process[$key][stripslashes($k)];
|
|
||||||
} else {
|
|
||||||
$process[$key][stripslashes($k)] = stripslashes($v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unset($process);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve the App structure
|
* @brief Retrieve the App structure
|
||||||
|
@ -538,14 +395,7 @@ function startup()
|
||||||
*/
|
*/
|
||||||
function get_app()
|
function get_app()
|
||||||
{
|
{
|
||||||
global $a;
|
return BaseObject::getApp();
|
||||||
|
|
||||||
if (empty($a)) {
|
|
||||||
$a = new App(dirname(__DIR__));
|
|
||||||
BaseObject::setApp($a);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $a;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -706,7 +556,7 @@ function check_url(App $a)
|
||||||
// and www.example.com vs example.com.
|
// and www.example.com vs example.com.
|
||||||
// We will only change the url to an ip address if there is no existing setting
|
// We will only change the url to an ip address if there is no existing setting
|
||||||
|
|
||||||
if (empty($url) || (!link_compare($url, System::baseUrl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname))) {
|
if (empty($url) || (!link_compare($url, System::baseUrl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname()))) {
|
||||||
Config::set('system', 'url', System::baseUrl());
|
Config::set('system', 'url', System::baseUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -740,10 +590,17 @@ function update_db()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// run the pre_update_nnnn functions in update.php
|
||||||
|
for ($x = $stored + 1; $x <= $current; $x++) {
|
||||||
|
$r = run_update_function($x, 'pre_update');
|
||||||
|
if (!$r) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, time());
|
Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, time());
|
||||||
|
|
||||||
// run update routine
|
// update the structure in one call
|
||||||
// it update the structure in one call
|
|
||||||
$retval = DBStructure::update(false, true);
|
$retval = DBStructure::update(false, true);
|
||||||
if ($retval) {
|
if ($retval) {
|
||||||
DBStructure::updateFail(
|
DBStructure::updateFail(
|
||||||
|
@ -755,9 +612,9 @@ function update_db()
|
||||||
Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, 'success');
|
Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, 'success');
|
||||||
}
|
}
|
||||||
|
|
||||||
// run any left update_nnnn functions in update.php
|
// run the update_nnnn functions in update.php
|
||||||
for ($x = $stored + 1; $x <= $current; $x++) {
|
for ($x = $stored + 1; $x <= $current; $x++) {
|
||||||
$r = run_update_function($x);
|
$r = run_update_function($x, 'update');
|
||||||
if (!$r) {
|
if (!$r) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -768,9 +625,11 @@ function update_db()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_update_function($x)
|
function run_update_function($x, $prefix)
|
||||||
{
|
{
|
||||||
if (function_exists('update_' . $x)) {
|
$funcname = $prefix . '_' . $x;
|
||||||
|
|
||||||
|
if (function_exists($funcname)) {
|
||||||
// There could be a lot of processes running or about to run.
|
// There could be a lot of processes running or about to run.
|
||||||
// We want exactly one process to run the update command.
|
// We want exactly one process to run the update command.
|
||||||
// So store the fact that we're taking responsibility
|
// So store the fact that we're taking responsibility
|
||||||
|
@ -778,16 +637,14 @@ function run_update_function($x)
|
||||||
// If the update fails or times-out completely you may need to
|
// If the update fails or times-out completely you may need to
|
||||||
// delete the config entry to try again.
|
// delete the config entry to try again.
|
||||||
|
|
||||||
$t = Config::get('database', 'update_' . $x);
|
$t = Config::get('database', $funcname);
|
||||||
if (!is_null($t)) {
|
if (!is_null($t)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Config::set('database', 'update_' . $x, time());
|
Config::set('database', $funcname, time());
|
||||||
|
|
||||||
// call the specific update
|
// call the specific update
|
||||||
|
$retval = $funcname();
|
||||||
$func = 'update_' . $x;
|
|
||||||
$retval = $func();
|
|
||||||
|
|
||||||
if ($retval) {
|
if ($retval) {
|
||||||
//send the administrator an e-mail
|
//send the administrator an e-mail
|
||||||
|
@ -797,13 +654,21 @@ function run_update_function($x)
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
Config::set('database', 'update_' . $x, 'success');
|
Config::set('database', $funcname, 'success');
|
||||||
|
|
||||||
|
if ($prefix == 'update') {
|
||||||
Config::set('system', 'build', $x);
|
Config::set('system', 'build', $x);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Config::set('database', 'update_' . $x, 'success');
|
Config::set('database', $funcname, 'success');
|
||||||
|
|
||||||
|
if ($prefix == 'update') {
|
||||||
Config::set('system', 'build', $x);
|
Config::set('system', 'build', $x);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -811,7 +676,7 @@ function run_update_function($x)
|
||||||
/**
|
/**
|
||||||
* @brief Synchronise addons:
|
* @brief Synchronise addons:
|
||||||
*
|
*
|
||||||
* $a->config['system']['addon'] contains a comma-separated list of names
|
* system.addon contains a comma-separated list of names
|
||||||
* of addons which are used on this system.
|
* of addons which are used on this system.
|
||||||
* Go through the database list of already installed addons, and if we have
|
* Go through the database list of already installed addons, and if we have
|
||||||
* an entry, but it isn't in the config list, call the uninstall procedure
|
* an entry, but it isn't in the config list, call the uninstall procedure
|
||||||
|
@ -824,7 +689,7 @@ function run_update_function($x)
|
||||||
function check_addons(App $a)
|
function check_addons(App $a)
|
||||||
{
|
{
|
||||||
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
|
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::isResult($r)) {
|
||||||
$installed = $r;
|
$installed = $r;
|
||||||
} else {
|
} else {
|
||||||
$installed = [];
|
$installed = [];
|
||||||
|
@ -864,28 +729,6 @@ function check_addons(App $a)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_guid($size = 16, $prefix = '')
|
|
||||||
{
|
|
||||||
if (is_bool($prefix) && !$prefix) {
|
|
||||||
$prefix = '';
|
|
||||||
} elseif ($prefix == '') {
|
|
||||||
$a = get_app();
|
|
||||||
$prefix = hash('crc32', $a->get_hostname());
|
|
||||||
}
|
|
||||||
|
|
||||||
while (strlen($prefix) < ($size - 13)) {
|
|
||||||
$prefix .= mt_rand();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($size >= 24) {
|
|
||||||
$prefix = substr($prefix, 0, $size - 22);
|
|
||||||
return str_replace('.', '', uniqid($prefix, true));
|
|
||||||
} else {
|
|
||||||
$prefix = substr($prefix, 0, max($size - 13, 0));
|
|
||||||
return uniqid($prefix);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Used to end the current process, after saving session state.
|
* @brief Used to end the current process, after saving session state.
|
||||||
* @deprecated
|
* @deprecated
|
||||||
|
@ -917,7 +760,7 @@ function goaway($path)
|
||||||
*/
|
*/
|
||||||
function local_user()
|
function local_user()
|
||||||
{
|
{
|
||||||
if (x($_SESSION, 'authenticated') && x($_SESSION, 'uid')) {
|
if (!empty($_SESSION['authenticated']) && !empty($_SESSION['uid'])) {
|
||||||
return intval($_SESSION['uid']);
|
return intval($_SESSION['uid']);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -960,6 +803,11 @@ function remote_user()
|
||||||
// if (local_user()) {
|
// if (local_user()) {
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if (empty($_SESSION)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (x($_SESSION, 'authenticated') && x($_SESSION, 'visitor_id')) {
|
if (x($_SESSION, 'authenticated') && x($_SESSION, 'visitor_id')) {
|
||||||
return intval($_SESSION['visitor_id']);
|
return intval($_SESSION['visitor_id']);
|
||||||
}
|
}
|
||||||
|
@ -975,6 +823,10 @@ function remote_user()
|
||||||
*/
|
*/
|
||||||
function notice($s)
|
function notice($s)
|
||||||
{
|
{
|
||||||
|
if (empty($_SESSION)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
if (!x($_SESSION, 'sysmsg')) {
|
if (!x($_SESSION, 'sysmsg')) {
|
||||||
$_SESSION['sysmsg'] = [];
|
$_SESSION['sysmsg'] = [];
|
||||||
|
@ -1007,17 +859,6 @@ function info($s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Wrapper around config to limit the text length of an incoming message
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
function get_max_import_size()
|
|
||||||
{
|
|
||||||
$a = get_app();
|
|
||||||
return (x($a->config, 'max_import_size') ? $a->config['max_import_size'] : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function feed_birthday($uid, $tz)
|
function feed_birthday($uid, $tz)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -1042,13 +883,9 @@ function feed_birthday($uid, $tz)
|
||||||
$tz = 'UTC';
|
$tz = 'UTC';
|
||||||
}
|
}
|
||||||
|
|
||||||
$p = q(
|
$profile = DBA::selectFirst('profile', ['dob'], ['is-default' => true, 'uid' => $uid]);
|
||||||
"SELECT `dob` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
|
if (DBA::isResult($profile)) {
|
||||||
intval($uid)
|
$tmp_dob = substr($profile['dob'], 5);
|
||||||
);
|
|
||||||
|
|
||||||
if (DBM::is_result($p)) {
|
|
||||||
$tmp_dob = substr($p[0]['dob'], 5);
|
|
||||||
if (intval($tmp_dob)) {
|
if (intval($tmp_dob)) {
|
||||||
$y = DateTimeFormat::timezoneNow($tz, 'Y');
|
$y = DateTimeFormat::timezoneNow($tz, 'Y');
|
||||||
$bd = $y . '-' . $tmp_dob . ' 00:00';
|
$bd = $y . '-' . $tmp_dob . ' 00:00';
|
||||||
|
@ -1073,13 +910,11 @@ function is_site_admin()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
|
$admin_email = Config::get('config', 'admin_email');
|
||||||
|
|
||||||
//if(local_user() && x($a->user,'email') && x($a->config,'admin_email') && ($a->user['email'] === $a->config['admin_email']))
|
$adminlist = explode(',', str_replace(' ', '', $admin_email));
|
||||||
if (local_user() && x($a->user, 'email') && x($a->config, 'admin_email') && in_array($a->user['email'], $adminlist)) {
|
|
||||||
return true;
|
return local_user() && $admin_email && in_array(defaults($a->user, 'email', ''), $adminlist);
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1155,7 +990,7 @@ function explode_querystring($query)
|
||||||
function curPageURL()
|
function curPageURL()
|
||||||
{
|
{
|
||||||
$pageURL = 'http';
|
$pageURL = 'http';
|
||||||
if ($_SERVER["HTTPS"] == "on") {
|
if (!empty($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on")) {
|
||||||
$pageURL .= "s";
|
$pageURL .= "s";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1173,7 +1008,7 @@ function random_digits($digits)
|
||||||
{
|
{
|
||||||
$rn = '';
|
$rn = '';
|
||||||
for ($i = 0; $i < $digits; $i++) {
|
for ($i = 0; $i < $digits; $i++) {
|
||||||
/// @TODO rand() is different to mt_rand() and maybe lesser "random"
|
/// @TODO Avoid rand/mt_rand, when it comes to cryptography, they are generating predictable (seedable) numbers.
|
||||||
$rn .= rand(0, 9);
|
$rn .= rand(0, 9);
|
||||||
}
|
}
|
||||||
return $rn;
|
return $rn;
|
||||||
|
@ -1187,7 +1022,7 @@ function get_server()
|
||||||
$server = "https://dir.friendica.social";
|
$server = "https://dir.friendica.social";
|
||||||
}
|
}
|
||||||
|
|
||||||
return($server);
|
return $server;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_temppath()
|
function get_temppath()
|
||||||
|
@ -1236,7 +1071,7 @@ function get_cachefile($file, $writemode = true)
|
||||||
$cache = get_itemcachepath();
|
$cache = get_itemcachepath();
|
||||||
|
|
||||||
if ((!$cache) || (!is_dir($cache))) {
|
if ((!$cache) || (!is_dir($cache))) {
|
||||||
return("");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$subfolder = $cache . "/" . substr($file, 0, 2);
|
$subfolder = $cache . "/" . substr($file, 0, 2);
|
||||||
|
@ -1250,7 +1085,6 @@ function get_cachefile($file, $writemode = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @TODO no need to put braces here
|
|
||||||
return $cachepath;
|
return $cachepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1357,7 +1191,6 @@ function get_spoolpath()
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('exif_imagetype')) {
|
if (!function_exists('exif_imagetype')) {
|
||||||
function exif_imagetype($file)
|
function exif_imagetype($file)
|
||||||
{
|
{
|
||||||
|
@ -1395,7 +1228,7 @@ function validate_include(&$file)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simply return flag
|
// Simply return flag
|
||||||
return ($valid);
|
return $valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
function current_load()
|
function current_load()
|
||||||
|
|
|
@ -13,18 +13,17 @@
|
||||||
"issues": "https://github.com/friendica/friendica/issues"
|
"issues": "https://github.com/friendica/friendica/issues"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">5.6",
|
"php": ">=5.6.1",
|
||||||
"ext-xml": "*",
|
"ext-xml": "*",
|
||||||
"asika/simple-console": "^1.0",
|
"asika/simple-console": "^1.0",
|
||||||
"divineomega/password_exposed": "^2.4",
|
"divineomega/password_exposed": "^2.4",
|
||||||
"ezyang/htmlpurifier": "~4.7.0",
|
"ezyang/htmlpurifier": "~4.7.0",
|
||||||
"league/html-to-markdown": "~4.4.1",
|
"league/html-to-markdown": "~4.8.0",
|
||||||
"lightopenid/lightopenid": "dev-master",
|
"lightopenid/lightopenid": "dev-master",
|
||||||
"michelf/php-markdown": "^1.7",
|
"michelf/php-markdown": "^1.7",
|
||||||
"mobiledetect/mobiledetectlib": "2.8.*",
|
"mobiledetect/mobiledetectlib": "2.8.*",
|
||||||
"paragonie/random_compat": "^2.0",
|
"paragonie/random_compat": "^2.0",
|
||||||
"pear/Text_LanguageDetect": "1.*",
|
"pear/Text_LanguageDetect": "1.*",
|
||||||
"pear/Text_Highlighter": "dev-master",
|
|
||||||
"seld/cli-prompt": "^1.0",
|
"seld/cli-prompt": "^1.0",
|
||||||
"smarty/smarty": "^3.1",
|
"smarty/smarty": "^3.1",
|
||||||
"fxp/composer-asset-plugin": "~1.3",
|
"fxp/composer-asset-plugin": "~1.3",
|
||||||
|
@ -37,7 +36,8 @@
|
||||||
"npm-asset/jquery-datetimepicker": "^2.4.0",
|
"npm-asset/jquery-datetimepicker": "^2.4.0",
|
||||||
"npm-asset/jgrowl": "^1.4",
|
"npm-asset/jgrowl": "^1.4",
|
||||||
"npm-asset/fullcalendar": "^3.0.1",
|
"npm-asset/fullcalendar": "^3.0.1",
|
||||||
"npm-asset/cropperjs": "1.2.2"
|
"npm-asset/cropperjs": "1.2.2",
|
||||||
|
"npm-asset/imagesloaded": "4.1.4"
|
||||||
},
|
},
|
||||||
"repositories": [
|
"repositories": [
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,8 @@
|
||||||
],
|
],
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Friendica\\": "src/"
|
"Friendica\\": "src/",
|
||||||
|
"Friendica\\Test\\": "tests/"
|
||||||
},
|
},
|
||||||
"psr-0": {
|
"psr-0": {
|
||||||
"": "library/"
|
"": "library/"
|
||||||
|
@ -68,5 +69,14 @@
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"log", "cache", "/photo", "/proxy"
|
"log", "cache", "/photo", "/proxy"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/dbunit": "^2.0",
|
||||||
|
"phpdocumentor/reflection-docblock": "^3.0.2",
|
||||||
|
"phpunit/php-token-stream": "^1.4.2",
|
||||||
|
"mikey179/vfsStream": "^1.6"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "phpunit"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php return <<<INI
|
||||||
|
|
||||||
|
; Copy this configuration file to addon.ini.php and edit it if you want to configure addons, see below example for the twitter addon
|
||||||
|
|
||||||
|
;[twitter]
|
||||||
|
;consumerkey = localhost
|
||||||
|
;consumersecret = mysqlusername
|
||||||
|
|
||||||
|
INI;
|
||||||
|
// Keep this line
|
|
@ -0,0 +1,408 @@
|
||||||
|
<?php return <<<INI
|
||||||
|
|
||||||
|
; CONFIG.INI.PHP
|
||||||
|
|
||||||
|
; This file declares the default values for the base config of Friendica.
|
||||||
|
; These configuration values aren't accessible from the admin settings page and custom values must be set in config/local.ini.php
|
||||||
|
|
||||||
|
; Please don't edit this file directly as its content may change in the upcoming versions.
|
||||||
|
|
||||||
|
[database]
|
||||||
|
|
||||||
|
; host (String)
|
||||||
|
; Hostname or IP address of the database server.
|
||||||
|
; Can contain the port number with the syntax "hostname:port".
|
||||||
|
hostname =
|
||||||
|
|
||||||
|
; user (String)
|
||||||
|
; Database user name. Please don't use "root".
|
||||||
|
username =
|
||||||
|
|
||||||
|
; pass (String)
|
||||||
|
; Database user password. Please don't use empty passwords.
|
||||||
|
password =
|
||||||
|
|
||||||
|
; base (String)
|
||||||
|
; Database name.
|
||||||
|
database =
|
||||||
|
|
||||||
|
; charset (String)
|
||||||
|
; Database connexion charset. Changing this value will likely corrupt special characters.
|
||||||
|
charset = utf8mb4
|
||||||
|
|
||||||
|
[config]
|
||||||
|
|
||||||
|
; admin_email (Comma-separated list)
|
||||||
|
; In order to perform system administration via the admin panel, this must precisely match the email address of the person logged in.
|
||||||
|
admin_email =
|
||||||
|
|
||||||
|
; admin_nickname (String)
|
||||||
|
; Nickname of the main admin user, used if there are more than one admin user defined in config.admin_email.
|
||||||
|
admin_nickname =
|
||||||
|
|
||||||
|
; max_import_size (Integer)
|
||||||
|
; Maximum body size of DFRN and Mail messages in characters. 0 is unlimited.
|
||||||
|
max_import_size = 200000
|
||||||
|
|
||||||
|
; php_path (String)
|
||||||
|
; Location of PHP command line processor.
|
||||||
|
php_path = php
|
||||||
|
|
||||||
|
[system]
|
||||||
|
|
||||||
|
; allowed_link_protocols (Array)
|
||||||
|
; Allowed protocols in links URLs, add at your own risk. http is always allowed.
|
||||||
|
allowed_link_protocols[0] = ftp
|
||||||
|
allowed_link_protocols[1] = ftps
|
||||||
|
allowed_link_protocols[2] = mailto
|
||||||
|
allowed_link_protocols[3] = cid
|
||||||
|
allowed_link_protocols[4] = gopher
|
||||||
|
|
||||||
|
; always_show_preview (Boolean)
|
||||||
|
; Only show small preview picures.
|
||||||
|
always_show_preview = false
|
||||||
|
|
||||||
|
; archival_days (Integer)
|
||||||
|
; Number of days that we try to deliver content before we archive a contact.
|
||||||
|
archival_days = 32
|
||||||
|
|
||||||
|
; auth_cookie_lifetime (Integer)
|
||||||
|
; Number of days that should pass without any activity before a user who chose "Remember me" when logging in is considered logged out.
|
||||||
|
auth_cookie_lifetime = 7
|
||||||
|
|
||||||
|
; block_local_dir (Boolean)
|
||||||
|
; Deny public access to the local user directory.
|
||||||
|
block_local_dir = false
|
||||||
|
|
||||||
|
; cache_driver (database|memcache|memcached|redis)
|
||||||
|
; Whether to use Memcache or Memcached or Redis to store temporary cache.
|
||||||
|
cache_driver = database
|
||||||
|
|
||||||
|
; config_adapter (jit|preload)
|
||||||
|
; Allow to switch the configuration adapter to improve performances at the cost of memory consumption.
|
||||||
|
config_adapter = jit
|
||||||
|
|
||||||
|
; curl_range_bytes (Integer)
|
||||||
|
; Maximum number of bytes that should be fetched. Default is 0, which mean "no limit".
|
||||||
|
curl_range_bytes = 0
|
||||||
|
|
||||||
|
; crawl_permit_period (Integer)
|
||||||
|
; Period in seconds between allowed searches when the number of free searches is reached and "permit_crawling" is activated.
|
||||||
|
crawl_permit_period = 60
|
||||||
|
|
||||||
|
; db_log (Path)
|
||||||
|
; Name of a logfile to log slow database queries.
|
||||||
|
db_log =
|
||||||
|
|
||||||
|
; db_log_index (Path)
|
||||||
|
; Name of a logfile to log queries with bad indexes.
|
||||||
|
db_log_index =
|
||||||
|
|
||||||
|
; db_log_index_watch (Comma-separated list)
|
||||||
|
; Watchlist of indexes to watch.
|
||||||
|
db_log_index_watch =
|
||||||
|
|
||||||
|
; db_log_index_blacklist (Comma-separated list)
|
||||||
|
; Blacklist of indexes that shouldn't be watched.
|
||||||
|
db_log_index_blacklist =
|
||||||
|
|
||||||
|
; db_loglimit (Integer)
|
||||||
|
; If a database call lasts longer than this value in seconds it is logged.
|
||||||
|
; Inactive if system.db_log is empty.
|
||||||
|
db_loglimit = 10
|
||||||
|
|
||||||
|
; db_loglimit_index (Integer)
|
||||||
|
; Number of index rows needed to be logged for indexes on the watchlist. 0 to disable.
|
||||||
|
db_loglimit_index = 0
|
||||||
|
|
||||||
|
; db_loglimit_index_high (Integer)
|
||||||
|
; Number of index rows to be logged anyway (for any index). 0 to disable.
|
||||||
|
db_loglimit_index_high = 0
|
||||||
|
|
||||||
|
; dbclean_expire_conversation (Integer)
|
||||||
|
; When DBClean is enabled, any entry in the conversation table will be deleted after this many days.
|
||||||
|
; These data are normally needed only for debugging purposes and they are safe to delete.
|
||||||
|
dbclean_expire_conversation = 90
|
||||||
|
|
||||||
|
; diaspora_test (Boolean)
|
||||||
|
; For development only. Disables the message transfer.
|
||||||
|
diaspora_test = false
|
||||||
|
|
||||||
|
; disable_email_validation (Boolean)
|
||||||
|
; Disables the check if a mail address is in a valid format and can be resolved via DNS.
|
||||||
|
disable_email_validation = false
|
||||||
|
|
||||||
|
; disable_url_validation (Boolean)
|
||||||
|
; Disables the DNS lookup of an URL.
|
||||||
|
disable_url_validation = false
|
||||||
|
|
||||||
|
; disable_password_exposed (Boolean)
|
||||||
|
; Disable the exposition check against the remote haveibeenpwned API on password change.
|
||||||
|
disable_password_exposed = false
|
||||||
|
|
||||||
|
; dlogfile (Path)
|
||||||
|
; location of the developer log file.
|
||||||
|
dlogfile =
|
||||||
|
|
||||||
|
; dlogip (String)
|
||||||
|
; restricts develop log writes to requests originating from this IP address.
|
||||||
|
dlogip =
|
||||||
|
|
||||||
|
; free_crawls (Integer)
|
||||||
|
; Number of "free" searches when system.permit_crawling is activated.
|
||||||
|
free_crawls = 10
|
||||||
|
|
||||||
|
; frontend_worker_timeout (Integer)
|
||||||
|
; Value in minutes after we think that a frontend task was killed by the webserver.
|
||||||
|
frontend_worker_timeout = 10
|
||||||
|
|
||||||
|
; groupedit_image_limit (Integer)
|
||||||
|
; Number of contacts at which the group editor should switch from display the profile pictures of the contacts to only display the names.
|
||||||
|
; This can alternatively be set on a per account basis in the pconfig table.
|
||||||
|
groupedit_image_limit = 400
|
||||||
|
|
||||||
|
; hsts (Boolean)
|
||||||
|
; Enables the sending of HTTP Strict Transport Security headers.
|
||||||
|
hsts = false
|
||||||
|
|
||||||
|
; ignore_cache (Boolean)
|
||||||
|
; For development only. Disables the item cache.
|
||||||
|
ignore_cache = false
|
||||||
|
|
||||||
|
; instances_social_key (String)
|
||||||
|
; Key to the API of https://instances.social which retrieves data about mastodon servers.
|
||||||
|
; See https://instances.social/api/token to get an API key.
|
||||||
|
instances_social_key =
|
||||||
|
|
||||||
|
; ipv4_resolve (Boolean)
|
||||||
|
; Resolve IPV4 addresses only. Don't resolve to IPV6.
|
||||||
|
ipv4_resolve = false
|
||||||
|
|
||||||
|
; invitation_only (Boolean)
|
||||||
|
; If set true registration is only possible after a current member of the node has send an invitation.
|
||||||
|
invitation_only = false
|
||||||
|
|
||||||
|
; like_no_comment (Boolean)
|
||||||
|
; Don't update the "commented" value of an item when it is liked.
|
||||||
|
like_no_comment = false
|
||||||
|
|
||||||
|
; local_block (Boolean)
|
||||||
|
; Used in conjunction with "block_public".
|
||||||
|
local_block = false
|
||||||
|
|
||||||
|
; local_search (Boolean)
|
||||||
|
; Blocks search for users who are not logged in to prevent crawlers from blocking your system.
|
||||||
|
local_search = false
|
||||||
|
|
||||||
|
; local_tags (Boolean)
|
||||||
|
; If activated, all hashtags will point to the local server.
|
||||||
|
local_tags = false
|
||||||
|
|
||||||
|
; max_batch_queue (Integer)
|
||||||
|
; Maximum number of batched queue items for a single contact before subsequent messages are discarded.
|
||||||
|
max_batch_queue = 1000
|
||||||
|
|
||||||
|
; max_connections (Integer)
|
||||||
|
; The maximum number of database connections which can be in use before the worker process is deferred to its next interval.
|
||||||
|
; When the system can't detect the maximum numbers of connection then this value can be used. Use 0 for auto-detection.
|
||||||
|
max_connections = 0
|
||||||
|
|
||||||
|
; max_connections_level (Integer 0-100)
|
||||||
|
; The maximum percentage of connections that are allowed to let the worker start.
|
||||||
|
max_connections_level = 75
|
||||||
|
|
||||||
|
; max_contact_queue (Integer)
|
||||||
|
; Maximum number of queue items for a single contact before subsequent messages are discarded.
|
||||||
|
max_contact_queue = 500
|
||||||
|
|
||||||
|
; max_image_length (Integer)
|
||||||
|
; An alternate way of limiting picture upload sizes.
|
||||||
|
; Specify the maximum pixel length that pictures are allowed to be (for non-square pictures, it will apply to the longest side).
|
||||||
|
; Pictures longer than this length will be resized to be this length (on the longest side, the other side will be scaled appropriately).
|
||||||
|
; If you don't want to set a maximum length, set to -1.
|
||||||
|
max_image_length = -1
|
||||||
|
|
||||||
|
; max_processes_backend (Integer)
|
||||||
|
; Maximum number of concurrent database processes for background tasks.
|
||||||
|
max_processes_backend = 5
|
||||||
|
|
||||||
|
; max_processes_frontend (Integer)
|
||||||
|
; Maximum number of concurrent database processes for foreground tasks.
|
||||||
|
max_processes_frontend = 20
|
||||||
|
|
||||||
|
; maximagesize (Integer)
|
||||||
|
; Maximum size in bytes of an uploaded photo.
|
||||||
|
maximagesize = 800000
|
||||||
|
|
||||||
|
; memcache_host (String)
|
||||||
|
; Host name of the memcache daemon.
|
||||||
|
memcache_host = 127.0.0.1
|
||||||
|
|
||||||
|
; memcache_port (Integer)
|
||||||
|
; Port number of the memcache daemon.
|
||||||
|
memcache_port = 11211
|
||||||
|
|
||||||
|
; memcached_hosts (Array)
|
||||||
|
; Array of Memcached servers info "host, port(, weight)".
|
||||||
|
memcached_hosts[0] = 127.0.0.1,11211
|
||||||
|
|
||||||
|
; min_poll_interval (Integer)
|
||||||
|
; minimal distance in minutes between two polls for a contact. Reasonable values are between 1 and 59.
|
||||||
|
min_poll_interval = 1
|
||||||
|
|
||||||
|
; no_count (Boolean)
|
||||||
|
; Don't do count calculations (currently only when showing albums).
|
||||||
|
no_count = false
|
||||||
|
|
||||||
|
; no_oembed (Boolean)
|
||||||
|
; Don't use OEmbed to fetch more information about a link.
|
||||||
|
no_oembed = false
|
||||||
|
|
||||||
|
; no_smilies (Boolean)
|
||||||
|
; Don't show smilies.
|
||||||
|
no_smilies = false
|
||||||
|
|
||||||
|
; no_view_full_size (Boolean)
|
||||||
|
; Don't add the link "View full size" under a resized image.
|
||||||
|
no_view_full_size = false
|
||||||
|
|
||||||
|
; optimize_items (Boolean)
|
||||||
|
; Triggers an SQL command to optimize the item table before expiring items.
|
||||||
|
optimize_items = false
|
||||||
|
|
||||||
|
; paranoia (Boolean)
|
||||||
|
; Log out users if their IP address changed.
|
||||||
|
paranoia = false
|
||||||
|
|
||||||
|
; permit_crawling (Boolean)
|
||||||
|
; Restricts the search for not logged in users to one search per minute.
|
||||||
|
permit_crawling = false
|
||||||
|
|
||||||
|
; pidfile (Path)
|
||||||
|
; Daemon pid file path. For example: pidfile = /path/to/daemon.pid
|
||||||
|
pidfile =
|
||||||
|
|
||||||
|
; png_quality (Integer)
|
||||||
|
; Sets the ImageMagick compression level for PNG images. Values ranges from 0 (uncompressed) to 9 (most compressed).
|
||||||
|
png_quality = 8
|
||||||
|
|
||||||
|
; profiler (Boolean)
|
||||||
|
; Enable internal timings to help optimize code. Needed for "rendertime" addon.
|
||||||
|
profiler = false
|
||||||
|
|
||||||
|
; proxy_cache_time (Integer)
|
||||||
|
; Period in seconds after which the cache is cleared.
|
||||||
|
proxy_cache_time = 86400
|
||||||
|
|
||||||
|
; pushpoll_frequency (Integer)
|
||||||
|
; Frequency of contact poll for subhub contact using the DFRM or OStatus network.
|
||||||
|
; Available values:
|
||||||
|
; - 5 = every month
|
||||||
|
; - 4 = every week
|
||||||
|
; - 3 = every day
|
||||||
|
; - 2 = twice a day
|
||||||
|
; - 1 = every hour
|
||||||
|
; - 0 = every minute
|
||||||
|
pushpoll_frequency = 3
|
||||||
|
|
||||||
|
; queue_no_dead_check (Boolean)
|
||||||
|
; Ignore if the target contact or server seems to be dead during queue delivery.
|
||||||
|
queue_no_dead_check = false
|
||||||
|
|
||||||
|
; redis_host (String)
|
||||||
|
; Host name of the redis daemon.
|
||||||
|
redis_host = 127.0.0.1
|
||||||
|
|
||||||
|
; redis_port (String)
|
||||||
|
; Port number of the redis daemon.
|
||||||
|
redis_port = 6379
|
||||||
|
|
||||||
|
; session_handler (database|cache|native)
|
||||||
|
; Whether to use Cache to store session data or to use PHP native session storage.
|
||||||
|
session_handler = database
|
||||||
|
|
||||||
|
; remove_multiplicated_lines (Boolean)
|
||||||
|
; If enabled, multiple linefeeds in items are stripped to a single one.
|
||||||
|
remove_multiplicated_lines = false
|
||||||
|
|
||||||
|
; sendmail_params (Boolean)
|
||||||
|
; Normal sendmail command parameters will be added when the PHP mail() function is called for sending e-mails.
|
||||||
|
; This ensures the Sender Email address setting is applied to the message envelope rather than the host's default address.
|
||||||
|
; Set to false if your non-sendmail agent is incompatible, or to restore old behavior of using the host address.
|
||||||
|
sendmail_params = true
|
||||||
|
|
||||||
|
; show_global_community_hint (Boolean)
|
||||||
|
; When the global community page is enabled, use this option to display a hint above the stream, that this is a collection of all public top-level postings that arrive on your node.
|
||||||
|
show_global_community_hint = false
|
||||||
|
|
||||||
|
; show_unsupported_addons (Boolean)
|
||||||
|
; Show all addons including the unsupported ones.
|
||||||
|
show_unsupported_addons = false
|
||||||
|
|
||||||
|
; show_unsupported_themes (Boolean)
|
||||||
|
; Show all themes including the unsupported ones.
|
||||||
|
show_unsupported_themes = false
|
||||||
|
|
||||||
|
; throttle_limit_day (Integer)
|
||||||
|
; Maximum number of posts that a user can send per day with the API. 0 to disable daily throttling.
|
||||||
|
throttle_limit_day = 0
|
||||||
|
|
||||||
|
; throttle_limit_week (Integer)
|
||||||
|
; Maximum number of posts that a user can send per week with the API. 0 to disable weekly throttling.
|
||||||
|
throttle_limit_week = 0
|
||||||
|
|
||||||
|
; throttle_limit_month (Integer)
|
||||||
|
; Maximum number of posts that a user can send per month with the API. 0 to disable monthly throttling.
|
||||||
|
throttle_limit_month = 0
|
||||||
|
|
||||||
|
; urlpath (String)
|
||||||
|
; If you are using a subdirectory of your domain you will need to put the relative path (from the root of your domain) here.
|
||||||
|
; For instance if your URL is 'http://example.com/directory/subdirectory', set urlpath to 'directory/subdirectory'.
|
||||||
|
urlpath =
|
||||||
|
|
||||||
|
; worker_cooldown (Integer)
|
||||||
|
; Cooldown period in seconds after each worker function call.
|
||||||
|
worker_cooldown = 0
|
||||||
|
|
||||||
|
; worker_debug (Boolean)
|
||||||
|
; If enabled, it prints out the number of running processes split by priority.
|
||||||
|
worker_debug = false
|
||||||
|
|
||||||
|
; worker_fetch_limit (Integer)
|
||||||
|
; Number of worker tasks that are fetched in a single query.
|
||||||
|
worker_fetch_limit = 1
|
||||||
|
|
||||||
|
; worker_load_exponent (Integer)
|
||||||
|
; Default 3, which allows only 25% of the maximum worker queues when server load reaches around 37% of maximum load.
|
||||||
|
; For a linear response where 25% of worker queues are allowed at 75% of maximum load, set this to 1.
|
||||||
|
; Setting 0 would allow maximum worker queues at all times, which is not recommended.
|
||||||
|
worker_load_exponent = 3
|
||||||
|
|
||||||
|
; xrd_timeout (Integer)
|
||||||
|
; Timeout in seconds for fetching the XRD links.
|
||||||
|
xrd_timeout = 20
|
||||||
|
|
||||||
|
[experimental]
|
||||||
|
|
||||||
|
; exp_themes (Boolean)
|
||||||
|
; Show experimental themes in user settings.
|
||||||
|
exp_themes = false
|
||||||
|
|
||||||
|
[theme]
|
||||||
|
|
||||||
|
; hide_eventlist (Boolean)
|
||||||
|
; Don't show the birthdays and events on the profile and network page.
|
||||||
|
hide_eventlist = false
|
||||||
|
|
||||||
|
[jabber]
|
||||||
|
|
||||||
|
; debug (Boolean)
|
||||||
|
; Enable debug level for the jabber account synchronisation.
|
||||||
|
debug = false
|
||||||
|
|
||||||
|
; lockpath (Path)
|
||||||
|
; Must be writable by the ejabberd process. if set then it will prevent the running of multiple processes.
|
||||||
|
lockpath =
|
||||||
|
|
||||||
|
INI;
|
||||||
|
// Keep this line
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?php return <<<INI
|
||||||
|
|
||||||
|
; If automatic system installation fails:
|
||||||
|
|
||||||
|
; Copy this file to local.ini.php
|
||||||
|
|
||||||
|
; Why local.ini.php? Because it contains sensitive information which could
|
||||||
|
; give somebody complete control of your database. Apache's default
|
||||||
|
; configuration will interpret any .php file as a script and won't show the values
|
||||||
|
|
||||||
|
; Then set the following for your MySQL installation
|
||||||
|
|
||||||
|
[database]
|
||||||
|
hostname = localhost
|
||||||
|
username = mysqlusername
|
||||||
|
password = mysqlpassword
|
||||||
|
database = mysqldatabasename
|
||||||
|
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
|
|
@ -0,0 +1,108 @@
|
||||||
|
<?php return <<<INI
|
||||||
|
|
||||||
|
; SETTINGS.INI.PHP
|
||||||
|
|
||||||
|
; This file declares the default values for the admin settings of Friendica.
|
||||||
|
; These values will be overriden by the admin settings page.
|
||||||
|
|
||||||
|
; Please don't edit this file directly as its content may change in the upcoming versions.
|
||||||
|
|
||||||
|
[config]
|
||||||
|
|
||||||
|
; info (String)
|
||||||
|
; Plaintext description of this node, used in the /friendica module.
|
||||||
|
info =
|
||||||
|
|
||||||
|
; register_policy (Constant)
|
||||||
|
; Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED.
|
||||||
|
; Be certain to create your own personal account before setting REGISTER_CLOSED.
|
||||||
|
; REGISTER_APPROVE requires you set system.admin_email to the email address of an already registered person who can authorize and/or approve/deny the request.
|
||||||
|
register_policy = REGISTER_CLOSED
|
||||||
|
|
||||||
|
; register_text (String)
|
||||||
|
; Will be displayed prominently on the registration page.
|
||||||
|
register_text = ''
|
||||||
|
|
||||||
|
; sitename (String)
|
||||||
|
; Displayed server name.
|
||||||
|
sitename = "Friendica Social Network"
|
||||||
|
|
||||||
|
[system]
|
||||||
|
|
||||||
|
; account_abandon_days (Integer)
|
||||||
|
; Will not waste system resources polling external sites for abandonded accounts.
|
||||||
|
; Enter 0 for no time limit.
|
||||||
|
account_abandon_days = 0
|
||||||
|
|
||||||
|
; addon (Comma-separated list)
|
||||||
|
; Manual list of addons which are enabled on this system.
|
||||||
|
addon =
|
||||||
|
|
||||||
|
; allowed_themes (Comma-separated list)
|
||||||
|
; Themes users can change to in their settings.
|
||||||
|
allowed_themes = 'quattro,vier,duepuntozero,smoothly'
|
||||||
|
|
||||||
|
; default_timezone (String)
|
||||||
|
; Choose a default timezone. See https://secure.php.net/manual/en/timezones.php
|
||||||
|
; It only applies to timestamps for anonymous viewers.
|
||||||
|
default_timezone = UTC
|
||||||
|
|
||||||
|
; directory (String)
|
||||||
|
; URL of the global directory.
|
||||||
|
directory = https://dir.friendica.social
|
||||||
|
|
||||||
|
; forbidden_nicknames (Comma-separated list)
|
||||||
|
; Prevents users from registering the specified nicknames on this node.
|
||||||
|
; Default value comprises classic role names from RFC 2142.
|
||||||
|
forbidden_nicknames = info, marketing, sales, support, abuse, noc, security, postmaster, hostmaster, usenet, news, webmaster, www, uucp, ftp, root, sysop
|
||||||
|
|
||||||
|
; jpeg_quality (Integer)
|
||||||
|
; Sets the ImageMagick quality level for JPEG images. Values ranges from 50 (awful) to 100 (near perfect).
|
||||||
|
jpeg_quality = 100
|
||||||
|
|
||||||
|
; language (String)
|
||||||
|
; System default languague, inluding admin-created user default language.
|
||||||
|
; Two-letters ISO 639-1 code.
|
||||||
|
language = en
|
||||||
|
|
||||||
|
; max_image_length (Integer)
|
||||||
|
; An alternate way of limiting picture upload sizes.
|
||||||
|
; Specify the maximum pixel length that pictures are allowed to be (for non-square pictures, it will apply to the longest side).
|
||||||
|
; Pictures longer than this length will be resized to be this length (on the longest side, the other side will be scaled appropriately).
|
||||||
|
; If you don't want to set a maximum length, set to -1.
|
||||||
|
max_image_length = -1
|
||||||
|
|
||||||
|
; maximagesize (Integer)
|
||||||
|
; Maximum size in bytes of an uploaded photo.
|
||||||
|
maximagesize = 800000
|
||||||
|
|
||||||
|
; no_regfullname (Boolean)
|
||||||
|
; Allow pseudonyms (true) or enforce a space between firstname and lastname in Full name, as an antispam measure (false).
|
||||||
|
no_regfullname = true
|
||||||
|
|
||||||
|
; optimize_max_tablesize (Integer)
|
||||||
|
; Maximum table size (in MB) for the automatic optimization.
|
||||||
|
; -1 to disable automatic optimization.
|
||||||
|
; 0 to use internal default (100MB)
|
||||||
|
optimize_max_tablesize = -1
|
||||||
|
|
||||||
|
; rino_encrypt (Integer)
|
||||||
|
; Server-to-server private message encryption (RINO).
|
||||||
|
; Encryption will only be provided if this setting is set to a non zero value on both servers.
|
||||||
|
; Set to 0 to disable, 2 to enable, 1 is deprecated but wont need mcrypt.
|
||||||
|
rino_encrypt = 2
|
||||||
|
|
||||||
|
; theme (String)
|
||||||
|
; System theme name.
|
||||||
|
theme = vier
|
||||||
|
|
||||||
|
; url (String)
|
||||||
|
; The fully-qualified URL of this Friendica node.
|
||||||
|
; Used by the worker in a non-HTTP execution environment.
|
||||||
|
url =
|
||||||
|
|
||||||
|
; Used in the admin settings to lock certain features
|
||||||
|
[featurelock]
|
||||||
|
|
||||||
|
INI;
|
||||||
|
// Keep this line
|
767
database.sql
|
@ -79,6 +79,7 @@ General
|
||||||
../settings
|
../settings
|
||||||
---------
|
---------
|
||||||
* o - Account
|
* o - Account
|
||||||
|
* p - Profiles
|
||||||
* t - Additional features
|
* t - Additional features
|
||||||
* w - Social Networks
|
* w - Social Networks
|
||||||
* l - Addons
|
* l - Addons
|
||||||
|
|
463
doc/Addons.md
|
@ -25,22 +25,23 @@ Addons should contain a comment block with the four following parameters:
|
||||||
* Author: John Q. Public <john@myfriendicasite.com>
|
* Author: John Q. Public <john@myfriendicasite.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Please also add a README or README.md file to the addon directory.
|
||||||
|
It will be displayed in the admin panel and should include some further information in addition to the header information.
|
||||||
|
|
||||||
|
## PHP addon hooks
|
||||||
|
|
||||||
Register your addon hooks during installation.
|
Register your addon hooks during installation.
|
||||||
|
|
||||||
Addon::registerHook($hookname, $file, $function);
|
Addon::registerHook($hookname, $file, $function);
|
||||||
|
|
||||||
$hookname is a string and corresponds to a known Friendica hook.
|
$hookname is a string and corresponds to a known Friendica PHP hook.
|
||||||
|
|
||||||
$file is a pathname relative to the top-level Friendica directory.
|
$file is a pathname relative to the top-level Friendica directory.
|
||||||
This *should* be 'addon/addon_name/addon_name.php' in most cases.
|
This *should* be 'addon/*addon_name*/*addon_name*.php' in most cases.
|
||||||
|
|
||||||
$function is a string and is the name of the function which will be executed when the hook is called.
|
$function is a string and is the name of the function which will be executed when the hook is called.
|
||||||
|
|
||||||
Please also add a README or README.md file to the addon directory.
|
### Arguments
|
||||||
It will be displayed in the admin panel and should include some further information in addition to the header information.
|
|
||||||
|
|
||||||
Arguments
|
|
||||||
---
|
|
||||||
Your hook callback functions will be called with at least one and possibly two arguments
|
Your hook callback functions will be called with at least one and possibly two arguments
|
||||||
|
|
||||||
function myhook_function(App $a, &$b) {
|
function myhook_function(App $a, &$b) {
|
||||||
|
@ -48,10 +49,10 @@ Your hook callback functions will be called with at least one and possibly two a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
If you wish to make changes to the calling data, you must declare them as reference variables (with '&') during function declaration.
|
If you wish to make changes to the calling data, you must declare them as reference variables (with `&`) during function declaration.
|
||||||
|
|
||||||
#### $a
|
#### $a
|
||||||
$a is the Friendica 'App' class.
|
$a is the Friendica `App` class.
|
||||||
It contains a wealth of information about the current state of Friendica:
|
It contains a wealth of information about the current state of Friendica:
|
||||||
|
|
||||||
* which module has been called,
|
* which module has been called,
|
||||||
|
@ -59,15 +60,64 @@ It contains a wealth of information about the current state of Friendica:
|
||||||
* the page contents at the point the hook was invoked,
|
* the page contents at the point the hook was invoked,
|
||||||
* profile and user information, etc.
|
* profile and user information, etc.
|
||||||
|
|
||||||
It is recommeded you call this '$a' to match its usage elsewhere.
|
It is recommeded you call this `$a` to match its usage elsewhere.
|
||||||
|
|
||||||
#### $b
|
#### $b
|
||||||
$b can be called anything you like.
|
$b can be called anything you like.
|
||||||
This is information specific to the hook currently being processed, and generally contains information that is being immediately processed or acted on that you can use, display, or alter.
|
This is information specific to the hook currently being processed, and generally contains information that is being immediately processed or acted on that you can use, display, or alter.
|
||||||
Remember to declare it with '&' if you wish to alter it.
|
Remember to declare it with `&` if you wish to alter it.
|
||||||
|
|
||||||
Modules
|
## JavaScript addon hooks
|
||||||
---
|
|
||||||
|
### PHP part
|
||||||
|
|
||||||
|
Make sure your JavaScript addon file (addon/*addon_name*/*addon_name*.js) is listed in the document response.
|
||||||
|
|
||||||
|
In your addon install function, add:
|
||||||
|
|
||||||
|
```php
|
||||||
|
Addon::registerHook('template_vars', __FILE__, '<addon_name>_template_vars');
|
||||||
|
```
|
||||||
|
|
||||||
|
In your addon uninstall function, add:
|
||||||
|
|
||||||
|
```php
|
||||||
|
Addon::unregisterHook('template_vars', __FILE__, '<addon_name>_template_vars');
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, add your addon name to the *addon_hooks* template variable array:
|
||||||
|
|
||||||
|
```php
|
||||||
|
function <addon_name>_template_vars($a, &$arr)
|
||||||
|
{
|
||||||
|
if (!array_key_exists('addon_hooks', $arr['vars']))
|
||||||
|
{
|
||||||
|
$arr['vars']['addon_hooks'] = array();
|
||||||
|
}
|
||||||
|
$arr['vars']['addon_hooks'][] = "<addon_name>";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### JavaScript part
|
||||||
|
|
||||||
|
Register your addon hooks in file `addon/*addon_name*/*addon_name*.js`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
Addon_registerHook(type, hookfnstr);
|
||||||
|
```
|
||||||
|
|
||||||
|
*type* is the name of the hook and corresponds to a known Friendica JavaScript hook.
|
||||||
|
*hookfnstr* is the name of your JavaScript function to execute.
|
||||||
|
|
||||||
|
No arguments are provided to your JavaScript callback function. Example:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
function myhook_function() {
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Modules
|
||||||
|
|
||||||
Addons may also act as "modules" and intercept all page requests for a given URL path.
|
Addons may also act as "modules" and intercept all page requests for a given URL path.
|
||||||
In order for a addon to act as a module it needs to define a function "addon_name_module()" which takes no arguments and needs not do anything.
|
In order for a addon to act as a module it needs to define a function "addon_name_module()" which takes no arguments and needs not do anything.
|
||||||
|
@ -77,15 +127,16 @@ These are parsed into an array $a->argv, with a corresponding $a->argc indicatin
|
||||||
So http://my.web.site/addon/arg1/arg2 would look for a module named "addon" and pass its module functions the $a App structure (which is available to many components).
|
So http://my.web.site/addon/arg1/arg2 would look for a module named "addon" and pass its module functions the $a App structure (which is available to many components).
|
||||||
This will include:
|
This will include:
|
||||||
|
|
||||||
$a->argc = 3
|
```php
|
||||||
$a->argv = array(0 => 'addon', 1 => 'arg1', 2 => 'arg2');
|
$a->argc = 3
|
||||||
|
$a->argv = array(0 => 'addon', 1 => 'arg1', 2 => 'arg2');
|
||||||
|
```
|
||||||
|
|
||||||
Your module functions will often contain the function addon_name_content(App $a), which defines and returns the page body content.
|
Your module functions will often contain the function addon_name_content(App $a), which defines and returns the page body content.
|
||||||
They may also contain addon_name_post(App $a) which is called before the _content function and typically handles the results of POST forms.
|
They may also contain addon_name_post(App $a) which is called before the _content function and typically handles the results of POST forms.
|
||||||
You may also have addon_name_init(App $a) which is called very early on and often does module initialisation.
|
You may also have addon_name_init(App $a) which is called very early on and often does module initialisation.
|
||||||
|
|
||||||
Templates
|
## Templates
|
||||||
---
|
|
||||||
|
|
||||||
If your addon needs some template, you can use the Friendica template system.
|
If your addon needs some template, you can use the Friendica template system.
|
||||||
Friendica uses [smarty3](http://www.smarty.net/) as a template engine.
|
Friendica uses [smarty3](http://www.smarty.net/) as a template engine.
|
||||||
|
@ -94,230 +145,256 @@ Put your tpl files in the *templates/* subfolder of your addon.
|
||||||
|
|
||||||
In your code, like in the function addon_name_content(), load the template file and execute it passing needed values:
|
In your code, like in the function addon_name_content(), load the template file and execute it passing needed values:
|
||||||
|
|
||||||
# load template file. first argument is the template name,
|
```php
|
||||||
# second is the addon path relative to friendica top folder
|
# load template file. first argument is the template name,
|
||||||
$tpl = get_markup_template('mytemplate.tpl', 'addon/addon_name/');
|
# second is the addon path relative to friendica top folder
|
||||||
|
$tpl = get_markup_template('mytemplate.tpl', 'addon/addon_name/');
|
||||||
|
|
||||||
# apply template. first argument is the loaded template,
|
# apply template. first argument is the loaded template,
|
||||||
# second an array of 'name'=>'values' to pass to template
|
# second an array of 'name' => 'values' to pass to template
|
||||||
$output = replace_macros($tpl,array(
|
$output = replace_macros($tpl, array(
|
||||||
'title' => 'My beautiful addon',
|
'title' => 'My beautiful addon',
|
||||||
));
|
));
|
||||||
|
```
|
||||||
|
|
||||||
See also the wiki page [Quick Template Guide](https://github.com/friendica/friendica/wiki/Quick-Template-Guide).
|
See also the wiki page [Quick Template Guide](https://github.com/friendica/friendica/wiki/Quick-Template-Guide).
|
||||||
|
|
||||||
Current hooks
|
## Current PHP hooks
|
||||||
-------------
|
|
||||||
|
|
||||||
### 'authenticate'
|
### authenticate
|
||||||
'authenticate' is called when a user attempts to login.
|
Called when a user attempts to login.
|
||||||
$b is an array containing:
|
`$b` is an array containing:
|
||||||
|
|
||||||
'username' => the supplied username
|
- **username**: the supplied username
|
||||||
'password' => the supplied password
|
- **password**: the supplied password
|
||||||
'authenticated' => set this to non-zero to authenticate the user.
|
- **authenticated**: set this to non-zero to authenticate the user.
|
||||||
'user_record' => successful authentication must also return a valid user record from the database
|
- **user_record**: successful authentication must also return a valid user record from the database
|
||||||
|
|
||||||
### 'logged_in'
|
### logged_in
|
||||||
'logged_in' is called after a user has successfully logged in.
|
Called after a user has successfully logged in.
|
||||||
$b contains the $a->user array.
|
`$b` contains the `$a->user` array.
|
||||||
|
|
||||||
### 'display_item'
|
### display_item
|
||||||
'display_item' is called when formatting a post for display.
|
Called when formatting a post for display.
|
||||||
$b is an array:
|
$b is an array:
|
||||||
|
|
||||||
'item' => The item (array) details pulled from the database
|
- **item**: The item (array) details pulled from the database
|
||||||
'output' => the (string) HTML representation of this item prior to adding it to the page
|
- **output**: the (string) HTML representation of this item prior to adding it to the page
|
||||||
|
|
||||||
### 'post_local'
|
### post_local
|
||||||
* called when a status post or comment is entered on the local system
|
Called when a status post or comment is entered on the local system.
|
||||||
* $b is the item array of the information to be stored in the database
|
`$b` is the item array of the information to be stored in the database.
|
||||||
* Please note: body contents are bbcode - not HTML
|
Please note: body contents are bbcode - not HTML.
|
||||||
|
|
||||||
### 'post_local_end'
|
### post_local_end
|
||||||
* called when a local status post or comment has been stored on the local system
|
Called when a local status post or comment has been stored on the local system.
|
||||||
* $b is the item array of the information which has just been stored in the database
|
`$b` is the item array of the information which has just been stored in the database.
|
||||||
* Please note: body contents are bbcode - not HTML
|
Please note: body contents are bbcode - not HTML
|
||||||
|
|
||||||
### 'post_remote'
|
### post_remote
|
||||||
* called when receiving a post from another source. This may also be used to post local activity or system generated messages.
|
Called when receiving a post from another source. This may also be used to post local activity or system generated messages.
|
||||||
* $b is the item array of information to be stored in the database and the item body is bbcode.
|
`$b` is the item array of information to be stored in the database and the item body is bbcode.
|
||||||
|
|
||||||
### 'settings_form'
|
### settings_form
|
||||||
* called when generating the HTML for the user Settings page
|
Called when generating the HTML for the user Settings page.
|
||||||
* $b is the (string) HTML of the settings page before the final '</form>' tag.
|
`$b` is the HTML string of the settings page before the final `</form>` tag.
|
||||||
|
|
||||||
### 'settings_post'
|
### settings_post
|
||||||
* called when the Settings pages are submitted
|
Called when the Settings pages are submitted.
|
||||||
* $b is the $_POST array
|
`$b` is the $_POST array.
|
||||||
|
|
||||||
### 'addon_settings'
|
### addon_settings
|
||||||
* called when generating the HTML for the addon settings page
|
Called when generating the HTML for the addon settings page.
|
||||||
* $b is the (string) HTML of the addon settings page before the final '</form>' tag.
|
`$b` is the (string) HTML of the addon settings page before the final `</form>` tag.
|
||||||
|
|
||||||
### 'addon_settings_post'
|
### addon_settings_post
|
||||||
* called when the Addon Settings pages are submitted
|
Called when the Addon Settings pages are submitted.
|
||||||
* $b is the $_POST array
|
`$b` is the $_POST array.
|
||||||
|
|
||||||
### 'profile_post'
|
### profile_post
|
||||||
* called when posting a profile page
|
Called when posting a profile page.
|
||||||
* $b is the $_POST array
|
`$b` is the $_POST array.
|
||||||
|
|
||||||
### 'profile_edit'
|
### profile_edit
|
||||||
'profile_edit' is called prior to output of profile edit page.
|
Called prior to output of profile edit page.
|
||||||
$b is an array containing:
|
`$b` is an array containing:
|
||||||
|
|
||||||
'profile' => profile (array) record from the database
|
- **profile**: profile (array) record from the database
|
||||||
'entry' => the (string) HTML of the generated entry
|
- **entry**: the (string) HTML of the generated entry
|
||||||
|
|
||||||
### 'profile_advanced'
|
### profile_advanced
|
||||||
* called when the HTML is generated for the 'Advanced profile', corresponding to the 'Profile' tab within a person's profile page
|
Called when the HTML is generated for the Advanced profile, corresponding to the Profile tab within a person's profile page.
|
||||||
* $b is the (string) HTML representation of the generated profile
|
`$b` is the HTML string representation of the generated profile.
|
||||||
* The profile array details are in $a->profile.
|
The profile array details are in `$a->profile`.
|
||||||
|
|
||||||
### 'directory_item'
|
### directory_item
|
||||||
'directory_item' is called from the Directory page when formatting an item for display.
|
Called from the Directory page when formatting an item for display.
|
||||||
|
`$b` is an array:
|
||||||
|
|
||||||
|
- **contact**: contact record array for the person from the database
|
||||||
|
- **entry**: the HTML string of the generated entry
|
||||||
|
|
||||||
|
### profile_sidebar_enter
|
||||||
|
Called prior to generating the sidebar "short" profile for a page.
|
||||||
|
`$b` is the person's profile array
|
||||||
|
|
||||||
|
### profile_sidebar
|
||||||
|
Called when generating the sidebar "short" profile for a page.
|
||||||
|
`$b` is an array:
|
||||||
|
|
||||||
|
- **profile**: profile record array for the person from the database
|
||||||
|
- **entry**: the HTML string of the generated entry
|
||||||
|
|
||||||
|
### contact_block_end
|
||||||
|
Called when formatting the block of contacts/friends on a profile sidebar has completed.
|
||||||
|
`$b` is an array:
|
||||||
|
|
||||||
|
- **contacts**: array of contacts
|
||||||
|
- **output**: the generated HTML string of the contact block
|
||||||
|
|
||||||
|
### bbcode
|
||||||
|
Called after conversion of bbcode to HTML.
|
||||||
|
`$b` is an HTML string converted text.
|
||||||
|
|
||||||
|
### html2bbcode
|
||||||
|
Called after tag conversion of HTML to bbcode (e.g. remote message posting)
|
||||||
|
`$b` is a string converted text
|
||||||
|
|
||||||
|
### page_header
|
||||||
|
Called after building the page navigation section.
|
||||||
|
`$b` is a string HTML of nav region.
|
||||||
|
|
||||||
|
### personal_xrd
|
||||||
|
Called prior to output of personal XRD file.
|
||||||
|
`$b` is an array:
|
||||||
|
|
||||||
|
- **user**: the user record array for the person
|
||||||
|
- **xml**: the complete XML string to be output
|
||||||
|
|
||||||
|
### home_content
|
||||||
|
Called prior to output home page content, shown to unlogged users.
|
||||||
|
`$b` is the HTML sring of section region.
|
||||||
|
|
||||||
|
### contact_edit
|
||||||
|
Called when editing contact details on an individual from the Contacts page.
|
||||||
$b is an array:
|
$b is an array:
|
||||||
|
|
||||||
'contact' => contact (array) record for the person from the database
|
- **contact**: contact record (array) of target contact
|
||||||
'entry' => the (string) HTML of the generated entry
|
- **output**: the (string) generated HTML of the contact edit page
|
||||||
|
|
||||||
### 'profile_sidebar_enter'
|
### contact_edit_post
|
||||||
* called prior to generating the sidebar "short" profile for a page
|
Called when posting the contact edit page.
|
||||||
* $b is the person's profile array
|
`$b` is the `$_POST` array
|
||||||
|
|
||||||
### 'profile_sidebar'
|
### init_1
|
||||||
'profile_sidebar is called when generating the sidebar "short" profile for a page.
|
Called just after DB has been opened and before session start.
|
||||||
$b is an array:
|
No hook data.
|
||||||
|
|
||||||
'profile' => profile (array) record for the person from the database
|
### page_end
|
||||||
'entry' => the (string) HTML of the generated entry
|
Called after HTML content functions have completed.
|
||||||
|
`$b` is (string) HTML of content div.
|
||||||
|
|
||||||
### 'contact_block_end'
|
### avatar_lookup
|
||||||
is called when formatting the block of contacts/friends on a profile sidebar has completed.
|
Called when looking up the avatar. `$b` is an array:
|
||||||
$b is an array:
|
|
||||||
|
|
||||||
'contacts' => array of contacts
|
- **size**: the size of the avatar that will be looked up
|
||||||
'output' => the (string) generated HTML of the contact block
|
- **email**: email to look up the avatar for
|
||||||
|
- **url**: the (string) generated URL of the avatar
|
||||||
|
|
||||||
### 'bbcode'
|
### emailer_send_prepare
|
||||||
* called during conversion of bbcode to html
|
Called from `Emailer::send()` before building the mime message.
|
||||||
* $b is a string converted text
|
`$b` is an array of params to `Emailer::send()`.
|
||||||
|
|
||||||
### 'html2bbcode'
|
- **fromName**: name of the sender
|
||||||
* called during conversion of html to bbcode (e.g. remote message posting)
|
- **fromEmail**: email fo the sender
|
||||||
* $b is a string converted text
|
- **replyTo**: replyTo address to direct responses
|
||||||
|
- **toEmail**: destination email address
|
||||||
|
- **messageSubject**: subject of the message
|
||||||
|
- **htmlVersion**: html version of the message
|
||||||
|
- **textVersion**: text only version of the message
|
||||||
|
- **additionalMailHeader**: additions to the smtp mail header
|
||||||
|
|
||||||
### 'page_header'
|
### emailer_send
|
||||||
* called after building the page navigation section
|
Called before calling PHP's `mail()`.
|
||||||
* $b is a string HTML of nav region
|
`$b` is an array of params to `mail()`.
|
||||||
|
|
||||||
### 'personal_xrd'
|
- **to**
|
||||||
'personal_xrd' is called prior to output of personal XRD file.
|
- **subject**
|
||||||
$b is an array:
|
- **body**
|
||||||
|
- **headers**
|
||||||
|
|
||||||
'user' => the user record for the person
|
### load_config
|
||||||
'xml' => the complete XML to be output
|
Called during `App` initialization to allow addons to load their own configuration file(s) with `App::loadConfigFile()`.
|
||||||
|
|
||||||
### 'home_content'
|
### nav_info
|
||||||
* called prior to output home page content, shown to unlogged users
|
Called after the navigational menu is build in `include/nav.php`.
|
||||||
* $b is (string) HTML of section region
|
`$b` is an array containing `$nav` from `include/nav.php`.
|
||||||
|
|
||||||
### 'contact_edit'
|
### template_vars
|
||||||
is called when editing contact details on an individual from the Contacts page.
|
Called before vars are passed to the template engine to render the page.
|
||||||
$b is an array:
|
|
||||||
|
|
||||||
'contact' => contact record (array) of target contact
|
|
||||||
'output' => the (string) generated HTML of the contact edit page
|
|
||||||
|
|
||||||
### 'contact_edit_post'
|
|
||||||
* called when posting the contact edit page.
|
|
||||||
* $b is the $_POST array
|
|
||||||
|
|
||||||
### 'init_1'
|
|
||||||
* called just after DB has been opened and before session start
|
|
||||||
* $b is not used or passed
|
|
||||||
|
|
||||||
### 'page_end'
|
|
||||||
* called after HTML content functions have completed
|
|
||||||
* $b is (string) HTML of content div
|
|
||||||
|
|
||||||
### 'avatar_lookup'
|
|
||||||
'avatar_lookup' is called when looking up the avatar.
|
|
||||||
$b is an array:
|
|
||||||
|
|
||||||
'size' => the size of the avatar that will be looked up
|
|
||||||
'email' => email to look up the avatar for
|
|
||||||
'url' => the (string) generated URL of the avatar
|
|
||||||
|
|
||||||
### 'emailer_send_prepare'
|
|
||||||
'emailer_send_prepare' called from Emailer::send() before building the mime message.
|
|
||||||
$b is an array, params to Emailer::send()
|
|
||||||
|
|
||||||
'fromName' => name of the sender
|
|
||||||
'fromEmail' => email fo the sender
|
|
||||||
'replyTo' => replyTo address to direct responses
|
|
||||||
'toEmail' => destination email address
|
|
||||||
'messageSubject' => subject of the message
|
|
||||||
'htmlVersion' => html version of the message
|
|
||||||
'textVersion' => text only version of the message
|
|
||||||
'additionalMailHeader' => additions to the smtp mail header
|
|
||||||
|
|
||||||
### 'emailer_send'
|
|
||||||
is called before calling PHP's mail().
|
|
||||||
$b is an array, params to mail()
|
|
||||||
|
|
||||||
'to'
|
|
||||||
'subject'
|
|
||||||
'body'
|
|
||||||
'headers'
|
|
||||||
|
|
||||||
### 'nav_info'
|
|
||||||
is called after the navigational menu is build in include/nav.php.
|
|
||||||
$b is an array containing $nav from nav.php.
|
|
||||||
|
|
||||||
### 'template_vars'
|
|
||||||
is called before vars are passed to the template engine to render the page.
|
|
||||||
The registered function can add,change or remove variables passed to template.
|
The registered function can add,change or remove variables passed to template.
|
||||||
$b is an array with:
|
`$b` is an array with:
|
||||||
|
|
||||||
'template' => filename of template
|
- **template**: filename of template
|
||||||
'vars' => array of vars passed to template
|
- **vars**: array of vars passed to the template
|
||||||
|
|
||||||
### 'acl_lookup_end'
|
### acl_lookup_end
|
||||||
is called after the other queries have passed.
|
Called after the other queries have passed.
|
||||||
The registered function can add, change or remove the acl_lookup() variables.
|
The registered function can add, change or remove the `acl_lookup()` variables.
|
||||||
|
|
||||||
'results' => array of the acl_lookup() vars
|
- **results**: array of the acl_lookup() vars
|
||||||
|
|
||||||
### 'prepare_body_init'
|
### prepare_body_init
|
||||||
Called at the start of prepare_body
|
Called at the start of prepare_body
|
||||||
Hook data:
|
Hook data:
|
||||||
'item' => item array (input/output)
|
|
||||||
|
|
||||||
### 'prepare_body_content_filter'
|
- **item** (input/output): item array
|
||||||
|
|
||||||
|
### prepare_body_content_filter
|
||||||
Called before the HTML conversion in prepare_body. If the item matches a content filter rule set by an addon, it should
|
Called before the HTML conversion in prepare_body. If the item matches a content filter rule set by an addon, it should
|
||||||
just add the reason to the filter_reasons element of the hook data.
|
just add the reason to the filter_reasons element of the hook data.
|
||||||
Hook data:
|
Hook data:
|
||||||
'item' => item array (input)
|
|
||||||
'filter_reasons' => reasons array (input/output)
|
|
||||||
|
|
||||||
### 'prepare_body'
|
- **item**: item array (input)
|
||||||
Called after the HTML conversion in prepare_body.
|
- **filter_reasons** (input/output): reasons array
|
||||||
|
|
||||||
|
### prepare_body
|
||||||
|
Called after the HTML conversion in `prepare_body()`.
|
||||||
Hook data:
|
Hook data:
|
||||||
'item' => item array (input)
|
|
||||||
'html' => converted item body (input/output)
|
|
||||||
'is_preview' => post preview flag (input)
|
|
||||||
'filter_reasons' => reasons array (input)
|
|
||||||
|
|
||||||
### 'prepare_body_final'
|
- **item** (input): item array
|
||||||
Called at the end of prepare_body.
|
- **html** (input/output): converted item body
|
||||||
|
- **is_preview** (input): post preview flag
|
||||||
|
- **filter_reasons** (input): reasons array
|
||||||
|
|
||||||
|
### prepare_body_final
|
||||||
|
Called at the end of `prepare_body()`.
|
||||||
Hook data:
|
Hook data:
|
||||||
'item' => item array (input)
|
|
||||||
'html' => converted item body (input/output)
|
|
||||||
|
|
||||||
Complete list of hook callbacks
|
- **item**: item array (input)
|
||||||
---
|
- **html**: converted item body (input/output)
|
||||||
|
|
||||||
|
### put_item_in_cache
|
||||||
|
Called after `prepare_text()` in `put_item_in_cache()`.
|
||||||
|
Hook data:
|
||||||
|
|
||||||
|
- **item** (input): item array
|
||||||
|
- **rendered-html** (input/output): final item body HTML
|
||||||
|
- **rendered-hash** (input/output): original item body hash
|
||||||
|
|
||||||
|
### magic_auth_success
|
||||||
|
Called when a magic-auth was successful.
|
||||||
|
Hook data:
|
||||||
|
|
||||||
|
visitor => array with the contact record of the visitor
|
||||||
|
url => the query string
|
||||||
|
|
||||||
|
## Current JavaScript hooks
|
||||||
|
|
||||||
|
### postprocess_liveupdate
|
||||||
|
Called at the end of the live update process (XmlHttpRequest)
|
||||||
|
|
||||||
|
## Complete list of hook callbacks
|
||||||
|
|
||||||
Here is a complete list of all hook callbacks with file locations (as of 01-Apr-2018). Please see the source for details of any hooks not documented above.
|
Here is a complete list of all hook callbacks with file locations (as of 01-Apr-2018). Please see the source for details of any hooks not documented above.
|
||||||
|
|
||||||
|
@ -364,6 +441,7 @@ Here is a complete list of all hook callbacks with file locations (as of 01-Apr-
|
||||||
|
|
||||||
Addon::callHooks('contact_block_end', $arr);
|
Addon::callHooks('contact_block_end', $arr);
|
||||||
Addon::callHooks('poke_verbs', $arr);
|
Addon::callHooks('poke_verbs', $arr);
|
||||||
|
Addon::callHooks('put_item_in_cache', $hook_data);
|
||||||
Addon::callHooks('prepare_body_init', $item);
|
Addon::callHooks('prepare_body_init', $item);
|
||||||
Addon::callHooks('prepare_body_content_filter', $hook_data);
|
Addon::callHooks('prepare_body_content_filter', $hook_data);
|
||||||
Addon::callHooks('prepare_body', $hook_data);
|
Addon::callHooks('prepare_body', $hook_data);
|
||||||
|
@ -490,6 +568,10 @@ Here is a complete list of all hook callbacks with file locations (as of 01-Apr-
|
||||||
|
|
||||||
Addon::callHooks("template_vars", $arr);
|
Addon::callHooks("template_vars", $arr);
|
||||||
|
|
||||||
|
### src/App.php
|
||||||
|
|
||||||
|
Addon::callHooks('load_config');
|
||||||
|
|
||||||
### src/Model/Item.php
|
### src/Model/Item.php
|
||||||
|
|
||||||
Addon::callHooks('post_local', $item);
|
Addon::callHooks('post_local', $item);
|
||||||
|
@ -510,6 +592,7 @@ Here is a complete list of all hook callbacks with file locations (as of 01-Apr-
|
||||||
Addon::callHooks('profile_sidebar', $arr);
|
Addon::callHooks('profile_sidebar', $arr);
|
||||||
Addon::callHooks('profile_tabs', $arr);
|
Addon::callHooks('profile_tabs', $arr);
|
||||||
Addon::callHooks('zrl_init', $arr);
|
Addon::callHooks('zrl_init', $arr);
|
||||||
|
Addon::callHooks('magic_auth_success', $arr);
|
||||||
|
|
||||||
### src/Model/Event.php
|
### src/Model/Event.php
|
||||||
|
|
||||||
|
@ -618,3 +701,7 @@ Here is a complete list of all hook callbacks with file locations (as of 01-Apr-
|
||||||
|
|
||||||
Addon::callHooks('atom_feed_end', $atom);
|
Addon::callHooks('atom_feed_end', $atom);
|
||||||
Addon::callHooks('atom_feed_end', $atom);
|
Addon::callHooks('atom_feed_end', $atom);
|
||||||
|
|
||||||
|
### view/js/main.js
|
||||||
|
|
||||||
|
callAddonHooks("postprocess_liveupdate");
|
||||||
|
|
|
@ -0,0 +1,231 @@
|
||||||
|
Config values that can only be set in config/local.ini.php
|
||||||
|
==========================================================
|
||||||
|
|
||||||
|
* [Home](help)
|
||||||
|
|
||||||
|
Friendica's configuration is done in two places: in INI configuration files and in the `config` database table.
|
||||||
|
Database config values overwrite the same file config values.
|
||||||
|
|
||||||
|
## File configuration
|
||||||
|
|
||||||
|
WARNING: some characters `?{}|&~![()^"` should not be used in the keys or values. If one of those character is required put the value between double quotes (eg. password = "let&me&in")
|
||||||
|
The configuration format for file configuration is an INI string 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:
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php return <<<INI
|
||||||
|
|
||||||
|
; Comment line
|
||||||
|
|
||||||
|
[section1]
|
||||||
|
key = value
|
||||||
|
empty_key =
|
||||||
|
|
||||||
|
[section2]
|
||||||
|
array[] = value0
|
||||||
|
array[] = value1
|
||||||
|
array[] = value2
|
||||||
|
|
||||||
|
INI;
|
||||||
|
// Keep this line
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configuration location
|
||||||
|
|
||||||
|
The `config` directory holds key configuration files:
|
||||||
|
|
||||||
|
- `config.ini.php` holds the default values for all the configuration keys that can only be set in `local.ini.php`.
|
||||||
|
- `settings.ini.php` holds the default values for some configuration keys that are set through the admin settings page.
|
||||||
|
- `local.ini.php` holds the current node custom configuration.
|
||||||
|
- `addon.ini.php` is optional and holds the custom configuration for specific addons.
|
||||||
|
|
||||||
|
Addons can define their own default configuration values in `addon/[addon]/config/[addon].ini.php` which is loaded when the addon is activated.
|
||||||
|
|
||||||
|
#### Migrating from .htconfig.php to config/local.ini.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.ini.php` to `config/addon.ini.php` and move your configuration values.
|
||||||
|
Afterwards, copy `config/local-sample.ini.php` to `config/local.ini.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>
|
||||||
|
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%
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<table class="config">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>.htconfig.php</th>
|
||||||
|
<th>config/local.ini.php</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><pre>
|
||||||
|
$db_host = 'localhost';
|
||||||
|
$db_user = 'mysqlusername';
|
||||||
|
$db_pass = 'mysqlpassword';
|
||||||
|
$db_data = 'mysqldatabasename';
|
||||||
|
$a->config["system"]["db_charset"] = 'utf8mb4';
|
||||||
|
</pre></td>
|
||||||
|
<td><pre>
|
||||||
|
[database]
|
||||||
|
hostname = localhost
|
||||||
|
username = mysqlusername
|
||||||
|
password = mysqlpassword
|
||||||
|
database = mysqldatabasename
|
||||||
|
charset = utf8mb4
|
||||||
|
</pre></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><pre>
|
||||||
|
$a->config["section"]["key"] = "value";
|
||||||
|
</pre></td>
|
||||||
|
<td><pre>
|
||||||
|
[section]
|
||||||
|
key = value
|
||||||
|
</pre></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><pre>
|
||||||
|
$a->config["section"]["key"] = array(
|
||||||
|
"value1",
|
||||||
|
"value2",
|
||||||
|
"value3"
|
||||||
|
);
|
||||||
|
</pre></td>
|
||||||
|
<td><pre>
|
||||||
|
[section]
|
||||||
|
key[] = value1
|
||||||
|
key[] = value2
|
||||||
|
key[] = value3
|
||||||
|
</pre></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><pre>
|
||||||
|
$a->config["key"] = "value";
|
||||||
|
</pre></td>
|
||||||
|
<td><pre>
|
||||||
|
[config]
|
||||||
|
key = value
|
||||||
|
</pre></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><pre>
|
||||||
|
$a->path = "value";
|
||||||
|
</pre></td>
|
||||||
|
<td><pre>
|
||||||
|
[system]
|
||||||
|
urlpath = value
|
||||||
|
</pre></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><pre>
|
||||||
|
$default_timezone = "value";
|
||||||
|
</pre></td>
|
||||||
|
<td><pre>
|
||||||
|
[system]
|
||||||
|
default_timezone = value
|
||||||
|
</pre></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><pre>
|
||||||
|
$pidfile = "value";
|
||||||
|
</pre></td>
|
||||||
|
<td><pre>
|
||||||
|
[system]
|
||||||
|
pidfile = value
|
||||||
|
</pre></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><pre>
|
||||||
|
$lang = "value";
|
||||||
|
</pre></td>
|
||||||
|
<td><pre>
|
||||||
|
[system]
|
||||||
|
language = value
|
||||||
|
</pre></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
### 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 of 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.ini.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 `config/config.ini.php` and should be ovewritten in `config/local.ini.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.ini.php file.
|
||||||
|
If more then 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
|
|
@ -33,7 +33,7 @@ If you don't want to translate the UI, or it is already done to your satisfactio
|
||||||
Are you good at designing things?
|
Are you good at designing things?
|
||||||
If you have seen Friendica you probably have ideas to improve it, haven't you?
|
If you have seen Friendica you probably have ideas to improve it, haven't you?
|
||||||
|
|
||||||
* If you would like to work with us on enhancing the user interface, please join the [UX Watchdogs forum](https://fc.oscp.info/profile/ux-watchdogs)
|
* If you would like to work with us on enhancing the user interface, please join the [forum for Friendica development](https://forum.friendi.ca/profile/developers).
|
||||||
* Make plans for a better Friendica interface design and share them with us.
|
* Make plans for a better Friendica interface design and share them with us.
|
||||||
* Tell us if you are able to realize your ideas or what kind of help you need.
|
* Tell us if you are able to realize your ideas or what kind of help you need.
|
||||||
We can't promise we have the right skills in the group but we'll try.
|
We can't promise we have the right skills in the group but we'll try.
|
||||||
|
|
|
@ -197,14 +197,14 @@ If you are searching for new themes, you can find them at [Friendica-Themes.com]
|
||||||
<a name="adminaccount1"></a>
|
<a name="adminaccount1"></a>
|
||||||
### I've changed my email address now the admin panel is gone?
|
### I've changed my email address now the admin panel is gone?
|
||||||
|
|
||||||
Have a look into your <tt>.htconfig.php</tt> and fix your email address there.
|
Have a look into your <tt>config/local.ini.php</tt> and fix your email address there.
|
||||||
|
|
||||||
<a name="adminaccount2"></a>
|
<a name="adminaccount2"></a>
|
||||||
### Can there be more then one admin for a node?
|
### Can there be more then one admin for a node?
|
||||||
|
|
||||||
Yes.
|
Yes.
|
||||||
You just have to list more then one email address in the
|
You just have to list more then one email address in the
|
||||||
<tt>.htconfig.php</tt> file.
|
<tt>config/local.ini.php</tt> file.
|
||||||
The listed emails need to be separated by a comma.
|
The listed emails need to be separated by a comma.
|
||||||
|
|
||||||
<a name="dbupdate">
|
<a name="dbupdate">
|
||||||
|
|
|
@ -32,7 +32,7 @@ Friendica Documentation and Resources
|
||||||
* [Installing Connectors (Twitter/GNU Social)](help/Installing-Connectors)
|
* [Installing Connectors (Twitter/GNU Social)](help/Installing-Connectors)
|
||||||
* [Install an ejabberd server (XMPP chat) with synchronized credentials](help/install-ejabberd)
|
* [Install an ejabberd server (XMPP chat) with synchronized credentials](help/install-ejabberd)
|
||||||
* [Using SSL with Friendica](help/SSL)
|
* [Using SSL with Friendica](help/SSL)
|
||||||
* [Config values that can only be set in .htconfig.php](help/htconfig)
|
* [Config values that can only be set in config/local.ini.php](help/Config)
|
||||||
* [Improve Performance](help/Improve-Performance)
|
* [Improve Performance](help/Improve-Performance)
|
||||||
* [Administration Tools](help/tools)
|
* [Administration Tools](help/tools)
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@ Friendica Documentation and Resources
|
||||||
* [Translate Friendica](help/translations)
|
* [Translate Friendica](help/translations)
|
||||||
* [Use Composer](help/Composer)
|
* [Use Composer](help/Composer)
|
||||||
* [Move classes to `src`](help/Developer-How-To-Move-Classes-to-src)
|
* [Move classes to `src`](help/Developer-How-To-Move-Classes-to-src)
|
||||||
|
* [Run tests](help/Tests)
|
||||||
* Reference
|
* Reference
|
||||||
* [Twitter/GNU Social API Functions](help/api)
|
* [Twitter/GNU Social API Functions](help/api)
|
||||||
* [Code (Doxygen generated - sets cookies)](doc/html/)
|
* [Code (Doxygen generated - sets cookies)](doc/html/)
|
||||||
|
@ -72,4 +73,3 @@ Friendica Documentation and Resources
|
||||||
|
|
||||||
* [Site/Version Info](friendica)
|
* [Site/Version Info](friendica)
|
||||||
* [Friendica Credits](credits)
|
* [Friendica Credits](credits)
|
||||||
|
|
||||||
|
|
149
doc/Install.md
|
@ -27,7 +27,7 @@ Requirements
|
||||||
---
|
---
|
||||||
|
|
||||||
* Apache with mod-rewrite enabled and "Options All" so you can use a local .htaccess file
|
* Apache with mod-rewrite enabled and "Options All" so you can use a local .htaccess file
|
||||||
* PHP 5.6+ (PHP 7 is recommended for performance)
|
* PHP 5.6.1+ (PHP 7 is recommended for performance)
|
||||||
* PHP *command line* access with register_argc_argv set to true in the php.ini file
|
* PHP *command line* access with register_argc_argv set to true in the php.ini file
|
||||||
* Curl, GD, PDO, MySQLi, hash, xml, zip and OpenSSL extensions
|
* Curl, GD, PDO, MySQLi, hash, xml, zip and OpenSSL extensions
|
||||||
* The POSIX module of PHP needs to be activated (e.g. [RHEL, CentOS](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) have disabled it)
|
* The POSIX module of PHP needs to be activated (e.g. [RHEL, CentOS](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) have disabled it)
|
||||||
|
@ -47,14 +47,15 @@ If you are able to do so, we recommend using git to clone the source repository
|
||||||
This makes the software much easier to update.
|
This makes the software much easier to update.
|
||||||
The Linux commands to clone the repository into a directory "mywebsite" would be
|
The Linux commands to clone the repository into a directory "mywebsite" would be
|
||||||
|
|
||||||
git clone https://github.com/friendica/friendica.git mywebsite
|
git clone https://github.com/friendica/friendica.git -b master mywebsite
|
||||||
cd mywebsite
|
cd mywebsite
|
||||||
bin/composer.phar install
|
bin/composer.phar install
|
||||||
|
|
||||||
Make sure the folder *view/smarty3* exists and is writable by the webserver user
|
Make sure the folder *view/smarty3* exists and is writable by the webserver user, in this case `www-data`
|
||||||
|
|
||||||
mkdir view/smarty3
|
mkdir view/smarty3
|
||||||
chmod 777 view/smarty3
|
chown www-data:www-data view/smarty3
|
||||||
|
chmod 775 view/smarty3
|
||||||
|
|
||||||
Get the addons by going into your website folder.
|
Get the addons by going into your website folder.
|
||||||
|
|
||||||
|
@ -62,10 +63,20 @@ Get the addons by going into your website folder.
|
||||||
|
|
||||||
Clone the addon repository (separately):
|
Clone the addon repository (separately):
|
||||||
|
|
||||||
git clone https://github.com/friendica/friendica-addons.git addon
|
git clone https://github.com/friendica/friendica-addons.git -b master addon
|
||||||
|
|
||||||
If you copy the directory tree to your webserver, make sure that you also copy .htaccess - as "dot" files are often hidden and aren't normally copied.
|
If you copy the directory tree to your webserver, make sure that you also copy .htaccess - as "dot" files are often hidden and aren't normally copied.
|
||||||
|
|
||||||
|
If you want to use the development version of Friendica you can switch to the devel branch in the repository by running
|
||||||
|
|
||||||
|
git checkout develop
|
||||||
|
bin/composer.phar install
|
||||||
|
cd addon
|
||||||
|
git checkout develop
|
||||||
|
|
||||||
|
please be aware that the develop branch may break your Friendica node at any time.
|
||||||
|
If you encounter a bug, please let us know.
|
||||||
|
|
||||||
### Create a database
|
### Create a database
|
||||||
|
|
||||||
Create an empty database and note the access details (hostname, username, password, database name).
|
Create an empty database and note the access details (hostname, username, password, database name).
|
||||||
|
@ -89,40 +100,124 @@ If you need to specify a port for the connection to the database, you can do so
|
||||||
|
|
||||||
*If* the manual installation fails for any reason, check the following:
|
*If* the manual installation fails for any reason, check the following:
|
||||||
|
|
||||||
* Does ".htconfig.php" exist? If not, edit htconfig.php and change the system settings. Rename to .htconfig.php
|
* Does "config/local.ini.php" exist? If not, edit config/local-sample.ini.php and change the system settings.
|
||||||
* Is the database is populated? If not, import the contents of "database.sql" with phpmyadmin or the mysql command line.
|
* Rename to `config/local.ini.php`.
|
||||||
|
* Is the database is populated? If not, import the contents of `database.sql` with phpmyadmin or the mysql command line.
|
||||||
|
|
||||||
At this point visit your website again, and register your personal account.
|
At this point visit your website again, and register your personal account.
|
||||||
Registration errors should all be recoverable automatically.
|
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.
|
If you get any *critical* failure at this point, it generally indicates the database was not installed correctly.
|
||||||
You might wish to move/rename .htconfig.php to another name and empty (called 'dropping') the database tables, so that you can start fresh.
|
You might wish to move/rename `config/local.ini.php` to another name and empty (called 'dropping') the database tables, so that you can start fresh.
|
||||||
|
|
||||||
### Option B: Run the automatic install script
|
### Option B: Run the automatic install script
|
||||||
|
|
||||||
Open the file htconfig.php in the main Friendica directory with a text editor.
|
You have the following options to automatically install Friendica:
|
||||||
Remove the `die('...');` line and edit the lines to suit your installation (MySQL, language, theme etc.).
|
- creating a prepared config file (f.e. `prepared.ini.php`)
|
||||||
Then save the file (do not rename it).
|
- using environment variables (f.e. `MYSQL_HOST`)
|
||||||
|
- using options (f.e. `--dbhost <host>`)
|
||||||
|
|
||||||
Navigate to the main Friendica directory and execute the following command:
|
You can combine environment variables and options, but be aware that options are prioritized over environment variables.
|
||||||
|
|
||||||
bin/console autoinstall
|
|
||||||
|
|
||||||
Or if you wish to include all optional checks, execute this statement instead:
|
|
||||||
|
|
||||||
bin/console autoinstall -a
|
|
||||||
|
|
||||||
At this point visit your website again, and register your personal account.
|
|
||||||
|
|
||||||
*If* the automatic installation fails for any reason, check the following:
|
|
||||||
|
|
||||||
* Does ".htconfig.php" already exist? If yes, the automatic installation won't start
|
|
||||||
* Are the settings inside "htconfig.php" correct? If not, edit the file again.
|
|
||||||
* Is the empty MySQL-database created? If not, create it.
|
|
||||||
|
|
||||||
For more information during the installation, you can use this command line option
|
For more information during the installation, you can use this command line option
|
||||||
|
|
||||||
bin/console autoinstall -v
|
bin/console autoinstall -v
|
||||||
|
|
||||||
|
If you wish to include all optional checks, use `-a` like this statement:
|
||||||
|
|
||||||
|
bin/console autoinstall -a
|
||||||
|
|
||||||
|
*If* the automatic installation fails for any reason, check the following:
|
||||||
|
|
||||||
|
* Does `config/local.ini.php` already exist? If yes, the automatic installation won't start
|
||||||
|
* Are the options in the `config/local.ini.php` correct? If not, edit them directly.
|
||||||
|
* Is the empty MySQL-database created? If not, create it.
|
||||||
|
|
||||||
|
#### B.1: Config file
|
||||||
|
|
||||||
|
You can use a prepared config file like [local-sample.ini.php](config/local-sample.ini.php).
|
||||||
|
|
||||||
|
Navigate to the main Friendica directory and execute the following command:
|
||||||
|
|
||||||
|
bin/console autoinstall -f <prepared.ini.php>
|
||||||
|
|
||||||
|
#### B.2: Environment variables
|
||||||
|
|
||||||
|
There are two types of environment variables.
|
||||||
|
- those you can use in normal mode too (Currently just **database credentials**)
|
||||||
|
- those you can only use during installation (because Friendica will normally ignore it)
|
||||||
|
|
||||||
|
You can use the options during installation too and skip some of the environment variables.
|
||||||
|
|
||||||
|
**Database credentials**
|
||||||
|
|
||||||
|
if you don't use the option `--savedb` during installation, the DB credentials will **not** be saved in the `config/local.ini.php`.
|
||||||
|
|
||||||
|
- `MYSQL_HOST` The host of the mysql/mariadb database
|
||||||
|
- `MYSQL_PORT` The port of the mysql/mariadb database
|
||||||
|
- `MYSQL_USERNAME` The username of the mysql database login (used for mysql)
|
||||||
|
- `MYSQL_USER` The username of the mysql database login (used for mariadb)
|
||||||
|
- `MYSQL_PASSWORD` The password of the mysql/mariadb database login
|
||||||
|
- `MYSQL_DATABASE` The name of the mysql/mariadb database
|
||||||
|
|
||||||
|
**Friendica settings**
|
||||||
|
|
||||||
|
This variables wont be used at normal Friendica runtime.
|
||||||
|
Instead, they get saved into `config/local.ini.php`.
|
||||||
|
|
||||||
|
- `FRIENDICA_PHP_PATH` The path of the PHP binary
|
||||||
|
- `FRIENDICA_ADMIN_MAIL` The admin email address of Friendica (this email will be used for admin access)
|
||||||
|
- `FRIENDICA_TZ` The timezone of Friendica
|
||||||
|
- `FRIENDICA_LANG` The langauge of Friendica
|
||||||
|
|
||||||
|
Navigate to the main Friendica directory and execute the following command:
|
||||||
|
|
||||||
|
bin/console autoinstall [--savedb]
|
||||||
|
|
||||||
|
#### B.3: Execution options
|
||||||
|
|
||||||
|
All options will be saved in the `config/local.ini.php` and are overruling the associated environment variables.
|
||||||
|
|
||||||
|
- `-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`)
|
||||||
|
- `-U|--dbuser <username>` The username of the mysql/mariadb database login (env `MYSQL_USER` or `MYSQL_USERNAME`)
|
||||||
|
- `-P|--dbpass <password>` The password of the mysql/mariadb database login (env `MYSQL_PASSWORD`)
|
||||||
|
- `-d|--dbdata <database>` The name of the mysql/mariadb database (env `MYSQL_DATABASE`)
|
||||||
|
- `-b|--phppath <path>` The path of the PHP binary (env `FRIENDICA_PHP_PATH`)
|
||||||
|
- `-A|--admin <mail>` The admin email address of Friendica (env `FRIENDICA_ADMIN_MAIL`)
|
||||||
|
- `-T|--tz <timezone>` The timezone of Friendica (env `FRIENDICA_TZ`)
|
||||||
|
- `-L|--land <language>` The language of Friendica (env `FRIENDICA_LANG`)
|
||||||
|
|
||||||
|
Navigate to the main Friendica directory and execute the following command:
|
||||||
|
|
||||||
|
bin/console autoinstall [options]
|
||||||
|
|
||||||
|
### Prepare .htaccess file
|
||||||
|
|
||||||
|
Copy .htaccess-dist to .htaccess (be careful under Windows) to have working mod-rewrite again. If you have installed Friendica into a sub directory, like /friendica/ set this path in RewriteBase accordingly.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
cp .htacces-dist .htaccess
|
||||||
|
|
||||||
|
*Note*: Do **not** rename the .htaccess-dist file as it is tracked by GIT and renaming will cause a dirty working directory.
|
||||||
|
|
||||||
|
### Verify the "host-meta" page is working
|
||||||
|
|
||||||
|
Friendica should respond automatically to important addresses under the /.well-known/ rewrite path.
|
||||||
|
One critical URL would look like, for example, https://example.com/.well-known/host-meta
|
||||||
|
It must be visible to the public and must respond with an XML file that is automatically customized to your site.
|
||||||
|
|
||||||
|
If that URL is not working, it is possible that some other software is using the /.well-known/ path.
|
||||||
|
Other symptoms may include an error message in the Admin settings that says "host-meta is not reachable on your system.
|
||||||
|
This is a severe configuration issue that prevents server to server communication."
|
||||||
|
Another common error related to host-meta is the "Invalid profile URL."
|
||||||
|
|
||||||
|
Check for a .well-known directory that did not come with Friendica.
|
||||||
|
The preferred configuration is to remove the directory, however this is not always possible.
|
||||||
|
If there is any /.well-known/.htaccess file, it could interfere with this Friendica core requirement.
|
||||||
|
You should remove any RewriteRules from that file, or remove that whole file if appropriate.
|
||||||
|
It may be necessary to chmod the /.well-known/.htaccess file if you were not given write permissions by default.
|
||||||
|
|
||||||
### Set up the worker
|
### Set up the worker
|
||||||
|
|
||||||
Set up a cron job or scheduled task to run the worker once every 5-10 minutes in order to perform background processing.
|
Set up a cron job or scheduled task to run the worker once every 5-10 minutes in order to perform background processing.
|
||||||
|
@ -151,5 +246,5 @@ Bad things will happen.
|
||||||
Let there be a hardware failure, a corrupted database or whatever you can think of.
|
Let there be a hardware failure, a corrupted database or whatever you can think of.
|
||||||
So once the installation of your Friendica node is done, you should make yourself a backup plan.
|
So once the installation of your Friendica node is done, you should make yourself a backup plan.
|
||||||
|
|
||||||
The most important file is the `.htconfig.php` file in the base directory.
|
The most important file is the `config/local.ini.php` file.
|
||||||
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.
|
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.
|
||||||
|
|
|
@ -4,7 +4,7 @@ Installing Connectors (Twitter/GNU Social)
|
||||||
* [Home](help)
|
* [Home](help)
|
||||||
|
|
||||||
|
|
||||||
Friendica uses addons to provide connectivity to some networks, such as Twitter or App.net.
|
Friendica uses addons to provide connectivity to some networks, such as Twitter.
|
||||||
|
|
||||||
There is also a addon to post through to an existing account on a GNU Social service.
|
There is also a 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.
|
You only need this to post to an already existing GNU Social account, but not to communicate with GNU Social members in general.
|
||||||
|
@ -19,7 +19,7 @@ Addons must be installed by the site administrator before they can be used.
|
||||||
This is accomplished through the site administration panel.
|
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.
|
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 (.htconfig.php).
|
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.ini.php).
|
||||||
The ways to obtain these keys vary between the services, but they all require an existing account on the target service.
|
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.
|
Once installed, these API keys can usually be shared by all site members.
|
||||||
|
|
||||||
|
@ -39,10 +39,11 @@ You can get it from [Twitter](https://twitter.com/apps).
|
||||||
Register your Friendica site as "Client" application with "Read & Write" access.
|
Register your Friendica site as "Client" application with "Read & Write" access.
|
||||||
We do not need "Twitter as login".
|
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.
|
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 global .htconfig.php:
|
Add this key pair to your config/local.ini.php:
|
||||||
|
|
||||||
$a->config['twitter']['consumerkey'] = 'your consumer_key here';
|
[twitter]
|
||||||
$a->config['twitter']['consumersecret'] = 'your consumer_secret here';
|
consumerkey = your consumer_key here
|
||||||
|
consumersecret = your consumer_secret here
|
||||||
|
|
||||||
After this, your users can configure their Twitter account settings from "Settings -> Connector Settings".
|
After this, your users can configure their Twitter account settings from "Settings -> Connector Settings".
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ How to move your account between servers
|
||||||
* Go to "Settings" -> "[Export personal data](uexport)"
|
* Go to "Settings" -> "[Export personal data](uexport)"
|
||||||
* Click on "Export account" to save your account data.
|
* Click on "Export account" to save your account data.
|
||||||
* **Save the file in a secure place!** It contains your details, your contacts, groups, and personal settings. It also contains your secret keys to authenticate yourself to your contacts.
|
* **Save the file in a secure place!** It contains your details, your contacts, groups, and personal settings. It also contains your secret keys to authenticate yourself to your contacts.
|
||||||
* Go to your new server, and open *http://newserver.com/uimport* (there is not a direct link to this page at the moment).
|
* Go to your new server, and open *http://newserver.com/uimport* (there is not a direct link to this page at the moment). Please consider that this is only possible on servers with open registration. On other systems only the administrator can add accounts with an uploaded file.
|
||||||
* Do NOT create a new account prior to importing your old settings - uimport should be used *instead* of register.
|
* Do NOT create a new account prior to importing your old settings - uimport should be used *instead* of register.
|
||||||
* Load your saved account file and click "Import".
|
* Load your saved account file and click "Import".
|
||||||
* After the move, the account on the old server will not work reliably anymore, and should be not used.
|
* After the move, the account on the old server will not work reliably anymore, and should be not used.
|
||||||
|
|
|
@ -15,6 +15,6 @@ Remember the link at the top of this page will bring you back here.
|
||||||
|
|
||||||
Once you've added some groups, <a href="help/Quick-Start-andfinally">move on to the next section</a>.
|
Once you've added some groups, <a href="help/Quick-Start-andfinally">move on to the next section</a>.
|
||||||
|
|
||||||
<iframe src="http://dir.friendica.com/directory/forum" width="950" height="600"></iframe>
|
<iframe src="http://dir.friendica.social/directory" width="950" height="600"></iframe>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ You can chose between the following modes:
|
||||||
##### Invitation based registry
|
##### Invitation based registry
|
||||||
|
|
||||||
Additionally to the setting in the admin panel, you can devide if registrations are only possible using an invitation code or not.
|
Additionally to the setting in the admin panel, you can devide if registrations are only possible using an invitation code or not.
|
||||||
To enable invitation based registration, you have to set the `invitation_only` setting in the [.htconfig.php](/help/htconfig) file.
|
To enable invitation based registration, you have to set the `invitation_only` setting in the [config/local.ini.php](/help/Config) file.
|
||||||
If you want to use this method, the registration policy has to be set to either *open* or *requires approval*.
|
If you want to use this method, the registration policy has to be set to either *open* or *requires approval*.
|
||||||
|
|
||||||
#### Check Full Names
|
#### Check Full Names
|
||||||
|
@ -162,6 +162,14 @@ It is disabled by default, as it causes additional load on the server and may be
|
||||||
As admin of the node you can also set this flag directly in the database.
|
As admin of the node you can also set this flag directly in the database.
|
||||||
Before doing so, you should be sure you know what you do and have a backup of the database.
|
Before doing so, you should be sure you know what you do and have a backup of the database.
|
||||||
|
|
||||||
|
#### Explicit Content
|
||||||
|
|
||||||
|
If you are running a node with explicit content, you can announce this with this option.
|
||||||
|
When checked an information flag will be set in the published information about your node.
|
||||||
|
(Should *Publish Server Information* be enabled.)
|
||||||
|
|
||||||
|
Additionally a note will be displayed on the registration page for new users.
|
||||||
|
|
||||||
### Advanced
|
### Advanced
|
||||||
|
|
||||||
#### Proxy Configuration Settings
|
#### Proxy Configuration Settings
|
||||||
|
@ -317,7 +325,7 @@ You should set up some kind of [log rotation](https://en.wikipedia.org/wiki/Log_
|
||||||
**Known Issues**: The filename ``friendica.log`` can cause problems depending on your server configuration (see [issue 2209](https://github.com/friendica/friendica/issues/2209)).
|
**Known Issues**: The filename ``friendica.log`` can cause problems depending on your server configuration (see [issue 2209](https://github.com/friendica/friendica/issues/2209)).
|
||||||
|
|
||||||
By default PHP warnings and error messages are supressed.
|
By default PHP warnings and error messages are supressed.
|
||||||
If you want to enable those, you have to activate them in the ``.htconfig.php`` file.
|
If you want to enable those, you have to activate them in the ``config/local.ini.php`` file.
|
||||||
Use the following settings to redirect PHP errors to a file.
|
Use the following settings to redirect PHP errors to a file.
|
||||||
|
|
||||||
Config:
|
Config:
|
||||||
|
@ -365,24 +373,27 @@ By default this will be the one account you create during the installation proce
|
||||||
But you can expand the list of email addresses by any used email address you want.
|
But you can expand the list of email addresses by any used email address you want.
|
||||||
Registration of new accounts with a listed email address is not possible.
|
Registration of new accounts with a listed email address is not possible.
|
||||||
|
|
||||||
$a->config['admin_email'] = 'you@example.com, buddy@example.com';
|
[config]
|
||||||
|
admin_email = you@example.com, buddy@example.com
|
||||||
|
|
||||||
## PHP Path
|
## PHP Path
|
||||||
|
|
||||||
Some of Friendicas processes are running in the background.
|
Some of Friendicas processes are running in the background.
|
||||||
For this you need to specify the path to the PHP binary to be used.
|
For this you need to specify the path to the PHP binary to be used.
|
||||||
|
|
||||||
$a->config['php_path'] = '{{$phpath}}';
|
[config]
|
||||||
|
php_path = {{$phpath}}
|
||||||
|
|
||||||
## Subdirectory configuration
|
## Subdirectory configuration
|
||||||
|
|
||||||
It is possible to install Friendica into a subdirectory of your webserver.
|
It is possible to install Friendica into a subdirectory of your webserver.
|
||||||
We strongly discurage you from doing so, as this will break federation to other networks (e.g. Diaspora, GNU Socia, Hubzilla)
|
We strongly discourage you from doing so, as this will break federation to other networks (e.g. Diaspora, GNU Socia, Hubzilla)
|
||||||
Say you have a subdirectory for tests and put Friendica into a further subdirectory, the config would be:
|
Say you have a subdirectory for tests and put Friendica into a further subdirectory, the config would be:
|
||||||
|
|
||||||
$a->path = 'tests/friendica';
|
[system]
|
||||||
|
urlpath = tests/friendica
|
||||||
|
|
||||||
## Other exceptions
|
## Other exceptions
|
||||||
|
|
||||||
Furthermore there are some experimental settings, you can read-up in the [Config values that can only be set in .htconfig.php](help/htconfig) section of the documentation.
|
Furthermore there are some experimental settings, you can read-up in the [Config values that can only be set in config/local.ini.php](help/Config) section of the documentation.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Themes
|
||||||
|
|
||||||
|
* [Home](help)
|
||||||
|
|
||||||
|
You can run unit tests with [PHPUnit](https://phpunit.de/):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
phpunit
|
||||||
|
```
|
||||||
|
|
||||||
|
Some tests require access to a MySQL database.
|
||||||
|
You can specify the database credentials in environment variables:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
USER=database_user PASS=database_password DB=database_name phpunit
|
||||||
|
```
|
||||||
|
|
||||||
|
**Warning**: This will empty all the tables! Never use this on a production database.
|
|
@ -7,7 +7,7 @@ Updating Friendica
|
||||||
|
|
||||||
If you installed Friendica in the ``path/to/friendica`` folder:
|
If you installed Friendica in the ``path/to/friendica`` folder:
|
||||||
1. Unpack the new Friendica archive in ``path/to/friendica_new``.
|
1. Unpack the new Friendica archive in ``path/to/friendica_new``.
|
||||||
2. Copy ``.htconfig.php``, ``photo/`` and ``proxy/`` from ``path/to/friendica`` to ``path/to/friendica_new``.
|
2. Copy ``config/local.ini.php``, ``photo/`` and ``proxy/`` from ``path/to/friendica`` to ``path/to/friendica_new``.
|
||||||
3. Rename the ``path/to/friendica`` folder to ``path/to/friendica_old``.
|
3. Rename the ``path/to/friendica`` folder to ``path/to/friendica_old``.
|
||||||
4. Rename the ``path/to/friendica_new`` folder to ``path/to/friendica``.
|
4. Rename the ``path/to/friendica_new`` folder to ``path/to/friendica``.
|
||||||
5. Check your site. Note: it may go into maintenance mode to update the database schema.
|
5. Check your site. Note: it may go into maintenance mode to update the database schema.
|
||||||
|
|
|
@ -42,7 +42,7 @@ This will not delete the virtual machine.
|
||||||
9. To ultimately delete the virtual machine run
|
9. To ultimately delete the virtual machine run
|
||||||
|
|
||||||
$> vagrant destroy
|
$> vagrant destroy
|
||||||
$> rm /vagrant/.htconfig.php
|
$> rm /vagrant/config/local.ini.php
|
||||||
|
|
||||||
to make sure that you can start from scratch with another "vagrant up".
|
to make sure that you can start from scratch with another "vagrant up".
|
||||||
|
|
||||||
|
|
67
doc/api.md
|
@ -634,6 +634,73 @@ Friendica doesn't allow showing the friends of other users.
|
||||||
* trim_user
|
* trim_user
|
||||||
* contributor_details
|
* contributor_details
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Return values for statuses/* api calls
|
||||||
|
|
||||||
|
Returned status object is conform to GNU Social/Twitter api.
|
||||||
|
|
||||||
|
Friendica adds some addictional fields:
|
||||||
|
|
||||||
|
- owner: a user object, it's the owner of the item.
|
||||||
|
- private: boolean, true if the item is marked as private
|
||||||
|
- activities: map with activities related to the item. Every activity is a list of user objects.
|
||||||
|
|
||||||
|
This properties are prefixed with "friendica_" in JSON responses and namespaced under "http://friendi.ca/schema/api/1/" in XML responses
|
||||||
|
|
||||||
|
JSON:
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
// ...
|
||||||
|
'friendica_owner' : {
|
||||||
|
// user object
|
||||||
|
},
|
||||||
|
'friendica_private' : true,
|
||||||
|
'friendica_activities': {
|
||||||
|
'like': [
|
||||||
|
{
|
||||||
|
// user object
|
||||||
|
},
|
||||||
|
// ...
|
||||||
|
],
|
||||||
|
'dislike': [],
|
||||||
|
'attendyes': [],
|
||||||
|
'attendno': [],
|
||||||
|
'attendmaybe': []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// ...
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
XML:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<statuses xmlns="http://api.twitter.com" xmlns:statusnet="http://status.net/schema/api/1/" xmlns:friendica="http://friendi.ca/schema/api/1/" xmlns:georss="http://www.georss.org/georss">
|
||||||
|
<status>
|
||||||
|
<!-- ... -->
|
||||||
|
<friendica:owner><!-- user object --></friendica:owner>
|
||||||
|
<friendica:private>true</friendica:private>
|
||||||
|
<friendica:activities>
|
||||||
|
<friendica:like>
|
||||||
|
<user>
|
||||||
|
<!-- user object -->
|
||||||
|
</user>
|
||||||
|
<!-- ... --->
|
||||||
|
</friendica:like>
|
||||||
|
<friendica:dislike/>
|
||||||
|
<friendica:attendyes/>
|
||||||
|
<friendica:attendno/>
|
||||||
|
<friendica:attendmaybe/>
|
||||||
|
</friendica:activities>
|
||||||
|
</status>
|
||||||
|
<!-- ... -->
|
||||||
|
</statuses>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### statusnet/config (*)
|
### statusnet/config (*)
|
||||||
|
|
|
@ -234,6 +234,7 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
|
||||||
|
|
||||||
Addon::callHooks('contact_block_end', $arr);
|
Addon::callHooks('contact_block_end', $arr);
|
||||||
Addon::callHooks('poke_verbs', $arr);
|
Addon::callHooks('poke_verbs', $arr);
|
||||||
|
Addon::callHooks('put_item_in_cache', $hook_data);
|
||||||
Addon::callHooks('prepare_body_init', $item);
|
Addon::callHooks('prepare_body_init', $item);
|
||||||
Addon::callHooks('prepare_body_content_filter', $hook_data);
|
Addon::callHooks('prepare_body_content_filter', $hook_data);
|
||||||
Addon::callHooks('prepare_body', $hook_data);
|
Addon::callHooks('prepare_body', $hook_data);
|
||||||
|
|
|
@ -180,7 +180,7 @@ Hier ist eine Liste von Clients bei denen dies möglich ist, bzw. die speziell f
|
||||||
<a name="help"></a>
|
<a name="help"></a>
|
||||||
### Wo finde ich Hilfe?
|
### Wo finde ich Hilfe?
|
||||||
|
|
||||||
Wenn Du Probleme mit Deiner Friendica-Seite hast, dann kannst Du die Community in der [Friendica-Support-Gruppe](https://forum.friendi.ca/profile/helpers) oder im [deutschen Friendica-Support-Forum](http://toktan.org/profile/wiki) fragen oder Dir das [deutsche Wiki](http://wiki.toktan.org/doku.php) anschauen.
|
Wenn Du Probleme mit Deiner Friendica-Seite hast, dann kannst Du die Community in der [Friendica-Support-Gruppe](https://forum.friendi.ca/profile/helpers) fragen oder Dir das [deutsche Wiki](https://friendica-wiki.de/) anschauen.
|
||||||
Wenn Du Deinen Account nicht nutzen kannst, kannst Du entweder einen [Testaccount](https://tryfriendica.de) bzw. einen Account auf einer öffentlichen Seite ([Liste](https://dir.friendica.social/servers)) nutzen.
|
Wenn Du Deinen Account nicht nutzen kannst, kannst Du entweder einen [Testaccount](https://tryfriendica.de) bzw. einen Account auf einer öffentlichen Seite ([Liste](https://dir.friendica.social/servers)) nutzen.
|
||||||
|
|
||||||
Wenn du dir keinen weiteren Friendica Account einrichten willst, kannst du auch gerne über einen der folgenden alternativen Kanäle Hilfe suchen:
|
Wenn du dir keinen weiteren Friendica Account einrichten willst, kannst du auch gerne über einen der folgenden alternativen Kanäle Hilfe suchen:
|
||||||
|
@ -199,7 +199,7 @@ Admin
|
||||||
|
|
||||||
Ja, das ist möglich.
|
Ja, das ist möglich.
|
||||||
Es ist allerdings nicht möglich, eine Datenbank durch zwei Domains zu nutzen.
|
Es ist allerdings nicht möglich, eine Datenbank durch zwei Domains zu nutzen.
|
||||||
Solange Du Deine .htconfig.php allerdings so einrichtest, dass das System nicht versucht, eine Installation durchzuführen, kannst Du die richtige Config-Datei in include/$hostname/.htconfig.php hinterlegen.
|
Solange Du Deine config/local.ini.php allerdings so einrichtest, dass das System nicht versucht, eine Installation durchzuführen, kannst Du die richtige Config-Datei in include/$hostname/config/local.ini.php hinterlegen.
|
||||||
Alle Cache-Aspekte und der Zugriffsschutz können pro Instanz konfiguriert werden.
|
Alle Cache-Aspekte und der Zugriffsschutz können pro Instanz konfiguriert werden.
|
||||||
|
|
||||||
<a name="sources"></a>
|
<a name="sources"></a>
|
||||||
|
@ -216,13 +216,13 @@ Wenn Du neue Themen suchst, findest Du sie auf [Friendica-Themes.com](http://fri
|
||||||
<a name="adminaccount1"></a>
|
<a name="adminaccount1"></a>
|
||||||
### Ich habe meine E-Mail Adresse geändern und jetzt ist das Admin Panel verschwunden?
|
### Ich habe meine E-Mail Adresse geändern und jetzt ist das Admin Panel verschwunden?
|
||||||
|
|
||||||
Bitte aktualisiere deine E-Mail Adresse in der <tt>.htconfig.php</tt> Datei.
|
Bitte aktualisiere deine E-Mail Adresse in der <tt>config/local.ini.php</tt> Datei.
|
||||||
|
|
||||||
<a name="adminaccount2"></a>
|
<a name="adminaccount2"></a>
|
||||||
### Kann es mehr als einen Admin auf einer Friendica Instanz geben?
|
### Kann es mehr als einen Admin auf einer Friendica Instanz geben?
|
||||||
|
|
||||||
Ja.
|
Ja.
|
||||||
Du kannst in der <tt>.htconfig.php</tt> Datei mehrere E-Mail Adressen auflisten.
|
Du kannst in der <tt>config/local.ini.php</tt> Datei mehrere E-Mail Adressen auflisten.
|
||||||
Die aufgelisteten Adressen werden mit Kommata von einander getrennt.
|
Die aufgelisteten Adressen werden mit Kommata von einander getrennt.
|
||||||
|
|
||||||
<a name="dbupdate">
|
<a name="dbupdate">
|
||||||
|
|
|
@ -34,7 +34,7 @@ Friendica - Dokumentation und Ressourcen
|
||||||
* [Konnektoren (Connectors) installieren (Twitter/GNU Social)](help/Installing-Connectors)
|
* [Konnektoren (Connectors) installieren (Twitter/GNU Social)](help/Installing-Connectors)
|
||||||
* [Installation eines ejabberd Servers (XMPP-Chat) mit synchronisierten Anmeldedaten](help/install-ejabberd) (EN)
|
* [Installation eines ejabberd Servers (XMPP-Chat) mit synchronisierten Anmeldedaten](help/install-ejabberd) (EN)
|
||||||
* [Betreibe deine Seite mit einem SSL-Zertifikat](help/SSL)
|
* [Betreibe deine Seite mit einem SSL-Zertifikat](help/SSL)
|
||||||
* [Konfigurationswerte, die nur in der .htconfig.php gesetzt werden können](help/htconfig) (EN)
|
* [Konfigurationswerte, die nur in der config/local.ini.php gesetzt werden können](help/Config) (EN)
|
||||||
* [Performance verbessern](help/Improve-Performance)
|
* [Performance verbessern](help/Improve-Performance)
|
||||||
* [Administration Werkzeuge](help/tools) (EN)
|
* [Administration Werkzeuge](help/tools) (EN)
|
||||||
|
|
||||||
|
@ -56,11 +56,12 @@ Friendica - Dokumentation und Ressourcen
|
||||||
* [Code-Referenz (mit doxygen generiert - setzt Cookies)](doc/html/)
|
* [Code-Referenz (mit doxygen generiert - setzt Cookies)](doc/html/)
|
||||||
* [Twitter/GNU Social API Functions](help/api) (EN)
|
* [Twitter/GNU Social API Functions](help/api) (EN)
|
||||||
* [Translation of Friendica](help/translations) (EN)
|
* [Translation of Friendica](help/translations) (EN)
|
||||||
|
* [Run tests](help/Tests) (EN)
|
||||||
|
|
||||||
**Externe Ressourcen**
|
**Externe Ressourcen**
|
||||||
|
|
||||||
* [Haupt-Webseite](https://friendi.ca)
|
* [Haupt-Webseite](https://friendi.ca)
|
||||||
* [Deutsches Friendica-Wiki](http://wiki.toktan.org/doku.php)
|
* [Deutsches Friendica-Wiki](https://friendica-wiki.de)
|
||||||
* Support Kanäle
|
* Support Kanäle
|
||||||
* [Friendica Support Forum](https://forum.friendi.ca/~helpers)
|
* [Friendica Support Forum](https://forum.friendi.ca/~helpers)
|
||||||
* [Mailing Listen Archiv](http://mailman.friendi.ca/mailman/listinfo/support-friendi.ca) zum Abonnieren der Liste eine E-Mail an ``support-request(at)friendi.ca?subject=subscribe`` senden
|
* [Mailing Listen Archiv](http://mailman.friendi.ca/mailman/listinfo/support-friendi.ca) zum Abonnieren der Liste eine E-Mail an ``support-request(at)friendi.ca?subject=subscribe`` senden
|
||||||
|
@ -72,4 +73,3 @@ Friendica - Dokumentation und Ressourcen
|
||||||
|
|
||||||
* [Seite/Friendica-Version](friendica)
|
* [Seite/Friendica-Version](friendica)
|
||||||
* [Mitwirkenden bei Friendica](credits)
|
* [Mitwirkenden bei Friendica](credits)
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ Requirements
|
||||||
---
|
---
|
||||||
|
|
||||||
* Apache mit einer aktiverten mod-rewrite-Funktion und dem Eintrag "Options All", so dass du die lokale .htaccess-Datei nutzen kannst
|
* Apache mit einer aktiverten mod-rewrite-Funktion und dem Eintrag "Options All", so dass du die lokale .htaccess-Datei nutzen kannst
|
||||||
* PHP 5.6+ (PHP 7 ist aufgrund der Performance empfohlen)
|
* PHP 5.6.1+ (PHP 7 ist aufgrund der Performance empfohlen)
|
||||||
* PHP *Kommandozeilen*-Zugang mit register_argc_argv auf "true" gesetzt in der php.ini-Datei
|
* PHP *Kommandozeilen*-Zugang mit register_argc_argv auf "true" gesetzt in der php.ini-Datei
|
||||||
* Curl, GD, PDO, MySQLi, xml, zip und OpenSSL-Erweiterung
|
* Curl, GD, PDO, MySQLi, xml, zip und OpenSSL-Erweiterung
|
||||||
* Das POSIX Modul muss aktiviert sein ([CentOS, RHEL](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) haben dies z.B. deaktiviert)
|
* Das POSIX Modul muss aktiviert sein ([CentOS, RHEL](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) haben dies z.B. deaktiviert)
|
||||||
|
@ -47,14 +47,14 @@ Wenn du die Möglichkeit hierzu hast, empfehlen wir dir "git" zu nutzen, um die
|
||||||
Das macht die Aktualisierung wesentlich einfacher.
|
Das macht die Aktualisierung wesentlich einfacher.
|
||||||
Der Linux-Code, mit dem man die Dateien direkt in ein Verzeichnis wie "meinewebseite" kopiert, ist
|
Der Linux-Code, mit dem man die Dateien direkt in ein Verzeichnis wie "meinewebseite" kopiert, ist
|
||||||
|
|
||||||
git clone https://github.com/friendica/friendica.git mywebsite
|
git clone https://github.com/friendica/friendica.git -b master mywebsite
|
||||||
cd mywebsite
|
cd mywebsite
|
||||||
bin/composer.phar install
|
bin/composer.phar install
|
||||||
|
|
||||||
Stelle sicher, dass der Ordner *view/smarty3* existiert and von dem Webserver-Benutzer beschreibbar ist
|
Stelle sicher, dass der Ordner *view/smarty3* existiert and von dem Webserver-Benutzer beschreibbar ist
|
||||||
|
|
||||||
mkdir view/smarty3
|
mkdir view/smarty3
|
||||||
chmod 777 view/smarty3
|
chmod 775 view/smarty3
|
||||||
|
|
||||||
Falls Addons installiert werden sollen: Gehe in den Friendica-Ordner
|
Falls Addons installiert werden sollen: Gehe in den Friendica-Ordner
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ Falls Addons installiert werden sollen: Gehe in den Friendica-Ordner
|
||||||
|
|
||||||
Und die Addon Repository klonst:
|
Und die Addon Repository klonst:
|
||||||
|
|
||||||
git clone https://github.com/friendica/friendica-addons.git addon
|
git clone https://github.com/friendica/friendica-addons.git -b master addon
|
||||||
|
|
||||||
Um das Addon-Verzeichnis aktuell zu halten, solltest du in diesem Pfad ein "git pull"-Befehl eintragen
|
Um das Addon-Verzeichnis aktuell zu halten, solltest du in diesem Pfad ein "git pull"-Befehl eintragen
|
||||||
|
|
||||||
|
@ -71,6 +71,17 @@ Um das Addon-Verzeichnis aktuell zu halten, solltest du in diesem Pfad ein "git
|
||||||
|
|
||||||
Wenn du den Verzeichnispfad auf deinen Webserver kopierst, dann stelle sicher, dass du auch die .htaccess kopierst, da "Punkt"-Dateien oft versteckt sind und normalerweise nicht direkt kopiert werden.
|
Wenn du den Verzeichnispfad auf deinen Webserver kopierst, dann stelle sicher, dass du auch die .htaccess kopierst, da "Punkt"-Dateien oft versteckt sind und normalerweise nicht direkt kopiert werden.
|
||||||
|
|
||||||
|
Wenn du die Entwickler Version von Friendica verwenden möchtest kannst du auf den develop Branch im git Repository wechseln.
|
||||||
|
Dies tust du mit den folgenden Befehlen
|
||||||
|
|
||||||
|
git checkout develop
|
||||||
|
bin/composer.phar install
|
||||||
|
cd addon
|
||||||
|
git checkout develop
|
||||||
|
|
||||||
|
Die Entwickler Version kann nach einem fehlerhaften Commit vorübergehend Probleme haben oder gar nicht mehr funktionieren.
|
||||||
|
Sollte dir so etwas passieren, lass es uns bitte wissen, damit der Fehler behoben werden kann.
|
||||||
|
|
||||||
### Erselle eine Datenbank
|
### Erselle eine Datenbank
|
||||||
|
|
||||||
Erstelle eine leere Datenbank und notiere alle Zugangsdaten (Adresse der Datenbank, Nutzername, Passwort, Datenbankname).
|
Erstelle eine leere Datenbank und notiere alle Zugangsdaten (Adresse der Datenbank, Nutzername, Passwort, Datenbankname).
|
||||||
|
@ -93,37 +104,96 @@ Bitte beachte jeden Fehler und korrigiere diese, bevor du fortfährst.
|
||||||
Falls du einen Port für die Datenbankverbindung angeben musst, kannst du diesen in der Host-Eingabe Zeile angeben.
|
Falls du einen Port für die Datenbankverbindung angeben musst, kannst du diesen in der Host-Eingabe Zeile angeben.
|
||||||
|
|
||||||
*Wenn* die manuelle Installation aus irgendeinem Grund fehlschlägt, dann prüfe das Folgende:
|
*Wenn* die manuelle Installation aus irgendeinem Grund fehlschlägt, dann prüfe das Folgende:
|
||||||
* ".htconfig.php" existiert ... wenn nicht, bearbeite die „htconfig.php“ und ändere die Systemeinstellungen. Benenne sie um in „.htconfig.php".
|
* "config/local.ini.php" existiert ... wenn nicht, bearbeite die „config/local-sample.ini.php“ und ändere die Systemeinstellungen. Benenne sie um in „config/local.ini.php".
|
||||||
* die Datenbank beinhaltet Daten. ... wenn nicht, importiere den Inhalt der Datei "database.sql" mit phpmyadmin oder per mysql-Kommandozeile.
|
* die Datenbank beinhaltet Daten. ... wenn nicht, importiere den Inhalt der Datei "database.sql" mit phpmyadmin oder per mysql-Kommandozeile.
|
||||||
|
|
||||||
Besuche deine Seite an diesem Punkt wieder und registriere deinen persönlichen Account.
|
Besuche deine Seite an diesem Punkt wieder und registriere deinen persönlichen Account.
|
||||||
Alle Registrierungsprobleme sollten automatisch behebbar sein.
|
Alle Registrierungsprobleme sollten automatisch behebbar sein.
|
||||||
Wenn du irgendwelche **kritischen** Fehler zu diesen Zeitpunkt erhalten solltest, deutet das darauf hin, dass die Datenbank nicht korrekt installiert wurde.
|
Wenn du irgendwelche **kritischen** Fehler zu diesen Zeitpunkt erhalten solltest, deutet das darauf hin, dass die Datenbank nicht korrekt installiert wurde.
|
||||||
Du kannst bei Bedarf die Datei .htconfig.php verschieben/umbenennen und die Datenbank leeren (als „Dropping“ bezeichnet), so dass du mit einem sauberen System neu starten kannst.
|
Du kannst bei Bedarf die Datei config/local.ini.php verschieben/umbenennen und die Datenbank leeren (als „Dropping“ bezeichnet), so dass du mit einem sauberen System neu starten kannst.
|
||||||
|
|
||||||
### Option B: Starte das manuelle Installationsscript
|
### Option B: Starte das automatische Installationsscript
|
||||||
|
|
||||||
Öffne die Datei htconfig.php im Friendica-Hauptordner mit einem Text-Editor.
|
Es existieren folgende Varianten zur automatischen Installation von Friendica:
|
||||||
Entferne die `die('...');` Zeile und bearbeite die Einstellungen so, das sie zu deinem System passen (MySQL, Sprache, Theme etc.).
|
- Eine vorgefertigte Konfigurationsdatei erstellen (z.B. `prepared.ini.php`)
|
||||||
Dann speichere die Datei (jedoch nicht umbenennen).
|
- Verwendung von Umgebungsvariablen (z.B. `MYSQL_HOST`)
|
||||||
|
- Verwendung von Optionen (z.B. `--dbhost <host>`)
|
||||||
|
|
||||||
Gehe in den Friendica-Hauptordner und führe den Kommandozeilen Befehl aus:
|
Umgebungsvariablen und Optionen können auch kombiniert werden.
|
||||||
|
Dabei ist jedoch darauf zu achten, dass etwaige Optionen immer die zugehörigen Umgebungsvariablen überschreiben.
|
||||||
bin/console autoinstall
|
|
||||||
|
|
||||||
Oder falls du alle optionalen Checks ausfürehn lassen möchtest, benutze diese Option:
|
|
||||||
|
|
||||||
bin/console autoinstall -a
|
|
||||||
|
|
||||||
*Wenn* die automatisierte Installation aus irgendeinem Grund fehlschlägt, dann prüfe das Folgende:
|
|
||||||
* Existiert die `.htconfig.php`? Falls ja, wird die automatisierte Installation nicht gestartet.
|
|
||||||
* Sind Einstellungen in der `.htconfig.php` korrekt? Falls nicht, bitte bearbeite diese Datei erneut.
|
|
||||||
* Ist die leere MySQL-Datenbank erstellt? Falls nicht, erstelle diese.
|
|
||||||
|
|
||||||
Für mehr Informationen kannst du diese Option verwenden:
|
Für mehr Informationen kannst du diese Option verwenden:
|
||||||
|
|
||||||
bin/console autoinstall -v
|
bin/console autoinstall -v
|
||||||
|
|
||||||
|
Falls du alle optionalen Checks ausfürehn lassen möchtest, benutze diese Option:
|
||||||
|
|
||||||
|
bin/console autoinstall -a
|
||||||
|
|
||||||
|
*Wenn* die automatisierte Installation aus irgendeinem Grund fehlschlägt, dann prüfe das Folgende:
|
||||||
|
* Existiert die `config/local.ini.php`? Falls ja, wird die automatisierte Installation nicht gestartet.
|
||||||
|
* Sind Einstellungen in der `config/local.ini.php` korrekt? Falls nicht, bitte bearbeite diese Datei erneut.
|
||||||
|
* Ist die leere MySQL-Datenbank erstellt? Falls nicht, erstelle diese.
|
||||||
|
|
||||||
|
#### B.1: Konfigurationsdatei
|
||||||
|
|
||||||
|
Für diese Variante muss ein Konfigurationsdatei bereits vor der Installation fertig definiert sein (z.B. [local-sample.ini.php](config/local-sample.ini.php).
|
||||||
|
|
||||||
|
Gehe im Anschluss in den Friendica-Hauptordner und führe den Kommandozeilen Befehl aus:
|
||||||
|
|
||||||
|
bin/console autoinstall -f <prepared.ini.php>
|
||||||
|
|
||||||
|
#### B.2: Umgebungsvariablen
|
||||||
|
|
||||||
|
Es existieren Zwei Arten von Umgebungsvariablen in Friendica:
|
||||||
|
- Jene, die auch im normalen Betrieb verwendet werden können (derzeit ausschließlich **Datenbank Einstellungen**)
|
||||||
|
- Jene, die nur während der Installation verwedent werden können (im normalen Betrieb werden sie ignoriert)
|
||||||
|
|
||||||
|
Umgebungsvariablen können auch durch adäquate Optionen (z.B. `--dbhost <hostname>`)übersteuert werden.
|
||||||
|
|
||||||
|
**Datenbank Einstellungen**
|
||||||
|
|
||||||
|
Nur wenn die Option `--savedb` gesetzt ist, werden diese Umgebungsvariablen auch in `config/local.ini.php` gespeichert!
|
||||||
|
|
||||||
|
- `MYSQL_HOST` Der Host der MySQL/MariaDB Datenbank
|
||||||
|
- `MYSQL_PORT` Der Port der MySQL/MariaDB Datenbank
|
||||||
|
- `MYSQL_USERNAME` Der Benutzername des MySQL Datenbanklogins (MySql - Variante)
|
||||||
|
- `MYSQL_USER` Der Benutzername des MariaDB Datenbanklogins (MariaDB-Variante)
|
||||||
|
- `MYSQL_PASSWORD` Das Passwort der MySQL/MariaDB Datenbanklogins
|
||||||
|
- `MYSQL_DATABASE` Der Name der MySQL/MariaDB Datenbank
|
||||||
|
|
||||||
|
**Friendica Einstellungen**
|
||||||
|
|
||||||
|
Diese Umgebungsvariablen können nicht während des normalen Friendica Betriebs verwendet werden.
|
||||||
|
Sie werden stattdessen direkt in `config/local.ini.php` gespeichert.
|
||||||
|
|
||||||
|
- `FRIENDICA_PHP_PATH` Der Pfad zur PHP-Datei
|
||||||
|
- `FRIENDICA_ADMIN_MAIL` Die Admin E-Mail Adresse dieses Friendica Knotens (wird auch für den Admin-Zugang benötigt)
|
||||||
|
- `FRIENDICA_TZ` Die Zeitzone von Friendica
|
||||||
|
- `FRIENDICA_LANG` Die Sprache von Friendica
|
||||||
|
|
||||||
|
Gehe im Anschluss in den Friendica-Hauptordner und führe den Kommandozeilen Befehl aus:
|
||||||
|
|
||||||
|
bin/console autoinstall [--savedb]
|
||||||
|
|
||||||
|
#### B.3: Optionen
|
||||||
|
|
||||||
|
Alle Optionen werden in `config/local.ini.php` gespeichert und überschreiben etwaige, zugehörige Umgebungsvariablen.
|
||||||
|
|
||||||
|
- `-H|--dbhost <host>` Der Host der MySQL/MariaDB Datenbank (env `MYSQL_HOST`)
|
||||||
|
- `-p|--dbport <port>` Der Port der MySQL/MariaDB Datenbank (env `MYSQL_PORT`)
|
||||||
|
- `-U|--dbuser <username>` Der Benutzername des MySQL/MariaDB Datenbanklogins (env `MYSQL_USER` or `MYSQL_USERNAME`)
|
||||||
|
- `-P|--dbpass <password>` Das Passwort der MySQL/MariaDB Datenbanklogins (env `MYSQL_PASSWORD`)
|
||||||
|
- `-d|--dbdata <database>` Der Name der MySQL/MariaDB Datenbank (env `MYSQL_DATABASE`)
|
||||||
|
- `-b|--phppath <path>` Der Pfad zur PHP-Datei (env `FRIENDICA_PHP_PATH`)
|
||||||
|
- `-A|--admin <mail>` Die Admin E-Mail Adresse dieses Friendica Knotens (env `FRIENDICA_ADMIN_MAIL`)
|
||||||
|
- `-T|--tz <timezone>` Die Zeitzone von Friendica (env `FRIENDICA_TZ`)
|
||||||
|
- `-L|--land <language>` Die Sprache von Friendica (env `FRIENDICA_LANG`)
|
||||||
|
|
||||||
|
Gehe in den Friendica-Hauptordner und führe den Kommandozeilen Befehl aus:
|
||||||
|
|
||||||
|
bin/console autoinstall [options]
|
||||||
|
|
||||||
### Einen Worker einrichten
|
### Einen Worker einrichten
|
||||||
|
|
||||||
Erstelle einen Cron job oder einen regelmäßigen Task, um den Poller alle 5-10 Minuten im Hintergrund ablaufen zu lassen.
|
Erstelle einen Cron job oder einen regelmäßigen Task, um den Poller alle 5-10 Minuten im Hintergrund ablaufen zu lassen.
|
||||||
|
@ -149,5 +219,5 @@ Es werden schlimme Dinge geschehen.
|
||||||
Sei es nun ein Hardwareversagen oder eine kaputte Datenbank.
|
Sei es nun ein Hardwareversagen oder eine kaputte Datenbank.
|
||||||
Deshalb solltest du dir, nachdem die Installation deines Friendica Knotens abgeschlossen ist, einen Backup Plan erstellen.
|
Deshalb solltest du dir, nachdem die Installation deines Friendica Knotens abgeschlossen ist, einen Backup Plan erstellen.
|
||||||
|
|
||||||
Die wichtigste Datei ist die `.htconfig.php` im Stammverzeichnis deiner Friendica Installation.
|
Die wichtigste Datei ist die `config/local.ini.php` im Stammverzeichnis deiner Friendica Installation.
|
||||||
Und da alle Daten in der Datenbank gespeichert werden, solltest du einen nicht all zu alten Dump der Friendica Datenbank zur Hand haben, solltest du deinen Knoten wieder herstellen müssen.
|
Und da alle Daten in der Datenbank gespeichert werden, solltest du einen nicht all zu alten Dump der Friendica Datenbank zur Hand haben, solltest du deinen Knoten wieder herstellen müssen.
|
||||||
|
|
|
@ -18,7 +18,7 @@ Erweiterung müssen vom Administrator installiert werden, bevor sie genutzt werd
|
||||||
Dieses kann über das Administrationsmenü erstellt werden.
|
Dieses kann über das Administrationsmenü erstellt werden.
|
||||||
|
|
||||||
Jeder der Konnektoren benötigt zudem einen API-Schlüssel vom Service, der verbunden werden soll.
|
Jeder der Konnektoren benötigt zudem einen API-Schlüssel vom Service, der verbunden werden soll.
|
||||||
Einige Erweiterung erlaube es, diese Informationen auf den Administrationsseiten einzustellen, wohingegen andere eine direkte Bearbeitung der Konfigurationsdatei ".htconfig.php" erfordern.
|
Einige Erweiterung erlaube es, diese Informationen auf den Administrationsseiten einzustellen, wohingegen andere eine direkte Bearbeitung der Konfigurationsdatei "config/local.ini.php" erfordern.
|
||||||
Der Weg, um diese Schlüssel zu erhalten, variiert stark, jedoch brauchen fast alle einen bestehenden Account im gewünschten Service.
|
Der Weg, um diese Schlüssel zu erhalten, variiert stark, jedoch brauchen fast alle einen bestehenden Account im gewünschten Service.
|
||||||
Einmal installiert, können diese Schlüssel von allen Seitennutzern genutzt werden.
|
Einmal installiert, können diese Schlüssel von allen Seitennutzern genutzt werden.
|
||||||
|
|
||||||
|
@ -37,11 +37,12 @@ Um dieses Erweiterung zu nutzen, benötigst du einen OAuth Consumer-Schlüsselpa
|
||||||
|
|
||||||
Registriere deine Friendica-Seite als "Client"-Anwendung mit "Read&Write"-Zugriff. Wir benötigen "Twitter als Login" nicht. Sobald du deine Anwendung installiert hast, erhältst du das Schlüsselpaar für deine Seite.
|
Registriere deine Friendica-Seite als "Client"-Anwendung mit "Read&Write"-Zugriff. Wir benötigen "Twitter als Login" nicht. Sobald du deine Anwendung installiert hast, erhältst du das Schlüsselpaar für deine Seite.
|
||||||
|
|
||||||
Trage dieses Schlüsselpaar in deine globale ".htconfig.php"-Datei ein.
|
Trage dieses Schlüsselpaar in deine globale "config/local.ini.php"-Datei ein.
|
||||||
|
|
||||||
```
|
```
|
||||||
$a->config['twitter']['consumerkey'] = 'your consumer_key here';
|
[twitter]
|
||||||
$a->config['twitter']['consumersecret'] = 'your consumer_secret here';
|
consumerkey = your consumer_key here
|
||||||
|
consumersecret = your consumer_secret here
|
||||||
```
|
```
|
||||||
|
|
||||||
Anschließend kann der Nutzer deiner Seite die Twitter-Einstellungen selbst eintragen: "Einstellungen -> Connector Einstellungen".
|
Anschließend kann der Nutzer deiner Seite die Twitter-Einstellungen selbst eintragen: "Einstellungen -> Connector Einstellungen".
|
||||||
|
|
|
@ -17,6 +17,10 @@ Außerdem enthält sie deinen geheimen Schlüssel mit dem du dich deinen Kontakt
|
||||||
|
|
||||||
Rufe nun dem neuen Server die Seite *http://newserver.com/uimport* auf (es gibt derzeit keinen direkten Link auf diese Seite).
|
Rufe nun dem neuen Server die Seite *http://newserver.com/uimport* auf (es gibt derzeit keinen direkten Link auf diese Seite).
|
||||||
|
|
||||||
|
Bitte beachte, dass dies nur auf Servern möglich ist, an denen man sich offen anmelden kann.
|
||||||
|
Bei Servern, bei denen der Administrator Accounts freigeben muss, ist das Hochladen nicht möglich.
|
||||||
|
Hier kann dies nur der Administrator selber durchführen.
|
||||||
|
|
||||||
Lege auf dem neuen Server auf keinen Fall einen gleichnamigen Account an!
|
Lege auf dem neuen Server auf keinen Fall einen gleichnamigen Account an!
|
||||||
uimport muss anstelle des Registrierens verwendet werden.
|
uimport muss anstelle des Registrierens verwendet werden.
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ Dabei kannst du zwischen den folgenden Optionen wählen:
|
||||||
##### Einladungen
|
##### Einladungen
|
||||||
|
|
||||||
Zusätzlich zu den oben genannten Möglichkeiten, kann die Registrierung eines neuen Nutzerkontos an eine Einladung durch einen bestehenden Nutzer gekoppelt werden.
|
Zusätzlich zu den oben genannten Möglichkeiten, kann die Registrierung eines neuen Nutzerkontos an eine Einladung durch einen bestehenden Nutzer gekoppelt werden.
|
||||||
Hierzu muss in der [.htconfig.php](/help/htconfig) Datei die Option `invitation_only` aktiviert und als Registrierungsmethode entweder *Offen* oder *Bedarf der Zustimmung* gewählt werden.
|
Hierzu muss in der [config/local.ini.php](/help/Config) Datei die Option `invitation_only` aktiviert und als Registrierungsmethode entweder *Offen* oder *Bedarf der Zustimmung* gewählt werden.
|
||||||
|
|
||||||
#### Namen auf Vollständigkeit überprüfen
|
#### Namen auf Vollständigkeit überprüfen
|
||||||
|
|
||||||
|
@ -156,6 +156,14 @@ Außerdem könnte es durch Nutzer als Spam Verteiler missbraucht werden.
|
||||||
Als Administrator der Friendica-Instanz kannst du diese Einstellungen ansonsten nur direkt in der Datenbank vornehmen.
|
Als Administrator der Friendica-Instanz kannst du diese Einstellungen ansonsten nur direkt in der Datenbank vornehmen.
|
||||||
Bevor du das tust solltest du sicherstellen, dass du ein Backup der Datenbank hast und genau weißt was die Änderungen an der Datenbank bewirken, die du vornehmen willst.
|
Bevor du das tust solltest du sicherstellen, dass du ein Backup der Datenbank hast und genau weißt was die Änderungen an der Datenbank bewirken, die du vornehmen willst.
|
||||||
|
|
||||||
|
#### Explizite Inhalte
|
||||||
|
|
||||||
|
Wenn Sie einen Knoten mit explizitem, nicht jugendfreien Inhalt betreiben, können Sie dies mit dieser Option ankündigen.
|
||||||
|
Ist diese Option aktiviert, wird ein Informationsflag in den veröffentlichten Informationen zu Ihrem Knoten gesetzt.
|
||||||
|
(Sollte *Server Informationen veröffentlichen* aktiviert sein.)
|
||||||
|
|
||||||
|
Zusätzlich wird auf der Registrierungsseite für neue Benutzer ein Hinweis angezeigt.
|
||||||
|
|
||||||
### Erweitert
|
### Erweitert
|
||||||
|
|
||||||
#### Proxy Einstellungen
|
#### Proxy Einstellungen
|
||||||
|
@ -305,7 +313,7 @@ Du solltest deshalb einen Dienst zur [log rotation](https://en.wikipedia.org/wik
|
||||||
**Bekannte Probleme**: Der Dateiname `friendica.log` kann bei speziellen Server Konfigurationen zu Problemen führen (siehe [issue 2209](https://github.com/friendica/friendica/issues/2209)).
|
**Bekannte Probleme**: Der Dateiname `friendica.log` kann bei speziellen Server Konfigurationen zu Problemen führen (siehe [issue 2209](https://github.com/friendica/friendica/issues/2209)).
|
||||||
|
|
||||||
Normalerweise werden Fehler- und Warnmeldungen von PHP unterdrückt.
|
Normalerweise werden Fehler- und Warnmeldungen von PHP unterdrückt.
|
||||||
Wenn du sie aktivieren willst, musst du folgendes in der `.htconfig.php` Datei eintragen um die Meldungen in die Datei `php.out` zu speichern
|
Wenn du sie aktivieren willst, musst du folgendes in der `config/local.ini.php` Datei eintragen um die Meldungen in die Datei `php.out` zu speichern
|
||||||
|
|
||||||
error_reporting(E_ERROR | E_WARNING | E_PARSE );
|
error_reporting(E_ERROR | E_WARNING | E_PARSE );
|
||||||
ini_set('error_log','php.out');
|
ini_set('error_log','php.out');
|
||||||
|
@ -344,6 +352,14 @@ Mit den folgenden Einstellungen kannst du die Zugriffsdaten für den Datenbank S
|
||||||
$db_pass = 'db_password';
|
$db_pass = 'db_password';
|
||||||
$db_data = 'database_name';
|
$db_data = 'database_name';
|
||||||
|
|
||||||
|
Sollten alle der folgenden Environment-Variablen gesetzt sein, wird Friendica diese anstatt der vorher konfigurierten Werte nutzen.
|
||||||
|
|
||||||
|
MYSQL_HOST
|
||||||
|
MYSQL_PORT
|
||||||
|
MYSQL_USERNAME
|
||||||
|
MYSQL_PASSWORD
|
||||||
|
MYSQL_DATABASE
|
||||||
|
|
||||||
## Administratoren
|
## Administratoren
|
||||||
|
|
||||||
Du kannst einen, oder mehrere Accounts, zu Administratoren machen.
|
Du kannst einen, oder mehrere Accounts, zu Administratoren machen.
|
||||||
|
@ -351,14 +367,16 @@ Normalerweise trifft dies auf den ersten Account zu, der nach der Installation a
|
||||||
Die Liste der E-Mail Adressen kann aber einfach erweitert werden.
|
Die Liste der E-Mail Adressen kann aber einfach erweitert werden.
|
||||||
Mit keiner der angegebenen E-Mail Adressen können weitere Accounts registriert werden.
|
Mit keiner der angegebenen E-Mail Adressen können weitere Accounts registriert werden.
|
||||||
|
|
||||||
$a->config['admin_email'] = 'you@example.com, buddy@example.com';
|
[config]
|
||||||
|
admin_email = you@example.com, buddy@example.com
|
||||||
|
|
||||||
## PHP Pfad
|
## PHP Pfad
|
||||||
|
|
||||||
Einige Prozesse von Friendica laufen im Hintergrund.
|
Einige Prozesse von Friendica laufen im Hintergrund.
|
||||||
Für diese Prozesse muss der Pfad zu der PHP Version gesetzt sein, die verwendet werden soll.
|
Für diese Prozesse muss der Pfad zu der PHP Version gesetzt sein, die verwendet werden soll.
|
||||||
|
|
||||||
$a->config['php_path'] = '/pfad/zur/php-version';
|
[config]
|
||||||
|
php_path = {{$phpath}}
|
||||||
|
|
||||||
## Unterverzeichnis Konfiguration
|
## Unterverzeichnis Konfiguration
|
||||||
|
|
||||||
|
@ -366,9 +384,10 @@ Man kann Friendica in ein Unterverzeichnis des Webservers installieren.
|
||||||
Wir raten allerdings dringen davon ab, da es die Interoperabilität mit anderen Netzwerken (z.B. Diaspora, GNU Social, Hubzilla) verhindert.
|
Wir raten allerdings dringen davon ab, da es die Interoperabilität mit anderen Netzwerken (z.B. Diaspora, GNU Social, Hubzilla) verhindert.
|
||||||
Mal angenommen, du hast ein Unterverzeichnis tests und willst Friendica in ein weiteres Unterverzeichnis installieren, dann lautet die Konfiguration hierfür:
|
Mal angenommen, du hast ein Unterverzeichnis tests und willst Friendica in ein weiteres Unterverzeichnis installieren, dann lautet die Konfiguration hierfür:
|
||||||
|
|
||||||
$a->path = 'tests/friendica';
|
[system]
|
||||||
|
urlpath = tests/friendica
|
||||||
|
|
||||||
## Weitere Ausnahmen
|
## Weitere Ausnahmen
|
||||||
|
|
||||||
Es gibt noch einige experimentelle Einstellungen, die nur in der ``.htconfig.php`` Datei konfiguriert werden können.
|
Es gibt noch einige experimentelle Einstellungen, die nur in der ``config/local.ini.php`` Datei konfiguriert werden können.
|
||||||
Im [Konfigurationswerte, die nur in der .htconfig.php gesetzt werden können (EN)](help/htconfig) Artikel kannst du mehr darüber erfahren.
|
Im [Konfigurationswerte, die nur in der config/local.ini.php gesetzt werden können (EN)](help/Config) Artikel kannst du mehr darüber erfahren.
|
||||||
|
|
126
doc/htconfig.md
|
@ -1,126 +0,0 @@
|
||||||
Config values that can only be set in .htconfig.php
|
|
||||||
===================================================
|
|
||||||
|
|
||||||
* [Home](help)
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
The header of the section describes the category, the value is the parameter.
|
|
||||||
Example: To set the automatic database cleanup process add this line to your .htconfig.php:
|
|
||||||
|
|
||||||
$a->config['system']['always_show_preview'] = true;
|
|
||||||
|
|
||||||
## jabber ##
|
|
||||||
* **debug** (Boolean) - Enable debug level for the jabber account synchronisation.
|
|
||||||
* **lockpath** - Must be writable by the ejabberd process. if set then it will prevent the running of multiple processes.
|
|
||||||
|
|
||||||
## system ##
|
|
||||||
|
|
||||||
* **allowed_link_protocols** (Array) - Allowed protocols in links URLs, add at your own risk. http is always allowed.
|
|
||||||
* **always_show_preview** (Boolean) - Only show small preview picures. Default value is false.
|
|
||||||
* **archival_days** (Integer) - Number of days that we try to deliver content before we archive a contact. Defaults to 32.
|
|
||||||
* **auth_cookie_lifetime** (Integer) - Number of days that should pass without any activity before a user who chose "Remember me" when logging in is considered logged out. Defaults to 7.
|
|
||||||
* **block_local_dir** (Boolean) - Blocks the access to the directory of the local users.
|
|
||||||
* **config_adapter** (jit|preload) - Allow to switch the configuration adapter to improve performances at the cost of memory consumption. Default value is "jit"
|
|
||||||
* **curl_range_bytes** - Maximum number of bytes that should be fetched. Default is 0, which mean "no limit".
|
|
||||||
* **db_log** - Name of a logfile to log slow database queries
|
|
||||||
* **db_loglimit** - If a database call lasts longer than this value it is logged
|
|
||||||
* **db_log_index** - Name of a logfile to log queries with bad indexes
|
|
||||||
* **db_log_index_watch** - Watchlist of indexes to watch
|
|
||||||
* **db_loglimit_index** - Number of index rows needed to be logged for indexes on the watchlist
|
|
||||||
* **db_loglimit_index_high** - Number of index rows to be logged anyway (for any index)
|
|
||||||
* **db_log_index_blacklist** - Blacklist of indexes that shouldn't be watched
|
|
||||||
* **diaspora_test** (Boolean) - For development only. Disables the message transfer.
|
|
||||||
* **disable_email_validation** (Boolean) - Disables the check if a mail address is in a valid format and can be resolved via DNS.
|
|
||||||
* **disable_url_validation** (Boolean) - Disables the DNS lookup of an URL.
|
|
||||||
* **disable_password_exposed** (Boolean) - Disable the exposition check against the remote haveibeenpwned API on password change. Default value is false.
|
|
||||||
* **dlogfile - location of the developer log file
|
|
||||||
* **dlogip - restricts develop log writes to requests originating from this IP address
|
|
||||||
* **frontend_worker_timeout** - Value in minutes after we think that a frontend task was killed by the webserver. Default value is 10.
|
|
||||||
* **hsts** (Boolean) - Enables the sending of HTTP Strict Transport Security headers
|
|
||||||
* **ignore_cache** (Boolean) - For development only. Disables the item cache.
|
|
||||||
* **instances_social_key** - Key to the API of https://instances.social which retrieves data about mastodon servers. See https://instances.social/api/token to get an API key.
|
|
||||||
* **ipv4_resolve** (Boolean) - Resolve IPV4 addresses only. Don't resolve to IPV6. Default value is false.
|
|
||||||
* **invitation_only** (Boolean) - If set true registration is only possible after a current member of the node has send an invitation. Default is false.
|
|
||||||
* **like_no_comment** (Boolean) - Don't update the "commented" value of an item when it is liked.
|
|
||||||
* **local_block** (Boolean) - Used in conjunction with "block_public".
|
|
||||||
* **local_search** (Boolean) - Blocks search for users who are not logged in to prevent crawlers from blocking your system.
|
|
||||||
* **local_tags** (Boolean) - If activated, all hashtags will point to the local server.
|
|
||||||
* **max_connections** - The maximum number of database connections which can be in use before the worker process is deferred to it's next interval. When the system can't detect the maximum numbers of connection then this value can be used.
|
|
||||||
* **max_connections_level** - The maximum level of connections that are allowed to let the worker start. It is a percentage value. Default value is 75.
|
|
||||||
* **max_contact_queue** - Default value is 500.
|
|
||||||
* **max_batch_queue** - Default value is 1000.
|
|
||||||
* **max_processes_backend** - Maximum number of concurrent database processes for background tasks. Default value is 5.
|
|
||||||
* **max_processes_frontend** - Maximum number of concurrent database processes for foreground tasks. Default value is 20.
|
|
||||||
* **min_poll_interval** - minimal distance in minutes between two polls for a contact. Default is 1. Reasonable values are between 1 and 59.
|
|
||||||
* **session_handler** (database|cache|native) - Whether to use Cache to store session data or to use PHP native session storage. Default value is `database`.
|
|
||||||
* **cache_driver** (database|memcache|memcached) - Whether to use Memcache or Memcached to store temporary cache. Default value is `database`.
|
|
||||||
* **memcache_host** - Host name of the memcache daemon. Default is '127.0.0.1'.
|
|
||||||
* **memcache_port** - Port number of the memcache daemon. Default is 11211.
|
|
||||||
* **memcached_hosts** - Array of Memcached servers info `[host, port(, weight)]`. Default value is `[['127.0.0.1', 11211]]`.
|
|
||||||
* **no_count** (Boolean) - Don't do count calculations (currently only when showing albums)
|
|
||||||
* **no_oembed** (Boolean) - Don't use OEmbed to fetch more information about a link.
|
|
||||||
* **no_smilies** (Boolean) - Don't show smilies.
|
|
||||||
* **no_view_full_size** (Boolean) - Don't add the link "View full size" under a resized image.
|
|
||||||
* **optimize_items** (Boolean) - Triggers an SQL command to optimize the item table before expiring items.
|
|
||||||
* **ostatus_poll_timeframe** - Defines how old an item can be to try to complete the conversation with it.
|
|
||||||
* **paranoia** (Boolean) - Log out users if their IP address changed.
|
|
||||||
* **permit_crawling** (Boolean) - Restricts the search for not logged in users to one search per minute.
|
|
||||||
* **queue_no_dead_check** (Boolean) - Ignore if the target contact or server seems to be dead during queue delivery.
|
|
||||||
* **worker_debug** (Boolean) - If enabled, it prints out the number of running processes split by priority.
|
|
||||||
* **worker_fetch_limit** - Number of worker tasks that are fetched in a single query. Default is 1.
|
|
||||||
* **profiler** (Boolean) - Enable internal timings to help optimize code. Needed for "rendertime" addon. Default is false.
|
|
||||||
* **free_crawls** - Number of "free" searches when "permit_crawling" is activated (Default value is 10)
|
|
||||||
* **crawl_permit_period** - Period in seconds between allowed searches when the number of free searches is reached and "permit_crawling" is activated (Default value is 60)
|
|
||||||
* **png_quality** - Default value is 8.
|
|
||||||
* **proc_windows** (Boolean) - Should be enabled if Friendica is running under Windows.
|
|
||||||
* **proxy_cache_time** - Time after which the cache is cleared. Default value is one day.
|
|
||||||
* **pushpoll_frequency** -
|
|
||||||
* **qsearch_limit** - Default value is 100.
|
|
||||||
* **remove_multiplicated_lines** (Boolean) - If enabled, multiple linefeeds in items are stripped to a single one.
|
|
||||||
* **show_unsupported_addons** (Boolean) - Show all addons including the unsupported ones.
|
|
||||||
* **show_unsupported_themes** (Boolean) - Show all themes including the unsupported ones.
|
|
||||||
* **show_global_community_hint** (Boolean) - When the global community page is enabled, use this option to display a hint above the stream, that this is a collection of all public top-level postings that arrive on your node.
|
|
||||||
* **throttle_limit_day** - Maximum number of posts that a user can send per day with the API.
|
|
||||||
* **throttle_limit_week** - Maximum number of posts that a user can send per week with the API.
|
|
||||||
* **throttle_limit_month** - Maximum number of posts that a user can send per month with the API.
|
|
||||||
* **wall-to-wall_share** (Boolean) - Displays forwarded posts like "wall-to-wall" posts.
|
|
||||||
* **worker_cooldown** - Cooldown time after each worker function call. Default value is 0 seconds.
|
|
||||||
* **xrd_timeout** - Timeout for fetching the XRD links. Default value is 20 seconds.
|
|
||||||
|
|
||||||
## experimental ##
|
|
||||||
|
|
||||||
* **exp_themes** (Boolean) - Show experimental themes as well.
|
|
||||||
|
|
||||||
## theme ##
|
|
||||||
|
|
||||||
* **hide_eventlist** (Boolean) - Don't show the birthdays and events on the profile and network page
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
$a->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 .htconfig file.
|
|
||||||
If more then one account should be able to access the admin panel, seperate the email addresses with a comma.
|
|
||||||
|
|
||||||
$a->config['admin_email'] = "someone@example.com,someonelese@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.
|
|
||||||
|
|
||||||
$a->config['admin_name'] = "Marvin";
|
|
||||||
|
|
||||||
## Database Settings
|
|
||||||
|
|
||||||
The configuration variables db_host, db_user, db_pass and db_data 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 db_host variable.
|
|
||||||
|
|
||||||
$db_host = 'your.mysqlhost.com:123456';
|
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 895 B After Width: | Height: | Size: 596 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 806 B After Width: | Height: | Size: 796 B |
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 448 B |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 452 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 483 B |
Before Width: | Height: | Size: 739 B After Width: | Height: | Size: 560 B |
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 612 B After Width: | Height: | Size: 482 B |
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 489 B |
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 484 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 629 B After Width: | Height: | Size: 503 B |
112
htconfig.php
|
@ -1,112 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
// If automatic system installation fails:
|
|
||||||
|
|
||||||
|
|
||||||
die('The configuration you did manually contains some mistakes. Please have a look at your .htconfig.php file.');
|
|
||||||
// If you are doing the configuration manually, please remove the line above
|
|
||||||
|
|
||||||
|
|
||||||
// Copy or rename this file to .htconfig.php
|
|
||||||
|
|
||||||
// Why .htconfig.php? Because it contains sensitive information which could
|
|
||||||
// give somebody complete control of your database. Apache's default
|
|
||||||
// configuration denies access to and refuses to serve any file beginning
|
|
||||||
// with .ht
|
|
||||||
|
|
||||||
// Then set the following for your MySQL installation
|
|
||||||
|
|
||||||
$db_host = 'your.mysqlhost.com';
|
|
||||||
$db_user = 'mysqlusername';
|
|
||||||
$db_pass = 'mysqlpassword';
|
|
||||||
$db_data = 'mysqldatabasename';
|
|
||||||
|
|
||||||
// Use environment variables for mysql if they are set beforehand
|
|
||||||
if (!empty(getenv('MYSQL_HOST'))
|
|
||||||
&& !empty(getenv('MYSQL_PORT'))
|
|
||||||
&& (!empty(getenv('MYSQL_USERNAME')) || !empty(getenv('MYSQL_USER')))
|
|
||||||
&& !empty(getenv('MYSQL_PASSWORD'))
|
|
||||||
&& !empty(getenv('MYSQL_DATABASE'))) {
|
|
||||||
$db_host = getenv('MYSQL_HOST') . ':' . getenv('MYSQL_PORT');
|
|
||||||
if (!empty(getenv('MYSQL_USERNAME'))) {
|
|
||||||
$db_user = getenv('MYSQL_USERNAME');
|
|
||||||
} elseif (!empty(getenv('MYSQL_USER'))) {
|
|
||||||
$db_user = getenv('MYSQL_USER');
|
|
||||||
}
|
|
||||||
$db_pass = getenv('MYSQL_PASSWORD');
|
|
||||||
$db_data = getenv('MYSQL_DATABASE');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the database connection charset to full Unicode (utf8mb4).
|
|
||||||
// Changing this value will likely corrupt the special characters.
|
|
||||||
// You have been warned.
|
|
||||||
$a->config['system']['db_charset'] = "utf8mb4";
|
|
||||||
|
|
||||||
// Choose a legal default timezone. If you are unsure, use "America/Los_Angeles".
|
|
||||||
// It can be changed later and only applies to timestamps for anonymous viewers.
|
|
||||||
|
|
||||||
$default_timezone = 'America/Los_Angeles';
|
|
||||||
|
|
||||||
// Default system language
|
|
||||||
|
|
||||||
$a->config['system']['language'] = 'en';
|
|
||||||
|
|
||||||
// What is your site name?
|
|
||||||
|
|
||||||
$a->config['sitename'] = "Friendica Social Network";
|
|
||||||
|
|
||||||
// Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED.
|
|
||||||
// Be certain to create your own personal account before setting
|
|
||||||
// REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on
|
|
||||||
// the registration page. REGISTER_APPROVE requires you set 'admin_email'
|
|
||||||
// to the email address of an already registered person who can authorise
|
|
||||||
// and/or approve/deny the request.
|
|
||||||
|
|
||||||
// In order to perform system administration via the admin panel, admin_email
|
|
||||||
// must precisely match the email address of the person logged in.
|
|
||||||
|
|
||||||
$a->config['register_policy'] = REGISTER_OPEN;
|
|
||||||
$a->config['register_text'] = '';
|
|
||||||
$a->config['admin_email'] = '';
|
|
||||||
|
|
||||||
// Maximum size of an imported message, 0 is unlimited
|
|
||||||
|
|
||||||
$a->config['max_import_size'] = 200000;
|
|
||||||
|
|
||||||
// maximum size of uploaded photos
|
|
||||||
|
|
||||||
$a->config['system']['maximagesize'] = 800000;
|
|
||||||
|
|
||||||
// Location of PHP command line processor
|
|
||||||
|
|
||||||
$a->config['php_path'] = 'php';
|
|
||||||
|
|
||||||
// Server-to-server private message encryption (RINO) is allowed by default.
|
|
||||||
// set to 0 to disable, 1 to enable
|
|
||||||
|
|
||||||
$a->config['system']['rino_encrypt'] = 1;
|
|
||||||
|
|
||||||
// allowed themes (change this from admin panel after installation)
|
|
||||||
|
|
||||||
$a->config['system']['allowed_themes'] = 'quattro,vier,duepuntozero,smoothly';
|
|
||||||
|
|
||||||
// default system theme
|
|
||||||
|
|
||||||
$a->config['system']['theme'] = 'vier';
|
|
||||||
|
|
||||||
|
|
||||||
// By default allow pseudonyms
|
|
||||||
|
|
||||||
$a->config['system']['no_regfullname'] = true;
|
|
||||||
|
|
||||||
//Deny public access to the local directory
|
|
||||||
//$a->config['system']['block_local_dir'] = false;
|
|
||||||
|
|
||||||
// Location of the global directory
|
|
||||||
$a->config['system']['directory'] = 'https://dir.friendica.social';
|
|
||||||
|
|
||||||
// Allowed protocols in link URLs; HTTP protocols always are accepted
|
|
||||||
$a->config['system']['allowed_link_protocols'] = ['ftp', 'ftps', 'mailto', 'cid', 'gopher'];
|
|
||||||
|
|
||||||
// Authentication cookie lifetime, in days
|
|
||||||
$a->config['system']['auth_cookie_lifetime'] = 7;
|
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 5.0 KiB |
BIN
images/blank.png
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 346 B After Width: | Height: | Size: 325 B |
Before Width: | Height: | Size: 490 B After Width: | Height: | Size: 469 B |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 5.7 KiB |
BIN
images/icons.png
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 470 B After Width: | Height: | Size: 465 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 388 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 483 B |
Before Width: | Height: | Size: 420 B After Width: | Height: | Size: 406 B |
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 464 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 698 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 496 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 513 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 501 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 570 B |
Before Width: | Height: | Size: 667 B After Width: | Height: | Size: 664 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 735 B |