summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--appinfo/info.xml1
-rw-r--r--lib/Command/CheckInstall.php88
-rw-r--r--lib/Controller/NavigationController.php12
-rw-r--r--lib/Db/FollowsRequest.php3
-rw-r--r--lib/Service/ConfigService.php9
5 files changed, 106 insertions, 7 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml
index d8b84cd8..9f1468c9 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -46,6 +46,7 @@
<commands>
<command>OCA\Social\Command\CacheRefresh</command>
+ <command>OCA\Social\Command\CheckInstall</command>
<command>OCA\Social\Command\NoteCreate</command>
<command>OCA\Social\Command\NoteBoost</command>
<command>OCA\Social\Command\Reset</command>
diff --git a/lib/Command/CheckInstall.php b/lib/Command/CheckInstall.php
new file mode 100644
index 00000000..fcd06aa0
--- /dev/null
+++ b/lib/Command/CheckInstall.php
@@ -0,0 +1,88 @@
+<?php
+declare(strict_types=1);
+
+
+/**
+ * Nextcloud - Social Support
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Maxence Lange <maxence@artificial-owl.com>
+ * @copyright 2018, Maxence Lange <maxence@artificial-owl.com>
+ * @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\Social\Command;
+
+
+use Exception;
+use OC\Core\Command\Base;
+use OCA\Social\Service\CheckService;
+use OCA\Social\Service\MiscService;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+
+class CheckInstall extends Base {
+
+
+ /** @var CheckService */
+ private $checkService;
+
+ /** @var MiscService */
+ private $miscService;
+
+
+ /**
+ * CacheUpdate constructor.
+ *
+ * @param CheckService $checkService
+ * @param MiscService $miscService
+ */
+ public function __construct(CheckService $checkService, MiscService $miscService) {
+ parent::__construct();
+
+ $this->checkService = $checkService;
+ $this->miscService = $miscService;
+ }
+
+
+ /**
+ *
+ */
+ protected function configure() {
+ parent::configure();
+ $this->setName('social:check:install')
+ ->setDescription('Check the integrity of the installation');
+ }
+
+
+ /**
+ * @param InputInterface $input
+ * @param OutputInterface $output
+ *
+ * @throws Exception
+ */
+ protected function execute(InputInterface $input, OutputInterface $output) {
+ $this->checkService->checkInstallationStatus();
+ }
+
+
+}
+
diff --git a/lib/Controller/NavigationController.php b/lib/Controller/NavigationController.php
index fd2ae48c..2621c7c0 100644
--- a/lib/Controller/NavigationController.php
+++ b/lib/Controller/NavigationController.php
@@ -189,15 +189,15 @@ class NavigationController extends Controller {
}
private function setupCloudAddress(): string {
- $frontControllerActive =
- ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true
- || getenv('front_controller_active') === 'true');
+// $frontControllerActive =
+// ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true
+// || getenv('front_controller_active') === 'true');
$cloudAddress = rtrim($this->config->getSystemValue('overwrite.cli.url', ''), '/');
if ($cloudAddress !== '') {
- if (!$frontControllerActive) {
- $cloudAddress .= '/index.php';
- }
+// if (!$frontControllerActive) {
+// $cloudAddress .= '/index.php';
+// }
$this->configService->setCloudAddress($cloudAddress);
return $cloudAddress;
diff --git a/lib/Db/FollowsRequest.php b/lib/Db/FollowsRequest.php
index 6c9855a9..ec8a7582 100644
--- a/lib/Db/FollowsRequest.php
+++ b/lib/Db/FollowsRequest.php
@@ -33,6 +33,7 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
use DateTime;
+use Exception;
use OCA\Social\Exceptions\FollowDoesNotExistException;
use OCA\Social\Model\ActivityPub\Object\Follow;
use OCP\DB\QueryBuilder\IQueryBuilder;
@@ -53,6 +54,8 @@ class FollowsRequest extends FollowsRequestBuilder {
* Insert a new Note in the database.
*
* @param Follow $follow
+ *
+ * @throws Exception
*/
public function save(Follow $follow) {
$qb = $this->getFollowsInsertSql();
diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php
index 4236b9de..cdfee8e3 100644
--- a/lib/Service/ConfigService.php
+++ b/lib/Service/ConfigService.php
@@ -262,6 +262,12 @@ class ConfigService {
throw new SocialAppConfigException();
}
+ // fixing address for alpha2
+ if (substr($address, -10) === '/index.php') {
+ $address = substr($address, 0, -10);
+ $this->setCloudAddress($address);
+ }
+
if ($host === true) {
$parsed = parse_url($address);
$result = $this->get('host', $parsed, '');
@@ -288,7 +294,8 @@ class ConfigService {
$path = $this->urlGenerator->linkToRoute('social.Navigation.navigate');
}
- return 'https://' . $this->getCloudAddress(true) . $path;
+ return $this->getCloudAddress() . $path;
+// return 'https://' . $this->getCloudAddress(true) . $path;
}