Skip to content

Commit

Permalink
v2.7 - Fix a ton of bugs, make compatible w/PHP8.
Browse files Browse the repository at this point in the history
-v2.7.
-Update documentation.
  -Update installation docs to reflect latest PHP.
  -Remove mySQL requirements.
-Remove 'odf' support, change to 'odt' support.
-Specifically define $URLEcho to fix undefined variable warnings.
-Added $ShowGUI config variable for determining whether to show a full or minimal GUI.
  -Detects if the variable is set and manually defines $_GET['noGUI'].
  -Has the same function as $_GET['noGUI'].
  -If users don't have this variable set in their config.php file then a full GUI will be shown.
-HRConvert2 looks best when you use it in an iframe on your website.
-Fixed some if/while/foreach statements not having whitespace before the opening '('.
-Removed reference to $UserID in logs.
-Verified that all PDFWork is capable of functioning.
-Verified that all document conversions are capable of functioning.
-Reworked the way archives are extracted & compressed.
-Improved logging during dearchiving.
-Added $ApplicationName & $ApplicationTitle config entries in config.php.
  -If these are not set; defaults are used instead.
-Upgraded to JQuery 3.6.0 from 3.3.1.
  -Remove 3.3.1 & 3.1.0 legacy versions as they are no longer required.
-Added $ShowFinePrint config entry to config.php for showing or hiding the TOS & PP links.
  -If this is not set; a default is used instead.
-Fixed noGUI mode so that the divs are centered & the produced HTML is valid.
-Cleaned up some sloppy assignments in dearch/rearch code.
-Move temporary archive location to ConvertDir from ConvertTempDir.
-Improved consistency of UI elements.
-Switched dearchive code from using the 7z e switch to the 7z x switch to preserve paths.
-Fixed a bug in rar archive output paths.
-Changed the rar archiving arguments from "rar a -ep " to "rar a -ep1 -r" to preserve folder structure.
-Verified that all extraction / rearchiving operations work.
-Remove $Thorough & $HighPerformanceAV from config.php as they were no longer applicable.
-Reworked the way sanitizeCore.php converts strings into arrays.
-Changed $VirusScan config entry default value from '1' to TRUE.
  -The core will still recognize '1' as a valid entry to support legacy config files.
-Remove tar.bz2 option from archiveAll menu.
-Rework the way archiveAll feature is accomplished.
-Improve logging consistencies.
-Remove old iPhone code from index.html.
  -This is easier to accomplish with screen size anyway.
  • Loading branch information
zelon88 committed Apr 12, 2022
1 parent 7c467d6 commit e8ca752
Show file tree
Hide file tree
Showing 13 changed files with 344 additions and 349 deletions.
45 changes: 45 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
COMMIT - 4/11/2020
v2.7 - Improve sanitization per Issue #4.

-v2.7.
-Update documentation.
-Update installation docs to reflect latest PHP.
-Remove mySQL requirements.
-Remove 'odf' support, change to 'odt' support.
-Specifically define $URLEcho to fix undefined variable warnings.
-Added $ShowGUI config variable for determining whether to show a full or minimal GUI.
-Detects if the variable is set and manually defines $_GET['noGUI'].
-Has the same function as $_GET['noGUI'].
-If users don't have this variable set in their config.php file then a full GUI will be shown.
-HRConvert2 looks best when you use it in an iframe on your website.
-Fixed some if/while/foreach statements not having whitespace before the opening '('.
-Removed reference to $UserID in logs.
-Verified that all PDFWork is capable of functioning.
-Verified that all document conversions are capable of functioning.
-Reworked the way archives are extracted & compressed.
-Improved logging during dearchiving.
-Added $ApplicationName & $ApplicationTitle config entries in config.php.
-If these are not set; defaults are used instead.
-Upgraded to JQuery 3.6.0 from 3.3.1.
-Remove 3.3.1 & 3.1.0 legacy versions as they are no longer required.
-Added $ShowFinePrint config entry to config.php for showing or hiding the TOS & PP links.
-If this is not set; a default is used instead.
-Fixed noGUI mode so that the divs are centered & the produced HTML is valid.
-Cleaned up some sloppy assignments in dearch/rearch code.
-Move temporary archive location to ConvertDir from ConvertTempDir.
-Improved consistency of UI elements.
-Switched dearchive code from using the 7z e switch to the 7z x switch to preserve paths.
-Fixed a bug in rar archive output paths.
-Changed the rar archiving arguments from "rar a -ep " to "rar a -ep1 -r" to preserve folder structure.
-Verified that all extraction / rearchiving operations work.
-Remove $Thorough & $HighPerformanceAV from config.php as they were no longer applicable.
-Reworked the way sanitizeCore.php converts strings into arrays.
-Changed $VirusScan config entry default value from '1' to TRUE.
-The core will still recognize '1' as a valid entry to support legacy config files.
-Remove tar.bz2 option from archiveAll menu.
-Rework the way archiveAll feature is accomplished.
-Improve logging consistencies.
-Remove old iPhone code from index.html.
-This is easier to accomplish with screen size anyway.

