Skip to content

Commit 1540d2f

Browse files
author
Jannik Stehle
committed
feat: add importer app
1 parent 702fef1 commit 1540d2f

File tree

14 files changed

+3491
-0
lines changed

14 files changed

+3491
-0
lines changed

.drone.star

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ APPS = [
99
"cast",
1010
"draw-io",
1111
"external-sites",
12+
"importer",
1213
"json-viewer",
1314
"progress-bars",
1415
"unzip",

dev/docker/ocis.apps.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
importer:
2+
config:
3+
companionUrl: 'https://host.docker.internal:9200/companion'

docker-compose.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,40 @@ services:
2222
volumes:
2323
- ocis-config:/etc/ocis
2424
- ./dev/docker/ocis.web.config.json:/web/config.json
25+
- ./dev/docker/ocis.apps.yaml:/etc/ocis/apps.yaml
2526
# apps
2627
- ./packages/web-app-cast/dist:/web/apps/cast
2728
- ./packages/web-app-draw-io/dist:/web/apps/draw-io
2829
- ./packages/web-app-external-sites/dist:/web/apps/external-sites
30+
- ./packages/web-app-importer/dist:/web/apps/importer
2931
- ./packages/web-app-json-viewer/dist:/web/apps/json-viewer
3032
- ./packages/web-app-progress-bars/dist:/web/apps/progress-bars
3133
- ./packages/web-app-unzip/dist:/web/apps/unzip
3234
depends_on:
3335
- traefik
3436

37+
companion:
38+
image: owncloud/uppy-companion:3.12.13-owncloud
39+
extra_hosts:
40+
- host.docker.internal:${DOCKER_HOST:-host-gateway}
41+
environment:
42+
NODE_TLS_REJECT_UNAUTHORIZED: 0
43+
COMPANION_ALLOW_LOCAL_URLS: 'true'
44+
COMPANION_DATADIR: /tmp/companion/
45+
COMPANION_DOMAIN: host.docker.internal:9200
46+
COMPANION_PROTOCOL: https
47+
COMPANION_PATH: /companion
48+
COMPANION_ONEDRIVE_KEY: '${COMPANION_ONEDRIVE_KEY}'
49+
COMPANION_ONEDRIVE_SECRET: '${COMPANION_ONEDRIVE_SECRET}'
50+
volumes:
51+
- uppy_companion_datadir:/tmp/companion/
52+
labels:
53+
traefik.enable: true
54+
traefik.http.routers.companion.tls: true
55+
traefik.http.routers.companion.rule: Host(`host.docker.internal`) && PathPrefix(`/companion`)
56+
traefik.http.routers.companion.entrypoints: ocis
57+
traefik.http.services.companion.loadbalancer.server.port: 3020
58+
3559
traefik:
3660
image: traefik:v2.11.8
3761
restart: unless-stopped
@@ -78,6 +102,7 @@ services:
78102

79103
volumes:
80104
ocis-config:
105+
uppy_companion_datadir:
81106

82107
networks:
83108
traefik:

packages/web-app-importer/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# web-app-importer
2+
3+
This application can be used for importing files and folders from other sources directly into your ownCloud. The following sources are currently supported:
4+
5+
- Google Drive
6+
- Onedrive
7+
- oCIS (via public links)
8+
- ownCloud 10 (via public links)
9+
- NextCloud (via public links)
10+
11+
## Companion setup
12+
13+
Make sure that you have an instance of [Uppy Companion](https://uppy.io/docs/companion/) up and running since this is the server handling the file import. It downloads the files and uploads them to the destination.
14+
15+
The `docker-compose.yml` in this repository includes a full working example of the importer running with Companion, you might want to use it as a reference. Please also refer to the [Uppy Companion docs](https://uppy.io/docs/companion/#options) for a full list of configuration options. Certain sources might require you to provide keys and secrets to Companion.
16+
17+
## App config
18+
19+
```
20+
"config": {
21+
"companionUrl": "https://example.com",
22+
"supportedClouds": ['OneDrive', 'GoogleDrive', 'WebdavPublicLink'],
23+
"webdavCloudType": "owncloud"
24+
}
25+
```
26+
27+
- `companionUrl` _(string)_ - specifies the URL under which Companion can be reached. This config needs to be set.
28+
- `supportedClouds` _(list[string])_ - specifies the supported cloud sources from which a user can import. Defaults to all enabled.
29+
- `webdavCloudType` _(string)_ - limit the webdav import to either `owncloud` or `nextcloud`. Defaults to allowing both.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"af":{},"ar":{"Cancel":"إلغاء"},"bg":{"Cancel":"Отказ","Import":"Импортиране","Import files":"Импортиране на файлове","Import files from:":"Импортиране на файлове от:","Import from %{name}":"Импортиране от %{name}"},"cs":{"Cancel":"Zrušit"},"de":{"Cancel":"Abbrechen","Import":"Importieren","Import files":"Dateien importieren","Import files from:":"Dateien importieren von:","Import from %{name}":"Importieren von %{name}","Importer":"Importeur","Please wait until all imports have finished":"Bitte warten, bis alle Importe abgeschlossen sind."},"el":{"Cancel":"Ακύρωση"},"bs":{},"es":{"Cancel":"Cancelar","Import":"Importar","Import files":"Importar archivos","Import files from:":"Importar archivos de:","Import from %{name}":"Importar de %{name}","Importer":"Importador","Please wait until all imports have finished":"Espere a que finalicen todas las importaciones"},"et":{},"fr":{"Cancel":"Annuler"},"gl":{"Cancel":"Cancelar"},"he":{"Cancel":"ביטול","Import":"ייבוא","Import files":"ייבוא קבצים","Import files from:":"ייבוא קבצים מתוך:","Import from %{name}":"ייבוא מתוך %{name}","Importer":"מייבא","Please wait until all imports have finished":"נא להמתין לסיום תהליכי הייבוא"},"it":{"Cancel":"Cancella"},"hr":{},"ja":{},"id":{"Cancel":"Batal"},"pl":{"Cancel":"Anuluj","Import":"Import","Import files":"Importuj pliki","Import files from:":"Importuj pliki z:","Import from %{name}":"Importuj z %{name}","Importer":"Importer","Please wait until all imports have finished":"Poczekaj, aż import się zakończy"},"nl":{"Cancel":"Annuleer","Import":"Importeren","Import files":"Importeer bestanden","Import files from:":"Importeer bestanden uit:","Import from %{name}":"Importeer uit %{name}","Importer":"Importeerder","Please wait until all imports have finished":"Wacht svp tot alle imports zijn voltooid"},"ko":{"Cancel":"취소","Import":"가져오기","Import files":"파일 가져오기","Import files from:":"다음에서 파일 가져오기:","Import from %{name}":"%{name}에서 가져오기","Please wait until all imports have finished":"내보내기가 완료될 때까지 잠시 기다려주세요"},"pt":{},"ro":{"Cancel":"Anulează"},"ka":{},"ru":{"Cancel":"Отмена","Import":"Импорт","Import files":"Импортировать файлы","Import files from:":"Импортировать файлы из:","Import from %{name}":"Импортировать из %{name}","Importer":"Импортируется посредством","Please wait until all imports have finished":"Пожалуйста, подождите, пока весь импорт не завершится."},"si":{"Cancel":"අවලංගු"},"sk":{"Cancel":"Zrušiť"},"sq":{"Cancel":"Anuloje","Import":"Importo","Import files":"Importo kartela","Import files from:":"Importo kartela prej:","Import from %{name}":"Importo prej %{name}","Importer":"Importues","Please wait until all imports have finished":"Ju lutemi, pritni deri sa të kenë përfunduar krejt importimet"},"sr":{},"ta":{"Cancel":"ரத்துசெய்"},"sv":{"Cancel":"Avbryt","Import":"Importera","Import files":"Importera filer","Import files from:":"Importera filer från:","Import from %{name}":"Importera från %{name}","Importer":"Importerare","Please wait until all imports have finished":"Vänligen vänta tills importeringen blir klar"},"tr":{"Cancel":"İptal","Import":"İçe Aktar","Import files":"İçe aktarılan dosyalar","Import files from:":"Şuradan içe aktarılan dosyalar:","Import from %{name}":"%{name}'dan içe aktar","Importer":"İçe aktaran","Please wait until all imports have finished":"Lütfen tüm içe aktarma işlemleri bitene kadar bekleyin"},"ug":{},"uk":{"Cancel":"Скасувати","Import":"Імпорт","Import files":"Імпорт файлів","Import files from:":"Імпортувати файли з:","Import from %{name}":"Імпортувати з %{name}","Importer":"Імпортер","Please wait until all imports have finished":"Будь ласка, зачекайте, доки всі імпорти завершаться"},"zh":{"Cancel":"取消","Import":"导入","Import files":"导入文件","Import files from:":"导入文件从:","Import from %{name}":"从 %{name} 导入","Importer":"导入器","Please wait until all imports have finished":"请等待所有导入完成。"}}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "web-app-importer",
3+
"version": "0.1.0",
4+
"private": true,
5+
"description": "ownCloud Web importer",
6+
"license": "AGPL-3.0",
7+
"type": "module",
8+
"scripts": {
9+
"build": "pnpm vite build",
10+
"build:w": "pnpm vite build --watch --mode development",
11+
"check:types": "vue-tsc --noEmit",
12+
"test:unit": "NODE_OPTIONS=--unhandled-rejections=throw vitest"
13+
},
14+
"dependencies": {
15+
"@uppy/dashboard": "3.3.0",
16+
"@uppy/google-drive": "3.3.0",
17+
"@uppy/onedrive": "3.3.0",
18+
"@uppy/webdav": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-webdav.tgz"
19+
},
20+
"devDependencies": {
21+
"@vue/compiler-dom": "^3.4.34",
22+
"@vue/server-renderer": "^3.4.34",
23+
"@vue/test-utils": "^2.4.6",
24+
"happy-dom": "^14.0.0",
25+
"vitest-mock-extended": "2.0.0",
26+
"vitest": "^2.0.4",
27+
"vue-tsc": "^2.0.29"
28+
},
29+
"peerDependencies": {
30+
"@ownclouders/web-client": "^10.1.0",
31+
"@ownclouders/web-pkg": "^10.1.0",
32+
"@uppy/core": "^3.3.0",
33+
"pinia": "^2.1.7",
34+
"typescript": "^5.5.4",
35+
"vue": "^3.4.21",
36+
"vue3-gettext": "^3.0.0-beta.5"
37+
},
38+
"pnpm": {
39+
"overrides": {
40+
"@uppy/companion-client": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-companion-client.tgz",
41+
"@uppy/core": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-core.tgz",
42+
"@uppy/dashboard": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-dashboard.tgz",
43+
"@uppy/drop-target": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-drop-target.tgz",
44+
"@uppy/google-drive": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-google-drive.tgz",
45+
"@uppy/informer": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-informer.tgz",
46+
"@uppy/onedrive": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-onedrive.tgz",
47+
"@uppy/provider-views": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-provider-views.tgz",
48+
"@uppy/status-bar": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-status-bar.tgz",
49+
"@uppy/store-default": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-store-default.tgz",
50+
"@uppy/thumbnail-generator": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-thumbnail-generator.tgz",
51+
"@uppy/tus": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-tus.tgz",
52+
"@uppy/utils": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-utils.tgz",
53+
"@uppy/webdav": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-webdav.tgz",
54+
"@uppy/xhr-upload": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-xhr-upload.tgz"
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)