dir deploy_files...

main
Robert 2 years ago
parent 0e160e7786
commit 7cf13fed44
  1. 2
      .gitignore
  2. 2
      README.md
  3. 6
      app/just_testing.sh
  4. 12
      app/neato.php
  5. 5
      build/compile-phar.php
  6. 10
      build/install_neato.sh
  7. 2
      build/make-sums.sh
  8. 17
      build/view_phar_file_contents.php
  9. 0
      deploy_files/deploy_example.php
  10. 0
      deploy_files/deploy_mysql_ex1.php
  11. 0
      deploy_files/deploy_mysql_ex2.php
  12. 0
      deploy_files/deploy_podman.php
  13. 0
      deploy_files/deploy_security_audit.php
  14. 0
      deploy_files/deploy_ssh_client.php
  15. 0
      deploy_files/deploy_sshd.php
  16. 0
      deploy_files/deploy_test1.php
  17. 2
      make-installer.sh

2
.gitignore vendored

@ -1,4 +1,6 @@
vendor/ vendor/
app/deploy_files
sums/
run/*.lck run/*.lck
log/*.txt log/*.txt
*.pub *.pub

@ -38,4 +38,4 @@ $ sudo ./neato_deploy.sh security_audit
Note that deployment files are named with the prefix of deploy_ Note that deployment files are named with the prefix of deploy_
and end with .php, they must be a valid PHP script... and end with .php, they must be a valid PHP script...
A few example deployments are given from the config_files directory and will be extracted upon running the file: neato_deploy.tar.gz.self to the /opt/neatoDemployments ROOT DIR. A few example deployments are given from the deploy_files directory and will be extracted upon running the file: neato_deploy.tar.gz.self to the /opt/neatoDemployments ROOT DIR.

@ -0,0 +1,6 @@
#!/bin/bash
if [ ! -L deploy_files ]; then
ln -s ../deploy_files .
fi
php -c build/neatoDeploy.ini -f neato.php $@

@ -53,7 +53,7 @@ if (is_string_found($argv[1], 'http://') || is_string_found($argv[1], 'https://'
$file = str_replace(".txt", "", $file); $file = str_replace(".txt", "", $file);
clean_file_name($file); clean_file_name($file);
} }
\utils\curl::save($argv[1], "deploy_{$file}.php"); \utils\curl::save($argv[1], "/deploy_files/deploy_{$file}.php");
} }
function save_sha($shasum) { function save_sha($shasum) {
@ -63,7 +63,7 @@ function save_sha($shasum) {
function do_harm_checker($shasum) { function do_harm_checker($shasum) {
require 'neato_danger_checker.php'; require 'neato_danger_checker.php';
if ( is_file_dangerious($GLOBALS['cwd'] . '/deploy_' . $GLOBALS['file'].'.php') ) { if ( is_file_dangerious($GLOBALS['cwd'] . '/deploy_files/deploy_' . $GLOBALS['file'].'.php') ) {
if (! $GLOBALS['auto']) { if (! $GLOBALS['auto']) {
$answer = readline("Do you wish to execute this Script, anyways!! ? "); $answer = readline("Do you wish to execute this Script, anyways!! ? ");
if ( strtolower( trim($answer) ) === "yes" ) { if ( strtolower( trim($answer) ) === "yes" ) {
@ -76,9 +76,9 @@ function do_harm_checker($shasum) {
} }
/* Keep as last lines */ /* Keep as last lines */
if (file_exists($cwd . '/deploy_' . $file.'.php')) { if (file_exists($cwd . '/deploy_files/deploy_' . $file.'.php')) {
$check_for_harm = true; $check_for_harm = true;
$shasum = shasum($cwd . '/deploy_' . $file.'.php'); $shasum = shasum($cwd . '/deploy_files/deploy_' . $file.'.php');
if ($shasum === false) { if ($shasum === false) {
echo "Unable to SHA sum script!"; echo "Unable to SHA sum script!";
exit(1); exit(1);
@ -111,9 +111,9 @@ if (file_exists($cwd . '/deploy_' . $file.'.php')) {
do_harm_checker($shasum); do_harm_checker($shasum);
} }
require($cwd . '/deploy_' . $file.'.php'); require($cwd . '/deploy_files/deploy_' . $file.'.php');
} else { } else {
echo 'PHP Script deploy_'. $file . '.php does not exist!!' . PHP_EOL; echo 'PHP Script deploy_files/deploy_'. $file . '.php does not exist!!' . PHP_EOL;
exit(1); exit(1);
} }

@ -21,7 +21,10 @@ $phar->startBuffering();
$defaultStub = $phar->createDefaultStub('neato.php'); $defaultStub = $phar->createDefaultStub('neato.php');
// Add the rest of the apps files // Add the rest of the apps files
$phar->buildFromDirectory(__DIR__ . '/../app'); $phar->buildFromDirectory(
__DIR__ . '/../app', // Base APP folder
'/\.php$/', // Regular expression to include only PHP files
);
// Customize the stub to add the shebang // Customize the stub to add the shebang
$stub = "\n" . $defaultStub; $stub = "\n" . $defaultStub;

@ -16,13 +16,13 @@ if [ "$current_directory" == "$target_directory" ]; then
exit 1 exit 1
fi fi
/usr/bin/mkdir -p /opt/neatoDeployments /usr/bin/mkdir -p /opt/neatoDeployments/deploy_files
/usr/bin/mv neato_deploy_php_cli.ini /opt/neatoDeployments/ /usr/bin/mv neato_deploy_php_cli.ini /opt/neatoDeployments/
/usr/bin/mv neatoDeploy.phar /opt/neatoDeployments/ /usr/bin/mv neatoDeploy.phar /opt/neatoDeployments/
/usr/bin/mv neato_deploy.sh /opt/neatoDeployments/ /usr/bin/mv neato_deploy.sh /opt/neatoDeployments/
/usr/bin/mv make-sums.sh /opt/neatoDeployments/ /usr/bin/mv make-sums.sh /opt/neatoDeployments/
/usr/bin/mv config_files/deploy_*.php /opt/neatoDeployments/ /usr/bin/mv deploy_files/deploy_*.php /opt/neatoDeployments/deploy_files/
/usr/bin/rmdir config_files /usr/bin/rmdir deploy_files
pushd /opt/neatoDeployments pushd /opt/neatoDeployments
@ -35,13 +35,13 @@ pushd /opt/neatoDeployments
/usr/bin/chown www-data:www-data neato* /usr/bin/chown www-data:www-data neato*
/usr/bin/chown www-data:www-data make-sums.sh /usr/bin/chown www-data:www-data make-sums.sh
/usr/bin/chown www-data:www-data deploy_*.php /usr/bin/chown -R www-data:www-data deploy_files
/usr/bin/chmod 775 neatoDeploy.phar /usr/bin/chmod 775 neatoDeploy.phar
/usr/bin/chmod 775 neato_deploy.sh /usr/bin/chmod 775 neato_deploy.sh
/usr/bin/chmod 775 make-sums.sh /usr/bin/chmod 775 make-sums.sh
/usr/bin/chmod 664 neato_deploy_php_cli.ini /usr/bin/chmod 664 neato_deploy_php_cli.ini
/usr/bin/chmod 664 deploy_*.php /usr/bin/chmod 664 deploy_files/deploy_*.php
popd popd

@ -2,7 +2,7 @@
if [ ! -d sums ]; then if [ ! -d sums ]; then
mkdir sums mkdir sums
fi fi
for file in deploy_*.php; do for file in deploy_files/deploy_*.php; do
if [ -f "$file" ]; then if [ -f "$file" ]; then
echo -e "Making sum file for: $file \r\n" echo -e "Making sum file for: $file \r\n"

@ -0,0 +1,17 @@
<?php
$pharFile = 'neatoDeploy.phar';
try {
$phar = new Phar($pharFile);
// Get the iterator for the Phar archive
$iterator = new RecursiveIteratorIterator($phar);
// Iterate through the contents
foreach ($iterator as $file) {
echo $file->getPathname() . PHP_EOL;
}
} catch (PharException $e) {
echo "Error reading Phar archive: " . $e->getMessage();
}

@ -5,7 +5,7 @@ pushd build
/usr/bin/chmod +x install_neato.sh /usr/bin/chmod +x install_neato.sh
TAR_FILE=neato_deploy.tar.gz TAR_FILE=neato_deploy.tar.gz
/usr/bin/tar -czvf $TAR_FILE install_neato.sh make-sums.sh neatoDeploy.phar neato_deploy_php_cli.ini neato_deploy.sh ../config_files/deploy_*.php /usr/bin/tar -czvf $TAR_FILE install_neato.sh make-sums.sh neatoDeploy.phar neato_deploy_php_cli.ini neato_deploy.sh ../deploy_files/deploy_*.php
EXIT_COMMAND="./install_neato.sh" EXIT_COMMAND="./install_neato.sh"

Loading…
Cancel
Save