Skip to content

Commit

Permalink
feat: add importer app
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannik Stehle committed Oct 2, 2024
1 parent 702fef1 commit c97f816
Show file tree
Hide file tree
Showing 13 changed files with 3,487 additions and 0 deletions.
1 change: 1 addition & 0 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ APPS = [
"cast",
"draw-io",
"external-sites",
"importer",
"json-viewer",
"progress-bars",
"unzip",
Expand Down
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,35 @@ services:
- ./packages/web-app-cast/dist:/web/apps/cast
- ./packages/web-app-draw-io/dist:/web/apps/draw-io
- ./packages/web-app-external-sites/dist:/web/apps/external-sites
- ./packages/web-app-importer/dist:/web/apps/importer
- ./packages/web-app-json-viewer/dist:/web/apps/json-viewer
- ./packages/web-app-progress-bars/dist:/web/apps/progress-bars
- ./packages/web-app-unzip/dist:/web/apps/unzip
depends_on:
- traefik

companion:
image: owncloud/uppy-companion:3.12.13-owncloud
extra_hosts:
- host.docker.internal:${DOCKER_HOST:-host-gateway}
environment:
NODE_TLS_REJECT_UNAUTHORIZED: 0
COMPANION_ALLOW_LOCAL_URLS: 'true'
COMPANION_DATADIR: /tmp/companion/
COMPANION_DOMAIN: host.docker.internal:9200
COMPANION_PROTOCOL: https
COMPANION_PATH: /companion
COMPANION_ONEDRIVE_KEY: '${COMPANION_ONEDRIVE_KEY}'
COMPANION_ONEDRIVE_SECRET: '${COMPANION_ONEDRIVE_SECRET}'
volumes:
- uppy_companion_datadir:/tmp/companion/
labels:
traefik.enable: true
traefik.http.routers.companion.tls: true
traefik.http.routers.companion.rule: Host(`host.docker.internal`) && PathPrefix(`/companion`)
traefik.http.routers.companion.entrypoints: ocis
traefik.http.services.companion.loadbalancer.server.port: 3020

traefik:
image: traefik:v2.11.8
restart: unless-stopped
Expand Down Expand Up @@ -78,6 +101,7 @@ services:

volumes:
ocis-config:
uppy_companion_datadir:

networks:
traefik:
29 changes: 29 additions & 0 deletions packages/web-app-importer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# web-app-importer

This application can be used for importing files and folders from other sources directly into your ownCloud. The following sources are currently supported:

- Google Drive
- Onedrive
- oCIS (via public links)
- ownCloud 10 (via public links)
- NextCloud (via public links)

## Companion setup

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.

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 to Companion (e.g. Onedrive).

## App config

```
"config": {
"companionUrl": "https://example.com",
"supportedClouds": ['OneDrive', 'GoogleDrive', 'WebdavPublicLink'],
"webdavCloudType": "owncloud"
}
```

- `companionUrl` _(string)_ - specifies the URL under which Companion can be reached. This config needs to be set.
- `supportedClouds` _(list[string])_ - specifies the supported cloud sources from which a user can import. Defaults to all enabled.
- `webdavCloudType` _(string)_ - limit the webdav import to either `owncloud` or `nextcloud`. Defaults to allowing both.
1 change: 1 addition & 0 deletions packages/web-app-importer/l10n/translations.json
Original file line number Diff line number Diff line change
@@ -0,0 +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":"请等待所有导入完成。"}}
57 changes: 57 additions & 0 deletions packages/web-app-importer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "web-app-importer",
"version": "0.1.0",
"private": true,
"description": "ownCloud Web importer",
"license": "AGPL-3.0",
"type": "module",
"scripts": {
"build": "pnpm vite build",
"build:w": "pnpm vite build --watch --mode development",
"check:types": "vue-tsc --noEmit",
"test:unit": "NODE_OPTIONS=--unhandled-rejections=throw vitest"
},
"dependencies": {
"@uppy/dashboard": "3.3.0",
"@uppy/google-drive": "3.3.0",
"@uppy/onedrive": "3.3.0",
"@uppy/webdav": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-webdav.tgz"
},
"devDependencies": {
"@vue/compiler-dom": "^3.4.34",
"@vue/server-renderer": "^3.4.34",
"@vue/test-utils": "^2.4.6",
"happy-dom": "^14.0.0",
"vitest-mock-extended": "2.0.0",
"vitest": "^2.0.4",
"vue-tsc": "^2.0.29"
},
"peerDependencies": {
"@ownclouders/web-client": "^10.1.0",
"@ownclouders/web-pkg": "^10.1.0",
"@uppy/core": "^3.3.0",
"pinia": "^2.1.7",
"typescript": "^5.5.4",
"vue": "^3.4.21",
"vue3-gettext": "^3.0.0-beta.5"
},
"pnpm": {
"overrides": {
"@uppy/companion-client": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-companion-client.tgz",
"@uppy/core": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-core.tgz",
"@uppy/dashboard": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-dashboard.tgz",
"@uppy/drop-target": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-drop-target.tgz",
"@uppy/google-drive": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-google-drive.tgz",
"@uppy/informer": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-informer.tgz",
"@uppy/onedrive": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-onedrive.tgz",
"@uppy/provider-views": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-provider-views.tgz",
"@uppy/status-bar": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-status-bar.tgz",
"@uppy/store-default": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-store-default.tgz",
"@uppy/thumbnail-generator": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-thumbnail-generator.tgz",
"@uppy/tus": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-tus.tgz",
"@uppy/utils": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-utils.tgz",
"@uppy/webdav": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-webdav.tgz",
"@uppy/xhr-upload": "https://github.com/owncloud/uppy/releases/download/v3.12.13-owncloud/uppy-xhr-upload.tgz"
}
}
}
Loading

0 comments on commit c97f816

Please sign in to comment.