Open glpatcern opened 2 years ago
@glpatcern I am interested to work on this tasks during my free time. One question before I start working on MAC, do I have to make these folder in the laptops main directory such as (etc, var) or wopi server in the project directory? I have referenced it below.
Hi there, those instructions refer to a production deployment, and as indicated they concern the system top-level folders. You can also run everything in a container, see the Dockerfile for details (where you see the same files in the container's top level folders).
Thank you for the information. I was able to run the Wopi server on local in Ubuntu. When I go to http://192.168.1.106:8880/wopi , I get the follow screen.
However, when I go to any other route like "/wopi/iop/openinapp", it says "Client not authorized".
Furthermore, I researched some implementations for improving the handling of globals. One of the most elegant ways I was able to figure it out was by Flask. It provides the g object, which is a global namespace that can store data during the life of a request. @glpatcern , I would appreciate to know your opinion!
However, when I go to any other route like "/wopi/iop/openinapp", it says "Client not authorized".
That means you didn't provide the required authorization token.
Furthermore, I researched some implementations for improving the handling of globals. One of the most elegant ways I was able to figure it out was by Flask. It provides the g object, which is a global namespace that can store data during the life of a request.
If it only survives during the life of a request, it does not fit the purpose: as you can see in the code, there are a number of global variables that live "forever", until the server is shut down.
Thank you for the information! I have got two more points. 🙂
How do I add an authorization token?
Please have a look at the examples such as https://github.com/cs3org/wopiserver/blob/master/tools/wopiopen.py
Well there is another method that involves Flask's configuration handling. It allows you to set global settings that are accessible across the entire application.
Can you share more details about this "other method"? Consider that here we're talking about global references to packages or classes, not just settings.
For the first point, I am going through the file for authorization that you shared with me. 🙂
For the second point, I was considering putting all the globals in the app.config file and referencing them from there to get their value, but better global handling can also be achieved through custom Flask extensions or modules that encapsulate global references to packages or classes. It can help manage and organize these references more effectively.
@glpatcern, I went through the file you shared with me and if the second point's method in the comment is fine for you, I will start working on this issue. 🙂
Hi there, to me it's not yet clear the method you want to pursue. Maybe you could start with a minimal modification and PR to validate the principle
This refers in particular to the core code base and the storage interfaces.