--------------------
COMMIT - 2/11/2020
v2.6 - Improve sanitization per Issue #4.

Expand Down
75 changes: 39 additions & 36 deletions How_To_Install_HRConvert2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ HRConvert2 requires a Debian Linux-based operating system w/3rd party audio lice
For this guide, it is assumed that the user is installing HRConvert2
on a PC which meets the above conditions. This guide will walk
a new user through the installation of HRConvert2 on a freshly installed
version of Lubuntu 16.04 LTS with no pre-existing dependencies.
version of Lubuntu 21.04 LTS with no pre-existing dependencies.

For a walkthrough of installing a Ubuntu distro, visit.....
http://www.ubuntu.com/download/desktop/install-ubuntu-desktop

IMPORTANT NOTE: During this guide we will be setting-up a fully
functional, yet somewhat customized, LAMP stack including
linux, Apache2.4, MySQL, and PHP7.0. If you DO NOT want to have
a LAMP stack installed on your local machine DO NOT install this software.
linux, Apache2.4, and PHP8.0. If you DO NOT want to have
a server stack installed on your local machine DO NOT install this software.
This software was designed to be run on a dedicated server setup for NAS
duties.

Expand All @@ -39,56 +39,59 @@ https://github.com/dwaaan/HRConvert2-Docker
-sudo apt-get install curl
--------------------------------------------------

-----STEP 2 - INSTALL PHP7 & PLUGINS-----
-sudo apt-get install php libapache2-mod-php php-mysql
-sudo apt-get install php-all-dev
**YOU MAY NEED TO CHANGE THE VERSIONS BELOW DEPENDING ON YOUR UBUNTU/PHP VERSION**
-sudo apt-get install php7.1-zip (Replace version number with whatever version you want)
-sudo apt-get install php7.1-gd (Replace version number with whatever version you want)
-sudo apt-get install php-curl
**EDIT THE "php.ini" FILE LOCATED IN "/etc/php/7.1/apache2/php.ini"**
-sudo leafpad /etc/php/7.1/apache2/php.ini
**SEARCH FOR AND MODIFY THE FOLLOWING VALUES CAREFULLY**
max_execution_time = 90
max_input_time = 90
memory_limit = 512M
;Use 256 - 384M for Raspberry Pis
display_errors = On
;Leave display errors = Off if you're not debugging HRConvert2 youself
post_max_size = 3000M
upload_max_filesize = 3000M
max_file_uploads = 100
zlib.output_compression = On
**SAVE THE MODIFIED "php.ini" FILE AND EXIT LEAFPAD**
-----STEP 2 - INSTALL FEATHERPAD, LIBREOFFICE, PHP & PLUGINS-----
-sudo apt-get install featherpad && sudo apt-get install libreoffice-common && sudo apt-get install libreoffice-java-common && sudo apt-get install php libapache2-mod-php php-mysql && sudo apt-get install php-all-dev
**YOU MAY NEED TO CHANGE THE PHP VERSIONS BELOW DEPENDING ON YOUR UBUNTU/PHP VERSION**
-sudo apt-get install php8.0-zip && sudo apt-get install php8.0-gd && sudo apt-get install php-curl
**EDIT THE "php.ini" FILE LOCATED IN "/etc/php/8.0/apache2/php.ini"**
-sudo featherpad /etc/php/8.0/apache2/php.ini
**SEARCH FOR AND MODIFY THE FOLLOWING VALUES CAREFULLY**
max_execution_time = 90
max_input_time = 90
memory_limit = 512M
;Use 256 - 384M for Raspberry Pis
display_errors = On
;Leave display errors = Off if you're not debugging HRCloud2 youself
post_max_size = 3000M
upload_max_filesize = 3000M
max_file_uploads = 100
zlib.output_compression = On
**SAVE THE MODIFIED "php.ini" FILE AND EXIT FEATHERPAD**
-sudo service apache2 restart
--------------------------------------------------

