Skip to content

Commit 85e215f

Browse files
committed
make extension work also with OpenCloud
1 parent 468fb75 commit 85e215f

File tree

11 files changed

+160
-4916
lines changed

11 files changed

+160
-4916
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules
22
dist
33
coverage
4+
pnpm-lock.yaml
45

56
# Editor directories and files
67
.vscode

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.PHONY: installOcis installOpencloud dependenciesOcis dependenciesOpencloud install clean package
2+
3+
installOcis: dependenciesOcis install
4+
5+
installOpencloud: dependenciesOpencloud install
6+
7+
dependenciesOcis: clean
8+
$(MAKE) package PACKAGE_JSON=package-ocis.json
9+
$(MAKE) depencenciesReplacement SOURCE=opencloud-eu DEST=ownclouders
10+
11+
dependenciesOpencloud: clean
12+
$(MAKE) package PACKAGE_JSON=package-opencloud.json
13+
$(MAKE) depencenciesReplacement SOURCE=ownclouders DEST=opencloud-eu
14+
15+
package:
16+
jq -s '.[0] * .[1]' package-general.json $(PACKAGE_JSON) > package.json
17+
18+
depencenciesReplacement:
19+
find . -type f \( -name "*.ts" -o -name "*.vue" -o -name "*.prettierrc" \) -not \( -path "./node_modules/*" -o -path "./dist/*" \) -print0 | xargs -0 sed -i 's/${SOURCE}/${DEST}/g'
20+
21+
clean:
22+
rm package.json
23+
24+
install:
25+
pnpm install

README.md

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![cover photo](./images/cover-large.png)
44

5-
A markdown presentation viewer for [ownCloud web](https://github.com/owncloud/web/) (the webUI of [oCIS](https://github.com/owncloud/ocis/)) using the [reveal.js](https://revealjs.com/) library.
5+
A markdown presentation viewer for [OpenCloud](https://github.com/opencloud-eu/opencloud/) and [oCIS](https://github.com/owncloud/ocis/) using the [reveal.js](https://revealjs.com/) library.
66

77
It allows users to:
88

@@ -11,42 +11,35 @@ It allows users to:
1111

1212
## Demonstration
1313

14-
- [Demonstation page](https://ocis.in-nepal.de/com.github.jankaritech.mdpresentation-viewer/public/phDIUqntYOMSfcE/presentation.md)
14+
- [Demonstation page oCIS](https://ocis.in-nepal.de/com.github.jankaritech.mdpresentation-viewer/public/phDIUqntYOMSfcE/presentation.md)
1515
- Click on `Open in Presentation Viewer` to view the slides
1616

1717
## Supported oCIS and Web Versions
1818

19-
- [oCIS](https://github.com/owncloud/ocis) (>= 6.x.x)
20-
- [Web](https://nodejs.org/en/) (>= 9.x.x)
19+
- [oCIS](https://github.com/owncloud/ocis) (>= 6.x.x) or [OpenCloud](https://github.com/opencloud-eu/opencloud/) (>= 2.0.0)
2120

2221
## App Installation
2322

24-
> NOTE: Requires oCIS >= 6.0.0
25-
2623
1. Download the zip file from the [releases page](https://github.com/JankariTech/web-app-presentation-viewer/releases)
2724

28-
For example: `mdpresentation-viewer-x.x.x.zip`
25+
For example: `mdpresentation-viewer-<architecture>-x.x.x.zip`
2926

30-
2. Extract the zip file to the `apps` directory of the oCIS server.
27+
2. Extract the zip file to the `apps` directory of the OpenCloud/oCIS server.
3128

3229
Apps directory is set using the `WEB_ASSET_APPS_PATH` environment variable.
3330

34-
### App Installation With [oCIS Deployment](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full)
31+
### App Installation With [OpenCloud](https://github.com/opencloud-eu/opencloud/tree/main/deployments/examples/opencloud_full) or [oCIS Deployment](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full)
3532

36-
1. Copy [`deployments/mdpresentation-viewer.yml`](./deployments/mdpresentation-viewer.yml) into the [web_extensions](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full/web_extensions)
37-
subfolder of oCIS full deployment example.
38-
2. Add `MDPRESENTATION_VIEWER=:web_extensions/mdpresentation-viewer.yml` to the `## oCIS Web Extensions ##` section of the `.env` file of your installation (file is located in `deployments/examples/ocis_full`) and append it to the `COMPOSE_FILE` variable.
33+
1. Copy [`deployments/mdpresentation-viewer.yml`](./deployments/mdpresentation-viewer.yml) into the `web_extensions`
34+
subfolder.
35+
2. Add `MDPRESENTATION_VIEWER=:web_extensions/mdpresentation-viewer.yml` to the `Web Extensions` section of the `.env` file of your installation and append it to the `COMPOSE_FILE` variable.
3936
```env
4037
## oCIS Web Extensions ##
4138
MDPRESENTATION_VIEWER=:web_extensions/mdpresentation-viewer.yml
4239
4340
COMPOSE_FILE=docker-compose.yml${...}${MDPRESENTATION_VIEWER:-}
4441
```
45-
3. Run `docker compose up` to run oCIS with the extensions
46-
47-
oCIS URL: [ocis.owncloud.test](https://ocis.owncloud.test)
48-
49-
See the [docs](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full).
42+
3. Run `docker compose up` to run the system with the extensions
5043
5144
## Creating Presentation
5245
@@ -59,16 +52,26 @@ This app has the following default slide separators:
5952
6053
## Development
6154
55+
> [!IMPORTANT] When switching between OpenCloud and oCIS, make sure to clean the browser cache!
56+
> [!CAUTION] Before commiting changes run `make installOcis`
57+
6258
#### Prerequisites
6359
6460
- [Node.js `v18`](https://nodejs.org/en/)
6561
- [pnpm `v8`](https://pnpm.io/)
6662
- [Docker Compose](https://docs.docker.com/compose/)
63+
- [jq](https://jqlang.org/)
6764
6865
#### 1. Install dependencies:
6966
67+
For OpenCloud:
7068
```bash
71-
pnpm install
69+
make installOpencloud
70+
```
71+
72+
For oCIS:
73+
```bash
74+
make installOcis
7275
```
7376

7477
#### 2. Build the extension
@@ -81,12 +84,16 @@ pnpm build:w
8184

8285
#### 3. Load the extension
8386

84-
> NOTE: Requires oCIS >= 6.0.0
87+
Run the server with the extension:
8588

86-
Run the oCIS server:
89+
For OpenCloud:
90+
```bash
91+
docker compose -f docker-compose-opencloud.yml up
92+
```
8793

94+
For oCIS:
8895
```bash
89-
docker compose up
96+
docker compose -f docker-compose-ocis.yml up
9097
```
9198

92-
oCIS URL: [localhost:9200](https://localhost:9200)
99+
server URL: [localhost:9200](https://localhost:9200)

docker-compose-opencloud.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
services:
2+
ocis:
3+
image: opencloudeu/opencloud-rolling:${OC_IMAGE_TAG:-latest}
4+
entrypoint: /bin/sh
5+
command: ['-c', 'opencloud init || true && opencloud server']
6+
ports:
7+
- 9200:9200
8+
environment:
9+
OC_URL: https://localhost:9200
10+
OC_INSECURE: true
11+
OC_LOG_LEVEL: error
12+
# WEB
13+
WEB_ASSET_APPS_PATH: /web/apps
14+
# IDM
15+
IDM_CREATE_DEMO_USERS: true
16+
IDM_ADMIN_PASSWORD: admin
17+
# PROXY
18+
PROXY_ENABLE_BASIC_AUTH: true
19+
PROXY_CSP_CONFIG_FILE_LOCATION: /etc/ocis/csp.yml
20+
volumes:
21+
- ./dist:/web/apps:ro
22+
- ./dev/config/csp.yml:/etc/ocis/csp.yml

package-general.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "mdpresentation-viewer",
3+
"version": "2.1.0-alpha.1",
4+
"description": "Markdown Presentation Viewer for ownCloud Web",
5+
"license": "Apache-2.0",
6+
"private": true,
7+
"type": "module",
8+
"scripts": {
9+
"build": "pnpm vite build",
10+
"build:w": "pnpm vite build --watch --mode development",
11+
"lint": "eslint './*.{js,cjs,mjs,ts}' '{src,tests}/**/*.{js,cjs,mjs,ts,vue}' --color",
12+
"lint:fix": "pnpm lint --fix",
13+
"test:unit": "vitest",
14+
"test:e2e": "NODE_TLS_REJECT_UNAUTHORIZED=0 cucumber-js"
15+
},
16+
"dependencies": {
17+
"@pnpm/meta-updater": "^2.0.5",
18+
"@types/reveal.js": "^4.4.8",
19+
"reveal.js": "^5.1.0"
20+
},
21+
"devDependencies": {
22+
"@babel/eslint-parser": "^7.24.5",
23+
"@cucumber/cucumber": "^10.6.0",
24+
"@cucumber/pretty-formatter": "^1.0.1",
25+
"@playwright/test": "^1.44.0",
26+
"@types/node": "^20.12.10",
27+
"@typescript-eslint/eslint-plugin": "^7.8.0",
28+
"@vitejs/plugin-vue": "^5.0.5",
29+
"@vitest/coverage-v8": "1.5.0",
30+
"@vue/test-utils": "^2.4.6",
31+
"axios": "^1.8.2",
32+
"eslint": "^8.57.0",
33+
"eslint-config-prettier": "^9.1.0",
34+
"eslint-plugin-prettier-vue": "^5.0.0",
35+
"eslint-plugin-unused-imports": "^3.2.0",
36+
"eslint-plugin-vue": "^9.25.0",
37+
"happy-dom": "^15.10.2",
38+
"typescript": "^5.4.5",
39+
"vite": "^5.2.11",
40+
"vitest": "^1.6.1",
41+
"vue": "^3.4.27"
42+
},
43+
"pnpm": {
44+
"peerDependencyRules": {
45+
"ignoreMissing": [
46+
"design-system"
47+
]
48+
}
49+
},
50+
"packageManager": "pnpm@8.15.1"
51+
}

package-ocis.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"devDependencies": {
3+
"@ownclouders/extension-sdk": "0.0.5-alpha.2",
4+
"@ownclouders/prettier-config": "0.0.1"
5+
},
6+
"pnpm": {
7+
"peerDependencies": {
8+
"@ownclouders/web-client": "https://gitpkg.vercel.app/owncloud/web/packages/web-client?1d95aec2326958dd28643697618c8bb1cea44929",
9+
"@ownclouders/web-pkg": "https://gitpkg.vercel.app/owncloud/web/packages/web-pkg?1d95aec2326958dd28643697618c8bb1cea44929"
10+
}
11+
}
12+
}

package-opencloud.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"devDependencies": {
3+
"@opencloud-eu/extension-sdk": "^1.0.0",
4+
"@opencloud-eu/prettier-config": "^1.0.0"
5+
},
6+
"pnpm": {
7+
"peerDependencies": {
8+
"@opencloud-eu/web-client": "^1.0.0",
9+
"@opencloud-eu/web-pkg": "^1.0.0"
10+
}
11+
}
12+
}

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
"test:e2e": "NODE_TLS_REJECT_UNAUTHORIZED=0 cucumber-js"
1515
},
1616
"dependencies": {
17+
"@pnpm/meta-updater": "^2.0.5",
1718
"@types/reveal.js": "^4.4.8",
1819
"reveal.js": "^5.1.0"
1920
},
2021
"devDependencies": {
2122
"@babel/eslint-parser": "^7.24.5",
2223
"@cucumber/cucumber": "^10.6.0",
2324
"@cucumber/pretty-formatter": "^1.0.1",
24-
"@ownclouders/extension-sdk": "0.0.5-alpha.2",
25-
"@ownclouders/prettier-config": "0.0.1",
2625
"@playwright/test": "^1.44.0",
2726
"@types/node": "^20.12.10",
2827
"@typescript-eslint/eslint-plugin": "^7.8.0",
@@ -39,17 +38,19 @@
3938
"typescript": "^5.4.5",
4039
"vite": "^5.2.11",
4140
"vitest": "^1.6.1",
42-
"vue": "^3.4.27"
43-
},
44-
"peerDependencies": {
45-
"@ownclouders/web-client": "https://gitpkg.vercel.app/owncloud/web/packages/web-client?1d95aec2326958dd28643697618c8bb1cea44929",
46-
"@ownclouders/web-pkg": "https://gitpkg.vercel.app/owncloud/web/packages/web-pkg?1d95aec2326958dd28643697618c8bb1cea44929"
41+
"vue": "^3.4.27",
42+
"@ownclouders/extension-sdk": "0.0.5-alpha.2",
43+
"@ownclouders/prettier-config": "0.0.1"
4744
},
4845
"pnpm": {
4946
"peerDependencyRules": {
5047
"ignoreMissing": [
5148
"design-system"
5249
]
50+
},
51+
"peerDependencies": {
52+
"@ownclouders/web-client": "https://gitpkg.vercel.app/owncloud/web/packages/web-client?1d95aec2326958dd28643697618c8bb1cea44929",
53+
"@ownclouders/web-pkg": "https://gitpkg.vercel.app/owncloud/web/packages/web-pkg?1d95aec2326958dd28643697618c8bb1cea44929"
5354
}
5455
},
5556
"packageManager": "pnpm@8.15.1"

0 commit comments

Comments
 (0)