This commit is contained in:
Bozhidar Slaveykov 2023-11-26 01:59:54 +02:00
parent fefd0c70f8
commit 6737744435
7 changed files with 29 additions and 12 deletions

View file

@ -1,7 +1,9 @@
name: Compile Phyre PHP Package name: Compile Phyre PHP Package
on: on:
release: push:
branches: [ "main" ]
pull_request:
branches: [ "main" ] branches: [ "main" ]
permissions: permissions:

View file

@ -6,6 +6,4 @@ Section: web
Maintainer: CloudVision Ltd. Maintainer: CloudVision Ltd.
Homepage: https://www.phyrepanel.com Homepage: https://www.phyrepanel.com
Architecture: amd64 Architecture: amd64
Depends: libzip4, unzip, libonig5 | libonig4 | libonig2
Conflct: libzip5
Description: Phyre Panel PHP SDK Description: Phyre Panel PHP SDK

View file

@ -15,13 +15,13 @@ cd php-8.2.0
sudo ./configure --prefix=/usr/local/phyre/php \ sudo ./configure --prefix=/usr/local/phyre/php \
--enable-fpm --with-fpm-user=admin --with-fpm-group=admin \ --enable-fpm --with-fpm-user=admin --with-fpm-group=admin \
# --with-libdir=lib/$(arch)-linux-gnu \ --with-openssl \
# --with-openssl \ --with-mysqli \
# --with-mysqli \ --with-gettext \
# --with-gettext \ --with-curl \
#--with-curl \ --with-zip
#--with-zip \
#--enable-mbstring #--enable-mbstring
# --with-libdir=lib/$(arch)-linux-gnu \
# Compile PHP # Compile PHP
sudo make sudo make

View file

@ -87,7 +87,7 @@ cp $MAIN_DIR/samples/sample-index.html /var/www/html/index.html
# Restart NGINX # Restart NGINX
systemctl 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 mkdir -p /usr/local/phyre/web
cp -r $MAIN_DIR/web/* /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 # Install Composer
cd /usr/local/phyre/web cd /usr/local/phyre/web
$PHYRE_PHP -v
$PHYRE_PHP -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" $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 -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');" $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 # Create database
PANEL_DB_NAME="phyredb" PANEL_DB_NAME="phyredb"

View file

@ -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