Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobicloudvision committed Apr 22, 2024
1 parent bef4d98 commit a9d5fc3
Show file tree
Hide file tree
Showing 1,134 changed files with 42,316 additions and 1 deletion.
103 changes: 103 additions & 0 deletions .github/workflows/app-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Phyre Panel - Unit Test & Build
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
phyre-panel-unit-test:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
ref: ${{ github.sha }}

- name: Install Base
run: |
ls -la
sudo mkdir /phyre-panel
sudo cp installers/${{ matrix.os }}/install-partial/install_base.sh /phyre-panel/install_base.sh
sudo chmod +x /phyre-panel/install_base.sh
sudo /phyre-panel/install_base.sh
sudo cp installers/${{ matrix.os }}/install-partial/install_web.sh /phyre-panel/install_web.sh
sudo chmod +x /phyre-panel/install_web.sh
- name: Run Unit Test
run: |
sudo cp -r web /usr/local/phyre/web/
cd /usr/local/phyre/web/
ls -la
sudo wget https://getcomposer.org/download/latest-stable/composer.phar
sudo COMPOSER_ALLOW_SUPERUSER=1 phyre-php composer.phar install
sudo /phyre-panel/install_web.sh
sudo phyre-php artisan test
compile-phyre-web-panel:
runs-on: ubuntu-22.04
needs: phyre-panel-unit-test
steps:
- uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
- name: Npm install
uses: actions/setup-node@v3
with:
node-version: 16

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Install Composer Dependencies
working-directory: ./web
run: |
composer install
composer dump-autoload
- name: Install NODE Dependencies
working-directory: ./web
run: |
npm install
npm run build
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x

- name: Zip the files
working-directory: ./web
run: |
rm -rf .git
rm -rf .github
rm -rf .nmp
rm -rf node_modules
rm -rf .phpunit.cache
rm -rf vendor/composer/tmp-*.zip
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +
zip -r phyre-web-panel-build.zip `ls -A`
mkdir -p ../dist
mv ./phyre-web-panel-build.zip ../dist/phyre-web-panel.zip
- name: Pushes to Phyre Panel Dist Repo
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: './dist'
destination-github-username: 'CloudVisionApps'
destination-repository-name: 'PhyrePanelWebDist'
user-email: bobicloudvision@gmail.com
target-branch: main
66 changes: 66 additions & 0 deletions .github/workflows/compile-web-panel.yml.stop-for-now
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Compile Phyre Web Panel

on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
compile-phyre-web-panel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
- name: Npm install
uses: actions/setup-node@v3
with:
node-version: 16

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Install Composer Dependencies
working-directory: ./web
run: |
composer install
composer dump-autoload

- name: Install NODE Dependencies
working-directory: ./web
run: |
npm install
npm run build

- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x

- name: Zip the files
working-directory: ./web
run: |
rm -rf .git
rm -rf .github
rm -rf .nmp
rm -rf node_modules
rm -rf .phpunit.cache
rm -rf vendor/composer/tmp-*.zip
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +
zip -r phyre-web-panel-build.zip `ls -A`
mkdir -p ../dist
mv ./phyre-web-panel-build.zip ../dist/phyre-web-panel.zip

- name: Pushes to Phyre Panel Dist Repo
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: './dist'
destination-github-username: 'CloudVisionApps'
destination-repository-name: 'PhyrePanelWebDist'
user-email: bobicloudvision@gmail.com
target-branch: main
42 changes: 42 additions & 0 deletions .github/workflows/compile-web-terminal-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Compile Phyre Web Terminal Package

on:
workflow_dispatch:
push:
# Pattern matched against refs/tags
tags:
- '**'

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v3

- name: Compile WEB Terminal Package
run: |
cd compilators/debian/web-terminal
chmod 775 ./web-terminal-compile.sh
./web-terminal-compile.sh
ls
- name: Pushes to Phyre Panel Dist Repo
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: './compilators/debian/web-terminal/dist'
target-directory: './debian/web-terminal/dist'
destination-github-username: 'CloudVisionApps'
destination-repository-name: 'PhyrePanelWebTerminalDist'
user-email: bobicloudvision@gmail.com
target-branch: main
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
web/storage/installed
/docker/e2e-tests/node_modules/
compilators/
web/thirdparty/
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# PhyrePanel
# PHYRE - WEB HOSTING PANEL

![InstallScreen](screenshots/install-screen.png)
![Dashboard](screenshots/dashboard.png)

## Introduction
PhyrePanel is a web-based panel for linux. It is written in PHP and uses the Laravel framework.

