Forráskód Böngészése

chore: repo clean up, prepare for release

M1Screw 2 éve
szülő
commit
aa8dd77e36

+ 2 - 2
README.md

@@ -1,4 +1,4 @@
-<img src="public/images/uim-logo-round_192x192.png" alt="logo" width="192" height="192" align="left" />
+<img src="public/images/uim-logo-round_192x192.png" alt="logo" width="150" height="150" align="left" />
 
 <h1>SSPanel UIM</h1>
 
@@ -41,7 +41,7 @@ SSPanel UIM 的需要以下程序才能正常的安装和运行:
 - MariaDB 10.6+(关闭严格模式,不兼容 MySQL/Disable strict mode, DO NOT USE MYSQL)
 - Redis 7.0+
 
-我们推荐用户在开始使用之前至少有一定程度的 PHP 和 Linux 使用知识,能够至少正确识别使用中所出现的问题并在 issue 中提供所需的信息。
+我们推荐用户在开始使用之前有一定程度的 PHP 和 Linux 使用知识,能够至少正确识别使用中所出现的问题并在 issue 中提供所需的信息。
 
 对于拒绝阅读文档且拒绝提供任何反馈的,我们建议其使用其他非开源的方案。
 

+ 0 - 1
composer.json

@@ -36,7 +36,6 @@
         "smarty/smarty": "^4",
         "srmklive/paypal": "~3.0",
         "stripe/stripe-php": "^10",
-        "symfony/console": "*",
         "symfony/yaml": "^6",
         "tronovav/geoip2-update": "^2.1",
         "vectorface/googleauthenticator": "^3.0",

+ 1 - 1
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "544143e8d800119b070bee10560449b4",
+    "content-hash": "ecc7da4619d8760e9d1240cb2099a50c",
     "packages": [
         {
             "name": "anankke/omnipay-alipay",

+ 0 - 25
console

@@ -1,25 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-declare(strict_types=1);
-
-use App\Services\Boot;
-use Symfony\Component\Console\Application;
-
-require __DIR__ . '/app/predefine.php';
-require __DIR__ . '/vendor/autoload.php';
-require __DIR__ . '/config/.config.php';
-
-Boot::setTime();
-Boot::bootSentry();
-Boot::bootDb();
-
-$application = new Application();
-
-// ... register commands
-
-try {
-    $application->run();
-} catch (Exception $e) {
-    echo $e->getMessage();
-}

+ 0 - 53
install.sh

@@ -1,53 +0,0 @@
-#!/usr/bin/bash
-
-[ $(id -u) != "0" ] && { echo "Error: You must be root to run this script!"; exit 1; }
-
-do_install_sspanel() {
-    read -p "Please input root password of your Database server: " db_root_password
-    read -p "Please input db_host(127.0.0.1): " db_host
-    read -p "Please input db_database(sspanel): " db_database
-    read -p "Please input db_username(sspanel): " db_username
-    read -p "Please input db_password: " db_password
-    read -p "Please input key: " key
-    read -p "Please input appName(SSPanel-UIM): " app_name
-    read -p "Please input baseUrl(https://example.com): " base_url
-    read -p "Please input muKey(SSPanel): " mu_key
-
-    echo "Generating config files..."
-    cp config/.config.example.php config/.config.php
-    cp config/appprofile.example.php config/appprofile.php
-    echo "Installing Composer..."
-    wget https://getcomposer.org/installer -O composer.phar
-    php composer.phar
-    php composer.phar install --no-dev
-    echo "Writing configuration..."
-    sed -i -e "s/$_ENV['key']        = 'ChangeMe';/$_ENV['key']        = '$key';/g" \
-    -e "s/$_ENV['appName']    = 'SSPanel-UIM';/$_ENV['appName']    = '$app_name';/g" \
-    -e "s|$_ENV['baseUrl']    = 'https://example.com';|$_ENV['baseUrl']    = '$base_url';|g" \
-    -e "s/$_ENV['muKey']      = 'SSPanel';/$_ENV['muKey']      = '$mu_key';/g" \
-    -e "s/$_ENV['db_host']      = '';/$_ENV['db_host']      = '$db_host';/g" \
-    -e "s/$_ENV['db_database']  = 'sspanel';/$_ENV['db_database']  = '$db_database';/g" \
-    -e "s/$_ENV['db_username']  = 'root';/$_ENV['db_username']  = '$db_username';/g" \
-    -e "s/$_ENV['db_password']  = 'sspanel';/$_ENV['db_password']  = '$db_password';/g" \
-    config/.config.php
-    echo "Creating database and user..."
-    mysql -uroot -p $db_root_password \
-    -e "CREATE DATABASE $db_database CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-    CREATE USER '$db_username'@'localhost';
-    GRANT ALL PRIVILEGES ON $db_database.* TO '$db_username'@'localhost' IDENTIFIED BY '$db_password';
-    FLUSH PRIVILEGES;"
-    echo "Importing config to database..."
-    php xcat Migration new
-    php xcat Tool importAllSettings
-    current_dir=$(pwd)
-    crontab -l > cron.tmp
-    echo "*/5 * * * * /usr/bin/php $current_dir/xcat Cron" >> cron.tmp
-    crontab cron.tmp
-    rm cron.tmp
-    echo "Updating File Permission..."
-    chmod 755 -R *
-    chown www -R *
-    echo "Installation completed! Now you can create your first admin user by running 'php xcat createAdmin'."
-}
-
-do_install_sspanel

+ 1 - 0
public/index.php

@@ -36,4 +36,5 @@ $routes($app);
 
 $request = ServerRequest::fromGlobals();
 $request = new Slim\Http\ServerRequest($request);
+
 $app->run($request);

+ 0 - 0
resources/lang/en-US.json → resources/locale/en-US.json


+ 0 - 0
resources/lang/ja-JP.json → resources/locale/ja-JP.json


+ 0 - 0
resources/lang/zh-CN.json → resources/locale/zh-CN.json


+ 0 - 0
resources/lang/zh-TW.json → resources/locale/zh-TW.json


+ 2 - 0
src/Controllers/SubController.php

@@ -75,10 +75,12 @@ final class SubController extends BaseController
                 $sub_info,
             ]);
         }
+
         $sub_details = ' upload=' . $user->u
         . '; download=' . $user->d
         . '; total=' . $user->transfer_enable
         . '; expire=' . strtotime($user->class_expire);
+
         return $response->withHeader('Subscription-Userinfo', $sub_details)->write(
             $sub_info
         );

+ 2 - 2
update.sh

@@ -9,8 +9,6 @@ Usage:
 ./update.sh release $release_version $db_version --> Upgrade to the release version with the specified database version
 EOF
 
-[ $(id -u) != "0" ] && { echo "Error: You must be root to run this script!"; exit 1; }
-
 do_update_sspanel_dev(){
     git pull origin dev
     git reset --hard origin/dev
@@ -46,10 +44,12 @@ if [[ $1 == "release" ]]; then
         echo "Error: The release version cannot be empty!"
         exit 1
     fi
+
     if [[ $3 == "" ]]; then
         echo "Error: The database version cannot be empty!"
         exit 1
     fi
+
     do_update_sspanel_release $2 $3
     exit 0
 fi