0
1
Fork 0

access-version fixes

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.

View File

@ -14,7 +14,7 @@ services:
target: /etc/hedera-web/config.test.php
volumes:
- /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:
replicas: 3
cron:

View File

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

View File

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