Compare commits

..

1 Commits

Author SHA1 Message Date
qkqpttgf d21abf12df
Update common.php 2022-05-29 12:22:00 +08:00
26 changed files with 2090 additions and 5994 deletions

View File

@ -1,7 +1,3 @@
language = "php74"
run = "php -S 0.0.0.0:8000 index.php"
entrypoint = "index.php"
[nix]
channel = "stable-22_11"
[deployment]
run = ["sh", "-c", "php -S 0.0.0.0:8000 index.php"]
deploymentTarget = "cloudrun"

1215
common.php

File diff suppressed because it is too large Load Diff

View File

@ -9,10 +9,7 @@ class Aliyundrive {
//$this->auth_url = 'https://websv.aliyundrive.com/token/refresh';
$this->auth_url = 'https://auth.aliyundrive.com/v2/account/token';
$this->api_url = 'https://api.aliyundrive.com/v2';
$this->api_url_v3 = 'https://api.aliyundrive.com/adrive/v3';
$this->driveId = getConfig('driveId', $tag);
//$this->DownurlStrName = 'download_url';
$this->DownurlStrName = 'url';
$res = $this->get_access_token(getConfig('refresh_token', $tag));
}
@ -53,7 +50,7 @@ class Aliyundrive {
$tmp['time'] = $files['updated_at'];
$tmp['size'] = $files['size'];
$tmp['mime'] = $files['file']['mimeType'];
$tmp['url'] = $files[$this->DownurlStrName];
$tmp['url'] = $files['download_url'];
$tmp['content'] = $files['content'];
if (isset($files['exist'])) $tmp['exist'] = $files['exist'];
if (isset($files['rapid_upload'])) $tmp['rapid_upload'] = $files['rapid_upload'];
@ -69,7 +66,7 @@ class Aliyundrive {
$filename = strtolower($file['name']);
if ($file['type']=='file') {
$tmp['list'][$filename]['type'] = 'file';
$tmp['list'][$filename]['url'] = $file[$this->DownurlStrName];
$tmp['list'][$filename]['url'] = $file['download_url'];
$tmp['list'][$filename]['mime'] = $file['file']['content_type'];
} elseif ($file['type']=='folder') {
$tmp['list'][$filename]['type'] = 'folder';
@ -125,7 +122,7 @@ class Aliyundrive {
if (!(isset($files['content'])&&$files['content']['stat']==200)) {
$header['Referer'] = 'https://www.aliyundrive.com/';
$header['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36';
$content1 = curl('GET', $files[$this->DownurlStrName], '', $header);
$content1 = curl('GET', $files['download_url'], '', $header);
$tmp = null;
$tmp = json_decode(json_encode($content1), true);
if ($tmp['body']===null) {
@ -185,7 +182,7 @@ class Aliyundrive {
}
protected function fileList($parent_file_id)
{
$url = $this->api_url_v3 . '/file/list';
$url = $this->api_url . '/file/list';
$header["content-type"] = "application/json; charset=utf-8";
$header['authorization'] = 'Bearer ' . $this->access_token;
@ -348,7 +345,7 @@ class Aliyundrive {
$r = bchexdec( substr(md5($this->access_token), 0, 16) );
$o = bcmod($r, $oldfile['size']);
}
$res = curl('GET', $oldfile[$this->DownurlStrName], '', [
$res = curl('GET', $oldfile['download_url'], '', [
'Referer' => ''
, 'Range' => 'bytes=' . $o . '-' . ($o+7)
]);
@ -629,7 +626,7 @@ class Aliyundrive {
}
$res = json_decode($result['body'], true);
//if (isset($res['url']))
$res[$this->DownurlStrName] = $_SERVER['host'] . path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . $filename);
$res['download_url'] = $_SERVER['host'] . path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . $filename);
}
return output(json_encode($this->files_format($res), JSON_UNESCAPED_SLASHES), $result['stat']);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,6 @@
<?php
//error_reporting(E_ALL & ~E_NOTICE);
error_reporting(0);
include 'vendor/autoload.php';
include 'conststr.php';
include 'common.php';
@ -9,46 +8,18 @@ include 'common.php';
date_default_timezone_set('UTC');
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
//echo '<pre>'. json_encode($_ENV, JSON_PRETTY_PRINT).'</pre>';
global $platform;
$platform = checkPlatform();
function checkPlatform() {
if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud')
return 'SCF';
if (isset($_SERVER['FC_FUNC_CODE_PATH']))
return 'FC';
if (isset($_SERVER['RUNTIME_LOG_PATH']) && $_SERVER['RUNTIME_LOG_PATH']=='/home/snuser/log')
return 'FG';
if (isset($_SERVER['BCE_CFC_RUNTIME_NAME']) && $_SERVER['BCE_CFC_RUNTIME_NAME']=='php7')
return 'CFC';
if (isset($_SERVER['HEROKU_APP_DIR'])&&$_SERVER['HEROKU_APP_DIR']==='/app')
return 'Heroku';
if (isset($_SERVER['DOCUMENT_ROOT'])&&$_SERVER['DOCUMENT_ROOT']==='/var/task/user')
return 'Vercel';
if (isset($_SERVER['DOCUMENT_ROOT'])&&substr($_SERVER['DOCUMENT_ROOT'], 0, 13)==='/home/runner/')
return 'Replit';
return 'Normal';
}
function writebackPlatform($p) {
if ('SCF'==$p) $_SERVER['USER']='qcloud';
if ('FC'==$p) $_SERVER['FC_FUNC_CODE_PATH']=getenv('FC_FUNC_CODE_PATH');
if ('FG'==$p) $_SERVER['RUNTIME_LOG_PATH']='/home/snuser/log';
if ('CFC'==$p) $_SERVER['BCE_CFC_RUNTIME_NAME']='php7';
//if ('Heroku'==$p) $_SERVER['HEROKU_APP_DIR']='/app';
if ('Vercel'==$p) $_SERVER['DOCUMENT_ROOT']='/var/task/user';
//if ('Replit'==$p) $_SERVER['DOCUMENT_ROOT']='/home/runner/';
}
if ('SCF'==$platform) {
if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
if (getenv('ONEMANAGER_CONFIG_SAVE')=='file') include 'platform/TencentSCF_file.php';
else include 'platform/TencentSCF_env.php';
} elseif ('FC'==$platform) {
} elseif (isset($_SERVER['FC_FUNC_CODE_PATH'])) {
include 'platform/AliyunFC.php';
} elseif ('FG'==$platform) {
} elseif (isset($_SERVER['_APP_SHARE_DIR']) && $_SERVER['_APP_SHARE_DIR']=='/var/share/CFF/processrouter') {
//if (getenv('ONEMANAGER_CONFIG_SAVE')=='file') include 'platform/HuaweiFG_file.php';
//else include 'platform/HuaweiFG_env.php';
echo 'FG' . PHP_EOL;
} elseif ('CFC'==$platform) {
} elseif (isset($_SERVER['BCE_CFC_RUNTIME_NAME']) && $_SERVER['BCE_CFC_RUNTIME_NAME']=='php7') {
include 'platform/BaiduCFC.php';
} elseif ('Heroku'==$platform) {
} elseif (isset($_SERVER['HEROKU_APP_DIR'])&&$_SERVER['HEROKU_APP_DIR']==='/app') {
include 'platform/Heroku.php';
$path = getpath();
//echo 'path:'. $path;
@ -62,11 +33,9 @@ if ('SCF'==$platform) {
http_response_code($re['statusCode']);
if ($re['isBase64Encoded']) echo base64_decode($re['body']);
else echo $re['body'];
} elseif ('Vercel'==$platform) {
} elseif (isset($_SERVER['DOCUMENT_ROOT'])&&$_SERVER['DOCUMENT_ROOT']==='/var/task/user') {
if (getenv('ONEMANAGER_CONFIG_SAVE')=='env') include 'platform/Vercel_env.php';
else include 'platform/Vercel.php';
writebackPlatform('Vercel');
$path = getpath();
//echo 'path:'. $path;
$_GET = getGET();
@ -79,7 +48,7 @@ if ('SCF'==$platform) {
http_response_code($re['statusCode']);
if ($re['isBase64Encoded']) echo base64_decode($re['body']);
else echo $re['body'];
} elseif ('Replit'==$platform) {
} elseif (isset($_SERVER['DOCUMENT_ROOT'])&&substr($_SERVER['DOCUMENT_ROOT'], 0, 13)==='/home/runner/') {
include 'platform/Replit.php';
$path = getpath();
@ -129,7 +98,6 @@ function main_handler($event, $context)
unset($_GET);
unset($_COOKIE);
unset($_SERVER);
writebackPlatform('SCF');
GetGlobalVariable($event);
//echo '<pre>'. json_encode($_COOKIE, JSON_PRETTY_PRINT).'</pre>';
$path = GetPathSetting($event, $context);
@ -140,8 +108,7 @@ function main_handler($event, $context)
// Aliyun FC & Huawei FG & Baidu CFC
function handler($event, $context)
{
global $platform;
if ('FC'==$platform) {
if (isset($_SERVER['FC_FUNC_CODE_PATH'])) {
// Aliyun FC
set_error_handler("myErrorHandler");
$tmp = array(
@ -160,7 +127,6 @@ function handler($event, $context)
unset($_GET);
unset($_COOKIE);
unset($_SERVER);
writebackPlatform('FC');
GetGlobalVariable($event);
$path = GetPathSetting($event, $context);
@ -168,7 +134,7 @@ function handler($event, $context)
return new RingCentral\Psr7\Response($re['statusCode'], $re['headers'], ($re['isBase64Encoded']?base64_decode($re['body']):$re['body']));
} elseif ('FG'==$platform) {
} elseif ($_SERVER['_APP_SHARE_DIR']=='/var/share/CFF/processrouter') {
// Huawei FG
global $contextUserData;
$contextUserData = $context;
@ -183,14 +149,13 @@ function handler($event, $context)
unset($_GET);
unset($_COOKIE);
unset($_SERVER);
writebackPlatform('FG');
GetGlobalVariable($event);
//echo '<pre>'. json_encode($_COOKIE, JSON_PRETTY_PRINT).'</pre>';
$path = GetPathSetting($event, $context);
return main($path);
} elseif ('CFC'==$platform) {
} elseif ($_SERVER['BCE_CFC_RUNTIME_NAME']=='php7') {
// Baidu CFC
//$html = '<pre>'. json_encode($event, JSON_PRETTY_PRINT).'</pre>';
//$html .= '<pre>'. json_encode($context, JSON_PRETTY_PRINT).'</pre>';
@ -204,7 +169,6 @@ function handler($event, $context)
unset($_GET);
unset($_COOKIE);
unset($_SERVER);
writebackPlatform('CFC');
GetGlobalVariable($event);
//echo '<pre>'. json_encode($_COOKIE, JSON_PRETTY_PRINT).'</pre>';
$path = GetPathSetting($event, $context);

File diff suppressed because it is too large Load Diff

1
js/spark-md5.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -67,6 +67,7 @@ function GetPathSetting($event, $context)
$_SERVER['host'] = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
$_SERVER['referhost'] = explode('/', $event['headers']['Referer'][0])[2];
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['If-Modified-Since'][0];
$_SERVER['FC_FUNC_CODE_PATH'] = getenv('FC_FUNC_CODE_PATH');
$_SERVER['REQUEST_METHOD'] = $event['method'];
return $path;
//return spurlencode($path, '/');

View File

@ -6,7 +6,7 @@ global $contextUserData;
function printInput($event, $context)
{
$tmp['RequestID'] = $context->getRequestID();
$tmp['eventID'] = $context->geteventID();
$tmp['RemainingTimeInMilliSeconds'] = $context->getRemainingTimeInMilliSeconds();
$tmp['AccessKey'] = $context->getAccessKey();
$tmp['SecretKey'] = $context->getSecretKey();
@ -17,7 +17,7 @@ function printInput($event, $context)
$tmp['MemorySize'] = $context->getMemorySize();
$tmp['CPUNumber'] = $context->getCPUNumber();
$tmp['ProjectID'] = $context->getProjectID();
$tmp['Package'] = $context->getPackage();
$tmp['Package'] = $context->Package();
$tmp['Token'] = $context->getToken();
$tmp['Logger'] = $context->getLogger();
@ -51,13 +51,13 @@ function GetPathSetting($event, $context)
$_SERVER['ProjectID'] = $context->getProjectID();
$host_name = $event['headers']['host'];
$_SERVER['HTTP_HOST'] = $host_name;
$path = path_format('/' . $event['pathParameters']['']);
$path = path_format($event['pathParameters'][''].'/');
$path = str_replace('+', '%2B', $path);
$_SERVER['base_path'] = path_format($event['path']);
$_SERVER['base_path'] = path_format($event['path'].'/');
if ( $_SERVER['base_path'] == $path ) {
$_SERVER['base_path'] = '/';
} else {
$_SERVER['base_path'] = substr($_SERVER['base_path'], 0, strlen($_SERVER['base_path'])-strlen($path));
$_SERVER['base_path'] = substr($_SERVER['base_path'], 0, -strlen($path));
if ($_SERVER['base_path']=='') $_SERVER['base_path'] = '/';
}
//$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
@ -75,6 +75,7 @@ function GetPathSetting($event, $context)
$_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['if-modified-since'];
$_SERVER['REQUEST_METHOD'] = $event['httpMethod'];
$_SERVER['_APP_SHARE_DIR'] = '/var/share/CFF/processrouter';
return $path;
}

View File

@ -6,7 +6,7 @@ global $contextUserData;
function printInput($event, $context)
{
$tmp['RequestID'] = $context->getRequestID();
$tmp['eventID'] = $context->geteventID();
$tmp['RemainingTimeInMilliSeconds'] = $context->getRemainingTimeInMilliSeconds();
$tmp['AccessKey'] = $context->getAccessKey();
$tmp['SecretKey'] = $context->getSecretKey();
@ -17,7 +17,7 @@ function printInput($event, $context)
$tmp['MemorySize'] = $context->getMemorySize();
$tmp['CPUNumber'] = $context->getCPUNumber();
$tmp['ProjectID'] = $context->getProjectID();
$tmp['Package'] = $context->getPackage();
$tmp['Package'] = $context->Package();
$tmp['Token'] = $context->getToken();
$tmp['Logger'] = $context->getLogger();
@ -51,13 +51,13 @@ function GetPathSetting($event, $context)
$_SERVER['ProjectID'] = $context->getProjectID();
$host_name = $event['headers']['host'];
$_SERVER['HTTP_HOST'] = $host_name;
$path = path_format('/' . $event['pathParameters']['']);
$path = path_format($event['pathParameters'][''].'/');
$path = str_replace('+', '%2B', $path);
$_SERVER['base_path'] = path_format($event['path']);
$_SERVER['base_path'] = path_format($event['path'].'/');
if ( $_SERVER['base_path'] == $path ) {
$_SERVER['base_path'] = '/';
} else {
$_SERVER['base_path'] = substr($_SERVER['base_path'], 0, strlen($_SERVER['base_path'])-strlen($path));
$_SERVER['base_path'] = substr($_SERVER['base_path'], 0, -strlen($path));
if ($_SERVER['base_path']=='') $_SERVER['base_path'] = '/';
}
//$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
@ -75,6 +75,7 @@ function GetPathSetting($event, $context)
$_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['if-modified-since'];
$_SERVER['REQUEST_METHOD'] = $event['httpMethod'];
$_SERVER['_APP_SHARE_DIR'] = '/var/share/CFF/processrouter';
return $path;
}

View File

@ -4,7 +4,7 @@ function getpath()
{
$_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($_SERVER['HTTP_ACCEPT_LANGUAGE'],';')[0],',')[0]);
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
if (isset($_SERVER['HTTP_FLY_CLIENT_IP'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_FLY_CLIENT_IP']; // Glitch
if (isset($_SERVER['HTTP_FLY_CLIENT_IP'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_FLY_CLIENT_IP'];
if ($_SERVER['HTTP_FLY_FORWARDED_PROTO']!='') $_SERVER['REQUEST_SCHEME'] = $_SERVER['HTTP_FLY_FORWARDED_PROTO'];
if ($_SERVER['HTTP_X_FORWARDED_PROTO']!='') {
$tmp = explode(',', $_SERVER['HTTP_X_FORWARDED_PROTO'])[0];

View File

@ -60,6 +60,7 @@ function GetPathSetting($event, $context)
$_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['if-modified-since'];
$_SERVER['REQUEST_METHOD'] = $event['httpMethod'];
$_SERVER['USER'] = 'qcloud';
return $path;
}

View File

@ -60,6 +60,7 @@ function GetPathSetting($event, $context)
$_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['if-modified-since'];
$_SERVER['REQUEST_METHOD'] = $event['httpMethod'];
$_SERVER['USER'] = 'qcloud';
return $path;
}

View File

@ -1,29 +1,32 @@
<?php
// https://vercel.com/docs/api#endpoints/deployments/create-a-new-deployment
function getpath() {
$_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($_SERVER['HTTP_ACCEPT_LANGUAGE'], ';')[0], ',')[0]);
function getpath()
{
$_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($_SERVER['HTTP_ACCEPT_LANGUAGE'],';')[0],',')[0]);
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
if (isset($_SERVER['HTTP_FLY_CLIENT_IP'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_FLY_CLIENT_IP'];
if ($_SERVER['REQUEST_SCHEME'] != 'http' && $_SERVER['REQUEST_SCHEME'] != 'https') {
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] != '') {
if ($_SERVER['REQUEST_SCHEME']!='http'&&$_SERVER['REQUEST_SCHEME']!='https') {
if ($_SERVER['HTTP_X_FORWARDED_PROTO']!='') {
$tmp = explode(',', $_SERVER['HTTP_X_FORWARDED_PROTO'])[0];
if ($tmp == 'http' || $tmp == 'https') $_SERVER['REQUEST_SCHEME'] = $tmp;
if ($tmp=='http'||$tmp=='https') $_SERVER['REQUEST_SCHEME'] = $tmp;
}
if ($_SERVER['HTTP_FLY_FORWARDED_PROTO'] != '') $_SERVER['REQUEST_SCHEME'] = $_SERVER['HTTP_FLY_FORWARDED_PROTO'];
if ($_SERVER['HTTP_FLY_FORWARDED_PROTO']!='') $_SERVER['REQUEST_SCHEME'] = $_SERVER['HTTP_FLY_FORWARDED_PROTO'];
}
$_SERVER['host'] = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
$_SERVER['referhost'] = explode('/', $_SERVER['HTTP_REFERER'])[2];
$_SERVER['base_path'] = "/";
if (isset($_SERVER['UNENCODED_URL'])) $_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];
$p = strpos($_SERVER['REQUEST_URI'], '?');
if ($p > 0) $path = substr($_SERVER['REQUEST_URI'], 0, $p);
$p = strpos($_SERVER['REQUEST_URI'],'?');
if ($p>0) $path = substr($_SERVER['REQUEST_URI'], 0, $p);
else $path = $_SERVER['REQUEST_URI'];
$path = path_format(substr($path, strlen($_SERVER['base_path'])));
$path = path_format( substr($path, strlen($_SERVER['base_path'])) );
$_SERVER['DOCUMENT_ROOT'] = '/var/task/user';
return $path;
}
function getGET() {
function getGET()
{
if (!$_POST) {
if (!!$HTTP_RAW_POST_DATA) {
$tmpdata = $HTTP_RAW_POST_DATA;
@ -33,20 +36,20 @@ function getGET() {
if (!!$tmpdata) {
$postbody = explode("&", $tmpdata);
foreach ($postbody as $postvalues) {
$pos = strpos($postvalues, "=");
$_POST[urldecode(substr($postvalues, 0, $pos))] = urldecode(substr($postvalues, $pos + 1));
$pos = strpos($postvalues,"=");
$_POST[urldecode(substr($postvalues,0,$pos))]=urldecode(substr($postvalues,$pos+1));
}
}
}
if (isset($_SERVER['UNENCODED_URL'])) $_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];
$p = strpos($_SERVER['REQUEST_URI'], '?');
if ($p > 0) {
$getstr = substr($_SERVER['REQUEST_URI'], $p + 1);
$getstrarr = explode("&", $getstr);
$p = strpos($_SERVER['REQUEST_URI'],'?');
if ($p>0) {
$getstr = substr($_SERVER['REQUEST_URI'], $p+1);
$getstrarr = explode("&",$getstr);
foreach ($getstrarr as $getvalues) {
if ($getvalues != '') {
$pos = strpos($getvalues, "=");
//echo $pos;
//echo $pos;
if ($pos > 0) {
$getarry[urldecode(substr($getvalues, 0, $pos))] = urldecode(substr($getvalues, $pos + 1));
} else {
@ -62,15 +65,16 @@ function getGET() {
}
}
function getConfig($str, $disktag = '') {
function getConfig($str, $disktag = '')
{
$projectPath = splitlast(__DIR__, '/')[0];
$configPath = $projectPath . '/.data/config.php';
$s = file_get_contents($configPath);
$configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}';
if ($configs != '') {
if ($configs!='') {
$envs = json_decode($configs, true);
if (isInnerEnv($str)) {
if ($disktag == '') $disktag = $_SERVER['disktag'];
if ($disktag=='') $disktag = $_SERVER['disktag'];
if (isset($envs[$disktag][$str])) {
if (isBase64Env($str)) return base64y_decode($envs[$disktag][$str]);
else return $envs[$disktag][$str];
@ -85,14 +89,15 @@ function getConfig($str, $disktag = '') {
return '';
}
function setConfig($arr, $disktag = '') {
if ($disktag == '') $disktag = $_SERVER['disktag'];
function setConfig($arr, $disktag = '')
{
if ($disktag=='') $disktag = $_SERVER['disktag'];
$projectPath = splitlast(__DIR__, '/')[0];
$configPath = $projectPath . '/.data/config.php';
$s = file_get_contents($configPath);
$configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}';
if ($configs != '') $envs = json_decode($configs, true);
$disktags = explode("|", getConfig('disktag'));
if ($configs!='') $envs = json_decode($configs, true);
$disktags = explode("|",getConfig('disktag'));
$indisk = 0;
$operatedisk = 0;
foreach ($arr as $k => $v) {
@ -103,20 +108,20 @@ function setConfig($arr, $disktag = '') {
if (isBase64Env($k)) $envs[$disktag][$k] = base64y_encode($v);
else $envs[$disktag][$k] = $v;
$indisk = 1;
} elseif ($k == 'disktag_add') {
} elseif ($k=='disktag_add') {
array_push($disktags, $v);
$operatedisk = 1;
} elseif ($k == 'disktag_del') {
$disktags = array_diff($disktags, [$v]);
} elseif ($k=='disktag_del') {
$disktags = array_diff($disktags, [ $v ]);
$envs[$v] = '';
$operatedisk = 1;
} elseif ($k == 'disktag_copy') {
} elseif ($k=='disktag_copy') {
$newtag = $v . '_' . date("Ymd_His");
$envs[$newtag] = $envs[$v];
array_push($disktags, $newtag);
$operatedisk = 1;
} elseif ($k == 'disktag_rename' || $k == 'disktag_newname') {
if ($arr['disktag_rename'] != $arr['disktag_newname']) $operatedisk = 1;
} elseif ($k=='disktag_rename' || $k=='disktag_newname') {
if ($arr['disktag_rename']!=$arr['disktag_newname']) $operatedisk = 1;
} else {
$envs[$k] = $v;
}
@ -128,10 +133,10 @@ function setConfig($arr, $disktag = '') {
$envs[$disktag] = $diskconfig;
}
if ($operatedisk) {
if (isset($arr['disktag_newname']) && $arr['disktag_newname'] != '') {
if (isset($arr['disktag_newname']) && $arr['disktag_newname']!='') {
$tags = [];
foreach ($disktags as $tag) {
if ($tag == $arr['disktag_rename']) array_push($tags, $arr['disktag_newname']);
if ($tag==$arr['disktag_rename']) array_push($tags, $arr['disktag_newname']);
else array_push($tags, $tag);
}
$envs['disktag'] = implode('|', $tags);
@ -139,9 +144,8 @@ function setConfig($arr, $disktag = '') {
$envs[$arr['disktag_rename']] = '';
} else {
$disktags = array_unique($disktags);
$disktag_s = "";
foreach ($disktags as $disktag) if ($disktag != '') $disktag_s .= $disktag . '|';
if ($disktag_s != '') $envs['disktag'] = substr($disktag_s, 0, -1);
foreach ($disktags as $disktag) if ($disktag!='') $disktag_s .= $disktag . '|';
if ($disktag_s!='') $envs['disktag'] = substr($disktag_s, 0, -1);
else $envs['disktag'] = '';
}
}
@ -153,10 +157,11 @@ function setConfig($arr, $disktag = '') {
return setVercelConfig($envs, getConfig('HerokuappId'), getConfig('APIKey'));
}
function install() {
function install()
{
global $constStr;
if ($_GET['install1']) {
if ($_POST['admin'] != '') {
if ($_POST['admin']!='') {
$tmp['admin'] = $_POST['admin'];
//$tmp['language'] = $_POST['language'];
$tmp['timezone'] = $_COOKIE['timezone'];
@ -171,14 +176,8 @@ function install() {
$header["Content-Type"] = "application/json";
$aliases = json_decode(curl("GET", "https://api.vercel.com/v3/now/aliases", "", $header)['body'], true);
$host = splitfirst($_SERVER["host"], "//")[1];
$aliases1 = [];
foreach ($aliases["aliases"] as $key => $aliase) {
$aliases1[] = $aliase["alias"];
if ($host == $aliase["alias"]) $projectId = $aliase["projectId"];
}
if (!$projectId) {
$html = 'Please visit from one of: ' . json_encode($aliases1, JSON_PRETTY_PRINT);
return message($html, 'Error', 400);
if ($host==$aliase["alias"]) $projectId = $aliase["projectId"];
}
$tmp['HerokuappId'] = $projectId;
@ -205,18 +204,17 @@ function install() {
}
}, 1000);
</script>';
$title = "Success";
return message($html, $title, 201, 1);
}
}
}
if ($_GET['install0']) {
$html = '
$html .= '
<form action="?install1" method="post" onsubmit="return notnull(this);">
language:<br>';
foreach ($constStr['languages'] as $key1 => $value1) {
$html .= '
<label><input type="radio" name="language" value="' . $key1 . '" ' . ($key1 == $constStr['language'] ? 'checked' : '') . ' onclick="changelanguage(\'' . $key1 . '\')">' . $value1 . '</label><br>';
<label><input type="radio" name="language" value="'.$key1.'" '.($key1==$constStr['language']?'checked':'').' onclick="changelanguage(\''.$key1.'\')">'.$value1.'</label><br>';
}
$html .= '<br>
<a href="https://vercel.com/account/tokens" target="_blank">' . getconstStr('Create') . ' token</a><br>
@ -224,7 +222,7 @@ language:<br>';
$html .= '<br>
<label>Set admin password:<input name="admin" type="password" placeholder="' . getconstStr('EnvironmentsDescription')['admin'] . '" size="' . strlen(getconstStr('EnvironmentsDescription')['admin']) . '"></label><br>';
$html .= '
<input type="submit" value="' . getconstStr('Submit') . '">
<input type="submit" value="'.getconstStr('Submit').'">
</form>
<div id="showerror"></div>
<script>
@ -260,28 +258,29 @@ language:<br>';
return message($html, $title, 201);
}
//if (substr($_SERVER["host"], -10)=="vercel.app") {
$html = '<a href="?install0">' . getconstStr('ClickInstall') . '</a>, ' . getconstStr('LogintoBind');
$html .= "<br>Remember: you MUST wait 30-60s after each operate / do some change, that make sure Vercel has done the building<br>";
//} else {
// $html.= "Please visit form *.vercel.app";
//}
if (substr($_SERVER["host"], -10)=="vercel.app") {
$html .= '<a href="?install0">' . getconstStr('ClickInstall') . '</a>, ' . getconstStr('LogintoBind');
$html .= "<br>Remember: you MUST wait 30-60s after each operate / do some change, that make sure Vercel has done the building<br>" ;
} else {
$html.= "Please visit form *.vercel.app";
}
$title = 'Install';
return message($html, $title, 201);
}
function copyFolder($from, $to) {
if (substr($from, -1) == '/') $from = substr($from, 0, -1);
if (substr($to, -1) == '/') $to = substr($to, 0, -1);
function copyFolder($from, $to)
{
if (substr($from, -1)=='/') $from = substr($from, 0, -1);
if (substr($to, -1)=='/') $to = substr($to, 0, -1);
if (!file_exists($to)) mkdir($to, 0777, 1);
$handler = opendir($from);
while ($filename = readdir($handler)) {
if ($filename != '.' && $filename != '..') {
$fromfile = $from . '/' . $filename;
$tofile = $to . '/' . $filename;
if (is_dir($fromfile)) { // 如果读取的某个对象是文件夹,则递归
$handler=opendir($from);
while($filename=readdir($handler)) {
if($filename != '.' && $filename != '..'){
$fromfile = $from.'/'.$filename;
$tofile = $to.'/'.$filename;
if(is_dir($fromfile)){// 如果读取的某个对象是文件夹,则递归
copyFolder($fromfile, $tofile);
} else {
}else{
copy($fromfile, $tofile);
}
}
@ -290,7 +289,8 @@ function copyFolder($from, $to) {
return 1;
}
function setVercelConfig($envs, $appId, $token) {
function setVercelConfig($envs, $appId, $token)
{
sortConfig($envs);
$outPath = '/tmp/code/';
$outPath_Api = $outPath . 'api/';
@ -305,7 +305,8 @@ function setVercelConfig($envs, $appId, $token) {
return VercelUpdate($appId, $token, $outPath);
}
function VercelUpdate($appId, $token, $sourcePath = "") {
function VercelUpdate($appId, $token, $sourcePath = "")
{
if (checkBuilding($appId, $token)) return '{"error":{"message":"Another building is in progress."}}';
$url = "https://api.vercel.com/v13/deployments";
$header["Authorization"] = "Bearer " . $token;
@ -315,8 +316,8 @@ function VercelUpdate($appId, $token, $sourcePath = "") {
$data["target"] = "production";
$data["routes"][0]["src"] = "/(.*)";
$data["routes"][0]["dest"] = "/api/index.php";
$data["functions"]["api/index.php"]["runtime"] = "vercel-php@0.6.0";
if ($sourcePath == "") $sourcePath = splitlast(splitlast(__DIR__, "/")[0], "/")[0];
$data["functions"]["api/index.php"]["runtime"] = "vercel-php@0.5.1";
if ($sourcePath=="") $sourcePath = splitlast(splitlast(__DIR__, "/")[0], "/")[0];
//echo $sourcePath . "<br>";
getEachFiles($file, $sourcePath);
$data["files"] = $file;
@ -329,7 +330,8 @@ function VercelUpdate($appId, $token, $sourcePath = "") {
return json_encode($result);
}
function checkBuilding($projectId, $token) {
function checkBuilding($projectId, $token)
{
$r = 0;
$url = "https://api.vercel.com/v6/deployments/?projectId=" . $projectId;
$header["Authorization"] = "Bearer " . $token;
@ -337,26 +339,27 @@ function checkBuilding($projectId, $token) {
$response = curl("GET", $url, '', $header);
//echo json_encode($response, JSON_PRETTY_PRINT) . " ,res<br>";
$result = json_decode($response["body"], true);
foreach ($result['deployments'] as $deployment) {
if ($deployment['state'] !== "READY" && $deployment['state'] !== "ERROR") $r++;
foreach ( $result['deployments'] as $deployment ) {
if ($deployment['state']!=="READY") $r++;
}
return $r;
//if ($r===0) return true;
//else return false;
}
function getEachFiles(&$file, $base, $path = "") {
function getEachFiles(&$file, $base, $path = "")
{
//if (substr($base, -1)=="/") $base = substr($base, 0, -1);
//if (substr($path, -1)=="/") $path = substr($path, 0, -1);
$handler = opendir(path_format($base . "/" . $path));
while ($filename = readdir($handler)) {
if ($filename != '.' && $filename != '..' && $filename != '.git') {
$handler=opendir(path_format($base . "/" . $path));
while($filename=readdir($handler)) {
if($filename != '.' && $filename != '..' && $filename != '.git'){
$fromfile = path_format($base . "/" . $path . "/" . $filename);
//echo $fromfile . "<br>";
if (is_dir($fromfile)) { // 如果读取的某个对象是文件夹,则递归
//echo $fromfile . "<br>";
if(is_dir($fromfile)){// 如果读取的某个对象是文件夹,则递归
$response = getEachFiles($file, $base, path_format($path . "/" . $filename));
if (api_error(setConfigResponse($response))) return $response;
} else {
}else{
$tmp['file'] = path_format($path . "/" . $filename);
$tmp['data'] = file_get_contents($fromfile);
$file[] = $tmp;
@ -365,43 +368,47 @@ function getEachFiles(&$file, $base, $path = "") {
}
closedir($handler);
return json_encode(['response' => 'success']);
return json_encode( [ 'response' => 'success' ] );
}
function api_error($response) {
function api_error($response)
{
return isset($response['error']);
}
function api_error_msg($response) {
function api_error_msg($response)
{
return $response['error']['code'] . '<br>
' . $response['error']['message'] . '<br>
<button onclick="location.href = location.href;">' . getconstStr('Refresh') . '</button>';
<button onclick="location.href = location.href;">'.getconstStr('Refresh').'</button>';
}
function setConfigResponse($response) {
function setConfigResponse($response)
{
return json_decode($response, true);
}
function OnekeyUpate($GitSource = 'Github', $auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master') {
function OnekeyUpate($GitSource = 'Github', $auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
{
$tmppath = '/tmp';
if ($GitSource == 'Github') {
if ($GitSource=='Github') {
// 从github下载对应tar.gz并解压
$url = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . urlencode($branch) . '/';
} elseif ($GitSource == 'HITGitlab') {
} elseif ($GitSource=='HITGitlab') {
$url = 'https://git.hit.edu.cn/' . $auth . '/' . $project . '/-/archive/' . urlencode($branch) . '/' . $project . '-' . urlencode($branch) . '.tar.gz';
} else return json_encode(['error' => ['code' => 'Git Source input Error!']]);
} else return json_encode(['error'=>['code'=>'Git Source input Error!']]);
$tarfile = $tmppath . '/github.tar.gz';
file_put_contents($tarfile, file_get_contents($url));
$phar = new PharData($tarfile);
$html = $phar->extractTo($tmppath, null, true); //路径 要解压的文件 是否覆盖
$html = $phar->extractTo($tmppath, null, true);//路径 要解压的文件 是否覆盖
unlink($tarfile);
// 获取解压出的目录名
$outPath = findIndexPath($tmppath);
if ($outPath == '') return '{"error":{"message":"no outpath"}}';
if ($outPath=='') return '{"error":{"message":"no outpath"}}';
$name = $project . 'CODE';
mkdir($tmppath . "/" . $name, 0777, 1);
rename($outPath, $tmppath . "/" . $name . '/api');
@ -418,36 +425,31 @@ function OnekeyUpate($GitSource = 'Github', $auth = 'qkqpttgf', $project = 'OneM
}
function WaitFunction($deployid = '') {
if ($deployid == '1') {
if ($buildId=='1') {
$tmp['stat'] = 400;
$tmp['body'] = 'id must provided.';
return $tmp;
}
$token = getConfig('APIKey');
if ($token != '') {
$header["Authorization"] = "Bearer " . $token;
$header["Content-Type"] = "application/json";
$url = "https://api.vercel.com/v13/deployments/" . $deployid;
$response = curl("GET", $url, "", $header);
if ($response['stat'] == 200) {
$result = json_decode($response['body'], true);
if ($result['readyState'] == "READY") return true;
if ($result['readyState'] == "ERROR") return $response;
return false;
} else {
$response['body'] .= $url;
return $response;
}
} else {
$header["Authorization"] = "Bearer " . getConfig('APIKey');
$header["Content-Type"] = "application/json";
$url = "https://api.vercel.com/v13/deployments/" . $deployid;
$response = curl("GET", $url, "", $header);
if ($response['stat']==200) {
$result = json_decode($response['body'], true);
if ($result['readyState']=="READY") return true;
if ($result['readyState']=="ERROR") return $response;
return false;
} else {
$response['body'] .= $url;
return $response;
}
}
function changeAuthKey() {
if ($_POST['APIKey'] != '') {
if ($_POST['APIKey']!='') {
$APIKey = $_POST['APIKey'];
$tmp['APIKey'] = $APIKey;
$response = setConfigResponse(setVercelConfig($tmp, getConfig('HerokuappId'), $APIKey));
$response = setConfigResponse( setVercelConfig($tmp, getConfig('HerokuappId'), $APIKey) );
if (api_error($response)) {
$html = api_error_msg($response);
$title = 'Error';
@ -466,7 +468,6 @@ function changeAuthKey() {
}
}, 1000);
</script>';
$title = "Success";
return message($html, $title, 201, 1);
}
}
@ -491,6 +492,6 @@ function changeAuthKey() {
function smallfileupload($drive, $path) {
if ($_FILES['file1']['error']) return output($_FILES['file1']['error'], 400);
if ($_FILES['file1']['size'] > 4 * 1024 * 1024) return output('File too large', 400);
if ($_FILES['file1']['size']>4*1024*1024) return output('File too large', 400);
return $drive->smallfileupload($path, $_FILES['file1']);
}

View File

@ -21,6 +21,7 @@ function getpath()
if ($p>0) $path = substr($_SERVER['REQUEST_URI'], 0, $p);
else $path = $_SERVER['REQUEST_URI'];
$path = path_format( substr($path, strlen($_SERVER['base_path'])) );
$_SERVER['DOCUMENT_ROOT'] = '/var/task/user';
return $path;
}

View File

@ -41,22 +41,19 @@
https://onemanager.qkqpttgf.repl.co/
### How to Install
A:
> 1. Click the "+" or "Create Repl", click the `Import from Github`;
> 2. Input `https://github.com/qkqpttgf/OneManager-php` in "GitHub URL", then it will auto show "Language" - "PHP Web Server", Click the "Import from Github";
> 3. After done, click the green button "Run", it will show the web page on the right, you MUST open it in a new tab or window.
### Notice
> `Import from Github` useing the `.replit` file in code files will cause an empty web page, may someone help me?
### How to Install
B:
> 1. Click the "+" or "Create Repl", find template "PHP Web Server" (via input "php"), input a name for your project in "Title" or left it default, Click the "+ Create Repl".
> 2. After done, input `git clone https://github.com/qkqpttgf/OneManager-php && mv -b OneManager-php/* ./ && mv -b OneManager-php/.[^.]* ./ && rm -rf *~ && rm -rf OneManager-php` to Console or Shell on the right, press "Enter" to run it.
> 3. Click the green button "Run", it will show the web page on the right, you MUST open it in a new tab or window.
> 3. Click the green button "Run", it will show the web page on the right, you can open it in a new tab or window.
---
# ~~Deploy to Heroku~~
## Dyno will no longer free
# Deploy to Heroku
### Official
@ -90,9 +87,7 @@ B:
---
# ~~Deploy to Tencent Serverless Cloud Function (SCF)~~
## SCF no longer free
# Deploy to Tencent Serverless Cloud Function (SCF)
### Official

View File

@ -43,22 +43,19 @@
https://onemanager.qkqpttgf.repl.co/
### 安装
A:
> 1. 点右上的 "+" 或左上的 "+ Create Repl",点击`Import from Github`
> 2. 在"GitHub URL"中输入`https://github.com/qkqpttgf/OneManager-php`,会自动弹出显示"Language"与"PHP Web Server",点下面的"Import from Github"。
> 3. 结束后,点上方的绿色 "Run" 按钮,右边会显示一个网页,你要在新窗口打开它来安装,不然不能登录。
### 注意
> 直接`Import from Github`通过`.replit`文件指定php时网页会空白有人帮忙解决吗
### 安装
B:
> 1. 点右上的 "+" 或左上的 "+ Create Repl"template中输入php点选"PHP Web Server",在"Title"里输入你想要的名称或者让它默认, 点下面的"+ Create Repl"。
> 2. 结束后在右边的Console或Shell里输入 `git clone https://github.com/qkqpttgf/OneManager-php && mv -b OneManager-php/* ./ && mv -b OneManager-php/.[^.]* ./ && rm -rf *~ && rm -rf OneManager-php` 敲回车运行。
> 3. 点上方的绿色 "Run" 按钮,右边会显示一个网页,你要在新窗口打开它来安装,不然不能登录。
---
# ~~部署到 Heroku~~
## Dyno套餐不再免费
# 部署到 Heroku
### 官网
@ -90,9 +87,7 @@ B:
---
# ~~部署到腾讯无服务器云函数 Serverless Cloud Function (SCF)~~
## SCF要收套餐费用了
# 部署到腾讯无服务器云函数 Serverless Cloud Function (SCF)
### 官网

View File

@ -484,11 +484,11 @@
</body>
<!--MdRequireStart--><link rel="stylesheet" href="https://unpkg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="?jsFile=marked.js"></script><!--MdRequireEnd-->
<script type="text/javascript" src="https://unpkg.com/marked@0.6.2/lib/marked.js"></script><!--MdRequireEnd-->
<!--ListStart-->
<!--GuestUploadStart--><script type="text/javascript" src="?jsFile=spark-md5.min.js"></script><!--GuestUploadEnd-->
<!--GuestUploadStart--><script type="text/javascript" src="//cdn.bootcss.com/spark-md5/3.0.0/spark-md5.min.js"></script><!--GuestUploadEnd-->
<!--AliyundriveUploadJsStart--><script src="https://unpkg.com/bignumber.js@9.0.2/bignumber.js"></script>
<script src="?jsFile=sha1.min.js"></script><!--AliyundriveUploadJsEnd-->
<script src="https://www.unpkg.com/js-sha1@0.6.0/src/sha1.js"></script><!--AliyundriveUploadJsEnd-->
<!--IsFileStart--><!--IspdfFileStart--><script src="https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
<!--ListEnd-->
<script type="text/javascript">
@ -655,6 +655,7 @@
addVideos(["<!--FileEncodeUrl-->"]);
<!--IsvideoFileEnd-->
<!--IspdfFileStart-->
//cdn.bootcss.com/pdf.js/2.4.456/pdf.worker.min.js
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.worker.min.js';
var loadingTask = pdfjsLib.getDocument({
url: "<!--FileDownUrl-->",
@ -1763,6 +1764,6 @@
<!--EncryptedEnd-->
</script>
<script src="https://www.unpkg.com/ionicons@6.0.1/dist/ionicons.js"></script>
<!--LoginStart--><script src="?jsFile=sha1.min.js"></script><!--LoginEnd-->
<!--LoginStart--><script src="https://www.unpkg.com/js-sha1@0.6.0/src/sha1.js"></script><!--LoginEnd-->
<!--customScript-->
</html>

View File

@ -510,11 +510,11 @@
</body>
<!--ListStart-->
<!--MdRequireStart--><link rel="stylesheet" href="https://unpkg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="?jsFile=marked.js"></script><!--MdRequireEnd-->
<!--GuestUploadStart--><script type="text/javascript" src="?jsFile=spark-md5.min.js"></script><!--GuestUploadEnd-->
<!--AliyundriveUploadJsStart--><script src="?jsFile=sha1.min.js"></script><!--AliyundriveUploadJsEnd-->
<!--IsFileStart--><!--IspdfFileStart--><script src="https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
<!--MdRequireStart--><link rel="stylesheet" href="//unpkg.zhimg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="//unpkg.zhimg.com/marked@0.6.2/marked.min.js"></script><!--MdRequireEnd-->
<!--GuestUploadStart--><script type="text/javascript" src="//cdn.bootcss.com/spark-md5/3.0.0/spark-md5.min.js"></script><!--GuestUploadEnd-->
<!--AliyundriveUploadJsStart--><script src="https://cdn.bootcss.com/js-sha1/0.6.0/sha1.min.js"></script><!--AliyundriveUploadJsEnd-->
<!--IsFileStart--><!--IspdfFileStart--><script src="//cdn.bootcss.com/pdf.js/2.3.200/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
<!--ListEnd-->
<style type="text/css">
.markdown-body{font-size: 14px;}
@ -642,10 +642,10 @@
addVideos(['<!--FileEncodeUrl-->']);
<!--IsvideoFileEnd-->
<!--IspdfFileStart-->
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.worker.min.js';
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.bootcss.com/pdf.js/2.3.200/pdf.worker.min.js';
var loadingTask = pdfjsLib.getDocument({
url: '<!--FileDownUrl-->',
cMapUrl: "https://unpkg.com/pdfjs-dist@2.4.456/cmaps/",
cMapUrl: "//cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/cmaps/",
cMapPacked: true,
rangeChunkSize: 65535
});
@ -1698,6 +1698,6 @@
<!--EncryptedEnd-->
</script>
<script src="https://cdn.jsdelivr.net/npm/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
<!--LoginStart--><script src="?jsFile=sha1.min.js"></script><!--LoginEnd-->
<!--LoginStart--><script src="https://cdn.bootcss.com/js-sha1/0.6.0/sha1.min.js"></script><!--LoginEnd-->
<!--customScript-->
</html>

View File

@ -89,10 +89,9 @@
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="<!--IsPreview?-->login=admin" method="post" onsubmit="return sha1loginpass(this);">
<form action="?login=admin" method="post">
<div class="modal-body">
<input class="form-control" id="login_input" name="password1" type="password" placeholder="<!--constStr@InputPassword-->">
<input name="timestamp" type="hidden">
</div>
<div class="modal-footer">
<input class="btn btn-primary" type="submit" value="<!--constStr@Login-->"></button>
@ -669,7 +668,7 @@ return false;
<!--IsFolderEnd-->
<!--AdminEnd-->
<!--LoginStart-->
<script src="?jsFile=sha1.min.js"></script>
<!--LoginEnd-->
<p class="text-center text-muted"><a href="https://github.com/qkqpttgf/OneManager-php" class="text-muted">OneManager</a> By 逸笙 Theme By Nchyn</p>
<p class="text-center" style="color: rgba(247,247,249,0);"><!--FootStr--></p>
@ -677,11 +676,11 @@ return false;
</body>
<!--ListStart-->
<!--MdRequireStart--><link rel="stylesheet" href="https://unpkg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="?jsFile=marked.js"></script><!--MdRequireEnd-->
<!--GuestUploadStart--><script type="text/javascript" src="?jsFile=spark-md5.min.js"></script><!--GuestUploadEnd-->
<!--AliyundriveUploadJsStart--><script src="?jsFile=sha1.min.js"></script><!--AliyundriveUploadJsEnd-->
<!--IsFileStart--><!--IspdfFileStart--><script src="https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
<!--MdRequireStart--><link rel="stylesheet" href="//unpkg.zhimg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="//unpkg.zhimg.com/marked@0.6.2/marked.min.js"></script><!--MdRequireEnd-->
<!--GuestUploadStart--><script type="text/javascript" src="//cdn.bootcss.com/spark-md5/3.0.0/spark-md5.min.js"></script><!--GuestUploadEnd-->
<!--AliyundriveUploadJsStart--><script src="//cdn.bootcdn.net/ajax/libs/js-sha1/0.6.0/sha1.min.js"></script><!--AliyundriveUploadJsEnd-->
<!--IsFileStart--><!--IspdfFileStart--><script src="//cdn.bootcss.com/pdf.js/2.3.200/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
<!--ListEnd-->
<script type="text/javascript">
function changelanguage(str)
@ -803,10 +802,10 @@ return false;
addVideos(['<!--FileEncodeUrl-->']);
<!--IsvideoFileEnd-->
<!--IspdfFileStart-->
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.worker.min.js';
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.bootcss.com/pdf.js/2.3.200/pdf.worker.min.js';
var loadingTask = pdfjsLib.getDocument({
url: '<!--FileDownUrl-->',
cMapUrl: "https://unpkg.com/pdfjs-dist@2.4.456/cmaps/",
cMapUrl: "//cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/cmaps/",
cMapPacked: true,
rangeChunkSize: 65535
});
@ -1746,35 +1745,6 @@ return false;
document.getElementById('login_div').style.top=(window.innerHeight-document.getElementById('login_div').offsetHeight)/2+document.body.scrollTop +'px';
document.getElementById('login_input').focus();
}
function sha1loginpass(f) {
if (f.password1.value=="") return false;
try {
timestamp = new Date().getTime() + "";
timestamp = timestamp.substr(0, timestamp.length-3);
f.timestamp.value = timestamp;
f.password1.value = sha1(timestamp + "" + f.password1.value);
return true;
} catch {
//alert("sha1.js not loaded.");
if (confirm("sha1.js not loaded.\n\nLoad from program?")) loadjs("?jsFile=sha1.min.js");
return false;
}
}
function loadjs(url) {
var xhr = new XMLHttpRequest;
xhr.open("GET", url);
xhr.onload = function(e) {
if (xhr.status==200) {
var script = document.createElement("script");
script.type = "text/javascript";
script.text = xhr.responseText;
document.body.appendChild(script);
} else {
console.log(xhr.response);
}
}
xhr.send(null);
}
<!--LoginEnd-->
<!--EncryptedStart-->
document.getElementById('password1').focus();

View File

@ -145,8 +145,8 @@
</div>
<!--IsofficeFileEnd-->
<!--IsvideoFileStart-->
<link class="dplayer-css" rel="stylesheet" href="https://fastly.jsdelivr.net/npm/dplayer/dist/DPlayer.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/dplayer/1.27.0/DPlayer.min.js"></script>
<link class="dplayer-css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.js"></script>
<div class="nexmoe-item">
<div class="mdui-center" id="dplayer"></div>
</div>
@ -283,8 +283,8 @@
<!--ShowThumbnailsEnd-->
<!--IsFolderEnd-->
<!--ListEnd-->
<!--MdRequireStart--><link rel="stylesheet" href="https://unpkg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="?jsFile=marked.js"></script><!--MdRequireEnd-->
<!--MdRequireStart--><link rel="stylesheet" href="//unpkg.zhimg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="//unpkg.zhimg.com/marked@0.6.2/marked.min.js"></script><!--MdRequireEnd-->
<script>
<!--MorePageStart-->
function nextpage(num) {

View File

@ -374,8 +374,8 @@
<!--ListEnd-->
<script src="//cdn.jsdelivr.net/gh/mcstudios/glightbox/dist/js/glightbox.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
<!--MdRequireStart--><link rel="stylesheet" href="https://unpkg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="?jsFile=marked.js"></script><!--MdRequireEnd-->
<!--MdRequireStart--><link rel="stylesheet" href="//unpkg.zhimg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="//unpkg.zhimg.com/marked@0.6.2/marked.min.js"></script><!--MdRequireEnd-->
<script>
<!--MorePageStart-->
function nextpage(num) {

View File

@ -434,11 +434,11 @@
</body>
<!--ListStart-->
<!--MdRequireStart--><link rel="stylesheet" href="https://unpkg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="?jsFile=marked.js"></script><!--MdRequireEnd-->
<!--GuestUploadStart--><script type="text/javascript" src="?jsFile=spark-md5.min.js"></script><!--GuestUploadEnd-->
<!--AliyundriveUploadJsStart--><script src="?jsFile=sha1.min.js"></script><!--AliyundriveUploadJsEnd-->
<!--IsFileStart--><!--IspdfFileStart--><script src="https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
<!--MdRequireStart--><link rel="stylesheet" href="//unpkg.zhimg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="//unpkg.zhimg.com/marked@0.6.2/marked.min.js"></script><!--MdRequireEnd-->
<!--GuestUploadStart--><script type="text/javascript" src="//cdn.bootcss.com/spark-md5/3.0.0/spark-md5.min.js"></script><!--GuestUploadEnd-->
<!--AliyundriveUploadJsStart--><script src="https://cdn.bootcss.com/js-sha1/0.6.0/sha1.min.js"></script><!--AliyundriveUploadJsEnd-->
<!--IsFileStart--><!--IspdfFileStart--><script src="//cdn.bootcss.com/pdf.js/2.3.200/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
<!--ListEnd-->
<script type="text/javascript">
function changelanguage(str)
@ -564,10 +564,10 @@
addVideos(['<!--FileEncodeUrl-->']);
<!--IsvideoFileEnd-->
<!--IspdfFileStart-->
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.worker.min.js';
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.bootcss.com/pdf.js/2.3.200/pdf.worker.min.js';
var loadingTask = pdfjsLib.getDocument({
url: '<!--FileDownUrl-->',
cMapUrl: "https://unpkg.com/pdfjs-dist@2.4.456/cmaps/",
cMapUrl: "//cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/cmaps/",
cMapPacked: true,
rangeChunkSize: 65535
});
@ -1590,6 +1590,6 @@
<!--EncryptedEnd-->
</script>
<script src="https://cdn.jsdelivr.net/npm/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
<!--LoginStart--><script src="?jsFile=sha1.min.js"></script><!--LoginEnd-->
<!--LoginStart--><script src="https://cdn.bootcss.com/js-sha1/0.6.0/sha1.min.js"></script><!--LoginEnd-->
<!--customScript-->
</html>

View File

@ -457,9 +457,8 @@
<div style="margin:50px">
<a onclick="operatediv_close('login')" class="operatediv_close"><!--constStr@Close--></a>
<center>
<form action="<!--IsPreview?-->login=admin" method="post" onsubmit="return sha1loginpass(this);">
<form action="<!--IsPreview?-->login=admin" method="post">
<input id="login_input" name="password1" type="password" placeholder="<!--constStr@InputPassword-->">
<input name="timestamp" type="hidden" value="">
<input type="submit" value="<!--constStr@Login-->">
</form>
</center>
@ -470,10 +469,10 @@
</body>
<!--ListStart-->
<!--MdRequireStart--><link rel="stylesheet" href="https://unpkg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="?jsFile=marked.js"></script><!--MdRequireEnd-->
<!--GuestUploadStart--><script type="text/javascript" src="?jsFile=spark-md5.min.js"></script><!--GuestUploadEnd-->
<!--IsFileStart--><!--IspdfFileStart--><script src="https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
<!--MdRequireStart--><link rel="stylesheet" href="//unpkg.zhimg.com/github-markdown-css@3.0.1/github-markdown.css">
<script type="text/javascript" src="//unpkg.zhimg.com/marked@0.6.2/marked.min.js"></script><!--MdRequireEnd-->
<!--GuestUploadStart--><script type="text/javascript" src="//cdn.bootcss.com/spark-md5/3.0.0/spark-md5.min.js"></script><!--GuestUploadEnd-->
<!--IsFileStart--><!--IspdfFileStart--><script src="//cdn.bootcss.com/pdf.js/2.3.200/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
<!--ListEnd-->
<script type="text/javascript">
function changelanguage(str)
@ -595,10 +594,10 @@
addVideos(['<!--FileDownUrl-->']);
<!--IsvideoFileEnd-->
<!--IspdfFileStart-->
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.worker.min.js';
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.bootcss.com/pdf.js/2.3.200/pdf.worker.min.js';
var loadingTask = pdfjsLib.getDocument({
url: '<!--FileDownUrl-->',
cMapUrl: "https://unpkg.com/pdfjs-dist@2.4.456/cmaps/",
cMapUrl: "//cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/cmaps/",
cMapPacked: true,
rangeChunkSize: 65535
});
@ -1247,43 +1246,11 @@
document.getElementById('login_div').style.top=(window.innerHeight-document.getElementById('login_div').offsetHeight)/2+document.body.scrollTop +'px';
document.getElementById('login_input').focus();
}
function sha1loginpass(f) {
if (f.password1.value == "") return false;
try {
timestamp = new Date().getTime() + "";
timestamp = timestamp.substr(0, timestamp.length - 3);
f.timestamp.value = timestamp;
f.password1.value = sha1(timestamp + "" + f.password1.value);
return true;
} catch {
//alert("sha1.js not loaded.");
if (confirm("sha1.js not loaded.\n\nLoad from program?")) loadjs("?jsFile=sha1.min.js");
return false;
}
}
function loadjs(url) {
var xhr = new XMLHttpRequest;
xhr.open("GET", url);
xhr.onload = function (e) {
if (xhr.status == 200) {
var script = document.createElement("script");
script.type = "text/javascript";
script.text = xhr.responseText;
document.body.appendChild(script);
} else {
console.log(xhr.response);
}
}
xhr.send(null);
}
<!--LoginEnd-->
<!--EncryptedStart-->
document.getElementById('password1').focus();
<!--EncryptedEnd-->
</script>
<!--LoginStart-->
<script src="?jsFile=sha1.min.js"></script>
<!--LoginEnd-->
<script src="https://cdn.jsdelivr.net/npm/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
<!--customScript-->
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!bash
if [ $# -eq 0 ]; then
echo "