mirror of
https://github.com/MetaProvide/nextcloud-swarm-plugin.git
synced 2025-03-15 00:32:45 +00:00
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>
This commit is contained in:
parent
63221db916
commit
608e3a5892
26 changed files with 1366 additions and 1173 deletions
MakefileREADME.mdpackage-lock.jsonpackage.json
appinfo
cli/staging
composer.jsoncomposer.lockjs
lib
AppInfo
Controller
Exception
Settings
src
templates
tests
vendor-bin
14
Makefile
14
Makefile
|
@ -10,9 +10,9 @@ cert_directory=$(HOME)/.nextcloud/certificates
|
|||
|
||||
all: dev-setup lint build-js-production
|
||||
|
||||
release: npm-init build-js-production build-tarball
|
||||
release: composer npm-init build-js-production build-tarball
|
||||
|
||||
appstore: npm-init build-js-production build-appstore-tarball
|
||||
appstore: composer npm-init build-js-production build-appstore-tarball
|
||||
|
||||
dev-setup: clean-dev composer npm-init
|
||||
|
||||
|
@ -91,8 +91,8 @@ build-tarball:
|
|||
--exclude="dev-environment" \
|
||||
--exclude="docker" \
|
||||
--exclude="node_modules" \
|
||||
--exclude="src" \
|
||||
--exclude="vendor" \
|
||||
--exclude="./src" \
|
||||
--exclude="./vendor" \
|
||||
--exclude=".editorconfig" \
|
||||
--exclude=".eslintrc.js" \
|
||||
--exclude=".gitignore" \
|
||||
|
@ -109,6 +109,7 @@ build-tarball:
|
|||
--exclude="package.json" \
|
||||
--exclude="stylelint.config.js" \
|
||||
--exclude="webpack.config.js" \
|
||||
--exclude="CHANGELOG.md" \
|
||||
../$(app_name)/ $(temp_build_directory)/$(app_id)
|
||||
tar czf $(build_directory)/$(app_name).tar.gz \
|
||||
-C $(temp_build_directory) $(app_id)
|
||||
|
@ -126,8 +127,8 @@ build-appstore-tarball:
|
|||
--exclude="dev-environment" \
|
||||
--exclude="docker" \
|
||||
--exclude="node_modules" \
|
||||
--exclude="src" \
|
||||
--exclude="vendor" \
|
||||
--exclude="./src" \
|
||||
--exclude="./vendor" \
|
||||
--exclude=".editorconfig" \
|
||||
--exclude=".eslintrc.js" \
|
||||
--exclude=".gitignore" \
|
||||
|
@ -144,6 +145,7 @@ build-appstore-tarball:
|
|||
--exclude="package.json" \
|
||||
--exclude="stylelint.config.js" \
|
||||
--exclude="webpack.config.js" \
|
||||
--exclude="CHANGELOG.md" \
|
||||
../$(app_id)/ $(temp_build_directory)/$(app_id)
|
||||
@if [ -f $(cert_directory)/$(app_id).key ]; then \
|
||||
echo "Signing app files…"; \
|
||||
|
|
|
@ -21,7 +21,7 @@ This plugin integrates [Swarm](https://www.ethswarm.org/) (a decentralized, bloc
|
|||
|
||||
Before using the plugin, ensure you have the following:
|
||||
|
||||
- An active Nextcloud instance (version 27,28 or 29)
|
||||
- An active Nextcloud instance (version 29,30 or 31)
|
||||
- A valid license and URL to activate the service
|
||||
- [Request Your Free Nextcloud Swarm Plugin Trial License](https://metaprovide.org/hejbit/start)
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ This plugin integrates [Swarm](https://www.ethswarm.org/) (a decentralized, bloc
|
|||
|
||||
Before using the plugin, ensure you have the following:
|
||||
|
||||
- An active Nextcloud instance (version 28,29 or 30)
|
||||
- An active Nextcloud instance (version 29,30 or 31)
|
||||
- A valid license and URL to activate the service
|
||||
- [Request Your Free Nextcloud Swarm Plugin Trial License](https://metaprovide.org/hejbit/start)
|
||||
|
||||
|
@ -71,7 +71,7 @@ Experience the future of data storage with 5GB of free, decentralized storage on
|
|||
|
||||
[Get your free licence here!](https://metaprovide.org/hejbit/start)
|
||||
]]></description>
|
||||
<version>0.5.11</version>
|
||||
<version>0.5.12</version>
|
||||
<licence>agpl</licence>
|
||||
<author>MetaProvide</author>
|
||||
<namespace>Files_External_Ethswarm</namespace>
|
||||
|
@ -86,8 +86,12 @@ Experience the future of data storage with 5GB of free, decentralized storage on
|
|||
<repository type="git">https://github.com/MetaProvide/nextcloud-swarm-plugin.git</repository>
|
||||
<screenshot>https://raw.githubusercontent.com/MetaProvide/nextcloud-swarm-plugin/main/assets/images/swarm_Files.png</screenshot>
|
||||
<dependencies>
|
||||
<nextcloud min-version="28" max-version="30"/>
|
||||
<nextcloud min-version="29" max-version="31"/>
|
||||
</dependencies>
|
||||
<settings>
|
||||
<admin>OCA\Files_External_Ethswarm\Settings\Admin</admin>
|
||||
<admin-section>OCA\Files_External_Ethswarm\Settings\Section</admin-section>
|
||||
</settings>
|
||||
<sabre>
|
||||
<plugins>
|
||||
<plugin>OCA\Files_External_Ethswarm\Sabre\PropfindPlugin</plugin>
|
||||
|
|
|
@ -20,30 +20,33 @@ declare(strict_types=1);
|
|||
* 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/>.
|
||||
*/
|
||||
return ['routes' => [
|
||||
[
|
||||
'name' => 'Settings#save',
|
||||
'url' => '/save',
|
||||
'verb' => 'POST',
|
||||
|
||||
return [
|
||||
'routes' => [
|
||||
[
|
||||
'name' => 'Settings#save',
|
||||
'url' => '/settings',
|
||||
'verb' => 'POST',
|
||||
],
|
||||
[
|
||||
'name' => 'Bee#createPostageBatch',
|
||||
'url' => '/bee/createPostageBatch',
|
||||
'verb' => 'POST',
|
||||
],
|
||||
[
|
||||
'name' => 'Bee#verifyBeeNodeAccess',
|
||||
'url' => '/bee/verifyBeeNodeAccess',
|
||||
'verb' => 'POST',
|
||||
],
|
||||
[
|
||||
'name' => 'Bee#topUpBatch',
|
||||
'url' => '/bee/topUpBatch',
|
||||
'verb' => 'POST',
|
||||
],
|
||||
[
|
||||
'name' => 'Feedback#submit',
|
||||
'url' => '/feedback/submit',
|
||||
'verb' => 'POST',
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'Bee#createPostageBatch',
|
||||
'url' => '/bee/createPostageBatch',
|
||||
'verb' => 'POST',
|
||||
],
|
||||
[
|
||||
'name' => 'Bee#verifyBeeNodeAccess',
|
||||
'url' => '/bee/verifyBeeNodeAccess',
|
||||
'verb' => 'POST',
|
||||
],
|
||||
[
|
||||
'name' => 'Bee#topUpBatch',
|
||||
'url' => '/bee/topUpBatch',
|
||||
'verb' => 'POST',
|
||||
],
|
||||
[
|
||||
'name' => 'Feedback#submit',
|
||||
'url' => '/feedback/submit',
|
||||
'verb' => 'POST',
|
||||
],
|
||||
]];
|
||||
];
|
||||
|
|
|
@ -119,7 +119,7 @@ log_gap
|
|||
|
||||
DEPLOYMENT=()
|
||||
TIMESTAMP=$(date +%s)
|
||||
for version in {28..30}; do
|
||||
for version in {29..31}; do
|
||||
deploy "$version" &
|
||||
DEPLOYMENT+=($!)
|
||||
done
|
||||
|
|
|
@ -13,10 +13,29 @@
|
|||
"require-dev": {
|
||||
"nextcloud/coding-standard": "^1.3.2",
|
||||
"ext-fileinfo": "*",
|
||||
"friendsofphp/php-cs-fixer": "*"
|
||||
"friendsofphp/php-cs-fixer": "*",
|
||||
"bamarni/composer-bin-plugin": "^1.8"
|
||||
},
|
||||
"scripts": {
|
||||
"cs:check": "./vendor/php-cs-fixer/shim/php-cs-fixer.phar fix --dry-run --diff",
|
||||
"cs:fix": "./vendor/php-cs-fixer/shim/php-cs-fixer.phar fix"
|
||||
"cs:fix": "./vendor/php-cs-fixer/shim/php-cs-fixer.phar fix",
|
||||
"post-install-cmd": [
|
||||
"[ $COMPOSER_DEV_MODE -eq 0 ] || composer bin all install --ansi"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"[ $COMPOSER_DEV_MODE -eq 0 ] || composer bin all update --ansi"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"php-http/discovery": true,
|
||||
"bamarni/composer-bin-plugin": true
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
59
composer.lock
generated
59
composer.lock
generated
|
@ -4,9 +4,66 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "9a0365504a1790b1f04538b1f0ddd13d",
|
||||
"content-hash": "5ec978b13df1bcd971c7c9d0cd723f22",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "bamarni/composer-bin-plugin",
|
||||
"version": "1.8.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bamarni/composer-bin-plugin.git",
|
||||
"reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880",
|
||||
"reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer-plugin-api": "^2.0",
|
||||
"php": "^7.2.5 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/composer": "^2.0",
|
||||
"ext-json": "*",
|
||||
"phpstan/extension-installer": "^1.1",
|
||||
"phpstan/phpstan": "^1.8",
|
||||
"phpstan/phpstan-phpunit": "^1.1",
|
||||
"phpunit/phpunit": "^8.5 || ^9.5",
|
||||
"symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
|
||||
"symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
|
||||
"symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0"
|
||||
},
|
||||
"type": "composer-plugin",
|
||||
"extra": {
|
||||
"class": "Bamarni\\Composer\\Bin\\BamarniBinPlugin"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Bamarni\\Composer\\Bin\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "No conflicts for your bin dependencies",
|
||||
"keywords": [
|
||||
"composer",
|
||||
"conflict",
|
||||
"dependency",
|
||||
"executable",
|
||||
"isolation",
|
||||
"tool"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/bamarni/composer-bin-plugin/issues",
|
||||
"source": "https://github.com/bamarni/composer-bin-plugin/tree/1.8.2"
|
||||
},
|
||||
"time": "2022-10-31T08:38:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "kubawerlos/php-cs-fixer-custom-fixers",
|
||||
"version": "v3.22.0",
|
||||
|
|
|
@ -1,24 +1,3 @@
|
|||
/*
|
||||
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
*
|
||||
* @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
*
|
||||
* @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/>.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Determine if an object is a Buffer
|
||||
*
|
||||
|
@ -54,6 +33,18 @@
|
|||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* focus-trap 6.9.4
|
||||
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
/*!
|
||||
* tabbable 5.3.3
|
||||
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
/*! For license information please see ncvuecomponents.js.LICENSE.txt */
|
||||
|
||||
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
||||
* http://hammerjs.github.io/
|
||||
*
|
||||
|
@ -62,93 +53,6 @@
|
|||
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/**
|
||||
* @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
*
|
||||
* @author 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
*
|
||||
* @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/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 Georg Ehrke
|
||||
*
|
||||
|
@ -195,249 +99,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 Georg Ehrke
|
||||
*
|
||||
* @author Georg Ehrke <oc.list@georgehrke.com>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 Marco Ambrosini <marcoambrosini@pm.me>
|
||||
*
|
||||
* @author Marco Ambrosini <marcoambrosini@pm.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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2020 Georg Ehrke
|
||||
*
|
||||
* @author Georg Ehrke <georg-nextcloud@ehrke.email>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2020 Georg Ehrke <georg-nextcloud@ehrke.email>
|
||||
*
|
||||
* @author Georg Ehrke <georg-nextcloud@ehrke.email>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2020 Raimund Schlüßler <raimund.schluessler@mailbox.org>
|
||||
*
|
||||
* @author Raimund Schlüßler <raimund.schluessler@mailbox.org>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2020 Raimund Schlüßler <raimund.schluessler@mailbox.org>
|
||||
*
|
||||
* @author Raimund Schlüßler <raimund.schluessler@mailbox.org>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 Christoph Wurst
|
||||
*
|
||||
|
@ -460,28 +121,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**!
|
||||
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
||||
* @version 1.16.1
|
||||
|
|
|
@ -26,5 +26,7 @@ namespace OCA\Files_External_Ethswarm\AppInfo;
|
|||
class AppConstants {
|
||||
// Application-wide constants go here
|
||||
public const APP_NAME = 'files_external_ethswarm';
|
||||
public const TELEMETRY_URL = 'https://c46a60056f22db1db257c1d99fa99e5f@sentry.metaprovide.org/2';
|
||||
public const TELEMETRY_MINIMUM_SUPPORTED_NEXTCLOUD_VERSION = '30.0.0';
|
||||
public const API_URL = 'app.hejbit.com';
|
||||
}
|
||||
|
|
|
@ -29,13 +29,18 @@ use OCA\Files_External\Lib\Config\IBackendProvider;
|
|||
use OCA\Files_External\Service\BackendService;
|
||||
use OCA\Files_External_Ethswarm\Auth\License;
|
||||
use OCA\Files_External_Ethswarm\Backend\BeeSwarm;
|
||||
use OCA\Files_External_Ethswarm\Exception\BaseException;
|
||||
use OCA\Files_External_Ethswarm\Notification\Notifier;
|
||||
use OCA\Files_External_Ethswarm\Utils\Env;
|
||||
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\IConfig;
|
||||
use OCP\Util;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Sentry;
|
||||
|
||||
class Application extends App implements IBootstrap, IBackendProvider, IAuthMechanismProvider {
|
||||
public function __construct(array $urlParams = []) {
|
||||
|
@ -51,6 +56,38 @@ class Application extends App implements IBootstrap, IBackendProvider, IAuthMech
|
|||
}
|
||||
|
||||
public function boot(IBootContext $context): void {
|
||||
$container = $this->getContainer();
|
||||
$config = $container->get(IConfig::class);
|
||||
|
||||
// Initialize Sentry if telemetry is enabled and the nextcloud version is supported
|
||||
$environment = Env::get('ENV') ?? 'production';
|
||||
$logger = $container->get(LoggerInterface::class);
|
||||
|
||||
// if telemetry is not set, set it to true
|
||||
// but if it is set to false, don't override it
|
||||
if ('' === $config->getSystemValue('telemetry.enabled')) {
|
||||
$config->setSystemValue('telemetry.enabled', true);
|
||||
$logger->info('Telemetry option has not been set, setting it to true');
|
||||
}
|
||||
|
||||
// Get telemetry enabled status and current nextcloud version
|
||||
$currentNextcloudVersion = $config->getSystemValue('version');
|
||||
$isSupported = version_compare($currentNextcloudVersion, AppConstants::TELEMETRY_MINIMUM_SUPPORTED_NEXTCLOUD_VERSION, '>=');
|
||||
|
||||
if ($config->getSystemValue('telemetry.enabled') && $isSupported) {
|
||||
Sentry\init([
|
||||
'dsn' => AppConstants::TELEMETRY_URL,
|
||||
'traces_sample_rate' => 1.0,
|
||||
'environment' => $environment,
|
||||
]);
|
||||
|
||||
$logger->info('Telemetry is enabled and the nextcloud version is supported');
|
||||
} elseif ($config->getSystemValue('telemetry.enabled') && !$isSupported) {
|
||||
$logger->info('Telemetry is enabled but the nextcloud version '.$currentNextcloudVersion.' is not supported');
|
||||
} elseif (false === $config->getSystemValue('telemetry.enabled')) {
|
||||
$logger->info('Telemetry is disabled');
|
||||
}
|
||||
|
||||
$context->injectFn([$this, 'registerEventsScripts']);
|
||||
|
||||
$context->injectFn(function (BackendService $backendService) {
|
||||
|
@ -83,6 +120,14 @@ class Application extends App implements IBootstrap, IBackendProvider, IAuthMech
|
|||
|
||||
public function register(IRegistrationContext $context): void {
|
||||
$context->registerNotifierService(Notifier::class);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
public function getAuthMechanisms() {
|
||||
|
|
|
@ -47,13 +47,22 @@ class SettingsController extends Controller {
|
|||
* Set the storage config settings.
|
||||
*/
|
||||
public function admin(): void {
|
||||
if ($this->request->getParam('storageconfig')) {
|
||||
$this->config->setAppValue($this->appName, 'storageconfig', $this->request->getParam('storageconfig'));
|
||||
} else {
|
||||
$this->config->setAppValue($this->appName, 'storageconfig', '');
|
||||
// Handle telemetry setting
|
||||
$telemetry = $this->request->getParam('telemetry');
|
||||
if (null !== $telemetry) {
|
||||
$this->config->setSystemValue('telemetry.enabled', (bool) $telemetry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current settings.
|
||||
*/
|
||||
public function getSettings(): array {
|
||||
return [
|
||||
'telemetry_enabled' => $this->config->getSystemValue('telemetry.enabled', false),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
|
@ -61,10 +70,10 @@ class SettingsController extends Controller {
|
|||
* Save the storage config settings
|
||||
*/
|
||||
public function save(): void {
|
||||
if ($this->request->getParam('storageconfig')) {
|
||||
$this->config->setAppValue($this->appName, 'storageconfig', $this->request->getParam('storageconfig'));
|
||||
} else {
|
||||
$this->config->setAppValue($this->appName, 'storageconfig', '');
|
||||
// Handle telemetry setting
|
||||
$telemetry = $this->request->getParam('telemetry');
|
||||
if (null !== $telemetry) {
|
||||
$this->config->setSystemValue('telemetry.enabled', (bool) $telemetry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
21
lib/Exception/BaseException.php
Normal file
21
lib/Exception/BaseException.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\Files_External_Ethswarm\Exception;
|
||||
|
||||
use Exception;
|
||||
use OC;
|
||||
use OCP\IConfig;
|
||||
use Sentry;
|
||||
|
||||
class BaseException extends Exception {
|
||||
public function __construct($message, $code = 0, ?Exception $previous = null) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
|
||||
// Report exception to Sentry if enabled
|
||||
$config = OC::$server->get(IConfig::class);
|
||||
$telemetryEnabled = $config->getSystemValue('telemetry.enabled', false);
|
||||
if ($telemetryEnabled) {
|
||||
Sentry\captureException($this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ namespace OCA\Files_External_Ethswarm\Exception;
|
|||
|
||||
use Exception;
|
||||
|
||||
class CurlException extends Exception {
|
||||
class CurlException extends BaseException {
|
||||
public function __construct($message, $code = 0, ?Exception $previous = null) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace OCA\Files_External_Ethswarm\Exception;
|
|||
|
||||
use Exception;
|
||||
|
||||
class HejBitException extends Exception {
|
||||
class HejBitException extends BaseException {
|
||||
public function __construct($message, $code = 0, ?Exception $previous = null) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
|
70
lib/Settings/Admin.php
Normal file
70
lib/Settings/Admin.php
Normal file
|
@ -0,0 +1,70 @@
|
|||
<?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/>.
|
||||
*/
|
||||
|
||||
namespace OCA\Files_External_Ethswarm\Settings;
|
||||
|
||||
use OCA\Files_External\Service\GlobalStoragesService;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IConfig;
|
||||
use OCP\Settings\ISettings;
|
||||
use OCP\Util;
|
||||
|
||||
class Admin implements ISettings {
|
||||
/** @var string */
|
||||
protected $appName;
|
||||
|
||||
/** @var IConfig */
|
||||
private $config;
|
||||
|
||||
/** @var GlobalStoragesService */
|
||||
private $globalStoragesService;
|
||||
|
||||
public function __construct(
|
||||
$appName,
|
||||
IConfig $config,
|
||||
GlobalStoragesService $globalStoragesService
|
||||
) {
|
||||
$this->appName = $appName;
|
||||
$this->config = $config;
|
||||
$this->globalStoragesService = $globalStoragesService;
|
||||
}
|
||||
|
||||
public function getForm(): TemplateResponse {
|
||||
$parameters = [
|
||||
'telemetry_enabled' => $this->config->getSystemValue('telemetry.enabled', false),
|
||||
];
|
||||
|
||||
Util::addScript($this->appName, 'nextcloud-swarm-plugin-main');
|
||||
|
||||
return new TemplateResponse($this->appName, 'vue-admin-settings', ['params' => $parameters]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string the section ID, e.g. 'sharing'
|
||||
*/
|
||||
public function getSection(): string {
|
||||
return $this->appName;
|
||||
}
|
||||
|
||||
public function getPriority(): int {
|
||||
return 5;
|
||||
}
|
||||
}
|
78
lib/Settings/Section.php
Normal file
78
lib/Settings/Section.php
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?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/>.
|
||||
*/
|
||||
|
||||
namespace OCA\Files_External_Ethswarm\Settings;
|
||||
|
||||
use OCP\IL10N;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\Settings\IIconSection;
|
||||
|
||||
class Section implements IIconSection {
|
||||
/** @var string */
|
||||
protected $appName;
|
||||
|
||||
/** @var IL10N */
|
||||
private $l;
|
||||
|
||||
/** @var IURLGenerator */
|
||||
private $url;
|
||||
|
||||
public function __construct(string $appName, IURLGenerator $url, IL10N $l) {
|
||||
$this->appName = $appName;
|
||||
$this->url = $url;
|
||||
$this->l = $l;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the ID of the section. It is supposed to be a lower case string,
|
||||
* e.g. 'ldap'.
|
||||
*
|
||||
* @returns string
|
||||
*/
|
||||
public function getID() {
|
||||
return $this->appName;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the translated name as it should be displayed, e.g. 'LDAP / AD
|
||||
* integration'. Use the L10N service to translate it.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->l->t('Swarm By Hejbit');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int whether the form should be rather on the top or bottom of
|
||||
* the settings navigation. The sections are arranged in ascending order of
|
||||
* the priority values. It is required to return a value between 0 and 99.
|
||||
*
|
||||
* E.g.: 70
|
||||
*/
|
||||
public function getPriority() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return $this->url->imagePath($this->appName, 'hejbit-logo.svg');
|
||||
}
|
||||
}
|
176
package-lock.json
generated
176
package-lock.json
generated
|
@ -17,7 +17,7 @@
|
|||
"@nextcloud/event-bus": "^3.3.1",
|
||||
"@nextcloud/files": "^3.6.0",
|
||||
"@nextcloud/router": "^2.0.0",
|
||||
"@nextcloud/vue": "^5.3.0",
|
||||
"@nextcloud/vue": "^5.4.0",
|
||||
"axios": "^0.27.2",
|
||||
"ical.js": "^1.4.0",
|
||||
"linkifyjs": "^3.0.0",
|
||||
|
@ -2455,9 +2455,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@nextcloud/vue": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-5.3.0.tgz",
|
||||
"integrity": "sha512-yRxEeQIgNHafvD2MC//BQXCkyyXiNQQZUGErlwOuuKpZbTX2BYTdvrN15On7rTqJNzwmwuzXAIPIFc0D8c2h+g==",
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-5.4.0.tgz",
|
||||
"integrity": "sha512-YybOMuStBKtCwbssxMNEd0A8k/Qr5+zm9vnSOaLaMxeB8iaUU+PgBNiYGo8O24UJjSS6FqFwg02V4XzI1Sd6Lw==",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@nextcloud/auth": "^1.2.3",
|
||||
"@nextcloud/axios": "^1.3.2",
|
||||
|
@ -2472,13 +2473,14 @@
|
|||
"debounce": "1.2.1",
|
||||
"emoji-mart-vue-fast": "^10.2.1",
|
||||
"escape-html": "^1.0.3",
|
||||
"focus-trap": "^6.8.1",
|
||||
"hammerjs": "^2.0.8",
|
||||
"linkify-string": "^3.0.2",
|
||||
"md5": "^2.2.1",
|
||||
"splitpanes": "^2.3.6",
|
||||
"string-length": "^5.0.0",
|
||||
"striptags": "^3.1.1",
|
||||
"style-loader": "^2.0.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"tributejs": "^5.1.3",
|
||||
"v-click-outside": "^3.0.1",
|
||||
"v-tooltip": "^2.0.3",
|
||||
|
@ -2486,7 +2488,6 @@
|
|||
"vue-color": "^2.7.1",
|
||||
"vue-material-design-icons": "^5.0.0",
|
||||
"vue-multiselect": "^2.1.6",
|
||||
"vue-visible": "^1.0.2",
|
||||
"vue2-datepicker": "^3.6.3"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -2522,29 +2523,6 @@
|
|||
"semver": "^7.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@nextcloud/vue/node_modules/ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"uri-js": "^4.2.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/@nextcloud/vue/node_modules/ajv-keywords": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
||||
"peerDependencies": {
|
||||
"ajv": "^6.9.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@nextcloud/vue/node_modules/axios": {
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz",
|
||||
|
@ -2553,47 +2531,6 @@
|
|||
"follow-redirects": "^1.14.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@nextcloud/vue/node_modules/json-schema-traverse": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
||||
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
|
||||
},
|
||||
"node_modules/@nextcloud/vue/node_modules/schema-utils": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
|
||||
"integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.8",
|
||||
"ajv": "^6.12.5",
|
||||
"ajv-keywords": "^3.5.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
}
|
||||
},
|
||||
"node_modules/@nextcloud/vue/node_modules/style-loader": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/style-loader/-/style-loader-2.0.0.tgz",
|
||||
"integrity": "sha512-Z0gYUJmzZ6ZdRUqpg1r8GsaFKypE+3xAzuFeMuoHgjc9KZv3wMyCRjQIWEbhoFSq7+7yoHXySDJyyWQaPajeiQ==",
|
||||
"dependencies": {
|
||||
"loader-utils": "^2.0.0",
|
||||
"schema-utils": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"webpack": "^4.0.0 || ^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@nextcloud/webpack-vue-config": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/webpack-vue-config/-/webpack-vue-config-5.0.0.tgz",
|
||||
|
@ -3790,6 +3727,7 @@
|
|||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
|
||||
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
|
@ -5035,6 +4973,7 @@
|
|||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
|
||||
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
}
|
||||
|
@ -6381,6 +6320,14 @@
|
|||
"integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/focus-trap": {
|
||||
"version": "6.9.4",
|
||||
"resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-6.9.4.tgz",
|
||||
"integrity": "sha512-v2NTsZe2FF59Y+sDykKY+XjqZ0cPfhq/hikWVL88BqLivnNiEffAsac6rP6H45ff9wG9LL5ToiDqrLEP9GX9mw==",
|
||||
"dependencies": {
|
||||
"tabbable": "^5.3.3"
|
||||
}
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.9",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||
|
@ -7836,6 +7783,7 @@
|
|||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
|
||||
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"big.js": "^5.2.2",
|
||||
"emojis-list": "^3.0.0",
|
||||
|
@ -10277,7 +10225,6 @@
|
|||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.1.tgz",
|
||||
"integrity": "sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 12.13.0"
|
||||
},
|
||||
|
@ -10538,6 +10485,11 @@
|
|||
"integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/tabbable": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tabbable/-/tabbable-5.3.3.tgz",
|
||||
"integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA=="
|
||||
},
|
||||
"node_modules/table": {
|
||||
"version": "6.8.0",
|
||||
"resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz",
|
||||
|
@ -11269,11 +11221,6 @@
|
|||
"vue": "^2.6.11"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-visible": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vue-visible/-/vue-visible-1.0.2.tgz",
|
||||
"integrity": "sha512-yaX2its9XAJKGuQqf7LsiZHHSkxsIK8rmCOQOvEGEoF41blKRK8qr9my4qYoD6ikdLss4n8tKqYBecmaY0+WJg=="
|
||||
},
|
||||
"node_modules/vue2-datepicker": {
|
||||
"version": "3.10.4",
|
||||
"resolved": "https://registry.npmjs.org/vue2-datepicker/-/vue2-datepicker-3.10.4.tgz",
|
||||
|
@ -13492,9 +13439,9 @@
|
|||
}
|
||||
},
|
||||
"@nextcloud/vue": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-5.3.0.tgz",
|
||||
"integrity": "sha512-yRxEeQIgNHafvD2MC//BQXCkyyXiNQQZUGErlwOuuKpZbTX2BYTdvrN15On7rTqJNzwmwuzXAIPIFc0D8c2h+g==",
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-5.4.0.tgz",
|
||||
"integrity": "sha512-YybOMuStBKtCwbssxMNEd0A8k/Qr5+zm9vnSOaLaMxeB8iaUU+PgBNiYGo8O24UJjSS6FqFwg02V4XzI1Sd6Lw==",
|
||||
"requires": {
|
||||
"@nextcloud/auth": "^1.2.3",
|
||||
"@nextcloud/axios": "^1.3.2",
|
||||
|
@ -13509,13 +13456,14 @@
|
|||
"debounce": "1.2.1",
|
||||
"emoji-mart-vue-fast": "^10.2.1",
|
||||
"escape-html": "^1.0.3",
|
||||
"focus-trap": "^6.8.1",
|
||||
"hammerjs": "^2.0.8",
|
||||
"linkify-string": "^3.0.2",
|
||||
"md5": "^2.2.1",
|
||||
"splitpanes": "^2.3.6",
|
||||
"string-length": "^5.0.0",
|
||||
"striptags": "^3.1.1",
|
||||
"style-loader": "^2.0.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"tributejs": "^5.1.3",
|
||||
"v-click-outside": "^3.0.1",
|
||||
"v-tooltip": "^2.0.3",
|
||||
|
@ -13523,7 +13471,6 @@
|
|||
"vue-color": "^2.7.1",
|
||||
"vue-material-design-icons": "^5.0.0",
|
||||
"vue-multiselect": "^2.1.6",
|
||||
"vue-visible": "^1.0.2",
|
||||
"vue2-datepicker": "^3.6.3"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -13551,23 +13498,6 @@
|
|||
"semver": "^7.3.2"
|
||||
}
|
||||
},
|
||||
"ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||
"requires": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"uri-js": "^4.2.2"
|
||||
}
|
||||
},
|
||||
"ajv-keywords": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
||||
"requires": {}
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz",
|
||||
|
@ -13575,30 +13505,6 @@
|
|||
"requires": {
|
||||
"follow-redirects": "^1.14.4"
|
||||
}
|
||||
},
|
||||
"json-schema-traverse": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
||||
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
|
||||
},
|
||||
"schema-utils": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
|
||||
"integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
|
||||
"requires": {
|
||||
"@types/json-schema": "^7.0.8",
|
||||
"ajv": "^6.12.5",
|
||||
"ajv-keywords": "^3.5.2"
|
||||
}
|
||||
},
|
||||
"style-loader": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/style-loader/-/style-loader-2.0.0.tgz",
|
||||
"integrity": "sha512-Z0gYUJmzZ6ZdRUqpg1r8GsaFKypE+3xAzuFeMuoHgjc9KZv3wMyCRjQIWEbhoFSq7+7yoHXySDJyyWQaPajeiQ==",
|
||||
"requires": {
|
||||
"loader-utils": "^2.0.0",
|
||||
"schema-utils": "^3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -14613,7 +14519,8 @@
|
|||
"big.js": {
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
|
||||
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="
|
||||
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"binary-extensions": {
|
||||
"version": "2.2.0",
|
||||
|
@ -15597,7 +15504,8 @@
|
|||
"emojis-list": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
|
||||
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q=="
|
||||
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
|
||||
"dev": true
|
||||
},
|
||||
"encodeurl": {
|
||||
"version": "1.0.2",
|
||||
|
@ -16586,6 +16494,14 @@
|
|||
"integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==",
|
||||
"dev": true
|
||||
},
|
||||
"focus-trap": {
|
||||
"version": "6.9.4",
|
||||
"resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-6.9.4.tgz",
|
||||
"integrity": "sha512-v2NTsZe2FF59Y+sDykKY+XjqZ0cPfhq/hikWVL88BqLivnNiEffAsac6rP6H45ff9wG9LL5ToiDqrLEP9GX9mw==",
|
||||
"requires": {
|
||||
"tabbable": "^5.3.3"
|
||||
}
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.15.9",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||
|
@ -17603,6 +17519,7 @@
|
|||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
|
||||
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"big.js": "^5.2.2",
|
||||
"emojis-list": "^3.0.0",
|
||||
|
@ -19433,7 +19350,6 @@
|
|||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.1.tgz",
|
||||
"integrity": "sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"style-search": {
|
||||
|
@ -19615,6 +19531,11 @@
|
|||
"integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=",
|
||||
"dev": true
|
||||
},
|
||||
"tabbable": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tabbable/-/tabbable-5.3.3.tgz",
|
||||
"integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA=="
|
||||
},
|
||||
"table": {
|
||||
"version": "6.8.0",
|
||||
"resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz",
|
||||
|
@ -20183,11 +20104,6 @@
|
|||
"vue-resize": "^0.4.5"
|
||||
}
|
||||
},
|
||||
"vue-visible": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vue-visible/-/vue-visible-1.0.2.tgz",
|
||||
"integrity": "sha512-yaX2its9XAJKGuQqf7LsiZHHSkxsIK8rmCOQOvEGEoF41blKRK8qr9my4qYoD6ikdLss4n8tKqYBecmaY0+WJg=="
|
||||
},
|
||||
"vue2-datepicker": {
|
||||
"version": "3.10.4",
|
||||
"resolved": "https://registry.npmjs.org/vue2-datepicker/-/vue2-datepicker-3.10.4.tgz",
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
"@nextcloud/event-bus": "^3.3.1",
|
||||
"@nextcloud/files": "^3.6.0",
|
||||
"@nextcloud/router": "^2.0.0",
|
||||
"@nextcloud/vue": "^5.3.0",
|
||||
"@nextcloud/vue": "^5.4.0",
|
||||
"axios": "^0.27.2",
|
||||
"ical.js": "^1.4.0",
|
||||
"linkifyjs": "^3.0.0",
|
||||
|
|
671
src/App.vue
671
src/App.vue
|
@ -1,236 +1,82 @@
|
|||
<template>
|
||||
<AppContent>
|
||||
<div class="section">
|
||||
<h2 class="inlineblock">External Storage: Swarm</h2>
|
||||
<Content app-name="files_external_ethswarm">
|
||||
<AppContent>
|
||||
<SettingsSection>
|
||||
<AppContentHeader>
|
||||
<HeaderDetails class="header-details">
|
||||
<h1>External Storage: Swarm By Hejbit</h1>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
class="icon-info"
|
||||
title="Open documentation"
|
||||
href="https://github.com/MetaProvide/nextcloud-swarm-plugin/">
|
||||
</a>
|
||||
</HeaderDetails>
|
||||
</AppContentHeader>
|
||||
|
||||
<div>
|
||||
Access key:
|
||||
<input v-model="accessKey" type="text" maxlength="200" />
|
||||
<button @click="verifyAccessKey">Verify</button>
|
||||
<AppSettingsSection title="Telemetry">
|
||||
<strong>Why Telemetry is Important for Us and for You</strong>
|
||||
<p>Our telemetry is designed solely to capture exceptions (errors) that occur while using our Nextcloud plugin. This means it focuses exclusively on identifying and understanding issues that might disrupt your experience. Here's why enabling telemetry can benefit both you and us:</p>
|
||||
|
||||
<!-- message box -->
|
||||
<div v-if="accessKeySubmitted" class="message">
|
||||
<div class="message-text">
|
||||
<span v-if="hasAccess" class="icon-checkmark"></span>
|
||||
<span v-else class="icon-alert-outline-white"></span>
|
||||
<span>{{ message }}</span>
|
||||
<button @click="accessKeySubmitted = false">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li>Improving Stability and Reliability</li>
|
||||
<li>Proactive Problem Solving</li>
|
||||
<li>Focusing on What Matters</li>
|
||||
<li>Respecting Your Privacy</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<a
|
||||
target="_blank" rel="noreferrer" class="icon-info" title="Open documentation"
|
||||
href="https://github.com/MetaProvide/nextcloud-swarm-plugin/"></a>
|
||||
<p class="settings-hint">
|
||||
View the current status of the Swarm node(s) configured in
|
||||
'External Storage' section of NextCloud.
|
||||
</p>
|
||||
<div v-if="parsedMounts.length === 0">
|
||||
Please configure a Swarm storage in the
|
||||
<a href="externalstorages">"External Storage"</a> Administration
|
||||
section.
|
||||
</div>
|
||||
<div v-for="(mount, mountidx) in parsedMounts" :key="mount.mount_id">
|
||||
<div @click="setSaveMessage(mountidx, '')">
|
||||
<h3>
|
||||
Swarm Node: <b>{{ mount.mount_name }}</b>
|
||||
<Actions>
|
||||
<ActionButton icon="icon-caret-dark" @click="showNode(mountidx)"></ActionButton>
|
||||
</Actions>
|
||||
</h3>
|
||||
|
||||
<div v-if="toggleNode[mountidx]">
|
||||
<div>
|
||||
<div class="switch-wrapper">
|
||||
<CheckboxRadioSwitch
|
||||
:checked.sync="mount.isEncrypted" type="switch"
|
||||
@update:checked="toggleEncryption(mountidx)">
|
||||
Enable encryption
|
||||
:checked="telemetryEnabled"
|
||||
type="switch"
|
||||
:disabled="isSaving"
|
||||
@update:checked="toggleTelemetry">
|
||||
Enable Telemetry
|
||||
</CheckboxRadioSwitch>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
Available chequebook balance (bzz):
|
||||
<input type="text" :value="mount.chequebalance" maxlength="200" readonly />
|
||||
</div>
|
||||
<Button
|
||||
type="primary"
|
||||
:disabled="!hasChanges"
|
||||
:loading="isSaving"
|
||||
@click="saveSettings">
|
||||
{{ isSaving ? 'Saving...' : 'Save' }}
|
||||
</Button>
|
||||
|
||||
<div><u>Stamp batches:</u></div>
|
||||
<EmptyContent v-if="saveMessage" :title="saveMessage" :type="saveSuccess ? 'success' : 'error'" />
|
||||
</AppSettingsSection>
|
||||
<AppSettingsSection title="Service Status">
|
||||
<RichText>
|
||||
<strong>Check the Status of the HejBit Application and Bee Node Services</strong>
|
||||
<p>To ensure seamless access to your decentralized data, it is essential that at least one Bee node service is operational alongside the HejBit Application. Check out the status page for more information.</p>
|
||||
<p><a href="https://monitoring.metaprovide.org/status/hejbit" class="service-link" target="_blank" rel="noreferrer">HejBit Status</a></p>
|
||||
</RichText>
|
||||
|
||||
<div>
|
||||
<table id="externalStorage" class="grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Batch Id</th>
|
||||
<th>Bzz purchased</th>
|
||||
<th>Balance</th>
|
||||
<th>Usable</th>
|
||||
<th>Active</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="(
|
||||
batch, batchidx
|
||||
) in mount.batches"
|
||||
:key="batchidx">
|
||||
<td>
|
||||
<input
|
||||
type="text" name="batchid" :value="batch.batchID" maxlength="200"
|
||||
readonly />
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bzz" :value="batch.amount" maxlength="200" readonly />
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="text" name="balance" :value="batch.batchTTL" maxlength="200"
|
||||
readonly />
|
||||
</td>
|
||||
<td>
|
||||
<CheckboxRadioSwitch
|
||||
:checked.sync="batch.isUsable" :disabled="true"
|
||||
type="switch" name="toggleUsableBatchName">
|
||||
</CheckboxRadioSwitch>
|
||||
</td>
|
||||
<td>
|
||||
<CheckboxRadioSwitch
|
||||
:checked.sync="batch.isActive" type="switch"
|
||||
name="toggleActiveBatchName" @update:checked="
|
||||
toggleActiveBatch(
|
||||
mountidx,
|
||||
batchidx,
|
||||
batch.batchID
|
||||
)
|
||||
">
|
||||
</CheckboxRadioSwitch>
|
||||
</td>
|
||||
<td>
|
||||
<Actions>
|
||||
<ActionButton :disabled="true" icon="icon-add">Top up (Bzz)
|
||||
</ActionButton>
|
||||
<ActionInput
|
||||
type="number" :editable="true" :value="batch.topUpValue"
|
||||
@update:value="
|
||||
(x) =>
|
||||
handleTopUpChange(
|
||||
x,
|
||||
mountidx
|
||||
)
|
||||
" @submit="
|
||||
topupBatch(
|
||||
mountidx,
|
||||
batchidx,
|
||||
batch.batchID
|
||||
)
|
||||
">
|
||||
</ActionInput>
|
||||
<ActionSeparator title="" />
|
||||
</Actions>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<input
|
||||
type="submit" :value="
|
||||
saveSettingsValue[mountidx]
|
||||
" :disabled="
|
||||
saveSettingsBtn[mountidx]
|
||||
" @click="
|
||||
saveSettings(
|
||||
mountidx,
|
||||
$event
|
||||
)
|
||||
" /> {{
|
||||
saveSettingsLabel[mountidx]
|
||||
}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div name="sectionline"></div>
|
||||
|
||||
<div><u>Purchase new Stamp:</u></div>
|
||||
|
||||
<div>
|
||||
<form @submit.prevent>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Amount:</th>
|
||||
<th>Depth (17-255):</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<input
|
||||
v-model="
|
||||
newBatchAmounts[
|
||||
mountidx
|
||||
]
|
||||
" type="number" value="" maxlength="10" />
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
v-model="
|
||||
newBatchDepths[mountidx]
|
||||
" type="number" value="" maxlength="17" />
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
type="submit" :disabled="
|
||||
newBatchBtnDisabled[
|
||||
mountidx
|
||||
]
|
||||
" value="Buy" @click="
|
||||
buyPostage(
|
||||
mountidx,
|
||||
$event
|
||||
)
|
||||
" /> {{
|
||||
newBatchLabel[mountidx]
|
||||
}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div name="mainline"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AppContent>
|
||||
</AppSettingsSection>
|
||||
</SettingsSection>
|
||||
</AppContent>
|
||||
</Content>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable no-console */
|
||||
import AppContent from "@nextcloud/vue/dist/Components/AppContent";
|
||||
import Actions from "@nextcloud/vue/dist/Components/Actions";
|
||||
import ActionButton from "@nextcloud/vue/dist/Components/ActionButton";
|
||||
import CheckboxRadioSwitch from "@nextcloud/vue/dist/Components/CheckboxRadioSwitch";
|
||||
import ActionInput from "@nextcloud/vue/dist/Components/ActionInput";
|
||||
import ActionSeparator from "@nextcloud/vue/dist/Components/ActionSeparator";
|
||||
import axios from "axios";
|
||||
import { generateUrl } from "@nextcloud/router";
|
||||
import { Content, AppContent, AppContentHeader, HeaderDetails, AppSettingsSection, SettingsSection, CheckboxRadioSwitch, EmptyContent, RichText } from '@nextcloud/vue';
|
||||
|
||||
import axios from '@nextcloud/axios';
|
||||
import { generateUrl } from '@nextcloud/router';
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
name: 'App',
|
||||
components: {
|
||||
Content,
|
||||
AppContent,
|
||||
Actions,
|
||||
ActionButton,
|
||||
AppContentHeader,
|
||||
HeaderDetails,
|
||||
AppSettingsSection,
|
||||
SettingsSection,
|
||||
CheckboxRadioSwitch,
|
||||
ActionInput,
|
||||
ActionSeparator,
|
||||
EmptyContent,
|
||||
RichText,
|
||||
},
|
||||
props: {
|
||||
settings: {
|
||||
|
@ -242,353 +88,102 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
beeClient: null,
|
||||
accessKey: null,
|
||||
hasAccess: false,
|
||||
message: null,
|
||||
accessKeySubmitted: false,
|
||||
show: true,
|
||||
parsedMounts: [],
|
||||
newBatchAmounts: [],
|
||||
newBatchDepths: [],
|
||||
newBatchLabel: [],
|
||||
newBatchBtnDisabled: [],
|
||||
toggleNode: [],
|
||||
saveSettingsValue: [],
|
||||
saveSettingsBtn: [],
|
||||
saveSettingsLabel: [],
|
||||
debugConsole: true, // set true to write to console.log, false to disable console.log
|
||||
telemetryEnabled: false,
|
||||
originalTelemetryState: false,
|
||||
isSaving: false,
|
||||
saveMessage: '',
|
||||
saveSuccess: false
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
async mounted() {
|
||||
this.parsedMounts = JSON.parse(this.settings.mounts);
|
||||
this.parsedMounts = this.parsedMounts.map((mount) => ({
|
||||
...mount,
|
||||
isEncrypted: mount.encrypt === 1,
|
||||
batches: mount.batches.map((b) => ({ ...b, topUpValue: 0 })),
|
||||
}));
|
||||
|
||||
this.newBatchAmounts = Array(this.parsedMounts.length).fill("");
|
||||
this.newBatchDepths = Array(this.parsedMounts.length).fill("");
|
||||
this.newBatchLabel = Array(this.parsedMounts.length).fill("");
|
||||
this.newBatchBtnDisabled = Array(this.parsedMounts.length).fill(false);
|
||||
this.topUpValue = Array(this.parsedMounts.length).fill("");
|
||||
this.toggleNode = Array(this.parsedMounts.length).fill(false);
|
||||
this.saveSettingsValue = Array(this.parsedMounts.length).fill(
|
||||
"Save Settings"
|
||||
);
|
||||
this.saveSettingsBtn = Array(this.parsedMounts.length).fill(false);
|
||||
this.saveSettingsLabel = Array(this.parsedMounts.length).fill("");
|
||||
if (!this.debugConsole) {
|
||||
const methods = ["log", "debug", "warn", "info"];
|
||||
for (let i = 0; i < methods.length; i++) {
|
||||
console[methods[i]] = function () { };
|
||||
}
|
||||
}
|
||||
computed: {
|
||||
hasChanges() {
|
||||
return this.telemetryEnabled !== this.originalTelemetryState;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.telemetryEnabled = this.settings.telemetry_enabled || false;
|
||||
this.originalTelemetryState = this.telemetryEnabled;
|
||||
},
|
||||
methods: {
|
||||
async verifyAccessKey() {
|
||||
this.accessKeySubmitted = true;
|
||||
if (!this.accessKey) {
|
||||
this.message = 'Please enter an access key';
|
||||
return;
|
||||
}
|
||||
toggleTelemetry(value) {
|
||||
this.telemetryEnabled = value;
|
||||
},
|
||||
async saveSettings() {
|
||||
this.isSaving = true;
|
||||
this.saveMessage = '';
|
||||
|
||||
try {
|
||||
const response = await axios.post(generateUrl("/apps/files_external_ethswarm/bee/verifyBeeNodeAccess"), {access_key: this.accessKey});
|
||||
this.hasAccess = response.status === 200;
|
||||
await axios.post(generateUrl('/apps/files_external_ethswarm/settings'), {
|
||||
telemetry: this.telemetryEnabled
|
||||
});
|
||||
|
||||
if (this.hasAccess) {
|
||||
this.message = 'Access key verified successfully';
|
||||
} else {
|
||||
this.message = response.data.msg;
|
||||
}
|
||||
this.saveSuccess = true;
|
||||
OC.Notification.showTemporary(t('files_external_ethswarm', 'Settings saved'));
|
||||
this.originalTelemetryState = this.telemetryEnabled;
|
||||
} catch (error) {
|
||||
console.error('There was a problem with the request:', error);
|
||||
this.message = error.response.data.msg;
|
||||
console.error('Error saving settings:', error);
|
||||
this.saveSuccess = false;
|
||||
OC.Notification.showTemporary(t('files_external_ethswarm', 'Error saving settings'));
|
||||
} finally {
|
||||
this.isSaving = false;
|
||||
}
|
||||
},
|
||||
getRequestOptions(authUser, authPassword) {
|
||||
let requestOptions = null;
|
||||
if (authUser && authPassword) {
|
||||
requestOptions = {
|
||||
headers:
|
||||
"Authorization: Basic " +
|
||||
btoa(authUser + ":" + authPassword),
|
||||
};
|
||||
}
|
||||
return requestOptions;
|
||||
},
|
||||
showNode(mountIdx) {
|
||||
const newToggleNode = [...this.toggleNode];
|
||||
newToggleNode[mountIdx] = !newToggleNode[mountIdx];
|
||||
this.toggleNode = newToggleNode;
|
||||
},
|
||||
toggleEncryption(mountIdx) {
|
||||
this.parsedMounts[mountIdx].encrypt = this.parsedMounts[mountIdx]
|
||||
.isEncrypted
|
||||
? 1
|
||||
: 0;
|
||||
},
|
||||
toggleActiveBatch(mountIdx, batchIdx, activeBatchId) {
|
||||
this.parsedMounts[mountIdx].batchid = "";
|
||||
if (this.parsedMounts[mountIdx].batches[batchIdx].isActive) {
|
||||
this.parsedMounts[mountIdx].batchid = activeBatchId;
|
||||
}
|
||||
const tmpParsedMounts = [...this.parsedMounts];
|
||||
let bIdx = 0;
|
||||
for (const batch of tmpParsedMounts[mountIdx].batches) {
|
||||
if (batchIdx !== bIdx && batch.isActive) {
|
||||
batch.isActive = !batch.isActive;
|
||||
console.log(
|
||||
"Set batch.isActive 1 = " +
|
||||
batch.isActive +
|
||||
" (" +
|
||||
bIdx +
|
||||
")"
|
||||
);
|
||||
}
|
||||
bIdx++;
|
||||
}
|
||||
this.parsedMounts = tmpParsedMounts;
|
||||
},
|
||||
handleTopUpChange(x, mountIdx) {
|
||||
const newTopUp = [...this.topUpValue];
|
||||
newTopUp[mountIdx] = x;
|
||||
this.topUpValue = newTopUp;
|
||||
},
|
||||
/**
|
||||
* User input validation
|
||||
*
|
||||
* @param {bigint} amount amount to check
|
||||
* @param {number} depth depth to check (optional)
|
||||
* @return {boolean} true if input is valid.
|
||||
* Throws a string exception with an error message
|
||||
*/
|
||||
isInputValid(amount, depth) {
|
||||
if (amount <= 0) {
|
||||
throw t('files_external_ethswarm', 'Please enter an amount');
|
||||
} else if (depth !== undefined && (depth < 17 || depth > 255)) {
|
||||
throw t('files_external_ethswarm', 'Please enter a valid depth between 17 and 255');
|
||||
}
|
||||
return true;
|
||||
},
|
||||
async topupBatch(mountIdx, batchIdx, activeBatchId) {
|
||||
const url = generateUrl("/apps/files_external_ethswarm/bee/topUpBatch");
|
||||
const postageBatch = this.parsedMounts[mountIdx];
|
||||
postageBatch.activeBatchId = activeBatchId;
|
||||
postageBatch.topUpValue = Number(this.topUpValue[mountIdx]);
|
||||
console.log(
|
||||
"json=" +
|
||||
JSON.stringify(this.parsedMounts) +
|
||||
";postageBatch=" +
|
||||
JSON.stringify(postageBatch) +
|
||||
"batch,amount=" +
|
||||
activeBatchId +
|
||||
"," +
|
||||
postageBatch.topUpValue
|
||||
);
|
||||
|
||||
try {
|
||||
this.isInputValid(postageBatch.topUpValue);
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
return false;
|
||||
}
|
||||
await axios
|
||||
.post(url, {
|
||||
postageBatch: JSON.stringify(postageBatch),
|
||||
})
|
||||
.then((response) => {
|
||||
console.log("Success", response.data.batchID);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(
|
||||
"response err=" +
|
||||
error.response +
|
||||
";mesg=" +
|
||||
error.response.data.msg +
|
||||
"error.msg=" +
|
||||
error.message
|
||||
);
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
async buyPostage(mountidx, evt) {
|
||||
if (evt) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
const postageBatch = this.parsedMounts[mountidx];
|
||||
postageBatch.amount = Number(this.newBatchAmounts[mountidx]);
|
||||
postageBatch.depth = Number(this.newBatchDepths[mountidx]);
|
||||
|
||||
console.log(
|
||||
"amount,depth=" +
|
||||
postageBatch.amount +
|
||||
"," +
|
||||
postageBatch.depth
|
||||
);
|
||||
|
||||
let newBatchlabel = [...this.newBatchLabel];
|
||||
try {
|
||||
this.isInputValid(postageBatch.amount, postageBatch.depth);
|
||||
}
|
||||
catch (errorMessage) {
|
||||
newBatchlabel[mountidx] = errorMessage;
|
||||
this.newBatchLabel = newBatchlabel;
|
||||
return false;
|
||||
}
|
||||
newBatchlabel[mountidx] = "Status...";
|
||||
this.newBatchLabel = newBatchlabel;
|
||||
|
||||
this.newBatchBtnDisabled[mountidx] = true;
|
||||
|
||||
|
||||
newBatchlabel = [...this.newBatchLabel];
|
||||
const url = generateUrl("/apps/files_external_ethswarm/bee/createPostageBatch");
|
||||
|
||||
console.log(
|
||||
"json=" +
|
||||
JSON.stringify(this.parsedMounts) +
|
||||
";len=" +
|
||||
this.parsedMounts.length +
|
||||
";url=" +
|
||||
url +
|
||||
";newparse=" +
|
||||
JSON.stringify(postageBatch));
|
||||
|
||||
await axios
|
||||
.post(url, {
|
||||
postageBatch: JSON.stringify(postageBatch),
|
||||
})
|
||||
.then((response) => {
|
||||
const newBatchId = response.data.batchID;
|
||||
newBatchlabel[mountidx] = "Success: Created new batch " + newBatchId;
|
||||
|
||||
this.parsedMounts[mountidx].batches.push({
|
||||
batchID: newBatchId,
|
||||
amount: this.newBatchAmounts[mountidx],
|
||||
batchTTL: "",
|
||||
isActive: false,
|
||||
isDisabled: false,
|
||||
isUsable: false,
|
||||
});
|
||||
this.newBatchLabel = newBatchlabel;
|
||||
this.newBatchBtnDisabled[mountidx] = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(
|
||||
"response err=" +
|
||||
error.response +
|
||||
";mesg=" +
|
||||
error.response.data.msg +
|
||||
"error.msg=" +
|
||||
error.message
|
||||
);
|
||||
console.log(error);
|
||||
newBatchlabel[mountidx] = error.response.data.msg;;
|
||||
this.newBatchLabel = newBatchlabel;
|
||||
this.newBatchBtnDisabled[mountidx] = false;
|
||||
});
|
||||
},
|
||||
async saveSettings(mountidx, evt) {
|
||||
if (evt) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
this.setSaveBtnValue(mountidx, "Saving...");
|
||||
this.setSaveMessage(mountidx, "");
|
||||
this.saveSettingsBtn[mountidx] = true;
|
||||
|
||||
const url = generateUrl("/apps/files_external_ethswarm/save");
|
||||
const parsedMountsToSave = this.parsedMounts.map((mount) => ({
|
||||
mount_id: mount.mount_id,
|
||||
encrypt: mount.encrypt,
|
||||
batchid: mount.batchid,
|
||||
}));
|
||||
console.log(
|
||||
"json=" +
|
||||
JSON.stringify(this.parsedMounts) +
|
||||
";len=" +
|
||||
this.parsedMounts.length +
|
||||
";url=" +
|
||||
url +
|
||||
";newparse=" +
|
||||
JSON.stringify(parsedMountsToSave)
|
||||
);
|
||||
await axios
|
||||
.post(url, {
|
||||
storageconfig: JSON.stringify(parsedMountsToSave),
|
||||
swarm_access_key: this.swarm_access_key,
|
||||
})
|
||||
.then((response) => {
|
||||
this.setSaveMessage(mountidx, "Saved!");
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(
|
||||
"response err=" +
|
||||
error.response +
|
||||
";mesg=" +
|
||||
error.response.data.message +
|
||||
"error.msg=" +
|
||||
error.message
|
||||
);
|
||||
this.setSaveMessage(
|
||||
mountidx,
|
||||
"Failed to save: " +
|
||||
(error.response
|
||||
? error.response.data.message
|
||||
: error)
|
||||
);
|
||||
});
|
||||
|
||||
this.setSaveBtnValue(mountidx, "Save Settings");
|
||||
this.saveSettingsBtn[mountidx] = false;
|
||||
},
|
||||
setSaveMessage(mountidx, message) {
|
||||
// Set label
|
||||
const newSaveSettingsLabel = [...this.saveSettingsLabel];
|
||||
newSaveSettingsLabel[mountidx] = message;
|
||||
this.saveSettingsLabel = newSaveSettingsLabel;
|
||||
},
|
||||
setSaveBtnValue(mountidx, message) {
|
||||
// Set new button value
|
||||
const newsaveSettingsValue = [...this.saveSettingsValue];
|
||||
newsaveSettingsValue[mountidx] = message;
|
||||
this.saveSettingsValue = newsaveSettingsValue;
|
||||
},
|
||||
},
|
||||
};
|
||||
/* eslint-enable no-console */
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
input[type="text"][name="batchid"] {
|
||||
width: 450px;
|
||||
.header-details {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
width: 250px;
|
||||
.header-details h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
div[name="mainline"] {
|
||||
border-bottom: 2px solid #ccc !important;
|
||||
padding: 20px 20px 20px 20px;
|
||||
ul {
|
||||
list-style-type: disc;
|
||||
margin-left: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
div[name="sectionline"] {
|
||||
border-bottom: 1px solid #ccc !important;
|
||||
padding: 20px 20px 20px 20px;
|
||||
li {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
.hide {
|
||||
visibility: hidden !important;
|
||||
.switch-wrapper {
|
||||
margin: 24px 0;
|
||||
}
|
||||
|
||||
a {
|
||||
border: 0;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
button {
|
||||
margin: 24px 0;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 12px 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
strong {
|
||||
display: block;
|
||||
margin-bottom: 16px;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.service-link {
|
||||
display: inline-block;
|
||||
margin: 12px 0;
|
||||
padding: 8px 16px;
|
||||
background-color: var(--color-primary);
|
||||
color: var(--color-primary-text);
|
||||
border-radius: var(--border-radius);
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.service-link:hover {
|
||||
background-color: var(--color-primary-element-light);
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
<?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/>.
|
||||
*/
|
||||
style('files_external_ethswarm', 'settings-admin');
|
||||
script('files_external_ethswarm', 'settings');
|
||||
?>
|
||||
<div id="beeswarm" class="section">
|
||||
<h2 class="inlineblock"><?php p($l->t('External Storage: Swarm')); ?></h2>
|
||||
<a target="_blank" rel="noreferrer" class="icon-info" title="<?php p($l->t('Open documentation')); ?>" href="<?php p('https://github.com/MetaProvide/nextcloud-swarm-plugin/'); ?>"></a>
|
||||
<p class="settings-hint"><?php p($l->t('View the current status of the Swarm node(s) configured in \'External Storage\' section of NextCloud.')); ?></p>
|
||||
<?php
|
||||
// Get configured storage mounts from parameters
|
||||
$mounts = json_decode($_['mounts'], true);
|
||||
$mountIds = array_column($mounts, 'mount_id');
|
||||
// Make comma-seperated list of storageIds to use in hidden control in this form.
|
||||
$controlmountIds = implode(',', $mountIds);
|
||||
|
||||
foreach ($mounts as $mount) {
|
||||
$mountId = $mount['mount_id'];
|
||||
$mountName = $mount['mount_name'];
|
||||
$encrypted = $mount['encrypt'];
|
||||
$batchId = isset($mount['batchid']) ? $mount['batchid'] : '';
|
||||
$batchBalance = isset($mount['batchbalance']) ? $mount['batchbalance'] : '';
|
||||
$chequeBalance = isset($mount['chequebalance']) ? $mount['chequebalance'] : '';
|
||||
?>
|
||||
<div>
|
||||
<label>
|
||||
<h3><b><span id="<?php p($mountId); ?>"><?php p($l->t('Swarm node')); ?></b>: <?php p($mountName); ?></span></h3>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<span class="label"><?php p($l->t('Allow encryption')); ?></span>
|
||||
<?php
|
||||
if ($encrypted) {
|
||||
$checked = 'checked';
|
||||
}?>
|
||||
<span><input id="beeswarm_encrypt_<?php p($mountId); ?>" type="checkbox" <?php p($checked); ?>/></span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<span class="label"><?php p($l->t('Current Batch Id')); ?></span>
|
||||
<span><input id="beeswarm_batchid_<?php p($mountId); ?>" type="text" maxlength="200" class="inputBatch" value="<?php p($batchId); ?>" /></span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<span class="label"><?php p($l->t('Batch TTL')); ?></span>
|
||||
<span><input id="beeswarm-bzz_<?php p($mountId); ?>" type="text" placeholder="<?php p($l->t('Batch TTL')); ?>" value="<?php p($batchBalance); ?>" maxlength="20" readonly/><span>
|
||||
<span data-setting="bzz" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<span class="label"><?php p($l->t('Chequebook Balance')); ?></span>
|
||||
<input id="beeswarm-chequebalance_<?php p($mountId); ?>" type="text" maxlength="20" value="<?php p($chequeBalance); ?>" readonly/>
|
||||
<div data-setting="chequebalance_" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
|
||||
</label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<input id="mountsIds" type="hidden" value='<?php p($controlmountIds); ?>'>
|
||||
|
||||
<button id="beeswarm-save-settings"><?php p($l->t('Save')); ?></button>
|
||||
</div>
|
143
tests/Unit/SentryTest.php
Normal file
143
tests/Unit/SentryTest.php
Normal file
|
@ -0,0 +1,143 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\Files_External_Ethswarm\Tests\Unit;
|
||||
|
||||
use OCA\Files_External_Ethswarm\AppInfo\AppConstants;
|
||||
use OCA\Files_External_Ethswarm\AppInfo\Application;
|
||||
use OCA\Files_External_Ethswarm\Exception\BaseException;
|
||||
use OCP\IConfig;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Sentry\ClientBuilder;
|
||||
use Sentry\State\Hub;
|
||||
use Sentry\State\HubInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
class SentryTest extends TestCase {
|
||||
private IConfig $config;
|
||||
private Application $application;
|
||||
|
||||
/** @var ContainerInterface&MockObject */
|
||||
private $serverContainer;
|
||||
private HubInterface $hub;
|
||||
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
// Mock the config
|
||||
$this->config = $this->createMock(IConfig::class);
|
||||
// @var ContainerInterface&\PHPUnit\Framework\MockObject\MockObject
|
||||
$this->serverContainer = $this->createMock(ContainerInterface::class);
|
||||
|
||||
// Set up container to return our mocked config
|
||||
$this->serverContainer->method('get')
|
||||
->with(IConfig::class)
|
||||
->willReturn($this->config)
|
||||
;
|
||||
|
||||
$this->hub = new Hub();
|
||||
|
||||
// Set up the exception handling
|
||||
BaseException::setContainer($this->serverContainer);
|
||||
BaseException::setHub($this->hub);
|
||||
|
||||
// Create application with mocked container
|
||||
$this->application = $this->getMockBuilder(Application::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock()
|
||||
;
|
||||
}
|
||||
|
||||
protected function tearDown(): void {
|
||||
BaseException::setContainer(null);
|
||||
BaseException::setHub(null);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testSentryInitializationWhenEnabled() {
|
||||
// Configure mock
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['environment', 'production', 'testing'],
|
||||
['telemetry.enabled', false, true],
|
||||
])
|
||||
;
|
||||
|
||||
// Initialize Sentry
|
||||
$client = ClientBuilder::create([
|
||||
'dsn' => AppConstants::TELEMETRY_URL,
|
||||
'traces_sample_rate' => 1.0,
|
||||
'environment' => 'testing',
|
||||
])->getClient();
|
||||
|
||||
$this->hub->bindClient($client);
|
||||
|
||||
// Verify Sentry was initialized
|
||||
$this->assertNotNull($this->hub->getClient());
|
||||
}
|
||||
|
||||
public function testSentryInitializationWhenDisabled() {
|
||||
// Configure mock
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['environment', 'production', 'testing'],
|
||||
['telemetry.enabled', false, false],
|
||||
])
|
||||
;
|
||||
|
||||
// Initialize Sentry (should not happen when disabled)
|
||||
$client = null;
|
||||
if ($this->config->getSystemValue('telemetry.enabled', false)) {
|
||||
$client = ClientBuilder::create([
|
||||
'dsn' => AppConstants::TELEMETRY_URL,
|
||||
'traces_sample_rate' => 1.0,
|
||||
'environment' => 'testing',
|
||||
])->getClient();
|
||||
|
||||
$this->hub->bindClient($client);
|
||||
}
|
||||
|
||||
// Verify Sentry was not initialized
|
||||
$this->assertNull($client);
|
||||
$this->assertNull($this->hub->getClient());
|
||||
}
|
||||
|
||||
public function testBaseExceptionSentryCapture() {
|
||||
// Configure mock
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['telemetry.enabled', false, true],
|
||||
])
|
||||
;
|
||||
|
||||
// Create a test exception
|
||||
$testMessage = 'Test Exception';
|
||||
$exception = new BaseException($testMessage);
|
||||
|
||||
// Verify exception properties
|
||||
$this->assertEquals($testMessage, $exception->getMessage());
|
||||
$this->assertEquals(0, $exception->getCode());
|
||||
}
|
||||
|
||||
public function testBaseExceptionWithoutSentry() {
|
||||
// Configure mock
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['telemetry.enabled', false, false],
|
||||
])
|
||||
;
|
||||
|
||||
// Create a test exception
|
||||
$testMessage = 'Test Exception';
|
||||
$exception = new BaseException($testMessage);
|
||||
|
||||
// Verify exception properties
|
||||
$this->assertEquals($testMessage, $exception->getMessage());
|
||||
$this->assertEquals(0, $exception->getCode());
|
||||
}
|
||||
}
|
26
tests/bootstrap.php
Normal file
26
tests/bootstrap.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
// Define PHPUNIT_RUN or any test-specific constants if required.
|
||||
if (!defined('PHPUNIT_RUN')) {
|
||||
define('PHPUNIT_RUN', 1);
|
||||
}
|
||||
|
||||
// Define the root directory for Nextcloud server
|
||||
define('OC_SERVERROOT', __DIR__.'/../dev-environment/nextcloud_source');
|
||||
|
||||
// Load Composer's autoloader.
|
||||
// If your plugin does not depend on legacy OC classes, you may not need to load lib/base.php.
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
// (Optional) If your test really needs parts of the core bootstrapping,
|
||||
// you could include lib/base.php. However, when using OCP and dependency injection,
|
||||
// this is usually not needed.
|
||||
require_once OC_SERVERROOT.'/lib/base.php';
|
||||
|
||||
// Fix for "Autoload path not allowed: .../tests/lib/testcase.php"
|
||||
OC::$loader->addValidRoot(OC_SERVERROOT.'/tests');
|
||||
|
||||
// Fix for "Autoload path not allowed: .../files_external_ethswarm/tests/testcase.php"
|
||||
OC_App::loadApp('files_external_ethswarm');
|
||||
|
||||
OC_Hook::clear();
|
20
tests/phpunit.xml
Normal file
20
tests/phpunit.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
|
||||
bootstrap="bootstrap.php"
|
||||
colors="true"
|
||||
verbose="true">
|
||||
<testsuites>
|
||||
<testsuite name="Files External Ethswarm Test Suite">
|
||||
<directory>./Unit</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<coverage>
|
||||
<include>
|
||||
<directory suffix=".php">../lib</directory>
|
||||
</include>
|
||||
<exclude>
|
||||
<directory suffix=".php">../lib/Migration</directory>
|
||||
</exclude>
|
||||
</coverage>
|
||||
</phpunit>
|
1
vendor-bin/.gitignore
vendored
Normal file
1
vendor-bin/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
**/vendor
|
5
vendor-bin/sentry/composer.json
Normal file
5
vendor-bin/sentry/composer.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"require": {
|
||||
"sentry/sentry": "^4.10"
|
||||
}
|
||||
}
|
619
vendor-bin/sentry/composer.lock
generated
Normal file
619
vendor-bin/sentry/composer.lock
generated
Normal file
|
@ -0,0 +1,619 @@
|
|||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "3291712ba952c517958e500df5811754",
|
||||
"packages": [
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
"version": "2.7.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
|
||||
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"psr/http-factory": "^1.0",
|
||||
"psr/http-message": "^1.1 || ^2.0",
|
||||
"ralouphie/getallheaders": "^3.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/http-factory-implementation": "1.0",
|
||||
"psr/http-message-implementation": "1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
"http-interop/http-factory-tests": "0.9.0",
|
||||
"phpunit/phpunit": "^8.5.39 || ^9.6.20"
|
||||
},
|
||||
"suggest": {
|
||||
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"GuzzleHttp\\Psr7\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
},
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
},
|
||||
{
|
||||
"name": "George Mponos",
|
||||
"email": "gmponos@gmail.com",
|
||||
"homepage": "https://github.com/gmponos"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Nyholm",
|
||||
"email": "tobias.nyholm@gmail.com",
|
||||
"homepage": "https://github.com/Nyholm"
|
||||
},
|
||||
{
|
||||
"name": "Márk Sági-Kazár",
|
||||
"email": "mark.sagikazar@gmail.com",
|
||||
"homepage": "https://github.com/sagikazarmark"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Schultze",
|
||||
"email": "webmaster@tubo-world.de",
|
||||
"homepage": "https://github.com/Tobion"
|
||||
},
|
||||
{
|
||||
"name": "Márk Sági-Kazár",
|
||||
"email": "mark.sagikazar@gmail.com",
|
||||
"homepage": "https://sagikazarmark.hu"
|
||||
}
|
||||
],
|
||||
"description": "PSR-7 message implementation that also provides common utility methods",
|
||||
"keywords": [
|
||||
"http",
|
||||
"message",
|
||||
"psr-7",
|
||||
"request",
|
||||
"response",
|
||||
"stream",
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/psr7/issues",
|
||||
"source": "https://github.com/guzzle/psr7/tree/2.7.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/Nyholm",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-18T11:15:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jean85/pretty-package-versions",
|
||||
"version": "2.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Jean85/pretty-package-versions.git",
|
||||
"reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/3c4e5f62ba8d7de1734312e4fff32f67a8daaf10",
|
||||
"reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer-runtime-api": "^2.1.0",
|
||||
"php": "^7.4|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^3.2",
|
||||
"jean85/composer-provided-replaced-stub-package": "^1.0",
|
||||
"phpstan/phpstan": "^1.4",
|
||||
"phpunit/phpunit": "^7.5|^8.5|^9.6",
|
||||
"vimeo/psalm": "^4.3 || ^5.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Jean85\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Alessandro Lai",
|
||||
"email": "alessandro.lai85@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "A library to get pretty versions strings of installed dependencies",
|
||||
"keywords": [
|
||||
"composer",
|
||||
"package",
|
||||
"release",
|
||||
"versions"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/Jean85/pretty-package-versions/issues",
|
||||
"source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.0"
|
||||
},
|
||||
"time": "2024-11-18T16:19:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-factory",
|
||||
"version": "1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-factory.git",
|
||||
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
|
||||
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"psr/http-message": "^1.0 || ^2.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Http\\Message\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
|
||||
"keywords": [
|
||||
"factory",
|
||||
"http",
|
||||
"message",
|
||||
"psr",
|
||||
"psr-17",
|
||||
"psr-7",
|
||||
"request",
|
||||
"response"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-factory"
|
||||
},
|
||||
"time": "2024-04-15T12:06:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-message",
|
||||
"version": "2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-message.git",
|
||||
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Http\\Message\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for HTTP messages",
|
||||
"homepage": "https://github.com/php-fig/http-message",
|
||||
"keywords": [
|
||||
"http",
|
||||
"http-message",
|
||||
"psr",
|
||||
"psr-7",
|
||||
"request",
|
||||
"response"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-message/tree/2.0"
|
||||
},
|
||||
"time": "2023-04-04T09:54:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "3.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
|
||||
"reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.0.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Log\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for logging libraries",
|
||||
"homepage": "https://github.com/php-fig/log",
|
||||
"keywords": [
|
||||
"log",
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/log/tree/3.0.2"
|
||||
},
|
||||
"time": "2024-09-11T13:17:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "ralouphie/getallheaders",
|
||||
"version": "3.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ralouphie/getallheaders.git",
|
||||
"reference": "120b605dfeb996808c31b6477290a714d356e822"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
|
||||
"reference": "120b605dfeb996808c31b6477290a714d356e822",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"php-coveralls/php-coveralls": "^2.1",
|
||||
"phpunit/phpunit": "^5 || ^6.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/getallheaders.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ralph Khattar",
|
||||
"email": "ralph.khattar@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "A polyfill for getallheaders.",
|
||||
"support": {
|
||||
"issues": "https://github.com/ralouphie/getallheaders/issues",
|
||||
"source": "https://github.com/ralouphie/getallheaders/tree/develop"
|
||||
},
|
||||
"time": "2019-03-08T08:55:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sentry/sentry",
|
||||
"version": "4.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/getsentry/sentry-php.git",
|
||||
"reference": "2af937d47d8aadb8dab0b1d7b9557e495dd12856"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/2af937d47d8aadb8dab0b1d7b9557e495dd12856",
|
||||
"reference": "2af937d47d8aadb8dab0b1d7b9557e495dd12856",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"guzzlehttp/psr7": "^1.8.4|^2.1.1",
|
||||
"jean85/pretty-package-versions": "^1.5|^2.0.4",
|
||||
"php": "^7.2|^8.0",
|
||||
"psr/log": "^1.0|^2.0|^3.0",
|
||||
"symfony/options-resolver": "^4.4.30|^5.0.11|^6.0|^7.0"
|
||||
},
|
||||
"conflict": {
|
||||
"raven/raven": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^3.4",
|
||||
"guzzlehttp/promises": "^2.0.3",
|
||||
"guzzlehttp/psr7": "^1.8.4|^2.1.1",
|
||||
"monolog/monolog": "^1.6|^2.0|^3.0",
|
||||
"phpbench/phpbench": "^1.0",
|
||||
"phpstan/phpstan": "^1.3",
|
||||
"phpunit/phpunit": "^8.5|^9.6",
|
||||
"symfony/phpunit-bridge": "^5.2|^6.0|^7.0",
|
||||
"vimeo/psalm": "^4.17"
|
||||
},
|
||||
"suggest": {
|
||||
"monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Sentry\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sentry",
|
||||
"email": "accounts@sentry.io"
|
||||
}
|
||||
],
|
||||
"description": "PHP SDK for Sentry (http://sentry.io)",
|
||||
"homepage": "http://sentry.io",
|
||||
"keywords": [
|
||||
"crash-reporting",
|
||||
"crash-reports",
|
||||
"error-handler",
|
||||
"error-monitoring",
|
||||
"log",
|
||||
"logging",
|
||||
"profiling",
|
||||
"sentry",
|
||||
"tracing"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/getsentry/sentry-php/issues",
|
||||
"source": "https://github.com/getsentry/sentry-php/tree/4.10.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://sentry.io/",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://sentry.io/pricing/",
|
||||
"type": "custom"
|
||||
}
|
||||
],
|
||||
"time": "2024-11-06T07:44:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
"version": "v3.5.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||
"reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
|
||||
"reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/contracts",
|
||||
"name": "symfony/contracts"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-main": "3.5-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"function.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-25T14:20:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/options-resolver",
|
||||
"version": "v7.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/options-resolver.git",
|
||||
"reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50",
|
||||
"reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"symfony/deprecation-contracts": "^2.5|^3"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\OptionsResolver\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Provides an improved replacement for the array_replace PHP function",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"config",
|
||||
"configuration",
|
||||
"options"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/options-resolver/tree/v7.2.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-11-20T11:17:29+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
Loading…
Reference in a new issue