33 * SPDX-License-Identifier: Apache-2.0
44-->
55
6- # Setting Up Sipi for Knora
6+ # Setting Up Sipi for DSP-API
77
88## Setup and Execution
99
1010In order to serve files to the client application like the Salsah GUI,
1111Sipi must be set up and running. Sipi can be downloaded from its own
12- GitHub repository: < https://github.com/dhlab-basel/Sipi > (which requires
12+ GitHub repository: < https://github.com/dasch-swiss/sipi > (which requires
1313building from source), or the published [ docker image] ( https://hub.docker.com/r/daschswiss/sipi/ ) .
1414can be used. To start Sipi, run the following command from inside the ` sipi/ `
1515folder:
1616
1717```
1818$ export DOCKERHOST=LOCAL_IP_ADDRESS
1919$ docker image rm --force daschswiss/sipi:main // deletes cached image and needs only to be used when newer image is available on dockerhub
20- $ docker run --rm -it --add-host webapihost:$DOCKERHOST -v $PWD/config:/sipi/config -v $PWD/scripts:/sipi/scripts -v /tmp:/tmp -v $HOME:$HOME -p 1024:1024 daschswiss/sipi:main --config=/sipi/config/sipi.knora- docker-config.lua
20+ $ docker run --rm -it --add-host webapihost:$DOCKERHOST -v $PWD/config:/sipi/config -v $PWD/scripts:/sipi/scripts -v /tmp:/tmp -v $HOME:$HOME -p 1024:1024 daschswiss/sipi:main --config=/sipi/config/sipi.docker-config.lua
2121```
2222
23- where ` LOCAL_IP_ADDRESS ` is the IP of the host running the ` Knora ` .
23+ where ` LOCAL_IP_ADDRESS ` is the IP of the host running ` DSP-API ` .
2424
25- ` --config=/sipi/config/sipi.knora-docker-config.lua ` (or ` --config=/sipi/config/sipi.knora-docker-it-config.lua ` for
26- using sipi for integration testing). Please see ` sipi.knora-docker-config.lua ` for the settings like URL, port number
27- etc. These settings need to be set accordingly in Knora's ` application.conf ` . If you use the default settings both in
28- Sipi and Knora, there is no need to change these settings.
25+ ` --config=/sipi/config/sipi.docker-config.lua ` . Please see ` sipi.docker-config.lua ` for the settings like URL, port number
26+ etc. These settings need to be set according to DSP-API's ` application.conf ` . If you use the default settings both in
27+ Sipi and DSP-API, there is no need to change these settings.
2928
3029Whenever a file is requested from Sipi (e.g. a browser trying to
31- dereference an image link served by Knora ), a preflight function is
32- called. This function is defined in ` sipi.init-knora .lua ` present in the
30+ dereference an image link served by DSP-API ), a preflight function is
31+ called. This function is defined in ` sipi.init.lua ` present in the
3332Sipi root directory. It takes three parameters: ` prefix ` , ` identifier `
3433(the name of the requested file), and ` cookie ` . The prefix is the shortcode
3534of the project that the resource containing the file value belongs to.
3635
37- Given this information, Sipi asks Knora about the current's users
38- permissions on the given file. The cookie contains the current user's
39- Knora session id, so Knora can match Sipi's request with a given user
36+ Given this information, Sipi asks the API about the current user's
37+ permissions on the given file. The cookie contains the current user's
38+ session id, so the API can match Sipi's request with a given user
4039profile and determine the permissions this user has on the file. If the
41- Knora response grants sufficient permissions, the file is served in the
42- requested quality. If the suer has preview rights, Sipi serves a reduced
40+ response grants sufficient permissions, the file is served in the
41+ requested quality. If the user has preview rights, Sipi serves the file in reduced
4342quality or integrates a watermark. If the user has no permissions, Sipi
4443refuses to serve the file. However, all of this behaviour is defined in
45- the preflight function in Sipi and not controlled by Knora. Knora only
44+ the preflight function in Sipi and not controlled by the API. DSP-API only
4645provides the permission code.
4746
48- See [ Authentication of Users with Sipi] ( sipi-and-knora .md#authentication-of-users-with-sipi ) for more
47+ See [ Authentication of Users with Sipi] ( sipi-and-dsp-api .md#authentication-of-users-with-sipi ) for more
4948information about sharing the session ID.
5049
5150## Using Sipi in Test Mode
5251
53- If you just want to test Sipi with Knora without serving the actual
52+ If you just want to test Sipi with DSP-API without serving the actual
5453files (e.g. when executing browser tests), you can simply start Sipi
5554like this:
5655
5756```
5857$ export DOCKERHOST=LOCAL_IP_ADDRESS
5958$ docker image rm --force daschswiss/sipi:main // deletes cached image and needs only to be used when newer image is available on dockerhub
60- $ docker run --rm -it --add-host webapihost:$DOCKERHOST -v $PWD/config:/sipi/config -v $PWD/scripts:/sipi/scripts -v /tmp:/tmp -v $HOME:$HOME -p 1024:1024 daschswiss/sipi:main --config=/sipi/config/sipi.knora- docker-test-config.lua
59+ $ docker run --rm -it --add-host webapihost:$DOCKERHOST -v $PWD/config:/sipi/config -v $PWD/scripts:/sipi/scripts -v /tmp:/tmp -v $HOME:$HOME -p 1024:1024 daschswiss/sipi:main --config=/sipi/config/sipi.docker-test-config.lua
6160```
6261
63- Then always the same test file will be served which is included in Sipi. In test mode, Sipi will
64- not ask Knora about the user's permission on the requested file.
62+ Then always the same test file will be served which is delivered with Sipi. In test mode, Sipi will
63+ not ask DSP-API about the user's permission on the requested file.
6564
6665## Additional Sipi Environment Variables
6766
@@ -70,7 +69,7 @@ Additionally, these environment variables can be used to further configure Sipi:
7069- ` SIPI_WEBAPI_HOSTNAME=localhost ` : overrides ` knora_path ` in Sipi's config
7170- ` SIPI_WEBAPI_PORT=3333 ` : overrides ` knora_port ` in Sipi's config
7271
73- These variables need to be explicitly used like in ` sipi.ini-knora .lua ` :
72+ These variables need to be explicitly used like in ` sipi.init .lua ` :
7473
7574``` lua
7675 --
0 commit comments