dev #1
15
Dockerfile
15
Dockerfile
@@ -57,6 +57,21 @@ RUN composer install --no-dev --no-interaction --prefer-dist
|
|||||||
# Generate application key
|
# Generate application key
|
||||||
RUN php artisan key:generate || true
|
RUN php artisan key:generate || true
|
||||||
|
|
||||||
|
# Install yakpro-po for code obfuscation
|
||||||
|
RUN cd /tmp && \
|
||||||
|
git clone https://github.com/pk-fr/yakpro-po.git && \
|
||||||
|
cd yakpro-po && \
|
||||||
|
chmod +x yakpro-po.php
|
||||||
|
|
||||||
|
# Obfuscate application code (app directory only, preserve vendor)
|
||||||
|
RUN php /tmp/yakpro-po/yakpro-po.php \
|
||||||
|
--config-file /var/www/html/yakpro-po.cnf \
|
||||||
|
/var/www/html/app \
|
||||||
|
-o /var/www/html/app_obfuscated && \
|
||||||
|
rm -rf /var/www/html/app && \
|
||||||
|
mv /var/www/html/app_obfuscated /var/www/html/app && \
|
||||||
|
rm -rf /tmp/yakpro-po
|
||||||
|
|
||||||
# Run Laravel 5.0 optimization
|
# Run Laravel 5.0 optimization
|
||||||
RUN php artisan clear-compiled && php artisan optimize
|
RUN php artisan clear-compiled && php artisan optimize
|
||||||
|
|
||||||
|
|||||||
54
yakpro-po.cnf
Normal file
54
yakpro-po.cnf
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
// yakpro-po configuration for Laravel 5.0
|
||||||
|
|
||||||
|
$conf = new StdClass;
|
||||||
|
|
||||||
|
// Directories to obfuscate (relative to project root)
|
||||||
|
$conf->t_directories = [
|
||||||
|
'app'
|
||||||
|
];
|
||||||
|
|
||||||
|
// Directories/files to skip
|
||||||
|
$conf->t_skip = [
|
||||||
|
'vendor',
|
||||||
|
'storage',
|
||||||
|
'bootstrap',
|
||||||
|
'config',
|
||||||
|
'database',
|
||||||
|
'public',
|
||||||
|
'resources',
|
||||||
|
'tests',
|
||||||
|
'.env',
|
||||||
|
'.env.example',
|
||||||
|
'artisan',
|
||||||
|
'server.php'
|
||||||
|
];
|
||||||
|
|
||||||
|
// Obfuscation options
|
||||||
|
$conf->obfuscate_string_literal = false; // Don't obfuscate strings (can break Laravel)
|
||||||
|
$conf->obfuscate_function_name = true; // Obfuscate function names
|
||||||
|
$conf->obfuscate_class_name = true; // Obfuscate class names (except Laravel core)
|
||||||
|
$conf->obfuscate_variable_name = true; // Obfuscate variable names
|
||||||
|
$conf->obfuscate_property_name = true; // Obfuscate property names
|
||||||
|
$conf->obfuscate_class_constant_name = true;
|
||||||
|
$conf->obfuscate_constant_name = true;
|
||||||
|
$conf->obfuscate_namespace_name = false; // Keep namespaces readable
|
||||||
|
$conf->obfuscate_label_name = true;
|
||||||
|
|
||||||
|
// Keep Laravel framework methods/classes readable
|
||||||
|
$conf->t_ignore_constants = ['APP_ENV', 'APP_DEBUG', 'APP_URL', 'APP_KEY'];
|
||||||
|
$conf->t_ignore_methods = [
|
||||||
|
'__construct', '__destruct', '__call', '__get', '__set',
|
||||||
|
'boot', 'register', 'handle', 'middleware', 'authorize'
|
||||||
|
];
|
||||||
|
|
||||||
|
// Scrambler mode
|
||||||
|
$conf->scrambler = true;
|
||||||
|
|
||||||
|
// Allow multiple PHP versions
|
||||||
|
$conf->allow_and_operator = true;
|
||||||
|
|
||||||
|
// Output directory (will be overridden in command)
|
||||||
|
$conf->t_dir = null;
|
||||||
|
|
||||||
|
return $conf;
|
||||||
Reference in New Issue
Block a user