nextcloud-swarm-plugin/lib/AppInfo/Application.php
Henry Bergström 158250546a
Release 20250514 (#129)
* Feature/795 setup notifications for upload (#77)

* feat(#795): add user notification for upload to swarm
- add: New file for application-wide Constants with AppName identifier

* feat(#795): Add user notification
- add: Notification for user when uploading to swarm

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature/onlyoffice (#76)

* feat(onlyoffice):
- add: service container
- add: app installation

* feat(docker):
- update: merge all version Dockerfiles into one
- update: create Dockerfile for rsycn
- add: docker proxy internal setup
- update: hooks orders and scripts

* feat(nginx):
- update: nginx.conf

* Bug fix/#904 file actions reload fix unview fix two actions for visual (#78)

* Chaging t('files to t('files_external_ethswarm
Fixing unview file and folder message
Adding hejbit overlay and swarmref action to all files and folders to "support" NC fileactions navigation bug

* Option with two separate file actions (Overlay and CopySwarm Ref)

* Improving reload logic

* Fixing Exec Batch Error - Now it's possible to select the action from the top file menu

* FIX - Improved Fileaction reload fix

* Fixing Unview file on NC29 & NC30
Organizing TODOs in Fileaction

* fix(904): previousPathHasSwarm to check with the first file available on index 0 instead

---------

Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* Fix for appearing files_external_ethswarm settings backend menu on search (#84)

* Feature/#833 disconnect reconnect storage (#82)

* Migration for option of working with multiple tables (swarm_files & swarm_file_tokens)

* Version using swarm file table adding token column fully functional

* Adding token to directory

* Everytime the test function is used all files from the tested storage are copied from swarm table to nc cache

* Fixing index name to avoid colision from token_index hejbit_token_index

* FIxing issue of root folder not found on cache

* feat(#747): remove new file menu options (#85)

- add: remove/restore menu options according to navigation to swarm storage

Co-authored-by: Take one <rontrevor@hotmail.com>

* Root (mount) folder $filename === "" doesn't exist on swarm table (#86)

Approved.

* fix: allow other plugin to handle request (#88)

* FIX > Get the ethswarm-node property from the folders intead of from the files (#90)

* Fix   #1019  improving migrations (#89)

* FIxing version 0005 migration

* Improving query builder variables on previous migrations

* implemented copy method (#93)

* Change working from Unview to Hide (#92)

* Feature/#1058  unhide (#94)

* Hide action to not hiden files, unhide action to hidden files
Unhide action implemented
Change UI of hidden files +-

* Fixing mistake

* The perfect solution would be:
- After hide or unhide action - reload view similiar when we toggle the show_hiden files option on config.

Another solution would be:
- After hide or unhide action - reload if we are with show_hiden folder file config on.

What I could do:
- After hide, I don't reload the screen, assuming that we are with the show_hiden folder config off
- After unhide action - I reload the screen, assuming that we are with the show_hiden folder config on

* Update lib/Sabre/PostPlugin.php

Co-authored-by: Henry Bergström <henrybergstrom@protonmail.com>

---------

Co-authored-by: Henry Bergström <henrybergstrom@protonmail.com>

* feature/884-hejbit-api (#95)

* feat(docker): enable multi NC versions setup
- add: auto install plugin
- add: hooks integration folders
- add: fpm installation
- add: redis for session caching
- add: selfsign ssl for local development

* feat(xdebug):
- fix: xdebug setup
- add: two targets for Dockerfile
- add: debug mode in NC
- fix: domain hook in NC config
- update: docker networks

* refactor(docker): compose file extension
- update: yaml to yml

* refactor(docker-compose):
- remove: extra environments from compose
- update: .env file

* feat(redis):
- add: redis server password
- update: .env file
- refactor: remove all passwords from .env

* feat(cli): install and clean dev env setup
- add: add script for linux/mac
- add: bat for windows

* feat(volumes): use specific volumes only
- refactor: rename volumes
- update: bind only nc volumes needed
- fix: redis password
- fix: extra env passed to all db containers

* feat(docker):
- add: caddy as proxy server
- add: rsync for dev env
- add: adminer default db server
- update: nextcloud labels

* feat(exceptions):
- add: SwarmException for Swarm related errors

* feat(Util): add Env
- add: util to access ENV vars

* feat(Util): update Curl
- add: ssl check to curl options
- update: default options calculation
- add: response success check

* feat(swarm): adapt to new API
- update: all Exceptions
- update: endpoints
- add: success checks and proper errors
- update: upload method and response
- update: remove header from download requests

* refactor(storage):
- update: code docs and style
- refactor: some if statements
- add: missing parent calls
- refactor: variable naming convention
- update: upload call with new api
- update: exceptions
- add: some todos for later refactoring
- update: imports

* chore(npm): update lock file

* refactor(docker):
- update: docker networks
- remove: proxy dockerfile

* feat(docker):
- add: db health checks
- update: redis password env var

* feat(docker):
- add: dev profile
- refactor: proxy network name

* feat(api):
- update: swarm connections
- update: swarm storage
- update: Curl requests
- docs: clean code

* chore(docker):
- remove: extra dockerfiles

* chore(docker):
- remove: old hooks

* bugfix(mkdir): create folder issue (#98)

- add: missing import
- fix: typo in entity name

* Feature/1088-code-style-setup (#97)

* feat(cs): update cs config

* feat(cs): update composer deps

* feat(cs): gitignore

* feat(cs): add pipeline

* feat(cs): code style

* perf(cs): update pipeline
- refactor: changed name to Lint
- add: auto commit action
- add: fast fail
- update: install only cs-fixer dep

* Apply automatic changes

* feat(cs): update auto commit
- update: commit message

* feat(cs): enable PSR12 and PhpCsFixer rules
- add: extend NC rules
- chore: lint new rules
- fix: OC PSR4 detection
- add: global imports
- add: trailing comma in arrays and etc

* refactor(file): find_exists return value

* chore: fix code style

* refactor(swarm): ref check and param arg type

* refactor(swarm): param arg type

* chore: fix code style

---------

Co-authored-by: mahiarirani <mahiarirani@users.noreply.github.com>
Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>

* bugfix(mkdir): create folder issue (#99)

- add: missing import
- fix: typo in entity name

* Fix/#1085  adding moodle to the documentation (#100)

* Adding moodle documentation

* FIxing link formating  error

* fix(curl): upload SSL verification (#105)

- remove: verify parameters to default to curl
- add: only in dev env

* feat(upload): add filename as meta param when uploading (#103)

* Improving github and NC app store documentation (#102)

* Improve settings information (#104)

* Improve settings information

* feat(settings): add server host URL as default value

* style(settings): remove extra wordings

---------

Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* Feature: secure API communication upgrade (#107)

* feat(exception): throw separate exceptions

* feat(api): separate token from api link
- update: merge getLink into a single function
- add: Dto for Links results
- pass: token in authorization header
- update: upload and download to use new api links
- refactor: remove extra isVersion input

* chore: fix code style

---------

Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* bugfix: exception handling to ensure the response is handled correctly (#109)

* bugfix: correct exception handling to ensure the response is handled correclty by calling test() function.
- update: do not assume an array (json) response from the api. The response is not always json which cause the json_decode() to return null;
- add: use StorageNotAvailableException to ensure a user-friendly error message to be displayed on the front.end;
- update: return value can be a string

* chore: fix code style

* feat(api): check status
- update: response based on status code
- add: specific error for invalid code

* chore: fix code style

---------

Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* bugfix/correct-install-docker-windows (#106)

* - Correction to docker-compose for Windows installations.
- Added README for known issues

* Update README.md

bugfix(correct-install-docker-windows): add supporting images

* - add: formatting changes to README.md

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* bugfix(feedback): remove the removed script load

* feat(curl): check url for protocol

* feat(toast): add nextcloud dialogs (#112)

- add: library package
- update: fileactions.js usage
- update: swarm logo remove xml

* Support-from-NC29-to-NC31 (#115)

* Release 20250307 (#114)

* Improving github and NC app store documentation (#102)

* fix(curl): upload SSL verification (#105)

- remove: verify parameters to default to curl
- add: only in dev env

* feat(upload): add filename as meta param when uploading (#103)

* Improve settings information (#104)

* Improve settings information

* feat(settings): add server host URL as default value

* style(settings): remove extra wordings

---------

Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* Feature: secure API communication upgrade (#107)

* feat(exception): throw separate exceptions

* feat(api): separate token from api link
- update: merge getLink into a single function
- add: Dto for Links results
- pass: token in authorization header
- update: upload and download to use new api links
- refactor: remove extra isVersion input

* chore: fix code style

---------

Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* bugfix: exception handling to ensure the response is handled correctly (#109)

* bugfix: correct exception handling to ensure the response is handled correclty by calling test() function.
- update: do not assume an array (json) response from the api. The response is not always json which cause the json_decode() to return null;
- add: use StorageNotAvailableException to ensure a user-friendly error message to be displayed on the front.end;
- update: return value can be a string

* chore: fix code style

* feat(api): check status
- update: response based on status code
- add: specific error for invalid code

* chore: fix code style

---------

Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* feat(docker): add install ocs api viewer app (#108)

* bugfix/correct-install-docker-windows (#106)

* - Correction to docker-compose for Windows installations.
- Added README for known issues

* Update README.md

bugfix(correct-install-docker-windows): add supporting images

* - add: formatting changes to README.md

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* feat(curl): check url for protocol

* bugfix(feedback): remove the removed script load

* feat(toast): add nextcloud dialogs (#112)

- add: library package
- update: fileactions.js usage
- update: swarm logo remove xml

* Fix/#1085  adding moodle to the documentation (#100)

* Adding moodle documentation

* FIxing link formating  error

---------

Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

* Feature/sentry integration (#110)

* new setting page

* unit tests

* settings page

* Unit test

* chore: fix code style

* update settingscontroller

* chore: fix code style

* add: sentry to composer.json

* chore: fix code style

* fix: sending to sentry

* chore: fix code style

* update(settings): new explain text and service status link

* add sentry library in vendor-bin

* chore: fix code style

* adjusted autoload path for sentry

* chore: fix code style

* sentry ready

* chore: fix code style

* feat(sentry): remove vendor-bin from repo
- update: makefile to install composer in release and appstore
- update: move require of vendor-bin to register method
- add: gitignore entry for vendor-bin

* chore: fix code style

* chore(sentry): remove test exception

* style: better readability for settings page

* enable telemetry by default

* feat(docker): add install ocs api viewer app (#108)

* bugfix/correct-install-docker-windows (#106)

* - Correction to docker-compose for Windows installations.
- Added README for known issues

* Update README.md

bugfix(correct-install-docker-windows): add supporting images

* - add: formatting changes to README.md

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* bugfix(feedback): remove the removed script load

* feat(curl): check url for protocol

* fix: ensure environment

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* bugfix(feedback): remove the removed script load

* feat(curl): check url for protocol

* feat(toast): add nextcloud dialogs (#112)

- add: library package
- update: fileactions.js usage
- update: swarm logo remove xml

* use .env to get environment

* chore: fix code style

* remove debug line

* fix: makefile include correct directories in vendor-bin

* fix: telemetry to be autoenabled

* chore: fix code style

* fix: exclude changelog.md in build

* chore: remove old admin page

* Support-from-NC29-to-NC31 (#115)

* Release 20250307 (#114)

* Improving github and NC app store documentation (#102)

* fix(curl): upload SSL verification (#105)

- remove: verify parameters to default to curl
- add: only in dev env

* feat(upload): add filename as meta param when uploading (#103)

* Improve settings information (#104)

* Improve settings information

* feat(settings): add server host URL as default value

* style(settings): remove extra wordings

---------

Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* Feature: secure API communication upgrade (#107)

* feat(exception): throw separate exceptions

* feat(api): separate token from api link
- update: merge getLink into a single function
- add: Dto for Links results
- pass: token in authorization header
- update: upload and download to use new api links
- refactor: remove extra isVersion input

* chore: fix code style

---------

Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* bugfix: exception handling to ensure the response is handled correctly (#109)

* bugfix: correct exception handling to ensure the response is handled correclty by calling test() function.
- update: do not assume an array (json) response from the api. The response is not always json which cause the json_decode() to return null;
- add: use StorageNotAvailableException to ensure a user-friendly error message to be displayed on the front.end;
- update: return value can be a string

* chore: fix code style

* feat(api): check status
- update: response based on status code
- add: specific error for invalid code

* chore: fix code style

---------

Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* feat(docker): add install ocs api viewer app (#108)

* bugfix/correct-install-docker-windows (#106)

* - Correction to docker-compose for Windows installations.
- Added README for known issues

* Update README.md

bugfix(correct-install-docker-windows): add supporting images

* - add: formatting changes to README.md

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* feat(curl): check url for protocol

* bugfix(feedback): remove the removed script load

* feat(toast): add nextcloud dialogs (#112)

- add: library package
- update: fileactions.js usage
- update: swarm logo remove xml

* Fix/#1085  adding moodle to the documentation (#100)

* Adding moodle documentation

* FIxing link formating  error

---------

Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

---------

Co-authored-by: frozenbanana <3958329+frozenbanana@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

* feat(docker): fix env path (#119)

* fix(types): follow parent storage class (#118)

- fix: Etag return false not null
- remove: unmodified extended codes
- fix: verify path return type is void

* Feature/docker stage (#121)

* feat(docker): remove profile from dev
- update: keep main docker compose to dev

* feat(docker): add new stage docker compose

* chore(docker): remove extra hosts for stage

* Release 20250307 (#114)

* Improving github and NC app store documentation (#102)

* fix(curl): upload SSL verification (#105)

- remove: verify parameters to default to curl
- add: only in dev env

* feat(upload): add filename as meta param when uploading (#103)

* Improve settings information (#104)

* Improve settings information

* feat(settings): add server host URL as default value

* style(settings): remove extra wordings

---------

Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* Feature: secure API communication upgrade (#107)

* feat(exception): throw separate exceptions

* feat(api): separate token from api link
- update: merge getLink into a single function
- add: Dto for Links results
- pass: token in authorization header
- update: upload and download to use new api links
- refactor: remove extra isVersion input

* chore: fix code style

---------

Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* bugfix: exception handling to ensure the response is handled correctly (#109)

* bugfix: correct exception handling to ensure the response is handled correclty by calling test() function.
- update: do not assume an array (json) response from the api. The response is not always json which cause the json_decode() to return null;
- add: use StorageNotAvailableException to ensure a user-friendly error message to be displayed on the front.end;
- update: return value can be a string

* chore: fix code style

* feat(api): check status
- update: response based on status code
- add: specific error for invalid code

* chore: fix code style

---------

Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* feat(docker): add install ocs api viewer app (#108)

* bugfix/correct-install-docker-windows (#106)

* - Correction to docker-compose for Windows installations.
- Added README for known issues

* Update README.md

bugfix(correct-install-docker-windows): add supporting images

* - add: formatting changes to README.md

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* feat(curl): check url for protocol

* bugfix(feedback): remove the removed script load

* feat(toast): add nextcloud dialogs (#112)

- add: library package
- update: fileactions.js usage
- update: swarm logo remove xml

* Fix/#1085  adding moodle to the documentation (#100)

* Adding moodle documentation

* FIxing link formating  error

---------

Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

* Release 20250313 (#117)

* Support-from-NC29-to-NC31 (#115)

* Feature/sentry integration (#110)

* new setting page

* unit tests

* settings page

* Unit test

* chore: fix code style

* update settingscontroller

* chore: fix code style

* add: sentry to composer.json

* chore: fix code style

* fix: sending to sentry

* chore: fix code style

* update(settings): new explain text and service status link

* add sentry library in vendor-bin

* chore: fix code style

* adjusted autoload path for sentry

* chore: fix code style

* sentry ready

* chore: fix code style

* feat(sentry): remove vendor-bin from repo
- update: makefile to install composer in release and appstore
- update: move require of vendor-bin to register method
- add: gitignore entry for vendor-bin

* chore: fix code style

* chore(sentry): remove test exception

* style: better readability for settings page

* enable telemetry by default

* feat(docker): add install ocs api viewer app (#108)

* bugfix/correct-install-docker-windows (#106)

* - Correction to docker-compose for Windows installations.
- Added README for known issues

* Update README.md

bugfix(correct-install-docker-windows): add supporting images

* - add: formatting changes to README.md

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* bugfix(feedback): remove the removed script load

* feat(curl): check url for protocol

* fix: ensure environment

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* bugfix(feedback): remove the removed script load

* feat(curl): check url for protocol

* feat(toast): add nextcloud dialogs (#112)

- add: library package
- update: fileactions.js usage
- update: swarm logo remove xml

* use .env to get environment

* chore: fix code style

* remove debug line

* fix: makefile include correct directories in vendor-bin

* fix: telemetry to be autoenabled

* chore: fix code style

* fix: exclude changelog.md in build

* chore: remove old admin page

* Support-from-NC29-to-NC31 (#115)

* Release 20250307 (#114)

* Improving github and NC app store documentation (#102)

* fix(curl): upload SSL verification (#105)

- remove: verify parameters to default to curl
- add: only in dev env

* feat(upload): add filename as meta param when uploading (#103)

* Improve settings information (#104)

* Improve settings information

* feat(settings): add server host URL as default value

* style(settings): remove extra wordings

---------

Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* Feature: secure API communication upgrade (#107)

* feat(exception): throw separate exceptions

* feat(api): separate token from api link
- update: merge getLink into a single function
- add: Dto for Links results
- pass: token in authorization header
- update: upload and download to use new api links
- refactor: remove extra isVersion input

* chore: fix code style

---------

Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* bugfix: exception handling to ensure the response is handled correctly (#109)

* bugfix: correct exception handling to ensure the response is handled correclty by calling test() function.
- update: do not assume an array (json) response from the api. The response is not always json which cause the json_decode() to return null;
- add: use StorageNotAvailableException to ensure a user-friendly error message to be displayed on the front.end;
- update: return value can be a string

* chore: fix code style

* feat(api): check status
- update: response based on status code
- add: specific error for invalid code

* chore: fix code style

---------

Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* feat(docker): add install ocs api viewer app (#108)

* bugfix/correct-install-docker-windows (#106)

* - Correction to docker-compose for Windows installations.
- Added README for known issues

* Update README.md

bugfix(correct-install-docker-windows): add supporting images

* - add: formatting changes to README.md

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* feat(curl): check url for protocol

* bugfix(feedback): remove the removed script load

* feat(toast): add nextcloud dialogs (#112)

- add: library package
- update: fileactions.js usage
- update: swarm logo remove xml

* Fix/#1085  adding moodle to the documentation (#100)

* Adding moodle documentation

* FIxing link formating  error

---------

Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

---------

Co-authored-by: frozenbanana <3958329+frozenbanana@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

* update version deployed

* bump version

---------

Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: frozenbanana <3958329+frozenbanana@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

* Release 20250314 (#120)

* feat(docker): fix env path (#119)

* fix(types): follow parent storage class (#118)

- fix: Etag return false not null
- remove: unmodified extended codes
- fix: verify path return type is void

---------

Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* fix: use built in Exception for type hint

* fix: only enable sentry if NC version is supported

* Release 20250307 (#114)

* Improving github and NC app store documentation (#102)

* fix(curl): upload SSL verification (#105)

- remove: verify parameters to default to curl
- add: only in dev env

* feat(upload): add filename as meta param when uploading (#103)

* Improve settings information (#104)

* Improve settings information

* feat(settings): add server host URL as default value

* style(settings): remove extra wordings

---------

Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* Feature: secure API communication upgrade (#107)

* feat(exception): throw separate exceptions

* feat(api): separate token from api link
- update: merge getLink into a single function
- add: Dto for Links results
- pass: token in authorization header
- update: upload and download to use new api links
- refactor: remove extra isVersion input

* chore: fix code style

---------

Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* bugfix: exception handling to ensure the response is handled correctly (#109)

* bugfix: correct exception handling to ensure the response is handled correclty by calling test() function.
- update: do not assume an array (json) response from the api. The response is not always json which cause the json_decode() to return null;
- add: use StorageNotAvailableException to ensure a user-friendly error message to be displayed on the front.end;
- update: return value can be a string

* chore: fix code style

* feat(api): check status
- update: response based on status code
- add: specific error for invalid code

* chore: fix code style

---------

Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* feat(docker): add install ocs api viewer app (#108)

* bugfix/correct-install-docker-windows (#106)

* - Correction to docker-compose for Windows installations.
- Added README for known issues

* Update README.md

bugfix(correct-install-docker-windows): add supporting images

* - add: formatting changes to README.md

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* feat(curl): check url for protocol

* bugfix(feedback): remove the removed script load

* feat(toast): add nextcloud dialogs (#112)

- add: library package
- update: fileactions.js usage
- update: swarm logo remove xml

* Fix/#1085  adding moodle to the documentation (#100)

* Adding moodle documentation

* FIxing link formating  error

---------

Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

* Release 20250313 (#117)

* Support-from-NC29-to-NC31 (#115)

* Feature/sentry integration (#110)

* new setting page

* unit tests

* settings page

* Unit test

* chore: fix code style

* update settingscontroller

* chore: fix code style

* add: sentry to composer.json

* chore: fix code style

* fix: sending to sentry

* chore: fix code style

* update(settings): new explain text and service status link

* add sentry library in vendor-bin

* chore: fix code style

* adjusted autoload path for sentry

* chore: fix code style

* sentry ready

* chore: fix code style

* feat(sentry): remove vendor-bin from repo
- update: makefile to install composer in release and appstore
- update: move require of vendor-bin to register method
- add: gitignore entry for vendor-bin

* chore: fix code style

* chore(sentry): remove test exception

* style: better readability for settings page

* enable telemetry by default

* feat(docker): add install ocs api viewer app (#108)

* bugfix/correct-install-docker-windows (#106)

* - Correction to docker-compose for Windows installations.
- Added README for known issues

* Update README.md

bugfix(correct-install-docker-windows): add supporting images

* - add: formatting changes to README.md

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* bugfix(feedback): remove the removed script load

* feat(curl): check url for protocol

* fix: ensure environment

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* bugfix(feedback): remove the removed script load

* feat(curl): check url for protocol

* feat(toast): add nextcloud dialogs (#112)

- add: library package
- update: fileactions.js usage
- update: swarm logo remove xml

* use .env to get environment

* chore: fix code style

* remove debug line

* fix: makefile include correct directories in vendor-bin

* fix: telemetry to be autoenabled

* chore: fix code style

* fix: exclude changelog.md in build

* chore: remove old admin page

* Support-from-NC29-to-NC31 (#115)

* Release 20250307 (#114)

* Improving github and NC app store documentation (#102)

* fix(curl): upload SSL verification (#105)

- remove: verify parameters to default to curl
- add: only in dev env

* feat(upload): add filename as meta param when uploading (#103)

* Improve settings information (#104)

* Improve settings information

* feat(settings): add server host URL as default value

* style(settings): remove extra wordings

---------

Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* Feature: secure API communication upgrade (#107)

* feat(exception): throw separate exceptions

* feat(api): separate token from api link
- update: merge getLink into a single function
- add: Dto for Links results
- pass: token in authorization header
- update: upload and download to use new api links
- refactor: remove extra isVersion input

* chore: fix code style

---------

Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* bugfix: exception handling to ensure the response is handled correctly (#109)

* bugfix: correct exception handling to ensure the response is handled correclty by calling test() function.
- update: do not assume an array (json) response from the api. The response is not always json which cause the json_decode() to return null;
- add: use StorageNotAvailableException to ensure a user-friendly error message to be displayed on the front.end;
- update: return value can be a string

* chore: fix code style

* feat(api): check status
- update: response based on status code
- add: specific error for invalid code

* chore: fix code style

---------

Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* feat(docker): add install ocs api viewer app (#108)

* bugfix/correct-install-docker-windows (#106)

* - Correction to docker-compose for Windows installations.
- Added README for known issues

* Update README.md

bugfix(correct-install-docker-windows): add supporting images

* - add: formatting changes to README.md

---------

Co-authored-by: Take one <rontrevor@hotmail.com>

* Feature #1192 feedback form js (#111)

* Adding Feedback form

* Not working yet.
Probably need to change strategy and send request to nc first

* Feedback js working.
Something might be improved:
// TODO - Get API Url from beeswarmtrait or another place
// TODO - Improve layout with css
// TODO - Remove wiget when not is not in swarm folders

* chore: fix code style

* feat(env): upgrade get
- update: return null if key is not found

* feat(feedback): add api url
- add: app const
- add: env example

* feat(curl): add post and get methods
- update: swarm endpoints to use new methods

* feat(feedback): update feedback request

* refactor(curl): rename curl to request

* feat(curl): add accept headers to getLink
- refactor: use get for download instead of exec

* style(feedback): improve feedback from ui

* style(feedback): improve feedback from ui

* feat(feedback): use custom exception

* feat(feedback): add status code to exception

* feat(feedback): return correct status code

* feat(feedback): add feedback js as dependency
- remove: manual added js file
- add: npm package
- update: the code usage

---------

Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* feat(curl): check url for protocol

* bugfix(feedback): remove the removed script load

* feat(toast): add nextcloud dialogs (#112)

- add: library package
- update: fileactions.js usage
- update: swarm logo remove xml

* Fix/#1085  adding moodle to the documentation (#100)

* Adding moodle documentation

* FIxing link formating  error

---------

Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

---------

Co-authored-by: frozenbanana <3958329+frozenbanana@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

* update version deployed

* bump version

---------

Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: frozenbanana <3958329+frozenbanana@users.noreply.github.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>

* Release 20250314 (#120)

* feat(docker): fix env path (#119)

* fix(types): follow parent storage class (#118)

- fix: Etag return false not null
- remove: unmodified extended codes
- fix: verify path return type is void

---------

Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>

* fix: info.xml removed dublicated link

* feat(feedback): allow user to input different email (#124)

* feat(feedback): allow user to input different email

* chore: fix code style

* feat(feedback): allow email field

* fix(feedback): default email parse

* feat(feedback): allow anonymous feedbacks
- remove: fetching user email from backend
- add: observer to prefill the feedback form with user email
- update: don't send email data if not provided

* chore: fix code style

* perf(feedback): add observer to the feedback root element

---------

Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* feature: file actions + archive + installation + bugfixes + dev env (#126)

I tested the following features in the local development environment (NC 30):
- Comments: Working properly.
- Tags: Working properly.
- Upload: Working properly.
- Download: Working properly.
- Archive Files and Folders: Working properly.
- Unarchive Files and Folders: Working properly.
- Rename: Working properly.

However, there is one area of concern regarding the activation of the plug-in when external storage is not enabled. I encountered some issues in the local development environment, but I will assume (and hope) that these problems are specific to this environment and will not occur in production.

* fix: archive + restore + move + rename (#127)

* fix(hide): reload effect via FE channels

* fix(move): avoid custom move for other storage type
- add: interface for swarm storage
- add: func to check is swarm
- add: helper to avoid error on storages
- update: use helper storage type check on webdav plugin

* refactor(service): rename fileMapper

* fix(service): get token method

* feat(archive): init on first archive
- update: create archive folder on first file archive
- update: archive name to "Archive - Hejbit"
- update: hide action FE to emit update for folder to appear on root
- add: new archive path maker func on storage

* fix(restore): restore storage by token
- add: sort to keep tree structure
- add: keep archive readonly permissions

* chore: fix code style

---------

Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>

* fix(storage): remove type to support NC29+NC30 (#128)

* Release 0.6.0: PRs 121, 123, 124, 126, 127, 128

---------

Co-authored-by: retrevor <75954541+retrevor@users.noreply.github.com>
Co-authored-by: Take one <rontrevor@hotmail.com>
Co-authored-by: Mahyar Iranibazaz <mahiarirani@pm.me>
Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
Co-authored-by: mahiarirani <mahiarirani@users.noreply.github.com>
Co-authored-by: mahiarirani <10583381+mahiarirani@users.noreply.github.com>
Co-authored-by: JoaoSRaposo <1598265+JoaoSRaposo@users.noreply.github.com>
Co-authored-by: frozenbanana <3958329+frozenbanana@users.noreply.github.com>
2025-05-14 19:46:17 +02:00

171 lines
6.2 KiB
PHP
Executable file

<?php
/**
* @copyright Copyright (c) 2022, MetaProvide Holding EKF
* @author Ron Trevor <ecoron@proton.me>
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace OCA\Files_External_Ethswarm\AppInfo;
use OC\Security\CSP\ContentSecurityPolicy;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files_External_Ethswarm\Exception\BaseException;
use OCA\Files_External_Ethswarm\Utils\Env;
use OCP\App\AppPathNotFoundException;
use OCP\App\IAppManager;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Exceptions\AppConfigException;
use OCP\IConfig;
use OCP\Security\CSP\AddContentSecurityPolicyEvent;
use OCP\Util;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Sentry;
class Application extends App implements IBootstrap {
public const NAME = 'files_external_ethswarm';
public const API_URL = 'app.hejbit.com';
public const TELEMETRY_URL = 'https://c46a60056f22db1db257c1d99fa99e5f@sentry.metaprovide.org/2';
public const TELEMETRY_MINIMUM_SUPPORTED_NEXTCLOUD_VERSION = '30.0.0';
public ContainerInterface $container;
private readonly IEventDispatcher $dispatcher;
private LoggerInterface $logger;
private IConfig $config;
/**
* @throws AppConfigException
*/
public function __construct() {
parent::__construct(Application::NAME);
$this->logger = $this->getContainer()->get(LoggerInterface::class);
$this->config = $this->getContainer()->get(IConfig::class);
$this->dispatcher = $this->getContainer()->getServer()->get(IEventDispatcher::class);
$this->enableFilesExternalApp();
}
public function boot(IBootContext $context): void {
new ExternalStorage($this->getContainer(), $context);
$this->loadAssets($context);
$this->configureTelemetry();
}
public function register(IRegistrationContext $context): void {
$this->loadTelemetry();
$this->dispatcher->addListener(
AddContentSecurityPolicyEvent::class,
function (AddContentSecurityPolicyEvent $event): void {
$policy = new ContentSecurityPolicy();
$policy->addAllowedConnectDomain('https://*.hejbit.com');
if (Env::isDevelopment()) {
$policy->addAllowedConnectDomain('http://*.hejbit.local');
}
$event->addPolicy($policy);
}
);
}
/**
* @throws AppConfigException
*/
private function enableFilesExternalApp(): void {
/** @var IAppManager $appManager */
$appManager = $this->getContainer()->get(IAppManager::class);
if (!$appManager->isInstalled('files_external')) {
try {
$this->logger->info('External Storage Support app is not enabled, enabling it now');
$appManager->enableApp('files_external');
if ($appManager->isInstalled('files_external')) {
$this->logger->info('External Storage support enabled');
return;
}
$this->logger->warning('Try enabling it now by force');
$appManager->enableApp('files_external', true);
if ($appManager->isInstalled('files_external')) {
$this->logger->info('External Storage support enabled');
return;
}
$this->logger->error('Failed to enable External Storage Support app');
} catch (AppPathNotFoundException $e) {
}
throw new AppConfigException('External Storage Support app is required be installed and enabled. Please enable it to use this app.');
}
}
private function loadAssets($context): void {
Util::addStyle(Application::NAME, 'app');
Util::addScript(Application::NAME, 'nextcloud-swarm-plugin-settings');
/** @var IEventDispatcher $dispatcher */
$dispatcher = $context->getAppContainer()->get(IEventDispatcher::class);
$dispatcher->addListener(LoadAdditionalScriptsEvent::class, function () {
Util::addStyle(Application::NAME, 'feedback');
Util::addInitScript(Application::NAME, 'nextcloud-swarm-plugin-app');
});
}
private function loadTelemetry(): void {
// Register autoloader of sentry
$autoloadPath = __DIR__.'/../../vendor-bin/sentry/vendor/autoload.php';
if (!file_exists($autoloadPath)) {
throw new BaseException('Vendor autoload.php not found at: '.$autoloadPath);
}
require_once $autoloadPath;
}
private function configureTelemetry(): void {
// Initialize Sentry if telemetry is enabled and the nextcloud version is supported
$environment = Env::get('ENV') ?? 'production';
// Get telemetry enabled status and current nextcloud version
$currentNextcloudVersion = $this->config->getSystemValue('version');
$isSupported = version_compare($currentNextcloudVersion, Application::TELEMETRY_MINIMUM_SUPPORTED_NEXTCLOUD_VERSION, '>=');
// if telemetry is not set, set it to true
// but if it is set to false, don't override it
if ('' === $this->config->getSystemValue('telemetry.enabled') && $isSupported) {
$this->config->setSystemValue('telemetry.enabled', false);
$this->logger->info('Telemetry option has not been set, setting it to true');
}
if ($this->config->getSystemValue('telemetry.enabled') && $isSupported) {
Sentry\init([
'dsn' => Application::TELEMETRY_URL,
'traces_sample_rate' => 1.0,
'environment' => $environment,
]);
$this->logger->info('Telemetry is enabled and the nextcloud version is supported');
} elseif ($this->config->getSystemValue('telemetry.enabled') && !$isSupported) {
$this->logger->info('Telemetry is enabled but the nextcloud version '.$currentNextcloudVersion.' is not supported');
} elseif (false === $this->config->getSystemValue('telemetry.enabled')) {
$this->logger->info('Telemetry is disabled');
}
}
}