From dfbe8af638bc02c8ff9fd8fed480529620a7c303 Mon Sep 17 00:00:00 2001 From: Banana Date: Sun, 2 Mar 2025 13:57:09 +0100 Subject: [PATCH] documentaiton cleanup Signed-off-by: Banana --- CHANGELOG | 10 +- TODO | 3 + documentation/{backup.txt => backup.md} | 8 +- .../{email-importer.txt => email-importer.md} | 45 +++++---- documentation/{features.txt => features.md} | 8 +- documentation/insipid-edit-me.sql | 32 +++---- documentation/installation.md | 72 ++++++++++++++ documentation/installation.txt | 57 ------------ .../{requirements.txt => requirements.md} | 10 +- documentation/technicalinfo.md | 14 +++ documentation/technicalinfo.txt | 5 - ...bnail-of-link.txt => thumbnail-of-link.md} | 10 +- documentation/translation.md | 8 ++ documentation/translation.txt | 6 -- ...troubleshooting.txt => troubleshooting.md} | 11 ++- documentation/update.md | 93 +++++++++++++++++++ documentation/update.txt | 75 --------------- documentation/{usage.txt => usage.md} | 11 ++- ...ge-snapshot.txt => whole-page-snapshot.md} | 8 +- ...nd-import.txt => xml-export-and-import.md} | 8 +- webroot/index.php | 14 +-- webroot/job/email-import.php | 2 +- webroot/lib/summoner.class.php | 2 +- 23 files changed, 289 insertions(+), 223 deletions(-) rename documentation/{backup.txt => backup.md} (55%) rename documentation/{email-importer.txt => email-importer.md} (65%) rename documentation/{features.txt => features.md} (58%) create mode 100644 documentation/installation.md delete mode 100644 documentation/installation.txt rename documentation/{requirements.txt => requirements.md} (58%) create mode 100644 documentation/technicalinfo.md delete mode 100644 documentation/technicalinfo.txt rename documentation/{thumbnail-of-link.txt => thumbnail-of-link.md} (67%) create mode 100644 documentation/translation.md delete mode 100644 documentation/translation.txt rename documentation/{troubleshooting.txt => troubleshooting.md} (72%) create mode 100644 documentation/update.md delete mode 100644 documentation/update.txt rename documentation/{usage.txt => usage.md} (77%) rename documentation/{whole-page-snapshot.txt => whole-page-snapshot.md} (65%) rename documentation/{xml-export-and-import.txt => xml-export-and-import.md} (63%) diff --git a/CHANGELOG b/CHANGELOG index 3e8494a..cc32284 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,13 +1,13 @@ version 2.x.x - Griffin Chapel () - + Added TIMEZONE as a new config setting. Please update your config. - See update.txt for more details. + + Added TIMEZONE as a new config setting. Please update your config.php file. + See update.md for more details. + Added new config settings for whole page screenshot creation. Please update your config. - See update.txt for more details. - See whole-page-snapshot.txt for more details. + See update.md for more details. + See whole-page-snapshot.md for more details. + Fixed: Snapshot json result from Google. + New home screen layout + Better logging - + + Changed documentation files to markdown syntax. version 2.8.2 - Dragon Chapel (2023-09-14) diff --git a/TODO b/TODO index 51532b9..f878d5c 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,8 @@ TODO / Feature list ++ google api call needs an api key now. Add or remove? +++ Also change the wording here. Thumbnail vs. preview thumbnail and hole page screenshot + combine category and tag class into one. + installer + view table really still needed? + theme support ++ backup only tables and not the db itself diff --git a/documentation/backup.txt b/documentation/backup.md similarity index 55% rename from documentation/backup.txt rename to documentation/backup.md index 1c77c8a..24e8e59 100644 --- a/documentation/backup.txt +++ b/documentation/backup.md @@ -1,8 +1,10 @@ -In the index.php?p=stats view, after authentication, you can create a basic complete mysql DB dump +# Backup + +In the `index.php?p=stats` view, after authentication, you can create a basic complete mysql DB dump of your current database. The downloaded file can then be used to restore your data. -Currently it dumps the whole database which is configured as the DB_NAME in config file. +Currently it dumps the whole database which is configured as the `DB_NAME` in config file. If you share this database with other applications, they will be dumped as well. -Improvements will be done in future versions. \ No newline at end of file +Improvements will be done in future versions. diff --git a/documentation/email-importer.txt b/documentation/email-importer.md similarity index 65% rename from documentation/email-importer.txt rename to documentation/email-importer.md index af2c93a..180eb41 100644 --- a/documentation/email-importer.txt +++ b/documentation/email-importer.md @@ -1,19 +1,18 @@ -Insipid has a feature to fetch new links from E-Mails. -Those E-Mails are read from a configured IMAP mailbox. +# E-Mail importer -# Requirements -You need to enable the imap/ssl functions within PHP and -have a IMAP mailbox on a SSL/TLS email server. +Insipid has a feature to fetch new links from E-Mails. Those E-Mails are read from a configured IMAP mailbox. -# Config -Set the config variables in the config file. -Make sure you an individual marker string! +## Requirements +You need to enable the imap/ssl functions within PHP and have a IMAP mailbox on a SSL/TLS email server. + +## Config +Set the config variables in the config file. Make sure you an individual marker string! There is no "security" within this method. Only the special string you can define. -The new links will be hidden at first. You need to verify them before they are -visible in your list. +The new links will be hidden at first. You need to verify them before they are visible in your list. Here are the important configs: +``` EMAIL_SERVER => Address of your E-Mail server EMAIL_SERVER_PORT_IMAP => The SSL Imap port. Default: 993 EMAIL_SERVER_MAILBOX => The name of your Inbox. Default: INBOX @@ -23,28 +22,38 @@ EMAIL_REPORT_BACK => set this to true if you want to report to the sender. Defau EMAIL_SERVER_PORT_SMTP => The SSL SMTP port for using the report back function. Default: 465 EMAIL_REPLY_BACK_VALID => Multiple E-Mails addresses which can be reported back to. RFC822-style comma-separated email addresses EMAIL_REPLY_BACK_ADDRESS => The E-Mail address which sends the report mail. Usually the address from which your read the mails +``` + +## Moderation + +Access the moderation with this link: `index.php?p=stats`. After authentication there will be more info and one called **Moderation** -# Moderation -Access the moderation with this link: index.php?p=stats -After authentication there will be more info and one called Moderation +## Usage -# Usage 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. +Create a cronjob to execute the `email-import.php` file. + +## Access and "protection" -# Access and "protection" If the file needs to be in a web accessible folder you can either use the provided htaccess file or active the "protection" with a secret given by URL / cli param. -If you activate EMAIL_JOB_PROTECT you NEED to set an individual string in EMAIL_JOB_PROTECT_SECRET -AND remove the provided .htaccess file in the job folder. +If you activate `EMAIL_JOB_PROTECT` you **NEED** to set an individual string in `EMAIL_JOB_PROTECT_SECRET` +**AND** remove the provided .htaccess file in the job folder. +``` cli: php email-import.php ----hiddenSouce=EMAIL_JOB_PROTECT_SECRET webaccess: email-import.php?hiddenSouce=EMAIL_JOB_PROTECT_SECRET +``` Use the following settings in the config file: + +``` define('EMAIL_JOB_PROTECT', false); => Set to true if you want this kind of "protection" define('EMAIL_JOB_PROTECT_SECRET', 'YOUR_SOME_SECRET_STRING'); => Change to your liking +``` diff --git a/documentation/features.txt b/documentation/features.md similarity index 58% rename from documentation/features.txt rename to documentation/features.md index 0a871d7..0e0f5ac 100644 --- a/documentation/features.txt +++ b/documentation/features.md @@ -1,3 +1,5 @@ +# Features + 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 services or agencies. @@ -5,8 +7,8 @@ Your data is your data. Bookmarks are put into categories and should have tags. -New links will be checked and tried to get as much as possible information automatically. +New links will be checked and accessed to get as much as possible information automatically. -If you enable the email importer, emails contents will be automatically added to the database. +If you enable the email importer, email contents will be automatically added to the database. -Public or private links. Also a complete user auth option to make your data "private". \ No newline at end of file +Public or private links. Also a complete user auth option to make your data "private". diff --git a/documentation/insipid-edit-me.sql b/documentation/insipid-edit-me.sql index 577ef04..2dd48d2 100644 --- a/documentation/insipid-edit-me.sql +++ b/documentation/insipid-edit-me.sql @@ -20,8 +20,8 @@ SET time_zone = "+00:00"; DROP TABLE IF EXISTS `#REPLACE_ME#_category`; CREATE TABLE `#REPLACE_ME#_category` ( - `id` int NOT NULL, - `name` varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL + `id` int NOT NULL, + `name` varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci ROW_FORMAT=COMPACT; -- -------------------------------------------------------- @@ -32,8 +32,8 @@ CREATE TABLE `#REPLACE_ME#_category` ( DROP TABLE IF EXISTS `#REPLACE_ME#_categoryrelation`; CREATE TABLE `#REPLACE_ME#_categoryrelation` ( - `linkid` int NOT NULL, - `categoryid` int NOT NULL + `linkid` int NOT NULL, + `categoryid` int NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci ROW_FORMAT=COMPACT; -- -------------------------------------------------------- @@ -44,7 +44,7 @@ CREATE TABLE `#REPLACE_ME#_categoryrelation` ( -- DROP VIEW IF EXISTS `#REPLACE_ME#_combined`; CREATE TABLE `#REPLACE_ME#_combined` ( - `category` varchar(128) + `category` varchar(128) ,`categoryId` int ,`created` datetime ,`description` varchar(255) @@ -66,16 +66,16 @@ CREATE TABLE `#REPLACE_ME#_combined` ( DROP TABLE IF EXISTS `#REPLACE_ME#_link`; CREATE TABLE `#REPLACE_ME#_link` ( - `id` int NOT NULL, - `link` mediumtext COLLATE utf8mb4_unicode_520_ci NOT NULL, - `created` datetime NOT NULL, - `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `status` int NOT NULL, - `description` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `image` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `hash` char(32) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `search` text COLLATE utf8mb4_unicode_520_ci NOT NULL + `id` int NOT NULL, + `link` mediumtext COLLATE utf8mb4_unicode_520_ci NOT NULL, + `created` datetime NOT NULL, + `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `status` int NOT NULL, + `description` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `title` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `image` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `hash` char(32) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `search` text COLLATE utf8mb4_unicode_520_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci ROW_FORMAT=COMPACT; -- -------------------------------------------------------- @@ -194,4 +194,4 @@ COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; \ No newline at end of file +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/documentation/installation.md b/documentation/installation.md new file mode 100644 index 0000000..244fd18 --- /dev/null +++ b/documentation/installation.md @@ -0,0 +1,72 @@ +# Installation + +## 1. Requirements + +Check the `requirements.md` first. +An access and database on a mysql database server. Write them down. +If you share a database, either use the default table prefix (inisipid) or use your own. +Absolute path on your webserver web-accessible folder where insipid will be installed to. + +## 2. Read + +Read this document before changing anything! + +## 3. Unpack + +Unpack the archive to a temporary directory of your choice. +Final files and folder will be moved to the webroot of your webserver later on. +You can also verify the package with the available md5/sha sum information. + +## 4. Config + +Create your config file. + +Copy `webroot/config.default.php` to `webroot/config.php` + +Modify at least the following settings in this file: +``` +const DB_HOST = '127.0.0.1; <= The database server hostname you are using +const DB_USERNAME = 'user' <= The database username you are using +const DB_PASSWORD = 'test; <= The database password you are using +const DB_NAME = 'insipid' <= Database name on your database server +const FRONTEND_USERNAME = 'han'; <= The frontend username. Please change the default +const FRONTEND_PASSWORD = 'solo'; <= The frontend password. Please change the default +const ABSOLUTE_PATH = '/path/to/insipid/on/your/webserver'; <= Absolute path where insipid is located in your webserver +``` + +## 5. Prepare SQL file + +Copy and modify `documentation/insipid-edit-me.sql` and replace the placeholder `#REPLACE_ME#`. +Open the file and make a search and replace: + +``` +search for: #REPLACE_ME# +replace with: YOUR_TABLE_PREFIX +``` + +The value `YOUR_TABLE_PREFIX` has to match with the value for `DB_PREFIX` in your `config.php` file. +Default is insipid. Alter the value here and in the config file if you choose a different one. + +## 6. Database + +Create a database if needed. Should match `DB_NAME` in your `config.php`. Remember step 1. +Import the edited from step 5 sql file into your MySQL database. + +## 7. Robots.txt + +Edit the `robots.txt` file to your needs. Usually not needed. + +## 8. Move files + +Copy the content of the unpacked webroot folder onto your webserver folder. +Make the `localdata` folder writable to the web process to store images from link parsing. +`LOCAL_STORAGE` is the option in the `config.php` file. +Make sure `ABSOLUTE_PATH` matches the location of insipid in your webserver! + +## 9. Access + +If you want to fully restrict your contents activate the user/password restriction in the `config.php` file. + +## 10. E-Mail importer + +If you want to use the e-mail importer read the `email-importer.md` file. diff --git a/documentation/installation.txt b/documentation/installation.txt deleted file mode 100644 index b93ccb1..0000000 --- a/documentation/installation.txt +++ /dev/null @@ -1,57 +0,0 @@ -1. Requirements -Check the requirements.txt first. -An access and database on a mysql database server. Write them down. -If you share a database either use the default table prefix (inisipid) or use your own. -Absolute path on your webserver web-accessible folder where insipid will be installed to - -2. Read -Read this document before changing anything! - -3. Unpack -Unpack the archive to a temporary directory of your choice. -Final files and folder will be moved to the webroot of your -webserver later on. -You can also verify the package with the available m5/sha sum information - -4. Config -Create your config file. -Copy webroot/config.default.php to webroot/config.php - -Modify at least the following settings in this file: -- const DB_HOST = '127.0.0.1; <= The database server hostname you are using -- const DB_USERNAME = 'user' <= The database username you are using -- const DB_PASSWORD = 'test; <= The database password you are using -- const DB_NAME = 'insipid' <= Database name on your database server -- const FRONTEND_USERNAME = 'han'; <= The frontend username. Please change the default -- const FRONTEND_PASSWORD = 'solo'; <= The frontend password. Please change the default -- const ABSOLUTE_PATH = '/path/to/insipid/on/your/webserver'; <= Absolute path where insipid is located in your webserver - -5. Prepare SQL file -Copy and modify documentation/insipid-edit-me.sql and replace the placeholder. -Open the file and make a search and replace: - -search for: `#REPLACE_ME# -replace with: `YOUR_TABLE_PREFIX - -The value YOUR_TABLE_PREFIX has to match with the value for DB_PREFIX in your config.php file. -Default is insipid. Alter the value here and in the config file if you choose a different one - -6. Database -Create a database if needed. Should match DB_NAME in your config. Remember step 1. -Import the edited from step 5 sql file into your MySQL database. - -7. -Edit the robots.txt file to your needs. -Usually not needed - -8. -Copy the content of the unpacked webroot folder onto your webserver folder. -Make the localdata folder writable to the web process to store images from link parsing. -LOCAL_STORAGE is the option in the config file. -Make sure ABSOLUTE_PATH matches the location of insipid in your webserver! - -9. -If you want to fully restrict your contents activate the user/password restriction in the config. - -10. -If you want to use the e-mail importer read the email-importer.txt file. diff --git a/documentation/requirements.txt b/documentation/requirements.md similarity index 58% rename from documentation/requirements.txt rename to documentation/requirements.md index 942a27e..b71eaae 100644 --- a/documentation/requirements.txt +++ b/documentation/requirements.md @@ -1,4 +1,9 @@ -Apache (2.4 and up) with PHP extension enabled +# Requirements + +There are the minimum requirements you need. The software is tested with those. + +Apache (2.4 and up) with PHP extension enabled. + PHP (8 and up) - mysql & mysqli - curl @@ -6,8 +11,9 @@ PHP (8 and up) - imap +ssl if you us the email importer - xmlread - xmlwriter + MySQL server or access to a database 5.6.x and up - DB user rights has to include create, alter a view - NOT MariaDB. It is missing some functions MySQL has. -Latest browser for accessing the client. IE (not Edge) is not supported anymore. +Latest browser for accessing the client. diff --git a/documentation/technicalinfo.md b/documentation/technicalinfo.md new file mode 100644 index 0000000..bb56147 --- /dev/null +++ b/documentation/technicalinfo.md @@ -0,0 +1,14 @@ +# Technical information + +Here are some technical information if you want to understand some code or config better. Not really well +documented or written. Improvements are welcome. + +## Table link + +`status = 1|2|3` + +1 = private + +2 = visible to everyone -> sql queries use this as default + +3 = added via email importer. Moderation needed diff --git a/documentation/technicalinfo.txt b/documentation/technicalinfo.txt deleted file mode 100644 index cf43d8d..0000000 --- a/documentation/technicalinfo.txt +++ /dev/null @@ -1,5 +0,0 @@ -# table link -status = 1|2|3 -1 = private -2 = visible to everyone -> sql queries use this as default -3 = added via email importer. Moderation needed diff --git a/documentation/thumbnail-of-link.txt b/documentation/thumbnail-of-link.md similarity index 67% rename from documentation/thumbnail-of-link.txt rename to documentation/thumbnail-of-link.md index 55f90be..35d6aa6 100644 --- a/documentation/thumbnail-of-link.txt +++ b/documentation/thumbnail-of-link.md @@ -1,10 +1,10 @@ +# Thumbnails + While editing a link you can request thumbnail of the given link at the time. It uses the Google page insights API to get a thumbnail. -It will be created if the option is activated. To remove uncheck the option. -To refresh uncheck the option. Save. This will delete the data. -Check the option again and the thumbnail will be created again. +It will be created if the option is activated. To remove uncheck the option at entry creation. +To refresh uncheck the option. Save. This will delete the data. Check the option again and the thumbnail will be created again. -Any error in this process will be visible in the error log file -and not visible in the client. This way the link will be saved +Any error in this process will be visible in the error log file and not visible in the client. This way the link will be saved and no data will be lost. diff --git a/documentation/translation.md b/documentation/translation.md new file mode 100644 index 0000000..954265b --- /dev/null +++ b/documentation/translation.md @@ -0,0 +1,8 @@ +# Translation + +Translation files are located in `webroot/lib/lang` and follow the [ISO_639-3](https://de.wikipedia.org/wiki/ISO_639#ISO_639-3) naming +convention. English is `eng.lang.ini` and german is `ger.lang.ini`. + +The `FRONTEND_LANGUAGE` setting in `config.php` defines the used language. + +If no or wrong `FRONTEND_LANGUAGE` is set, eng will be used. diff --git a/documentation/translation.txt b/documentation/translation.txt deleted file mode 100644 index 71ff7b0..0000000 --- a/documentation/translation.txt +++ /dev/null @@ -1,6 +0,0 @@ -Translation files are located in lib/lang and follow the https://de.wikipedia.org/wiki/ISO_639#ISO_639-3 naming -convention. English is eng.lang.ini and german is ger.lang.ini - -The FRONTEND_LANGUAGE setting in config.php defines the used language. - -If no or wrong FRONTEND_LANGUAGE is set, eng will be used. diff --git a/documentation/troubleshooting.txt b/documentation/troubleshooting.md similarity index 72% rename from documentation/troubleshooting.txt rename to documentation/troubleshooting.md index 145af9f..f8ca59e 100644 --- a/documentation/troubleshooting.txt +++ b/documentation/troubleshooting.md @@ -1,17 +1,22 @@ +# Troubleshooting + To get more information if your are stuck: -Edit config.php and change the following setting: +Edit `config.php` and change the following setting: +``` FROM: const DEBUG = false; TO: const DEBUG = true; +``` Alter it to false after your are done. Do not use this permanently since it displays unwanted and even sensitive information to everyone. - If you want to know the db queries: +``` FROM: const QUERY_DEBUG = false; TO: const QUERY_DEBUG = true; +``` -This writes the queries into the LOGFILE \ No newline at end of file +This writes the queries into the `LOGFILE` diff --git a/documentation/update.md b/documentation/update.md new file mode 100644 index 0000000..d69c5b3 --- /dev/null +++ b/documentation/update.md @@ -0,0 +1,93 @@ +# Update + +If you are updating from a previous version make sure every update info from the version your are updating from is done. + +## version 2.x.x - Griffin Chapel + +Add new config setting `TIMEZONE` to your config. See `config.default.php` for more details. + +Add new config settings for using page screenshot with browserless.io. See `config.default.php` for more details. + +``` +const COMPLETE_PAGE_SCREENSHOT_BROWSERLESS_API = "https://chrome.browserless.io/screenshot?token="; +const COMPLETE_PAGE_SCREENSHOT_API_KEY = 'YOUR-API-KEY'; +const COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_TIMEOUT = 10000; # milliseconds +const COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_IMAGE_QUALITY = 75; # quality for jpeg +``` + +## version 2.8.2 - Dragon Chapel + +Add query debug setting to config file. See `config.default.php` for `QUERY_DEBUG` constant. Add it to your local `config.php` + +Add log file path constant to config file. See `config.default.php` for `LOGFILE` constant. Add it to your local `config.php` + +Update your tables with the following SQL statements. Replace `#REPLACE_ME#` with your current table prefix. + +``` +ALTER TABLE `#REPLACE_ME#_link` ADD INDEX (`created`); +ALTER TABLE `#REPLACE_ME#_link` ADD INDEX (`status`); +ALTER TABLE `#REPLACE_ME#_categoryrelation` ADD INDEX (`categoryid`); +ALTER TABLE `#REPLACE_ME#_tagrelation` ADD UNIQUE `tagid` (`linkid`, `tagid`); +ALTER TABLE `#REPLACE_ME#_tagrelation` ADD INDEX (`linkid`); +ALTER TABLE `#REPLACE_ME#_category` ADD INDEX (`name`); + +ALTER TABLE `#REPLACE_ME#_category` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +ALTER TABLE `#REPLACE_ME#_categoryrelation` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +ALTER TABLE `#REPLACE_ME#_link` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +ALTER TABLE `#REPLACE_ME#_tag` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +ALTER TABLE `#REPLACE_ME#_tagrelation` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +ALTER TABLE `#REPLACE_ME#_tag` CHANGE `name` `name` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; +ALTER TABLE `#REPLACE_ME#_link` CHANGE `link` `link` MEDIUMTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; +ALTER TABLE `#REPLACE_ME#_link` CHANGE `description` `description` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; +ALTER TABLE `#REPLACE_ME#_link` CHANGE `title` `title` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; +ALTER TABLE `#REPLACE_ME#_link` CHANGE `image` `image` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; +ALTER TABLE `#REPLACE_ME#_link` CHANGE `hash` `hash` CHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; +ALTER TABLE `#REPLACE_ME#_link` CHANGE `search` `search` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; +ALTER TABLE `#REPLACE_ME#_category` CHANGE `name` `name` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; +``` + +Folder `lib/MysqlDump` and its contents can be removed. + +## version 2.8.1 - Deathwind + +Added debug setting into `config.php`. See `config.default.php` for `DEBUG` constant. Add it to your local `config.php`. + +Removed `WKHTMLTOPDF_USE` and `WKHTMLTOPDF_COMMAND` from `config.php` file and replaced with `COMPLETE_PAGE_SCREENSHOT` +and `COMPLETE_PAGE_SCREENSHOT_COMMAND`. + +## version 2.8 - Wastelands + +Nothing. + +## version 2.7 - Sacred Grove + +New syntax in `config.php` file. Switched from `define()` to `const` syntax. Use `config.default.php` as a template to update your config. + +## version 2.6 - Hypostyle + +Update config file with the new language setting. See `config.default.php` and `translation.md` for more information + +Run update search index to use the URL within the search index for your existing data. + +## version 2.5 - Winnowing Hall + +Update `config.php` file with the two new constants. See `config.default.php` and `snapshots-of-linked-webpage.txt` for more information. + +``` + define('WKHTMLTOPDF_USE',false); + define('WKHTMLTOPDF_COMMAND','/absolute/path/to/wkhtmltoimage'); +``` + +## version 2.4 - Seven Portals + +Run (after authentication) at `/index.php?p=stats` the "Search index update" to make the search work again correctly. +At success, there is no confirmation. To validate you can now search for single words case-insensitive. + +Update `config.php` file with two new settings. See `config.default.php` for more info. + +``` +define('EMAIL_JOB_PROTECT', false); +define('EMAIL_JOB_PROTECT_SECRET', 'SOME_SECRET_STRING'); +``` + +All files in `webroot/asset/js/` **EXCEPT** the new `editlink.js` can be removed. diff --git a/documentation/update.txt b/documentation/update.txt deleted file mode 100644 index 9c89d63..0000000 --- a/documentation/update.txt +++ /dev/null @@ -1,75 +0,0 @@ -If you are updating from a previous version make sure every update info from -the version your are updating from is done. - -## version 2.x.x - Griffin Chapel -+ Add new config setting TIMEZONE to your config. See config.default.php for more details. -+ Add new config settings for using page screenshot with browserless.io. See config.default.php for more details. - const COMPLETE_PAGE_SCREENSHOT_BROWSERLESS_API = "https://chrome.browserless.io/screenshot?token="; - const COMPLETE_PAGE_SCREENSHOT_API_KEY = 'YOUR-API-KEY'; - const COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_TIMEOUT = 10000; # milliseconds - const COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_IMAGE_QUALITY = 75; # quality for jpeg - -## version 2.8.2 - Dragon Chapel -+ Add query debug setting to config file. - See config.default.php for QUERY_DEBUG constant. Add it to your local config.php -+ Add log file path constant to config file. - See config.default.php for LOGFILE constant. Add it to your local config.php -+ Update your tables with the following SQL statements. Replace #REPLACE_ME# with your current table prefix. - -ALTER TABLE `#REPLACE_ME#_link` ADD INDEX (`created`); -ALTER TABLE `#REPLACE_ME#_link` ADD INDEX (`status`); -ALTER TABLE `#REPLACE_ME#_categoryrelation` ADD INDEX (`categoryid`); -ALTER TABLE `#REPLACE_ME#_tagrelation` ADD UNIQUE `tagid` (`linkid`, `tagid`); -ALTER TABLE `#REPLACE_ME#_tagrelation` ADD INDEX (`linkid`); -ALTER TABLE `#REPLACE_ME#_category` ADD INDEX (`name`); - -ALTER TABLE `#REPLACE_ME#_category` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -ALTER TABLE `#REPLACE_ME#_categoryrelation` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -ALTER TABLE `#REPLACE_ME#_link` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -ALTER TABLE `#REPLACE_ME#_tag` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -ALTER TABLE `#REPLACE_ME#_tagrelation` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -ALTER TABLE `#REPLACE_ME#_tag` CHANGE `name` `name` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; -ALTER TABLE `#REPLACE_ME#_link` CHANGE `link` `link` MEDIUMTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; -ALTER TABLE `#REPLACE_ME#_link` CHANGE `description` `description` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; -ALTER TABLE `#REPLACE_ME#_link` CHANGE `title` `title` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; -ALTER TABLE `#REPLACE_ME#_link` CHANGE `image` `image` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; -ALTER TABLE `#REPLACE_ME#_link` CHANGE `hash` `hash` CHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; -ALTER TABLE `#REPLACE_ME#_link` CHANGE `search` `search` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; -ALTER TABLE `#REPLACE_ME#_category` CHANGE `name` `name` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; - - + Folder lib/MysqlDump and its contents can be removed. - -## version 2.8.1 - Deathwind -+ Added debug setting into config. See config.default.php for DEBUG constant. - Add it to your local config.php -+ Removed WKHTMLTOPDF_USE and WKHTMLTOPDF_COMMAND from config file. - and replaced with COMPLETE_PAGE_SCREENSHOT and COMPLETE_PAGE_SCREENSHOT_COMMAND - -## version 2.8 - Wastelands -+ Nothing. - -## version 2.7 - Sacred Grove -+ New syntax in config file. Switched from define() to const syntax. - Use config.default.php as a template to update your config. - -## version 2.6 - Hypostyle -+ Update config file with the new language setting. See config.default and - translation.txt for more information -+ Run update search index to use the URL within the search index for your existing data. - -## version 2.5 - Winnowing Hall -+ Update config file with the two new constants. See config.default and - snapshots-of-linked-webpage.txt for more information - define('WKHTMLTOPDF_USE',false); - define('WKHTMLTOPDF_COMMAND','/absolute/path/to/wkhtmltoimage'); - -## version 2.4 - Seven Portals (2020-02-16) -+ Run (after authentication) at /index.php?p=stats the "Search index update" - to make the search work again correctly. At success, there is no confirmation. - To validate you can now search for single words case-insensitive. - -+ Update config file with two new settings. See config.default for more info - define('EMAIL_JOB_PROTECT', false); - define('EMAIL_JOB_PROTECT_SECRET', 'SOME_SECRET_STRING'); - -+ All files in webroot/asset/js/ EXCEPT the new editlink.js can be removed diff --git a/documentation/usage.txt b/documentation/usage.md similarity index 77% rename from documentation/usage.txt rename to documentation/usage.md index 92e165b..e515317 100644 --- a/documentation/usage.txt +++ b/documentation/usage.md @@ -1,12 +1,15 @@ +# Usage + Use Insipid as a self hosted service for your own bookmarks. Share and collect. Management needs authentication which is configured with the following options in the options file: +``` FRONTEND_USERNAME => This is the username FRONTEND_PASSWORD => This is the password for the username +``` -Call the following URL to trigger the authentication: -http(s)://your.domain.tld/path/to/insipid/index.php?m=auth +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. Moderation and more overview can be access from the stats overview page. @@ -17,9 +20,9 @@ There is no special "add a new link" option. Just paste the link into the search 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. -Usage of the email-importer can be found in the email-importer.txt file. +Usage of the email-importer can be found in the `email-importer.md` file. # Search The search is based on the link, description, tags and categories. Technology behind is a mysql fulltext search in BOOLEAN MODE: https://dev.mysql.com/doc/refman/8.0/en/fulltext-boolean.html -Which means you can use special operators like +- or * \ No newline at end of file +Which means you can use special operators like +- or * diff --git a/documentation/whole-page-snapshot.txt b/documentation/whole-page-snapshot.md similarity index 65% rename from documentation/whole-page-snapshot.txt rename to documentation/whole-page-snapshot.md index 1b9af57..8dcafd7 100644 --- a/documentation/whole-page-snapshot.txt +++ b/documentation/whole-page-snapshot.md @@ -1,12 +1,14 @@ -Whole page screenshot of a website. +# Whole page screenshot of a website. It uses browserless.io to generate a whole page screenshot of a link. There is a free account which allows ap to 1000 requests per month. # Usage -To use this feature edit the config and set COMPLETE_PAGE_SCREENSHOT to true -and provide your browserles.io API key to COMPLETE_PAGE_SCREENSHOT_API_KEY. + +To use this feature edit the `config.php` and set `COMPLETE_PAGE_SCREENSHOT` to `true` +and provide your browserles.io API key to `COMPLETE_PAGE_SCREENSHOT_API_KEY`. # Limitations and expectations + Every link and its target is different. The settings to generate the screenshot should work for the most of them. But there are a lot of things which influence the result and can return in a not-so-good screenshot. diff --git a/documentation/xml-export-and-import.txt b/documentation/xml-export-and-import.md similarity index 63% rename from documentation/xml-export-and-import.txt rename to documentation/xml-export-and-import.md index 60c0b64..ed1ebec 100644 --- a/documentation/xml-export-and-import.txt +++ b/documentation/xml-export-and-import.md @@ -1,10 +1,10 @@ -Any link can be exported as a xml file from the link info view. -Login is required to trigger this function. +# XML import and export + +Any link can be exported as a xml file from the link info view. Login is required to trigger this function. The result can be used to import it again at the stats view. It exports all the link information, image and its tags and categories. The import can overwrite existing links and import non existing ones. -A import xml file can contain multiple exports. Make sure the root is -still there. \ No newline at end of file +A import xml file can contain multiple exports. Make sure the root is still there. diff --git a/webroot/index.php b/webroot/index.php index c21624b..f818198 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -3,7 +3,7 @@ * Insipid * Personal web-bookmark-system * - * Copyright 2016-2023 Johannes Keßler + * Copyright 2016-2025 Johannes Keßler * * Development starting from 2011: Johannes Keßler * https://www.bananas-playground.net/projekt/insipid/ @@ -23,7 +23,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0. - * */ mb_http_output('UTF-8'); @@ -32,15 +31,6 @@ error_reporting(-1); // E_ALL & E_STRICT require('config.php'); date_default_timezone_set(TIMEZONE); -## check request -$_urlToParse = filter_var($_SERVER['QUERY_STRING'],FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_LOW); -if(!empty($_urlToParse)) { - # see http://de2.php.net/manual/en/regexp.reference.unicode.php - if(preg_match('/[\p{C}\p{M}\p{Sc}\p{Sk}\p{So}\p{Zl}\p{Zp}]/u',$_urlToParse) === 1) { - die('Malformed request. Make sure you know what you are doing.'); - } -} - ## set the error reporting ini_set('log_errors',true); if(DEBUG === true) { @@ -79,7 +69,7 @@ if(defined("USE_PAGE_AUTH") && USE_PAGE_AUTH === true) { $DB = new mysqli(DB_HOST, DB_USERNAME,DB_PASSWORD, DB_NAME); if ($DB->connect_errno) exit('Can not connect to MySQL Server'); $DB->set_charset("utf8mb4"); -$DB->query("SET collation_connection = 'utf8mb4_bin'"); +$DB->query("SET collation_connection = 'utf8mb4_unicode_520_ci'"); $driver = new mysqli_driver(); $driver->report_mode = MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT;; diff --git a/webroot/job/email-import.php b/webroot/job/email-import.php index ec64daa..ae07097 100644 --- a/webroot/job/email-import.php +++ b/webroot/job/email-import.php @@ -108,7 +108,7 @@ if(EMAIL_REPORT_BACK === true) { $DB = new mysqli(DB_HOST, DB_USERNAME,DB_PASSWORD, DB_NAME); if ($DB->connect_errno) exit('Can not connect to MySQL Server'); $DB->set_charset("utf8mb4"); -$DB->query("SET collation_connection = 'utf8mb4_bin'"); +$DB->query("SET collation_connection = 'utf8mb4_unicode_520_ci'"); $driver = new mysqli_driver(); $driver->report_mode = MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT;; diff --git a/webroot/lib/summoner.class.php b/webroot/lib/summoner.class.php index 50a9852..08b375c 100644 --- a/webroot/lib/summoner.class.php +++ b/webroot/lib/summoner.class.php @@ -31,7 +31,7 @@ */ class Summoner { - private const BROWSER_AGENT_STRING = 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0'; + private const BROWSER_AGENT_STRING = 'Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0'; /** * validate the given string with the given type. Optional check the string -- 2.39.5