Skip to content

Commit 557d129

Browse files
committed
add cloud federation api app
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
1 parent 2179200 commit 557d129

File tree

14 files changed

+1610
-0
lines changed

14 files changed

+1610
-0
lines changed

apps/cloud_federation_api/LICENSE

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

apps/cloud_federation_api/Makefile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
app_name=end_to_end_encryption
2+
3+
project_dir=$(CURDIR)/../$(app_name)
4+
build_dir=$(CURDIR)/build/artifacts
5+
appstore_dir=$(build_dir)/appstore
6+
source_dir=$(build_dir)/source
7+
sign_dir=$(build_dir)/sign
8+
package_name=$(app_name)
9+
cert_dir=$(HOME)/.nextcloud/certificates
10+
version+=1.0.1
11+
12+
all: appstore
13+
14+
release: appstore create-tag
15+
16+
create-tag:
17+
git tag -s -a v$(version) -m "Tagging the $(version) release."
18+
git push origin v$(version)
19+
20+
clean:
21+
rm -rf $(build_dir)
22+
rm -rf node_modules
23+
24+
appstore: clean
25+
mkdir -p $(sign_dir)
26+
rsync -a \
27+
--exclude=/build \
28+
--exclude=/docs \
29+
--exclude=/l10n/templates \
30+
--exclude=/l10n/.tx \
31+
--exclude=/tests \
32+
--exclude=/.git \
33+
--exclude=/.github \
34+
--exclude=/l10n/l10n.pl \
35+
--exclude=/CONTRIBUTING.md \
36+
--exclude=/issue_template.md \
37+
--exclude=/README.md \
38+
--exclude=/.gitattributes \
39+
--exclude=/.gitignore \
40+
--exclude=/.scrutinizer.yml \
41+
--exclude=/.drone.yml \
42+
--exclude=/.travis.yml \
43+
--exclude=/Makefile \
44+
$(project_dir)/ $(sign_dir)/$(app_name)
45+
tar -czf $(build_dir)/$(app_name)-$(version).tar.gz \
46+
-C $(sign_dir) $(app_name)
47+
@if [ -f $(cert_dir)/$(app_name).key ]; then \
48+
echo "Signing package…"; \
49+
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name)-$(version).tar.gz | openssl base64; \
50+
fi
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cloud_federation_api
2+
The cloud federation API allows to share information like files, contacts, calendars, incoming calls, etc accross Nextcloud instances
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
4+
*
5+
* @license GNU AGPL version 3 or any later version
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*
20+
*/
21+
22+
$app = new \OCA\CloudFederationAPI\AppInfo\Application();
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0"?>
2+
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
4+
<id>cloud_federation_api</id>
5+
<name>Cloud Federation API</name>
6+
<summary>Enable clouds to communicate with each other and exchange data</summary>
7+
<description>The Coud Federation API enabled various Nextcloud instances to communitcate with each other and to exchange data</description>
8+
<version>0.0.1</version>
9+
<licence>agpl</licence>
10+
<author>Bjoern Schiessle</author>
11+
<namespace>CloudFederationAPI</namespace>
12+
<types>
13+
<filesystem/>
14+
</types>
15+
<category>files</category>
16+
<bugs>https://github.com/nextcloud/cloud_federation/issues</bugs>
17+
<dependencies>
18+
<nextcloud min-version="14" max-version="14"/>
19+
</dependencies>
20+
</info>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
4+
*
5+
* @license GNU AGPL version 3 or any later version
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*
20+
*/
21+
22+
23+
namespace OCA\CloudFederationAPI\AppInfo;
24+
25+
26+
use OCA\CloudFederationAPI\Capabilities;
27+
use OCP\AppFramework\App;
28+
29+
class Application extends App {
30+
31+
public function __construct() {
32+
parent::__construct('cloud_federation_api');
33+
34+
$container = $this->getContainer();
35+
$container->registerCapability(Capabilities::class);
36+
}
37+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2017 Bjoern Schiessle <bjoern@schiessle.org>
4+
*
5+
* @license GNU AGPL version 3 or any later version
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*
20+
*/
21+
22+
23+
namespace OCA\CloudFederationAPI;
24+
25+
26+
use OCP\Capabilities\ICapability;
27+
use OCP\IURLGenerator;
28+
29+
class Capabilities implements ICapability {
30+
31+
/** @var IURLGenerator */
32+
private $urlGenerator;
33+
34+
public function __construct(IURLGenerator $urlGenerator) {
35+
$this->urlGenerator = $urlGenerator;
36+
}
37+
38+
/**
39+
* Function an app uses to return the capabilities
40+
*
41+
* @return array Array containing the apps capabilities
42+
* @since 8.2.0
43+
*/
44+
public function getCapabilities() {
45+
$url = $this->urlGenerator->linkToRouteAbsolute('cloud_federation_api.requesthandlercontroller.addShare');
46+
$capabilities = ['ocm' =>
47+
[
48+
'enabled' => true,
49+
'api-version' => '2.0-draft',
50+
'end-point' => substr($url, 0, strrpos($url, '/')),
51+
]
52+
];
53+
54+
return $capabilities;
55+
}
56+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
4+
*
5+
* @license GNU AGPL version 3 or any later version
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*
20+
*/
21+
22+
23+
namespace OCA\CloudFederationAPI;
24+
25+
26+
/**
27+
* Class config
28+
*
29+
* handles all the config parameters
30+
*
31+
* @package OCA\CloudFederationAPI
32+
*/
33+
class Config {
34+
35+
public function __construct() {
36+
}
37+
38+
public function incomingRequestsEnabled() {
39+
return true;
40+
}
41+
42+
public function outgoingRequestsEnabled() {
43+
return true;
44+
}
45+
46+
}

0 commit comments

Comments
 (0)