From: Hypolite Petovan Date: Thu, 29 Nov 2018 04:08:43 +0000 (-0500) Subject: Move files from util to mods X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c0b3b73c8838e7bc6850d2f6934e8a81a083c6f6;p=friendica.git Move files from util to mods - Move local.config.vagrant.php - Move fpostit - Move bookmarklet-share2friendica - Updated Readme file --- diff --git a/bin/dev/vagrant_provision.sh b/bin/dev/vagrant_provision.sh index 440a7b590c..7ebbdcafd4 100755 --- a/bin/dev/vagrant_provision.sh +++ b/bin/dev/vagrant_provision.sh @@ -86,7 +86,7 @@ cd /var/www php bin/composer.phar install # initial config file for friendica in vagrant -cp /vagrant/util/local.config.vagrant.php /vagrant/config/local.config.php +cp /vagrant/mods/local.config.vagrant.php /vagrant/config/local.config.php # copy the .htaccess-dist file to .htaccess so that rewrite rules work cp /vagrant/.htaccess-dist /vagrant/.htaccess diff --git a/mods/README.md b/mods/README.md new file mode 100644 index 0000000000..917fcccd82 --- /dev/null +++ b/mods/README.md @@ -0,0 +1,36 @@ +Friendica mods files +==================== + +## `bookmarklet-share2friendica` + +Browser bookmarklet to share any page with your Friendica account. +Please see `bookmarklet-share2friendica/README.md` for detailed instruction. + +## `fpostit` + +Node-agnostic Friendica bookmarklet by Devlon Duthie. +Unmaintained and unsupported. + +## `home.css` and `home.html` + +Example files to customize the landing page of your Friendica node. +The `home.html file` contains the text of the page, the `home.css` file the style information. +The login box will be added according to the other system settings. +Both files have to be placed in the base directory of your Friendica installation to be used for the landing page. + +## `local.config.vagrant.php` + +Configuration file used by the Vagrant setup script. + +## `sample-Lighttpd.config` and `sample-nginx.config` + +Sample configuration files to use Friendica with Lighttpd or Nginx. +Please check software documentation to know how modify these examples to make them work on your server. + +## `sample-systemd.timer` and `sample-systemd.service` + +Sample systemd unit files to start worker.php periodically. + +Please place them in the correct location for your system, typically this is `/etc/systemd/system/friendicaworker.timer` and `/etc/systemd/system/friendicaworker.service`. +Please report problems and improvements to `!helpers@forum.friendi.ca` and `@utzer@social.yl.ms` or open an issue in [the Github Friendica page](https://github.com/friendica/friendica/issues). +This is for usage of systemd instead of cron to start the worker periodically, the solution is a work-in-progress and can surely be improved. diff --git a/mods/bookmarklet-share2friendica/README.md b/mods/bookmarklet-share2friendica/README.md new file mode 100644 index 0000000000..ad30baa9dd --- /dev/null +++ b/mods/bookmarklet-share2friendica/README.md @@ -0,0 +1,47 @@ +# Bookmarklet-share2friendica + +Javascript bookmarklet to share websites with your friendica account + +## Getting Started + +### Installing + +Open the file bookmarklet-share2friendica.js and change 'YourFriendicaDoomain.tld" with your friendica domain + +If you friendica is at https://myfriend.myfami.ly/ , the original ... +```javascript +javascript:(function(){f='https://YourFriendicaDomain.tld/bookmarklet/?url='+encodeURIC.... +``` +... has to be changed to ... + +```javascript +javascript:(function(){f='https://myfriend.myfami.ly/bookmarklet/?url='+encodeURIC.... +``` + +*Please copy the whole script, not only the part mentioned here!* + +Then create a new bookmark, give it a name like "share2Friendica" and paste the script in the address field. Save it. Now you can click on that bookmarklet every time you want to share a website, you are currently reading. A new small window will open where title is prefilled and the website you want to share is put as attachement in the body of the new post. + +## Additional notes if it doesn't work + +* Make sure the site you want to share is allowed to run javascript. (enable it in your script blocker) +* Check the apostrophes that are used. Sometimes it is changed by the copy and paste process depending on the editor you are using, or if you copy it from a website. Correct it and it will work again. + + + +## Authors + +* **diaspora** - *Initial work* - [Share all teh internetz!](https://share.diasporafoundation.org/about.html) +* **hoergen** - *Adaptation to Friendica (2017)* - [hoergen.org](https://hoergen.org) + +## License + +This project is licensed under the same license like friendica + +## Acknowledgments + +* Hat tip to anyone who's code was used +* Hat tip to everyone who does everyday a little something ot make this world better +* Had tip but spent it + + diff --git a/mods/bookmarklet-share2friendica/bookmarklet-share2friendica.js b/mods/bookmarklet-share2friendica/bookmarklet-share2friendica.js new file mode 100644 index 0000000000..584dee2403 --- /dev/null +++ b/mods/bookmarklet-share2friendica/bookmarklet-share2friendica.js @@ -0,0 +1 @@ +javascript:(function(){f='https://YourFriendicaDomain.tld/bookmarklet/?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title);a=function(){if(!window.open(f+'&jump=doclose','friendica','location=yes,links=no,scrollbars=no,toolbar=no,width=620,height=250'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})() diff --git a/mods/fpostit/README b/mods/fpostit/README new file mode 100644 index 0000000000..39b7c57613 --- /dev/null +++ b/mods/fpostit/README @@ -0,0 +1,8 @@ +fpostit + +original author: Devlon Duthied + +see his blog posting: +http://blog.duthied.com/2011/09/13/node-agnostic-friendika-bookmarklet/ + +original published at github https://github.com/duthied/Friendika-Bookmarklet diff --git a/mods/fpostit/fpostit.js b/mods/fpostit/fpostit.js new file mode 100644 index 0000000000..a6c75aba8f --- /dev/null +++ b/mods/fpostit/fpostit.js @@ -0,0 +1,11 @@ +javascript: (function() { + the_url = 'http://testbubble.com/fpostit.php?url=' + encodeURIComponent(window.location.href) + '&title=' + encodeURIComponent(document.title) + '&text=' + encodeURIComponent('' (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text)); + a_funct = function() { + if (!window.open(the_url, 'fpostit', 'location=yes,links=no,scrollbars=no,toolbar=no,width=600,height=300')) location.href = the_url; + }; + if (/Firefox/.test(navigator.userAgent)) { + setTimeout(a_funct, 0) + } else { + a_funct() + } +})() \ No newline at end of file diff --git a/mods/fpostit/fpostit.php b/mods/fpostit/fpostit.php new file mode 100644 index 0000000000..3a2f0d15f5 --- /dev/null +++ b/mods/fpostit/fpostit.php @@ -0,0 +1,129 @@ + + + + + + + + $content]; + + // echo "posting to: $url
"; + + $c = curl_init(); + curl_setopt($c, CURLOPT_URL, $url); + curl_setopt($c, CURLOPT_USERPWD, "$username:$password"); + curl_setopt($c, CURLOPT_POSTFIELDS, $data); + curl_setopt($c, CURLOPT_RETURNTRANSFER, true); + curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); + $c_result = curl_exec($c); + if(curl_errno($c)){ + $error = curl_error($c); + showForm($error, $content); + } + + curl_close($c); + if (!isset($error)) { + echo ''; + } + + } else { + $error = "Missing account name and/or password...try again please"; + showForm($error, $content); + } + +} else { + showForm(null, $content); +} + +function showForm($error, $content) { + $username_cookie = $_COOKIE['username']; + $password_cookie = $_COOKIE['password']; + + echo << +

