Merge pull request 'refs #5879 test into dev' (!34) from test into dev
gitea/hedera-web/pipeline/head This commit looks good
Details
gitea/hedera-web/pipeline/head This commit looks good
Details
Reviewed-on: #34
This commit is contained in:
commit
5bcfd5897c
|
@ -1,5 +1,5 @@
|
||||||
# Not using buster because of bug: https://bugs.php.net/bug.php?id=78870
|
# Not using buster because of bug: https://bugs.php.net/bug.php?id=78870
|
||||||
FROM debian:stretch-slim
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
@ -23,13 +23,13 @@ RUN a2dissite 000-default
|
||||||
|
|
||||||
# NodeJs
|
# NodeJs
|
||||||
|
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||||
&& apt-get install -y --no-install-recommends nodejs
|
&& apt-get install -y --no-install-recommends nodejs
|
||||||
|
|
||||||
# Hedera
|
# Hedera
|
||||||
|
|
||||||
RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | apt-key add - \
|
RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | apt-key add - \
|
||||||
&& echo "deb http://apt.verdnatura.es/ stretch main" \
|
&& echo "deb http://apt.verdnatura.es/ bookworm main" \
|
||||||
> /etc/apt/sources.list.d/vn.list \
|
> /etc/apt/sources.list.d/vn.list \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
|
|
@ -46,7 +46,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'debuild -us -uc -b'
|
sh 'debuild -us -uc -b'
|
||||||
sh 'vn-includedeb stretch'
|
sh 'vn-includedeb bookworm'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Container') {
|
stage('Container') {
|
||||||
|
|
17
README.md
17
README.md
|
@ -8,14 +8,25 @@ Required dependencies.
|
||||||
* PHP >= 7.0
|
* PHP >= 7.0
|
||||||
* Node.js >= 8.0
|
* Node.js >= 8.0
|
||||||
|
|
||||||
Launch application for development.
|
### Web application
|
||||||
|
|
||||||
|
Launch fronted.
|
||||||
```
|
```
|
||||||
$ npm run dev
|
npm run front
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Launch backend.
|
||||||
|
```
|
||||||
|
npm run db
|
||||||
|
npm run back
|
||||||
|
php -S 127.0.0.1:3001 -t . index.php
|
||||||
|
```
|
||||||
|
|
||||||
|
### Command line
|
||||||
|
|
||||||
Run server side method from command line.
|
Run server side method from command line.
|
||||||
```
|
```
|
||||||
$ php hedera-web.php -m method_path
|
php hedera-web.php -m method_path
|
||||||
```
|
```
|
||||||
|
|
||||||
## Built with
|
## Built with
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
hedera-web (23.6.9) stable; urgency=low
|
hedera-web (23.6.14) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hedera-web",
|
"name": "hedera-web",
|
||||||
"version": "23.6.9",
|
"version": "23.6.14",
|
||||||
"description": "Verdnatura web page",
|
"description": "Verdnatura web page",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -21,9 +21,9 @@
|
||||||
"html-webpack-plugin": "^5.5.0",
|
"html-webpack-plugin": "^5.5.0",
|
||||||
"json-loader": "^0.5.7",
|
"json-loader": "^0.5.7",
|
||||||
"mini-css-extract-plugin": "^2.7.0",
|
"mini-css-extract-plugin": "^2.7.0",
|
||||||
"node-sass": "^7.0.1",
|
"node-sass": "^9.0.0",
|
||||||
"raw-loader": "^4.0.2",
|
"raw-loader": "^4.0.2",
|
||||||
"sass-loader": "^12.6.0",
|
"sass-loader": "^13.3.2",
|
||||||
"style-loader": "^3.3.1",
|
"style-loader": "^3.3.1",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
"webpack": "^5.75.0",
|
"webpack": "^5.75.0",
|
||||||
|
|
|
@ -39,31 +39,31 @@ class Upload extends Vn\Web\JsonRequest {
|
||||||
|
|
||||||
if ($_FILES['image']['error'] != 0) {
|
if ($_FILES['image']['error'] != 0) {
|
||||||
switch ($_FILES['image']['error']) {
|
switch ($_FILES['image']['error']) {
|
||||||
case UPLOAD_ERR_INI_SIZE:
|
case UPLOAD_ERR_INI_SIZE:
|
||||||
$message = 'ErrIniSize';
|
$message = 'ErrIniSize';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_FORM_SIZE:
|
case UPLOAD_ERR_FORM_SIZE:
|
||||||
$message = 'ErrFormSize';
|
$message = 'ErrFormSize';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_PARTIAL:
|
case UPLOAD_ERR_PARTIAL:
|
||||||
$message = 'ErrPartial';
|
$message = 'ErrPartial';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_NO_FILE:
|
case UPLOAD_ERR_NO_FILE:
|
||||||
$message = 'ErrNoFile';
|
$message = 'ErrNoFile';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_NO_TMP_DIR:
|
case UPLOAD_ERR_NO_TMP_DIR:
|
||||||
$message = 'ErrNoTmpDir';
|
$message = 'ErrNoTmpDir';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_CANT_WRITE:
|
case UPLOAD_ERR_CANT_WRITE:
|
||||||
$message = 'ErrCantWrite';
|
$message = 'ErrCantWrite';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_EXTENSION:
|
case UPLOAD_ERR_EXTENSION:
|
||||||
$message = 'ErrExtension';
|
$message = 'ErrExtension';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$message = 'ErrDefault';
|
$message = 'ErrDefault';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Lib\Exception(s($message));
|
throw new Lib\Exception(s($message));
|
||||||
}
|
}
|
||||||
|
@ -101,12 +101,6 @@ class Upload extends Vn\Web\JsonRequest {
|
||||||
$symbolicSrc = "../full/$fileName";
|
$symbolicSrc = "../full/$fileName";
|
||||||
|
|
||||||
$image = Image::create($tmpName);
|
$image = Image::create($tmpName);
|
||||||
Image::resizeSave($image, $fullFile, $info['maxHeight'], $info['maxWidth']);
|
|
||||||
|
|
||||||
foreach ($info['sizes'] as $size => $i) {
|
|
||||||
$dstFile = "$collectionPath/$size/$fileName";
|
|
||||||
Image::resizeSave($image, $dstFile, $i['height'], $i['width'], $i['crop'], $symbolicSrc);
|
|
||||||
}
|
|
||||||
|
|
||||||
$query =
|
$query =
|
||||||
"INSERT INTO `image`
|
"INSERT INTO `image`
|
||||||
|
@ -121,6 +115,13 @@ class Upload extends Vn\Web\JsonRequest {
|
||||||
'name' => $name
|
'name' => $name
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Image::resizeSave($image, $fullFile, $info['maxHeight'], $info['maxWidth']);
|
||||||
|
|
||||||
|
foreach ($info['sizes'] as $size => $i) {
|
||||||
|
$dstFile = "$collectionPath/$size/$fileName";
|
||||||
|
Image::resizeSave($image, $dstFile, $i['height'], $i['width'], $i['crop'], $symbolicSrc);
|
||||||
|
}
|
||||||
|
|
||||||
imagedestroy($image);
|
imagedestroy($image);
|
||||||
unlink($tmpName);
|
unlink($tmpName);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
class Account {
|
|
||||||
static function trySync($db, $userName, $password = NULL) {
|
|
||||||
$sync = $db->getValue(
|
|
||||||
'SELECT COUNT(*) > 0 FROM account.userSync WHERE name = #',
|
|
||||||
[$userName]
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($sync)
|
|
||||||
self::sync($db, $userName, $password);
|
|
||||||
}
|
|
||||||
|
|
||||||
static function sync($db, $userName, $password = NULL) {
|
|
||||||
$bcryptPassword = password_hash($password, PASSWORD_BCRYPT);
|
|
||||||
|
|
||||||
$userId = $db->getValue(
|
|
||||||
'SELECT id FROM account.user WHERE `name` = #',
|
|
||||||
[$userName]
|
|
||||||
);
|
|
||||||
$db->query(
|
|
||||||
'UPDATE account.user SET
|
|
||||||
bcryptPassword = #
|
|
||||||
WHERE id = #',
|
|
||||||
[$bcryptPassword, $userId]
|
|
||||||
);
|
|
||||||
|
|
||||||
$hasAccount = $db->getValue(
|
|
||||||
'SELECT COUNT(*) > 0
|
|
||||||
FROM account.user u
|
|
||||||
JOIN account.account a ON u.id = a.id
|
|
||||||
WHERE u.name = #',
|
|
||||||
[$userName]
|
|
||||||
);
|
|
||||||
if (!$hasAccount)
|
|
||||||
$db->query('DELETE FROM account.userSync WHERE name = #',
|
|
||||||
[$userName]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -54,7 +54,7 @@ class RestService extends Service {
|
||||||
if ($e->getCode() == 1644) {
|
if ($e->getCode() == 1644) {
|
||||||
$eMessage = $e->getMessage();
|
$eMessage = $e->getMessage();
|
||||||
$tMessage = $db->getValue(
|
$tMessage = $db->getValue(
|
||||||
'SELECT `description` FROM `message` WHERE `code` = #',
|
'SELECT `description` FROM `messageL10n` WHERE `code` = #',
|
||||||
[$eMessage]
|
[$eMessage]
|
||||||
);
|
);
|
||||||
if (!$tMessage) $tMessage = $eMessage;
|
if (!$tMessage) $tMessage = $eMessage;
|
||||||
|
|
|
@ -126,7 +126,7 @@ const devConfig = {
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': 'http://localhost:3000',
|
'/api': 'http://localhost:3000',
|
||||||
'/': {
|
'/': {
|
||||||
target: 'http://localhost/projects/hedera-web',
|
target: 'http://localhost:3001',
|
||||||
bypass: (req) => req.path !== '/' ? req.path : null
|
bypass: (req) => req.path !== '/' ? req.path : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue