diff --git a/.codecov.yml b/.codecov.yml index 4592266d81..0c54747c95 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,36 +1,14 @@ codecov: branch: develop - -comment: off + ci: + - drone.friendi.ca coverage: + precision: 2 + round: down + range: "70...100" status: - patch: - default: off - source: - target: 80% - flags: source - backend: - target: 80% - flags: backend - project: - default: off - source: - flags: source - backend: - flags: backend + project: off + patch: off -flags: - source: - paths: - - src/ - backend: - paths: - - mod/ - - include/ - binary: - paths: - - bin/ - tests: - paths: - - tests/ +comment: off diff --git a/.gitignore b/.gitignore index 0d18ab0bdc..2d8acf0160 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,11 @@ favicon.* -.htconfig.php -.htpreconfig.php +/.htconfig.php +/.htpreconfig.php \#* *.log *.out *.version* home.html - *~ robots.txt @@ -34,6 +33,9 @@ report/ #ignore NetBeans IDE's private files (at least) /nbproject/private/ +Ignore config files from VSCode +/.vscode/ + #ignore smarty cache /view/smarty3/compiled/ @@ -74,3 +76,6 @@ venv/ #ignore filesystem storage default path /storage + +#Ignore log folder +/log diff --git a/.travis.yml b/.travis.yml index c66457325f..5e4c3483b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,10 @@ php: services: - mysql - - redis-server + - redis - memcached env: - - MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_USERNAME=travis MYSQL_PASSWORD= MYSQL_DATABASE=test + - MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_USERNAME=travis MYSQL_PASSWORD="" MYSQL_DATABASE=test install: - composer install @@ -19,6 +19,13 @@ before_script: - cp config/local-sample.config.php config/local.config.php - mysql -e 'CREATE DATABASE IF NOT EXISTS test;' - mysql -utravis test < database.sql - - echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - pecl channel-update pecl.php.net + - pecl config-set preferred_state beta + - phpenv config-add .travis/redis.ini + - phpenv config-add .travis/memcached.ini + +script: + - vendor/bin/parallel-lint --exclude vendor/ --exclude view/asset/ . + - vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml + after_success: bash <(curl -s https://codecov.io/bash) diff --git a/.travis/apcu.ini b/.travis/apcu.ini new file mode 100644 index 0000000000..92598662cf --- /dev/null +++ b/.travis/apcu.ini @@ -0,0 +1,4 @@ +extension="apcu.so" + +apc.enabled = 1 +apc.enable_cli = 1 \ No newline at end of file diff --git a/.travis/memcached.ini b/.travis/memcached.ini new file mode 100644 index 0000000000..c9a2ff0c9a --- /dev/null +++ b/.travis/memcached.ini @@ -0,0 +1 @@ +extension="memcached.so" \ No newline at end of file diff --git a/.travis/redis.ini b/.travis/redis.ini new file mode 100644 index 0000000000..ab995b8374 --- /dev/null +++ b/.travis/redis.ini @@ -0,0 +1 @@ +extension="redis.so" \ No newline at end of file diff --git a/CHANGELOG b/CHANGELOG index 01208cbed9..2c5662c2b7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,453 @@ +Version 2020.09 (unreleased) + +Version 2020.07 (2020-07-12) + Friendica Core: + Update to the translations: DE, EN GB, EN US, FR, ET, NL, PL, RU, ZH-CN [translation teams] + Updates to the themes (frio, vier) [MrPetovan] + Updated the shipped composer version, and the dependency list [annando, MrPetovan, tobiasd] + Updates to the documentation [MrPetovan] + General code refactoring and enhancements [AlfredSK, annando, MrPetovan] + Replace charged terms with "allowlist", "denylist" and "blocklist" [MrPetovan] + Enhanced the comment distribution in threads that involve diaspora*, AP and DFRN actors [annando] + Enhanced the profile probing mechanism [annando, MrPetovan] + Enhanced the post update process of the database [annando] + Enhanced the database performance [annando] + Enhanced ActivityPub attachment handling [MrPetovan] + Enhanced security of redirections [annando] + Enhanced database performance [annando] + Enhanced the handling of BBCode [pre] tags [MrPetovan] + Enhanced Markdown to BBCode conversion [MrPetovan] + Enhanced the speed of the network page [annando] + Fixed a problem recognising logins via the API [MrPetovan] + Fixed a problem with handling local diaspora* URLs [MrPetovan] + Fixed a problem with implicit mentions [annando] + Fixed a problem with the password reset token security [lynn-stephenson] + Fixed a problem with receiving non-public posts via ActivityPub [annando] + Fixed a problem with the photo endpoint of the API [MrPetovan] + Fixed a problem with pressing the ESC key in the frio-theme [MrPetovan] + Fixed a problem with the display if post categories [annando] + Fixed a problem with validation of feeds [annando] + Fixed a problem that prevented AP activities being fetched sometimes [annando] + Renamed the -q option of the console user delete command to -y [MrPetovan] + Added notification count to page title [MrPetovan] + Added handling of relative URLs during feed detection [MrPetovan] + Added entities [nupplaphil] + + Friendica Addons: + Update to the translations (EN GB, NB NO, NL, PL, RU, ZH CN) [translation teams] + blockbot: + The list of accepted user agents was enhanced [annando] + Diaspora*: + Enhanced conntector settings [MrPetovan] + PHP Mailer SMTP: + Updated phpmailer version [dependabot] + showmore_dyn: + New addon to collapse long post depending on their actual height [wiwie] + twitter: + Enhaceed the handling of mobile twitter URLs [annando] + Enhanced the handling of quoted tweets [MrPetovan] + added HTML error code handling [MrPetovan] + various: + enhancements to the probe mechanism [MrPetovan] + + Closed Issues: + 3084, 3884, 8287, 8314, 8374, 8400, 8425, 8432, 8458, 8470, 8477, + 8482, 8488, 8489, 8490, 8493, 8495, 8498, 8511, 8517, 8523, 8527, + 8551, 8553, 8560, 8564, 8565, 8568, 8578, 8586, 8593, 8606, 8610, + 8612, 8626, 8664, 8672, 8683, 8685, 8691, 8694, 8702, 8709, 8714, + 8717, 8722, 8726, 8732, 8736, 8743, 8744, 8746, 8756, 8766, 8769, + 8781, 8800, 8807, 8808, 8827, 8829, 8836, 8844, 8846, 8857, 8866 + +Version 2020.03 "Red Hot Poker" (2020-03-30) + Friendica Core: + Updates to the translations (DE, FR, JA, NL, PL, RU, ZH-CN) [translation teams] + Updates to the documentation [AlfredSK, annando, MrPetovan] + Updates to the themes (all) [AlfredSK, annando, MrPetovan, ozero] + General code refactoring and enhancements [annando, MrPetovan, nupplaphil, tobiasd] + Enhanced the performance in several background tasks [annando] + Enhanced the display of contact relations (Twitter) [annando] + Enhanced the permission selection for uploaded photos [annando] + Enhanced the access control during composing a posting [MrPetovan] + Enhanced the accessibility [annando, MrPetovan] + Enhanced the delegation process [annando] + Enhanced the contact management links [annando] + Enhanced the pagination on the community page [MrPetovan] + Enhanced the remote following page [annando] + Enhanced the generated node statistics [AlfredSK] + Enhanced the federation statistics page in the admin panel [annando] + Enhanced the probing mechanism [annando] + Enhanced the federation with Zot [annando] + Enhanced the permission selections for events [MrPetovan] + Enhanced the logging format of the date-time entries [MrPetovan] + Fixed a problem with the uninstalling of addons [annando] + Fixed a problem with the XML escaping in postings [MrPetovan] + Fixed a problem with the Markdown parser [MrPetovan] + Fixed AP federation problems with GNU social [annando] + Fixed AP federation problems with Peertube [annando] + Fixed a problem with the update process of the database [annando] + Fixed problems in the generation of notification emails [nupplaphil] + Fixed a problem with automatic contact approvals [annando] + Fixed a problem with following items [annando] + Fixed the redirection in the photo album after actions there [MrPetovan] + Fixed redirection from notifications for non logged in users [nupplaphil] + Fixed a problem with image permissions in comments [annando] + Fixed a problem leading to random deletion of postings [MrPetovan, SpcCw] + Fixed a problem while transmitting XML in CODE blocks [annando] + All target _blank links now have the rel no-opener no-referrer [MrPetovan] + The "more action" menu in Frio was moved to the action buttons [annando] + Replacement of the "hide_wall" option with more clear options [annando] + Replaced most of all fixed profile field with free form profile fields [MrPetovan] + Removed the "compose on new page" option in Frio [MrPetovan] + Removed multiple profiles in favour of custom profile fields [MrPetovan] + Added an option to hide the dislike reaction [MrPetovan] + Added user group filter to contact listings [MrPetovan] + Added folding to the widgets in the side bar [annando] + Added user management functionality to the Friendica console [nupplaphil] + Added api/friendica/events endpoint to the API [MrPetovan] + Added api/friendica/events endpoint to the API [MrPetovan] + Added custom profile fields [MrPetovan] + Added AP type audio for the federation with Funkwhale [annando] + + Friendica Addons: + Update to the translations (CS, DE, FR, PL, RU, ZH-CN) [translation teams] + General code refactoring and enhancements [AndyHee, annando, MrPetovan, nupplaphil] + blockbot: + Ensure that good agents are allowlisted [valvin1] + markdown: + Addon to use Markdown while composing a posting was added [annando] + showmore: + Functionality is ignored by screen readers [annando] + twitter: + Added fetching of contact relations [annando] + unicode emoticons: + Extended the list of supported emoticons [loma-one] + + Closed Issues: + 4599, 5562, 6205, 6418, 6757, 7558, 7560, 7771, 7808, 7817, 7892, + 7964, 7968, 7978, 7984, 7991, 7992, 7994, 8002, 8008, 8014, 8058, + 8067, 8081, 8084, 8087, 8090, 8097, 8098, 8103, 8136, 8151, 8153, + 8157, 8160, 8164, 8165, 8167, 8172, 8173, 8181, 8182, 8185, 8187, + 8193, 8197, 8205, 8206, 8216, 8219, 8229, 8233, 8234, 8238, 8245, + 8248, 8251, 8252, 8254, 8255, 8264, 8268, 8275, 8280, 8286, 8288, + 8289, 8290, 8299, 8303, 8305, 8310, 8318, 8321, 8338, 8339, 8341, + 8342, 8358, 8371, 8383, 8393, 8396, 8404, 8412, 8417, 8449, 8467 + +Version 2019.12 (2019-12-23) + Friendica Core: + Updates to the translations (CS, DE, ET, JA, NL, PL) [translation teams] + Updates to the documentation [copiis, MrPetovan, stom79, tobiasd] + Updates to the themes (all) [annando, hoergen, MrPetovan, tobiasd] + General code refactoring and enhancements [annando, MrPetovan, nupplaphil, tobiasd] + Enhanced the manage functionality [annando] + Enhanced the federation with ActivityPub and Diaspora* protocol detection and contact requests [annando] + Enhanced federation with pixelfed and peertube [annando] + Enhanced how the API handles quoted postings [annando] + Enhanced the attachment removal by the API [annando] + Enhanced the 2FA field for mobile devices [nupplaphil] + Enhanced handling of re-shares [annando] + Enhanced the ACL dialog [annando, MrPetovan] + Enhanced transmission of postings by email and email handling in general [annando] + Enhanced the updating process of contacts [annando] + Enhanced the import of RSS/Atom feeds [annando] + Enhanced the registration form for require approval setups [tobiasd] + Enhanced the follow process for the Diaspora* protocol [annando] + Enhanced the display of the saved searched [AlfredSK] + Enhanced the display of image titles [annando] + Enhanced the handling of OpenID [annando] + Enhanced the Vagrant devel VM [tobiasd] + Enhanced handling of HTML special entities [nathilia-peirce] + Enhanced hashes by using HMAC [nathilia-peirce] + Enhancements to the ActivityPub implementation [annando] + Fixed a problem with delivery of direct messages over ActivityPub [annando] + Fixed some problems with the remote auth functionality [annando] + Fixed an issue that prevented notifications for deleted postings be deleted themselves [annando] + Fixed a problem connecting to forums [annando] + Fixed messages in the admin panel [nupplaphil] + Fixed a problem when the log-file was not write-able [nupplaphil] + Fixed a problem with the caching directory for the password exposure check [MrPetovan] + Fixed a bug with detecting the browser language [nupplaphil] + Smart threading is now the default, but can be switched off by the user [annando] + Clarification: Posted order is now arrival order [annando] + Added router configuration file [nupplaphil] + Added drone.io as CI service [nupplaphil] + Added the ability to pin postings on account walls [annando] + Added various new API endpoints [annando, MrPetovan] + Added hooks for the email fetching process [annando] + Added support for nodeinfo 2 [annando] + Added export and import of followed contact data [tobiasd] + Added links to tag and category overview in the footer of postings [tobiasd] + Added config switch to use BCC instead of CC for ActivityPub delivery of non-public postings [annando] + + Friendica Addons: + Update to the translations (CA, DE, ET) [translation teams] + buffer + marked as unsupported [annando] + Discourse + New addon to integrate Discourse discussions [annando] + gnot + UI improvements [tobiasd] + js_upload + The addon got rewritten to adopt the new ACL [MrPetovan] + mailstream: + Support for new img format was added [mexon] + BB Code is now included as plaintext [mexon] + Logging format is enhanced [mexon] + ActivityPub "announce" notifications are not included [mexon] + + Closed Issues: + 989, 1071, 1188, 1334, 2537, 3229, 3231, 3385, 4112, 4442, 4451, + 5048, 5568, 5802, 6865, 7190, 7308, 7316, 7418, 7613, 7657, 7659, + 7664, 7671, 7679, 7681, 7682, 7685, 7688, 7691, 7702, 7707, 7709, + 7718, 7733, 7740, 7747, 7756, 7766, 7773, 7776, 7778, 7781, 7821, + 7825, 7834, 7863, 7868, 7880, 7888, 7889, 7902, 7914, 7920, 7946, + 7953, 7978 + +Version 2019.09 (2019-09-29) + Friendica Core: + Update to the translations (CS, DE, EN GB, EN US, FR, JA, NL, PL) [translation teams] + Update to the themes (frio, vier) [JeroenED, MrPetovan, tobiasd, vinzv] + Update to the documentation [annando, tobiasd, guzzisti, vinzv] + Enhanced the log output of the background process [annando] + Enhanced the vcard translation in the profile [JeroenED] + Enhanced the delivery count [annando] + Enhanced ActivityPub envelopes [MrPetovan] + Enhanced communication about deleted accounts via AP [annando] + Enhanced the following process [annando] + Enhanced the tests [nupplaphil] + Enhanced the front-end worker [annando] + Enhanced the img format to allow alternative texts [annando] + Enhanced the detection of supported protocols for contacts [annando] + Enhanced the re-share of items [annando] + Enhanced 2FA process [MrPetovan] + Enhanced server wide theme settings [MrPetovan] + Enhanced config loading process [MrPetovan, nupplaphil] + Enhanced handling of emoticons [MrPetovan] + Enhanced performance [annando] + Fixed a bug in the admin panel leading to orphaned options [tobiasd] + Fixed a problem that could lead to duplicated Pleroma contacts [annando] + Fixed a problem with the hide profile setting [annando] + Fixed the problem sending out the post when hitting the enter key in the ACL dialog [MrPetovan] + Fixed a bug in HTML special character escaping of event titles [MrPetovan] + Fixed a bug in HTML special character conversion in item titles [MrPetovan] + Fixed a bug in the auto linker for URLs [MrPetovan] + Fixed a bug that prevented the display of images in some postings from diaspora* [MrPetovan] + Fixed a bug in setting the permissions on uploaded images [annando] + Fixed a bug that lead to potentially unwanted importing threads started by contacts of contacts [annando] + Fixed implicit self mentions [MrPetovan] + Fixed display of register links on closed nodes landing pages [MrPetovan] + Fixed the display of [spoiler] tags [MrPetovan] + Fixed an issue with photo permissions in private mails [annando] + Fixed a bug in the process of following Pleroma accounts [annando] + Fixed a bug that caused notifications about locally deleted items [annando] + Fixed the link to the source of an event [MrPetovan] + Fixed a problem that caused authors from twitter postings having no profile pic [annando] + Fixed a bug in BBCode -> Markdown conversation for font size [annando] + Fixed a BBCode parser problem with the audio tag [MrPetovan] + Fixed a session problem [annando] + Fixed a problem with the auto-installer [nupplaphil] + Fixed a bug with magic links redirection for non profiles [annando] + General code cleaning [annando, MrPetovan, nupplaphil] + Removed contacts auto completion (in /contacts [MrPetovan] + Replaced FontAwesome by ForkAwesome in frio theme [vinzv] + Added new compose page for the frio theme [MrPetovan] + Added new console command: lock [nupplaphil] + Added new additional feature to show trending tags on community page [MrPetovan] + Added support of image descriptions [annando] + Added support of wildcards to server block lists [MrPetovan] + Added app specific passwords when using 2FA [MrPetovan] + Added fetching of postings via URL to interact with public postings [annando] + Added opt-out flag for federated search engines and associated header information for profiles [annando] + + Friendica Addons: + Update to the translation (CS, DE, EN GB, EN US, ES, FR, JA, NL SV) [translation teams] + General code cleanup [nupplaphil, Quix0r] + blockbot: + Added translations + Added more bots [annando] + Added admin panel settings [annando] + tumblr: + Changed used URLs to https adopting tumblrs change [annando] + twitter: + Enhanced handling of multi image postings [annando] + Enhanced display of quoted tweets [MrPetovan] + Added alternative text support for images [annando] + + Closed Issues: + 870, 1605, 2199, 3239, 3816, 4117, 4815, 5721, 6384, 6521, 6553, + 6675, 7212, 7235, 7285, 7293, 7314, 7317, 7337, 7338, 7346, 7350, + 7367, 7383, 7396, 7397, 7401, 7406, 7408, 7426, 7428, 7456, 7442, + 7457, 7468, 7471, 7473, 7488, 7497, 7498, 7501, 7507, 7521, 7526, + 7527, 7536, 7542, 7545, 7576, 7586, 7594, 7597, 7603, 7610, 7618, + 7629, 7635, 7638, 7663, 7665, 7672 + +Version 2019.06 (2019-06-23) + Friendica Core: + Update to the tranlation (CS, DE, EN-GB, EN-US, ET, FR, IT, PL, PT-BR, SV) [translation teams] + Update to the documentation [nupplaphil, realkinetix, MrPetovan] + Update to the themes (frio, vier) [BinkaDroid, MrPetovan, tobiasd] + Enhancements to the API [annando, MrPetovan] + Enhancements to the way reshares are handled [annando] + Enhancements to the redis configuration [nupplaphil] + Enhancements to the federation stats display in the admin panel [tobiasd] + Enhancements to the processing of changed storage engine [MrPetovan] + Enhancements to ActivityPub support [annando, MrPetovan] + Enhancements to code security [MrPetovan] + Enhancements to delivery counter [annando] + Fixed the notification order [JeroenED] + Fixed the timezone of Friendica logs [nupplaphil] + Fixed tag completion painfully slow [AlfredSK] + Fixed a regression in notifications [MrPetovan, annando] + Fixed an issue with smilies and code blocks [MrPetovan] + Fixed an AP issue with unavailable local profiles [MrPetovan] + Fixed an issue with the File to Folder feature [MrPetovan] + Fixed an issue with the legacy storage engine [fabrixxm] + Fixed an issue with the theme and addon path items [MrPetovan] + Fixed an issue occuring when the BasePath was not set [tobiasd] + Fixed an issue with additionally opened Sessions [MrPetovan] + Fixed an issue with legacy loglevel mapping [nupplaphil] + Fixed contact suggestions [annando] + Fixed an issue with frio hovercard [nupplaphil] + Fixed event interaction federation [annando] + Fixed remote image permission [deantownsley] + General Code cleaning and restructuring [annando, nupplaphil, tobiasd] + Added frio color scheme sharing [JeroenED] + Added syslog and stream Logger [nupplaphil] + Added storage move cronjob [MrPetovan] + Added collapsible panel for connector permission fields [MrPetovan] + Added rule-based router [MrPetovan] + Added Estonian translation [Rain Hawk] + Added APCu caching [nupplaphil] + Added BlockServer command to the Friendica console [nupplaphil] + Added reshare count [annando] + Added rule-based router [MrPetovan, nupplaphil] + Added themed error pages with mascot [MrPetovan, lostinlight] + Added contact relationship filter [MrPetovan] + Added native reshares and reshare count [annando] + Removed the old queue mechanism (deferred workers are now used) [annando] + Removed BasePath and Hostname settings from the admin panel [nupplaphil] + Remove support for defunct F-Droid Friendica app [MrPetovan] + + Friendica Addons: + Update to the tranlation (ET, SV, ZH_CN) [translation teams] + botdetection: + Added a new addon for preventing access by bots [nupplaphil, annando] + buffer: + Traces of Google+ were removed [annando] + curweather: + Fixed a problem with the display of the correct temperature unit [tobiasd] + fromgplus: + Deprecated the addon as Google+ was closed [tobiasd] + fortunate: + Deprecated addon for incompatibility with latest Friendica version [MrPetovan] + phpmailer: + Added a new addon to use external SMTP for email [M-arcus, kecalcze, MrPetovan] + pledgie: + Deprecated addon as service was discontinued [M-arcus] + xmpp: + Marked addon as unsupported because of various incompatibilities with themes [MrPetovan] + + Closed Issues: + 838, 1012, 2209, 2528, 3309, 3717, 3816, 3869, 4453, 4999, 5011, + 5047, 5276, 5850, 5983, 6245, 6303, 6319, 6379, 6410, 6477, 6478, + 6720, 6799, 6813, 6819, 6861, 6864, 6879, 6903, 6916, 6917, 6918, + 6921, 6927, 6929, 6936, 6938, 6941, 6943, 6947, 6948, 6950, 6952, + 6983, 6999, 7012, 7020, 7023, 7031, 7036, 7047, 7106, 7110, 7112, + 7119, 7128, 7130, 7131, 7141, 7142, 7150, 7171, 7183, 7196, 7209, + 7223, 7226, 7240, 7241, 7249, 7264, 7269, 7271, 7275, 7300, 7303 + +Version 2019.04 (2019-04-28) + Friendica Core: + Fixed a privacy problem with postings accessed by feed [MrPetovan] + +Version 2019.03 (2019-03-22) + Friendica Core: + Update to the translation (CS, DE, EN-GB, EN-US, ES, FR, IT, PL, SV, ZH-CN) [translation teams] + Update to the documentation [Aditoo17, JeroenED, m4sk1n, softmetz, tobiasd] + Update to the themes (duepuntozero, frio, smoothy, quattro, vier) [lxiter, MrPetovan, nupplaphil, rabuzarus, tobiasd] + Enhancements to the API [jasonscheng] + Enhancements to the Vagrant development VM [JeroenED] + Enhancements to the storage of gender, sexual preferences and maritial status [JeroenED] + Enhancements to the wording of notifications [MrPetovan] + Enhancements to the display of contacts in the profile [MrPetovan] + Enhancements to the handling of local links [lxiter] + Enhancements to the explicit and implicit mentioning in conversations [annando, MrPetovan] + Enhancements to the warnings in the admin panel [tobiasd] + Enhancements to the AP implementation [annando] + Enhancements to the worker process [annando] + Enhancements to the testing process [MrPetovan, nupplaphil] + Enhancements to the LibreJS compatibility [tobiasd] + Enhancements to the federated display of postings [MrPetovan] + Enhancements to the photo menu [annando] + Enhancements to the probing of contacts [annando] + Fixed several bugs with weird tagging in code blocks [lxiter] + Fixed a bug during contact entries update [rabuzarus] + Fixed several PHP warnings and errors [annando, MrPetovan, tobiasd] + Fixed an issue when Friendica is installed in a subdirectory [rabuzarus] + Fixed several issues in the handling of the Markdown parsing from and to d* [lxiter, MrPetovan] + Fixed a bug that prevented blocked contacts from being removed from groups [MrPetovan] + Fixed a bug in the ACL with preselected items [lxiter] + Fixed an issue with polling Events via AP [annando] + Fixed a memory issue with the JSON-LD parser [annando] + Fixed an issue with the forced DB structure update [nupplaphil] + Fixed an issue with wrongly encoded HTML entities in URLs [annando] + Fixed an issue with the rotation of images in the gallery [nupplaphil] + Fixed issues with redirs in the photo menu of Friendica contacts [tobiasd] + Fixed an issue with sending out notification mails to the admin [nupplaphil] + Fixed an the issue, that the API was ignoring the globalsilence setting [nupplaphil] + Fixed issues with the autolinker of URLs in postings [MrPetovan] + Fixed an issue resulting in multible emails after successful updates of the database [nupplaphil] + Fixed a timeout issue during detection process of the remote profile [annando] + Fixed an issue with postings from blocked servers [annando, MrPetovan] + Fixed an issue with the paging of stored folders [MrPetovan] + Fixed an issue with notifications about interactions with Friendica contacts [annando] + Fixed an issue that caused double postings of images uploaded to the gallery [annando] + Fixed an issue handling legacy config files [nupplaphil] + Fixed an issue that caused notifications about interaction with a locally deleted posting [annando] + If the node does not want to publish information, nodeinfo now returns 404 instead of non-existing entries [nupplaphil] + General Code cleaning and restructuring [annando, JeroenED, MrPetovan, nupplaphil] + Switched logging engine to monolog [nupplaphil] + Added plugable storage backend [fabrixxm, nupplaphil] + Added item delivery indicator to posting header [MrPetovan] + Added URL parameter to force a specific language [JeroenED] + Added live preview of attachments to frio [rabuzarus] + Added a "friendica_author" field to the API results which holds the real author [annando] + Added support for AP with forum postings [annando] + Added a summary of articles send over AP [annando] + + Friendica Addons: + Updates to the translations (CS, DE, EN-GB, ES, FR, NL, PL, SV) [translation teams] + Updated documentation [softmetz, tobiasd] + blackout: + Fix applying the translations [JeroenED, tobiasd] + Fixed some templating of the settings [tobiasd] + blogger: + The addon was marked as unsupported as it does currently not work (needs OAuth support) [annando] + cookienotice: + Added new addon to display a cookie usage notice in the browser [lxiter] + forumdirectory: + Fixed a theming issue with frio [rabuzarus] + js_upload: + Fixed a missing extionsion index [nupplaphil] + mailstream: + Fixed a curl issue [MrPetovan] + piwik: + Make it clear that Piwik is now Matomo but the addon supports both [tobiasd] + securemail: + updated the addon dependencies [MrPetovan] + twitter: + @ mentions are now stripped from the posts send to Twitter [MrPetovan] + + Closed Issues: + 1777, 2487, 3218, 3506, 3837, 4496, 5884, 6087, 6161, 6167, 6205, + 6232, 6263, 6274, 6292, 6337, 6338, 6375, 6378, 6382, 6384, 6386, + 6403, 6405, 6449, 6468, 6472, 6489, 6491, 6492, 6495, 6498, 6501, + 6503, 6505, 6511, 6514, 6521, 6522, 6529, 6532, 6533, 6544, 6545, + 6551, 6553, 6537, 6558, 6552, 6561, 6570, 6575, 6585, 6603, 6610, + 6629, 6630, 6633, 6635, 6652, 6656, 6658, 6667, 6668, 6669, 6672, + 6674, 6676, 6677, 6679, 6691, 6710, 6711, 6714, 6716, 6733, 6758, + 6772, 6778, 6785, 6788, 6800, 6805, 6812, 6819, 6822, 6823, 6840, + 6855, 6866, 6874, 6891, 6901, 6913 + Version 2019.01 (2019-01-21) Friendica Core: Update to the translation (CS, DE, EN-UK, EN-US, FR, NB-NO, NL, PL) [translation teams] @@ -512,7 +962,7 @@ Version 3.5.3 (2017-10-05) Updates to the documentation [tobiasd] Code revision and refactoring [Hypolite] pumpio, twitter bridges adopted to new background mechanism [annando] - Leistungsschutzrecht has a new source list, and a whitelist [annando] + Leistungsschutzrecht has a new source list, and an allowlist [annando] retriever marked unsupported due to unwanted side-effects [annando] Unicode emoji added [annando] Enhancement to the general content filter [annando] @@ -974,7 +1424,7 @@ Version 3.3.1 (2014-11-06) Set default location to empty for new users. Suppress warning on user creation (issue #1193) (fabrixxm) Correctly build urls with queries (issue #1190) (fabrixxm) Optionally use keywords in feed as post tags with "remote self" (annando) - A blacklist of keywords to not use can be defined (annando) + A denylist of keywords to not use can be defined (annando) "remote self" works also with Friendica and Diaspora contacts (annando) Show exact post time after 12 hours (FX7) Optionally redirect from non-SSL to SSL (annando) diff --git a/CREDITS.txt b/CREDITS.txt index 79f6dc10bf..402c356b7b 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -1,18 +1,21 @@ 23n Abinoam P. Marques Jr. +Abraham Pérez Hernández Abrax Adam Clark Adam Jurkiewicz Adam Magness Aditoo -Aditoo17 AgnesElisa Albert Alberto Díaz Tormo +Aleksandr "M.O.Z.G" Dikov Alex +Alexander An Alexander Fortin Alexander Kampmann Alexandre Alapetite +Alexey Adamov AlfredSK Andi Andi Stadler @@ -23,10 +26,11 @@ André Alves André Lohan Andy Andy Hee -AndyHee Angristan Anthronaut +Antron Samurai Arian - Cazare Muncitori +Asher Pen Athalbert aweiher axelt @@ -38,10 +42,14 @@ Beluga Ben Ben Roberts ben-utzer +BinkaDroid +Bjoessi bufalo1973 +ButterflyOfFire Calango Jr Carlos Solís Carsten Pfeiffer +Casper Cat Gray Chris Case Christian González @@ -61,6 +69,7 @@ David Martín Miranda David Rabel Dean Townsley Denis Chenu +dependabot[bot] Devlon Duthie Diego Souza Domovoy @@ -75,6 +84,7 @@ emilia.krawczyk Eric Côté erik Erkan Yilmaz +Eugene Veresk Fabian Dost Fabio Comuni felixgilles @@ -91,13 +101,13 @@ Gert Cauwenberg GLComo greeneyedred Gregory Smith +guzzisti Haakon Meland Eriksen Hans Meine -hauke Hauke Hauke Altmann -Hauke Zühl Herbert Thielen +hlad hoergen Hubert Kościański Hypolite Petovan @@ -110,6 +120,8 @@ Jens Tautenhahn jensp Jeroen De Meerleer jeroenpraat +Joan Bar +JOduMonT Johannes Schwab John Brazil Jonatan Nyberg @@ -117,18 +129,24 @@ Jonny Tischbein Josef Moravek juanman julia.domagalska +Julio Cova Karel Karolina +Keenan Pepper Keith Fernie Klaus Weidenbach Koyu Berteon +kPherox Kris Lea1995polish Leberwurscht Leonard Lausen Lionel Triay +loma-one +loma1 Lorem Ipsum Ludovic Grossard +Lynn Stephenson maase2 Magdalena Gazda Mai Anh Nguyen @@ -156,18 +174,23 @@ Michalina Mike Macgirvin miqrogroove mytbk +nathilia-peirce Nicola Spanti Olaf Conradi Oliver Olivier Olivier Mehani Olivier Migeot +ozero dien Paolo Wave Pascal Pascal Deklerck Pavel Morozov PerigGouanvic +peter +Peter Liebetrau peturisfeld +Phigger Phigger Philipp Philipp Holzer Pierre Rudloff @@ -177,17 +200,21 @@ R C Rabuzarus Radek Rafael Garau +Rain Hawk Rainulf Pineda Ralf Thees Ralph Ratten rcmaniac rebeka-catalina +René Wagner repat Ricardo Pereira +Rik 4 RJ Madsen Roland Häder Rui Andrada +rwa RyDroid S.Krumbholz Sakałoŭ Alaksiej @@ -201,13 +228,17 @@ Seth Silke Meyer Simon L'nu Simó Albert i Beltran +softmetz soko1 +SpencerDub St John Karp Stanislav N. Steffen K9 StefOfficiel +steve jobs Sveinn í Felli Sven Anders +Sylke Vicious Sylvain Lagacé szymon.filip Sérgio Lima @@ -219,13 +250,15 @@ Thomas Thomas Willingham thorsten23 Tim Stahel +TiMESPLiNTER Tino Tobias Diekershoff Tobias Hößl -tomacat +Tom tomamplius tomtom84 Tony Baldwin +Torbjörn Andersson TORminator trebor tschlotfeldt @@ -233,12 +266,16 @@ Tubuntu Tupambae.org U-SOUND\mike ufic +Ulf Rompe Unknown +Valvin +Valvin A Vasudev Kamath Vasya Novikov Vinzenz Vietzke vislav vladimir N +Vladimir Núñez VVelox Vít Šesták 'v6ak' Waldemar Stoczkowski diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index b6107e0063..0000000000 --- a/INSTALL.md +++ /dev/null @@ -1,347 +0,0 @@ -# Friendica Installation - -We've tried very hard to ensure that Friendica will run on commodity hosting -platforms - such as those used to host Wordpress blogs and Drupal websites. -But be aware that Friendica is more than a simple web application. It is a -complex communications system which more closely resembles an email server than -a web server. For reliability and performance, messages are delivered in the -background and are queued for later delivery when sites are down. This kind of -functionality requires a bit more of the host system than the typical blog. -Not every PHP/MySQL hosting provider will be able to support Friendica. Many will. -But please review the requirements and confirm these with your hosting provider -prior to installation. - -Before you begin: Choose a domain name or subdomain name for your server. -Put some thought into this - because changing it is currently not-supported. -Things will break, and some of your friends may have difficulty communicating with you. -We plan to address this limitation in a future release. Also decide if you wish -to connect with members of the Diaspora network, as this will impact the -installation requirements. - -Decide if you will use SSL and obtain an SSL cert. Communications with the -Diaspora network MAY require both SSL AND an SSL cert signed by a CA which is -recognized by major browsers. Friendica will work with self-signed certs but -Diaspora communication may not. For best results, install your cert PRIOR to -installing Friendica and when visiting your site for the initial installation in -step 5, please use the https: link. (Use the http: or non-SSL link if your cert -is self-signed). - -## 1. Requirements - -- Apache with mod-rewrite enabled and "Options All" so you can use a local .htaccess file -- PHP 5.6.1+ (PHP 7.1+ recommended for performance and official support). - - PHP *command line* with `register_argc_argv = true` in php.ini - - curl, gd (with at least jpeg support), mysql, mbstring, xml, zip and openssl extensions - - Some form of email server or email gateway such that PHP mail() works - - The POSIX module of PHP needs to be activated (e.g. RHEL, CentOS have disabled it) - - Composer for a Git install - -- Mysql 5.6+ or an equivalent alternative for MySQL (MariaDB 10.0.5+, Percona Server etc.) -- Ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks (Windows) -- Installation into a top-level domain or sub-domain (without a directory/path - component in the URL) is preferred. This is REQUIRED if you wish to communicate - with the Diaspora network. -- For alternative server configurations (such as Nginx server and MariaDB database - engine), refer to the [Friendica wiki](https://github.com/friendica/friendica/wiki). - -This guide will walk you through the manual installation process of Friendica. -If this is nothing for you, you might be interested in: -* the Friendica Docker image (https://github.com/friendica/docker) or -* how install Friendica with YunoHost (https://github.com/YunoHost-Apps/friendica_ynh). - -## 2. Install Friendica sources - -Unpack the Friendica files into the root of your web server document area. - -If you copy the directory tree to your webserver, make sure that you also copy -`.htaccess-dist` - as "dot" files are often hidden and aren't normally copied. - -OR - -Clone the friendica/friendica GitHub repository and import dependencies - - git clone https://github.com/friendica/friendica -b master [web server folder] - cd [web server folder] - bin/composer.phar install --no-dev - -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 want to use the development version of Friendica you can switch to the -develop 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 is unstable. -Exercise caution when pulling. -If you encounter a bug, please let us know. - -Either way, if you use Apache, copy `.htaccess-dist` to `.htaccess` to enable -URL rewriting. - -## 3. Database - -Create an empty database and note the access details (hostname, username, password, -database name). - -- Friendica needs the permission to create and delete fields and tables in its - own database. -- Please check the additional notes if running on MySQ 5.7.17 or newer - -## 4. Config - -If you know in advance that it will be impossible for the web server to write or -create files in the `config/` directory, please create an empty file called -`local.config.php` in it and make it writable by the web server. - -## 5a. Install Wizard - -Visit your website with a web browser and follow the instructions. -Please note any error messages and correct these before continuing. - -If you are using SSL with a known signature authority (recommended), use the -https: link to your website. If you are using a self-signed cert or no cert, -use the http: link. - -If you need to specify a port for the connection to the database, you can do so -in the host name setting for the database. - -## 5b. Manual install - -*If* the automated installation fails for any reason, please check the following: - -- `config/local.config.php` exists - - If not, copy `config/local-sample.config.php` to `config/local.config.php` - and edit it with your settings. -- Database is populated. - - If not, import the contents of `database.sql` with phpMyAdmin or the mysql - command line tool. - -## 6. Register the admin account - -At this point visit your website again, and register your personal account with -the same email as in the `config.admin_email` config value. -Registration errors should all be recoverable automatically. - -If you get any *critical* failure at this point, it generally indicates the -database was not installed correctly. You might wish to delete/rename -`config/local.config.php` to another name and drop all the database tables so -that you can start fresh. - -## 7. Background tasks (IMPORTANT) - -Set up a cron job or scheduled task to run the worker once every 5-10 minutes to -pick up the recent "public" postings of your friends. Example: - - cd /base/directory; /path/to/php bin/worker.php - -Change "/base/directory", and "/path/to/php" as appropriate for your situation. - -If you are using a Linux server, run "crontab -e" and add a line like the one -shown, substituting for your unique paths and settings: - - */10 * * * * cd /home/myname/mywebsite; /usr/bin/php bin/worker.php - -You can generally find the location of PHP by executing "which php". -If you have troubles with this section please contact your hosting provider for assistance. -Friendica will not work correctly if you cannot perform this step. - -You should also be sure that `config.php_path` is set correctly, it should look -like this: (changing it to the correct PHP location) - - 'config' => [ - 'php_path' => '/usr/local/php56/bin/php', - ] - -Alternative: If you cannot use a cron job as described above, you can use the -frontend worker and an external cron service to trigger the execution of the worker script. -You can enable the frontend worker after the installation from the admin panel -of your node and call: - - https://example.com/worker - -with the service of your choice. - -## 8. (Recommended) Set up a backup plan - -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 Friendica node is done, you should make yourself -a backup plan. - -The most important file is the `config/local.config.php` file in the base directory. -As it stores all your data, you should also have a recent dump of your Friendica -database at hand, should you have to recover your node. - -## 9. (Optional) Reverse-proxying and HTTPS - -Friendica looks for some well-known HTTP headers indicating a reverse-proxy -terminating an HTTPS connection. -While the standard from RFC 7239 specifies the use of the `Forwaded` header. - - Forwarded: for=192.0.2.1; proto=https; by=192.0.2.2 - -Friendica also supports a number on non-standard headers in common use. - - X-Forwarded-Proto: https - - Front-End-Https: on - - X-Forwarded-Ssl: on - -It is however preferable to use the standard approach if configuring a new server. - -## Troubleshooting - -### "System is currently unavailable. Please try again later" - -Check your database settings. -It usually means your database could not be opened or accessed. -If the database resides on the same machine, check that the database server name -is "localhost". - -### 500 Internal Error - -This could be the result of one of our Apache directives not being supported by -your version of Apache. Examine your apache server logs. -You might remove the line "Options -Indexes" from the .htaccess file if you are -using a Windows server as this has been known to cause problems. -Also check your file permissions. Your website and all contents must generally -be world-readable. - -It is likely that your web server reported the source of the problem in its error log files. -Please review these system error logs to determine what caused the problem. -Often this will need to be resolved with your hosting provider or (if self-hosted) -your web server configuration. - -### 400 and 4xx "File not found" errors - -First check your file permissions. -Your website and all contents must generally be world-readable. - -Ensure that mod-rewite is installed and working, and that your `.htaccess` file -is being used. To verify the latter, create a file `test.out` containing the -word "test" in the top directory of Friendica, make it world readable and point -your web browser to - - http://yoursitenamehere.com/test.out - -This file should be blocked. You should get a permission denied message. - -If you see the word "test" your Apache configuration is not allowing your -`.htaccess` file to be used (there are rules in this file to block access to any -file with .out at the end, as these are typically used for system logs). - -Make certain the `.htaccess` file exists and is readable by everybody, then look -for the existence of "AllowOverride None" in the Apache server configuration for your site. -This will need to be changed to "AllowOverride All". - -If you do not see the word "test", your `.htaccess` is working, but it is likely -that mod-rewrite is not installed in your web server or is not working. - -On most Linux flavors: - - % a2enmod rewrite - % /etc/init.d/apache2 restart - -Consult your hosting provider, experts on your particular Linux distribution or -(if Windows) the provider of your Apache server software if you need to change -either of these and can not figure out how. There is a lot of help available on -the web. Search "mod-rewrite" along with the name of your operating system -distribution or Apache package (if using Windows). - -### Unable to write the file config/local.config.php due to permissions issues - -Create an empty `config/local.config.php`file with that name and give it -world-write permission. - -On Linux: - - % touch config/local.config.php - % chmod 664 config/local.config.php - -Retry the installation. As soon as the database has been created, - -******* this is important ********* - - % chmod 644 config/local.config.php - -### Suhosin issues - -Some configurations with "suhosin" security are configured without an ability to -run external processes. Friendica requires this ability. Following are some notes -provided by one of our members. - -> On my server I use the php protection system Suhosin [http://www.hardened-php.net/suhosin/]. -> One of the things it does is to block certain functions like proc_open, as -> configured in `/etc/php5/conf.d/suhosin.ini`: -> -> suhosin.executor.func.blacklist = proc_open, ... -> -> For those sites like Friendica that really need these functions they can be -> enabled, e.g. in `/etc/apache2/sites-available/friendica`: -> -> -> php_admin_value suhosin.executor.func.blacklist none -> php_admin_value suhosin.executor.eval.blacklist none -> -> -> This enables every function for Friendica if accessed via browser, but not for -> the cronjob that is called via php command line. I attempted to enable it for -> cron by using something like: -> -> */10 * * * * cd /var/www/friendica/friendica/ && sudo -u www-data /usr/bin/php \ -> -d suhosin.executor.func.blacklist=none \ -> -d suhosin.executor.eval.blacklist=none -f bin/worker.php -> -> This worked well for simple test cases, but the friendica-cron still failed -> with a fatal error: -> -> suhosin[22962]: ALERT - function within blacklist called: proc_open() -> (attacker 'REMOTE_ADDR not set', file '/var/www/friendica/friendica/boot.php', -> line 1341) -> -> 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 are NOT -> called with `-d suhosin.executor.func.blacklist=none`. -> -> So the simple solution is to put the correct parameters into `config/local.config.php`: -> -> 'config' => [ -> //Location of PHP command line processor -> 'php_path' => '/usr/bin/php -d suhosin.executor.func.blacklist=none \ -> -d suhosin.executor.eval.blacklist=none', -> ], -> -> 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 find that out. -> I hope this saves some time for other people using suhosin with function blacklists. - -### Unable to create all mysql tables on MySQL 5.7.17 or newer - -If the setup fails to create all the database tables and/or manual creation from -the command line fails, with this error: - - ERROR 1067 (42000) at line XX: Invalid default value for 'created' - -You need to adjust your my.cnf and add the following setting under the [mysqld] -section: - - sql_mode = ''; - -After that, restart mysql and try again. diff --git a/LICENSE b/LICENSE index e720a404d8..c258e1e60c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ Friendica Communications Server -Copyright (c) 2010-2019 the Friendica Project +Copyright (c) 2010-2020 the Friendica Project This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by diff --git a/README.md b/README.md index 20d6b0ef50..a7494d7f8d 100644 --- a/README.md +++ b/README.md @@ -13,29 +13,34 @@ With Friendica, you can also fully interact with anyone on Twitter, post on Face Join today and [get your Friendica profile!](https://dir.friendica.social/servers 'Join Friendica today!') +Have a look at the [installation documentation](doc/Install.md) for further information about installing and using Friendica. ### Friendica Screenshots -| ![Frio theme in mobile browser](/images/screenshots/friendica-frio-mobile-profle-1.png?raw=true "Frio theme in mobile browser") ![Frio theme in mobile browser](/images/screenshots/friendica-frio-mobile-profle-2.png?raw=true "Frio theme in mobile browser") +| ![Frio theme in mobile browser](images/screenshots/friendica-frio-mobile-profle-1.png?raw=true "Frio theme in mobile browser") ![Frio theme in mobile browser](images/screenshots/friendica-frio-mobile-profle-2.png?raw=true "Frio theme in mobile browser") |:--:| |*Frio theme, mobile browser. Timeline and composer view.*| -|![Frio theme in desktop browser](/images/screenshots/friendica-frio-green-profle-1.png?raw=true "Frio theme in desktop browser") +|![Frio theme in desktop browser](images/screenshots/friendica-frio-green-profle-1.png?raw=true "Frio theme in desktop browser") |*Frio theme, desktop browser. Timeline view, contact info popped up, control menu open.*| -|![Frio theme in desktop browser](/images/screenshots/friendica-frio-green-profle-2.png?raw=true "Frio theme in desktop browser") +|![Frio theme in desktop browser](images/screenshots/friendica-frio-green-profle-2.png?raw=true "Frio theme in desktop browser") |*Frio theme, desktop browser. Menu open for controlling individual posts.*| -|![Frio theme in desktop browser](/images/screenshots/friendica-frio-red-profle-3.png?raw=true "Frio theme in desktop browser") +|![Frio theme in desktop browser](images/screenshots/friendica-frio-red-profle-3.png?raw=true "Frio theme in desktop browser") |*Frio theme, desktop browser. Profile view, notification menu open.*| -|![Frio theme in desktop browser](/images/screenshots/friendica-frio-red-profle-2.png?raw=true "Frio theme in desktop browser") +|![Frio theme in desktop browser](images/screenshots/friendica-frio-red-profle-2.png?raw=true "Frio theme in desktop browser") |*Number of new posts, in total and by group.*| -|![Frio theme in desktop browser](/images/screenshots/friendica-frio-red-profle-1.png?raw=true "Frio theme in desktop browser") +|![Frio theme in desktop browser](images/screenshots/friendica-frio-red-profle-1.png?raw=true "Frio theme in desktop browser") |*Calender with popup of event.*| -|![Frio theme default colour in standard browser on tablet](/images/screenshots/friendica-frio-default-profile-1.png?raw=true "Frio theme default colour in standard browser on tablet") +|![Frio theme default colour in standard browser on tablet](images/screenshots/friendica-frio-default-profile-1.png?raw=true "Frio theme default colour in standard browser on tablet") |*Notifications menu and private messages counter, standard browser on tablet.*| -|![Frio theme in desktop browser](/images/screenshots/friendica-frio-brown-profile-2.png?raw=true "Frio theme in desktop browser") +|![Frio theme in desktop browser](images/screenshots/friendica-frio-brown-profile-2.png?raw=true "Frio theme in desktop browser") |*Number of visible contacts, standard browser.*| -|![Frio theme in desktop browser](/images/screenshots/friendica-frio-brown-profile-1.png?raw=true "Frio theme in desktop browser") +|![Frio theme in desktop browser](images/screenshots/friendica-frio-brown-profile-1.png?raw=true "Frio theme in desktop browser") |*Network posts chronologically ordered, standard browser.*| -|![Vier theme in desktop browser](/images/screenshots/friendica-vier-profile.png?raw=true "Vier theme in desktop browser") +|![Vier theme in desktop browser](images/screenshots/friendica-vier-profile.png?raw=true "Vier theme in desktop browser") |*Vier theme, desktop browser. Public timeline view.*| -|![Vier theme in desktop browser](/images/screenshots/friendica-vier-community.png?raw=true "Vier theme in desktop browser") +|![Vier theme in desktop browser](images/screenshots/friendica-vier-community.png?raw=true "Vier theme in desktop browser") |*Vier theme, desktop browser. Community post displayed.*| + +## Endorsements + +- [![Awesome Humane Tech](images/humane-tech-badge.svg)](https://github.com/humanetech-community/awesome-humane-tech) On August 12th 2020, Friendica was added to [the curated Awesome Humane Tech directory](https://github.com/humanetech-community/awesome-humane-tech) in [the "Fediverse" category](https://github.com/humanetech-community/awesome-humane-tech#fediverse). diff --git a/VERSION b/VERSION index 2b5b640bc3..454e445f6e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2019.03-dev +2020.09-dev diff --git a/Vagrantfile b/Vagrantfile index e5f30b307f..f9ffe0c75e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,8 +6,8 @@ server_timezone = "UTC" public_folder = "/vagrant" Vagrant.configure(2) do |config| - # Set server to Ubuntu 16.04 - config.vm.box = "ubuntu/xenial64" + # Set server to Debian 10 / Buster 64bit + config.vm.box = "debian/buster64" # Disable automatic box update checking. If you disable this, then # boxes will only be checked for updates when the user runs diff --git a/autotest.sh b/autotest.sh new file mode 100755 index 0000000000..15067bf9d5 --- /dev/null +++ b/autotest.sh @@ -0,0 +1,279 @@ +#!/usr/bin/env bash +# +# This script is used for autotesting the Friendica codebase with different +# types of tests and environments. +# +# Currently, there are three types of autotesting possibilities: +# - "USEDOCKER=true ./autotest.sh" will start a database docker container for testing +# - "./autotest.sh" on the Drone CI environment will use the database container of the drone CI pipeline +# - "./autotest.sh" on a local environment will try to use the local database instance for testing +# +# You can specify a database (mysql, mariadb currently) for the db backend of Friendica ("./autotest.sh mysql") +# And you can specify some parameters for the test, like: +# - NOCOVERAGE=true ... Don't create a coverage XML (this is only useful if you will send coverage to codecov.io) +# - NOINSTALL=true ... Skip the whole Friendica installation process (e.g. you just test Caching drivers) +# - TEST_SELECTION= ... Specify which tests are used to run (based on the test-labeling) +# - XDEBUG_CONFIG= ... Set some XDEBUG specific environment settings for development + +DATABASENAME=${MYSQL_DATABASE:-test} +DATABASEUSER=${MYSQL_USERNAME:-friendica} +DATABASEHOST=${MYSQL_HOST:-localhost} +BASEDIR=$PWD + +DBCONFIGS="mysql mariadb" +TESTS="REDIS MEMCACHE MEMCACHED APCU NODB" + +export MYSQL_DATABASE="$DATABASENAME" +export MYSQL_USERNAME="$DATABASEUSER" +export MYSQL_PASSWORD="friendica" + +if [ -z "$PHP_EXE" ]; then + PHP_EXE=php +fi +PHP=$(which "$PHP_EXE") +# Use the Friendica internal composer +COMPOSER="$BASEDIR/bin/composer.phar" + +set -e + +_XDEBUG_CONFIG=$XDEBUG_CONFIG +unset XDEBUG_CONFIG + +function show_syntax() { + echo -e "Syntax: ./autotest.sh [dbconfigname] [testfile]\n" >&2 + echo -e "\t\"dbconfigname\" can be one of: $DBCONFIGS" >&2 + echo -e "\t\"testfile\" is the name of a test file, for example lib/template.php" >&2 + echo -e "\nDatabase environment variables:\n" >&2 + echo -e "\t\"MYSQL_HOST\" Mysql Hostname (Default: localhost)" >&2 + echo -e "\t\"MYSQL_USDRNAME\" Mysql Username (Default: friendica)" >&2 + echo -e "\t\"MYSQL_DATABASE\" Mysql Database (Default: test)" >&2 + echo -e "\nOther environment variables:\n" >&2 + echo -e "\t\"TEST_SELECTION\" test a specific group of tests, can be one of: $TESTS" >&2 + echo -e "\t\"NOINSTALL\" If set to true, skip the db and install process" >&2 + echo -e "\t\"NOCOVERAGE\" If set to true, don't create a coverage output" >&2 + echo -e "\t\"USEDOCKER\" If set to true, the DB server will be executed inside a docker container" >&2 + echo -e "\nExample: NOCOVERAGE=true ./autotest.sh mysql src/Core/Cache/MemcacheTest.php" >&2 + echo "will run the test suite from \"tests/src/Core/Cache/MemcacheTest.php\" without a Coverage" >&2 + echo -e "\nIf no arguments are specified, all tests will be run with all database configs" >&2 +} + +if [ -x "$PHP" ]; then + echo "Using PHP executable $PHP" +else + echo "Could not find PHP executable $PHP_EXE" >&2 + exit 3 +fi + +echo "Installing depdendencies" +$PHP "$COMPOSER" install + +PHPUNIT="$BASEDIR/vendor/bin/phpunit" + +if [ -x "$PHPUNIT" ]; then + echo "Using PHPUnit executable $PHPUNIT" +else + echo "Could not find PHPUnit executable after composer $PHPUNIT" >&2 + exit 3 +fi + +if ! [ \( -w config -a ! -f config/local.config.php \) -o \( -f config/local.config.php -a -w config/local.config.php \) ]; then + echo "Please enable write permissions on config and config/config.php" >&2 + exit 1 +fi + +if [ "$1" ]; then + FOUND=0 + for DBCONFIG in $DBCONFIGS; do + if [ "$1" = "$DBCONFIG" ]; then + FOUND=1 + break + fi + done + if [ $FOUND = 0 ]; then + echo -e "Unknown database config name \"$1\"\n" >&2 + show_syntax + exit 2 + fi +fi + +# Back up existing (dev) config if one exists and backup not already there +if [ -f config/local.config.php ] && [ ! -f config/local.config-autotest-backup.php ]; then + mv config/local.config.php config/local.config-autotest-backup.php +fi + +function cleanup_config() { + + if [ -n "$DOCKER_CONTAINER_ID" ]; then + echo "Kill the docker $DOCKER_CONTAINER_ID" + docker stop "$DOCKER_CONTAINER_ID" + docker rm -f "$DOCKER_CONTAINER_ID" + fi + + cd "$BASEDIR" + + # Restore existing config + if [ -f config/local.config-autotest-backup.php ]; then + mv config/local.config-autotest-backup.php config/local.config.php + fi +} + +# restore config on exit +trap cleanup_config EXIT + +function execute_tests() { + DB=$1 + echo "Setup environment for $DB testing ..." + # back to root folder + cd "$BASEDIR" + + # backup current config + if [ -f config/local.config.php ]; then + mv config/local.config.php config/local.config-autotest-backup.php + fi + + if [ -z "$NOINSTALL" ]; then + #drop database + if [ "$DB" == "mysql" ]; then + if [ -n "$USEDOCKER" ]; then + echo "Fire up the mysql docker" + DOCKER_CONTAINER_ID=$(docker run \ + -e MYSQL_ROOT_PASSWORD=friendica \ + -e MYSQL_USER="$DATABASEUSER" \ + -e MYSQL_PASSWORD=friendica \ + -e MYSQL_DATABASE="$DATABASENAME" \ + -d mysql) + DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID") + + else + if [ -z "$DRONE" ]; then # no need to drop the DB when we are on CI + if [ "mysql" != "$(mysql --version | grep -o mysql)" ]; then + echo "Your mysql binary is not provided by mysql" + echo "To use the docker container set the USEDOCKER environment variable" + exit 3 + fi + mysql -u "$DATABASEUSER" -pfriendica -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true + mysql -u "$DATABASEUSER" -pfriendica -e "CREATE DATABASE $DATABASENAME DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" -h $DATABASEHOST + else + DATABASEHOST=mysql + fi + fi + + echo "Waiting for MySQL $DATABASEHOST initialization..." + if ! bin/wait-for-connection $DATABASEHOST 3306 300; then + echo "[ERROR] Waited 300 seconds, no response" >&2 + exit 1 + fi + + echo "MySQL is up." + fi + if [ "$DB" == "mariadb" ]; then + if [ -n "$USEDOCKER" ]; then + echo "Fire up the mariadb docker" + DOCKER_CONTAINER_ID=$(docker run \ + -e MYSQL_ROOT_PASSWORD=friendica \ + -e MYSQL_USER="$DATABASEUSER" \ + -e MYSQL_PASSWORD=friendica \ + -e MYSQL_DATABASE="$DATABASENAME" \ + -d mariadb) + DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID") + + else + if [ -z "$DRONE" ]; then # no need to drop the DB when we are on CI + if [ "MariaDB" != "$(mysql --version | grep -o MariaDB)" ]; then + echo "Your mysql binary is not provided by mysql" + echo "To use the docker container set the USEDOCKER environment variable" + exit 3 + fi + mysql -u "$DATABASEUSER" -pfriendica -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true + mysql -u "$DATABASEUSER" -pfriendica -e "CREATE DATABASE $DATABASENAME DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" -h $DATABASEHOST + else + DATABASEHOST=mariadb + fi + fi + + echo "Waiting for MariaDB $DATABASEHOST initialization..." + if ! bin/wait-for-connection $DATABASEHOST 3306 300; then + echo "[ERROR] Waited 300 seconds, no response" >&2 + exit 1 + fi + + echo "MariaDB is up." + fi + + if [ -n "$USEDOCKER" ]; then + echo "Initialize database..." + docker exec $DOCKER_CONTAINER_ID mysql -u root -pfriendica -e 'CREATE DATABASE IF NOT EXISTS $DATABASENAME;' + fi + + export MYSQL_HOST="$DATABASEHOST" + + #call installer + echo "Installing Friendica..." + "$PHP" ./bin/console.php autoinstall --dbuser="$DATABASEUSER" --dbpass=friendica --dbdata="$DATABASENAME" --dbhost="$DATABASEHOST" --url=https://friendica.local --admin=admin@friendica.local + fi + + #test execution + echo "Testing..." + rm -fr "coverage-html" + mkdir "coverage-html" + if [[ "$_XDEBUG_CONFIG" ]]; then + export XDEBUG_CONFIG=$_XDEBUG_CONFIG + fi + + COVER='' + if [ -z "$NOCOVERAGE" ]; then + COVER="--coverage-clover tests/autotest-clover.xml" + else + echo "No coverage" + fi + + # per default, there is no cache installed + GROUP='--exclude-group REDIS,MEMCACHE,MEMCACHED,APCU' + if [ "$TEST_SELECTION" == "REDIS" ]; then + GROUP="--group REDIS" + fi + if [ "$TEST_SELECTION" == "MEMCACHE" ]; then + GROUP="--group MEMCACHE" + fi + if [ "$TEST_SELECTION" == "MEMCACHED" ]; then + GROUP="--group MEMCACHED" + fi + if [ "$TEST_SELECTION" == "APCU" ]; then + GROUP="--group APCU" + fi + if [ "$TEST_SELECTION" == "NODB" ]; then + GROUP="--exclude-group DB,SLOWDB" + fi + + INPUT="$BASEDIR/tests" + if [ -n "$2" ]; then + INPUT="$INPUT/$2" + fi + + echo "${PHPUNIT[@]}" --configuration tests/phpunit.xml $GROUP $COVER --log-junit "autotest-results.xml" "$INPUT" "$3" + "${PHPUNIT[@]}" --configuration tests/phpunit.xml $GROUP $COVER --log-junit "autotest-results.xml" "$INPUT" "$3" + RESULT=$? + + if [ -n "$DOCKER_CONTAINER_ID" ]; then + echo "Kill the docker $DOCKER_CONTAINER_ID" + docker stop $DOCKER_CONTAINER_ID + docker rm -f $DOCKER_CONTAINER_ID + unset $DOCKER_CONTAINER_ID + fi +} + +# +# Start the test execution +# +if [ -z "$1" ] && [ -n "$TEST_SELECTION" ]; then + # run all known database configs + for DBCONFIG in $DBCONFIGS; do + execute_tests "$DBCONFIG" + done +else + FILENAME="$2" + if [ -n "$2" ] && [ ! -f "tests/$FILENAME" ] && [ "${FILENAME:0:2}" != "--" ]; then + FILENAME="../$FILENAME" + fi + execute_tests "$1" "$FILENAME" "$3" +fi diff --git a/bin/auth_ejabberd.php b/bin/auth_ejabberd.php index 11df438952..f00615f02b 100755 --- a/bin/auth_ejabberd.php +++ b/bin/auth_ejabberd.php @@ -1,6 +1,23 @@ #!/usr/bin/env php . + * * ejabberd extauth script for the integration with friendica * * Originally written for joomla by Dalibor Karlovic @@ -18,9 +35,11 @@ * - Change the access mode so it is readable only to the user ejabberd and has exec * $ chmod 700 /path/to/friendica/bin/auth_ejabberd.php * - * - Edit your ejabberd.cfg file, comment out your auth_method and add: - * {auth_method, external}. - * {extauth_program, "/path/to/friendica/bin/auth_ejabberd.php"}. + * - Edit your ejabberd.yml file and add after "shaper:": + * + * auth_method: [external] + * extauth_program: "/path/to/friendica/bin/auth_ejabberd.php" + * auth_use_cache: false * * - Restart your ejabberd service, you should be able to login with your friendica auth info * @@ -32,11 +51,10 @@ * */ -use Friendica\App; -use Friendica\Core\Config; -use Friendica\Factory; -use Friendica\Util\BasePath; +use Dice\Dice; +use Friendica\App\Mode; use Friendica\Util\ExAuth; +use Psr\Log\LoggerInterface; if (sizeof($_SERVER["argv"]) == 0) { die(); @@ -54,14 +72,14 @@ chdir($directory); require dirname(__DIR__) . '/vendor/autoload.php'; -$basedir = BasePath::create(dirname(__DIR__), $_SERVER); -$configLoader = new Config\ConfigCacheLoader($basedir); -$config = Factory\ConfigFactory::createCache($configLoader); -$logger = Factory\LoggerFactory::create('auth_ejabberd', $config); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['auth_ejabberd']]); -$a = new App($config, $logger); +\Friendica\DI::init($dice); -if ($a->getMode()->isNormal()) { +$appMode = $dice->create(Mode::class); + +if ($appMode->isNormal()) { $oAuth = new ExAuth(); $oAuth->readStdin(); } diff --git a/bin/composer.phar b/bin/composer.phar index 96fa2df7bd..4cb50a573b 100755 Binary files a/bin/composer.phar and b/bin/composer.phar differ diff --git a/bin/console.php b/bin/console.php index 9061824d87..27522d8554 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,18 +1,31 @@ #!/usr/bin/env php . + * + */ + +use Dice\Dice; +use Psr\Log\LoggerInterface; require dirname(__DIR__) . '/vendor/autoload.php'; -use Friendica\Core\Config; -use Friendica\Factory; -use Friendica\Util\BasePath; +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]); -$basedir = BasePath::create(dirname(__DIR__), $_SERVER); -$configLoader = new Config\ConfigCacheLoader($basedir); -$config = Factory\ConfigFactory::createCache($configLoader); -$logger = Factory\LoggerFactory::create('console', $config); - -$a = new Friendica\App($config, $logger); -\Friendica\BaseObject::setApp($a); - -(new Friendica\Core\Console($argv))->execute(); +(new Friendica\Core\Console($dice, $argv))->execute(); diff --git a/bin/daemon.php b/bin/daemon.php index 5c014a9270..c2ce05c8e0 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -1,18 +1,34 @@ #!/usr/bin/env php . + * + * Run the worker from a daemon. * * This script was taken from http://php.net/manual/en/function.pcntl-fork.php */ -use Friendica\App; -use Friendica\Core\Config; +use Dice\Dice; +use Friendica\Core\Logger; use Friendica\Core\Worker; use Friendica\Database\DBA; -use Friendica\Factory; -use Friendica\Util\BasePath; +use Friendica\DI; +use Psr\Log\LoggerInterface; // Get options $shortopts = 'f'; @@ -33,20 +49,19 @@ if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) { require dirname(__DIR__) . '/vendor/autoload.php'; -$basedir = BasePath::create(dirname(__DIR__), $_SERVER); -$configLoader = new Config\ConfigCacheLoader($basedir); -$config = Factory\ConfigFactory::createCache($configLoader); -$logger = Factory\LoggerFactory::create('daemon', $config); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['daemon']]); -$a = new App($config, $logger); +DI::init($dice); +$a = DI::app(); -if ($a->getMode()->isInstall()) { +if (DI::mode()->isInstall()) { die("Friendica isn't properly installed yet.\n"); } -Config::load(); +DI::config()->load(); -if (empty(Config::get('system', 'pidfile'))) { +if (empty(DI::config()->get('system', 'pidfile'))) { die(<<get('system', 'pidfile'); if (in_array("start", $_SERVER["argv"])) { $mode = "start"; @@ -88,7 +103,7 @@ if (is_readable($pidfile)) { } if (empty($pid) && in_array($mode, ["stop", "status"])) { - Config::set('system', 'worker_daemon_mode', false); + DI::config()->set('system', 'worker_daemon_mode', false); die("Pidfile wasn't found. Is the daemon running?\n"); } @@ -99,7 +114,7 @@ if ($mode == "status") { unlink($pidfile); - Config::set('system', 'worker_daemon_mode', false); + DI::config()->set('system', 'worker_daemon_mode', false); die("Daemon process $pid isn't running.\n"); } @@ -108,9 +123,9 @@ if ($mode == "stop") { unlink($pidfile); - $logger->notice("Worker daemon process was killed", ["pid" => $pid]); + Logger::notice("Worker daemon process was killed", ["pid" => $pid]); - Config::set('system', 'worker_daemon_mode', false); + DI::config()->set('system', 'worker_daemon_mode', false); die("Worker daemon process $pid was killed.\n"); } @@ -118,7 +133,7 @@ if (!empty($pid) && posix_kill($pid, 0)) { die("Daemon process $pid is already running.\n"); } -$logger->notice('Starting worker daemon.', ["pid" => $pid]); +Logger::notice('Starting worker daemon.', ["pid" => $pid]); if (!$foreground) { echo "Starting worker daemon.\n"; @@ -150,15 +165,15 @@ if (!$foreground) { file_put_contents($pidfile, $pid); // We lose the database connection upon forking - $a->loadDatabase(); + DBA::reconnect(); } -Config::set('system', 'worker_daemon_mode', true); +DI::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; +$wait_interval = intval(DI::config()->get('system', 'cron_interval', 5)) * 60; $do_cron = true; $last_cron = 0; @@ -166,7 +181,7 @@ $last_cron = 0; // Now running as a daemon. while (true) { if (!$do_cron && ($last_cron + $wait_interval) < time()) { - $logger->info('Forcing cron worker call.', ["pid" => $pid]); + Logger::info('Forcing cron worker call.', ["pid" => $pid]); $do_cron = true; } @@ -180,7 +195,7 @@ while (true) { $last_cron = time(); } - $logger->info("Sleeping", ["pid" => $pid]); + Logger::info("Sleeping", ["pid" => $pid]); $start = time(); do { $seconds = (time() - $start); @@ -197,10 +212,10 @@ while (true) { if ($timeout) { $do_cron = true; - $logger->info("Woke up after $wait_interval seconds.", ["pid" => $pid, 'sleep' => $wait_interval]); + Logger::info("Woke up after $wait_interval seconds.", ["pid" => $pid, 'sleep' => $wait_interval]); } else { $do_cron = false; - $logger->info("Worker jobs are calling to be forked.", ["pid" => $pid]); + Logger::info("Worker jobs are calling to be forked.", ["pid" => $pid]); } } diff --git a/bin/dev/minifyjs.sh b/bin/dev/minifyjs.sh index 50a56a45ca..caa2b3846a 100755 --- a/bin/dev/minifyjs.sh +++ b/bin/dev/minifyjs.sh @@ -5,16 +5,13 @@ command -v uglifyjs >/dev/null 2>&1 || { echo >&2 "I require UglifyJS but it's n MINIFY_CMD=uglifyjs JSFILES=( - "view/js/acl.js" "view/js/ajaxupload.js" "view/js/country.js" "view/js/main.js" "vendor/asset/base64/base64.min.js" - "view/theme/frost/js/acl.js" "view/theme/frost/js/jquery.divgrow-1.3.1.f1.js" "view/theme/frost/js/main.js" "view/theme/frost/js/theme.js" - "view/theme/frost-mobile/js/acl.js" "view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.js" "view/theme/frost-mobile/js/main.js" "view/theme/frost-mobile/js/theme.js" diff --git a/bin/dev/vagrant_provision.sh b/bin/dev/vagrant_provision.sh index 7ebbdcafd4..bc28cc384c 100755 --- a/bin/dev/vagrant_provision.sh +++ b/bin/dev/vagrant_provision.sh @@ -16,14 +16,12 @@ DOMAIN="*.xip.io" EXTRADOMAIN="friendica.local" PASSPHRASE="vaprobash" SUBJ=" -C=US -ST=Connecticut -O=Vaprobash -localityName=New Haven -commonName=$DOMAIN +C=US/ +ST=Connecticut/ +O=Vaprobash/ +localityName=New Haven/ +commonName=$DOMAIN/ subjectAltName=DNS:$EXTRADOMAIN -organizationalUnitName= -emailAddress= " sudo mkdir -p "$SSL_DIR" sudo openssl genrsa -out "$SSL_DIR/xip.io.key" 4096 @@ -37,9 +35,9 @@ sudo apt-get install -y apache2 sudo a2enmod rewrite actions ssl sudo cp /vagrant/bin/dev/vagrant_vhost.sh /usr/local/bin/vhost sudo chmod guo+x /usr/local/bin/vhost - sudo vhost -s 192.168.22.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica.local - sudo a2dissite 000-default - sudo service apache2 restart +sudo vhost -s 192.168.22.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica.local +sudo a2dissite 000-default +sudo service apache2 restart #Install php echo ">>> Installing PHP7" @@ -48,9 +46,9 @@ sudo systemctl restart apache2 #Install mysql echo ">>> Installing Mysql" -sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password root" -sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password root" -sudo apt-get install -qq mysql-server +sudo debconf-set-selections <<< "mariadb-server mariadb-server/root_password password root" +sudo debconf-set-selections <<< "mariadb-server mariadb-server/root_password_again password root" +sudo apt-get install -qq mariadb-server # enable remote access # setting the mysql bind-address to allow connections from everywhere sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf @@ -76,6 +74,9 @@ debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Local Only' sudo apt-get install -y postfix mailutils libmailutils-dev sudo echo -e "friendica1: vagrant\nfriendica2: vagrant\nfriendica3: vagrant\nfriendica4: vagrant\nfriendica5: vagrant" >> /etc/aliases && sudo newaliases +# Friendica needs git for fetching some dependencies +sudo apt-get install -y git + #make the vagrant directory the docroot sudo rm -rf /var/www/ sudo ln -fs /vagrant /var/www @@ -83,7 +84,7 @@ sudo ln -fs /vagrant /var/www # install deps with composer sudo apt install unzip cd /var/www -php bin/composer.phar install +sudo -u www-data php bin/composer.phar install # initial config file for friendica in vagrant cp /vagrant/mods/local.config.vagrant.php /vagrant/config/local.config.php diff --git a/bin/run_xgettext.sh b/bin/run_xgettext.sh index 5c40df8b5f..3bc0286bdd 100755 --- a/bin/run_xgettext.sh +++ b/bin/run_xgettext.sh @@ -32,7 +32,7 @@ case "$MODE" in mkdir -p "$FULLPATH/../addon/$ADDONNAME/lang/C" OUTFILE="$FULLPATH/../addon/$ADDONNAME/lang/C/messages.po" FINDSTARTDIR="." - FINDOPTS= + FINDOPTS="-path ./vendor -prune -or" ;; 'single') FULLPATH=$PWD @@ -40,7 +40,7 @@ case "$MODE" in mkdir -p "$FULLPATH/lang/C" OUTFILE="$FULLPATH/lang/C/messages.po" FINDSTARTDIR="." - FINDOPTS= + FINDOPTS="-path ./vendor -prune -or" echo "Extract strings for single addon '$ADDONNAME'" ;; 'default') @@ -48,9 +48,9 @@ case "$MODE" in OUTFILE="$FULLPATH/../view/lang/C/messages.po" FINDSTARTDIR="." # skip addon folder - FINDOPTS="( -wholename */addon -or -wholename */addons -or -wholename */addons-extra -or -wholename */smarty3 ) -prune -o" + FINDOPTS="( -path ./addon -or -path ./addons -or -path ./addons-extra -or -path ./tests -or -path ./view/lang -or -path ./view/smarty3 -or -path ./vendor ) -prune -or" - F9KVERSION=$(sed -n "s/.*'FRIENDICA_VERSION'.*'\([0-9.]*\)'.*/\1/p" ./boot.php); + F9KVERSION=$(cat ./VERSION); echo "Friendica version $F9KVERSION" ;; esac @@ -58,44 +58,54 @@ esac KEYWORDS="-k -kt -ktt:1,2" -echo "extract strings to $OUTFILE.." +echo "Extract strings to $OUTFILE.." rm "$OUTFILE"; touch "$OUTFILE" -for f in $(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f) + +find_result=$(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f) + +total_files=$(wc -l <<< "${find_result}") + +for file in $find_result do - if [ ! -d "$f" ] + ((count++)) + echo -ne " \r" + echo -ne "Reading file $count/$total_files..." + + # On Windows, find still outputs the name of pruned folders + if [ ! -d "$file" ] then - xgettext $KEYWORDS -j -o "$OUTFILE" --from-code=UTF-8 "$f" + xgettext $KEYWORDS -j -o "$OUTFILE" --from-code=UTF-8 "$file" || exit 1 sed -i "s/CHARSET/UTF-8/g" "$OUTFILE" fi done +echo -ne "\n" -echo "setup base info.." -case "$MODE" in +echo "Interpolate metadata.." + +sed -i "s/^\"Plural-Forms.*$//g" "$OUTFILE" + +case "$MODE" in 'addon'|'single') sed -i "s/SOME DESCRIPTIVE TITLE./ADDON $ADDONNAME/g" "$OUTFILE" sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER//g" "$OUTFILE" sed -i "s/FIRST AUTHOR , YEAR.//g" "$OUTFILE" sed -i "s/PACKAGE VERSION//g" "$OUTFILE" sed -i "s/PACKAGE/Friendica $ADDONNAME addon/g" "$OUTFILE" - sed -i "s/CHARSET/UTF-8/g" "$OUTFILE" - sed -i "s/^\"Plural-Forms.*$//g" "$OUTFILE" ;; 'default') sed -i "s/SOME DESCRIPTIVE TITLE./FRIENDICA Distributed Social Network/g" "$OUTFILE" - sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2010, 2011, 2012, 2013 the Friendica Project/g" "$OUTFILE" + sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2010-$(date +%Y) the Friendica Project/g" "$OUTFILE" sed -i "s/FIRST AUTHOR , YEAR./Mike Macgirvin, 2010/g" "$OUTFILE" sed -i "s/PACKAGE VERSION/$F9KVERSION/g" "$OUTFILE" sed -i "s/PACKAGE/Friendica/g" "$OUTFILE" - sed -i "s/CHARSET/UTF-8/g" "$OUTFILE" - sed -i "s/^\"Plural-Forms.*$//g" "$OUTFILE" ;; esac if [ "" != "$1" -a "$MODE" == "default" ] then UPDATEFILE="$(readlink -f ${FULLPATH}/$1)" - echo "merging new strings to $UPDATEFILE.." + echo "Merging new strings to $UPDATEFILE.." msgmerge -U $OUTFILE $UPDATEFILE fi -echo "done." +echo "Done." diff --git a/bin/testargs.php b/bin/testargs.php index a0ddea3452..b7d7125f7a 100644 --- a/bin/testargs.php +++ b/bin/testargs.php @@ -1,10 +1,22 @@ . * - * Purpose: * During installation we need to check if register_argc_argv is * enabled for the command line PHP processor, because otherwise * deliveries will fail. So we will do a shell exec of php and diff --git a/bin/wait-for-connection b/bin/wait-for-connection new file mode 100755 index 0000000000..b6c03a6705 --- /dev/null +++ b/bin/wait-for-connection @@ -0,0 +1,63 @@ +#!/usr/bin/php +. + * + * This script tries to connect to a database for a given interval + * Useful in case of installation e.g. to wait for the database to not generate unnecessary errors + * + * Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}] + */ + +$timeout = 60; +switch ($argc) { + case 4: + $timeout = (float)$argv[3]; + case 3: + $host = $argv[1]; + $port = (int)$argv[2]; + break; + default: + fwrite(STDERR, 'Usage: '.$argv[0].' host port [timeout]'."\n"); + exit(2); +} +if ($timeout < 0) { + fwrite(STDERR, 'Timeout must be greater than zero'."\n"); + exit(2); +} +if ($port < 1) { + fwrite(STDERR, 'Port must be an integer greater than zero'."\n"); + exit(2); +} +$socketTimeout = (float)ini_get('default_socket_timeout'); +if ($socketTimeout > $timeout) { + $socketTimeout = $timeout; +} +$stopTime = time() + $timeout; +do { + $sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout); + if ($sock !== false) { + fclose($sock); + fwrite(STDOUT, "\n"); + exit(0); + } + sleep(1); + fwrite(STDOUT, '.'); +} while (time() < $stopTime); +fwrite(STDOUT, "\n"); +exit(1); diff --git a/bin/worker.php b/bin/worker.php index 553e984977..1b70a20955 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -1,16 +1,32 @@ #!/usr/bin/env php . + * + * Starts the background processing */ +use Dice\Dice; use Friendica\App; -use Friendica\Core\Config; use Friendica\Core\Update; use Friendica\Core\Worker; -use Friendica\Factory; -use Friendica\Util\BasePath; +use Friendica\DI; +use Psr\Log\LoggerInterface; // Get options $shortopts = 'sn'; @@ -31,22 +47,21 @@ if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) { require dirname(__DIR__) . '/vendor/autoload.php'; -$basedir = BasePath::create(dirname(__DIR__), $_SERVER); -$configLoader = new Config\ConfigCacheLoader($basedir); -$config = Factory\ConfigFactory::createCache($configLoader); -$logger = Factory\LoggerFactory::create('worker', $config); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['worker']]); -$a = new App($config, $logger); +DI::init($dice); +$a = DI::app(); // Check the database structure and possibly fixes it -Update::check($a->getBasePath(), true); +Update::check($a->getBasePath(), true, DI::mode()); // Quit when in maintenance -if (!$a->getMode()->has(App\Mode::MAINTENANCEDISABLED)) { +if (!DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) { return; } -$a->setBaseURL(Config::get('system', 'url')); +DI::baseUrl()->saveByURL(DI::config()->get('system', 'url')); $spawn = array_key_exists('s', $options) || array_key_exists('spawn', $options); diff --git a/boot.php b/boot.php index 1f503c908a..b43fd6dc2f 100644 --- a/boot.php +++ b/boot.php @@ -1,11 +1,21 @@ . * * Friendica is a communications platform for integrated social communications * utilising decentralised communications and linkage to several indie social @@ -17,25 +27,23 @@ * easily as email does today. */ -use Friendica\App; -use Friendica\BaseObject; -use Friendica\Core\Config; -use Friendica\Core\PConfig; use Friendica\Core\Protocol; use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Model\Notify; use Friendica\Util\BasePath; use Friendica\Util\DateTimeFormat; define('FRIENDICA_PLATFORM', 'Friendica'); -define('FRIENDICA_CODENAME', 'The Tazmans Flax-lily'); -define('FRIENDICA_VERSION', '2019.03-dev'); +define('FRIENDICA_CODENAME', 'Red Hot Poker'); +define('FRIENDICA_VERSION', '2020.09-dev'); define('DFRN_PROTOCOL_VERSION', '2.23'); define('NEW_UPDATE_ROUTINE_VERSION', 1170); /** - * @brief Constant with a HTML line break. + * Constant with a HTML line break. * * Contains a HTML line break (br) element and a real carriage return with line * feed for the source. @@ -44,7 +52,7 @@ define('NEW_UPDATE_ROUTINE_VERSION', 1170); define('EOL', "
\r\n"); /** - * @brief Image storage quality. + * Image storage quality. * * Lower numbers save space at cost of image detail. * For ease of upgrade, please do not change here. Set system.jpegquality = n in config/local.config.php, @@ -81,17 +89,6 @@ define('MAX_IMAGE_LENGTH', -1); */ define('DEFAULT_DB_ENGINE', 'InnoDB'); -/** - * @name SSL Policy - * - * SSL redirection policies - * @{ - */ -define('SSL_POLICY_NONE', 0); -define('SSL_POLICY_FULL', 1); -define('SSL_POLICY_SELFSIGN', 2); -/* @}*/ - /** @deprecated since version 2019.03, please use \Friendica\Module\Register::CLOSED instead */ define('REGISTER_CLOSED', \Friendica\Module\Register::CLOSED); /** @deprecated since version 2019.03, please use \Friendica\Module\Register::APPROVE instead */ @@ -153,111 +150,31 @@ define('MAX_LIKERS', 75); * Email notification options * @{ */ -define('NOTIFY_INTRO', 1); -define('NOTIFY_CONFIRM', 2); -define('NOTIFY_WALL', 4); -define('NOTIFY_COMMENT', 8); -define('NOTIFY_MAIL', 16); -define('NOTIFY_SUGGEST', 32); -define('NOTIFY_PROFILE', 64); -define('NOTIFY_TAGSELF', 128); -define('NOTIFY_TAGSHARE', 256); -define('NOTIFY_POKE', 512); -define('NOTIFY_SHARE', 1024); +/** @deprecated since 2020.03, use Notify\Type::INTRO instead */ +define('NOTIFY_INTRO', Notify\Type::INTRO); +/** @deprecated since 2020.03, use Notify\Type::CONFIRM instead */ +define('NOTIFY_CONFIRM', Notify\Type::CONFIRM); +/** @deprecated since 2020.03, use Notify\Type::WALL instead */ +define('NOTIFY_WALL', Notify\Type::WALL); +/** @deprecated since 2020.03, use Notify\Type::COMMENT instead */ +define('NOTIFY_COMMENT', Notify\Type::COMMENT); +/** @deprecated since 2020.03, use Notify\Type::MAIL instead */ +define('NOTIFY_MAIL', Notify\Type::MAIL); +/** @deprecated since 2020.03, use Notify\Type::SUGGEST instead */ +define('NOTIFY_SUGGEST', Notify\Type::SUGGEST); +/** @deprecated since 2020.03, use Notify\Type::PROFILE instead */ +define('NOTIFY_PROFILE', Notify\Type::PROFILE); +/** @deprecated since 2020.03, use Notify\Type::TAG_SELF instead */ +define('NOTIFY_TAGSELF', Notify\Type::TAG_SELF); +/** @deprecated since 2020.03, use Notify\Type::TAG_SHARE instead */ +define('NOTIFY_TAGSHARE', Notify\Type::TAG_SHARE); +/** @deprecated since 2020.03, use Notify\Type::POKE instead */ +define('NOTIFY_POKE', Notify\Type::POKE); +/** @deprecated since 2020.03, use Notify\Type::SHARE instead */ +define('NOTIFY_SHARE', Notify\Type::SHARE); -define('SYSTEM_EMAIL', 16384); - -define('NOTIFY_SYSTEM', 32768); -/* @}*/ - - -/** - * @name Term - * - * Tag/term types - * @{ - */ -define('TERM_UNKNOWN', 0); -define('TERM_HASHTAG', 1); -define('TERM_MENTION', 2); -define('TERM_CATEGORY', 3); -define('TERM_PCATEGORY', 4); -define('TERM_FILE', 5); -define('TERM_SAVEDSEARCH', 6); -define('TERM_CONVERSATION', 7); - -define('TERM_OBJ_POST', 1); -define('TERM_OBJ_PHOTO', 2); - -/** - * @name Namespaces - * - * Various namespaces we may need to parse - * @{ - */ -define('NAMESPACE_ZOT', 'http://purl.org/zot'); -define('NAMESPACE_DFRN', 'http://purl.org/macgirvin/dfrn/1.0'); -define('NAMESPACE_THREAD', 'http://purl.org/syndication/thread/1.0'); -define('NAMESPACE_TOMB', 'http://purl.org/atompub/tombstones/1.0'); -define('NAMESPACE_ACTIVITY', 'http://activitystrea.ms/spec/1.0/'); -define('NAMESPACE_ACTIVITY_SCHEMA', 'http://activitystrea.ms/schema/1.0/'); -define('NAMESPACE_MEDIA', 'http://purl.org/syndication/atommedia'); -define('NAMESPACE_SALMON_ME', 'http://salmon-protocol.org/ns/magic-env'); -define('NAMESPACE_OSTATUSSUB', 'http://ostatus.org/schema/1.0/subscribe'); -define('NAMESPACE_GEORSS', 'http://www.georss.org/georss'); -define('NAMESPACE_POCO', 'http://portablecontacts.net/spec/1.0'); -define('NAMESPACE_FEED', 'http://schemas.google.com/g/2010#updates-from'); -define('NAMESPACE_OSTATUS', 'http://ostatus.org/schema/1.0'); -define('NAMESPACE_STATUSNET', 'http://status.net/schema/api/1/'); -define('NAMESPACE_ATOM1', 'http://www.w3.org/2005/Atom'); -define('NAMESPACE_MASTODON', 'http://mastodon.social/schema/1.0'); -/* @}*/ - -/** - * @name Activity - * - * Activity stream defines - * @{ - */ -define('ACTIVITY_LIKE', NAMESPACE_ACTIVITY_SCHEMA . 'like'); -define('ACTIVITY_DISLIKE', NAMESPACE_DFRN . '/dislike'); -define('ACTIVITY_ATTEND', NAMESPACE_ZOT . '/activity/attendyes'); -define('ACTIVITY_ATTENDNO', NAMESPACE_ZOT . '/activity/attendno'); -define('ACTIVITY_ATTENDMAYBE', NAMESPACE_ZOT . '/activity/attendmaybe'); - -define('ACTIVITY_OBJ_HEART', NAMESPACE_DFRN . '/heart'); - -define('ACTIVITY_FRIEND', NAMESPACE_ACTIVITY_SCHEMA . 'make-friend'); -define('ACTIVITY_REQ_FRIEND', NAMESPACE_ACTIVITY_SCHEMA . 'request-friend'); -define('ACTIVITY_UNFRIEND', NAMESPACE_ACTIVITY_SCHEMA . 'remove-friend'); -define('ACTIVITY_FOLLOW', NAMESPACE_ACTIVITY_SCHEMA . 'follow'); -define('ACTIVITY_UNFOLLOW', NAMESPACE_ACTIVITY_SCHEMA . 'stop-following'); -define('ACTIVITY_JOIN', NAMESPACE_ACTIVITY_SCHEMA . 'join'); - -define('ACTIVITY_POST', NAMESPACE_ACTIVITY_SCHEMA . 'post'); -define('ACTIVITY_UPDATE', NAMESPACE_ACTIVITY_SCHEMA . 'update'); -define('ACTIVITY_TAG', NAMESPACE_ACTIVITY_SCHEMA . 'tag'); -define('ACTIVITY_FAVORITE', NAMESPACE_ACTIVITY_SCHEMA . 'favorite'); -define('ACTIVITY_UNFAVORITE', NAMESPACE_ACTIVITY_SCHEMA . 'unfavorite'); -define('ACTIVITY_SHARE', NAMESPACE_ACTIVITY_SCHEMA . 'share'); -define('ACTIVITY_DELETE', NAMESPACE_ACTIVITY_SCHEMA . 'delete'); - -define('ACTIVITY_POKE', NAMESPACE_ZOT . '/activity/poke'); - -define('ACTIVITY_OBJ_BOOKMARK', NAMESPACE_ACTIVITY_SCHEMA . 'bookmark'); -define('ACTIVITY_OBJ_COMMENT', NAMESPACE_ACTIVITY_SCHEMA . 'comment'); -define('ACTIVITY_OBJ_NOTE', NAMESPACE_ACTIVITY_SCHEMA . 'note'); -define('ACTIVITY_OBJ_PERSON', NAMESPACE_ACTIVITY_SCHEMA . 'person'); -define('ACTIVITY_OBJ_IMAGE', NAMESPACE_ACTIVITY_SCHEMA . 'image'); -define('ACTIVITY_OBJ_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'photo'); -define('ACTIVITY_OBJ_VIDEO', NAMESPACE_ACTIVITY_SCHEMA . 'video'); -define('ACTIVITY_OBJ_P_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'profile-photo'); -define('ACTIVITY_OBJ_ALBUM', NAMESPACE_ACTIVITY_SCHEMA . 'photo-album'); -define('ACTIVITY_OBJ_EVENT', NAMESPACE_ACTIVITY_SCHEMA . 'event'); -define('ACTIVITY_OBJ_GROUP', NAMESPACE_ACTIVITY_SCHEMA . 'group'); -define('ACTIVITY_OBJ_TAGTERM', NAMESPACE_DFRN . '/tagterm'); -define('ACTIVITY_OBJ_PROFILE', NAMESPACE_DFRN . '/profile'); -define('ACTIVITY_OBJ_QUESTION', 'http://activityschema.org/object/question'); +/** @deprecated since 2020.12, use Notify\Type::SYSTEM instead */ +define('NOTIFY_SYSTEM', Notify\Type::SYSTEM); /* @}*/ /** @@ -312,70 +229,7 @@ if (!defined('CURLE_OPERATION_TIMEDOUT')) { } /** - * @brief Retrieve the App structure - * - * Useful in functions which require it but don't get it passed to them - * - * @deprecated since version 2018.09 - * @see BaseObject::getApp() - * @return App - */ -function get_app() -{ - return BaseObject::getApp(); -} - -/** - * Return the provided variable value if it exists and is truthy or the provided - * default value instead. - * - * Works with initialized variables and potentially uninitialized array keys - * - * Usages: - * - defaults($var, $default) - * - defaults($array, 'key', $default) - * - * @param array $args - * @brief Returns a defaut value if the provided variable or array key is falsy - * @return mixed - */ -function defaults(...$args) -{ - if (count($args) < 2) { - throw new BadFunctionCallException('defaults() requires at least 2 parameters'); - } - if (count($args) > 3) { - throw new BadFunctionCallException('defaults() cannot use more than 3 parameters'); - } - if (count($args) === 3 && is_null($args[1])) { - throw new BadFunctionCallException('defaults($arr, $key, $def) $key is null'); - } - - // The default value always is the last argument - $return = array_pop($args); - - if (count($args) == 2 && is_array($args[0]) && !empty($args[0][$args[1]])) { - $return = $args[0][$args[1]]; - } - - if (count($args) == 1 && !empty($args[0])) { - $return = $args[0]; - } - - return $return; -} - -/** - * @brief Used to end the current process, after saving session state. - * @deprecated - */ -function killme() -{ - exit(); -} - -/** - * @brief Returns the user id of locally logged in user or false. + * Returns the user id of locally logged in user or false. * * @return int|bool user id or false */ @@ -388,7 +242,7 @@ function local_user() } /** - * @brief Returns the public contact id of logged in user or false. + * Returns the public contact id of logged in user or false. * * @return int|bool public contact id or false */ @@ -399,10 +253,10 @@ function public_contact() if (!$public_contact_id && !empty($_SESSION['authenticated'])) { if (!empty($_SESSION['my_address'])) { // Local user - $public_contact_id = intval(Contact::getIdForURL($_SESSION['my_address'], 0, true)); + $public_contact_id = intval(Contact::getIdForURL($_SESSION['my_address'], 0, false)); } elseif (!empty($_SESSION['visitor_home'])) { // Remote user - $public_contact_id = intval(Contact::getIdForURL($_SESSION['visitor_home'], 0, true)); + $public_contact_id = intval(Contact::getIdForURL($_SESSION['visitor_home'], 0, false)); } } elseif (empty($_SESSION['authenticated'])) { $public_contact_id = false; @@ -412,31 +266,25 @@ function public_contact() } /** - * @brief Returns contact id of authenticated site visitor or false + * Returns public contact id of authenticated site visitor or false * * @return int|bool visitor_id or false */ function remote_user() { - // You cannot be both local and remote. - // Unncommented by rabuzarus because remote authentication to local - // profiles wasn't possible anymore (2018-04-12). -// if (local_user()) { -// return false; -// } - - if (empty($_SESSION)) { + if (empty($_SESSION['authenticated'])) { return false; } - if (!empty($_SESSION['authenticated']) && !empty($_SESSION['visitor_id'])) { + if (!empty($_SESSION['visitor_id'])) { return intval($_SESSION['visitor_id']); } + return false; } /** - * @brief Show an error message to user. + * Show an error message to user. * * This function save text in session, to be shown to the user at next page load * @@ -448,7 +296,7 @@ function notice($s) return; } - $a = \get_app(); + $a = DI::app(); if (empty($_SESSION['sysmsg'])) { $_SESSION['sysmsg'] = []; } @@ -458,7 +306,7 @@ function notice($s) } /** - * @brief Show an info message to user. + * Show an info message to user. * * This function save text in session, to be shown to the user at next page load * @@ -466,11 +314,7 @@ function notice($s) */ function info($s) { - $a = \get_app(); - - if (local_user() && PConfig::get(local_user(), 'system', 'ignore_info')) { - return; - } + $a = DI::app(); if (empty($_SESSION['sysmsg_info'])) { $_SESSION['sysmsg_info'] = []; @@ -504,7 +348,7 @@ function feed_birthday($uid, $tz) $tz = 'UTC'; } - $profile = DBA::selectFirst('profile', ['dob'], ['is-default' => true, 'uid' => $uid]); + $profile = DBA::selectFirst('profile', ['dob'], ['uid' => $uid]); if (DBA::isResult($profile)) { $tmp_dob = substr($profile['dob'], 5); if (intval($tmp_dob)) { @@ -523,52 +367,19 @@ function feed_birthday($uid, $tz) } /** - * @brief Check if current user has admin role. + * Check if current user has admin role. * * @return bool true if user is an admin */ function is_site_admin() { - $a = \get_app(); + $a = DI::app(); - $admin_email = Config::get('config', 'admin_email'); + $admin_email = DI::config()->get('config', 'admin_email'); $adminlist = explode(',', str_replace(' ', '', $admin_email)); - return local_user() && $admin_email && in_array(defaults($a->user, 'email', ''), $adminlist); -} - -/** - * @brief Returns querystring as string from a mapped array. - * - * @param array $params mapped array with query parameters - * @param string $name of parameter, default null - * - * @return string - */ -function build_querystring($params, $name = null) -{ - $ret = ""; - foreach ($params as $key => $val) { - if (is_array($val)) { - /// @TODO maybe not compare against null, use is_null() - if ($name == null) { - $ret .= build_querystring($val, $key); - } else { - $ret .= build_querystring($val, $name . "[$key]"); - } - } else { - $val = urlencode($val); - /// @TODO maybe not compare against null, use is_null() - if ($name != null) { - /// @TODO two string concated, can be merged to one - $ret .= $name . "[$key]" . "=$val&"; - } else { - $ret .= "$key=$val&"; - } - } - } - return $ret; + return local_user() && $admin_email && in_array($a->user['email'] ?? '', $adminlist); } function explode_querystring($query) @@ -625,22 +436,9 @@ function curPageURL() return $pageURL; } -function get_server() -{ - $server = Config::get("system", "directory"); - - if ($server == "") { - $server = "https://dir.friendica.social"; - } - - return $server; -} - function get_temppath() { - $a = \get_app(); - - $temppath = Config::get("system", "temppath"); + $temppath = DI::config()->get("system", "temppath"); if (($temppath != "") && System::isDirectoryUsable($temppath)) { // We have a temp path and it is usable @@ -656,7 +454,7 @@ function get_temppath() $temppath = BasePath::getRealPath($temppath); // To avoid any interferences with other systems we create our own directory - $new_temppath = $temppath . "/" . $a->getHostName(); + $new_temppath = $temppath . "/" . DI::baseUrl()->getHostname(); if (!is_dir($new_temppath)) { /// @TODO There is a mkdir()+chmod() upwards, maybe generalize this (+ configurable) into a function/method? mkdir($new_temppath); @@ -664,7 +462,7 @@ function get_temppath() if (System::isDirectoryUsable($new_temppath)) { // The new path is usable, we are happy - Config::set("system", "temppath", $new_temppath); + DI::config()->set("system", "temppath", $new_temppath); return $new_temppath; } else { // We can't create a subdirectory, strange. @@ -714,7 +512,7 @@ function clear_cache($basepath = "", $path = "") return; } - $cachetime = (int) Config::get('system', 'itemcache_duration'); + $cachetime = (int) DI::config()->get('system', 'itemcache_duration'); if ($cachetime == 0) { $cachetime = 86400; } @@ -738,12 +536,12 @@ function clear_cache($basepath = "", $path = "") function get_itemcachepath() { // Checking, if the cache is deactivated - $cachetime = (int) Config::get('system', 'itemcache_duration'); + $cachetime = (int) DI::config()->get('system', 'itemcache_duration'); if ($cachetime < 0) { return ""; } - $itemcache = Config::get('system', 'itemcache'); + $itemcache = DI::config()->get('system', 'itemcache'); if (($itemcache != "") && System::isDirectoryUsable($itemcache)) { return BasePath::getRealPath($itemcache); } @@ -757,7 +555,7 @@ function get_itemcachepath() } if (System::isDirectoryUsable($itemcache)) { - Config::set("system", "itemcache", $itemcache); + DI::config()->set("system", "itemcache", $itemcache); return $itemcache; } } @@ -765,13 +563,13 @@ function get_itemcachepath() } /** - * @brief Returns the path where spool files are stored + * Returns the path where spool files are stored * * @return string Spool path */ function get_spoolpath() { - $spoolpath = Config::get('system', 'spoolpath'); + $spoolpath = DI::config()->get('system', 'spoolpath'); if (($spoolpath != "") && System::isDirectoryUsable($spoolpath)) { // We have a spool path and it is usable return $spoolpath; @@ -789,7 +587,7 @@ function get_spoolpath() if (System::isDirectoryUsable($spoolpath)) { // The new path is usable, we are happy - Config::set("system", "spoolpath", $spoolpath); + DI::config()->set("system", "spoolpath", $spoolpath); return $spoolpath; } else { // We can't create a subdirectory, strange. @@ -841,22 +639,3 @@ function validate_include(&$file) // Simply return flag return $valid; } - -/** - * PHP 5 compatible dirname() with count parameter - * - * @see http://php.net/manual/en/function.dirname.php#113193 - * - * @deprecated with PHP 7 - * @param string $path - * @param int $levels - * @return string - */ -function rdirname($path, $levels = 1) -{ - if ($levels > 1) { - return dirname(rdirname($path, --$levels)); - } else { - return dirname($path); - } -} diff --git a/composer.json b/composer.json index 39d9358926..2d6b46574d 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "issues": "https://github.com/friendica/friendica/issues" }, "require": { - "php": ">=5.6.1", + "php": ">=7.0", "ext-ctype": "*", "ext-curl": "*", "ext-dom": "*", @@ -27,30 +27,43 @@ "ext-simplexml": "*", "ext-xml": "*", "asika/simple-console": "^1.0", - "divineomega/password_exposed": "^2.4", - "ezyang/htmlpurifier": "~4.7.0", + "bacon/bacon-qr-code": "^1.0", + "divineomega/password_exposed": "^2.8", + "ezyang/htmlpurifier": "^4.7", "friendica/json-ld": "^1.0", - "league/html-to-markdown": "~4.8.0", + "league/html-to-markdown": "^4.8", + "level-2/dice": "^4", "lightopenid/lightopenid": "dev-master", "michelf/php-markdown": "^1.7", - "mobiledetect/mobiledetectlib": "2.8.*", - "paragonie/random_compat": "^2.0", - "pear/Text_LanguageDetect": "1.*", + "mobiledetect/mobiledetectlib": "^2.8", + "monolog/monolog": "^1.25", + "nikic/fast-route": "^1.3", + "paragonie/hidden-string": "^1.0", + "pear/console_table": "^1.3", + "pear/text_languagedetect": "1.*", + "pragmarx/google2fa": "^5.0", + "pragmarx/recovery": "^0.1.0", + "psr/container": "^1.0", "seld/cli-prompt": "^1.0", "smarty/smarty": "^3.1", - "fxp/composer-asset-plugin": "~1.3", + "fxp/composer-asset-plugin": "^1.4", "bower-asset/base64": "^1.0", - "bower-asset/Chart-js": "^2.7", - "bower-asset/perfect-scrollbar": "^0.6", - "bower-asset/vue": "^2.5", + "bower-asset/chart-js": "^2.8", + "bower-asset/dompurify": "^1.0", + "bower-asset/fork-awesome": "^1.1", + "bower-asset/vue": "^2.6", + "npm-asset/cropperjs": "1.2.2", + "npm-asset/es-jquery-sortable": "^0.9.13", + "npm-asset/fullcalendar": "^3.10", + "npm-asset/imagesloaded": "4.1.4", "npm-asset/jquery": "^2.0", "npm-asset/jquery-colorbox": "^1.6", - "npm-asset/jquery-datetimepicker": "^2.4.0", + "npm-asset/jquery-datetimepicker": "^2.5", "npm-asset/jgrowl": "^1.4", - "npm-asset/fullcalendar": "^3.0.1", - "npm-asset/cropperjs": "1.2.2", - "npm-asset/imagesloaded": "4.1.4", - "monolog/monolog": "^1.24" + "npm-asset/moment": "^2.24", + "npm-asset/perfect-scrollbar": "0.6.16", + "npm-asset/textcomplete": "^0.18.2", + "npm-asset/typeahead.js": "^0.11.1" }, "repositories": [ { @@ -61,7 +74,6 @@ "autoload": { "psr-4": { "Friendica\\": "src/", - "Friendica\\Test\\": "tests/", "Friendica\\Addon\\": "addon/" }, "psr-0": { @@ -71,12 +83,18 @@ "include/conversation.php", "include/dba.php", "include/enotify.php", - "include/items.php", - "include/text.php", "boot.php" ] }, + "autoload-dev": { + "psr-4": { + "Friendica\\Test\\": "tests/" + } + }, "config": { + "platform": { + "php": "7.0" + }, "autoloader-suffix": "Friendica", "optimize-autoloader": true, "preferred-install": "dist", @@ -89,16 +107,28 @@ }, "archive": { "exclude": [ - "log", "cache", "/photo", "/proxy" + "/.*", + "/*file", + "!/.htaccess-dist", + "/tests", + "/*.xml", + "/composer.*", + "/log", + "/cache", + "/photo", + "/proxy", + "/addon", + "!/vendor", + "!/view/asset" ] }, "require-dev": { - "phpunit/dbunit": "^2.0", "phpdocumentor/reflection-docblock": "^3.0.2", "phpunit/php-token-stream": "^1.4.2", - "mikey179/vfsStream": "^1.6", + "mikey179/vfsstream": "^1.6", "mockery/mockery": "^1.2", - "johnkary/phpunit-speedtrap": "1.1" + "johnkary/phpunit-speedtrap": "1.1", + "jakub-onderka/php-parallel-lint": "^1.0" }, "scripts": { "test": "phpunit" diff --git a/composer.lock b/composer.lock index f91b833de7..9f6f78d000 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b944adfb6ede89430ba3b7e9ebb45acb", + "content-hash": "7d1fe40c28d815b56d0b5cb323860b26", "packages": [ { "name": "asika/simple-console", @@ -40,17 +40,63 @@ "time": "2018-03-08T12:05:40+00:00" }, { - "name": "bower-asset/Chart-js", - "version": "v2.7.2", + "name": "bacon/bacon-qr-code", + "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/chartjs/Chart.js.git", - "reference": "98f104cdd03617f1300b417b3d60c23d4e3e3403" + "url": "https://github.com/Bacon/BaconQrCode.git", + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chartjs/Chart.js/zipball/98f104cdd03617f1300b417b3d60c23d4e3e3403", - "reference": "98f104cdd03617f1300b417b3d60c23d4e3e3403", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee", + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": "^5.4|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, + "suggest": { + "ext-gd": "to generate QR code images" + }, + "type": "library", + "autoload": { + "psr-0": { + "BaconQrCode": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", + "homepage": "http://www.dasprids.de", + "role": "Developer" + } + ], + "description": "BaconQrCode is a QR code generator for PHP.", + "homepage": "https://github.com/Bacon/BaconQrCode", + "time": "2017-10-17T09:59:25+00:00" + }, + { + "name": "bower-asset/Chart-js", + "version": "v2.9.3", + "source": { + "type": "git", + "url": "https://github.com/chartjs/Chart.js.git", + "reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/chartjs/Chart.js/zipball/06f73dc3590084b2c464bf08189c7aee2b6b92d2", + "reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2", "shasum": "" }, "type": "bower-asset-library", @@ -69,20 +115,20 @@ "MIT" ], "description": "Simple HTML5 charts using the canvas element.", - "time": "2018-03-01T21:45:21+00:00" + "time": "2019-11-14T18:37:30+00:00" }, { "name": "bower-asset/base64", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/davidchambers/Base64.js.git", - "reference": "b2d49f347ed1bce61000a82769bffc837b7c79dc" + "reference": "660b299aa4854843fd35d42b30eda9273125b9da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/davidchambers/Base64.js/zipball/b2d49f347ed1bce61000a82769bffc837b7c79dc", - "reference": "b2d49f347ed1bce61000a82769bffc837b7c79dc", + "url": "https://api.github.com/repos/davidchambers/Base64.js/zipball/660b299aa4854843fd35d42b30eda9273125b9da", + "reference": "660b299aa4854843fd35d42b30eda9273125b9da", "shasum": "" }, "type": "bower-asset-library", @@ -100,70 +146,130 @@ "WTFPL" ], "description": "Base64 encoding and decoding", - "time": "2017-03-25T21:16:21+00:00" + "time": "2019-11-02T20:07:47+00:00" }, { - "name": "bower-asset/perfect-scrollbar", - "version": "0.6.16", + "name": "bower-asset/dompurify", + "version": "1.0.11", "source": { "type": "git", - "url": "https://github.com/utatti/perfect-scrollbar-bower.git", - "reference": "3049129e5dbb403295ce8507a461cdd0f200938c" + "url": "https://github.com/cure53/DOMPurify.git", + "reference": "3c1c0d7e11cda896b0c69cf82e0ca6e0c0e7dd38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utatti/perfect-scrollbar-bower/zipball/3049129e5dbb403295ce8507a461cdd0f200938c", - "reference": "3049129e5dbb403295ce8507a461cdd0f200938c", + "url": "https://api.github.com/repos/cure53/DOMPurify/zipball/3c1c0d7e11cda896b0c69cf82e0ca6e0c0e7dd38", + "reference": "3c1c0d7e11cda896b0c69cf82e0ca6e0c0e7dd38", + "shasum": "" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": "src/purify.js", + "bower-asset-ignore": [ + "**/.*", + "demos", + "scripts", + "test", + "website" + ] + }, + "license": [ + "MPL-2.0", + "Apache-2.0" + ], + "description": "A DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG", + "keywords": [ + "cross site scripting", + "dom", + "filter", + "html", + "mathml", + "sanitize", + "sanitizer", + "secure", + "security", + "svg", + "xss" + ], + "time": "2019-06-18T13:33:05+00:00" + }, + { + "name": "bower-asset/fork-awesome", + "version": "1.1.7", + "source": { + "type": "git", + "url": "https://github.com/ForkAwesome/Fork-Awesome.git", + "reference": "326af9c8bee0c80ff4c00cb2fadd4f1edd2a08c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ForkAwesome/Fork-Awesome/zipball/326af9c8bee0c80ff4c00cb2fadd4f1edd2a08c3", + "reference": "326af9c8bee0c80ff4c00cb2fadd4f1edd2a08c3", "shasum": "" }, "type": "bower-asset-library", "extra": { "bower-asset-main": [ - "css/perfect-scrollbar.css", - "js/perfect-scrollbar.js" + "less/fork-awesome.less", + "scss/fork-awesome.scss" ], "bower-asset-ignore": [ - "**/.*", - "bower_components" + "*/.*", + "*.json", + "src", + "*.yml", + "Gemfile", + "Gemfile.lock", + "*.md" ] }, "license": [ - "MIT" + "OFL-1.1", + "MIT", + "CC-BY-3.0" ], - "description": "Minimalistic but perfect custom scrollbar plugin", - "time": "2017-01-10T01:04:09+00:00" + "description": "Fork Awesome", + "keywords": [ + "awesome", + "font", + "fork", + "icon" + ], + "time": "2019-02-28T15:21:34+00:00" }, { "name": "bower-asset/vue", - "version": "v2.5.17", + "version": "v2.6.11", "source": { "type": "git", "url": "https://github.com/vuejs/vue.git", - "reference": "636c9b4ef17f2062720b677cbbe613f146f4d4db" + "reference": "ec78fc8b6d03e59da669be1adf4b4b5abf670a34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vuejs/vue/zipball/636c9b4ef17f2062720b677cbbe613f146f4d4db", - "reference": "636c9b4ef17f2062720b677cbbe613f146f4d4db", + "url": "https://api.github.com/repos/vuejs/vue/zipball/ec78fc8b6d03e59da669be1adf4b4b5abf670a34", + "reference": "ec78fc8b6d03e59da669be1adf4b4b5abf670a34", "shasum": "" }, "type": "bower-asset-library" }, { "name": "divineomega/do-file-cache", - "version": "v2.0.2", + "version": "v2.0.6", "source": { "type": "git", "url": "https://github.com/DivineOmega/DO-File-Cache.git", - "reference": "261c6e30a0de8cd325f826d08b2e51b2e367a1a3" + "reference": "23696a8a4c3ebe2ab3d68a35b2698fa103f69334" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DivineOmega/DO-File-Cache/zipball/261c6e30a0de8cd325f826d08b2e51b2e367a1a3", - "reference": "261c6e30a0de8cd325f826d08b2e51b2e367a1a3", + "url": "https://api.github.com/repos/DivineOmega/DO-File-Cache/zipball/23696a8a4c3ebe2ab3d68a35b2698fa103f69334", + "reference": "23696a8a4c3ebe2ab3d68a35b2698fa103f69334", "shasum": "" }, "require": { + "ext-json": "*", + "ext-zlib": "*", "php": ">=5.6" }, "require-dev": { @@ -194,7 +300,7 @@ "library", "php" ], - "time": "2018-09-12T23:08:34+00:00" + "time": "2018-12-31T09:36:51+00:00" }, { "name": "divineomega/do-file-cache-psr-6", @@ -240,28 +346,28 @@ }, { "name": "divineomega/password_exposed", - "version": "v2.5.3", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/DivineOmega/password_exposed.git", - "reference": "1f1b49e3ec55b0f07115d342b145091368b081c4" + "reference": "908ed8e62ef95411bd0f866e29c69cef2bbca880" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DivineOmega/password_exposed/zipball/1f1b49e3ec55b0f07115d342b145091368b081c4", - "reference": "1f1b49e3ec55b0f07115d342b145091368b081c4", + "url": "https://api.github.com/repos/DivineOmega/password_exposed/zipball/908ed8e62ef95411bd0f866e29c69cef2bbca880", + "reference": "908ed8e62ef95411bd0f866e29c69cef2bbca880", "shasum": "" }, "require": { "divineomega/do-file-cache-psr-6": "^2.0", "guzzlehttp/guzzle": "^6.3", - "paragonie/certainty": "^1", + "paragonie/certainty": "^1|^2", "php": ">=5.6" }, "require-dev": { "fzaninotto/faker": "^1.7", "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5.7", + "phpunit/phpunit": "^6.5", "vimeo/psalm": "^1" }, "type": "library", @@ -284,25 +390,28 @@ } ], "description": "This PHP package provides a `password_exposed` helper function, that uses the haveibeenpwned.com API to check if a password has been exposed in a data breach.", - "time": "2018-07-12T22:09:43+00:00" + "time": "2019-01-25T12:00:28+00:00" }, { "name": "ezyang/htmlpurifier", - "version": "v4.7.0", + "version": "v4.12.0", "source": { "type": "git", "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "ae1828d955112356f7677c465f94f7deb7d27a40" + "reference": "a617e55bc62a87eec73bd456d146d134ad716f03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/ae1828d955112356f7677c465f94f7deb7d27a40", - "reference": "ae1828d955112356f7677c465f94f7deb7d27a40", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/a617e55bc62a87eec73bd456d146d134ad716f03", + "reference": "a617e55bc62a87eec73bd456d146d134ad716f03", "shasum": "" }, "require": { "php": ">=5.2" }, + "require-dev": { + "simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd" + }, "type": "library", "autoload": { "psr-0": { @@ -314,7 +423,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL" + "LGPL-2.1-or-later" ], "authors": [ { @@ -328,7 +437,7 @@ "keywords": [ "html" ], - "time": "2015-08-05T01:03:42+00:00" + "time": "2019-10-28T03:44:26+00:00" }, { "name": "friendica/json-ld", @@ -376,16 +485,16 @@ }, { "name": "fxp/composer-asset-plugin", - "version": "v1.4.4", + "version": "v1.4.6", "source": { "type": "git", "url": "https://github.com/fxpio/composer-asset-plugin.git", - "reference": "0d07328eef6e6f3753aa835fd2faef7fed1717bf" + "reference": "886ece037849d3935c5a34cdcd984e46f2de5fae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fxpio/composer-asset-plugin/zipball/0d07328eef6e6f3753aa835fd2faef7fed1717bf", - "reference": "0d07328eef6e6f3753aa835fd2faef7fed1717bf", + "url": "https://api.github.com/repos/fxpio/composer-asset-plugin/zipball/886ece037849d3935c5a34cdcd984e46f2de5fae", + "reference": "886ece037849d3935c5a34cdcd984e46f2de5fae", "shasum": "" }, "require": { @@ -431,31 +540,33 @@ "npm", "package" ], - "time": "2018-07-02T11:37:17+00:00" + "time": "2019-08-08T18:36:07+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "6.3.3", + "version": "6.5.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", "shasum": "" }, "require": { + "ext-json": "*", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" + "guzzlehttp/psr7": "^1.6.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17.0" }, "require-dev": { "ext-curl": "*", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" + "psr/log": "^1.1" }, "suggest": { "psr/log": "Required for using the Log middleware" @@ -463,16 +574,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.3-dev" + "dev-master": "6.5-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\": "src/" - } + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -496,7 +607,7 @@ "rest", "web service" ], - "time": "2018-04-22T15:46:56+00:00" + "time": "2020-06-16T21:01:06+00:00" }, { "name": "guzzlehttp/promises", @@ -551,32 +662,37 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.4.2", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0" + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -606,26 +722,27 @@ "keywords": [ "http", "message", + "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2019-07-01T23:21:34+00:00" }, { "name": "league/html-to-markdown", - "version": "4.8.0", + "version": "4.9.1", "source": { "type": "git", "url": "https://github.com/thephpleague/html-to-markdown.git", - "reference": "f9a879a068c68ff47b722de63f58bec79e448f9d" + "reference": "1dcd0f85de786f46a7f224a27cc3d709ddd2a68c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/f9a879a068c68ff47b722de63f58bec79e448f9d", - "reference": "f9a879a068c68ff47b722de63f58bec79e448f9d", + "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/1dcd0f85de786f46a7f224a27cc3d709ddd2a68c", + "reference": "1dcd0f85de786f46a7f224a27cc3d709ddd2a68c", "shasum": "" }, "require": { @@ -635,7 +752,7 @@ }, "require-dev": { "mikehaertl/php-shellcommand": "~1.1.0", - "phpunit/phpunit": "4.*", + "phpunit/phpunit": "^4.8|^5.7", "scrutinizer/ocular": "~1.1" }, "bin": [ @@ -644,7 +761,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "4.10-dev" } }, "autoload": { @@ -657,17 +774,17 @@ "MIT" ], "authors": [ - { - "name": "Nick Cernis", - "email": "nick@cern.is", - "homepage": "http://modernnerd.net", - "role": "Original Author" - }, { "name": "Colin O'Dell", "email": "colinodell@gmail.com", "homepage": "https://www.colinodell.com", "role": "Lead Developer" + }, + { + "name": "Nick Cernis", + "email": "nick@cern.is", + "homepage": "http://modernnerd.net", + "role": "Original Author" } ], "description": "An HTML-to-markdown conversion helper for PHP", @@ -676,7 +793,53 @@ "html", "markdown" ], - "time": "2018-09-18T12:18:08+00:00" + "time": "2019-12-28T01:32:28+00:00" + }, + { + "name": "level-2/dice", + "version": "4.0.2", + "source": { + "type": "git", + "url": "https://github.com/Level-2/Dice.git", + "reference": "b9336d9200d0165c31e982374dc5d8d2552807bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Level-2/Dice/zipball/b9336d9200d0165c31e982374dc5d8d2552807bc", + "reference": "b9336d9200d0165c31e982374dc5d8d2552807bc", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Dice\\": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Tom Butler", + "email": "tom@r.je" + } + ], + "description": "A minimalist Dependency injection container (DIC) for PHP. Please note: 3.0+ is only compatible with PHP 7.0. The 2.0 branch is compatbile with PHP 5.6.", + "homepage": "http://r.je/dice.html", + "keywords": [ + "dependency injection", + "dependency injection container", + "di", + "ioc" + ], + "time": "2020-01-28T13:47:49+00:00" }, { "name": "lightopenid/lightopenid", @@ -713,21 +876,24 @@ }, { "name": "michelf/php-markdown", - "version": "1.8.0", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/michelf/php-markdown.git", - "reference": "01ab082b355bf188d907b9929cd99b2923053495" + "reference": "c83178d49e372ca967d1a8c77ae4e051b3a3c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/michelf/php-markdown/zipball/01ab082b355bf188d907b9929cd99b2923053495", - "reference": "01ab082b355bf188d907b9929cd99b2923053495", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/c83178d49e372ca967d1a8c77ae4e051b3a3c75c", + "reference": "c83178d49e372ca967d1a8c77ae4e051b3a3c75c", "shasum": "" }, "require": { "php": ">=5.3.0" }, + "require-dev": { + "phpunit/phpunit": ">=4.3 <5.8" + }, "type": "library", "autoload": { "psr-4": { @@ -755,20 +921,20 @@ "keywords": [ "markdown" ], - "time": "2018-01-15T00:49:33+00:00" + "time": "2019-12-02T02:32:27+00:00" }, { "name": "mobiledetect/mobiledetectlib", - "version": "2.8.33", + "version": "2.8.34", "source": { "type": "git", "url": "https://github.com/serbanghita/Mobile-Detect.git", - "reference": "cd385290f9a0d609d2eddd165a1e44ec1bf12102" + "reference": "6f8113f57a508494ca36acbcfa2dc2d923c7ed5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/cd385290f9a0d609d2eddd165a1e44ec1bf12102", - "reference": "cd385290f9a0d609d2eddd165a1e44ec1bf12102", + "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/6f8113f57a508494ca36acbcfa2dc2d923c7ed5b", + "reference": "6f8113f57a508494ca36acbcfa2dc2d923c7ed5b", "shasum": "" }, "require": { @@ -807,20 +973,20 @@ "mobile detector", "php mobile detect" ], - "time": "2018-09-01T15:05:15+00:00" + "time": "2019-09-18T18:44:20+00:00" }, { "name": "monolog/monolog", - "version": "1.24.0", + "version": "1.25.4", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" + "reference": "3022efff205e2448b560c833c6fbbf91c3139168" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/3022efff205e2448b560c833c6fbbf91c3139168", + "reference": "3022efff205e2448b560c833c6fbbf91c3139168", "shasum": "" }, "require": { @@ -834,11 +1000,10 @@ "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", + "php-parallel-lint/php-parallel-lint": "^1.0", "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", "ruflin/elastica": ">=0.90 <3.0", "sentry/sentry": "^0.13", "swiftmailer/swiftmailer": "^5.3|^6.0" @@ -885,7 +1050,53 @@ "logging", "psr-3" ], - "time": "2018-11-05T09:00:11+00:00" + "time": "2020-05-22T07:31:27+00:00" + }, + { + "name": "nikic/fast-route", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/FastRoute.git", + "reference": "181d480e08d9476e61381e04a71b34dc0432e812" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", + "reference": "181d480e08d9476e61381e04a71b34dc0432e812", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|~5.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "FastRoute\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov", + "email": "nikic@php.net" + } + ], + "description": "Fast request router for PHP", + "keywords": [ + "router", + "routing" + ], + "time": "2018-02-13T20:26:39+00:00" }, { "name": "npm-asset/cropperjs", @@ -893,7 +1104,6 @@ "dist": { "type": "tar", "url": "https://registry.npmjs.org/cropperjs/-/cropperjs-1.2.2.tgz", - "reference": null, "shasum": "30dc7a7ce872155b23a33bd10ad4c76c0d613f55" }, "require-dev": { @@ -981,13 +1191,55 @@ ], "time": "2018-01-03T13:39:39+00:00" }, + { + "name": "npm-asset/es-jquery-sortable", + "version": "0.9.13-patch2", + "dist": { + "type": "tar", + "url": "https://registry.npmjs.org/es-jquery-sortable/-/es-jquery-sortable-0.9.13-patch2.tgz", + "shasum": "a4db16d133fbce1bcd1543c98279902a6b0812a3" + }, + "require": { + "npm-asset/jquery": ">=2.1.2,<3.0.0" + }, + "type": "npm-asset-library", + "extra": { + "npm-asset-bugs": { + "url": "https://github.com/johnny/jquery-sortable/issues" + }, + "npm-asset-main": "./source/js/jquery-sortable.js", + "npm-asset-directories": [], + "npm-asset-repository": { + "type": "git", + "url": "git+https://github.com/johnny/jquery-sortable.git" + }, + "npm-asset-scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + } + }, + "license": [ + "BSD-3" + ], + "authors": [ + "" + ], + "description": "jquery plugin for sortable, nestable lists", + "homepage": "https://github.com/johnny/jquery-sortable", + "keywords": [ + "drag", + "dragging", + "sort", + "sortable", + "sorting" + ], + "time": "2019-11-20T03:55:51+00:00" + }, { "name": "npm-asset/ev-emitter", "version": "1.1.1", "dist": { "type": "tar", "url": "https://registry.npmjs.org/ev-emitter/-/ev-emitter-1.1.1.tgz", - "reference": null, "shasum": "8f18b0ce5c76a5d18017f71c0a795c65b9138f2a" }, "type": "npm-asset-library", @@ -1025,33 +1277,75 @@ "time": "2017-07-06T13:46:38+00:00" }, { - "name": "npm-asset/fullcalendar", - "version": "3.9.0", + "name": "npm-asset/eventemitter3", + "version": "2.0.3", "dist": { "type": "tar", - "url": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-3.9.0.tgz", - "reference": null, - "shasum": "b608a9989f3416f0b1d526c6bdfeeaf2ac79eda5" + "url": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", + "shasum": "b5e1079b59fb5e1ba2771c0a993be060a58c99ba" }, - "require": { - "npm-asset/jquery": ">=2,<4.0", - "npm-asset/moment": ">=2.20.1,<3.0.0" + "type": "npm-asset-library", + "extra": { + "npm-asset-bugs": { + "url": "https://github.com/primus/eventemitter3/issues" + }, + "npm-asset-main": "index.js", + "npm-asset-directories": [], + "npm-asset-repository": { + "type": "git", + "url": "git://github.com/primus/eventemitter3.git" + }, + "npm-asset-scripts": { + "build": "mkdir -p umd && browserify index.js -s EventEmitter3 | uglifyjs -m -o umd/eventemitter3.min.js", + "benchmark": "find benchmarks/run -name '*.js' -exec benchmarks/start.sh {} \\;", + "test": "nyc --reporter=html --reporter=text mocha", + "test-browser": "zuul -- test.js", + "prepublish": "npm run build", + "sync": "node versions.js" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arnout Kazemier" + } + ], + "description": "EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface.", + "homepage": "https://github.com/primus/eventemitter3#readme", + "keywords": [ + "EventEmitter", + "EventEmitter2", + "EventEmitter3", + "Events", + "addEventListener", + "addListener", + "emit", + "emits", + "emitter", + "event", + "once", + "pub/sub", + "publish", + "reactor", + "subscribe" + ], + "time": "2017-03-31T14:51:09+00:00" + }, + { + "name": "npm-asset/fullcalendar", + "version": "3.10.2", + "dist": { + "type": "tar", + "url": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-3.10.2.tgz", + "shasum": "9b1ba84bb02803621b761d1bba91a4f18affafb7" }, "type": "npm-asset-library", "extra": { "npm-asset-bugs": { "url": "https://fullcalendar.io/wiki/Reporting-Bugs/" }, - "npm-asset-files": [ - "dist/*.js", - "dist/*.css", - "dist/*.d.ts", - "dist/locale/*.js", - "README.*", - "LICENSE.*", - "CHANGELOG.*", - "CONTRIBUTING.*" - ], "npm-asset-main": "dist/fullcalendar.js", "npm-asset-directories": [], "npm-asset-repository": { @@ -1061,7 +1355,7 @@ "npm-asset-scripts": { "clean": "gulp clean", "dist": "gulp dist", - "lint": "gulp lint", + "lint": "gulp lint-and-example-repos", "test": "gulp test:single" } }, @@ -1083,7 +1377,7 @@ "full-sized", "jquery-plugin" ], - "time": "2018-03-05T03:30:23+00:00" + "time": "2020-05-19T03:44:55+00:00" }, { "name": "npm-asset/imagesloaded", @@ -1091,7 +1385,6 @@ "dist": { "type": "tar", "url": "https://registry.npmjs.org/imagesloaded/-/imagesloaded-4.1.4.tgz", - "reference": null, "shasum": "1376efcd162bb768c34c3727ac89cc04051f3cc7" }, "require": { @@ -1155,7 +1448,6 @@ "dist": { "type": "tar", "url": "https://registry.npmjs.org/jgrowl/-/jgrowl-1.4.6.tgz", - "reference": null, "shasum": "2736e332aaee73ccf0a14a5f0066391a0a13f4a3" }, "require-dev": { @@ -1196,7 +1488,6 @@ "dist": { "type": "tar", "url": "https://registry.npmjs.org/jquery/-/jquery-2.2.4.tgz", - "reference": null, "shasum": "2c89d6889b5eac522a7eea32c14521559c6cbf02" }, "require-dev": { @@ -1267,7 +1558,6 @@ "dist": { "type": "tar", "url": "https://registry.npmjs.org/jquery-colorbox/-/jquery-colorbox-1.6.4.tgz", - "reference": null, "shasum": "799452523a6c494839224ef702e807deb9c06cc5" }, "require": { @@ -1310,12 +1600,11 @@ }, { "name": "npm-asset/jquery-datetimepicker", - "version": "2.5.20", + "version": "2.5.21", "dist": { "type": "tar", - "url": "https://registry.npmjs.org/jquery-datetimepicker/-/jquery-datetimepicker-2.5.20.tgz", - "reference": null, - "shasum": "687d6204b90b03dc93f725f8df036e1d061f37ac" + "url": "https://registry.npmjs.org/jquery-datetimepicker/-/jquery-datetimepicker-2.5.21.tgz", + "shasum": "00c388a78df2732fedfdb5c6529b6e84d53e0235" }, "require": { "npm-asset/jquery": ">=1.7.2", @@ -1364,7 +1653,7 @@ "time", "timepicker" ], - "time": "2018-03-21T16:26:39+00:00" + "time": "2019-02-23T11:25:30+00:00" }, { "name": "npm-asset/jquery-mousewheel", @@ -1372,7 +1661,6 @@ "dist": { "type": "tar", "url": "https://registry.npmjs.org/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz", - "reference": null, "shasum": "06f0335f16e353a695e7206bf50503cb523a6ee5" }, "require-dev": { @@ -1423,12 +1711,11 @@ }, { "name": "npm-asset/moment", - "version": "2.22.2", + "version": "2.26.0", "dist": { "type": "tar", - "url": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", - "reference": null, - "shasum": "3c257f9839fc0e93ff53149632239eb90783ff66" + "url": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz", + "shasum": "5e1f82c6bafca6e83e808b30c8705eed0dcbd39a" }, "type": "npm-asset-library", "extra": { @@ -1442,8 +1729,12 @@ "url": "git+https://github.com/moment/moment.git" }, "npm-asset-scripts": { - "typescript-test": "tsc --project typing-tests", + "ts3.1-typescript-test": "cross-env node_modules/typescript3/bin/tsc --project ts3.1-typing-tests", + "typescript-test": "cross-env node_modules/typescript/bin/tsc --project typing-tests", "test": "grunt test", + "eslint": "eslint Gruntfile.js tasks src", + "prettier-check": "prettier --check Gruntfile.js tasks src", + "prettier-fmt": "prettier --write Gruntfile.js tasks src", "coverage": "nyc npm test && nyc report", "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" }, @@ -1486,7 +1777,7 @@ } ], "description": "Parse, validate, manipulate, and display dates", - "homepage": "http://momentjs.com", + "homepage": "https://momentjs.com", "keywords": [ "date", "ender", @@ -1498,20 +1789,78 @@ "time", "validate" ], - "time": "2018-06-01T06:58:41+00:00" + "time": "2020-05-20T06:46:22+00:00" + }, + { + "name": "npm-asset/perfect-scrollbar", + "version": "0.6.16", + "dist": { + "type": "tar", + "url": "https://registry.npmjs.org/perfect-scrollbar/-/perfect-scrollbar-0.6.16.tgz", + "shasum": "b1d61a5245cf3962bb9a8407a3fc669d923212fc" + }, + "type": "npm-asset-library", + "extra": { + "npm-asset-bugs": { + "url": "https://github.com/noraesae/perfect-scrollbar/issues" + }, + "npm-asset-files": [ + "dist", + "src", + "index.js", + "jquery.js", + "perfect-scrollbar.d.ts" + ], + "npm-asset-main": "./index.js", + "npm-asset-directories": [], + "npm-asset-repository": { + "type": "git", + "url": "git+https://github.com/noraesae/perfect-scrollbar.git" + }, + "npm-asset-scripts": { + "test": "gulp", + "before-deploy": "gulp && gulp compress", + "release": "rm -rf dist && gulp && npm publish" + }, + "npm-asset-engines": { + "node": ">= 0.12.0" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Hyunje Jun", + "email": "me@noraesae.net" + }, + { + "name": "Hyunje Jun", + "email": "me@noraesae.net" + } + ], + "description": "Minimalistic but perfect custom scrollbar plugin", + "homepage": "https://github.com/noraesae/perfect-scrollbar#readme", + "keywords": [ + "frontend", + "jquery-plugin", + "scroll", + "scrollbar" + ], + "time": "2017-01-10T01:03:05+00:00" }, { "name": "npm-asset/php-date-formatter", - "version": "v1.3.5", + "version": "v1.3.6", "source": { "type": "git", "url": "https://github.com/kartik-v/php-date-formatter.git", - "reference": "d842e1c4e6a8d6108017b726321c305bb5ae4fb5" + "reference": "514a53660b0d69439236fd3cbc3f41512adb00a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kartik-v/php-date-formatter/zipball/d842e1c4e6a8d6108017b726321c305bb5ae4fb5", - "reference": "d842e1c4e6a8d6108017b726321c305bb5ae4fb5", + "url": "https://api.github.com/repos/kartik-v/php-date-formatter/zipball/514a53660b0d69439236fd3cbc3f41512adb00a0", + "reference": "514a53660b0d69439236fd3cbc3f41512adb00a0", "shasum": "" }, "type": "npm-asset-library", @@ -1536,31 +1885,221 @@ ], "description": "A Javascript datetime formatting and manipulation library using PHP date-time formats.", "homepage": "https://github.com/kartik-v/php-date-formatter", - "time": "2018-07-13T06:56:46+00:00" + "time": "2020-04-14T10:16:32+00:00" + }, + { + "name": "npm-asset/textarea-caret", + "version": "3.1.0", + "dist": { + "type": "tar", + "url": "https://registry.npmjs.org/textarea-caret/-/textarea-caret-3.1.0.tgz", + "shasum": "5d5a35bb035fd06b2ff0e25d5359e97f2655087f" + }, + "type": "npm-asset-library", + "extra": { + "npm-asset-bugs": { + "url": "https://github.com/component/textarea-caret-position/issues" + }, + "npm-asset-files": [ + "index.js" + ], + "npm-asset-main": "index.js", + "npm-asset-directories": [], + "npm-asset-repository": { + "type": "git", + "url": "git+https://github.com/component/textarea-caret-position.git" + } + }, + "license": [ + "MIT" + ], + "description": "(x, y) coordinates of the caret in a textarea or input type='text'", + "homepage": "https://github.com/component/textarea-caret-position#readme", + "keywords": [ + "caret", + "position", + "textarea" + ], + "time": "2018-02-20T06:11:03+00:00" + }, + { + "name": "npm-asset/textcomplete", + "version": "0.18.2", + "dist": { + "type": "tar", + "url": "https://registry.npmjs.org/textcomplete/-/textcomplete-0.18.2.tgz", + "shasum": "de0d806567102f7e32daffcbcc3db05af1515eb5" + }, + "require": { + "npm-asset/eventemitter3": ">=2.0.3,<3.0.0", + "npm-asset/textarea-caret": ">=3.0.1,<4.0.0", + "npm-asset/undate": ">=0.2.3,<0.3.0" + }, + "type": "npm-asset-library", + "extra": { + "npm-asset-bugs": { + "url": "https://github.com/yuku-t/textcomplete/issues" + }, + "npm-asset-main": "lib/index.js", + "npm-asset-directories": [], + "npm-asset-repository": { + "type": "git", + "url": "git+ssh://git@github.com/yuku-t/textcomplete.git" + }, + "npm-asset-scripts": { + "build": "yarn run clean && run-p build:*", + "build:dist": "webpack && webpack --env=min && run-p print-dist-gz-size", + "build:docs": "run-p build:docs:*", + "build:docs:html": "webpack --config webpack.doc.config.js && pug -o docs src/doc/index.pug", + "build:docs:md": "documentation build src/*.js -f md -o doc/api.md", + "build:lib": "babel src -d lib -s && for js in src/*.js; do cp $js lib/${js##*/}.flow; done", + "clean": "rm -fr dist docs lib", + "format": "prettier --no-semi --trailing-comma all --write 'src/*.js' 'test/**/*.js'", + "gh-release": "npm pack textcomplete && gh-release -a textcomplete-$(cat package.json|jq -r .version).tgz", + "opener": "wait-on http://localhost:8082 && opener http://localhost:8082", + "print-dist-gz-size": "printf 'dist/textcomplete.min.js.gz: %d bytes\\n' \"$(gzip -9kc dist/textcomplete.min.js | wc -c)\"", + "start": "run-p watch opener", + "test": "run-p test:*", + "test:bundlesize": "yarn run build:dist && bundlesize", + "test:e2e": "NODE_ENV=test karma start --single-run", + "test:lint": "eslint src/*.js test/**/*.js", + "test:typecheck": "flow check", + "watch": "run-p watch:*", + "watch:webpack": "webpack-dev-server --config webpack.doc.config.js", + "watch:pug": "pug -o docs --watch src/doc/index.pug" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Yuku Takahashi" + } + ], + "description": "Autocomplete for textarea elements", + "homepage": "https://github.com/yuku-t/textcomplete#readme", + "time": "2020-06-10T06:11:00+00:00" + }, + { + "name": "npm-asset/typeahead.js", + "version": "0.11.1", + "dist": { + "type": "tar", + "url": "https://registry.npmjs.org/typeahead.js/-/typeahead.js-0.11.1.tgz", + "shasum": "4e64e671b22310a8606f4aec805924ba84b015b8" + }, + "require": { + "npm-asset/jquery": ">=1.7" + }, + "type": "npm-asset-library", + "extra": { + "npm-asset-bugs": { + "url": "https://github.com/twitter/typeahead.js/issues" + }, + "npm-asset-main": "dist/typeahead.bundle.js", + "npm-asset-directories": [], + "npm-asset-repository": { + "type": "git", + "url": "https://github.com/twitter/typeahead.js.git" + }, + "npm-asset-scripts": { + "test": "./node_modules/karma/bin/karma start --single-run --browsers PhantomJS" + } + }, + "authors": [ + { + "name": "Twitter, Inc.", + "url": "https://twitter.com/twitteross" + }, + { + "name": "Jake Harding", + "url": "https://twitter.com/JakeHarding" + }, + { + "name": "Tim Trueman", + "url": "https://twitter.com/timtrueman" + }, + { + "name": "Veljko Skarich", + "url": "https://twitter.com/vskarich" + } + ], + "description": "fast and fully-featured autocomplete library", + "homepage": "http://twitter.github.com/typeahead.js", + "keywords": [ + "autocomplete", + "typeahead" + ], + "time": "2015-04-27T04:03:42+00:00" + }, + { + "name": "npm-asset/undate", + "version": "0.2.4", + "dist": { + "type": "tar", + "url": "https://registry.npmjs.org/undate/-/undate-0.2.4.tgz", + "shasum": "ccb2a8cf38edc035d1006fcb2909c4c6024a8400" + }, + "type": "npm-asset-library", + "extra": { + "npm-asset-bugs": { + "url": "https://github.com/yuku-t/undate/issues" + }, + "npm-asset-main": "lib/index.js", + "npm-asset-directories": [], + "npm-asset-repository": { + "type": "git", + "url": "git+https://github.com/yuku-t/undate.git" + }, + "npm-asset-scripts": { + "build": "babel src -d lib && for js in src/*.js; do cp $js lib/${js##*/}.flow; done", + "test": "run-p test:*", + "test:eslint": "eslint src/*.js test/*.js", + "test:flow": "flow check", + "test:karma": "karma start --single-run" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Yuku Takahashi" + } + ], + "description": "Undoable update for HTMLTextAreaElement", + "homepage": "https://github.com/yuku-t/undate#readme", + "keywords": [ + "textarea" + ], + "time": "2018-01-24T10:49:39+00:00" }, { "name": "paragonie/certainty", - "version": "v1.0.4", + "version": "v2.6.1", "source": { "type": "git", "url": "https://github.com/paragonie/certainty.git", - "reference": "d0f22c0fe579cf0e4f8ee301de5bc97ab124faac" + "reference": "b0068bc1e5605bd2ebe1ba906f2426d5df123944" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/certainty/zipball/d0f22c0fe579cf0e4f8ee301de5bc97ab124faac", - "reference": "d0f22c0fe579cf0e4f8ee301de5bc97ab124faac", + "url": "https://api.github.com/repos/paragonie/certainty/zipball/b0068bc1e5605bd2ebe1ba906f2426d5df123944", + "reference": "b0068bc1e5605bd2ebe1ba906f2426d5df123944", "shasum": "" }, "require": { + "ext-curl": "*", + "ext-json": "*", "guzzlehttp/guzzle": "^6", "paragonie/constant_time_encoding": "^1|^2", - "paragonie/sodium_compat": "^1.6", - "php": "^5.6|^7" + "paragonie/sodium_compat": "^1.11", + "php": "^5.5|^7|^8" }, "require-dev": { - "phpunit/phpunit": "^5|^6", - "vimeo/psalm": "^1" + "composer/composer": "^1", + "phpunit/phpunit": "^4|^5|^6" }, "bin": [ "bin/certainty-cert-symlink" @@ -1596,29 +2135,28 @@ "ssl", "tls" ], - "time": "2018-04-09T07:21:55+00:00" + "time": "2020-01-02T00:55:01+00:00" }, { "name": "paragonie/constant_time_encoding", - "version": "v1.0.4", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "2132f0f293d856026d7d11bd81b9f4a23a1dc1f6" + "reference": "47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/2132f0f293d856026d7d11bd81b9f4a23a1dc1f6", - "reference": "2132f0f293d856026d7d11bd81b9f4a23a1dc1f6", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2", + "reference": "47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2", "shasum": "" }, "require": { - "php": "^5.3|^7" + "php": "^7|^8" }, "require-dev": { - "paragonie/random_compat": "^1.4|^2", - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^0.3|^1" + "phpunit/phpunit": "^6|^7", + "vimeo/psalm": "^1|^2|^3" }, "type": "library", "autoload": { @@ -1659,37 +2197,82 @@ "hex2bin", "rfc4648" ], - "time": "2018-04-30T17:57:16+00:00" + "time": "2019-11-06T19:20:29+00:00" }, { - "name": "paragonie/random_compat", - "version": "v2.0.17", + "name": "paragonie/hidden-string", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" + "url": "https://github.com/paragonie/hidden-string.git", + "reference": "0bbb00be0e33b8e1d48fa79ea35cd42d3091a936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", + "url": "https://api.github.com/repos/paragonie/hidden-string/zipball/0bbb00be0e33b8e1d48fa79ea35cd42d3091a936", + "reference": "0bbb00be0e33b8e1d48fa79ea35cd42d3091a936", "shasum": "" }, "require": { - "php": ">=5.2.0" + "paragonie/constant_time_encoding": "^2", + "paragonie/sodium_compat": "^1.6", + "php": "^7" }, "require-dev": { - "phpunit/phpunit": "4.*|5.*" + "phpunit/phpunit": "^6|^7", + "vimeo/psalm": "^1" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\HiddenString\\": "./src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MPL-2.0" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "info@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "Encapsulate strings in an object to hide them from stack traces", + "homepage": "https://github.com/paragonie/hidden-string", + "keywords": [ + "hidden", + "stack trace", + "string" + ], + "time": "2018-05-07T20:28:06+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.99", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "shasum": "" + }, + "require": { + "php": "^7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" }, "suggest": { "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." }, "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -1708,28 +2291,28 @@ "pseudorandom", "random" ], - "time": "2018-07-04T16:31:37+00:00" + "time": "2018-07-02T15:55:56+00:00" }, { "name": "paragonie/sodium_compat", - "version": "v1.7.0", + "version": "v1.13.0", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "7b73005be3c224f12c47bd75a23ce24b762e47e8" + "reference": "bbade402cbe84c69b718120911506a3aa2bae653" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/7b73005be3c224f12c47bd75a23ce24b762e47e8", - "reference": "7b73005be3c224f12c47bd75a23ce24b762e47e8", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/bbade402cbe84c69b718120911506a3aa2bae653", + "reference": "bbade402cbe84c69b718120911506a3aa2bae653", "shasum": "" }, "require": { "paragonie/random_compat": ">=1", - "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7" + "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" }, "require-dev": { - "phpunit/phpunit": "^3|^4|^5" + "phpunit/phpunit": "^3|^4|^5|^6|^7" }, "suggest": { "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", @@ -1790,24 +2373,79 @@ "secret-key cryptography", "side-channel resistant" ], - "time": "2018-09-22T03:59:58+00:00" + "time": "2020-03-20T21:48:09+00:00" }, { - "name": "pear/text_languagedetect", - "version": "v1.0.0", + "name": "pear/console_table", + "version": "v1.3.1", "source": { "type": "git", - "url": "https://github.com/pear/Text_LanguageDetect.git", - "reference": "bb9ff6f4970f686fac59081e916b456021fe7ba6" + "url": "https://github.com/pear/Console_Table.git", + "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Text_LanguageDetect/zipball/bb9ff6f4970f686fac59081e916b456021fe7ba6", - "reference": "bb9ff6f4970f686fac59081e916b456021fe7ba6", + "url": "https://api.github.com/repos/pear/Console_Table/zipball/1930c11897ca61fd24b95f2f785e99e0f36dcdea", + "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "suggest": { + "pear/Console_Color2": ">=0.1.2" + }, + "type": "library", + "autoload": { + "classmap": [ + "Table.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jan Schneider", + "homepage": "http://pear.php.net/user/yunosh" + }, + { + "name": "Tal Peer", + "homepage": "http://pear.php.net/user/tal" + }, + { + "name": "Xavier Noguer", + "homepage": "http://pear.php.net/user/xnoguer" + }, + { + "name": "Richard Heyes", + "homepage": "http://pear.php.net/user/richard" + } + ], + "description": "Library that makes it easy to build console style tables.", + "homepage": "http://pear.php.net/package/Console_Table/", + "keywords": [ + "console" + ], + "time": "2018-01-25T20:47:17+00:00" + }, + { + "name": "pear/text_languagedetect", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/pear/Text_LanguageDetect.git", + "reference": "9e253f26cef9a9066f53f200cc3e0684018cb5b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Text_LanguageDetect/zipball/9e253f26cef9a9066f53f200cc3e0684018cb5b5", + "reference": "9e253f26cef9a9066f53f200cc3e0684018cb5b5", "shasum": "" }, "require-dev": { - "phpunit/phpunit": "*" + "phpunit/phpunit": "8.*|9.*" }, "suggest": { "ext-mbstring": "May require the mbstring PHP extension" @@ -1834,7 +2472,190 @@ ], "description": "Identify human languages from text samples", "homepage": "http://pear.php.net/package/Text_LanguageDetect", - "time": "2017-03-02T16:14:08+00:00" + "time": "2020-05-17T12:19:40+00:00" + }, + { + "name": "pragmarx/google2fa", + "version": "v5.0.0", + "source": { + "type": "git", + "url": "https://github.com/antonioribeiro/google2fa.git", + "reference": "17c969c82f427dd916afe4be50bafc6299aef1b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/17c969c82f427dd916afe4be50bafc6299aef1b4", + "reference": "17c969c82f427dd916afe4be50bafc6299aef1b4", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "~1.0|~2.0", + "paragonie/random_compat": ">=1", + "php": ">=5.4", + "symfony/polyfill-php56": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4|~5|~6" + }, + "type": "library", + "extra": { + "component": "package", + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "PragmaRX\\Google2FA\\": "src/", + "PragmaRX\\Google2FA\\Tests\\": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Antonio Carlos Ribeiro", + "email": "acr@antoniocarlosribeiro.com", + "role": "Creator & Designer" + } + ], + "description": "A One Time Password Authentication package, compatible with Google Authenticator.", + "keywords": [ + "2fa", + "Authentication", + "Two Factor Authentication", + "google2fa" + ], + "time": "2019-03-19T22:44:16+00:00" + }, + { + "name": "pragmarx/random", + "version": "v0.2.2", + "source": { + "type": "git", + "url": "https://github.com/antonioribeiro/random.git", + "reference": "daf08a189c5d2d40d1a827db46364d3a741a51b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antonioribeiro/random/zipball/daf08a189c5d2d40d1a827db46364d3a741a51b7", + "reference": "daf08a189c5d2d40d1a827db46364d3a741a51b7", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "fzaninotto/faker": "~1.7", + "phpunit/phpunit": "~6.4", + "pragmarx/trivia": "~0.1", + "squizlabs/php_codesniffer": "^2.3" + }, + "suggest": { + "fzaninotto/faker": "Allows you to get dozens of randomized types", + "pragmarx/trivia": "For the trivia database" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "PragmaRX\\Random\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Antonio Carlos Ribeiro", + "email": "acr@antoniocarlosribeiro.com", + "homepage": "https://antoniocarlosribeiro.com", + "role": "Developer" + } + ], + "description": "Create random chars, numbers, strings", + "homepage": "https://github.com/antonioribeiro/random", + "keywords": [ + "Randomize", + "faker", + "pragmarx", + "random", + "random number", + "random pattern", + "random string" + ], + "time": "2017-11-21T05:26:22+00:00" + }, + { + "name": "pragmarx/recovery", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/antonioribeiro/recovery.git", + "reference": "e16573a1ae5345cc3b100eec6d0296a1a15a90fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antonioribeiro/recovery/zipball/e16573a1ae5345cc3b100eec6d0296a1a15a90fe", + "reference": "e16573a1ae5345cc3b100eec6d0296a1a15a90fe", + "shasum": "" + }, + "require": { + "php": "~7.0", + "pragmarx/random": "~0.1" + }, + "require-dev": { + "phpunit/phpunit": ">=5.4.3", + "squizlabs/php_codesniffer": "^2.3", + "tightenco/collect": "^5" + }, + "suggest": { + "tightenco/collect": "Allows to generate recovery codes as collections" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "PragmaRX\\Recovery\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Antonio Carlos Ribeiro", + "email": "acr@antoniocarlosribeiro.com", + "homepage": "https://antoniocarlosribeiro.com", + "role": "Developer" + } + ], + "description": "Create recovery codes for two factor auth", + "homepage": "https://github.com/antonioribeiro/recovery", + "keywords": [ + "2fa", + "account recovery", + "auth", + "backup codes", + "google2fa", + "pragmarx", + "recovery", + "recovery codes", + "two factor auth" + ], + "time": "2017-09-19T16:58:00+00:00" }, { "name": "psr/cache", @@ -1882,6 +2703,55 @@ ], "time": "2016-08-06T20:24:11+00:00" }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, { "name": "psr/http-message", "version": "1.0.1", @@ -1934,16 +2804,16 @@ }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -1952,7 +2822,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -1977,7 +2847,47 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2020-03-23T09:12:05+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" }, { "name": "seld/cli-prompt", @@ -2029,21 +2939,25 @@ }, { "name": "smarty/smarty", - "version": "v3.1.33", + "version": "v3.1.36", "source": { "type": "git", "url": "https://github.com/smarty-php/smarty.git", - "reference": "dd55b23121e55a3b4f1af90a707a6c4e5969530f" + "reference": "fd148f7ade295014fff77f89ee3d5b20d9d55451" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/smarty-php/smarty/zipball/dd55b23121e55a3b4f1af90a707a6c4e5969530f", - "reference": "dd55b23121e55a3b4f1af90a707a6c4e5969530f", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/fd148f7ade295014fff77f89ee3d5b20d9d55451", + "reference": "fd148f7ade295014fff77f89ee3d5b20d9d55451", "shasum": "" }, "require": { "php": ">=5.2" }, + "require-dev": { + "phpunit/phpunit": "6.4.1", + "smarty/smarty-lexer": "^3.1" + }, "type": "library", "extra": { "branch-alias": { @@ -2051,8 +2965,8 @@ } }, "autoload": { - "files": [ - "libs/bootstrap.php" + "classmap": [ + "libs/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2078,7 +2992,291 @@ "keywords": [ "templating" ], - "time": "2018-09-12T20:54:16+00:00" + "time": "2020-04-14T14:44:26+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3bff59ea7047e925be6b7f2059d60af31bb46d6a", + "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-php56", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php56.git", + "reference": "e3c8c138280cdfe4b81488441555583aa1984e23" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/e3c8c138280cdfe4b81488441555583aa1984e23", + "reference": "e3c8c138280cdfe4b81488441555583aa1984e23", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-util": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php56\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "f048e612a3905f34931127360bdd2def19a5e582" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", + "reference": "f048e612a3905f34931127360bdd2def19a5e582", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-util", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-util.git", + "reference": "4afb4110fc037752cf0ce9869f9ab8162c4e20d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/4afb4110fc037752cf0ce9869f9ab8162c4e20d7", + "reference": "4afb4110fc037752cf0ce9869f9ab8162c4e20d7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Util\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony utilities for portability of PHP codes", + "homepage": "https://symfony.com", + "keywords": [ + "compat", + "compatibility", + "polyfill", + "shim" + ], + "time": "2020-05-12T16:14:59+00:00" } ], "packages-dev": [ @@ -2184,6 +3382,55 @@ ], "time": "2016-01-20T08:20:44+00:00" }, + { + "name": "jakub-onderka/php-parallel-lint", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Parallel-Lint.git", + "reference": "04fbd3f5fb1c83f08724aa58a23db90bd9086ee8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Parallel-Lint/zipball/04fbd3f5fb1c83f08724aa58a23db90bd9086ee8", + "reference": "04fbd3f5fb1c83f08724aa58a23db90bd9086ee8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "jakub-onderka/php-console-highlighter": "~0.3", + "nette/tester": "~1.3", + "squizlabs/php_codesniffer": "~2.7" + }, + "suggest": { + "jakub-onderka/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint", + "abandoned": "php-parallel-lint/php-parallel-lint", + "time": "2018-02-24T15:31:20+00:00" + }, { "name": "johnkary/phpunit-speedtrap", "version": "v1.1.0", @@ -2233,24 +3480,24 @@ "time": "2017-03-25T17:14:26+00:00" }, { - "name": "mikey179/vfsStream", - "version": "v1.6.5", + "name": "mikey179/vfsstream", + "version": "v1.6.8", "source": { "type": "git", - "url": "https://github.com/mikey179/vfsStream.git", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145" + "url": "https://github.com/bovigo/vfsStream.git", + "reference": "231c73783ebb7dd9ec77916c10037eff5a2b6efe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/231c73783ebb7dd9ec77916c10037eff5a2b6efe", + "reference": "231c73783ebb7dd9ec77916c10037eff5a2b6efe", "shasum": "" }, "require": { "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "~4.5" + "phpunit/phpunit": "^4.5|^5.0" }, "type": "library", "extra": { @@ -2276,20 +3523,20 @@ ], "description": "Virtual file system to mock the real file system in unit tests.", "homepage": "http://vfs.bovigo.org/", - "time": "2017-08-01T08:02:14+00:00" + "time": "2019-10-30T15:31:00+00:00" }, { "name": "mockery/mockery", - "version": "1.2.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "100633629bf76d57430b86b7098cd6beb996a35a" + "reference": "f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/100633629bf76d57430b86b7098cd6beb996a35a", - "reference": "100633629bf76d57430b86b7098cd6beb996a35a", + "url": "https://api.github.com/repos/mockery/mockery/zipball/f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be", + "reference": "f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be", "shasum": "" }, "require": { @@ -2298,12 +3545,12 @@ "php": ">=5.6.0" }, "require-dev": { - "phpunit/phpunit": "~5.7.10|~6.5|~7.0" + "phpunit/phpunit": "~5.7.10|~6.5|~7.0|~8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -2341,7 +3588,7 @@ "test double", "testing" ], - "time": "2018-10-02T21:52:37+00:00" + "time": "2019-12-26T09:49:15+00:00" }, { "name": "myclabs/deep-copy", @@ -2536,38 +3783,38 @@ }, { "name": "phpspec/prophecy", - "version": "1.8.0", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", + "phpspec/phpspec": "^2.5 || ^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -2595,62 +3842,7 @@ "spy", "stub" ], - "time": "2018-08-05T17:53:17+00:00" - }, - { - "name": "phpunit/dbunit", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/dbunit.git", - "reference": "5c35d74549c21ba55d0ea74ba89d191a51f8cf25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/5c35d74549c21ba55d0ea74ba89d191a51f8cf25", - "reference": "5c35d74549c21ba55d0ea74ba89d191a51f8cf25", - "shasum": "" - }, - "require": { - "ext-pdo": "*", - "ext-simplexml": "*", - "php": "^5.4 || ^7.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0", - "symfony/yaml": "^2.1 || ^3.0" - }, - "bin": [ - "dbunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "DbUnit port for PHP/PHPUnit to support database interaction testing.", - "homepage": "https://github.com/sebastianbergmann/dbunit/", - "keywords": [ - "database", - "testing", - "xunit" - ], - "time": "2016-12-02T14:39:14+00:00" + "time": "2020-03-05T15:02:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3040,6 +4232,7 @@ "mock", "xunit" ], + "abandoned": true, "time": "2017-06-30T09:13:00+00:00" }, { @@ -3143,7 +4336,7 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", + "homepage": "http://www.github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", @@ -3245,7 +4438,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "https://github.com/sebastianbergmann/environment", + "homepage": "http://www.github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -3313,7 +4506,7 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://github.com/sebastianbergmann/exporter", + "homepage": "http://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" @@ -3365,7 +4558,7 @@ } ], "description": "Snapshotting of global state", - "homepage": "https://github.com/sebastianbergmann/global-state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], @@ -3467,7 +4660,7 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "time": "2016-11-19T07:33:16+00:00" }, { @@ -3557,16 +4750,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", "shasum": "" }, "require": { @@ -3578,7 +4771,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -3594,13 +4787,13 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, { "name": "Gert de Pagter", "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony polyfill for ctype functions", @@ -3611,31 +4804,41 @@ "polyfill", "portable" ], - "time": "2018-08-06T14:22:27+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-05-12T16:14:59+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.16", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "61973ecda60e9f3561e929e19c07d4878b960fc1" + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/61973ecda60e9f3561e929e19c07d4878b960fc1", - "reference": "61973ecda60e9f3561e929e19c07d4878b960fc1", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" + "php": ">=5.5.9" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "symfony/console": "~2.8|~3.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -3643,7 +4846,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -3670,35 +4873,34 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-09-24T08:15:45+00:00" + "time": "2017-07-23T12:43:26+00:00" }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "9dc4f203e36f2b486149058bade43c851dd97451" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/9dc4f203e36f2b486149058bade43c851dd97451", + "reference": "9dc4f203e36f2b486149058bade43c851dd97451", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -3720,7 +4922,7 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2020-06-16T10:16:42+00:00" } ], "aliases": [], @@ -3731,7 +4933,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.6.1", + "php": ">=7.0", "ext-ctype": "*", "ext-curl": "*", "ext-dom": "*", @@ -3745,5 +4947,9 @@ "ext-simplexml": "*", "ext-xml": "*" }, - "platform-dev": [] + "platform-dev": [], + "platform-overrides": { + "php": "7.0" + }, + "plugin-api-version": "1.1.0" } diff --git a/config/local-sample.config.php b/config/local-sample.config.php index 9b977ff53f..9bf073df1d 100644 --- a/config/local-sample.config.php +++ b/config/local-sample.config.php @@ -12,7 +12,7 @@ * * Then set the following for your MySQL installation * - * If you're unsure about what any of the config keys below do, please check the config/defaults.config.php file for + * If you're unsure about what any of the config keys below do, please check the static/defaults.config.php file for * detailed documentation of their data type and behavior. */ diff --git a/database.sql b/database.sql index 2102a9398a..5387d14c6c 100644 --- a/database.sql +++ b/database.sql @@ -1,9 +1,217 @@ -- ------------------------------------------ --- Friendica 2019.03-dev (The Tazmans Flax-lily) --- DB_UPDATE_VERSION 1300 +-- Friendica 2020.09-dev (Red Hot Poker) +-- DB_UPDATE_VERSION 1360 -- ------------------------------------------ +-- +-- TABLE gserver +-- +CREATE TABLE IF NOT EXISTS `gserver` ( + `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', + `url` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `version` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `site_name` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `info` text COMMENT '', + `register_policy` tinyint NOT NULL DEFAULT 0 COMMENT '', + `registered-users` int unsigned NOT NULL DEFAULT 0 COMMENT 'Number of registered users', + `directory-type` tinyint DEFAULT 0 COMMENT 'Type of directory service (Poco, Mastodon)', + `poco` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `noscrape` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `network` char(4) NOT NULL DEFAULT '' COMMENT '', + `platform` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `relay-subscribe` boolean NOT NULL DEFAULT '0' COMMENT 'Has the server subscribed to the relay system', + `relay-scope` varchar(10) NOT NULL DEFAULT '' COMMENT 'The scope of messages that the server wants to get', + `detection-method` tinyint unsigned COMMENT 'Method that had been used to detect that server', + `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', + `last_poco_query` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '', + `last_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '', + `last_failure` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '', + `failed` boolean COMMENT 'Connection failed', + PRIMARY KEY(`id`), + UNIQUE INDEX `nurl` (`nurl`(190)) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Global servers'; + +-- +-- TABLE clients +-- +CREATE TABLE IF NOT EXISTS `clients` ( + `client_id` varchar(20) NOT NULL COMMENT '', + `pw` varchar(20) NOT NULL DEFAULT '' COMMENT '', + `redirect_uri` varchar(200) NOT NULL DEFAULT '' COMMENT '', + `name` text COMMENT '', + `icon` text COMMENT '', + `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id', + PRIMARY KEY(`client_id`) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='OAuth usage'; + +-- +-- TABLE contact +-- +CREATE TABLE IF NOT EXISTS `contact` ( + `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', + `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id', + `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', + `updated` datetime DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of last contact update', + `self` boolean NOT NULL DEFAULT '0' COMMENT '1 if the contact is the user him/her self', + `remote_self` boolean NOT NULL DEFAULT '0' COMMENT '', + `rel` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'The kind of the relation between the user and the contact', + `duplex` boolean NOT NULL DEFAULT '0' COMMENT '', + `network` char(4) NOT NULL DEFAULT '' COMMENT 'Network of the contact', + `protocol` char(4) NOT NULL DEFAULT '' COMMENT 'Protocol of the contact', + `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Name that this contact is known by', + `nick` varchar(255) NOT NULL DEFAULT '' COMMENT 'Nick- and user name of the contact', + `location` varchar(255) DEFAULT '' COMMENT '', + `about` text COMMENT '', + `keywords` text COMMENT 'public keywords (interests) of the contact', + `gender` varchar(32) NOT NULL DEFAULT '' COMMENT 'Deprecated', + `xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `attag` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `photo` varchar(255) DEFAULT '' COMMENT 'Link to the profile photo of the contact', + `thumb` varchar(255) DEFAULT '' COMMENT 'Link to the profile photo (thumb size)', + `micro` varchar(255) DEFAULT '' COMMENT 'Link to the profile photo (micro size)', + `site-pubkey` text COMMENT '', + `issued-id` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `dfrn-id` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `url` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `addr` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `alias` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `pubkey` text COMMENT 'RSA public key 4096 bit', + `prvkey` text COMMENT 'RSA private key 4096 bit', + `batch` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `request` varchar(255) COMMENT '', + `notify` varchar(255) COMMENT '', + `poll` varchar(255) COMMENT '', + `confirm` varchar(255) COMMENT '', + `subscribe` varchar(255) COMMENT '', + `poco` varchar(255) COMMENT '', + `aes_allow` boolean NOT NULL DEFAULT '0' COMMENT '', + `ret-aes` boolean NOT NULL DEFAULT '0' COMMENT '', + `usehub` boolean NOT NULL DEFAULT '0' COMMENT '', + `subhub` boolean NOT NULL DEFAULT '0' COMMENT '', + `hub-verify` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `last-update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last try to update the contact info', + `success_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last successful contact update', + `failure_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last failed update', + `failed` boolean COMMENT 'Connection failed', + `name-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', + `uri-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', + `avatar-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', + `term-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', + `last-item` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'date of the last post', + `last-discovery` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'date of the last follower discovery', + `priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', + `blocked` boolean NOT NULL DEFAULT '1' COMMENT 'Node-wide block status', + `block_reason` text COMMENT 'Node-wide block reason', + `readonly` boolean NOT NULL DEFAULT '0' COMMENT 'posts of the contact are readonly', + `writable` boolean NOT NULL DEFAULT '0' COMMENT '', + `forum` boolean NOT NULL DEFAULT '0' COMMENT 'contact is a forum', + `prv` boolean NOT NULL DEFAULT '0' COMMENT 'contact is a private group', + `contact-type` tinyint NOT NULL DEFAULT 0 COMMENT '', + `hidden` boolean NOT NULL DEFAULT '0' COMMENT '', + `archive` boolean NOT NULL DEFAULT '0' COMMENT '', + `pending` boolean NOT NULL DEFAULT '1' COMMENT '', + `deleted` boolean NOT NULL DEFAULT '0' COMMENT 'Contact has been deleted', + `rating` tinyint NOT NULL DEFAULT 0 COMMENT '', + `unsearchable` boolean NOT NULL DEFAULT '0' COMMENT 'Contact prefers to not be searchable', + `sensitive` boolean NOT NULL DEFAULT '0' COMMENT 'Contact posts sensitive content', + `baseurl` varchar(255) DEFAULT '' COMMENT 'baseurl of the contact', + `gsid` int unsigned COMMENT 'Global Server ID', + `reason` text COMMENT '', + `closeness` tinyint unsigned NOT NULL DEFAULT 99 COMMENT '', + `info` mediumtext COMMENT '', + `profile-id` int unsigned COMMENT 'Deprecated', + `bdyear` varchar(4) NOT NULL DEFAULT '' COMMENT '', + `bd` date NOT NULL DEFAULT '0001-01-01' COMMENT '', + `notify_new_posts` boolean NOT NULL DEFAULT '0' COMMENT '', + `fetch_further_information` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', + `ffi_keyword_denylist` text COMMENT '', + PRIMARY KEY(`id`), + INDEX `uid_name` (`uid`,`name`(190)), + INDEX `self_uid` (`self`,`uid`), + INDEX `alias_uid` (`alias`(32),`uid`), + INDEX `pending_uid` (`pending`,`uid`), + INDEX `blocked_uid` (`blocked`,`uid`), + INDEX `uid_rel_network_poll` (`uid`,`rel`,`network`,`poll`(64),`archive`), + INDEX `uid_network_batch` (`uid`,`network`,`batch`(64)), + INDEX `addr_uid` (`addr`(32),`uid`), + INDEX `nurl_uid` (`nurl`(32),`uid`), + INDEX `nick_uid` (`nick`(32),`uid`), + INDEX `attag_uid` (`attag`(32),`uid`), + INDEX `dfrn-id` (`dfrn-id`(64)), + INDEX `issued-id` (`issued-id`(64)), + INDEX `network_uid_lastupdate` (`network`,`uid`,`last-update`), + INDEX `uid_lastitem` (`uid`,`last-item`), + INDEX `gsid` (`gsid`), + FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='contact table'; + +-- +-- TABLE item-uri +-- +CREATE TABLE IF NOT EXISTS `item-uri` ( + `id` int unsigned NOT NULL auto_increment, + `uri` varbinary(255) NOT NULL COMMENT 'URI of an item', + `guid` varbinary(255) COMMENT 'A unique identifier for an item', + PRIMARY KEY(`id`), + UNIQUE INDEX `uri` (`uri`), + INDEX `guid` (`guid`) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='URI and GUID for items'; + +-- +-- TABLE permissionset +-- +CREATE TABLE IF NOT EXISTS `permissionset` ( + `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', + `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner id of this permission set', + `allow_cid` mediumtext COMMENT 'Access Control - list of allowed contact.id \'<19><78>\'', + `allow_gid` mediumtext COMMENT 'Access Control - list of allowed groups', + `deny_cid` mediumtext COMMENT 'Access Control - list of denied contact.id', + `deny_gid` mediumtext COMMENT 'Access Control - list of denied groups', + PRIMARY KEY(`id`), + INDEX `uid_allow_cid_allow_gid_deny_cid_deny_gid` (`allow_cid`(50),`allow_gid`(30),`deny_cid`(50),`deny_gid`(30)) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT=''; + +-- +-- TABLE tag +-- +CREATE TABLE IF NOT EXISTS `tag` ( + `id` int unsigned NOT NULL auto_increment COMMENT '', + `name` varchar(96) NOT NULL DEFAULT '' COMMENT '', + `url` varbinary(255) NOT NULL DEFAULT '' COMMENT '', + PRIMARY KEY(`id`), + UNIQUE INDEX `type_name_url` (`name`,`url`), + INDEX `url` (`url`) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='tags and mentions'; + +-- +-- TABLE 2fa_app_specific_password +-- +CREATE TABLE IF NOT EXISTS `2fa_app_specific_password` ( + `id` mediumint unsigned NOT NULL auto_increment COMMENT 'Password ID for revocation', + `uid` mediumint unsigned NOT NULL COMMENT 'User ID', + `description` varchar(255) COMMENT 'Description of the usage of the password', + `hashed_password` varchar(255) NOT NULL COMMENT 'Hashed password', + `generated` datetime NOT NULL COMMENT 'Datetime the password was generated', + `last_used` datetime COMMENT 'Datetime the password was last used', + PRIMARY KEY(`id`), + INDEX `uid_description` (`uid`,`description`(190)) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Two-factor app-specific _password'; + +-- +-- TABLE 2fa_recovery_codes +-- +CREATE TABLE IF NOT EXISTS `2fa_recovery_codes` ( + `uid` mediumint unsigned NOT NULL COMMENT 'User ID', + `code` varchar(50) NOT NULL COMMENT 'Recovery code string', + `generated` datetime NOT NULL COMMENT 'Datetime the code was generated', + `used` datetime COMMENT 'Datetime the code was used', + PRIMARY KEY(`uid`,`code`) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Two-factor authentication recovery codes'; + -- -- TABLE addon -- @@ -39,12 +247,21 @@ CREATE TABLE IF NOT EXISTS `apcontact` ( `addr` varchar(255) COMMENT '', `alias` varchar(255) COMMENT '', `pubkey` text COMMENT '', + `subscribe` varchar(255) COMMENT '', `baseurl` varchar(255) COMMENT 'baseurl of the ap contact', + `gsid` int unsigned COMMENT 'Global Server ID', + `generator` varchar(255) COMMENT 'Name of the contact\'s system', + `following_count` int unsigned DEFAULT 0 COMMENT 'Number of following contacts', + `followers_count` int unsigned DEFAULT 0 COMMENT 'Number of followers', + `statuses_count` int unsigned DEFAULT 0 COMMENT 'Number of posts', `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', PRIMARY KEY(`url`), INDEX `addr` (`addr`(32)), INDEX `alias` (`alias`(190)), - INDEX `url` (`followers`(190)) + INDEX `followers` (`followers`(190)), + INDEX `baseurl` (`baseurl`(190)), + INDEX `gsid` (`gsid`), + FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='ActivityPub compatible contacts - used in the ActivityPub implementation'; -- @@ -78,7 +295,9 @@ CREATE TABLE IF NOT EXISTS `auth_codes` ( `redirect_uri` varchar(200) NOT NULL DEFAULT '' COMMENT '', `expires` int NOT NULL DEFAULT 0 COMMENT '', `scope` varchar(250) NOT NULL DEFAULT '' COMMENT '', - PRIMARY KEY(`id`) + PRIMARY KEY(`id`), + INDEX `client_id` (`client_id`), + FOREIGN KEY (`client_id`) REFERENCES `clients` (`client_id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='OAuth usage'; -- @@ -106,19 +325,6 @@ CREATE TABLE IF NOT EXISTS `challenge` ( PRIMARY KEY(`id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT=''; --- --- TABLE clients --- -CREATE TABLE IF NOT EXISTS `clients` ( - `client_id` varchar(20) NOT NULL COMMENT '', - `pw` varchar(20) NOT NULL DEFAULT '' COMMENT '', - `redirect_uri` varchar(200) NOT NULL DEFAULT '' COMMENT '', - `name` text COMMENT '', - `icon` text COMMENT '', - `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id', - PRIMARY KEY(`client_id`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='OAuth usage'; - -- -- TABLE config -- @@ -132,92 +338,19 @@ CREATE TABLE IF NOT EXISTS `config` ( ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='main configuration storage'; -- --- TABLE contact +-- TABLE contact-relation -- -CREATE TABLE IF NOT EXISTS `contact` ( - `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', - `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id', - `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - `self` boolean NOT NULL DEFAULT '0' COMMENT '1 if the contact is the user him/her self', - `remote_self` boolean NOT NULL DEFAULT '0' COMMENT '', - `rel` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'The kind of the relation between the user and the contact', - `duplex` boolean NOT NULL DEFAULT '0' COMMENT '', - `network` char(4) NOT NULL DEFAULT '' COMMENT 'Network protocol of the contact', - `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Name that this contact is known by', - `nick` varchar(255) NOT NULL DEFAULT '' COMMENT 'Nick- and user name of the contact', - `location` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `about` text COMMENT '', - `keywords` text COMMENT 'public keywords (interests) of the contact', - `gender` varchar(32) NOT NULL DEFAULT '' COMMENT '', - `xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `attag` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `photo` varchar(255) DEFAULT '' COMMENT 'Link to the profile photo of the contact', - `thumb` varchar(255) DEFAULT '' COMMENT 'Link to the profile photo (thumb size)', - `micro` varchar(255) DEFAULT '' COMMENT 'Link to the profile photo (micro size)', - `site-pubkey` text COMMENT '', - `issued-id` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `dfrn-id` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `url` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `addr` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `alias` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `pubkey` text COMMENT 'RSA public key 4096 bit', - `prvkey` text COMMENT 'RSA private key 4096 bit', - `batch` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `request` varchar(255) COMMENT '', - `notify` varchar(255) COMMENT '', - `poll` varchar(255) COMMENT '', - `confirm` varchar(255) COMMENT '', - `poco` varchar(255) COMMENT '', - `aes_allow` boolean NOT NULL DEFAULT '0' COMMENT '', - `ret-aes` boolean NOT NULL DEFAULT '0' COMMENT '', - `usehub` boolean NOT NULL DEFAULT '0' COMMENT '', - `subhub` boolean NOT NULL DEFAULT '0' COMMENT '', - `hub-verify` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `last-update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last try to update the contact info', - `success_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last successful contact update', - `failure_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last failed update', - `name-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - `uri-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - `avatar-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - `term-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - `last-item` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'date of the last post', - `priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', - `blocked` boolean NOT NULL DEFAULT '1' COMMENT '', - `readonly` boolean NOT NULL DEFAULT '0' COMMENT 'posts of the contact are readonly', - `writable` boolean NOT NULL DEFAULT '0' COMMENT '', - `forum` boolean NOT NULL DEFAULT '0' COMMENT 'contact is a forum', - `prv` boolean NOT NULL DEFAULT '0' COMMENT 'contact is a private group', - `contact-type` tinyint NOT NULL DEFAULT 0 COMMENT '', - `hidden` boolean NOT NULL DEFAULT '0' COMMENT '', - `archive` boolean NOT NULL DEFAULT '0' COMMENT '', - `pending` boolean NOT NULL DEFAULT '1' COMMENT '', - `deleted` boolean NOT NULL DEFAULT '0' COMMENT 'Contact has been deleted', - `rating` tinyint NOT NULL DEFAULT 0 COMMENT '', - `reason` text COMMENT '', - `closeness` tinyint unsigned NOT NULL DEFAULT 99 COMMENT '', - `info` mediumtext COMMENT '', - `profile-id` int unsigned NOT NULL DEFAULT 0 COMMENT '', - `bdyear` varchar(4) NOT NULL DEFAULT '' COMMENT '', - `bd` date NOT NULL DEFAULT '0001-01-01' COMMENT '', - `notify_new_posts` boolean NOT NULL DEFAULT '0' COMMENT '', - `fetch_further_information` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', - `ffi_keyword_blacklist` text COMMENT '', - PRIMARY KEY(`id`), - INDEX `uid_name` (`uid`,`name`(190)), - INDEX `self_uid` (`self`,`uid`), - INDEX `alias_uid` (`alias`(32),`uid`), - INDEX `pending_uid` (`pending`,`uid`), - INDEX `blocked_uid` (`blocked`,`uid`), - INDEX `uid_rel_network_poll` (`uid`,`rel`,`network`,`poll`(64),`archive`), - INDEX `uid_network_batch` (`uid`,`network`,`batch`(64)), - INDEX `addr_uid` (`addr`(32),`uid`), - INDEX `nurl_uid` (`nurl`(32),`uid`), - INDEX `nick_uid` (`nick`(32),`uid`), - INDEX `dfrn-id` (`dfrn-id`(64)), - INDEX `issued-id` (`issued-id`(64)) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='contact table'; +CREATE TABLE IF NOT EXISTS `contact-relation` ( + `cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'contact the related contact had interacted with', + `relation-cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'related contact who had interacted with the contact', + `last-interaction` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last interaction', + `follow-updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last update of the contact relationship', + `follows` boolean NOT NULL DEFAULT '0' COMMENT '', + PRIMARY KEY(`cid`,`relation-cid`), + INDEX `relation-cid` (`relation-cid`), + FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, + FOREIGN KEY (`relation-cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Contact relations'; -- -- TABLE conv @@ -244,6 +377,7 @@ CREATE TABLE IF NOT EXISTS `conversation` ( `conversation-uri` varbinary(255) NOT NULL DEFAULT '' COMMENT 'GNU Social conversation URI', `conversation-href` varbinary(255) NOT NULL DEFAULT '' COMMENT 'GNU Social conversation link', `protocol` tinyint unsigned NOT NULL DEFAULT 255 COMMENT 'The protocol of the item', + `direction` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'How the message arrived here: 1=push, 2=pull', `source` mediumtext COMMENT 'Original source', `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Receiving date', PRIMARY KEY(`item-uri`), @@ -257,7 +391,8 @@ CREATE TABLE IF NOT EXISTS `conversation` ( CREATE TABLE IF NOT EXISTS `diaspora-interaction` ( `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri', `interaction` mediumtext COMMENT 'The Diaspora interaction', - PRIMARY KEY(`uri-id`) + PRIMARY KEY(`uri-id`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Signed Diaspora Interaction'; -- @@ -330,72 +465,6 @@ CREATE TABLE IF NOT EXISTS `fsuggest` ( PRIMARY KEY(`id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='friend suggestion stuff'; --- --- TABLE gcign --- -CREATE TABLE IF NOT EXISTS `gcign` ( - `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', - `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Local User id', - `gcid` int unsigned NOT NULL DEFAULT 0 COMMENT 'gcontact.id of ignored contact', - PRIMARY KEY(`id`), - INDEX `uid` (`uid`), - INDEX `gcid` (`gcid`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='contacts ignored by friend suggestions'; - --- --- TABLE gcontact --- -CREATE TABLE IF NOT EXISTS `gcontact` ( - `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', - `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Name that this contact is known by', - `nick` varchar(255) NOT NULL DEFAULT '' COMMENT 'Nick- and user name of the contact', - `url` varchar(255) NOT NULL DEFAULT '' COMMENT 'Link to the contacts profile page', - `nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'Link to the profile photo', - `connect` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - `updated` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '', - `last_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '', - `last_failure` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '', - `location` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `about` text COMMENT '', - `keywords` text COMMENT 'puplic keywords (interests)', - `gender` varchar(32) NOT NULL DEFAULT '' COMMENT '', - `birthday` varchar(32) NOT NULL DEFAULT '0001-01-01' COMMENT '', - `community` boolean NOT NULL DEFAULT '0' COMMENT '1 if contact is forum account', - `contact-type` tinyint NOT NULL DEFAULT -1 COMMENT '', - `hide` boolean NOT NULL DEFAULT '0' COMMENT '1 = should be hidden from search', - `nsfw` boolean NOT NULL DEFAULT '0' COMMENT '1 = contact posts nsfw content', - `network` char(4) NOT NULL DEFAULT '' COMMENT 'social network protocol', - `addr` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `notify` varchar(255) COMMENT '', - `alias` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `generation` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', - `server_url` varchar(255) NOT NULL DEFAULT '' COMMENT 'baseurl of the contacts server', - PRIMARY KEY(`id`), - UNIQUE INDEX `nurl` (`nurl`(190)), - INDEX `name` (`name`(64)), - INDEX `nick` (`nick`(32)), - INDEX `addr` (`addr`(64)), - INDEX `hide_network_updated` (`hide`,`network`,`updated`), - INDEX `updated` (`updated`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='global contacts'; - --- --- TABLE glink --- -CREATE TABLE IF NOT EXISTS `glink` ( - `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', - `cid` int unsigned NOT NULL DEFAULT 0 COMMENT '', - `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id', - `gcid` int unsigned NOT NULL DEFAULT 0 COMMENT '', - `zcid` int unsigned NOT NULL DEFAULT 0 COMMENT '', - `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - PRIMARY KEY(`id`), - UNIQUE INDEX `cid_uid_gcid_zcid` (`cid`,`uid`,`gcid`,`zcid`), - INDEX `gcid` (`gcid`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='\'friends of friends\' linkages derived from poco'; - -- -- TABLE group -- @@ -421,32 +490,6 @@ CREATE TABLE IF NOT EXISTS `group_member` ( UNIQUE INDEX `gid_contactid` (`gid`,`contact-id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='privacy groups, member info'; --- --- TABLE gserver --- -CREATE TABLE IF NOT EXISTS `gserver` ( - `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', - `url` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `version` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `site_name` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `info` text COMMENT '', - `register_policy` tinyint NOT NULL DEFAULT 0 COMMENT '', - `registered-users` int unsigned NOT NULL DEFAULT 0 COMMENT 'Number of registered users', - `poco` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `noscrape` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `network` char(4) NOT NULL DEFAULT '' COMMENT '', - `platform` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `relay-subscribe` boolean NOT NULL DEFAULT '0' COMMENT 'Has the server subscribed to the relay system', - `relay-scope` varchar(10) NOT NULL DEFAULT '' COMMENT 'The scope of messages that the server wants to get', - `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - `last_poco_query` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '', - `last_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '', - `last_failure` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '', - PRIMARY KEY(`id`), - UNIQUE INDEX `nurl` (`nurl`(190)) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Global servers'; - -- -- TABLE gserver-tag -- @@ -470,6 +513,20 @@ CREATE TABLE IF NOT EXISTS `hook` ( UNIQUE INDEX `hook_file_function` (`hook`,`file`,`function`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='addon hook registry'; +-- +-- TABLE inbox-status +-- +CREATE TABLE IF NOT EXISTS `inbox-status` ( + `url` varbinary(255) NOT NULL COMMENT 'URL of the inbox', + `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Creation date of this entry', + `success` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last successful delivery', + `failure` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last failed delivery', + `previous` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Previous delivery date', + `archive` boolean NOT NULL DEFAULT '0' COMMENT 'Is the inbox archived?', + `shared` boolean NOT NULL DEFAULT '0' COMMENT 'Is it a shared inbox?', + PRIMARY KEY(`url`) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Status of ActivityPub inboxes'; + -- -- TABLE intro -- @@ -513,10 +570,11 @@ CREATE TABLE IF NOT EXISTS `item` ( `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the author of this item', `icid` int unsigned COMMENT 'Id of the item-content table entry that contains the whole item content', `iaid` int unsigned COMMENT 'Id of the item-activity table entry that contains the activity data', + `vid` smallint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', `extid` varchar(255) NOT NULL DEFAULT '' COMMENT '', `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, bookmark, ...)', `global` boolean NOT NULL DEFAULT '0' COMMENT '', - `private` boolean NOT NULL DEFAULT '0' COMMENT 'distribution is restricted', + `private` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '0=public, 1=private, 2=unlisted', `visible` boolean NOT NULL DEFAULT '0' COMMENT '', `moderated` boolean NOT NULL DEFAULT '0' COMMENT '', `deleted` boolean NOT NULL DEFAULT '0' COMMENT 'item has been deleted', @@ -571,25 +629,33 @@ CREATE TABLE IF NOT EXISTS `item` ( INDEX `extid` (`extid`(191)), INDEX `uid_id` (`uid`,`id`), INDEX `uid_contactid_id` (`uid`,`contact-id`,`id`), - INDEX `uid_created` (`uid`,`created`), + INDEX `uid_received` (`uid`,`received`), INDEX `uid_commented` (`uid`,`commented`), INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`), INDEX `uid_network_received` (`uid`,`network`,`received`), INDEX `uid_network_commented` (`uid`,`network`,`commented`), INDEX `uid_thrparent` (`uid`,`thr-parent`(190)), INDEX `uid_parenturi` (`uid`,`parent-uri`(190)), - INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`), - INDEX `authorid_created` (`author-id`,`created`), + INDEX `uid_contactid_received` (`uid`,`contact-id`,`received`), + INDEX `authorid_received` (`author-id`,`received`), INDEX `ownerid` (`owner-id`), INDEX `contact-id` (`contact-id`), INDEX `uid_uri` (`uid`,`uri`(190)), INDEX `resource-id` (`resource-id`), INDEX `deleted_changed` (`deleted`,`changed`), INDEX `uid_wall_changed` (`uid`,`wall`,`changed`), + INDEX `mention_uid_id` (`mention`,`uid`,`id`), INDEX `uid_eventid` (`uid`,`event-id`), INDEX `icid` (`icid`), INDEX `iaid` (`iaid`), - INDEX `psid_wall` (`psid`,`wall`) + INDEX `psid_wall` (`psid`,`wall`), + INDEX `uri-id` (`uri-id`), + INDEX `parent-uri-id` (`parent-uri-id`), + INDEX `thr-parent-id` (`thr-parent-id`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, + FOREIGN KEY (`parent-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, + FOREIGN KEY (`thr-parent-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, + FOREIGN KEY (`psid`) REFERENCES `permissionset` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Structure for all posts'; -- @@ -604,7 +670,8 @@ CREATE TABLE IF NOT EXISTS `item-activity` ( PRIMARY KEY(`id`), UNIQUE INDEX `uri-hash` (`uri-hash`), INDEX `uri` (`uri`(191)), - INDEX `uri-id` (`uri-id`) + INDEX `uri-id` (`uri-id`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activities for items'; -- @@ -633,33 +700,11 @@ CREATE TABLE IF NOT EXISTS `item-content` ( PRIMARY KEY(`id`), UNIQUE INDEX `uri-plink-hash` (`uri-plink-hash`), INDEX `uri` (`uri`(191)), - INDEX `uri-id` (`uri-id`) + INDEX `plink` (`plink`(191)), + INDEX `uri-id` (`uri-id`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Content for all posts'; --- --- TABLE item-delivery-data --- -CREATE TABLE IF NOT EXISTS `item-delivery-data` ( - `iid` int unsigned NOT NULL COMMENT 'Item id', - `postopts` text COMMENT 'External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery', - `inform` mediumtext COMMENT 'Additional receivers of the linked item', - `queue_count` mediumint NOT NULL DEFAULT 0 COMMENT 'Initial number of delivery recipients, used as item.delivery_queue_count', - `queue_done` mediumint NOT NULL DEFAULT 0 COMMENT 'Number of successful deliveries, used as item.delivery_queue_done', - PRIMARY KEY(`iid`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Delivery data for items'; - --- --- TABLE item-uri --- -CREATE TABLE IF NOT EXISTS `item-uri` ( - `id` int unsigned NOT NULL auto_increment, - `uri` varbinary(255) NOT NULL COMMENT 'URI of an item', - `guid` varbinary(255) COMMENT 'A unique identifier for an item', - PRIMARY KEY(`id`), - UNIQUE INDEX `uri` (`uri`), - INDEX `guid` (`guid`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='URI and GUID for items'; - -- -- TABLE locks -- @@ -738,7 +783,6 @@ CREATE TABLE IF NOT EXISTS `manage` ( -- CREATE TABLE IF NOT EXISTS `notify` ( `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', - `hash` varchar(64) NOT NULL DEFAULT '' COMMENT '', `type` smallint unsigned NOT NULL DEFAULT 0 COMMENT '', `name` varchar(255) NOT NULL DEFAULT '' COMMENT '', `url` varchar(255) NOT NULL DEFAULT '' COMMENT '', @@ -749,13 +793,14 @@ CREATE TABLE IF NOT EXISTS `notify` ( `link` varchar(255) NOT NULL DEFAULT '' COMMENT '', `iid` int unsigned NOT NULL DEFAULT 0 COMMENT 'item.id', `parent` int unsigned NOT NULL DEFAULT 0 COMMENT '', + `uri-id` int unsigned COMMENT 'Item-uri id of the related post', + `parent-uri-id` int unsigned COMMENT 'Item-uri id of the parent of the related post', `seen` boolean NOT NULL DEFAULT '0' COMMENT '', `verb` varchar(100) NOT NULL DEFAULT '' COMMENT '', `otype` varchar(10) NOT NULL DEFAULT '' COMMENT '', `name_cache` tinytext COMMENT 'Cached bbcode parsing of name', `msg_cache` mediumtext COMMENT 'Cached bbcode parsing of msg', PRIMARY KEY(`id`), - INDEX `hash_uid` (`hash`,`uid`), INDEX `seen_uid_date` (`seen`,`uid`,`date`), INDEX `uid_date` (`uid`,`date`), INDEX `uid_type_link` (`uid`,`type`,`link`(190)) @@ -768,9 +813,11 @@ CREATE TABLE IF NOT EXISTS `notify-threads` ( `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', `notify-id` int unsigned NOT NULL DEFAULT 0 COMMENT '', `master-parent-item` int unsigned NOT NULL DEFAULT 0 COMMENT '', + `master-parent-uri-id` int unsigned COMMENT 'Item-uri id of the parent of the related post', `parent-item` int unsigned NOT NULL DEFAULT 0 COMMENT '', `receiver-uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id', - PRIMARY KEY(`id`) + PRIMARY KEY(`id`), + INDEX `master-parent-uri-id` (`master-parent-uri-id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT=''; -- @@ -837,20 +884,6 @@ CREATE TABLE IF NOT EXISTS `pconfig` ( UNIQUE INDEX `uid_cat_k` (`uid`,`cat`,`k`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='personal (per user) configuration storage'; --- --- TABLE permissionset --- -CREATE TABLE IF NOT EXISTS `permissionset` ( - `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', - `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner id of this permission set', - `allow_cid` mediumtext COMMENT 'Access Control - list of allowed contact.id \'<19><78>\'', - `allow_gid` mediumtext COMMENT 'Access Control - list of allowed groups', - `deny_cid` mediumtext COMMENT 'Access Control - list of denied contact.id', - `deny_gid` mediumtext COMMENT 'Access Control - list of denied groups', - PRIMARY KEY(`id`), - INDEX `uid_allow_cid_allow_gid_deny_cid_deny_gid` (`allow_cid`(50),`allow_gid`(30),`deny_cid`(50),`deny_gid`(30)) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT=''; - -- -- TABLE photo -- @@ -877,8 +910,10 @@ CREATE TABLE IF NOT EXISTS `photo` ( `allow_gid` mediumtext COMMENT 'Access Control - list of allowed groups', `deny_cid` mediumtext COMMENT 'Access Control - list of denied contact.id', `deny_gid` mediumtext COMMENT 'Access Control - list of denied groups', + `accessible` boolean NOT NULL DEFAULT '0' COMMENT 'Make photo publicly accessible, ignoring permissions', `backend-class` tinytext COMMENT 'Storage backend class', `backend-ref` text COMMENT 'Storage backend data reference', + `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', PRIMARY KEY(`id`), INDEX `contactid` (`contact-id`), INDEX `uid_contactid` (`uid`,`contact-id`), @@ -919,6 +954,55 @@ CREATE TABLE IF NOT EXISTS `poll_result` ( INDEX `poll_id` (`poll_id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='data for polls - currently unused'; +-- +-- TABLE post-category +-- +CREATE TABLE IF NOT EXISTS `post-category` ( + `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri', + `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id', + `type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', + `tid` int unsigned NOT NULL DEFAULT 0 COMMENT '', + PRIMARY KEY(`uri-id`,`uid`,`type`,`tid`), + INDEX `uri-id` (`tid`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, + FOREIGN KEY (`tid`) REFERENCES `tag` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='post relation to categories'; + +-- +-- TABLE post-delivery-data +-- +CREATE TABLE IF NOT EXISTS `post-delivery-data` ( + `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri', + `postopts` text COMMENT 'External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery', + `inform` mediumtext COMMENT 'Additional receivers of the linked item', + `queue_count` mediumint NOT NULL DEFAULT 0 COMMENT 'Initial number of delivery recipients, used as item.delivery_queue_count', + `queue_done` mediumint NOT NULL DEFAULT 0 COMMENT 'Number of successful deliveries, used as item.delivery_queue_done', + `queue_failed` mediumint NOT NULL DEFAULT 0 COMMENT 'Number of unsuccessful deliveries, used as item.delivery_queue_failed', + `activitypub` mediumint NOT NULL DEFAULT 0 COMMENT 'Number of successful deliveries via ActivityPub', + `dfrn` mediumint NOT NULL DEFAULT 0 COMMENT 'Number of successful deliveries via DFRN', + `legacy_dfrn` mediumint NOT NULL DEFAULT 0 COMMENT 'Number of successful deliveries via legacy DFRN', + `diaspora` mediumint NOT NULL DEFAULT 0 COMMENT 'Number of successful deliveries via Diaspora', + `ostatus` mediumint NOT NULL DEFAULT 0 COMMENT 'Number of successful deliveries via OStatus', + PRIMARY KEY(`uri-id`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Delivery data for items'; + +-- +-- TABLE post-tag +-- +CREATE TABLE IF NOT EXISTS `post-tag` ( + `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri', + `type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', + `tid` int unsigned NOT NULL DEFAULT 0 COMMENT '', + `cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Contact id of the mentioned public contact', + PRIMARY KEY(`uri-id`,`type`,`tid`,`cid`), + INDEX `tid` (`tid`), + INDEX `cid` (`cid`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, + FOREIGN KEY (`tid`) REFERENCES `tag` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT, + FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='post relation to tags'; + -- -- TABLE process -- @@ -936,40 +1020,40 @@ CREATE TABLE IF NOT EXISTS `process` ( CREATE TABLE IF NOT EXISTS `profile` ( `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id', - `profile-name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Name of the profile', - `is-default` boolean NOT NULL DEFAULT '0' COMMENT 'Mark this profile as default profile', + `profile-name` varchar(255) COMMENT 'Deprecated', + `is-default` boolean COMMENT 'Deprecated', `hide-friends` boolean NOT NULL DEFAULT '0' COMMENT 'Hide friend list from viewers of this profile', `name` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `pdesc` varchar(255) NOT NULL DEFAULT '' COMMENT 'Title or description', + `pdesc` varchar(255) COMMENT 'Deprecated', `dob` varchar(32) NOT NULL DEFAULT '0000-00-00' COMMENT 'Day of birth', `address` varchar(255) NOT NULL DEFAULT '' COMMENT '', `locality` varchar(255) NOT NULL DEFAULT '' COMMENT '', `region` varchar(255) NOT NULL DEFAULT '' COMMENT '', `postal-code` varchar(32) NOT NULL DEFAULT '' COMMENT '', `country-name` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `hometown` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `gender` varchar(32) NOT NULL DEFAULT '' COMMENT '', - `marital` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `with` text COMMENT '', - `howlong` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - `sexual` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `politic` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `religion` varchar(255) NOT NULL DEFAULT '' COMMENT '', + `hometown` varchar(255) COMMENT 'Deprecated', + `gender` varchar(32) COMMENT 'Deprecated', + `marital` varchar(255) COMMENT 'Deprecated', + `with` text COMMENT 'Deprecated', + `howlong` datetime COMMENT 'Deprecated', + `sexual` varchar(255) COMMENT 'Deprecated', + `politic` varchar(255) COMMENT 'Deprecated', + `religion` varchar(255) COMMENT 'Deprecated', `pub_keywords` text COMMENT '', `prv_keywords` text COMMENT '', - `likes` text COMMENT '', - `dislikes` text COMMENT '', - `about` text COMMENT '', - `summary` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `music` text COMMENT '', - `book` text COMMENT '', - `tv` text COMMENT '', - `film` text COMMENT '', - `interest` text COMMENT '', - `romance` text COMMENT '', - `work` text COMMENT '', - `education` text COMMENT '', - `contact` text COMMENT '', + `likes` text COMMENT 'Deprecated', + `dislikes` text COMMENT 'Deprecated', + `about` text COMMENT 'Profile description', + `summary` varchar(255) COMMENT 'Deprecated', + `music` text COMMENT 'Deprecated', + `book` text COMMENT 'Deprecated', + `tv` text COMMENT 'Deprecated', + `film` text COMMENT 'Deprecated', + `interest` text COMMENT 'Deprecated', + `romance` text COMMENT 'Deprecated', + `work` text COMMENT 'Deprecated', + `education` text COMMENT 'Deprecated', + `contact` text COMMENT 'Deprecated', `homepage` varchar(255) NOT NULL DEFAULT '' COMMENT '', `xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT '', `photo` varchar(255) NOT NULL DEFAULT '' COMMENT '', @@ -994,6 +1078,25 @@ CREATE TABLE IF NOT EXISTS `profile_check` ( PRIMARY KEY(`id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='DFRN remote auth use'; +-- +-- TABLE profile_field +-- +CREATE TABLE IF NOT EXISTS `profile_field` ( + `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', + `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner user id', + `order` mediumint unsigned NOT NULL DEFAULT 1 COMMENT 'Field ordering per user', + `psid` int unsigned COMMENT 'ID of the permission set of this profile field - 0 = public', + `label` varchar(255) NOT NULL DEFAULT '' COMMENT 'Label of the field', + `value` text COMMENT 'Value of the field', + `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'creation time', + `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'last edit time', + PRIMARY KEY(`id`), + INDEX `uid` (`uid`), + INDEX `order` (`order`), + INDEX `psid` (`psid`), + FOREIGN KEY (`psid`) REFERENCES `permissionset` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Custom profile fields'; + -- -- TABLE push_subscriber -- @@ -1012,25 +1115,6 @@ CREATE TABLE IF NOT EXISTS `push_subscriber` ( INDEX `next_try` (`next_try`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Used for OStatus: Contains feed subscribers'; --- --- TABLE queue --- -CREATE TABLE IF NOT EXISTS `queue` ( - `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', - `cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Message receiver', - `network` char(4) NOT NULL DEFAULT '' COMMENT 'Receiver\'s network', - `guid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Unique GUID of the message', - `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date, when the message was created', - `last` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of last trial', - `next` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Next retrial date', - `retrial` tinyint NOT NULL DEFAULT 0 COMMENT 'Retrial counter', - `content` mediumtext COMMENT '', - `batch` boolean NOT NULL DEFAULT '0' COMMENT '', - PRIMARY KEY(`id`), - INDEX `last` (`last`), - INDEX `next` (`next`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Queue for messages that couldn\'t be delivered'; - -- -- TABLE register -- @@ -1070,45 +1154,20 @@ CREATE TABLE IF NOT EXISTS `session` ( ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='web session storage'; -- --- TABLE sign +-- TABLE storage -- -CREATE TABLE IF NOT EXISTS `sign` ( - `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', - `iid` int unsigned NOT NULL DEFAULT 0 COMMENT 'item.id', - `signed_text` mediumtext COMMENT '', - `signature` text COMMENT '', - `signer` varchar(255) NOT NULL DEFAULT '' COMMENT '', - PRIMARY KEY(`id`), - UNIQUE INDEX `iid` (`iid`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Diaspora signatures'; - --- --- TABLE term --- -CREATE TABLE IF NOT EXISTS `term` ( - `tid` int unsigned NOT NULL auto_increment COMMENT '', - `oid` int unsigned NOT NULL DEFAULT 0 COMMENT '', - `otype` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', - `type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', - `term` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `url` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '', - `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', - `global` boolean NOT NULL DEFAULT '0' COMMENT '', - `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id', - PRIMARY KEY(`tid`), - INDEX `oid_otype_type_term` (`oid`,`otype`,`type`,`term`(32)), - INDEX `uid_otype_type_term_global_created` (`uid`,`otype`,`type`,`term`(32),`global`,`created`), - INDEX `uid_otype_type_url` (`uid`,`otype`,`type`,`url`(64)), - INDEX `guid` (`guid`(64)) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='item taxonomy (categories, tags, etc.) table'; +CREATE TABLE IF NOT EXISTS `storage` ( + `id` int unsigned NOT NULL auto_increment COMMENT 'Auto incremented image data id', + `data` longblob NOT NULL COMMENT 'file data', + PRIMARY KEY(`id`) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Data stored by Database storage backend'; -- -- TABLE thread -- CREATE TABLE IF NOT EXISTS `thread` ( `iid` int unsigned NOT NULL DEFAULT 0 COMMENT 'sequential ID', + `uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the item uri', `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id', `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '', `owner-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Item owner', @@ -1119,7 +1178,7 @@ CREATE TABLE IF NOT EXISTS `thread` ( `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', `changed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', `wall` boolean NOT NULL DEFAULT '0' COMMENT '', - `private` boolean NOT NULL DEFAULT '0' COMMENT '', + `private` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '0=public, 1=private, 2=unlisted', `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '', `moderated` boolean NOT NULL DEFAULT '0' COMMENT '', `visible` boolean NOT NULL DEFAULT '0' COMMENT '', @@ -1135,16 +1194,18 @@ CREATE TABLE IF NOT EXISTS `thread` ( `bookmark` boolean COMMENT '', PRIMARY KEY(`iid`), INDEX `uid_network_commented` (`uid`,`network`,`commented`), - INDEX `uid_network_created` (`uid`,`network`,`created`), + INDEX `uid_network_received` (`uid`,`network`,`received`), INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`), - INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`), + INDEX `uid_contactid_received` (`uid`,`contact-id`,`received`), INDEX `contactid` (`contact-id`), INDEX `ownerid` (`owner-id`), INDEX `authorid` (`author-id`), - INDEX `uid_created` (`uid`,`created`), + INDEX `uid_received` (`uid`,`received`), INDEX `uid_commented` (`uid`,`commented`), - INDEX `uid_wall_created` (`uid`,`wall`,`created`), - INDEX `private_wall_origin_commented` (`private`,`wall`,`origin`,`commented`) + INDEX `uid_wall_received` (`uid`,`wall`,`received`), + INDEX `private_wall_origin_commented` (`private`,`wall`,`origin`,`commented`), + INDEX `uri-id` (`uri-id`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Thread related data'; -- @@ -1157,7 +1218,9 @@ CREATE TABLE IF NOT EXISTS `tokens` ( `expires` int NOT NULL DEFAULT 0 COMMENT '', `scope` varchar(200) NOT NULL DEFAULT '' COMMENT '', `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id', - PRIMARY KEY(`id`) + PRIMARY KEY(`id`), + INDEX `client_id` (`client_id`), + FOREIGN KEY (`client_id`) REFERENCES `clients` (`client_id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='OAuth usage'; -- @@ -1243,9 +1306,22 @@ CREATE TABLE IF NOT EXISTS `user-item` ( `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id', `hidden` boolean NOT NULL DEFAULT '0' COMMENT 'Marker to hide an item from the user', `ignored` boolean COMMENT 'Ignore this thread if set', - PRIMARY KEY(`uid`,`iid`) + `pinned` boolean COMMENT 'The item is pinned on the profile page', + `notification-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', + PRIMARY KEY(`uid`,`iid`), + INDEX `uid_pinned` (`uid`,`pinned`), + INDEX `iid_uid` (`iid`,`uid`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='User specific item data'; +-- +-- TABLE verb +-- +CREATE TABLE IF NOT EXISTS `verb` ( + `id` smallint unsigned NOT NULL auto_increment, + `name` varchar(100) NOT NULL DEFAULT '' COMMENT '', + PRIMARY KEY(`id`) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activity Verbs'; + -- -- TABLE worker-ipc -- @@ -1269,22 +1345,293 @@ CREATE TABLE IF NOT EXISTS `workerqueue` ( `retrial` tinyint NOT NULL DEFAULT 0 COMMENT 'Retrial counter', `done` boolean NOT NULL DEFAULT '0' COMMENT 'Marked 1 when the task was done - will be deleted later', PRIMARY KEY(`id`), - INDEX `pid` (`pid`), - INDEX `parameter` (`parameter`(64)), - INDEX `priority_created_next_try` (`priority`,`created`,`next_try`), - INDEX `done_priority_executed_next_try` (`done`,`priority`,`executed`,`next_try`), - INDEX `done_executed_next_try` (`done`,`executed`,`next_try`), + INDEX `done_parameter` (`done`,`parameter`(64)), + INDEX `done_executed` (`done`,`executed`), + INDEX `done_priority_created` (`done`,`priority`,`created`), INDEX `done_priority_next_try` (`done`,`priority`,`next_try`), - INDEX `done_next_try` (`done`,`next_try`) + INDEX `done_pid_next_try` (`done`,`pid`,`next_try`), + INDEX `done_pid_priority_created` (`done`,`pid`,`priority`,`created`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Background tasks queue entries'; -- --- TABLE storage +-- VIEW category-view -- -CREATE TABLE IF NOT EXISTS `storage` ( - `id` int unsigned NOT NULL auto_increment COMMENT 'Auto incremented image data id', - `data` longblob NOT NULL COMMENT 'file data', - PRIMARY KEY(`id`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Data stored by Database storage backend'; +DROP VIEW IF EXISTS `category-view`; +CREATE VIEW `category-view` AS SELECT + `post-category`.`uri-id` AS `uri-id`, + `post-category`.`uid` AS `uid`, + `item-uri`.`uri` AS `uri`, + `item-uri`.`guid` AS `guid`, + `post-category`.`type` AS `type`, + `post-category`.`tid` AS `tid`, + `tag`.`name` AS `name`, + `tag`.`url` AS `url` + FROM `post-category` + INNER JOIN `item-uri` ON `item-uri`.id = `post-category`.`uri-id` + LEFT JOIN `tag` ON `post-category`.`tid` = `tag`.`id`; + +-- +-- VIEW tag-view +-- +DROP VIEW IF EXISTS `tag-view`; +CREATE VIEW `tag-view` AS SELECT + `post-tag`.`uri-id` AS `uri-id`, + `item-uri`.`uri` AS `uri`, + `item-uri`.`guid` AS `guid`, + `post-tag`.`type` AS `type`, + `post-tag`.`tid` AS `tid`, + `post-tag`.`cid` AS `cid`, + CASE `cid` WHEN 0 THEN `tag`.`name` ELSE `contact`.`name` END AS `name`, + CASE `cid` WHEN 0 THEN `tag`.`url` ELSE `contact`.`url` END AS `url` + FROM `post-tag` + INNER JOIN `item-uri` ON `item-uri`.id = `post-tag`.`uri-id` + LEFT JOIN `tag` ON `post-tag`.`tid` = `tag`.`id` + LEFT JOIN `contact` ON `post-tag`.`cid` = `contact`.`id`; + +-- +-- VIEW network-item-view +-- +DROP VIEW IF EXISTS `network-item-view`; +CREATE VIEW `network-item-view` AS SELECT + `item`.`parent-uri-id` AS `uri-id`, + `item`.`parent-uri` AS `uri`, + `item`.`parent` AS `parent`, + `item`.`received` AS `received`, + `item`.`commented` AS `commented`, + `item`.`created` AS `created`, + `item`.`uid` AS `uid`, + `item`.`starred` AS `starred`, + `item`.`mention` AS `mention`, + `item`.`network` AS `network`, + `item`.`unseen` AS `unseen`, + `item`.`gravity` AS `gravity`, + `item`.`contact-id` AS `contact-id` + FROM `item` + INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent` + STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id` AND (NOT `contact`.`blocked` OR `contact`.`pending`) + LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = `thread`.`uid` + LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `thread`.`uid` AND `author`.`cid` = `thread`.`author-id` + LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `thread`.`uid` AND `owner`.`cid` = `thread`.`owner-id` + WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated` + AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`) + AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`) + AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`); + +-- +-- VIEW network-thread-view +-- +DROP VIEW IF EXISTS `network-thread-view`; +CREATE VIEW `network-thread-view` AS SELECT + `item`.`uri-id` AS `uri-id`, + `item`.`uri` AS `uri`, + `item`.`parent-uri-id` AS `parent-uri-id`, + `thread`.`iid` AS `parent`, + `thread`.`received` AS `received`, + `thread`.`commented` AS `commented`, + `thread`.`created` AS `created`, + `thread`.`uid` AS `uid`, + `thread`.`starred` AS `starred`, + `thread`.`mention` AS `mention`, + `thread`.`network` AS `network`, + `thread`.`contact-id` AS `contact-id` + FROM `thread` + STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id` AND (NOT `contact`.`blocked` OR `contact`.`pending`) + STRAIGHT_JOIN `item` ON `item`.`id` = `thread`.`iid` + LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = `thread`.`uid` + LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `thread`.`uid` AND `author`.`cid` = `thread`.`author-id` + LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `thread`.`uid` AND `owner`.`cid` = `thread`.`owner-id` + WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated` + AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`) + AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`) + AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`); + +-- +-- VIEW owner-view +-- +DROP VIEW IF EXISTS `owner-view`; +CREATE VIEW `owner-view` AS SELECT + `contact`.`id` AS `id`, + `contact`.`uid` AS `uid`, + `contact`.`created` AS `created`, + `contact`.`updated` AS `updated`, + `contact`.`self` AS `self`, + `contact`.`remote_self` AS `remote_self`, + `contact`.`rel` AS `rel`, + `contact`.`duplex` AS `duplex`, + `contact`.`network` AS `network`, + `contact`.`protocol` AS `protocol`, + `contact`.`name` AS `name`, + `contact`.`nick` AS `nick`, + `contact`.`location` AS `location`, + `contact`.`about` AS `about`, + `contact`.`keywords` AS `keywords`, + `contact`.`gender` AS `gender`, + `contact`.`xmpp` AS `xmpp`, + `contact`.`attag` AS `attag`, + `contact`.`avatar` AS `avatar`, + `contact`.`photo` AS `photo`, + `contact`.`thumb` AS `thumb`, + `contact`.`micro` AS `micro`, + `contact`.`site-pubkey` AS `site-pubkey`, + `contact`.`issued-id` AS `issued-id`, + `contact`.`dfrn-id` AS `dfrn-id`, + `contact`.`url` AS `url`, + `contact`.`nurl` AS `nurl`, + `contact`.`addr` AS `addr`, + `contact`.`alias` AS `alias`, + `contact`.`pubkey` AS `pubkey`, + `contact`.`prvkey` AS `prvkey`, + `contact`.`batch` AS `batch`, + `contact`.`request` AS `request`, + `contact`.`notify` AS `notify`, + `contact`.`poll` AS `poll`, + `contact`.`confirm` AS `confirm`, + `contact`.`poco` AS `poco`, + `contact`.`aes_allow` AS `aes_allow`, + `contact`.`ret-aes` AS `ret-aes`, + `contact`.`usehub` AS `usehub`, + `contact`.`subhub` AS `subhub`, + `contact`.`hub-verify` AS `hub-verify`, + `contact`.`last-update` AS `last-update`, + `contact`.`success_update` AS `success_update`, + `contact`.`failure_update` AS `failure_update`, + `contact`.`name-date` AS `name-date`, + `contact`.`uri-date` AS `uri-date`, + `contact`.`avatar-date` AS `avatar-date`, + `contact`.`avatar-date` AS `picdate`, + `contact`.`term-date` AS `term-date`, + `contact`.`last-item` AS `last-item`, + `contact`.`priority` AS `priority`, + `contact`.`blocked` AS `blocked`, + `contact`.`block_reason` AS `block_reason`, + `contact`.`readonly` AS `readonly`, + `contact`.`writable` AS `writable`, + `contact`.`forum` AS `forum`, + `contact`.`prv` AS `prv`, + `contact`.`contact-type` AS `contact-type`, + `contact`.`hidden` AS `hidden`, + `contact`.`archive` AS `archive`, + `contact`.`pending` AS `pending`, + `contact`.`deleted` AS `deleted`, + `contact`.`rating` AS `rating`, + `contact`.`unsearchable` AS `unsearchable`, + `contact`.`sensitive` AS `sensitive`, + `contact`.`baseurl` AS `baseurl`, + `contact`.`reason` AS `reason`, + `contact`.`closeness` AS `closeness`, + `contact`.`info` AS `info`, + `contact`.`profile-id` AS `profile-id`, + `contact`.`bdyear` AS `bdyear`, + `contact`.`bd` AS `bd`, + `contact`.`notify_new_posts` AS `notify_new_posts`, + `contact`.`fetch_further_information` AS `fetch_further_information`, + `contact`.`ffi_keyword_denylist` AS `ffi_keyword_denylist`, + `user`.`parent-uid` AS `parent-uid`, + `user`.`guid` AS `guid`, + `user`.`nickname` AS `nickname`, + `user`.`email` AS `email`, + `user`.`openid` AS `openid`, + `user`.`timezone` AS `timezone`, + `user`.`language` AS `language`, + `user`.`register_date` AS `register_date`, + `user`.`login_date` AS `login_date`, + `user`.`default-location` AS `default-location`, + `user`.`allow_location` AS `allow_location`, + `user`.`theme` AS `theme`, + `user`.`pubkey` AS `upubkey`, + `user`.`prvkey` AS `uprvkey`, + `user`.`sprvkey` AS `sprvkey`, + `user`.`spubkey` AS `spubkey`, + `user`.`verified` AS `verified`, + `user`.`blockwall` AS `blockwall`, + `user`.`hidewall` AS `hidewall`, + `user`.`blocktags` AS `blocktags`, + `user`.`unkmail` AS `unkmail`, + `user`.`cntunkmail` AS `cntunkmail`, + `user`.`notify-flags` AS `notify-flags`, + `user`.`page-flags` AS `page-flags`, + `user`.`account-type` AS `account-type`, + `user`.`prvnets` AS `prvnets`, + `user`.`maxreq` AS `maxreq`, + `user`.`expire` AS `expire`, + `user`.`account_removed` AS `account_removed`, + `user`.`account_expired` AS `account_expired`, + `user`.`account_expires_on` AS `account_expires_on`, + `user`.`expire_notification_sent` AS `expire_notification_sent`, + `user`.`def_gid` AS `def_gid`, + `user`.`allow_cid` AS `allow_cid`, + `user`.`allow_gid` AS `allow_gid`, + `user`.`deny_cid` AS `deny_cid`, + `user`.`deny_gid` AS `deny_gid`, + `user`.`openidserver` AS `openidserver`, + `profile`.`publish` AS `publish`, + `profile`.`net-publish` AS `net-publish`, + `profile`.`hide-friends` AS `hide-friends`, + `profile`.`prv_keywords` AS `prv_keywords`, + `profile`.`pub_keywords` AS `pub_keywords`, + `profile`.`address` AS `address`, + `profile`.`locality` AS `locality`, + `profile`.`region` AS `region`, + `profile`.`postal-code` AS `postal-code`, + `profile`.`country-name` AS `country-name`, + `profile`.`homepage` AS `homepage`, + `profile`.`dob` AS `dob` + FROM `user` + INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self` + INNER JOIN `profile` ON `profile`.`uid` = `user`.`uid`; + +-- +-- VIEW pending-view +-- +DROP VIEW IF EXISTS `pending-view`; +CREATE VIEW `pending-view` AS SELECT + `register`.`id` AS `id`, + `register`.`hash` AS `hash`, + `register`.`created` AS `created`, + `register`.`uid` AS `uid`, + `register`.`password` AS `password`, + `register`.`language` AS `language`, + `register`.`note` AS `note`, + `contact`.`self` AS `self`, + `contact`.`name` AS `name`, + `contact`.`url` AS `url`, + `contact`.`micro` AS `micro`, + `user`.`email` AS `email`, + `contact`.`nick` AS `nick` + FROM `register` + INNER JOIN `contact` ON `register`.`uid` = `contact`.`uid` + INNER JOIN `user` ON `register`.`uid` = `user`.`uid`; + +-- +-- VIEW tag-search-view +-- +DROP VIEW IF EXISTS `tag-search-view`; +CREATE VIEW `tag-search-view` AS SELECT + `post-tag`.`uri-id` AS `uri-id`, + `item`.`id` AS `iid`, + `item`.`uri` AS `uri`, + `item`.`guid` AS `guid`, + `item`.`uid` AS `uid`, + `item`.`private` AS `private`, + `item`.`wall` AS `wall`, + `item`.`origin` AS `origin`, + `item`.`gravity` AS `gravity`, + `item`.`received` AS `received`, + `tag`.`name` AS `name` + FROM `post-tag` + INNER JOIN `tag` ON `tag`.`id` = `post-tag`.`tid` + INNER JOIN `item` ON `item`.`uri-id` = `post-tag`.`uri-id` + WHERE `post-tag`.`type` = 1; + +-- +-- VIEW workerqueue-view +-- +DROP VIEW IF EXISTS `workerqueue-view`; +CREATE VIEW `workerqueue-view` AS SELECT + `process`.`pid` AS `pid`, + `workerqueue`.`priority` AS `priority` + FROM `process` + INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid` + WHERE NOT `workerqueue`.`done`; diff --git a/doc/API-Entities.md b/doc/API-Entities.md new file mode 100644 index 0000000000..e369cb4ffd --- /dev/null +++ b/doc/API-Entities.md @@ -0,0 +1,1449 @@ +# Friendica API entities + +* [Home](help) + * [Using the APIs](help/api) + + +## Activities + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeNullable
likeList of ContactsNo
dislikeList of ContactsNo
attendyesList of ContactsNo
attendnoList of ContactsNo
attendmaybeList of ContactsNo
+ +## Attachment + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeNullable
urlString (URL)No
mimetypeStringNo
sizeInteger (bytes)No
+ +## Contact + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeNullable
idIntegerNo
id_strStringNo
nameStringNo
screen_nameStringNo
locationStringNo
descriptionStringNo
profile_image_urlString (URL)No
profile_image_url_httpsString (URL)No
profile_image_url_profile_sizeString (URL)No
profile_image_url_largeString (URL)No
urlString (URL)No
protectedBooleanNo
followers_countIntegerNo
friends_countIntegerNo
listed_countIntegerNo
favourites_countIntegerNo
statuses_countIntegerNo
created_atString (Date)
+Ex: Wed May 23 06:01:13 +0000 2007 +
No
utc_offsetIntegerNo
time_zoneStringNo
geo_enabledBooleanNo
verifiedBooleanNo
langStringNo
contributors_enabledBooleanNo
is_translatorBooleanNo
is_translation_enabledBooleanNo
followingBooleanNo
follow_request_sentBooleanNo
statusnet_blockingBooleanNo
notificationsBooleanNo
statusnet_profile_urlString (URL)No
uidIntegerNo
cidIntegerNo
pidIntegerNo
selfIntegerNo
networkStringNo
+ + +## Entities + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeNullable
hashtagsList of HashtagsNo
symbolsList of SymbolsNo
urlsList of URLsNo
user_mentionsList of User mentionsNo
mediaList of MediasNo
+ +## Event + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idInteger
uidIntegerOwner User Id
cidIntegerTarget Contact Id
uriStringItem unique URI string
nameString (Plaintext)Title
descString (HTML)Description
startTimeString (UTC YYYY-MM-DD HH:II:SS))
endTimeString (UTC YYYY-MM-DD HH:II:SS))Optional (null date is 0001-01-01 00:00:00
typeString (event or birthday)
nofinishBooleanOngoing event
placeStringOptional. Location.
adjustBoolean???
ignoreBoolean???
allow_cidString (angle-brackets escaped integers)Optional. List of allowed contact ids
allow_gidString (angle-brackets escaped integers)Optional. List of allowed group ids
deny_cidString (angle-brackets escaped integers)Optional. List of disallowed contact ids
deny_gidString (angle-brackets escaped integers)Optional. List of disallowed group ids
+ +## Hashtag + +Unused + +## Item + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeNullable
textString (Plaintext)No
truncatedBooleanNo
created_atString (Date)
+Ex: Wed May 23 06:01:13 +0000 2007 +
No
in_reply_to_status_idIntegerNo
in_reply_to_status_id_strStringNo
sourceStringNo
idIntegerNo
id_strStringNo
in_reply_to_user_idIntegerNo
in_reply_to_user_id_strStringNo
in_reply_to_screen_nameStringNo
geoStringYes
favoritedBooleanNo
userContactNo
friendica_authorContactNo
friendica_owner + +ContactNo
friendica_privateBooleanNo
statusnet_htmlString (HTML)No
statusnet_conversation_idIntegerNo
external_urlString (URL)No
friendica_activitiesActivitiesNo
friendica_titleString (Plaintext)No
friendica_htmlString (HTML)No
attachmentsList of AttachmentsYes
entitiesEntitiesYes
+ +## Media + +Identical to [the Twitter Media Object](https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/entities-object#media). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeNullable
idIntegerNo
id_strStringNo
indicesList of IntegerNo
media_urlString (URL)No
media_url_httpsString (URL)No
urlString (URL)No
display_urlString (URL)No
expanded_urlString (URL)No
ext_alt_textStringNo
typeStringNo
sizesSizesNo
+ +## Notification + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idInteger
hashString
typeInteger
    +
  • 1: Inbound follow request
  • +
  • 2: Outbound follow request confirmation
  • +
  • 4: Wall-to-wall post
  • +
  • 8: Reply
  • +
  • 16: Private message
  • +
  • 32: Friend suggestion
  • +
  • 64: Unused
  • +
  • 128: Mention
  • +
  • 256: Tag added to a post
  • +
  • 512: Poke
  • +
  • 1024: New post
  • +
  • 16384: System email
  • +
  • 32768: System event
  • +
nameStringFull name of the contact subject
urlString (URL)Profile page URL of the contact subject
photoString (URL)Profile photo URL of the contact subject
dateString (Date)YYYY-MM-DD hh:mm:ss local server time
msgString (BBCode)
uidIntegerOwner User Id
linkString (URL)Notification URL
iidIntegerItem Id
parentIntegerParent Item Id
seenInteger (Boolean)Whether the notification was read or not.
verbString (URL)[Activity Streams](http://activitystrea.ms) Verb URL
seenInteger (Boolean)Whether the notification was read or not.
otypeEnumSubject type (`item`, `intro` or `mail`)
name_cacheString (HTML)Full name of the contact subject
msg_cacheString (Plaintext)Plaintext version of the notification text with a placeholder (`{0}`) for the subject contact's name.
timestampIntegerUnix timestamp
date_relStringTime since the note was posted, eg "1 hour ago"
msg_htmlString (HTML)
msg_plainString (Plaintext)
+ +## Photo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idStringResource ID (32 hex chars)
createdString (Date)Format YYYY-MM-DD HH:MM:SS
editedString (Date)Format YYYY-MM-DD HH:MM:SS
titleString
descString (Plaintext)Picture caption
albumStringAlbum name
filenameStringOriginal image filename
typeStringMIME Type
heightIntegerImage height in pixels
widthIntegerImage width in pixels
profileInteger1 if it is a profile photo
allow_cidString (ACL)List of contact ids wrapped in angle brackets allowed to access the photo.
allow_gidString (ACL)List of contact group ids wrapped in angle brackets allowed to access the photo.
deny_cidString (ACL)List of contact ids wrapped in angle brackets forbidden to access the photo.
deny_gidString (ACL)List of contact group ids wrapped in angle brackets forbidden to access the photo.
linkArray of Strings (URL) +URLs to the different scales indexed by scale number if no specific scale was requested. +Mutually exclusive with data datasize. +
datasizeInteger +Picture size in bytes if a single scale was requested. +Mutually exclusive with link. +
dataString +Base64-encoded image data if a single scale was requested. +Mutually exclusive with link. +
friendica_activitiesActivities
friendica_commentsList of Items
rights_mismatchBooleanTrue if the ACL differs between the picture and the associated item.
+ +## Photo List Item + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idStringResource ID (32 hex chars)
albumStringAlbum name
filenameStringOriginal image filename
typeStringMIME Type
createdString (Date)Format YYYY-MM-DD HH:MM:SS
editedString (Date)Format YYYY-MM-DD HH:MM:SS
descString (Plaintext)Picture caption
thumbString (URL)URL of the smallest scale version of the picture.
+ +## Private message + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idInteger
sender_idIntegerSender Contact Id
textStringCan be HTML or plaintext depending on the API call parameter `getText`.
recipient_idIntegerRecipient Contact Id
created_atString (Date)Ex: Wed May 23 06:01:13 +0000 2007
sender_screen_nameString
recipient_screen_nameString
senderContact
recipientContact
titleStringEmpty if the API call parameter `getText` is empty or absent.
friendica_seenInteger (Boolean)Whether the private message has been read or not.
friendica_parent_uriString
+ +## Profile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
profile_idInteger
profile_nameString
is_defaultBoolean
hide_friendsBooleanWhether the user chose to hide their contact list on their profile.
profile_photoString (URL)Largest size profile picture URL.
profile_thumbString (URL)Smallest size profile picture URL.
publishBooleanWhether the user chose to publish their profile in the local directory.
net_publishBooleanWhether the user chose to publish their profile in the global directory.
descriptionString
date_of_birthString
addressString
cityString
regionString
postal_codeString
countryString
public_keywordsStringComma-separated list of words meant to be displayed as hashtags.
private_keywordsStringComma-separated list of words meant to be used for search only.
homepageString (URL)
+ +## Size + + + + + + + + + + +
AttributeTypeNullable
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeNullable
wIntegerNo
hIntegerNo
resizeEnum (fit, crop)Yes
+ + +## Sizes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeNullable
mediumSizeNo
largeSizeYes
thumbSizeYes
smallSizeYes
+ +## Symbol + +Unused + +## URL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeNullable
urlString (URL)No
expanded_urlString (URL)No
display_urlString (URL)No
indicesList of IntegerNo
+ +## User Mention + +Unused \ No newline at end of file diff --git a/doc/API-Friendica.md b/doc/API-Friendica.md new file mode 100644 index 0000000000..62a71dc6b1 --- /dev/null +++ b/doc/API-Friendica.md @@ -0,0 +1,703 @@ +# Friendica API + +* [Home](help) + * [Using the APIs](help/api) + +## Overview + +Friendica provides the following specific endpoints. + +Authentication is the same as described in [Using the APIs](help/api#Authentication). + +## Entities + +These endpoints uses the [Friendica API entities](help/API-Entities). + +## Endpoints + +### GET api/friendica/events + +Returns a list of [Event](help/API-Entities#Event) entities for the current logged in user. + +#### Parameters + +- `since_id`: (optional) minimum event id for pagination +- `count`: maximum number of items returned, default 20 + +### GET api/externalprofile/show + +Returns a [Contact](help/API-Entities#Contact) entity for the provided profile URL. + +#### Parameters + +- `profileurl`: Profile URL + +### GET api/statuses/public_timeline + +Returns a list of public [Items](help/API-Entities#Item) posted on this node. +Equivalent of the local community page. + +#### Parameters + +* `count`: Items per page (default: 20) +* `page`: page number +* `since_id`: minimum id +* `max_id`: maximum id +* `exclude_replies`: don't show replies (default: false) +* `conversation_id`: Shows all statuses of a given conversation. +* `include_entities`: "true" shows entities for pictures and links (Default: false) + +#### Unsupported parameters + +* `trim_user` + +### GET api/statuses/networkpublic_timeline + +Returns a list of public [Items](help/API-Entities#Item) this node is aware of. +Equivalent of the global community page. + +#### Parameters + +* `count`: Items per page (default: 20) +* `page`: page number +* `since_id`: minimum id +* `max_id`: maximum id +* `exclude_replies`: don't show replies (default: false) +* `conversation_id`: Shows all statuses of a given conversation. +* `include_entities`: "true" shows entities for pictures and links (Default: false) + +### GET api/statuses/replies + +#### Parameters + +* `count`: Items per page (default: 20) +* `page`: page number +* `since_id`: minimum id +* `max_id`: maximum id +* `include_entities`: "true" shows entities for pictures and links (Default: false) + +#### Unsupported parameters + +* `include_rts` +* `trim_user` +* `contributor_details` + +--- + +### GET api/conversation/show + +Unofficial Twitter command. It shows all direct answers (excluding the original post) to a given id. + +#### Parameters + +* `id`: id of the post +* `count`: Items per page (default: 20) +* `page`: page number +* `since_id`: minimum id +* `max_id`: maximum id +* `include_entities`: "true" shows entities for pictures and links (Default: false) + +#### Unsupported parameters + +* `include_rts` +* `trim_user` +* `contributor_details` + +### GET api/statusnet/conversation + +Alias of [`api/conversation/show`](#GET+api%2Fconversation%2Fshow). + +### GET api/statusnet/config + +Returns the public Friendica node configuration. + +### GET api/gnusocial/config + +Alias of [`api/statusnet/config`](#GET+api%2Fstatusnet%2Fconfig). + +### GET api/statusnet/version + +Returns a fake static StatusNet protocol version. + +### GET api/gnusocial/version + +Alias of [`api/statusnet/version`](#GET+api%2Fstatusnet%2Fversion). + +--- + +### POST api/friendica/activity/[verb] + +Add or remove an activity from an item. +'verb' can be one of: + +* `like` +* `dislike` +* `attendyes` +* `attendno` +* `attendmaybe` + +To remove an activity, prepend the verb with "un", eg. "unlike" or "undislike" +Attend verbs disable eachother: that means that if "attendyes" was added to an item, adding "attendno" remove previous "attendyes". +Attend verbs should be used only with event-related items (there is no check at the moment). + +#### Parameters + +* `id`: item id + +#### Return values + +On success: +json: + +```"ok"``` + +xml: + +```true``` + +On error: +HTTP 400 BadRequest + +--- + +### GET api/direct_messages + +Deprecated Twitter received direct message list endpoint. + +#### Parameters + +* `count`: Items per page (default: 20) +* `page`: page number +* `since_id`: minimum id +* `max_id`: maximum id +* `getText`: Defines the format of the status field. Can be "html" or "plain" +* `include_entities`: "true" shows entities for pictures and links (Default: false) +* `friendica_verbose`: "true" enables different error returns (default: "false") + +#### Unsupported parameters + +* `skip_status` + +### GET api/direct_messages/all + +Returns all [Private Messages](help/API-Entities#Private+message). + +#### Parameters + +* `count`: Items per page (default: 20) +* `page`: page number +* `since_id`: minimum id +* `max_id`: maximum id +* `getText`: Defines the format of the status field. Can be "html" or "plain" +* `friendica_verbose`: "true" enables different error returns (default: "false") + +### GET api/direct_messages/conversation + +Returns all replies of a single private message conversation. Returns [Private Messages](help/API-Entities#Private+message) + +#### Parameters + +* `count`: Items per page (default: 20) +* `page`: page number +* `since_id`: minimum id +* `max_id`: maximum id +* `getText`: Defines the format of the status field. Can be "html" or "plain" +* `uri`: URI of the conversation +* `friendica_verbose`: "true" enables different error returns (default: "false") + +### GET api/direct_messages/sent + +Deprecated Twitter sent direct message list endpoint. Returns [Private Messages](help/API-Entities#Private+message). + +#### Parameters + +* `count`: Items per page (default: 20) +* `page`: page number +* `since_id`: minimum id +* `max_id`: maximum id +* `getText`: Defines the format of the status field. Can be "html" or "plain" +* `include_entities`: "true" shows entities for pictures and links (Default: false) +* `friendica_verbose`: "true" enables different error returns (default: "false") + + +### POST/PUT api/direct_messages/new + +Deprecated Twitter direct message submission endpoint. + +#### Parameters + +* `user_id`: id of the user +* `screen_name`: screen name (for technical reasons, this value is not unique!) +* `text`: The message +* `replyto`: ID of the replied direct message +* `title`: Title of the direct message + +### POST/DELETE api/direct_messages/destroy + +Deprecated Twitter direct message deletion endpoint. + +#### Parameters + +* `id`: id of the message to be deleted +* `include_entities`: optional, currently not yet implemented +* `friendica_parenturi`: optional, can be used for increased safety to delete only intended messages +* `friendica_verbose`: "true" enables different error returns (default: "false") + +#### Return values + +On success: + +* JSON return as defined for Twitter API not yet implemented +* on friendica_verbose=true: JSON return {"result":"ok","message":"message deleted"} + +On error: +HTTP 400 BadRequest + +* on friendica_verbose=true: different JSON returns {"result":"error","message":"xyz"} + +### GET api/friendica/direct_messages_setseen + +#### Parameters + +* `id`: id of the message to be updated as seen + +#### Return values + +On success: + +* JSON return `{"result": "ok", "message": "message set to seen"}` + +On error: + +* different JSON returns `{"result": "error", "message": "xyz"}` + + +### GET api/friendica/direct_messages_search (GET; AUTH) + +Returns [Private Messages](help/API-Entities#Private+message) matching the provided search string. + +#### Parameters + +* `searchstring`: string for which the API call should search as '%searchstring%' in field 'body' of all messages of the authenticated user (caption ignored) +* `getText` (optional): `plain`|`html` If ommited, the title is prepended to the plaintext body in the `text` attribute of the private message objects. +* `getUserObjects` (optional): `true`|`false` If `false`, the `sender` and `recipient` attributes of the private message object are absent. + +#### Return values + +Returns only tested with JSON, XML might work as well. + +On success: + +* JSON return `{"success":"true", "search_results": array of found messages}` +* JSOn return `{"success":"false", "search_results": "nothing found"}` + +On error: + +* different JSON returns `{"result": "error", "message": "searchstring not specified"}` + +--- + +### GET api/friendica/group_show + +Return all or a specified group of the user with the containing contacts as array. + +#### Parameters + +* `gid`: optional, if not given, API returns all groups of the user + +#### Return values + +Array of: + +* `name`: name of the group +* `gid`: id of the group +* `user`: array of [Contacts](help/API-Entities#Contact) + +### POST/PUT api/friendica/group_create + +Create the group with the posted array of contacts as members. + +#### Parameters + +* `name`: name of the group to be created + +#### POST data + +JSON data as Array like the result of [GET api/friendica/group_show](#GET+api%2Ffriendica%2Fgroup_show): + +* `gid` +* `name` +* List of [Contacts](help/API-Entities#Contact) + +#### Return values + +Array of: + +* `success`: true if successfully created or reactivated +* `gid`: gid of the created group +* `name`: name of the created group +* `status`: "missing user" | "reactivated" | "ok" +* `wrong users`: array of users, which were not available in the contact table + +### POST api/friendica/group_update + +Update the group with the posted array of contacts as members (post all members of the group to the call; function will remove members not posted). + +#### Parameters + +* `gid`: id of the group to be changed +* `name`: name of the group to be changed + +#### POST data + +JSON data as array like the result of [GET api/friendica/group_show](#GET+api%2Ffriendica%2Fgroup_show): + +* `gid` +* `name` +* List of [Contacts](help/API-Entities#Contact) + +#### Return values + +Array of: + +* `success`: true if successfully updated +* `gid`: gid of the changed group +* `name`: name of the changed group +* `status`: "missing user" | "ok" +* `wrong users`: array of users, which were not available in the contact table + +### POST/DELETE api/friendica/group_delete + +Delete the specified group of contacts; API call need to include the correct gid AND name of the group to be deleted. + +#### Parameters + +* `gid`: id of the group to be deleted +* `name`: name of the group to be deleted + +#### Return values + +Array of: + +* `success`: true if successfully deleted +* `gid`: gid of the deleted group +* `name`: name of the deleted group +* `status`: "deleted" if successfully deleted +* `wrong users`: empty array + +--- + +### GET api/friendica/notifications + +Return last 50 [Notifications](help/API-Entities#Notification) for the current user, ordered by date with unseen item on top. + +#### Parameters + +none + +### POST api/friendica/notifications/seen + +Set notification as seen. + +#### Parameters + +- `id`: id of the notification to set seen + +#### Return values + +If the note is linked to an item, returns an [Item](help/API-Entities#Item). + +Otherwise, a success status is returned: + +* `success` (json) | `success` (xml) + +--- + +### GET api/friendica/photo + +Returns a [Photo](help/API-Entities#Photo). + +#### Parameters + +* `photo_id`: Resource id of a photo. +* `scale`: (optional) scale value of the photo + +Returns data of a picture with the given resource. +If 'scale' isn't provided, returned data include full url to each scale of the photo. +If 'scale' is set, returned data include image data base64 encoded. + +possibile scale value are: + +* 0: original or max size by server settings +* 1: image with or height at <= 640 +* 2: image with or height at <= 320 +* 3: thumbnail 160x160 +* 4: Profile image at 300x300 +* 5: Profile image at 80x80 +* 6: Profile image at 48x48 + +An image used as profile image has only scale 4-6, other images only 0-3 + +#### Return values + +json: + +```json + { + "id": "photo id", + "created": "date(YYYY-MM-DD HH:MM:SS)", + "edited": "date(YYYY-MM-DD HH:MM:SS)", + "title": "photo title", + "desc": "photo description", + "album": "album name", + "filename": "original file name", + "type": "mime type", + "height": "number", + "width": "number", + "profile": "1 if is profile photo", + "link": { + "": "url to image", + ... + }, + // if 'scale' is set + "datasize": "size in byte", + "data": "base64 encoded image data" + } +``` + +xml: + +```xml + + photo id + date(YYYY-MM-DD HH:MM:SS) + date(YYYY-MM-DD HH:MM:SS) + photo title + photo description + album name + original file name + mime type + number + number + 1 if is profile photo + + + ... + + +``` + +### GET api/friendica/photos/list + +Returns the API user's [Photo List Items](help/API-Entities#Photo+List+Item). + +#### Return values + +json: + +```json + [ + { + "id": "resource_id", + "album": "album name", + "filename": "original file name", + "type": "image mime type", + "thumb": "url to thumb sized image" + }, + ... + ] +``` + +xml: + +```xml + + + "url to thumb sized image" + + ... + +``` + +### POST api/friendica/photo/create + +Alias of [`api/friendica/photo/update`](#POST+api%2Ffriendica%2Fphoto%2Fupdate) + +### POST api/friendica/photo/update + +Saves data for the scales 0-2 to database (see above for scale description). +Call adds non-public entries to items table to enable authenticated contacts to comment/like the photo. +Client should pay attention to the fact that updated access rights are not transferred to the contacts. i.e. public photos remain publicly visible if they have been commented/liked before setting visibility back to a limited group. +Currently it is best to inform user that updating rights is not the right way to do this, and offer a solution to add photo as a new photo with the new rights instead. + +#### Parameters + +* `photo_id` (optional): if specified the photo with this id will be updated +* `media` (optional): image data as base64, only optional if photo_id is specified (new upload must have media) +* `desc` (optional): description for the photo, updated when photo_id is specified +* `album`: name of the album to be deleted (always necessary) +* `album_new` (optional): can be used to change the album of a single photo if photo_id is specified +* `allow_cid`/`allow_gid`/`deny_cid`/`deny_gid` (optional): + - on create: empty string or omitting = public photo, specify in format `````` for private photo + - on update: keys need to be present with empty values for changing a private photo to public + +#### Return values + +On success: + +* new photo uploaded: JSON return with photo data (see [GET api/friendica/photo](#GET+api%2Ffriendica%2Fphoto)) +* photo updated - changed photo data: JSON return with photo data (see [GET api/friendica/photo](#GET+api%2Ffriendica%2Fphoto)) +* photo updated - changed info: JSON return `{"result": "updated", "message":"Image id 'xyz' has been updated."}` +* photo updated - nothing changed: JSON return `{"result": "cancelled","message": "Nothing to update for image id 'xyz'."}` + +On error: + +* 403 FORBIDDEN: if not authenticated +* 400 BADREQUEST: "no albumname specified", "no media data submitted", "photo not available", "acl data invalid" +* 500 INTERNALSERVERERROR: "image size exceeds PHP config settings, file was rejected by server", + "image size exceeds Friendica Config setting (uploaded size: x)", + "unable to process image data", + "image upload failed", + "unknown error - uploading photo failed, see Friendica log for more information", + "unknown error - update photo entry in database failed", + "unknown error - this error on uploading or updating a photo should never happen" + +### DELETE api/friendica/photo/delete + +Deletes a single image with the specified id, is not reversible -> ensure that client is asking user for being sure to do this +Sets item table entries for this photo to deleted = 1. + +#### Parameters + +* `photo_id`: id of the photo to be deleted + +#### Return values + +On success: + +* JSON return + +```json +{ + "result": "deleted", + "message": "photo with id 'xyz' has been deleted from server." +} +``` + +On error: + +* 403 FORBIDDEN: if not authenticated +* 400 BADREQUEST: "no photo_id specified", "photo not available" +* 500 INTERNALSERVERERROR: "unknown error on deleting photo", "problem with deleting items occurred" + +--- + +### POST/DELETE api/friendica/photoalbum/delete + +Deletes all images with the specified album name, is not reversible -> ensure that client is asking user for being sure to do this. + +#### Parameters + +* `album`: name of the album to be deleted + +#### Return values + +On success: + +* JSON return + +```json +{ + "result": "deleted", + "message": "album 'xyz' with all containing photos has been deleted." +} +``` + +On error: + +* 403 FORBIDDEN: if not authenticated +* 400 BADREQUEST: "no albumname specified", "album not available" +* 500 INTERNALSERVERERROR: "problem with deleting item occured", "unknown error - deleting from database failed" + +### POST/PUT api/friendica/photoalbum/update + +Changes the album name to album_new for all photos in album. + +#### Parameters + +* `album`: name of the album to be updated +* `album_new`: new name of the album + +#### Return values + +On success: + +* JSON return + +```json +{ + "result": "updated", + "message":"album 'abc' with all containing photos has been renamed to 'xyz'." +} +``` + +On error: + +* 403 FORBIDDEN: if not authenticated +* 400 BADREQUEST: "no albumname specified", "no new albumname specified", "album not available" +* 500 INTERNALSERVERERROR: "unknown error - updating in database failed" + +--- + +### GET api/friendica/profile/show + +Returns the [Profile](help/API-Entities#Profile) data of the authenticated user. + +#### Return values + +On success: Array of: + +* `global_dir`: URL of the global directory set in server settings +* `friendica_owner`: user data of the authenticated user +* `profiles`: array of the profile data + +On error: +HTTP 403 Forbidden: when no authentication was provided +HTTP 400 Bad Request: if given profile_id is not in the database or is not assigned to the authenticated user + +General description of profile data in API returns: +- hide_friends: true if friends are hidden +- profile_photo +- profile_thumb +- publish: true if published on the server's local directory +- net_publish: true if published to global_dir +- fullname +- date_of_birth +- description +- xmpp +- homepage +- address +- locality +- region +- postal_code +- country +- pub_keywords +- custom_fields: list of public custom fields + +--- + +### GET api/friendica/remoteauth + +Similar as /redir, redirects to `url` after DFRN authentication. + +#### Parameters + +- `c_url`: url of remote contact to auth to +- `url`: string, url to redirect after auth + +## Deprecated endpoints + +- POST api/statuses/mediap diff --git a/doc/API-GNU-Social.md b/doc/API-GNU-Social.md new file mode 100644 index 0000000000..157450666b --- /dev/null +++ b/doc/API-GNU-Social.md @@ -0,0 +1,81 @@ +# GNU Social API + +* [Home](help) + * [Using the APIs](help/api) + +## Overview + +Friendica provides the following endpoints defined in [the official GNU Social Twitter-like API reference](https://gnusocial.net/doc/twitterapi). + +Authentication is the same as described in [Using the APIs](help/api#Authentication). + +## Entities + +These endpoints use the [Friendica API entities](help/API-Entities). + +## Implemented endpoints + +- GET api/account/rate_limit_status +- POST api/account/update_profile_image +- GET api/account/verify_credentials + +- GET api/direct_messages +- POST/DELETE api/direct_messages/destroy +- POST api/direct_messages/new +- GET api/direct_messages/sent +- GET api/favorites +- POST api/favorites/create/:id +- POST api/favorites/destroy/:id +- GET api/followers/ids +- POST api/friendships/destroy +- GET api/friends/ids +- GET/POST api/help/test +- POST api/oauth/access_token +- POST api/oauth/request_token +- GET api/search +- GET api/statuses/show/:id +- POST api/statuses/destroy/:id +- GET api/statuses/followers +- GET api/statuses/friends +- GET api/statuses/friends_timeline +- GET api/statuses/friends_timeline/:username +- GET api/statuses/home_timeline +- GET api/statuses/mentions +- GET api/statuses/replies +- GET api/statuses/replies/:username +- POST api/statuses/retweet/:id +- GET api/statuses/public_timeline +- POST api/statuses/update +- GET api/statuses/user_timeline +- GET api/users/show + +## Non-implemented endpoints + +- statuses/retweeted_to_me +- statuses/retweeted_by_me +- statuses/retweets_of_me +- friendships/create +- friendships/exists +- friendships/show +- account/end_session +- account/update_delivery_device +- account/update_profile_background_image +- notifications/follow +- notifications/leave +- blocks/create +- blocks/destroy +- blocks/exists +- blocks/blocking +- oauth/authorize +- statusnet/groups/timeline +- statusnet/groups/show +- statusnet/groups/create +- statusnet/groups/join +- statusnet/groups/leave +- statusnet/groups/list +- statusnet/groups/list_all +- statusnet/groups/membership +- statusnet/groups/is_member +- statusnet/tags/timeline +- statusnet/media/upload +- statusnet/config diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md new file mode 100644 index 0000000000..d9e6f22b66 --- /dev/null +++ b/doc/API-Mastodon.md @@ -0,0 +1,39 @@ +# Mastodon API + +* [Home](help) + * [Using the APIs](help/api) + +## Overview + +Friendica provides the following endpoints defined in [the official Mastodon API reference](https://docs.joinmastodon.org/api/). + +Authentication is the same as described in [Using the APIs](help/api#Authentication). + +## Entities + +These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/entities/). + +## Implemented endpoints + +- [`GET /api/v1/custom_emojis`](https://docs.joinmastodon.org/methods/instance/custom_emojis/) + - Doesn't return unicode emojis since they aren't using an image URL + + +- [`GET /api/v1/follow_requests`](https://docs.joinmastodon.org/methods/accounts/follow_requests#pending-follows) + - Returned IDs are specific to follow requests +- [`POST /api/v1/follow_requests/:id/authorize`](https://docs.joinmastodon.org/methods/accounts/follow_requests#accept-follow) + - `:id` is a follow request ID, not a regular account id +- [`POST /api/v1/follow_requests/:id/reject`](https://docs.joinmastodon.org/methods/accounts/follow_requests#reject-follow) + - `:id` is a follow request ID, not a regular account id +- `POST /api/v1/follow_requests/:id/ignore` + - Friendica-specific, hides the follow request from the list and prevents the remote contact from retrying. + - `:id` is a follow request ID, not a regular account id + - Returns a [Relationship](https://docs.joinmastodon.org/entities/relationship) object. + + +- [`GET /api/v1/instance`](https://docs.joinmastodon.org/methods/instance#fetch-instance) +- [`GET /api/v1/instance/peers`](https://docs.joinmastodon.org/methods/instance#list-of-connected-domains) + +## Non-implemented endpoints + +- [`GET /api/v1/instance/activity`](https://docs.joinmastodon.org/methods/instance#weekly-activity) diff --git a/doc/API-Twitter.md b/doc/API-Twitter.md new file mode 100644 index 0000000000..fab26ae5b5 --- /dev/null +++ b/doc/API-Twitter.md @@ -0,0 +1,306 @@ +# Twitter API + +* [Home](help) + * [Using the APIs](help/api) + +## Overview + +Friendica provides the following endpoints defined in the [official Twitter API reference](https://developer.twitter.com/en/docs/api-reference-index). + +Authentication is the same as described in [Using the APIs](help/api#Authentication). + +## Entities + +These endpoints use the [Friendica API entities](help/API-Entities). + +## Different behaviour + +* `screen_name`: The nick name in Friendica is only unique in each network but not for all networks. The users are searched in the following priority: Friendica, StatusNet/GNU Social, Diaspora, pump.io, Twitter. If no contact was found by this way, then the first contact is taken. +* `include_entities`: Default is "false". If set to "true" then the plain text is formatted so that links are having descriptions. + +## Friendica-specific return values + +* `cid`: Contact id of the user (important for "contact_allow" and "contact_deny") +* `network`: network of the user + +## Unsupported parameters + +* `cursor` +* `trim_user` +* `contributor_details` +* `place_id` +* `display_coordinates` +* `include_rts`: To-Do +* `include_my_retweet`: Retweets in Friendica are implemented in a different way + +## Implemented endpoints + +- [POST api/oauth/access_token](https://developer.twitter.com/en/docs/basics/authentication/api-reference/access_token) + - Unsupported parameters: + - `x_auth_password` + - `x_auth_username` + - `x_auth_mode` +- [POST api/oauth/request_token](https://developer.twitter.com/en/docs/basics/authentication/api-reference/request_token) + - Unsupported parameter: + - `x_auth_access_type` + + +- [GET api/account/verify_credentials](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials) + - Unsupported parameter: + - `include_email` +- [POST api/account/update_profile](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile) + - Unsupported parameters: + - `url` + - `location` + - `profile_link_color` + - `include_entities` + - `skip_status` +- [POST api/account/update_profile_image](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_image) + - Additional parameter: + - `profile_id` (optional): Numerical id of the profile for which the image should be used, default is changing the default profile. + + +- [POST api/statuses/update](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update) + - Unsupported parameter: + - `display_coordinates` +- [POST api/statuses/update_with_media (deprecated)](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update_with_media) + + +- [POST api/media/upload](https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-upload) + - Additional return value: + - `image.friendica_preview_url`: image preview url +- [POST api/media/metadata/create](https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-metadata-create) + + +- [GET api/users/show](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-show) +- [GET api/users/search](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-search) + - Unsupported parameters: + - `page` + - `count` + - `include_entities` +- [GET api/users/lookup](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-lookup) + - Unsupported parameters: + - `screen_name` + - `include_entities` + + +- [GET api/search/tweets](https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets) + - Unsupported parameters: + - `geocode` + - `lang` + - `locale` + - `result_type` + - `until` + - `include_entities` + + +- [GET api/saved_searches/list](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-list) + + +- [GET api/statuses/home_timeline](https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-home_timeline) + - Alias: `GET api/statuses/friends_timeline` +- [GET api/statuses/user_timeline](https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-user_timeline) +- [GET api/statuses/mentions (deprecated)](https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-mentions_timeline) +- [GET api/statuses/show/:id](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-show-id) +- [POST api/statuses/retweet/:id](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-retweet-id) +- [POST api/statuses/destroy/:id](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-destroy-id) +- [GET api/statuses/followers (deprecated)](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-list) + - Alias: `GET api/statuses/friends` + + +- [GET api/favorites (deprecated)](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-favorites-list) + - Unsupported parameters: + - `user_id`: Favorites aren't returned for other users than self + - `screen_name`: Favorites aren't returned for other users than self +- [POST api/favorites/create](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-favorites-create) +- [POST api/favorites/destroy](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-favorites-destroy) + + +- [GET api/lists/list](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-list) +- [GET api/lists/ownerships](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-ownerships) + - Unsupported parameters: + - `slug` + - `owner_screen_name` + - `owner_id` + - `include_entities` +- [GET api/lists/statuses](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses) + - Unsupported parameters: + - `screen_name` + - `count` +- [GET api/lists/subscriptions](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-subscriptions) +- [POST api/lists/update](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-update) + - Unsupported parameters: + - `slug` + - `name` + - `mode` + - `description` + - `owner_screen_name` + - `owner_id` +- [POST api/lists/create](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-create) + - Unsupported parameters: + - `mode` + - `description` +- [POST api/lists/destroy](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-destroy) + - Unsupported parameters: + - `owner_screen_name` + - `owner_id` + - `slug` + +- [GET api/blocks/list](https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/get-blocks-list) + + +- [GET api/friendships/incoming](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friendships-incoming) + - Unsupported parameters + - `stringify_ids` + +- - [GET api/followers/ids](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids) + - [GET api/followers/list](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-list) + - [GET api/friends/ids](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friends-ids) + - [GET api/friends/list](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friends-list) + - Additional parameters: + - `since_id`: You can use the `next_cursor` value to load the next page. + - `max_id`: You can use the inverse of the `previous_cursor` value to load the previous page. + - Unsupported parameter: + - `skip_status`: No status is returned even if it isn't set to true. + - Caveats: + - `cursor` trumps `since_id` trumps `max_id` if any combination is provided. + - `user_id` must be the ID of a contact associated with a local user account. + - `screen_name` must be associated with a local user account. + - `screen_name` trumps `user_id` if both are provided (undocumented Twitter behavior). + - Will succeed but return an empty array for users hiding their contact lists. + + +- [POST api/friendships/destroy](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/post-friendships-destroy) + + + + +## Non-implemented endpoints + +- [GET oauth/authenticate](https://developer.twitter.com/en/docs/basics/authentication/api-reference/authenticate) +- [GET oauth/authorize](https://developer.twitter.com/en/docs/basics/authentication/api-reference/authorize) +- [POST oauth/invalidate_token](https://developer.twitter.com/en/docs/basics/authentication/api-reference/invalidate_access_token) +- [POST oauth2/invalidate_token](https://developer.twitter.com/en/docs/basics/authentication/api-reference/invalidate_bearer_token) +- [POST oauth2/token](https://developer.twitter.com/en/docs/basics/authentication/api-reference/token) + + +- [GET lists/members](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-members) +- [GET lists/members/show](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-members-show) +- [GET lists/memberships](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-memberships) +- [GET lists/show](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-show) +- [GET lists/subscribers](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers) +- [GET lists/subscribers/show](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show) +- [POST lists/members/create](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-members-create) +- [POST lists/members/create_all](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-members-create_all) +- [POST lists/members/destroy](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy) +- [POST lists/members/destroy_all](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy_all) +- [POST lists/subscribers/create](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-create) +- [POST lists/subscribers/destroy](https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-destroy) + + +- [GET friendships/lookup](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friendships-lookup) +- [GET friendships/no_retweets/ids](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friendships-no_retweets-ids) +- [GET friendships/outgoing](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friendships-outgoing) +- [GET friendships/show](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friendships-show) +- [GET users/suggestions (deprecated)](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-suggestions) +- [GET users/suggestions/:slug (deprecated)](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-suggestions-slug) +- [GET users/suggestions/:slug/members (deprecated)](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-suggestions-slug-members) +- [POST friendships/create](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/post-friendships-create) +- [POST friendships/update](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/post-friendships-update) + + +- [GET account/settings](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-account-settings) +- [GET saved_searches/show/:id](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-show-id) +- [GET users/profile_banner](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-users-profile_banner) +- [POST account/remove_profile_banner](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-remove_profile_banner) +- [POST account/settings](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-settings) +- [POST account/update_profile_background_image (deprecated)](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_background_image) +- [POST account/update_profile_banner](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner) +- [POST saved_searches/create](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-saved_searches-create) +- [POST saved_searches/destroy/:id](https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-saved_searches-destroy-id) + + +- [GET blocks/ids](https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/get-blocks-ids) +- [GET mutes/users/ids](https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-ids) +- [GET mutes/users/list](https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-list) +- [POST blocks/create](https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/post-blocks-create) +- [POST blocks/destroy](https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/post-blocks-destroy) +- [POST mutes/users/create](https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/post-mutes-users-create) +- [POST mutes/users/destroy](https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/post-mutes-users-destroy) +- [POST users/report_spam](https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/post-users-report_spam) + + +- [GET collections/entries](https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/get-collections-entries) +- [GET collections/list](https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/get-collections-list) +- [GET collections/show](https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/get-collections-show) +- [POST collections/create](https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/post-collections-create) +- [POST collections/destroy](https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/post-collections-destroy) +- [POST collections/entries/add](https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/post-collections-entries-add) +- [POST collections/entries/curate](https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/post-collections-entries-curate) +- [POST collections/entries/move](https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/post-collections-entries-move) +- [POST collections/entries/remove](https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/post-collections-entries-remove) +- [POST collections/update](https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/post-collections-update) + + +- [POST statuses/filter](https://developer.twitter.com/en/docs/tweets/filter-realtime/api-reference/post-statuses-filter) + + +- [GET statuses/mentions_timeline](https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-mentions_timeline) + + +- [GET favorites/list](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-favorites-list) +- [GET statuses/lookup](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-lookup) +- [GET statuses/oembed](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-oembed) +- [GET statuses/retweeters/ids](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-retweeters-ids) +- [GET statuses/retweets/:id](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-retweets-id) +- [GET statuses/retweets_of_me](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-retweets_of_me) +- [POST statuses/unretweet/:id](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-unretweet-id) + + +- [GET statuses/sample](https://developer.twitter.com/en/docs/tweets/sample-realtime/api-reference/get-statuses-sample) + + +- [GET compliance/firehose](https://developer.twitter.com/en/docs/tweets/compliance/api-reference/compliance-firehose) + + +- [DELETE custom_profiles/destroy.json](https://developer.twitter.com/en/docs/direct-messages/custom-profiles/api-reference/delete-profile) +- [GET custom_profiles/:id](https://developer.twitter.com/en/docs/direct-messages/custom-profiles/api-reference/get-profile) +- [GET custom_profiles/list](https://developer.twitter.com/en/docs/direct-messages/custom-profiles/api-reference/get-profile-list) +- [POST custom_profiles/new.json](https://developer.twitter.com/en/docs/direct-messages/custom-profiles/api-reference/new-profile) + + +- [DELETE direct_messages/events/destroy](https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/delete-message-event) +- [GET direct_messages/events/list](https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/list-events) +- [GET direct_messages/events/show](https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/get-event) +- [POST direct_messages/events/new (message_create)](https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/new-event) +- [POST direct_messages/indicate_typing](https://developer.twitter.com/en/docs/direct-messages/typing-indicator-and-read-receipts/api-reference/new-typing-indicator) +- [POST direct_messages/mark_read](https://developer.twitter.com/en/docs/direct-messages/typing-indicator-and-read-receipts/api-reference/new-read-receipt) + + +- [DELETE direct_messages/welcome_messages/destroy](https://developer.twitter.com/en/docs/direct-messages/welcome-messages/api-reference/delete-welcome-message) +- [DELETE direct_messages/welcome_messages/rules/destroy](https://developer.twitter.com/en/docs/direct-messages/welcome-messages/api-reference/delete-welcome-message-rule) +- [PUT direct_messages/welcome_messages/update](https://developer.twitter.com/en/docs/direct-messages/welcome-messages/api-reference/update-welcome-message) +- [GET direct_messages/welcome_messages/list](https://developer.twitter.com/en/docs/direct-messages/welcome-messages/api-reference/list-welcome-messages) +- [GET direct_messages/welcome_messages/rules/list](https://developer.twitter.com/en/docs/direct-messages/welcome-messages/api-reference/list-welcome-message-rules) +- [GET direct_messages/welcome_messages/rules/show](https://developer.twitter.com/en/docs/direct-messages/welcome-messages/api-reference/get-welcome-message-rule) +- [GET direct_messages/welcome_messages/show](https://developer.twitter.com/en/docs/direct-messages/welcome-messages/api-reference/get-welcome-message) +- [POST direct_messages/welcome_messages/new](https://developer.twitter.com/en/docs/direct-messages/welcome-messages/api-reference/new-welcome-message) +- [POST direct_messages/welcome_messages/rules/new](https://developer.twitter.com/en/docs/direct-messages/welcome-messages/api-reference/new-welcome-message-rule) + + +- [GET media/upload (STATUS)](https://developer.twitter.com/en/docs/media/upload-media/api-reference/get-media-upload-status) +- [POST media/subtitles/create](https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-subtitles-create) +- [POST media/subtitles/delete](https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-subtitles-delete) +- [POST media/upload (APPEND)](https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-upload-append) +- [POST media/upload (FINALIZE)](https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-upload-finalize) +- [POST media/upload (INIT)](https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-upload-init) + + +- [GET trends/available](https://developer.twitter.com/en/docs/trends/locations-with-trending-topics/api-reference/get-trends-available) +- [GET trends/closest](https://developer.twitter.com/en/docs/trends/locations-with-trending-topics/api-reference/get-trends-closest) +- [GET trends/place](https://developer.twitter.com/en/docs/trends/trends-for-location/api-reference/get-trends-place) + + +- [GET geo/id/:place_id](https://developer.twitter.com/en/docs/geo/place-information/api-reference/get-geo-id-place_id) +- [GET geo/reverse_geocode](https://developer.twitter.com/en/docs/geo/places-near-location/api-reference/get-geo-reverse_geocode) +- [GET geo/search](https://developer.twitter.com/en/docs/geo/places-near-location/api-reference/get-geo-search) diff --git a/doc/Account-Basics.md b/doc/Account-Basics.md index da865ad2b5..5e22e8a151 100644 --- a/doc/Account-Basics.md +++ b/doc/Account-Basics.md @@ -99,7 +99,7 @@ See Also * [Profiles](help/Profiles) -* [Global Directory](help/Making-Friends#1_1) +* [Global Directory](help/Making-Friends#The+Directories) * [Groups and Privacy](help/Groups-and-Privacy) diff --git a/doc/AddonStorageBackend.md b/doc/AddonStorageBackend.md index d42c8bbbd7..950a2ad88d 100644 --- a/doc/AddonStorageBackend.md +++ b/doc/AddonStorageBackend.md @@ -17,22 +17,24 @@ namespace Friendica\Model\Storage; ```php interface IStorage { - public static function get($ref); - public static function put($data, $ref = ""); - public static function delete($ref); - public static function getOptions(); - public static function saveOptions($data); + public function get(string $reference); + public function put(string $data, string $reference = ''); + public function delete(string $reference); + public function getOptions(); + public function saveOptions(array $data); + public function __toString(); + public static function getName(); } ``` -- `get($ref)` returns data pointed by `$ref` -- `put($data, $ref)` saves data in `$data` to position `$ref`, or a new position if `$ref` is empty. -- `delete($ref)` delete data pointed by `$ref` +- `get(string $reference)` returns data pointed by `$reference` +- `put(string $data, string $reference)` saves data in `$data` to position `$reference`, or a new position if `$reference` is empty. +- `delete(string $reference)` delete data pointed by `$reference` Each storage backend can have options the admin can set in admin page. - `getOptions()` returns an array with details about each option to build the interface. -- `saveOptions($data)` get `$data` from admin page, validate it and save it. +- `saveOptions(array $data)` get `$data` from admin page, validate it and save it. The array returned by `getOptions()` is defined as: @@ -50,7 +52,7 @@ The info array for each option is defined as: 'type', define the field used in form, and the type of data. -one of 'checkbox', 'combobox', 'custom', 'datetime', 'input', 'intcheckbox', 'password', 'radio', 'richtext', 'select', 'select_raw', 'textarea', 'yesno' +one of 'checkbox', 'combobox', 'custom', 'datetime', 'input', 'intcheckbox', 'password', 'radio', 'richtext', 'select', 'select_raw', 'textarea' 'label', @@ -71,7 +73,6 @@ Optional. Depends on which 'type' this option is: - 'select': array `[ value => label ]` of choices - 'intcheckbox': value of input element - 'select_raw': prebuild html string of `