Skip to content
Snippets Groups Projects
Commit 81bd6436 authored by Robin Appelman's avatar Robin Appelman
Browse files

try to fix binary permissions on install/upgrade

parent 272bf74b
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
<description><![CDATA[Push update support for desktop app.
Once the app is installed, the push binary needs to be setup. You can either use the setup wizard with `occ notify_push:setup` or see the [README](http://github.com/nextcloud/notify_push) for detailed setup instructions]]></description>
<version>0.1.2</version>
<version>0.1.3</version>
<licence>agpl</licence>
<author>Robin Appelman</author>
<namespace>NotifyPush</namespace>
......@@ -26,6 +26,12 @@ Once the app is installed, the push binary needs to be setup. You can either use
<nextcloud min-version="21" max-version="21"/>
</dependencies>
<repair-steps>
<install>
<step>OCA\NotifyPush\Migration\Install</step>
</install>
</repair-steps>
<commands>
<command>OCA\NotifyPush\Command\Setup</command>
<command>OCA\NotifyPush\Command\SelfTest</command>
......
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2021 Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\NotifyPush\Migration;
use OCA\NotifyPush\SetupWizard;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
class Install implements IRepairStep {
private $setupWizard;
public function __construct(SetupWizard $setupWizard) {
$this->setupWizard = $setupWizard;
}
public function getName() {
return 'Set binary permissions';
}
public function run(IOutput $output) {
$this->setupWizard->testBinary();
}
}
......@@ -81,9 +81,10 @@ class SetupWizard {
$path = $this->getBinaryPath();
@chmod($path, 0755);
$appVersion = $this->appManager->getAppVersion("notify_push");
$appVersion = substr($appVersion, 0, strrpos($appVersion, '.'));
$output = [];
exec("$path --version", $output);
return count($output) === 1 && $output[0] === "notify_push $appVersion";
return count($output) === 1 && strpos($output[0], "notify_push $appVersion") === 0;
}
public function isPortFree(): bool {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment