]> 91.132.146.200 Git - insipid.git/commitdiff
updated documentation and some fixes
authorBanana <banana@mirage>
Fri, 27 Dec 2019 11:07:49 +0000 (12:07 +0100)
committerBanana <banana@mirage>
Fri, 27 Dec 2019 11:07:49 +0000 (12:07 +0100)
ChangeLog
documentation/email-importer.txt
documentation/features.txt
documentation/installation.txt
documentation/requirements.txt
documentation/usage.txt
webroot/job/email-import.php
webroot/lib/simple-imap.class.php
webroot/view/overview.inc.php

index 678b3833a62b9a9b5255f2b69f3450f65de75e69..45ed8219da6b5247f2533532646a778a11eea549 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,6 @@
 version 2.2 - Guardian of Ice - (tba)
 
        * email import
-       * code cleanups
        * using mysql transactions if needed
        * pagination
        * authentication with an extra url now (index.php?m=auth)
@@ -9,8 +8,11 @@ version 2.2 - Guardian of Ice - (tba)
        * small stats overview
        * links can now be deleted
        * awaiting moderation links can new be moderated
-       * Fixed an error in create sql file
        * clean up the local storage via stats page (if authenticated)
+       * Updated documentation
+       * Fixed an error in create sql file
+       * Fixed info when a tag or category has no links
+       * Fixed code cleanups
 
 version 2.1alpha - Guardian of Fire - (2019-09-29)
 
index 20421d971e3b1582f71a1c890199fe3384769092..e22c3321cca1731243a9a54fcd78a2ddfb5c3cfa 100644 (file)
@@ -26,3 +26,5 @@ Syntax of the E-Mail body:
 
 absolute-link|multiple,category,strings|multiple,tag,strings\n
 new-absolute-link|multiple,category,strings|multiple,tag,strings\n
+
+Create a cronjob to execute the email-import.php file.
\ No newline at end of file
index 4d6b3e01f71e0513947f451e6bbb4b4799daa5bc..0a871d7a8c5684e51301862908e4df2eda84f336 100644 (file)
@@ -1,6 +1,6 @@
 Insipid is a web-based bookmark manager similar to the Delicious service.
 
-It lets you manage and host your own bookmarks. No talking to other servervices or agencies.
+It lets you manage and host your own bookmarks. No talking to other services or agencies.
 Your data is your data.
 
 Bookmarks are put into categories and should have tags.
index 3b486fd7ade88bb766f5e20e9f9a0489df0e1dbd..0ab884b25efdd7551d936dc221984ceaba5696f6 100644 (file)
@@ -8,7 +8,16 @@ Read this first!!
 Unpack the archive
 
 4.
-Modify webroot/config.default.php and copy it to webroot/config.php
+Create your config file.
+Copy webroot/config.default.php to webroot/config.php
+
+Modify at least the following settings in this file:
+- define('DB_HOST','127.0.0.1');
+- define('DB_USERNAME','user');
+- define('DB_PASSWORD','test');
+- define('FRONTEND_USERNAME','luke');
+- define('FRONTEND_PASSWORD','father');
+- define('ABSOLUTE_PATH', '/path/to/insipid/webroot');
 
 5.
 Copy and modify documentation/insipid-edit-me.sql and replace the placeholder.
@@ -17,11 +26,11 @@ Open the file and make a search and replace:
 search for: `#REPLACE_ME#
 replace with: `tableprefix
 
-The value tableprefix has to match with the value for DB_PREFIX in config.php
+The value tableprefix has to match with the value for DB_PREFIX in your config.php file
 
 6.
 Create a table if needed.
-Import the sql file into your MySQL database
+Import the edited from step 5 sql file into your MySQL database.
 
 7.
 Edit the robots.txt file to your needs.
index 57d997aa5a596a8f2b4d5d6fc8b1d9d9a657b08e..9c7541c1e74135f7f35a07d000f1366cf5c59852 100644 (file)
@@ -1,3 +1,4 @@
-Apache (2 and up) with PHP extension (+imap if you us the email importer)
-PHP (7 and up) with MySQL extension -> mysqli; curl enabled
+Apache (2.4 and up) with PHP extension enabled
+PHP (7 and up) with MySQL extension -> mysqli; curl enabled; (+imap +ssl if you us the email importer)
 MySQL database 5.6.x and up
+- DB user rights has to include create, alter a view
index 09294a95310b02ef9ec90d83c2b3ea431651eba1..1939ee5173b656937ae6a75469b823465e68678e 100644 (file)
@@ -9,3 +9,9 @@ Call the following URL to trigger the authentication:
 http(s)://your.domain.tld/path/to/insipid/index.php?m=auth
 
 If successful you can now manage your items. Edit buttons are visible now.
+
+HowToAdd a new link:
+
+There is no special "add a new link" option. Just paste the link into the search bar.
+If the link is already in your database the edit option will be shown.
+If not the add field will be shown and the possibility to safe the new link.
\ No newline at end of file
index 3096d3d386a5e377d5646c621ef17683e83fe07e..25b524ed25083d051e287d722599eff923b46f31 100644 (file)
@@ -72,6 +72,16 @@ if(EMAIL_REPORT_BACK === true) {
        $phpmailer->setFrom(EMAIL_REPLY_BACK_ADDRESS);
        $phpmailer->Subject = EMAIL_REPLY_BACK_SUBJECT;
        $phpmailer->Timeout = 3;
+
+    if(DEBUG === true) $phpmailer->SMTPDebug = SMTP::DEBUG_SERVER;
+
+    $phpmailer->SMTPOptions = array(
+        'ssl' => [
+            'verify_peer' => false,
+            'verify_peer_name' => false,
+            'allow_self_signed' => true
+        ],
+    );
 }
 
 $DB = false;
@@ -92,7 +102,7 @@ try {
     if(DEBUG === true) $EmailReader->mailboxStatus();
 }
 catch (Exception $e) {
-    error_log('Email server connection failed: '.var_export($e->getMessage(),true));
+    error_log('ERROR Email server connection failed: '.var_export($e->getMessage(),true));
     exit();
 }
 
@@ -102,7 +112,7 @@ try {
     $emails = $EmailReader->messageWithValidSubject(EMAIL_MARKER);
 }
 catch (Exception $e) {
-    error_log('Can not process email messages: '.var_export($e->getMessage(),true));
+    error_log('ERROR Can not process email messages: '.var_export($e->getMessage(),true));
     exit();
 }
 
@@ -141,7 +151,7 @@ if(!empty($emails)) {
                                $newdata['link'] = Summoner::addSchemeToURL($newdata['link']);
 
                                if (!filter_var($newdata['link'], FILTER_VALIDATE_URL)) {
-                                       error_log("Invalid URL: ".var_export($newdata['link'],true));
+                                       error_log("ERROR Invalid URL: ".var_export($newdata['link'],true));
                                        if(DEBUG === true) var_dump($newdata['link']);
                                        continue;
                                }
@@ -160,8 +170,8 @@ if(!empty($emails)) {
                                        }
                                }
                                else {
-                                       error_log("No valid title for link found: ".var_export($newdata,true));
-                                       if(DEBUG === true) var_dump("No valid title for link found: ".var_export($newdata,true));
+                                       error_log("WARN No valid title for link found: ".var_export($newdata,true));
+                                       if(DEBUG === true) var_dump("WARN No valid title for link found: ".var_export($newdata,true));
                                        array_push($invalidProcessedEmails, $emailData);
                                        continue;
                                }