## Installation
To install PhyrePanel, you need to run this commands:
```
wget https://raw.githubusercontent.com/CloudVisionApps/PhyrePanel/main/installers/install.sh && chmod +x install.sh && ./install.sh
```
The admin panel can be opened on port: yourserver.com:8443

## Features

### Server Applications
Apache + PHP 7.4, 8.0, 8.1, 8.3, 8.4

Apache + NGINX

Apache + Python

Apache + Ruby

### Databases
MySQL

SQLITE

Remote Database Connections

### UI/UX / Developing
Clean Admin Panel

Server Clustering

Easy Module Developing

## Join to our discord group
https://discord.gg/yfFWfrfwTZ

1 change: 1 addition & 0 deletions bin/apache-website-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ls
19 changes: 19 additions & 0 deletions bin/cron-job-add.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

username=$1
schedule=$2
command=$3

# Create a temporary file to hold the existing user's crontab
crontab -u $username -l > /tmp/temp_crontab

# Add a new cron job to the temporary file
echo "$schedule $command" >> /tmp/temp_crontab

# Install the modified crontab from the temporary file
crontab -u $username /tmp/temp_crontab

# Remove the temporary file
rm /tmp/temp_crontab

echo "done!"
10 changes: 10 additions & 0 deletions bin/cron-job-delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

username=$1
schedule=$2
command=$3

# Get the user's crontab, filter out the specific command and schedule, and install the updated crontab
crontab -u $username -l | grep -v -F "$schedule $command" | crontab -u $username -

echo "done!"
7 changes: 7 additions & 0 deletions bin/cron-jobs-list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Replace 'username' with the actual username you want to retrieve cron jobs for
username=$1

# Get the user's crontab entries and convert them to JSON
crontab -u $username -l | grep -v -e '^#' -e '^\s*$' | awk '{print "{\"schedule\":\"" $1 " " $2 " " $3 " " $4 " " $5 "\", \"command\":\"" substr($0, index($0,$6)) "\"}"}' | jq -s .
22 changes: 22 additions & 0 deletions bin/mysql-create-db-and-user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

echo "Creating MySQL user and database"

PASS=$3
if [ -z "$3" ]; then
PASS=`openssl rand -base64 8`
fi

mysql -u root <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$2'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$2'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT

echo "MySQL user and database created."
echo "Database: $1"
echo "Username: $2"
echo "Password: $PASS"
echo "Success!"

34 changes: 34 additions & 0 deletions bin/nginx-website-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

DOMAIN=$1
USER=$2

# Path to NGINX sites-available directory
SITES_AVAILABLE_DIR="/etc/nginx/sites-available"
SITES_ENABLED_DIR="/etc/nginx/sites-enabled"

# Create the site
SERVER_ROOT="/var/www/$DOMAIN/public_html"

cp -f /usr/local/phyre/samples/ubuntu/nginx.conf.sample $SITES_AVAILABLE_DIR/$DOMAIN.conf
ln -s $SITES_AVAILABLE_DIR/$DOMAIN.conf $SITES_ENABLED_DIR/$DOMAIN.conf

mkdir -p $SERVER_ROOT
chown -R www-data:www-data $SERVER_ROOT

# Replace the domain name in the NGINX config
sed -i "s/%SERVER_NAME%/${DOMAIN}/g" $SITES_AVAILABLE_DIR/$DOMAIN.conf
sed -i "s/%USER%/${USER}/g" $SITES_AVAILABLE_DIR/$DOMAIN.conf

SERVER_ROOT_ESCAPED=$(printf '%s\n' "$SERVER_ROOT" | sed -e 's/[\/&]/\\&/g')
sed -i "s#%SERVER_ROOT%#${SERVER_ROOT_ESCAPED}#g" $SITES_AVAILABLE_DIR/$DOMAIN.conf

cp -f /usr/local/phyre/samples/sample-website-index.html $SERVER_ROOT/index.html
sed -i "s/%DOMAIN%/${DOMAIN}/g" $SERVER_ROOT/index.html


# Reload NGINX
service nginx reload

echo "Created site $DOMAIN"
echo "done!"
16 changes: 16 additions & 0 deletions bin/nginx-website-delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Path to NGINX sites-available directory
SITES_AVAILABLE_DIR="/etc/nginx/sites-available"
SITES_ENABLED_DIR="/etc/nginx/sites-enabled"

# Delete the site
rm -rf $SITES_AVAILABLE_DIR/$1.conf
rm -rf $SITES_ENABLED_DIR/$1.conf
rm -rf /var/www/$1

# Reload NGINX
service nginx reload

echo "Deleted site $1"
echo "done!"
Loading

0 comments on commit a9d5fc3

Please sign in to comment.