-----STEP 4 - INSTALL BASIC FEATURE DEPENDENCIES-----
-sudo apt-get install clamav && sudo apt-get install libreoffice-common && sudo apt-get install unoconv && sudo apt-get install default-jre
-----STEP 3 - INSTALL BASIC FEATURE DEPENDENCIES-----
-sudo apt-get install clamav && sudo apt-get install unoconv && sudo apt-get install default-jre
-sudo chown -R www-data:www-data /var/www
-sudo leafpad /etc/rc.local
**ADD THE FOLLOWING LINE TO THE "rc.local" FILE **ABOVE** THE "exit 0" LINE**
/usr/bin/soffice --headless --accept="socket,host=127.0.0.1,port=$soffice_port;urp;" --nofirststartwizard &
**IF YOU DO NOT HAVE AN rc.local FILE, COPY AND PASTE THE INCLUDED ONE**
-sudo featherpad /etc/rc.local
**ADD THE FOLLOWING LINE TO THE "rc.local" FILE **ABOVE** THE "exit 0" LINE**
/usr/bin/soffice --headless --accept="socket,host=127.0.0.1,port=$soffice_port;urp;" --nofirststartwizard &
**IF YOU DO NOT HAVE AN "rc.local" FILE, OR IF THE FILE IS BLANK THEN COPY AND PASTE THE INCLUDED ONE**
-sudo chmod +x /etc/rc.local
-sudo systemctl enable rc-local.service
-sudo apt-get install rar && sudo apt-get install unrar && sudo apt-get install p7zip-full && sudo apt-get install imagemagick && sudo apt-get install ffmpeg && sudo apt-get install tesseract-ocr && sudo apt-get install meshlab && sudo apt-get install dia && sudo apt-get install pandoc && sudo apt-get install poppler-utils
**IF YOU GET ERRORS WHEN ENABLING THE SERVICE**
**COPY AND PASTE THE INCLUDED "rc-local.service" FILE TO "/etc/systemd/system/rc-local.service"**
**-sudo chmod +x /etc/rc.local**
**-sudo systemctl enable rc-local.service**
-sudo apt-get install rar && sudo apt-get install unrar && sudo apt-get install p7zip-full && sudo apt-get install imagemagick && sudo apt-get install ffmpeg && sudo apt-get install tesseract-ocr && sudo apt-get install meshlab && sudo apt-get install dia && sudo apt-get install pandoc && sudo apt-get install poppler-utils && sudo apt-get install nodejs && sudo apt-get install winetricks
-sudo apt install libnode-dev && sudo apt install node-gyp && sudo apt install npm && sudo apt-get install acpi
-sudo npm install nativefier -g
**REBOOT THE SERVER**
**IF DOCUMENT CONVERSIONS DONT WORK...**
**-unoconv --listen**
**OR -unoconv -l**
**OR create a daemon to run unoconv --listen**
**OR adjust the shebang at the top of /usr/bin/unoconv to #!/usr/bin/env python3
**OR adjust the shebang at the top of /usr/bin/unoconv to #!/usr/bin/env python3
--------------------------------------------------

-----STEP 5 - INSTALL HRConvert2-----
-----STEP 4 - INSTALL HRConvert2-----
**CREATE A DIRECTORY IN "/var/www/html" NAMED "HRProprietary"**
**CREATE ANOTHER DIRECTORY IN "/var/www/html/HRProprietary" NAMED "HRConvert2"**
**VISIT "http://github.com/zelon88/HRConvert2" AND DOWNLOAD THE LATEST HRConvert2 .zip FILE
TO YOUR DOWNLOADS FOLDER**
**EXTRACT HRConvert2.zip TO YOUR DOWNLOADS FOLDER**
**COPY THE CONTENTS OF THE "HRConvert2-master" FOLDER TO "/var/www/html/HRProprietary/HRConvert2"*
-sudo leafpad /var/www/html/HRProprietary/HRConvert2/config.php
-sudo featherpad /var/www/html/HRProprietary/HRConvert2/config.php
**CAREFULLY READ AND COMPLETELY FILL OUT THE CONFIG.PHP FILE!!!**
**HRConvert2 REQUIRES A SAFE LOCATION TO CREATE USER CONVERT DIRECTORIES. TO FACILITATE
THIS YOU MUST CREATE A !!!NEW!!! DIRECTORY AND ENTER IS AS THE "$ConvertLoc"**
Expand All @@ -113,13 +116,13 @@ IMPORTANT NOTE: If you need to correct permissions later, perform the following
-sudo chgrp -R www-data /var/www/html
--------------------------------------------------

-----STEP 6 - VISIT YOUR CONVERTER!!!-----
-----STEP 5 - VISIT YOUR CONVERTER!!!-----
Go to http://localhost/HRProprietary/HRConvert2/convertCore.php to view your Converter! The computer you install HRConvert2 onto
should be considered a staitionary server that you can safely point your "Static NAT" at and access from anywhere. To accomplish
these things, follow the additional steps below.
--------------------------------------------------

