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
--- /dev/null
+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.
--- /dev/null
+# 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
+
+
--- /dev/null
+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()}})()
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+<?php
+
+if (($_POST["friendica_acct_name"] != '') && ($_POST["friendica_password"] != '')) {
+ setcookie("username", $_POST["friendica_acct_name"], time()+60*60*24*300);
+ setcookie("password", $_POST["friendica_password"], time()+60*60*24*300);
+}
+
+?>
+<html>
+<head>
+ <style>
+ body {
+ font-family: arial, Helvetica,sans-serif;
+ margin: 0px;
+ }
+ .wrap1 {
+ padding: 2px 5px;
+ background-color: #729FCF;
+ margin-bottom: 10px;
+ }
+ .wrap2 {
+ margin-left: 10px;
+ font-size: 12px;
+ }
+ .logo {
+ margin-left: 3px;
+ margin-right: 5px;
+ float: left;
+ }
+ h2 {
+ color: #ffffff;
+ }
+ .error {
+ background-color: #FFFF66;
+ font-size: 12px;
+ margin-left: 10px;
+ }
+ </style>
+</head>
+
+<body>
+<?php
+
+if (isset($_GET['title'])) {
+ $title = $_GET['title'];
+}
+if (isset($_GET['text'])) {
+ $text = $_GET['text'];
+}
+if (isset($_GET['url'])) {
+ $url = $_GET['url'];
+}
+
+if ((isset($title)) && (isset($text)) && (isset($url))) {
+ $content = "$title\nsource:$url\n\n$text";
+} else {
+ $content = $_POST['content'];
+}
+
+if (isset($_POST['submit'])) {
+
+ if (($_POST["friendica_acct_name"] != '') && ($_POST["friendica_password"] != '')) {
+ $acctname = $_POST["friendica_acct_name"];
+ $tmp_account_array = explode("@", $acctname);
+ if (isset($tmp_account_array[1])) {
+ $username = $tmp_account_array[0];
+ $hostname = $tmp_account_array[1];
+ }
+ $password = $_POST["friendica_password"];
+ $content = $_POST["content"];
+
+ $url = "http://" . $hostname . '/api/statuses/update';
+ $data = ['status' => $content];
+
+ // echo "posting to: $url<br/>";
+
+ $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 '<script language="javascript" type="text/javascript">window.close();</script>';
+ }
+
+ } 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 <<<EOF
+ <div class='wrap1'>
+ <h2><img class='logo' src='friendica-32.png' align='middle';/>
+ Friendica Bookmarklet</h2>
+ </div>
+
+ <div class="wrap2">
+ <form method="post" action="{$_SERVER['PHP_SELF']}">
+ Enter the email address of the Friendica Account that you want to cross-post to:(example: user@friendica.org)<br /><br />
+ Account ID: <input type="text" name="friendica_acct_name" value="{$username_cookie}" size="50"/><br />
+ Password: <input type="password" name="friendica_password" value="{$password_cookie}" size="50"/><br />
+ <textarea name="content" id="content" rows="6" cols="70">{$content}</textarea><br />
+ <input type="submit" value="PostIt!" name="submit" /> <span class='error'>$error</span>
+ </form>
+ <p></p>
+ </div>
+EOF;
+
+}
+?>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+// Local configuration\r
+\r
+/* If automatic system installation fails:\r
+ *\r
+ * Copy this file to local.config.php\r
+ *\r
+ * Why local.config.php? Because it contains sensitive information which could\r
+ * give somebody complete control of your database. Apache's default\r
+ * configuration will interpret any .php file as a script and won't show the values\r
+ *\r
+ * Then set the following for your MySQL installation\r
+ */\r
+\r
+return [\r
+ 'database' => [\r
+ 'hostname' => 'localhost',\r
+ 'username' => 'friendica',\r
+ 'password' => 'friendica',\r
+ 'database' => 'friendica',\r
+ 'charset' => 'utf8mb4',\r
+ ],\r
+\r
+ // ****************************************************************\r
+ // The configuration below will be overruled by the admin panel.\r
+ // Changes made below will only have an effect if the database does\r
+ // not contain any configuration for the friendica system.\r
+ // ****************************************************************\r
+\r
+ 'config' => [\r
+ 'admin_email' => 'admin@friendica.local',\r
+ 'sitename' => 'Friendica Social Network',\r
+ 'register_policy' => REGISTER_OPEN,\r
+ 'register_text' => '',\r
+ ],\r
+ 'system' => [\r
+ 'default_timezone' => 'UTC',\r
+ 'language' => 'en',\r
+ ],\r
+];\r
+++ /dev/null
-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.
+++ /dev/null
-# 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
-
-
+++ /dev/null
-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()}})()
+++ /dev/null
-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
+++ /dev/null
-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
+++ /dev/null
-<?php
-
-if (($_POST["friendica_acct_name"] != '') && ($_POST["friendica_password"] != '')) {
- setcookie("username", $_POST["friendica_acct_name"], time()+60*60*24*300);
- setcookie("password", $_POST["friendica_password"], time()+60*60*24*300);
-}
-
-?>
-<html>
-<head>
- <style>
- body {
- font-family: arial, Helvetica,sans-serif;
- margin: 0px;
- }
- .wrap1 {
- padding: 2px 5px;
- background-color: #729FCF;
- margin-bottom: 10px;
- }
- .wrap2 {
- margin-left: 10px;
- font-size: 12px;
- }
- .logo {
- margin-left: 3px;
- margin-right: 5px;
- float: left;
- }
- h2 {
- color: #ffffff;
- }
- .error {
- background-color: #FFFF66;
- font-size: 12px;
- margin-left: 10px;
- }
- </style>
-</head>
-
-<body>
-<?php
-
-if (isset($_GET['title'])) {
- $title = $_GET['title'];
-}
-if (isset($_GET['text'])) {
- $text = $_GET['text'];
-}
-if (isset($_GET['url'])) {
- $url = $_GET['url'];
-}
-
-if ((isset($title)) && (isset($text)) && (isset($url))) {
- $content = "$title\nsource:$url\n\n$text";
-} else {
- $content = $_POST['content'];
-}
-
-if (isset($_POST['submit'])) {
-
- if (($_POST["friendica_acct_name"] != '') && ($_POST["friendica_password"] != '')) {
- $acctname = $_POST["friendica_acct_name"];
- $tmp_account_array = explode("@", $acctname);
- if (isset($tmp_account_array[1])) {
- $username = $tmp_account_array[0];
- $hostname = $tmp_account_array[1];
- }
- $password = $_POST["friendica_password"];
- $content = $_POST["content"];
-
- $url = "http://" . $hostname . '/api/statuses/update';
- $data = ['status' => $content];
-
- // echo "posting to: $url<br/>";
-
- $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 '<script language="javascript" type="text/javascript">window.close();</script>';
- }
-
- } 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 <<<EOF
- <div class='wrap1'>
- <h2><img class='logo' src='friendica-32.png' align='middle';/>
- Friendica Bookmarklet</h2>
- </div>
-
- <div class="wrap2">
- <form method="post" action="{$_SERVER['PHP_SELF']}">
- Enter the email address of the Friendica Account that you want to cross-post to:(example: user@friendica.org)<br /><br />
- Account ID: <input type="text" name="friendica_acct_name" value="{$username_cookie}" size="50"/><br />
- Password: <input type="password" name="friendica_password" value="{$password_cookie}" size="50"/><br />
- <textarea name="content" id="content" rows="6" cols="70">{$content}</textarea><br />
- <input type="submit" value="PostIt!" name="submit" /> <span class='error'>$error</span>
- </form>
- <p></p>
- </div>
-EOF;
-
-}
-?>
-
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-<?php\r
-\r
-// Local configuration\r
-\r
-/* If automatic system installation fails:\r
- *\r
- * Copy this file to local.config.php\r
- *\r
- * Why local.config.php? Because it contains sensitive information which could\r
- * give somebody complete control of your database. Apache's default\r
- * configuration will interpret any .php file as a script and won't show the values\r
- *\r
- * Then set the following for your MySQL installation\r
- */\r
-\r
-return [\r
- 'database' => [\r
- 'hostname' => 'localhost',\r
- 'username' => 'friendica',\r
- 'password' => 'friendica',\r
- 'database' => 'friendica',\r
- 'charset' => 'utf8mb4',\r
- ],\r
-\r
- // ****************************************************************\r
- // The configuration below will be overruled by the admin panel.\r
- // Changes made below will only have an effect if the database does\r
- // not contain any configuration for the friendica system.\r
- // ****************************************************************\r
-\r
- 'config' => [\r
- 'admin_email' => 'admin@friendica.local',\r
- 'sitename' => 'Friendica Social Network',\r
- 'register_policy' => REGISTER_OPEN,\r
- 'register_text' => '',\r
- ],\r
- 'system' => [\r
- 'default_timezone' => 'UTC',\r
- 'language' => 'en',\r
- ],\r
-];\r