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

Implementation of an app provider for Overleaf #4084

Merged
merged 33 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4a9e517
Add air config example
javfg May 12, 2023
2b3033d
temporary workaround for EOS-5754 (#45)
labkode Jul 21, 2023
f363551
Initial implementation of an app provider for Overleaf
Jul 27, 2023
f5b5946
Added changelog
Jul 27, 2023
2eea3ea
Fixed New function and updated config
Jul 27, 2023
4929172
Updated description of folder_base_url to better fit use case
Jul 27, 2023
5fd9014
Improved request and made use of Target and Action fields
Jul 31, 2023
e432edd
Added checks for when a project is exported twice
Aug 2, 2023
7253754
Improved date format and naming of meta data
Aug 2, 2023
6c967c8
wrapped errors to be more descriptive
Aug 2, 2023
f62ae90
Improved config
Aug 3, 2023
6223596
Adding context to New
Aug 3, 2023
2ee5f9f
Linting
Aug 3, 2023
23b1f15
Removing a check in http appprovider service so it allows folders
Aug 4, 2023
ae197f8
Fixed check
Aug 4, 2023
e6da495
Improving external attribute names and adding name attribute
Aug 7, 2023
fc5816d
Moved overleaf app provider to a service
Aug 10, 2023
8d6c4f9
Adapted Overleaf New fn and removed from loaders
Aug 10, 2023
aa756de
Base encoding project name to avoid problem with spaces
Aug 14, 2023
2d25a99
Refactoring out features common to import and export
Aug 15, 2023
4242461
Removing unnecessary files for air config
Aug 24, 2023
f960ddb
Updating parsing of config
Aug 24, 2023
c300c65
Refactoring and adding required property to fields
Aug 24, 2023
926d3fa
Refactoring Handler, resource id and deleting unnecessary file
Aug 24, 2023
26e5160
Revert "Refactoring Handler, resource id and deleting unnecessary file"
Aug 24, 2023
ec18636
Revert "temporary workaround for EOS-5754 (#45)"
Aug 24, 2023
f7abf7a
Refactoring id and handler
Aug 24, 2023
c6f595a
Restricting token to scope of resource
Aug 24, 2023
752f5d0
Added changelog
Aug 24, 2023
03ef853
Change validateQuery to getExportRequest which validates parameters
Aug 24, 2023
996367a
Amending error message to include case where resource is a container
Aug 24, 2023
c176fe4
Removing unnecessary leftover check
Aug 25, 2023
7295890
Linting
abaldacchino Aug 25, 2023
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ tests/ocis/tests/acceptance/work_tmp
# drone
.drone.yml

# air config file
.air.toml

toolchain/
10 changes: 10 additions & 0 deletions changelog/unreleased/overleaf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Enhancement: implementation of an app provider for Overleaf

This PR adds an app provider for Overleaf as a standalone http service.

The app provider currently consists of support for the export to Overleaf
feature, which when called returns a URL to Overleaf that prompts Overleaf
to download the appropriate resource making use of the Archiver service,
and upload the files to a user's Overleaf account.

https://github.com/cs3org/reva/pull/4084
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
title: "overleaf"
linkTitle: "overleaf"
weight: 10
description: >
Configuration for the overleaf service
---

# _struct: config_

{{% dir name="mime_types" type="[]string" default=nil %}}
Inherited from the appprovider. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/app/provider/overleaf/overleaf.go#L69)
{{< highlight toml >}}
[app.provider.overleaf]
mime_types = nil
{{< /highlight >}}
{{% /dir %}}

{{% dir name="iop_secret" type="string" default="" %}}
The IOP secret used to connect to the wopiserver. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/app/provider/overleaf/overleaf.go#L70)
{{< highlight toml >}}
[app.provider.overleaf]
iop_secret = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="app_name" type="string" default="" %}}
The App user-friendly name. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/app/provider/overleaf/overleaf.go#L71)
{{< highlight toml >}}
[app.provider.overleaf]
app_name = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="app_icon_uri" type="string" default="" %}}
A URI to a static asset which represents the app icon. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/app/provider/overleaf/overleaf.go#L72)
{{< highlight toml >}}
[app.provider.overleaf]
app_icon_uri = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="folder_base_url" type="string" default="" %}}
The base URL to generate links to navigate back to the containing folder. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/app/provider/overleaf/overleaf.go#L73)
{{< highlight toml >}}
[app.provider.overleaf]
folder_base_url = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="app_url" type="string" default="" %}}
The App URL. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/app/provider/overleaf/overleaf.go#L74)
{{< highlight toml >}}
[app.provider.overleaf]
app_url = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="app_int_url" type="string" default="" %}}
The internal app URL in case of dockerized deployments. Defaults to AppURL [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/app/provider/overleaf/overleaf.go#L75)
{{< highlight toml >}}
[app.provider.overleaf]
app_int_url = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="app_api_key" type="string" default="" %}}
The API key used by the app, if applicable. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/app/provider/overleaf/overleaf.go#L76)
{{< highlight toml >}}
[app.provider.overleaf]
app_api_key = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="jwt_secret" type="string" default="" %}}
The JWT secret to be used to retrieve the token TTL. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/app/provider/overleaf/overleaf.go#L77)
{{< highlight toml >}}
[app.provider.overleaf]
jwt_secret = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="app_desktop_only" type="bool" default=false %}}
Specifies if the app can be opened only on desktop. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/app/provider/overleaf/overleaf.go#L78)
{{< highlight toml >}}
[app.provider.overleaf]
app_desktop_only = false
{{< /highlight >}}
{{% /dir %}}

4 changes: 2 additions & 2 deletions internal/http/services/appprovider/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ func (s *svc) handleOpen(w http.ResponseWriter, r *http.Request) {
return
}

if statRes.Info.Type != storagepb.ResourceType_RESOURCE_TYPE_FILE {
writeError(w, r, appErrorInvalidParameter, "the given file id does not point to a file", nil)
if statRes.Info.Type != storagepb.ResourceType_RESOURCE_TYPE_FILE && statRes.Info.Type != storagepb.ResourceType_RESOURCE_TYPE_CONTAINER {
writeError(w, r, appErrorInvalidParameter, "the given file id does not point to a file or a container", nil)
return
}

Expand Down
1 change: 1 addition & 0 deletions internal/http/services/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
_ "github.com/cs3org/reva/internal/http/services/metrics"
_ "github.com/cs3org/reva/internal/http/services/ocmd"
_ "github.com/cs3org/reva/internal/http/services/ocmprovider"
_ "github.com/cs3org/reva/internal/http/services/overleaf"
_ "github.com/cs3org/reva/internal/http/services/owncloud/ocdav"
_ "github.com/cs3org/reva/internal/http/services/owncloud/ocs"
_ "github.com/cs3org/reva/internal/http/services/plugins"
Expand Down
Loading
Loading