-----STEP 7 - ADD FIREWALL EXCEPTIONS AND SETUP STATIC NAT ON YOUR ROUTER-----
-----STEP 6 - ADD FIREWALL EXCEPTIONS AND SETUP STATIC NAT ON YOUR ROUTER-----
-According to the manual for the manufacturer of your broadband router, find the local IP address where you can make changes to it's
configuration. Try entering "192.168.1.1" into a browser. If you are greeted with a login screen, check the bottom of your router or your
system administrator for the required information. If you are not greeted with any tangible login screen other than an error message,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Supports specific bitrate through the API.
- Docx
- Txt
- Rtf
- Odf
- Odt
- Pdf
#### Spreadsheet Formats
- Xls
Expand Down Expand Up @@ -102,7 +102,7 @@ OCR Operations support the following output formats...
- Docx
- Txt
- Rtf
- Odf
- Odt
- Pdf
---
# Screenshots
Expand Down
2 changes: 2 additions & 0 deletions Resources/jquery-3.6.0.min.js

Large diffs are not rendered by default.

35 changes: 15 additions & 20 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,10 @@
$Salts5 = 'somethingSoRanDoMThatNobodyr3454r3r33_Will_evar+guess+it';
$Salts6 = 'somethingSoRanDoMThatNob2odyawryoglukfgy;/.5^&#&__Will_evar+guess+it';
// / Externally or internally accesible domain or IP.
$URL = 'https://www.honestrepair.net';
$URL = 'localhost';
// / Scan for viruses during directory scan. Use '1' for default.
// / (ClamAV MUST be installed on the localhost!!!).
$VirusScan = '1';
// / Use multi-threaded virus scanning. Virus scanning is extremely resource intensive.
// / If you are running an older machine (Rpi, CoreDuo, or any single-core CPU) leave
// / this setting disabled '0'.
$HighPerformanceAV = '1';
// / Thorough A/V scanning requires stricter permissions, and may require additional
// / ClamAV user, usergroup, and permissions configuration.
// / Disable '0' if you experience errors.
// / Enable '0' if you experience false-negatives.
$ThoroughAV = '0';
// / Persistent A/V scanning will try to achieve the highest level of scanning that is
// / possible with available permissions.
// / When enabled; If errors are encountered ANY AND EVERY attempt to recover from the
// / error will be made. No expense will be spared to complete the operation.
// / When disabled; If errors are encountered, NO ATTEMPTS to recover from the error
// / will be made. The operation will be abandoned and abort after reasonable effort.
$PersistentAV = '1';
$VirusScan = FALSE;
// / ------------------------------

// / ------------------------------
Expand All @@ -65,20 +49,31 @@
// / (NO SLASH AFTER DIRECTORY!!!) ...
$ServerRootDir = '/var/www/html';
// / The CloudLoc is where temporary data files are stored. (NO SLASH AFTER DIRECTORY!!!) ...
$ConvertLoc = '/mnt/0b3324303-b1a7-4223-8360-7343263c052/ConvertDATA';
$ConvertLoc = '/home/justin/Documents/Projects/DATA/ConvertDATA';
// / The CloudLoc is where permanent Log files are stored. (NO SLASH AFTER DIRECTORY!!!) ...
$LogDir = '/var/www/html/HRProprietary/HRConvert2/Logs';
// / ------------------------------

// / ------------------------------
// / General Information ...
// / Default is '30'.
// / The default name to display for this application.
// / You can change this to make it fit with other services your organization provides.
$ApplicationName = 'HRConvert2';
// / The default title to display in taskbars & window managers.
// / You can change this to make it fit with other services your organization provides.
$ApplicationTitle = 'Convert Anything!';
// / Age in minutes of files to be deleted.
// / Set to '0' to keep files indefinately.
// / Default is '30'.
$Delete_Threshold = '30';
// / Number of bytes to store in each logfile before splitting to a new one.
$MaxLogSize = '1048576';
// / The default font to use throughout HRConvert2 GUI elements.
$Font = 'Arial';
// / Set whether or not to display a full GUI by default.
$ShowGUI = TRUE;
// / Set whether or not to display the Terms of Service & Privacy Policy links.
$ShowFinePrint = TRUE;
// / Terms of Service URL.
$TOSURL = 'https://www.honestrepair.net/index.php/terms-of-service/';
// / Privacy Policy URL.
Expand Down
Loading

0 comments on commit e8ca752

Please sign in to comment.