Merge pull request #79 from PGYER/dev/master

Dev/master
This commit is contained in:
Carney Wu
2022-03-31 17:57:35 +08:00
committed by GitHub
3 changed files with 6 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ class Internal extends Base
$data = Request::parse()->parsed;
$parsedRepo = [];
preg_match("/([\w\d\_]+)\/([\w\d\_]+)\.git/", $data['repo'], $parsedRepo);
preg_match("/([\w\d_]+)\/([\w\d_]+)\.git/", $data['repo'], $parsedRepo);
if ($data && $data['userID'] && $data['repo'] && $data['action'] && $parsedRepo[0] && $parsedRepo[1]) {
@@ -74,6 +74,7 @@ class Internal extends Base
// group or repository not found
Response::reject(0x0302);
}
Response::reject(0x0201);
}
@@ -81,7 +82,7 @@ class Internal extends Base
$data = Request::parse()->parsed;
$parsedRepo = [];
preg_match("/([\w\d\_]+)\/([\w\d\_]+)\.git/", $data['repo'], $parsedRepo);
preg_match("/([\w\d_]+)\/([\w\d_]+)\.git/", $data['repo'], $parsedRepo);
if ($data && $data['user'] && $data['pass'] && $data['repo'] && $parsedRepo[1] && $parsedRepo[2]) {
// check email and password
@@ -134,6 +135,7 @@ class Internal extends Base
// user not found
Response::reject(0x0101);
}
Response::reject(0x0201);
}

View File

@@ -15,7 +15,7 @@ class APIAuth
static function auth(array $authTypes)
{
if (in_array(self::AUTH_TYPE_GATEWAY, $authTypes)) {
if (Request::parse()->token === YAML_GATEWAY_TOKEN) {
if ((string) Request::parse()->token === YAML_GATEWAY_TOKEN) {
Request::setAuthData([]);
return TRUE;
}

View File

@@ -40,7 +40,7 @@ chmod 0777 ../config.yaml ../env.yaml
echo 'env files generated!'
mkdir ../application/logs
chmod -R git:git ../application/logs
chown -R git:git ../application/logs
chmod -R 0777 ../git-storage