From 3f71cdf8be1c97a41323eeaa539b12895bfe0065 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 18 Mar 2018 23:15:31 -0400 Subject: [PATCH 1/6] Move util/composer.ohar to bin/ --- INSTALL.txt | 2 +- {util => bin}/composer.phar | Bin doc/Composer.md | 12 ++++++------ doc/Developers-Intro.md | 2 +- doc/Github.md | 2 +- doc/Install.md | 2 +- doc/Update.md | 2 +- doc/de/Install.md | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) rename {util => bin}/composer.phar (100%) mode change 100755 => 100644 diff --git a/INSTALL.txt b/INSTALL.txt index 01fe65d11..ee3779bc9 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -66,7 +66,7 @@ OR git clone https://github.com/friendica/friendica [web server folder] cd [web server folder] - php util/composer.phar install + php bin/composer.phar install 3. Create an empty database and note the access details (hostname, username, password, database name). diff --git a/util/composer.phar b/bin/composer.phar old mode 100755 new mode 100644 similarity index 100% rename from util/composer.phar rename to bin/composer.phar diff --git a/doc/Composer.md b/doc/Composer.md index 41fc2aca3..306d0fa89 100644 --- a/doc/Composer.md +++ b/doc/Composer.md @@ -12,7 +12,7 @@ It's a command-line tool that downloads required libraries into the `vendor` fol ## How to use Composer -If you don't have Composer installed on your system, Friendica ships with a copy of it at `util/composer.phar`. +If you don't have Composer installed on your system, Friendica ships with a copy of it at `bin/composer.phar`. For the purpose of this help, all examples will use this path to run Composer commands, however feel free to replace them with your own way of calling Composer. Composer requires PHP CLI and the following examples assume it's available system-wide. @@ -30,7 +30,7 @@ Here are the typical commands you will have to run to do so: ```` ~> git clone https://github.com/friendica/friendica.git friendica ~/friendica> cd friendica -~/friendica> util/composer.phar install +~/friendica> bin/composer.phar install ```` That's it! Composer will take care of fetching all the required libraries in the `vendor` folder and build the autoloader to make those libraries available to Friendica. @@ -42,7 +42,7 @@ Updating Friendica to the current stable or the latest develop version is easy w ```` ~> cd friendica ~/friendica> git pull -~/friendica> util/composer.phar install +~/friendica> bin/composer.phar install ```` And that's it. If any library used by Friendica has been upgraded, Composer will fetch the version currently used by Friendica and refresh the autoloader to ensure the best performances. @@ -87,13 +87,13 @@ Or you can specify the exact version of the library if you code requires it, and To add a library, just add its Packagist identifier to the `require` list and set a target version string. -Then you should run `util/composer.phar update` to add it to your local `vendor` folder and update the `composer.lock` file that specifies the current versions of the dependencies. +Then you should run `bin/composer.phar update` to add it to your local `vendor` folder and update the `composer.lock` file that specifies the current versions of the dependencies. #### Updating an existing dependency If a package needs to be updated, whether to the next minor version or to the next major version provided you changed the adequate code in Friendica, simply edit `composer.json` to update the target version string of the relevant library. -Then you should run `util/composer.phar update` to update it in your local `vendor` folder and update the `composer.lock` file that specifies the current versions of the dependencies. +Then you should run `bin/composer.phar update` to update it in your local `vendor` folder and update the `composer.lock` file that specifies the current versions of the dependencies. Please note that you should commit both `composer.json` and `composer.lock` with your work every time you make a change to the former. @@ -111,7 +111,7 @@ This is because `sudo` doesn't always change the `HOME` environment variable, wh However, you can temporarily change environment variable for the execution of a single command. For Composer, this would be: ```` -$> COMPOSER_HOME=/var/tmp/composer sudo -u [web user] util/composer.phar [mode] +$> COMPOSER_HOME=/var/tmp/composer sudo -u [web user] bin/composer.phar [mode] ```` ## Related diff --git a/doc/Developers-Intro.md b/doc/Developers-Intro.md index f0591cddc..53aacafb4 100644 --- a/doc/Developers-Intro.md +++ b/doc/Developers-Intro.md @@ -61,7 +61,7 @@ If you want to have git automatically update the dependencies with composer, you } # `composer install` if the `composer.lock` file gets changed # to update all the php dependencies - check_run composer.lock "util/composer.phar install --no-dev" + check_run composer.lock "bin/composer.phar install --no-dev" just place it into `.git/hooks/post-merge` and make it executable. diff --git a/doc/Github.md b/doc/Github.md index a34855bf7..7c6233d31 100644 --- a/doc/Github.md +++ b/doc/Github.md @@ -13,7 +13,7 @@ Introduction to the workflow with our GitHub repository 3. Fork the Friendica repository from [https://github.com/friendica/friendica.git](https://github.com/friendica/friendica.git). 4. Clone your fork from your GitHub account to your machine. Follow the instructions provided here: [http://help.github.com/fork-a-repo/](http://help.github.com/fork-a-repo/) to create and use your own tracking fork on GitHub -5. Run `util/composer.phar install` in Friendica's folder. +5. Run `bin/composer.phar install` in Friendica's folder. 6. Commit your changes to your fork. Then go to your GitHub page and create a "Pull request" to notify us to merge your work. diff --git a/doc/Install.md b/doc/Install.md index c9fc4e603..23232347e 100644 --- a/doc/Install.md +++ b/doc/Install.md @@ -47,7 +47,7 @@ The Linux commands to clone the repository into a directory "mywebsite" would be git clone https://github.com/friendica/friendica.git mywebsite cd mywebsite - util/composer.phar install + bin/composer.phar install Make sure the folder *view/smarty3* exists and is writable by the webserver user diff --git a/doc/Update.md b/doc/Update.md index 57d29bae4..9e9324da9 100644 --- a/doc/Update.md +++ b/doc/Update.md @@ -21,7 +21,7 @@ You can get the latest changes at any time with cd path/to/friendica git pull - util/composer.phar install + bin/composer.phar install The addon tree has to be updated separately like so: diff --git a/doc/de/Install.md b/doc/de/Install.md index 8c7c72cfc..916c131d6 100644 --- a/doc/de/Install.md +++ b/doc/de/Install.md @@ -49,7 +49,7 @@ Wir planen, diese Einschränkung in einer zukünftigen Version zu beheben. `cd meinewebseite` `git pull` - `util/composer.phar install` + `bin/composer.phar install` - Addons installieren - zunächst solltest du **in** deinem Webseitenordner sein From 542ff9b0825bc2b21137f23026d61c2c9644ef13 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 18 Mar 2018 23:17:31 -0400 Subject: [PATCH 2/6] Move scripts/auth_ejabberd.php to bin/ --- {scripts => bin}/auth_ejabberd.php | 6 +++--- doc/install-ejabberd.md | 6 +++--- src/Util/ExAuth.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) rename {scripts => bin}/auth_ejabberd.php (89%) mode change 100755 => 100644 diff --git a/scripts/auth_ejabberd.php b/bin/auth_ejabberd.php old mode 100755 new mode 100644 similarity index 89% rename from scripts/auth_ejabberd.php rename to bin/auth_ejabberd.php index 32aa30898..06d8488df --- a/scripts/auth_ejabberd.php +++ b/bin/auth_ejabberd.php @@ -13,14 +13,14 @@ * Installation: * * - Change it's owner to whichever user is running the server, ie. ejabberd - * $ chown ejabberd:ejabberd /path/to/friendica/scripts/auth_ejabberd.php + * $ chown ejabberd:ejabberd /path/to/friendica/bin/auth_ejabberd.php * * - Change the access mode so it is readable only to the user ejabberd and has exec - * $ chmod 700 /path/to/friendica/scripts/auth_ejabberd.php + * $ 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/script/auth_ejabberd.php"}. + * {extauth_program, "/path/to/friendica/bin/auth_ejabberd.php"}. * * - Restart your ejabberd service, you should be able to login with your friendica auth info * diff --git a/doc/install-ejabberd.md b/doc/install-ejabberd.md index 8f95069e6..dbdc0b975 100644 --- a/doc/install-ejabberd.md +++ b/doc/install-ejabberd.md @@ -11,16 +11,16 @@ Installation - Change it's owner to whichever user is running the server, ie. ejabberd - $ chown ejabberd:ejabberd /path/to/friendica/include/auth_ejabberd.php + $ chown ejabberd:ejabberd /path/to/friendica/bin/auth_ejabberd.php - Change the access mode so it is readable only to the user ejabberd and has exec - $ chmod 700 /path/to/friendica/include/auth_ejabberd.php + $ 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/include/auth_ejabberd.php"}. + {extauth_program, "/path/to/friendica/bin/auth_ejabberd.php"}. - Disable the module "mod_register" and disable the registration: diff --git a/src/Util/ExAuth.php b/src/Util/ExAuth.php index a6851c385..d4436e32a 100644 --- a/src/Util/ExAuth.php +++ b/src/Util/ExAuth.php @@ -13,14 +13,14 @@ * Installation: * * - Change it's owner to whichever user is running the server, ie. ejabberd - * $ chown ejabberd:ejabberd /path/to/friendica/scripts/auth_ejabberd.php + * $ chown ejabberd:ejabberd /path/to/friendica/bin/auth_ejabberd.php * * - Change the access mode so it is readable only to the user ejabberd and has exec - * $ chmod 700 /path/to/friendica/scripts/auth_ejabberd.php + * $ 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/script/auth_ejabberd.php"}. + * {extauth_program, "/path/to/friendica/bin/auth_ejabberd.php"}. * * - Restart your ejabberd service, you should be able to login with your friendica auth info * From e7e497e244a91f38416bf26015ecb952282b13b0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 18 Mar 2018 23:24:09 -0400 Subject: [PATCH 3/6] Move scripts/daemon.php to bin/ --- {scripts => bin}/daemon.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {scripts => bin}/daemon.php (98%) mode change 100755 => 100644 diff --git a/scripts/daemon.php b/bin/daemon.php old mode 100755 new mode 100644 similarity index 98% rename from scripts/daemon.php rename to bin/daemon.php index a9b8d1d26..b53a69e1b --- a/scripts/daemon.php +++ b/bin/daemon.php @@ -1,7 +1,7 @@ #!/usr/bin/env php Date: Sun, 18 Mar 2018 23:25:21 -0400 Subject: [PATCH 4/6] Move scripts/worker.php to bin/ --- INSTALL.txt | 8 ++++---- bin/daemon.php | 2 +- {scripts => bin}/worker.php | 2 +- doc/Install.md | 4 ++-- doc/de/Install.md | 4 ++-- src/Core/Worker.php | 2 +- util/vagrant_provision.sh | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) rename {scripts => bin}/worker.php (97%) mode change 100755 => 100644 diff --git a/INSTALL.txt b/INSTALL.txt index ee3779bc9..2a95822a2 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -113,14 +113,14 @@ tables, so that you can start fresh. 8. 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 scripts/worker.php + 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 scripts/worker.php +*/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 @@ -293,14 +293,14 @@ 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 scripts/worker.php +-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 scripts/worker.php calls further php script via +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. diff --git a/bin/daemon.php b/bin/daemon.php index b53a69e1b..6b0e377a3 100644 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -104,7 +104,7 @@ while (true) { set_time_limit(0); // Call the worker - $cmdline = $php.' scripts/worker.php'; + $cmdline = $php.' bin/worker.php'; $executed = false; diff --git a/scripts/worker.php b/bin/worker.php old mode 100755 new mode 100644 similarity index 97% rename from scripts/worker.php rename to bin/worker.php index 1980a21b1..67f9fed1a --- a/scripts/worker.php +++ b/bin/worker.php @@ -1,7 +1,7 @@ #!/usr/bin/env php proc_run($args); } diff --git a/util/vagrant_provision.sh b/util/vagrant_provision.sh index 7ca5a1f4e..eab125b0d 100755 --- a/util/vagrant_provision.sh +++ b/util/vagrant_provision.sh @@ -88,7 +88,7 @@ echo "create database friendica DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_ge $MYSQL -uroot -proot friendica < /vagrant/friendica_test_data.sql # create cronjob - activate if you have enough memory in you dev VM -echo "*/10 * * * * cd /vagrant; /usr/bin/php scripts/worker.php" >> friendicacron +echo "*/10 * * * * cd /vagrant; /usr/bin/php bin/worker.php" >> friendicacron sudo crontab friendicacron sudo rm friendicacron From 7cd3b5d629a81ad85b4434f2144be7947492f927 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 18 Mar 2018 23:27:41 -0400 Subject: [PATCH 5/6] Move util/run_xgettext.sh to bin/ --- CHANGELOG | 20 ++++++++++---------- {util => bin}/run_xgettext.sh | 0 util/README | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) rename {util => bin}/run_xgettext.sh (100%) mode change 100755 => 100644 diff --git a/CHANGELOG b/CHANGELOG index 9ad913771..3d5c11f51 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -72,7 +72,7 @@ Version 3.5.3 (2017-10-05) Fixes to buffer, diaspora, libertree, pumpio, gnu social, tumblr, twitter and wppost bridges to redistribute remote_self content [annando] Fixed a bug in securemail settings form [FuzzJunket] external poller addons are deprecated, as this is now a core functionality [annando] - + Friendica Directory: Fix a problem with the Vagrant config [tobiasd] Fix not working node health page [Hypolite] @@ -82,7 +82,7 @@ Version 3.5.3 (2017-10-05) 1257, 2786, 2864, 2872, 2998, 3013, 3018, 3131, 3180, 3234, 3248, 3309, 3313, 3360, 3362, 3391, 3482, 3511, 3512, 3515, 3516, 3529, 3531, 3536, 3545, 3552, 3553, 3560, 3571, 3589, 3592, 3599, 3615, - 3616, 3621, 3624, 3636, 3645, 3661, 3684, 3685, 3691, 3696, 3699, + 3616, 3621, 3624, 3636, 3645, 3661, 3684, 3685, 3691, 3696, 3699, 3700, 3732 Version 3.5.2 (2017-06-06) @@ -199,8 +199,8 @@ Version 3.5.1 (2017-03-12) Twitter-bridge now supports quotes and long posts when importing tweets [annando] Closed Issues - 1019, 1163, 1612, 1613, 2103, 2177, 2252, 2260, 2403, 2991, 2614, - 2751, 2752, 2772, 2791, 2800, 2804, 2813, 2814, 2816, 2817, 2823, + 1019, 1163, 1612, 1613, 2103, 2177, 2252, 2260, 2403, 2991, 2614, + 2751, 2752, 2772, 2791, 2800, 2804, 2813, 2814, 2816, 2817, 2823, 2850, 2858, 2865, 2892, 2894, 2895, 2907, 2908, 2914, 2015, 2926, 2948, 2955, 2958, 2963, 2964, 2968, 2987, 2993, 3020, 3052, 3062, 3066, 3091, 3108, 3113, 3116, 3117, 3118, 3126, 3130, 3135, 3155, @@ -304,7 +304,7 @@ Version 3.4.3 (2015-12-22) Diaspora and OStatus can be enabled only if requirements are satisfied (annando) Support for additional passwords for ejabberd (annando) Use proxy for profile photos (annando) - 'Reload active themes' in theme admin page (fabrixxm) + 'Reload active themes' in theme admin page (fabrixxm) Install routine checks for ImageMagick and GIF support (fabrixxm) Install routine checks for availability of "mcrypt_create_iv()" function, needed for RINO2 (fabrixxm) Only suported themes are shown in admin page (annando) @@ -315,7 +315,7 @@ Version 3.4.3 (2015-12-22) Show an info message if an empty contact group is shown (issue #1871) (annando) User setting to disable network page autoupdate (issue #1921) (annando) Settings to limit or permit access to crawler to search page (annando) - What's new for developers: + What's new for developers: Themes can show Events entry in navbar (annando) Themes can now override colorbox (fabrixxm) Updated Vagrant development VM (silke, hauke) @@ -343,7 +343,7 @@ Version 3.4.3 (2015-12-22) Fix mention completition popup with TinyMCE (issue #1920) (fabrixxm) Fix photo cache and proxy when installed in subfolder (ddorian1) Fix bbcode conversion of the about text for the profile (issue #1607) (annando) - + Version 3.4.2 (2015-09-29) @@ -388,8 +388,8 @@ Version 3.4.2 (2015-09-29) Checks for mcrypt availability before enable or use RINO2 (fabrixm) Fix following email contacts (issue #1896) (annando) Parse BBCode in contact request notification email (annando) - - + + Version 3.4.1 (2015-07-06) Implement server-to-server encryption (RINO) using php-encryption library as "RINO 2", deprecate "RINO 1" (issue #1655) (fabrixxm) @@ -436,7 +436,7 @@ Version 3.4.1 (2015-07-06) Fix spelling in accepted connection notification email (strk) Show image size warning in a human readable format (rabuzarus) Move ACL window in template (rabuzarus) - New option "-s" in util/run_xgettext.sh (fabrixxm) + New option "-s" in bin/run_xgettext.sh (fabrixxm) Support, but ignore at the moment, delete message from Quitter (annando) Remove google maps from core. Functionality moved to addon "googlemap" alongside "openstreetmap" (issue #1705) (annando) Update to German documentation (Frank Dieckmann, tobias) diff --git a/util/run_xgettext.sh b/bin/run_xgettext.sh old mode 100755 new mode 100644 similarity index 100% rename from util/run_xgettext.sh rename to bin/run_xgettext.sh diff --git a/util/README b/util/README index 83a49cd22..f4f16fb46 100644 --- a/util/README +++ b/util/README @@ -78,11 +78,11 @@ More info at http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html Xgettext and .po workflow -1. Run util/run_xgettext.sh script (on *unix sistems, with GNU xgettext installed) +1. Run bin/run_xgettext.sh script (on *unix sistems, with GNU xgettext installed) This script runs xgettext on source tree, extracting strings from L10n::t() and L10n::tt() functions, and creates a util/messages.po file. - $ cd util; ./run_xgettext.sh + $ cd bin; ./run_xgettext.sh 2. copy util/messages.po to view/lang//messages.po Replace with the language you are working on - e.g. 'es', 'fr', 'de', etc. @@ -111,7 +111,7 @@ Xgettext and .po workflow to create the strings.php file When strings are added or modified in source, you could run - $ cd util; ./run_xgettext.sh ../view/lang//messages.po + $ cd bin; ./run_xgettext.sh ../view/lang//messages.po to extract strings from source files and join them with the existing .po file: new strings are added, the existing are not overwritten. From e837f6fff9970d8489bcf3f62e8a068d7af4dce8 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 19 Mar 2018 02:16:05 -0400 Subject: [PATCH 6/6] Revert changes to the CHANGELOG --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 3d5c11f51..e77a46c71 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -436,7 +436,7 @@ Version 3.4.1 (2015-07-06) Fix spelling in accepted connection notification email (strk) Show image size warning in a human readable format (rabuzarus) Move ACL window in template (rabuzarus) - New option "-s" in bin/run_xgettext.sh (fabrixxm) + New option "-s" in util/run_xgettext.sh (fabrixxm) Support, but ignore at the moment, delete message from Quitter (annando) Remove google maps from core. Functionality moved to addon "googlemap" alongside "openstreetmap" (issue #1705) (annando) Update to German documentation (Frank Dieckmann, tobias)