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

feat: add basic csp config #636

Merged
merged 4 commits into from
Jul 12, 2024
Merged

feat: add basic csp config #636

merged 4 commits into from
Jul 12, 2024

Conversation

dschmidt
Copy link
Member

Description

This adds a basic csp config.

Related Issue

Motivation and Context

Enables loading oC Web.

This needs further work for enabling office suites, but that could maybe be tackled after/or while integrating the new collaboration service.

How Has This Been Tested?

  • deployed it in a demo environment and oC Web didn't refuse to load anymore

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

@wkloucek
Copy link
Contributor

We should expose config options to be actually able to use integrations like eg. Drawio.

@dschmidt
Copy link
Member Author

dschmidt commented Jul 11, 2024

Do you insist on having it inside this PR?

I would suggest to iterate, as in the current state of the repo it's not possible to login at all and this PR at least makes it possible to run a very simple ocis without offices or drawio

@wkloucek
Copy link
Contributor

Do you insist on having it inside this PR?

Yes, except you can explain which value your current PR provide over the default oCIS config.

@wkloucek
Copy link
Contributor

wkloucek commented Jul 11, 2024

I would suggest to iterate, as in the current state of the repo it's not possible to login at all and this PR at least makes it possible to run a very simple ocis without offices or drawio

this is already possible on main ( minus the office and drawio, but therefore we have the current PR in my opinion)

Once CSP is configurable, we can see how that blends into the collaboration service integration #567

@dschmidt
Copy link
Member Author

Ah, I see - unsafe-eval is missing from the default config which causes errors in the console:

Screenshot_20240711_155001

I had added it locally but removed it before pushing because I thought that shouldn't be something we actually set in the helm charts... I didn't realize this was the only reason I needed this change.

As I'm not so familiar with how you handle optional features here: if it takes you longer to tell me how to implement this, feel free to take this PR over

@dschmidt
Copy link
Member Author

dschmidt commented Jul 11, 2024

Meanwhile I would try to figure out if we can get rid of the unsafe-eval requirement in Web...

edit:
apparently caused by the Vue.js Devtools, so irrelevant here

@micbar
Copy link
Contributor

micbar commented Jul 11, 2024

In the ocis full deployment we were forced to add

  • the idp url to connect-src to get token refresh still working
  • the web office urls to frame-src and img-src
  • uppy companion url and web socket to connect-src for the cloud importer

@wkloucek wkloucek requested a review from d7oc July 12, 2024 06:28
@wkloucek
Copy link
Contributor

I tested it with following deployment examples:

  • development-install
  • external-user-management

Office will be added in #567

@wkloucek wkloucek requested a review from case0sh July 12, 2024 06:29
@@ -14,7 +14,7 @@ data:
policy: ocis
{{- with $.Values.features.quotas.roles }}
role_quotas:
{{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 4 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Sure about the 4? I would say it should be 6

Copy link
Contributor

@wkloucek wkloucek Jul 12, 2024

Choose a reason for hiding this comment

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

actually this should have kept unchanged, will revert it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm but unchanged (so 4) also sounds wrong to me if I look at the indentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

It was reverted in 8d67428

# - user-management
# - admin-settings
# - epub-reader
# - draw-io
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that officially available know?

Copy link
Contributor

Choose a reason for hiding this comment

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

I just took it from the documentation for oCIS 6.1: https://owncloud.dev/services/web/configuration/

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. I not sure if this is the right place to look if something is considered stable.

@micbar Can I please have your vote here? TIA

Copy link
Contributor

@wkloucek wkloucek Jul 12, 2024

Choose a reason for hiding this comment

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

Hmm. I not sure if this is the right place to look if something is considered stable.

what do you mean by "stable" ? I agree that owncloud.dev might change over time because it has no concept of oCIS versions, while doc.owncloud.com has. But for rolling releases like 6.1.0 there is no documentation on doc.owncloud.com from what I know.

In this particular case and because of the timing, owncloud.dev and the released code are in sync: https://github.com/owncloud/ocis/blob/v6.1.0/services/web/pkg/config/defaults/defaultconfig.go#L101

EDIT: because of the time constraint, I also did a screenshot of the documentation instead of linking to it

@wkloucek wkloucek merged commit b6e5ece into main Jul 12, 2024
1 check passed
@wkloucek wkloucek deleted the feat/csp branch July 12, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants