Skip to content

Technical Description and Breakdown

zelon88 edited this page May 7, 2017 · 36 revisions

Technical Description & Requirements

HRCloud2 runs in a web server environment. Therefore HRCloud2 requires, at minimum, a LAMP stack with Linux (Ubuntu derivative preferable), Apache2, MySql, PHP7, and WordPress. HRCloud2 also requires STRICT user group, ownership, and permissions over it's controlled directories. It is highly recommended that you read and closely adhere to the Installation Instructions.

How HRCloud2 Works

HRCloud2 takes in multiple user uploaded files at a time and places them in a user-specific subdirectory of the CloudDir specified in the "config.php" file. The CloudLoc could be any local/network drive or device-storage attached to the server so long as the server's "www-data" usergroup has read and write access to the CloudLoc. This means that it is possible for HRCloud2 to situate your user storage directories on specified RAID arrays, external storage, removable storage, or whatever else suits the needs of the end-user.

HRCloud2 stores user-specific logs of all operational history in "/var/www/html/HRProprietary/HRCloud2/DATA/UserID/.AppData" by default.

If VirusScanning is enabled, HRCloud2 will scan broad or specific folders depending on each scenario and return information or error messages that are appropriate to the type of security fault being identified. If VirusScanning is disabled HRCloud2 will pass all files and all requests without updating ClamAV or scanning any files or directories. VirusScanning has a major impact on server performance and latency. Each server environment should be manually evaluated to determine if VirusScanning is appropriate or neccesary.

Once the "config.php" file and all specified directories are verified, HRCloud2 verifies the user account being accessed. If WordPress returns a valid user_ID that is 0 (not logged in) HRCloud2 returns a login error. If WordPress returns a user_ID that is 1, HRCloud2 will assume the user is an administrator. If WordPress returns a user_ID of greater than 1 HRCloud2 will assume that the user has a standard user account.

After the user_ID has been verified, HRCloud2 locates and verifies the specific users Cloud directory. If the directory does not exist it is created. Files uploaded by "user_ID" are permanently stored in "CloudLocation/user_ID/UserDirectory/FILENAME". Whenever a file is needed for rework via a command-line tool, the permanent file is copied to a temporary file in "/var/www/html/HRProprietary/DATA/user_ID/UserDirectory/FILENAME" so that they are available for rework/download to the user over HTTP, and so that the server can segregate the file and predict the filename later. Temporary user files hosted in the "/DATA" directory older than 15 minutes are deleted.

HRCloud2 receives inputs from POST data. Depending on the type of POST, HRCloud2 will call upon one or more of it's dependencies to rework the specified file or directory. HRCloud2 uses a combination of AJAX embedded into "Applications/displaydirectorycontents_72216", CuRL, and regular HTML form POSTs. HRAI sometimes uses experimental CuRL requests during operation to detect other nearby HRAI nodes.

HRCloud2 Apps are simple web applications located in "Applications". HRCloud2 comes pre-loaded with some apps in this folder. Developers can drop their Apps into this folder, and if they appear in the AppLauncher they were installed sucessfully. Do not remove apps from this folder that are not listed in the HRCloud2 AppLauncher. Always try to use the HRCloud2 GUI whenever possible to install/uninstall Apps.

How Core Files Work

HRCloud2 was written to include the bulk of it's operational logic built into role-specific "core" files. These Core files allow decentralized, modular, and consistent operation of HRCloud2 code and functions without excess bloat. Core files can be included or required within HRCloud2 Apps to gain certain desired functionality, although HRCloud2 automatically pre-loads some of it's cores during normal operation. Deciding whether to use an instance of a core that is already running, or starting a fresh one can be decided by the App developer. Some HRCloud2 cores have the built-in ability to perform WordPress functions, although HRCloud2 itself only uses one (1) WordPress function (wp_get_current_user).

Core Files

Sanitize Core (sanitizeCore.php)

The Sanitize Core sanitizes user POST and GET inputs. If you are a developer, put your sanitiziaton code here and it will automatically be inluded anywhere your POST or GET input could be parsed.

Security Core (securityCore.php)

The Security Core secures your server and HRCloud2 by maintaining permission levels, verifying that ClamAV is enabled and up-to-date, and generates and verifies the "SaltHash" and "YUMMUSaltHash", respectively. If you require special authentication or the latest virus definitions for your HRCloud2 App, "include" or "require" this file somewhere in your code.

Common Core (commonCore.php)

The Common Core performs all of the standard user authentication, directory definitions, verification, logging, and variable functions for HRCloud2. If your App needs the official time, access to the Logs, user verification, access to a user directory, or just some WordPress functions you can "include" or "require" this file in your code.

Compatibility Core (compatibilityCore.php)

The Compatibility Core contains all of the functions required to perform system updates (both Automatic and Manual), cache cleaning and creation, compatibility related file modifications, backups, and deprecated file maintanence. The Compatibility Core keeps the HRCloud2 server performing it's best, and gives administrators the ability to maintain the server.

Cloud Core (cloudCore.php)

The Cloud Core contains all of the functions required to perform conversion, OCR, archiving/dearchiving, folder creation, deletion, moving, renaming, copying, cleaning, uploading, downloading, and various other Cloud Storage and data related functions.

App Core (appCore.php)

The App Core detects, verifies, manages, installs, and uninstalls HRCloud2 Apps. It is a required component of the AppLauncher and will give you useful information about installed HRCloud2 Apps if you "include" or "require" it into your HRCloud2 App.

Settings Core (settingsCore.php)

The Settings Core detects, updates, and manages user configuration data and settings. It also returns settings to default and gives users options to modify settings related to their account and gives administrators access to advanced features.

Non-Core Support Files

HRCloud2 App Launcher (appLauncher.php)

The App Launcher isn't a Core, but it does give administrators the ability to manage their Installed Apps. It also gives every user the ability to tweak or Launch their Apps and administrators access to vital App information and settings.

Janitor (janitor.php)

The Janitor cleans files and directories. That's it. If you need to delete directroies and subdirectories, simply set a PHP string as $CleanDir (path to directory being cleaned) and an array as $CleanFiles (use scandir() or opendir() ) and when you "include" or "require" the Janitor, your $CleanFiles and $CleanDir will be recursively deleted (up to about 10x levels). Critical HRCloud2 files will NOT be deleted. If your App makes a huge mess in a directory, aim this at the mess and check that it was cleaned.