@@ -189,7 +199,7 @@ if(!empty($emails)) {
                                        ), true);
                                }
                                catch (Exception $e) {
-                                       $_m = "Can not create new link into DB. Duplicate? ".$e->getMessage();
+                                       $_m = "WARN Can not create new link into DB. Duplicate? ".$e->getMessage();
                                        error_log($_m);
                                        $emailData['importmessage'] = $_m;
                                        array_push($invalidProcessedEmails,$emailData);
@@ -221,12 +231,12 @@ if(!empty($emails)) {
 
                                        $DB->commit();
 
-                                       error_log("Link successfully added: ".$newdata['link']);
+                                       error_log("INFO Link successfully added: ".$newdata['link']);
                                        array_push($validProcessedEmails,$emailData);
                                }
                                else {
                                        $DB->rollback();
-                                       error_log("Link could not be added. SQL problem: ".$newdata['link']);
+                                       error_log("ERROR Link could not be added. SQL problem: ".$newdata['link']);
                                        $emailData['importmessage'] = "Link could not be added";
                                        array_push($invalidProcessedEmails,$emailData);
                                }
@@ -239,7 +249,7 @@ if(!empty($emails)) {
 # if we have invalid import mails, ignore them, just log em
 # if EMAIL_REPORT_BACK is true then report back with errors if EMAIL_REPLY_BACK_VALID
 if(!empty($invalidProcessedEmails)) {
-       error_log("We have invalid import messages.");
+       error_log("INFO We have invalid import messages.");
        foreach ($invalidProcessedEmails as $invalidMail) {
                if(EmailImportHelper::canSendReplyTo($invalidMail['header_rfc822']->reply_toaddress)
                        && !EmailImportHelper::isAutoReplyMessage($invalidMail['header_array'])) {
@@ -248,10 +258,10 @@ if(!empty($invalidProcessedEmails)) {
                        $phpmailer->Body .= $invalidMail['body'];
                        $phpmailer->addAddress($_address[0]['address']);
                        $phpmailer->send();
-                       error_log("Report back email to: ".$_address[0]['address']);
+                       error_log("INFO Report back email to: ".$_address[0]['address']);
                }
                else {
-                       error_log("Invalid message: ".$invalidMail['header_rfc822']->subject);
+                       error_log("WARN Invalid message: ".$invalidMail['header_rfc822']->subject);
                }
        }
 }
@@ -259,7 +269,7 @@ if(!empty($invalidProcessedEmails)) {
 # move them to the processed / archive folder
 #$EmailReader->move()
 if(!empty($validProcessedEmails)) {
-       error_log("We have valid import messages.");
+       error_log("INFO We have valid import messages.");
        foreach ($validProcessedEmails as $validMail) {
        }
 }
index bced0205808f69c5ee69aed1cf5a19f5db6f45bb..8467025b624b8efefb71c1d6440479872903da80 100644 (file)
@@ -126,11 +126,13 @@ class SimpleImap {
            if($this->_connection !== false) {
                $status = imap_status($this->_connection, $this->_connectionstring.$this->_mailbox, SA_ALL);
 
-               var_dump("messages ".$status->messages);
-               var_dump("recent ".$status->recent);
-               var_dump("unseen ".$status->unseen);
-               var_dump("uidnext ".$status->uidnext);
-               var_dump("uidvalidity ".$status->uidvalidity);
+               if(DEBUG === true) {
+                var_dump("messages " . $status->messages);
+                var_dump("recent " . $status->recent);
+                var_dump("unseen " . $status->unseen);
+                var_dump("uidnext " . $status->uidnext);
+                var_dump("uidvalidity " . $status->uidvalidity);
+            }
 
                $list = imap_getmailboxes($this->_connection, $this->_connectionstring, "*");
                if (is_array($list)) {
@@ -141,7 +143,7 @@ class SimpleImap {
                        echo $val->attributes . "<br />\n";
                    }
                } else {
-                   error_log("imap_getmailboxes failed: ".var_export(imap_last_error()));
+                   error_log("ERROR imap_getmailboxes failed: ".var_export(imap_last_error()));
                }
            }
        }
index 18ad32033c12722742c0138a9d3a38c5b1590b49..fb90e6d8797869b347a5ddb996bff202e48c7df4 100644 (file)
@@ -57,13 +57,12 @@ if(Summoner::simpleAuthCheck() === true) {
 switch($_requestMode) {
        case 'tag':
                if(!empty($_id)) {
+            $tagObj = new Tag($DB);
+            $tagObj->initbyid($_id);
+            $tagname = $tagObj->getData('name');
+            $subHeadline = $tagname.' <i class="ion-md-pricetag"></i>';
+
                        $linkCollection = $Management->linksByTag($_id,false,RESULTS_PER_PAGE, (RESULTS_PER_PAGE * ($_curPage-1)));
-                       if(!empty($linkCollection['results'])) {
-                               $tagObj = new Tag($DB);
-                               $tagObj->initbyid($_id);
-                               $tagname = $tagObj->getData('name');
-                               $subHeadline = $tagname.' <i class="ion-md-pricetag"></i>';
-                       }
                }
                else {
                        # show all the tags we have
@@ -73,13 +72,11 @@ switch($_requestMode) {
        break;
        case 'category':
                if(!empty($_id)) {
+            $catObj = new Category($DB);
+            $catObj->initbyid($_id);
+            $catname = $catObj->getData('name');
+            $subHeadline = $catname.' <i class="ion-md-filing"></i>';
                        $linkCollection = $Management->linksByCategory($_id,false,RESULTS_PER_PAGE, (RESULTS_PER_PAGE * ($_curPage-1)));
-                       if(!empty($linkCollection['results'])) {
-                               $catObj = new Category($DB);
-                               $catObj->initbyid($_id);
-                               $catname = $catObj->getData('name');
-                               $subHeadline = $catname.' <i class="ion-md-filing"></i>';
-                       }
                }
                else {
                        # show all the categories we have