+ Friendica Bookmarklet

+ + +
+
+ Enter the email address of the Friendica Account that you want to cross-post to:(example: user@friendica.org)

+ Account ID:
+ Password:
+
+   $error +
+

+
+EOF; + +} +?> + + + \ No newline at end of file diff --git a/mods/fpostit/friendika-32.png b/mods/fpostit/friendika-32.png new file mode 100644 index 0000000000..61764bf20a Binary files /dev/null and b/mods/fpostit/friendika-32.png differ diff --git a/mods/local.config.vagrant.php b/mods/local.config.vagrant.php new file mode 100644 index 0000000000..099500200d --- /dev/null +++ b/mods/local.config.vagrant.php @@ -0,0 +1,41 @@ + [ + 'hostname' => 'localhost', + 'username' => 'friendica', + 'password' => 'friendica', + 'database' => 'friendica', + 'charset' => 'utf8mb4', + ], + + // **************************************************************** + // The configuration below will be overruled by the admin panel. + // Changes made below will only have an effect if the database does + // not contain any configuration for the friendica system. + // **************************************************************** + + 'config' => [ + 'admin_email' => 'admin@friendica.local', + 'sitename' => 'Friendica Social Network', + 'register_policy' => REGISTER_OPEN, + 'register_text' => '', + ], + 'system' => [ + 'default_timezone' => 'UTC', + 'language' => 'en', + ], +]; diff --git a/mods/redme.txt b/mods/redme.txt deleted file mode 100644 index 8fc1c48b32..0000000000 --- a/mods/redme.txt +++ /dev/null @@ -1,31 +0,0 @@ -sample-Lighttpd.config -sample-nginx.config - - Sample configuration files to use Friendica with Lighttpd - or Nginx. Pleas check software documentation to know how modify - these examples to make them work on your server. - - -sample-systemd.timer -sample-systemd.service - - Sample systemd unit files to start worker.php periodically. - - Please place them in the correct location for your system, - typically this is /etc/systemd/system/friendicaworker.timer - and /etc/systemd/system/friendicaworker.service. - Please report problems and improvements to - !helpers@forum.friendi.ca and @utzer@social.yl.ms or open an - issue in Github (https://github.com/friendica/friendica/issues). - This is for usage of systemd instead of cron to start the worker.php - periodically, the solution is work-in-progress and can surely be improved. - -home.css -home.html - - Example files to customize the landing page of your Friendica node. - The home.html file contains the text of the page, the home.css file - the style information. The login box will be added according to the - other system settings. - Both files have to be placed in the base directory of your Friendica - installation to be used for the landing page. diff --git a/util/bookmarklet-share2friendica/README.md b/util/bookmarklet-share2friendica/README.md deleted file mode 100644 index ad30baa9dd..0000000000 --- a/util/bookmarklet-share2friendica/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Bookmarklet-share2friendica - -Javascript bookmarklet to share websites with your friendica account - -## Getting Started - -### Installing - -Open the file bookmarklet-share2friendica.js and change 'YourFriendicaDoomain.tld" with your friendica domain - -If you friendica is at https://myfriend.myfami.ly/ , the original ... -```javascript -javascript:(function(){f='https://YourFriendicaDomain.tld/bookmarklet/?url='+encodeURIC.... -``` -... has to be changed to ... - -```javascript -javascript:(function(){f='https://myfriend.myfami.ly/bookmarklet/?url='+encodeURIC.... -``` - -*Please copy the whole script, not only the part mentioned here!* - -Then create a new bookmark, give it a name like "share2Friendica" and paste the script in the address field. Save it. Now you can click on that bookmarklet every time you want to share a website, you are currently reading. A new small window will open where title is prefilled and the website you want to share is put as attachement in the body of the new post. - -## Additional notes if it doesn't work - -* Make sure the site you want to share is allowed to run javascript. (enable it in your script blocker) -* Check the apostrophes that are used. Sometimes it is changed by the copy and paste process depending on the editor you are using, or if you copy it from a website. Correct it and it will work again. - - - -## Authors - -* **diaspora** - *Initial work* - [Share all teh internetz!](https://share.diasporafoundation.org/about.html) -* **hoergen** - *Adaptation to Friendica (2017)* - [hoergen.org](https://hoergen.org) - -## License - -This project is licensed under the same license like friendica - -## Acknowledgments - -* Hat tip to anyone who's code was used -* Hat tip to everyone who does everyday a little something ot make this world better -* Had tip but spent it - - diff --git a/util/bookmarklet-share2friendica/bookmarklet-share2friendica.js b/util/bookmarklet-share2friendica/bookmarklet-share2friendica.js deleted file mode 100644 index 584dee2403..0000000000 --- a/util/bookmarklet-share2friendica/bookmarklet-share2friendica.js +++ /dev/null @@ -1 +0,0 @@ -javascript:(function(){f='https://YourFriendicaDomain.tld/bookmarklet/?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title);a=function(){if(!window.open(f+'&jump=doclose','friendica','location=yes,links=no,scrollbars=no,toolbar=no,width=620,height=250'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})() diff --git a/util/fpostit/README b/util/fpostit/README deleted file mode 100644 index 39b7c57613..0000000000 --- a/util/fpostit/README +++ /dev/null @@ -1,8 +0,0 @@ -fpostit - -original author: Devlon Duthied - -see his blog posting: -http://blog.duthied.com/2011/09/13/node-agnostic-friendika-bookmarklet/ - -original published at github https://github.com/duthied/Friendika-Bookmarklet diff --git a/util/fpostit/fpostit.js b/util/fpostit/fpostit.js deleted file mode 100644 index a6c75aba8f..0000000000 --- a/util/fpostit/fpostit.js +++ /dev/null @@ -1,11 +0,0 @@ -javascript: (function() { - the_url = 'http://testbubble.com/fpostit.php?url=' + encodeURIComponent(window.location.href) + '&title=' + encodeURIComponent(document.title) + '&text=' + encodeURIComponent('' (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text)); - a_funct = function() { - if (!window.open(the_url, 'fpostit', 'location=yes,links=no,scrollbars=no,toolbar=no,width=600,height=300')) location.href = the_url; - }; - if (/Firefox/.test(navigator.userAgent)) { - setTimeout(a_funct, 0) - } else { - a_funct() - } -})() \ No newline at end of file diff --git a/util/fpostit/fpostit.php b/util/fpostit/fpostit.php deleted file mode 100644 index 3a2f0d15f5..0000000000 --- a/util/fpostit/fpostit.php +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - $content]; - - // echo "posting to: $url
"; - - $c = curl_init(); - curl_setopt($c, CURLOPT_URL, $url); - curl_setopt($c, CURLOPT_USERPWD, "$username:$password"); - curl_setopt($c, CURLOPT_POSTFIELDS, $data); - curl_setopt($c, CURLOPT_RETURNTRANSFER, true); - curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); - $c_result = curl_exec($c); - if(curl_errno($c)){ - $error = curl_error($c); - showForm($error, $content); - } - - curl_close($c); - if (!isset($error)) { - echo ''; - } - - } else { - $error = "Missing account name and/or password...try again please"; - showForm($error, $content); - } - -} else { - showForm(null, $content); -} - -function showForm($error, $content) { - $username_cookie = $_COOKIE['username']; - $password_cookie = $_COOKIE['password']; - - echo << -

