Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/nextcloud28 #151

Merged
merged 10 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
runs-on: ubuntu-latest
strategy:
matrix:
# For the latest version information see: https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule

Check warning on line 31 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

31:121 [line-length] line too long (123 > 120 characters)

Check warning on line 31 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

31:121 [line-length] line too long (123 > 120 characters)

Check warning on line 31 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

31:121 [line-length] line too long (123 > 120 characters)
# Versions before 22 are not tested as they run on PHP versions lower than 8.0
# Versions before 24 are not tested as they do not support `.well-known` entries
# Version 24 comes with PHP 8.0, which is no longer supported;
Expand All @@ -37,6 +37,7 @@
- 25
- 26
- 27
- 28

steps:
- name: Create docker tag from git reference
Expand Down Expand Up @@ -69,7 +70,7 @@
.
docker push "ghcr.io/pdsinterop/solid-nextcloud:${{ env.TAG }}"
mkdir -p cache/solid-nextcloud
docker image save solid-nextcloud:${{ env.TAG }} --output ./cache/solid-nextcloud/${{ github.sha }}-${{ matrix.nextcloud_version }}.tar

Check warning on line 73 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

73:121 [line-length] line too long (145 > 120 characters)

Check warning on line 73 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

73:121 [line-length] line too long (145 > 120 characters)

Check warning on line 73 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

73:121 [line-length] line too long (145 > 120 characters)

solid-testsuite:
timeout-minutes: 30
Expand All @@ -85,13 +86,14 @@
- 25
- 26
- 27
- 28
test:
- 'solidtestsuite/solid-crud-tests:v7.0.5'
- 'solidtestsuite/web-access-control-tests:v7.1.0'
- 'solidtestsuite/webid-provider-tests:v2.1.0'

# Prevent EOL or non-stable versions of Nextcloud to fail the test-suite
continue-on-error: ${{ contains(fromJson('[25,26,27]'), matrix.nextcloud_version) == false }}
continue-on-error: ${{ contains(fromJson('[25,26,27,28]'), matrix.nextcloud_version) == false }}

steps:
- name: Create docker tag from git reference
Expand Down
2 changes: 1 addition & 1 deletion solid/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ IMPORTANT: See https://github.com/pdsinterop/solid-nextcloud/blob/main/INSTALL.m
<category>integration</category>
<bugs>https://github.com/pdsinterop/solid-nextcloud/issues</bugs>
<dependencies>
<nextcloud min-version="25" max-version="27"/>
<nextcloud min-version="25" max-version="28"/>
</dependencies>
<settings>
<admin>\OCA\Solid\Settings</admin>
Expand Down
75 changes: 20 additions & 55 deletions solid/img/app.svg
Potherca marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 17 additions & 23 deletions solid/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use OC\Server;

use OCA\Solid\Service\UserService;
use OCA\Solid\Service\SolidWebhookService;
use OCA\Solid\Db\SolidWebhookMapper;
use OCA\Solid\WellKnown\OpenIdConfigurationHandler;
use OCA\Solid\WellKnown\SolidHandler;
use OCA\Solid\Middleware\SolidCorsMiddleware;
Expand All @@ -23,6 +25,7 @@
use OCP\IServerContainer;
use OCP\Settings\IManager;
use OCP\Util;
use OCP\IDBConnection;

class Application extends App implements IBootstrap {
public const APP_ID = 'solid';
Expand All @@ -32,34 +35,12 @@ class Application extends App implements IBootstrap {
*/
public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);

$container = $this->getContainer();

$container->registerService(SolidCorsMiddleware::class, function($c): SolidCorsMiddleware {
return new SolidCorsMiddleware(
$c->get(IRequest::class)
);
});

// executed in the order that it is registered
$container->registerMiddleware(SolidCorsMiddleware::class);

$container->registerService(SolidWebhookService::class, function($c): SolidWebhookService {
return new SolidWebhookService(
$c->query(SolidWebhookMapper::class)
);
});

$container->registerService(SolidWebhookMapper::class, function($c): SolidWebhookMapper {
return new SolidWebhookMapper(
$c->get(IDBConnection::class)
);
});
}

public function register(IRegistrationContext $context): void {
$context->registerWellKnownHandler(\OCA\Solid\WellKnown\OpenIdConfigurationHandler::class);
$context->registerWellKnownHandler(\OCA\Solid\WellKnown\SolidHandler::class);
$context->registerMiddleware(SolidCorsMiddleware::class);

/**
* Core class wrappers
Expand All @@ -79,6 +60,19 @@ public function register(IRegistrationContext $context): void {
$context->registerService('User', function($c) {
return $c->query('UserSession')->getUser();
});

/* webhook DB services */
$context->registerService(SolidWebhookService::class, function($c): SolidWebhookService {
return new SolidWebhookService(
$c->query(SolidWebhookMapper::class)
);
});

$context->registerService(SolidWebhookMapper::class, function($c): SolidWebhookMapper {
return new SolidWebhookMapper(
$c->get(\OCP\IDBConnection::class)
);
});
}

public function boot(IBootContext $context): void {
Expand Down
2 changes: 1 addition & 1 deletion solid/lib/Controller/StorageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ private function respond($response) {
$policy->addAllowedFontDomain("*");
$policy->addAllowedConnectDomain("*");
$policy->allowInlineStyle(true);
$policy->allowInlineScript(true);
// $policy->allowInlineScript(true); - removed, this function no longer exists in NC28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be documented (somewhere?) that allowedScriptDomains or evalScriptAllowed should now be used to enable the script-src policy?

$policy->allowEvalScript(true);
$result->setContentSecurityPolicy($policy);

Expand Down
2 changes: 1 addition & 1 deletion solid/templates/applauncher.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
style('solid', 'style');
?>

<div id="app-navigation">
<div id="app-navigation" class="app-navigation-personal">
<?php print_unescaped($this->inc('navigation/index')); ?>
</div>

Expand Down
2 changes: 1 addition & 1 deletion solid/templates/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
style('solid', 'style');
?>

<div id="app-navigation">
<div id="app-navigation" class="app-navigation-personal">
<?php print_unescaped($this->inc('navigation/index')); ?>
</div>

Expand Down
Loading