access-version fixes
gitea/hedera-web/master This commit looks good Details

This commit is contained in:
Juan Ferrer 2020-01-23 14:28:12 +01:00
parent 54dd5a21cf
commit 5a8b0447dd
4 changed files with 12 additions and 10 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.407.03) stable; urgency=low hedera-web (1.407.04) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -14,7 +14,7 @@ services:
target: /etc/hedera-web/config.test.php target: /etc/hedera-web/config.test.php
volumes: volumes:
- /mnt/storage/image:/var/lib/hedera-web/image-db - /mnt/storage/image:/var/lib/hedera-web/image-db
- /mnt/storage/vn-access:/mnt/storage/vn-access - /mnt/storage/vn-access:/var/lib/hedera-web/vn-access
deploy: deploy:
replicas: 3 replicas: 3
cron: cron:

View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "1.407.03", "version": "1.407.04",
"description": "Verdnatura web page", "description": "Verdnatura web page",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {

View File

@ -56,16 +56,18 @@ class AccessVersion extends Vn\Web\JsonRequest {
$appName = $_REQUEST['appName']; $appName = $_REQUEST['appName'];
$newVersion = $_REQUEST['newVersion']; $newVersion = $_REQUEST['newVersion'];
$uploadDir = '/mnt/storage/vn-access'; $accessDir = _DATA_DIR .'/'. $this->app->getName() .'/vn-access';
$uploadFile = "$uploadDir/$appName.7z"; $headFile = "$accessDir/$appName.7z";
$archiveDir = "$uploadDir/.archive/$appName"; $archiveRelPath = ".archive/$appName/$newVersion.7z";
$archiveFile = "$archiveDir/$newVersion.7z"; $archiveFullPath = "$accessDir/$archiveRelPath";
// Updates the application // Updates the application
copy($moduleFile['tmp_name'], $archiveFile); rename($moduleFile['tmp_name'], $archiveFullPath);
rename($moduleFile['tmp_name'], $uploadFile); chmod($archiveFullPath, 0644);
chmod($archiveFile, 0644);
@unlink ($headFile);
symlink($headFile, $archiveRelPath);
return TRUE; return TRUE;
} }