diff --git a/docs/CodeHydrater.md b/docs/CodeHydrater.md new file mode 100644 index 0000000..b46e5d4 --- /dev/null +++ b/docs/CodeHydrater.md @@ -0,0 +1,224 @@ +# You will need to become ROOT!! +Please be authorized to do any of this! Really, a web site must be installed by a web-developer account with SUDOERS access! + +## Installing the Framework +To install the Framework, IF NOT INSTALLED YET: +``` +$ cd /tmp +$ git clone https://git.mysnippetsofcode.com/bobs/CodeHydrater.git +$ sudo mkdir -p /usr/share/php +$ sudo mv /tmp/CodeHydrater /usr/share/php/ +$ sudo chgrp www-data /usr/share/php/CodeHydrater +``` +## Installing the Project +To install the Project files, IF NOT INSTALLED YET: +``` +$ cd /tmp +$ git clone https://git.mysnippetsofcode.com/bobs/ProjectCodeHydrater.git +$ sudo mkdir -p /var/www +$ sudo mv /tmp/ProjectCodeHydrater /var/www/ +$ sudo chgrp www-data /var/www/ProjectCodeHydrater +``` +## Linking the Framework to the Project +This is a REQUIRED Step!!! Do not FORGET to do this: +``` +$ ln -s /usr/share/php/CodeHydrater /var/www/ProjectCodeHydrater/protected/ +``` +# PHP needs acccess to the Framework DIR +``` +If you have locked down the acceess using Open Base DIR... +Multiple Paths: Separate multiple directories with a semicolon (;) on Windows and a colon (:) on Linux. +EDIT php.ini look for open_basedir +open_basedir = /var/www:/usr/share/php/CodeHydrater:/var/lib/php/session +``` + +# Optional: Zephir Stuff - Encrypted Features +## If you want to hide your code by compiling or AES encryption... +If you want the advanced feature set with Zephir, see the Zephir_code.md file. +It is optional... + +# Framework DIRS +src/ +├── bootstrap +│   ├── auto_loader.php +│   ├── errors.php +│   ├── load_all.php +│   ├── main.php +│   ├── requires.php +│   ├── safer_io.php +│   └── site_helper.php +├── classes +│   ├── apis +│   │   ├── api.php +│   │   └── rate_limiting +│   │   ├── api_authenticator.php +│   │   ├── create_subscription_aware_validator.php +│   │   ├── rate_limiter.php +│   │   └── redis_rate_limiter.php +│   ├── app.php +│   ├── arrays +│   │   ├── common_stuff.php +│   │   ├── countries.php +│   │   ├── mimes.php +│   │   ├── mocking +│   │   │   ├── address.php +│   │   │   ├── phone.php +│   │   │   └── rnd_names.php +│   │   ├── shortn.php +│   │   └── zipcodes.php +│   ├── assets.php +│   ├── bb_code_parser.php +│   ├── collection.php +│   ├── common.php +│   ├── console_app.php +│   ├── database +│   │   ├── dummy_data.php +│   │   ├── model.php +│   │   └── paginate.php +│   ├── dollars.php +│   ├── enums +│   │   ├── api_tier.php +│   │   ├── compression_method.php +│   │   ├── safer_io_enums.php +│   │   └── view_type.php +│   ├── exceptions +│   │   ├── Bool_Exception.php +│   │   └── DB_Exception.php +│   ├── extras_booter.php +│   ├── gz_compression.php +│   ├── html_document.php +│   ├── html_parser.php +│   ├── html.php +│   ├── http +│   │   ├── container.php +│   │   ├── kernel.php +│   │   ├── request.php +│   │   ├── response.php +│   │   └── service_provider.php +│   ├── interfaces +│   ├── lazy_collection.php +│   ├── lazy_object.php +│   ├── make_license_files.php +│   ├── memory_usage.php +│   ├── middleware.php +│   ├── misc.php +│   ├── page_not_found.php +│   ├── php_file_cache.php +│   ├── random_engine.php +│   ├── router.php +│   ├── rss_feed.php +│   ├── safer_sql.php +│   ├── scalar.php +│   ├── security.php +│   ├── services +│   │   ├── emailer.php +│   │   ├── encryption.php +│   │   ├── html_filter.php +│   │   ├── liquid_templates.php +│   │   ├── log.php +│   │   ├── paragon_crypto +│   │   │   ├── crypto.php +│   │   │   ├── password_storage.php +│   │   │   └── sodium_storage.php +│   │   ├── sessions +│   │   │   ├── cookie_session_handler.php +│   │   │   ├── file_session_handler.php +│   │   │   └── redis_session_handler.php +│   │   ├── twig.php +│   │   └── twilio_setup.php +│   ├── session_management.php +│   ├── strings +│   │   ├── mb_string_fns.php +│   │   ├── string_facade.php +│   │   └── string_fns.php +│   ├── tag_matches.php +│   ├── time_zone_selection.php +│   ├── time_zones.php +│   ├── traits +│   │   ├── database +│   │   │   ├── run_sql.php +│   │   │   └── validation.php +│   │   ├── Macroable.php +│   │   └── security +│   │   ├── csrf_token_functions.php +│   │   └── session_hijacking_functions.php +│   ├── uuidv7.php +│   ├── validator.php +│   └── view.php +└── views + └── on_error + ├── 404_page.php + ├── dev_error.php + └── prod_error.php + +21 directories, 91 files + +# Project Dirs: +protedcted/src +├── aes +│   ├── config.aes +│   └── testing.aes +├── composer.json +├── composer.lock +├── configs +│   ├── off_redis.php +│   ├── off_remove_request_vars.php +│   ├── off_twilio.php +│   ├── on_CodeHydrater.php +│   ├── on_footer_banner.php +│   ├── on_html_purifier.php +│   ├── on_JWT.php +│   ├── on_liquid.php +│   ├── on_security.php +│   ├── on_sessions.php +│   ├── on_time_zone_set.php +│   ├── on_twig.php +│   ├── on_UTF8.php +│   └── on_view_mode.php +├── controllers +│   └── app +│   ├── cookie_ctrl.php +│   ├── home_ctrl.php +│   ├── jwt_ctrl.php +│   ├── rss_ctrl.php +│   └── twilio_ctrl.php +├── docs +│   ├── odt +│   └── pdfs +├── inputs +├── logic +├── models +├── outputs +├── routes +│   └── routes.php +├── secret_php_files +│   ├── config.php +│   └── testing.php +├── services +│   ├── off_test_db.php +│   ├── on_html_filter.php +│   ├── on_JSON_Tokens.php +│   ├── on_liquid.php +│   ├── on_log.php +│   ├── on_session_encryption.php +│   ├── on_twig.php +│   └── on_twilio_setup.php +├── templates +│   └── main.php +└── views + ├── default + │   └── app + │   ├── footer.php + │   ├── header.php + │   └── home_index.php + ├── liquid + │   └── app + │   └── liquid.tpl + └── twig + └── app + └── test.twig + +23 directories, 40 files + +/var/www/ProjectCodeHydrater/public/index.php (Entry Point) +public/assets/... \ No newline at end of file diff --git a/docs/Zephir_code.md b/docs/Zephir_code.md new file mode 100644 index 0000000..2213034 --- /dev/null +++ b/docs/Zephir_code.md @@ -0,0 +1,67 @@ +# Install the Project Files +First, see CodeHydrater.md file for install instructions for both the Framework & the Project files... then do: +``` +# Zephir source code files +Zephir/aes-license/hydraterlicense/hydraterlicense/ +├── keygenerator.zep +├── licensewriter.zep +└── makelicense.zep +Zephir/aes-loader/hydraterbootloader/hydraterbootloader/ +├── licenseverifier.zep +└── loader.zep + +2 directories, 5 files +``` +# Installing Zephir on DEV BOX ONLY +To INSTALL Zephir & Parser, see the websites: +https://github.com/zephir-lang/php-zephir-parser +https://docs.zephir-lang.com/latest/installation/ + +Follow their instructions, install/enable the Parser library for PHP, add to your php.ini files [NOTE: .so files are Linux..., .dll are Windows]: +[Zephir Parser] +extension=zephir_parser.so + +# Building the Extensions +``` +$ cd /usr/share/php/CodeHydrater/Zephir/aes-license/hydraterlicense +$ zephir build + +$ cd /usr/share/php/CodeHydrater/Zephir/aes-loader/hydraterbootloader +$ zephir build +``` +Note that Zephir compiles up to the current version of PHP you have installed, so beware of updates! + +## NOTES about Zephir extension files: +AS long as your PROD Environment has the same system Architecture IE 64bit Linux on AMD64... then copy the extension files from DEV to PROD... +## PROD will need: +zephir_parser and hydraterbootloader, to work for Encrypted Features to work. +If not using this then do not worry about zephir nor the bootloader... +## DEV will need: +Running Zephir gives you these Shared Object files, add them to your php.ini files (Examples: /etc/php/8.4/cli/php.ini and /etc/php/8.4/fpm/php.ini: +``` +[Zephir Parser] +extension=zephir_parser.so +extension=hydraterlicense.so +extension=hydraterbootloader.so +``` +# Update your Secret PHP Files on DEV BOX only +``` +$ cd /var/www/ProjectCodeHydrater/protected/src/secret_php_files +Each file should correspond with the Array_For_Files inside of make_license.php +Don't Ship these secret_php_files, they do not belong on PROD!!!! +``` +The .php file names [in secret_php_files folder] must match the .aes file names! +# Make a new License File and AES data +``` +$ cd /var/www/ProjectCodeHydrater/protected/cli +$ php make_license.php +``` +That will generate both keydata and aes files and folders! +#Do Ship to PROD the keydata and aes folders: +``` +/var/www/ProjectCodeHydrater/protected/keydata [Folder and files]. +/var/www/ProjectCodeHydrater/protected/src/aes [Folder and files]. +``` + +# Don't Ship the License Code +If you are crafty, and do not Want the Customer to have access to your AES encrypted Features... Do NOT share the extension hydraterlicense.so file, and remove any traces of source code in: Zephir/aes-license . As they allow one to generate licenses and features. \ No newline at end of file