- Friendica Bookmarklet

- - -
-
- Enter the email address of the Friendica Account that you want to cross-post to:(example: user@friendica.org)

- Account ID:
- Password:
-
-   $error -
-

-
-EOF; - -} -?> - - - \ No newline at end of file diff --git a/util/fpostit/friendika-32.png b/util/fpostit/friendika-32.png deleted file mode 100644 index 61764bf20a..0000000000 Binary files a/util/fpostit/friendika-32.png and /dev/null differ diff --git a/util/local.config.vagrant.php b/util/local.config.vagrant.php deleted file mode 100644 index 099500200d..0000000000 --- a/util/local.config.vagrant.php +++ /dev/null @@ -1,41 +0,0 @@ - [ - 'hostname' => 'localhost', - 'username' => 'friendica', - 'password' => 'friendica', - 'database' => 'friendica', - 'charset' => 'utf8mb4', - ], - - // **************************************************************** - // The configuration below will be overruled by the admin panel. - // Changes made below will only have an effect if the database does - // not contain any configuration for the friendica system. - // **************************************************************** - - 'config' => [ - 'admin_email' => 'admin@friendica.local', - 'sitename' => 'Friendica Social Network', - 'register_policy' => REGISTER_OPEN, - 'register_text' => '', - ], - 'system' => [ - 'default_timezone' => 'UTC', - 'language' => 'en', - ], -];