Skip to content

Commit cfe5754

Browse files
Merge pull request #50 from owncloud/enable-dynamic-app-loading
Enable dynamic app loading
2 parents 8e21151 + 9478343 commit cfe5754

File tree

5 files changed

+89
-4
lines changed

5 files changed

+89
-4
lines changed

README.md

+34-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ownCloud Web DICOM Viewer
22

33
[![Build Status](https://drone.owncloud.com/api/badges/owncloud/web-app-dicom-viewer/status.svg)](https://drone.owncloud.com/owncloud/web-app-dicom-viewer)
4-
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=owncloud_web-app-dicom-viewer&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=owncloud_web-app-dicom-viewer)
4+
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=owncloud_web-app-dicom-viewer&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=owncloud_web-app-dicom-viewer)
55
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=owncloud_web-app-dicom-viewer&metric=coverage)](https://sonarcloud.io/summary/new_code?id=owncloud_web-app-dicom-viewer)
66

77
The ownCloud Web DICOM Viewer app is an extension of [ownCloud Web](https://github.com/owncloud/web) to preview DICOM files (medical images and their corresponding metadata) in the browser. The preview of the medical images is based on MIT licensed [cornerstone3D](https://github.com/cornerstonejs/cornerstone3D).
@@ -16,7 +16,29 @@ The current implementation allows to preview .dcm files and display their corres
1616
- **Supported architectures:**\
1717
`amd64`
1818

19-
## Config
19+
## Installation
20+
21+
### 1. Install dependencies
22+
23+
```
24+
pnpm install
25+
```
26+
27+
### 2. Build extension
28+
29+
Build the extension using watch for development.
30+
31+
```
32+
pnpm build:w
33+
```
34+
35+
### 3. Load apps
36+
37+
We can load the app into the oCIS server in two different ways, depending on the version of oCIS:
38+
39+
#### 1. For oCIS 5.0.0 (Seperate extension server)
40+
41+
Configure the extension in `web.config.json`
2042

2143
```json
2244
{
@@ -36,9 +58,18 @@ The current implementation allows to preview .dcm files and display their corres
3658
}
3759
]
3860
}
39-
61+
4062
```
4163

64+
#### 2. For oCIS >= 5.1
65+
66+
Copy `docker-compose.override.example.yml` to `docker-compose.override.yml`.
67+
68+
### 4. Run oCIS server
69+
70+
```
71+
docker compose up
72+
```
4273

4374
## Docker Tags and respective Dockerfile links
4475

dev/docker/csp.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
directives:
2+
child-src:
3+
- '''self'''
4+
- 'data:'
5+
- 'blob:'
6+
connect-src:
7+
- '''self'''
8+
- 'data:'
9+
- 'blob:'
10+
default-src:
11+
- '''none'''
12+
font-src:
13+
- '''self'''
14+
frame-ancestors:
15+
- '''none'''
16+
frame-src:
17+
- '''self'''
18+
img-src:
19+
- '''self'''
20+
- 'data:'
21+
- 'blob:'
22+
manifest-src:
23+
- '''self'''
24+
media-src:
25+
- '''self'''
26+
object-src:
27+
- '''self'''
28+
- 'blob:'
29+
script-src:
30+
- '''self'''
31+
- '''unsafe-inline'''
32+
- '''unsafe-eval''' #TODO: try to remove it
33+
style-src:
34+
- '''self'''
35+
- '''unsafe-inline'''

docker-compose.override.example.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
ocis:
3+
image: owncloud/ocis:latest
4+
environment:
5+
WEB_UI_CONFIG_FILE: null
6+
WEB_ASSET_APPS_PATH: /web/apps
7+
PROXY_CSP_CONFIG_FILE_LOCATION: /etc/ocis/csp.yml
8+
volumes:
9+
- ./dist:/web/apps/dicom-viewer:ro
10+
- ./dev/docker/csp.yml:/etc/ocis/csp.yml
11+
12+
extension:
13+
profiles:
14+
- skip

public/manifest.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "com.github.owncloud.web.dicom.viewer",
3+
"entrypoint": "js/web-app-dicom-viewer.js",
4+
"config": {}
5+
}

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import translations from '../l10n/translations.json'
22
import { AppWrapperRoute, defineWebApplication } from '@ownclouders/web-pkg'
33
import App from './App.vue'
44
import { useGettext } from 'vue3-gettext'
5+
import { id as appId } from '../public/manifest.json'
56

67
export default defineWebApplication({
78
setup() {
89
const { $gettext } = useGettext()
9-
const appId = 'com.github.owncloud.web.dicom.viewer'
1010

1111
const appInfo = {
1212
name: $gettext('DICOM Viewer'),

0 commit comments

Comments
 (0)