From 67377444351829400ad29c34d0622201139b2ffb Mon Sep 17 00:00:00 2001 From: Bozhidar Slaveykov Date: Sun, 26 Nov 2023 01:59:54 +0200 Subject: [PATCH] update --- ...e-ngix-package.yml => compile-ngix-package.yml_} | 0 ...-php-package.yml.old => compile-php-package.yml} | 4 +++- compilators/debian/php/control | 2 -- compilators/debian/php/php-compile.sh | 12 ++++++------ installers/Ubuntu/22.04/install.sh | 10 +++++++--- installers/helpers/create-web-user.sh | 13 +++++++++++++ {web => installers/helpers}/sudo/phyreweb | 0 7 files changed, 29 insertions(+), 12 deletions(-) rename .github/workflows/{compile-ngix-package.yml => compile-ngix-package.yml_} (100%) rename .github/workflows/{compile-php-package.yml.old => compile-php-package.yml} (94%) create mode 100644 installers/helpers/create-web-user.sh rename {web => installers/helpers}/sudo/phyreweb (100%) diff --git a/.github/workflows/compile-ngix-package.yml b/.github/workflows/compile-ngix-package.yml_ similarity index 100% rename from .github/workflows/compile-ngix-package.yml rename to .github/workflows/compile-ngix-package.yml_ diff --git a/.github/workflows/compile-php-package.yml.old b/.github/workflows/compile-php-package.yml similarity index 94% rename from .github/workflows/compile-php-package.yml.old rename to .github/workflows/compile-php-package.yml index 26b1683..e1c9292 100644 --- a/.github/workflows/compile-php-package.yml.old +++ b/.github/workflows/compile-php-package.yml @@ -1,7 +1,9 @@ name: Compile Phyre PHP Package on: - release: + push: + branches: [ "main" ] + pull_request: branches: [ "main" ] permissions: diff --git a/compilators/debian/php/control b/compilators/debian/php/control index f6d906a..e402a5d 100644 --- a/compilators/debian/php/control +++ b/compilators/debian/php/control @@ -6,6 +6,4 @@ Section: web Maintainer: CloudVision Ltd. Homepage: https://www.phyrepanel.com Architecture: amd64 -Depends: libzip4, unzip, libonig5 | libonig4 | libonig2 -Conflct: libzip5 Description: Phyre Panel PHP SDK diff --git a/compilators/debian/php/php-compile.sh b/compilators/debian/php/php-compile.sh index eb06bc3..8c79a1d 100644 --- a/compilators/debian/php/php-compile.sh +++ b/compilators/debian/php/php-compile.sh @@ -15,13 +15,13 @@ cd php-8.2.0 sudo ./configure --prefix=/usr/local/phyre/php \ --enable-fpm --with-fpm-user=admin --with-fpm-group=admin \ -# --with-libdir=lib/$(arch)-linux-gnu \ -# --with-openssl \ -# --with-mysqli \ -# --with-gettext \ - #--with-curl \ - #--with-zip \ + --with-openssl \ + --with-mysqli \ + --with-gettext \ + --with-curl \ + --with-zip #--enable-mbstring + # --with-libdir=lib/$(arch)-linux-gnu \ # Compile PHP sudo make diff --git a/installers/Ubuntu/22.04/install.sh b/installers/Ubuntu/22.04/install.sh index 84647c6..783d647 100644 --- a/installers/Ubuntu/22.04/install.sh +++ b/installers/Ubuntu/22.04/install.sh @@ -87,7 +87,7 @@ cp $MAIN_DIR/samples/sample-index.html /var/www/html/index.html # Restart NGINX systemctl restart nginx -PHYRE_PHP="/usr/local/phyre/php/bin/php" +PHYRE_PHP=/usr/local/phyre/php/bin/php mkdir -p /usr/local/phyre/web cp -r $MAIN_DIR/web/* /usr/local/phyre/web @@ -96,12 +96,16 @@ cp $MAIN_DIR/web/.env.example /usr/local/phyre/web/.env.example # Install Composer cd /usr/local/phyre/web +$PHYRE_PHP -v $PHYRE_PHP -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" $PHYRE_PHP -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" -$PHYRE_PHP composer-setup.php +$PHYRE_PHP ./composer-setup.php $PHYRE_PHP -r "unlink('composer-setup.php');" -COMPOSER_ALLOW_SUPERUSER=1 $PHYRE_PHP composer.phar install --no-dev --optimize-autoloader --no-interaction +COMPOSER_ALLOW_SUPERUSER=1 $PHYRE_PHP ./composer.phar install --no-dev --optimize-autoloader --no-interaction + +ls +exit # Create database PANEL_DB_NAME="phyredb" diff --git a/installers/helpers/create-web-user.sh b/installers/helpers/create-web-user.sh new file mode 100644 index 0000000..63ee56f --- /dev/null +++ b/installers/helpers/create-web-user.sh @@ -0,0 +1,13 @@ +# Generate a random password +random_password="$(openssl rand -base64 32)" +email="email1@phyrepanel.com" + +# Create the new phyreweb user +/usr/sbin/useradd "phyreweb" -c "$email" --no-create-home + +# do not allow login into phyreweb user +echo phyreweb:$random_password | sudo chpasswd -e + +mkdir -p /etc/sudoers.d +cp -f /usr/local/phyre/web/sudo/phyreweb /etc/sudoers.d/ +chmod 440 /etc/sudoers.d/phyreweb diff --git a/web/sudo/phyreweb b/installers/helpers/sudo/phyreweb similarity index 100% rename from web/sudo/phyreweb rename to installers/helpers/sudo/phyreweb