Compare commits
39 Commits
Author | SHA1 | Date |
---|---|---|
adphi | abdf1777f5 | |
adphi | 317c2483d4 | |
adphi | d0c4cd1488 | |
adphi | 5a5ba37b69 | |
Adphi | 4fecde9d9d | |
Adphi | 411e9e800f | |
Adphi | 6579503c63 | |
Adphi | ad5306cf67 | |
Adphi | f2d7ff4c14 | |
Adphi | aa2848cfee | |
Adphi | e5d211826f | |
Adphi | 222e9d5956 | |
Adphi | 93e4701a82 | |
Adphi | 5e7ddb1578 | |
Adphi | e03bd71092 | |
Adphi | 2447aea115 | |
Adphi | b4761ebb4f | |
Adphi | a9019903cf | |
Adphi | 608b0e2462 | |
Adphi | e725fd3ed7 | |
Adphi | 4dbbcce938 | |
Adphi | 16de1641ea | |
Adphi | 77b1f007cf | |
Adphi | 9ade0837b0 | |
Adphi | cee4b7a7e1 | |
Adphi | 42ccc2e7e5 | |
Adphi | 1831886e20 | |
Adphi | a79cc12161 | |
Adphi | 8c4d675e1f | |
Adphi | 1745aa185a | |
Adphi | a1efcf2096 | |
Adphi | d077d211c8 | |
Adphi | 96dfe2ebdb | |
Adphi | e5a9f0142f | |
Adphi | 4fc2359fdc | |
Adphi | 83ed35c4c5 | |
Adphi | 0d59a3595e | |
Adphi | 395cbee8cc | |
Adphi | 2325df3667 |
|
@ -0,0 +1,2 @@
|
|||
.idea
|
||||
build
|
20
Makefile
20
Makefile
|
@ -115,20 +115,21 @@ dist:
|
|||
source:
|
||||
rm -rf $(source_build_directory)
|
||||
mkdir -p $(source_build_directory)
|
||||
tar cvzf $(source_package_name).tar.gz ../$(app_name) \
|
||||
tar \
|
||||
--exclude-vcs \
|
||||
--exclude="../$(app_name)/build" \
|
||||
--exclude="../$(app_name)/js/node_modules" \
|
||||
--exclude="../$(app_name)/node_modules" \
|
||||
--exclude="../$(app_name)/*.log" \
|
||||
--exclude="../$(app_name)/js/*.log" \
|
||||
-cvzf $(source_package_name).tar.gz ../$(app_name)
|
||||
|
||||
# Builds the source package for the app store, ignores php and js tests
|
||||
.PHONY: appstore
|
||||
appstore:
|
||||
rm -rf $(appstore_build_directory)
|
||||
mkdir -p $(appstore_build_directory)
|
||||
tar cvzf $(appstore_package_name).tar.gz ../$(app_name) \
|
||||
tar \
|
||||
--exclude-vcs \
|
||||
--exclude="../$(app_name)/build" \
|
||||
--exclude="../$(app_name)/tests" \
|
||||
|
@ -150,8 +151,23 @@ appstore:
|
|||
--exclude="../$(app_name)/protractor\.*" \
|
||||
--exclude="../$(app_name)/.*" \
|
||||
--exclude="../$(app_name)/js/.*" \
|
||||
-cvzf $(appstore_package_name).tar.gz ../$(app_name)
|
||||
|
||||
.PHONY: test
|
||||
test: composer
|
||||
$(CURDIR)/vendor/phpunit/phpunit/phpunit -c phpunit.xml
|
||||
$(CURDIR)/vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml
|
||||
|
||||
.PHONY: sign
|
||||
sign:
|
||||
@openssl dgst -sha512 -sign ~/.nextcloud/certificates/occweb.key build/artifacts/appstore/occweb.tar.gz |openssl base64
|
||||
|
||||
.PHONY: version
|
||||
version:
|
||||
@echo "Creating version v$(VERSION)"
|
||||
@sed -i "s/<version>[0-9a-z.]\{1,\}<\/version>/<version>$(VERSION)<\/version>/g" appinfo/info.xml
|
||||
@git tag v$(VERSION)
|
||||
@git push origin v$(VERSION)
|
||||
@make dist
|
||||
@echo "\nRelease Signature: \n"
|
||||
@make sign
|
||||
|
|
76
README.md
76
README.md
|
@ -1,73 +1,25 @@
|
|||
# OCCWeb terminal
|
||||
# ⚠️ Deprecated ⚠️ OCCWeb terminal
|
||||
|
||||
### A web terminal for admins to launch Nextcloud's occ commands
|
||||
|
||||
![occweb](https://git.adphi.net/Adphi/OCCWeb/raw/master/appinfo/screenshot.png)
|
||||
|
||||
|
||||
##
|
||||
## ⚠️ Deprecated ⚠️
|
||||
As nextcloudd has no native support for asynchronous operations, due to the use of php, this aplication is deprecated, and will no longer support the Nextcloud' future versions (19+). I did not find a way to implemement true support for interactive and long running occ tasks in a web terminal whitout introducing addtional dependencies (through websockets, for example), the lack of true asynchronous occ operations can lead to serious alterations of voluminous instances.
|
||||
[This issue](https://github.com/nextcloud/server/issues/16726) may give some hints on why I decided to not support this application anymore.
|
||||
|
||||
And over all of this , I want to say I really dislike, even dispise the overall Nextloud teams communication, the "we are the best", and other "look, we make so many commits", witout fixing good old issues, moving fast forward, "we make more commits than pydio"! what a good point ! your more than 10x their developpers ! What a 'prouesse' !!!
|
||||
|
||||
## Install
|
||||
|
||||
Place this app in **nextcloud/apps/**
|
||||
|
||||
## Building the app
|
||||
## ⚠️ Warnings ⚠️
|
||||
|
||||
The app can be built by using the provided Makefile by running:
|
||||
- The application is not a real interactive terminal and does not support long running tasks.
|
||||
So if your instance is pretty big, commands like `occ files:scan` will time out and fail.
|
||||
- Do not use `occ maintenance:mode --on`, obvious...
|
||||
|
||||
make
|
||||
|
||||
This requires the following things to be present:
|
||||
* make
|
||||
* which
|
||||
* tar: for building the archive
|
||||
* curl: used if phpunit and composer are not installed to fetch them
|
||||
from the web
|
||||
* npm: for building and testing everything JS, only required if a
|
||||
package.json is placed inside the **js/** folder
|
||||
|
||||
The make command will install or update Composer dependencies if a
|
||||
composer.json is present and also **npm run build** if a package.json
|
||||
is present in the **js/** folder. The npm **build** script should use
|
||||
local paths for build systems and package managers, so people that
|
||||
simply want to build the app won't need to install npm libraries
|
||||
globally, e.g.:
|
||||
|
||||
**package.json**:
|
||||
```json
|
||||
"scripts": {
|
||||
"test": "node node_modules/gulp-cli/bin/gulp.js karma",
|
||||
"prebuild": "npm install && node_modules/bower/bin/bower install &&
|
||||
node_modules/bower/bin/bower update",
|
||||
"build": "node node_modules/gulp-cli/bin/gulp.js"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Publish to App Store
|
||||
|
||||
First get an account for the [App Store](http://apps.nextcloud.com/)
|
||||
then run:
|
||||
|
||||
make && make appstore
|
||||
|
||||
The archive is located in build/artifacts/appstore and can then be
|
||||
uploaded to the App Store.
|
||||
|
||||
## Running tests
|
||||
You can use the provided Makefile to run all tests by using:
|
||||
|
||||
make test
|
||||
|
||||
This will run the PHP unit and integration tests and if a package.json
|
||||
is present in the **js/** folder will execute **npm run test**
|
||||
|
||||
Of course you can also install
|
||||
[PHPUnit](http://phpunit.de/getting-started.html) and use the
|
||||
configurations directly:
|
||||
|
||||
phpunit -c phpunit.xml
|
||||
|
||||
or:
|
||||
|
||||
phpunit -c phpunit.integration.xml
|
||||
|
||||
for integration tests
|
||||
## TODOs:
|
||||
See [open issues](https://git.adphi.net/Adphi/OCCWeb/issues)
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
<name>OCC Web</name>
|
||||
<summary>OCC Commands in a web terminal</summary>
|
||||
<description><![CDATA[Run OCC Commands in a web terminal]]></description>
|
||||
<version>0.0.6</version>
|
||||
<version>0.0.7</version>
|
||||
<licence>agpl</licence>
|
||||
<author mail="adphi.apps@gmail.com" >Adphi</author>
|
||||
<namespace>OCCWeb</namespace>
|
||||
<category>tools</category>
|
||||
<website>https://git.adphi.net/Adphi/OCCWeb</website>
|
||||
<bugs>https://git.adphi.net/Adphi/OCCWeb/issues</bugs>
|
||||
<repository>https://git.adphi.net/Adphi/OCCWeb</repository>
|
||||
<screenshot>https://git.adphi.net/Adphi/OCCWeb/raw/master/appinfo/screenshot.png</screenshot>
|
||||
<website>https://git.adphi.net/adphi/occweb</website>
|
||||
<bugs>https://git.adphi.net/adphi/occweb/issues</bugs>
|
||||
<repository>https://git.adphi.net/adphi/occweb</repository>
|
||||
<screenshot>https://git.adphi.net/adphi/occweb/raw/master/appinfo/screenshot.png</screenshot>
|
||||
<dependencies>
|
||||
<nextcloud min-version="13" max-version="18"/>
|
||||
</dependencies>
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -58,9 +58,8 @@ class OccController extends Controller
|
|||
$this->application->run($input, $this->output);
|
||||
return $this->output->fetch();
|
||||
} catch (Exception $ex) {
|
||||
exceptionHandler($ex);
|
||||
} catch (Error $ex) {
|
||||
exceptionHandler($ex);
|
||||
$this->logger->logException($ex);
|
||||
return "error: " . $ex->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,9 +86,3 @@ class OccController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
function exceptionHandler($exception)
|
||||
{
|
||||
echo "An unhandled exception has been thrown:" . PHP_EOL;
|
||||
echo $exception;
|
||||
exit(1);
|
||||
}
|
|
@ -8,12 +8,12 @@ use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
|||
use Symfony\Component\Console\Output\ConsoleSectionOutput;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
* @method ConsoleSectionOutput section()
|
||||
*/
|
||||
|
||||
class OccOutput extends BufferedOutput implements ConsoleOutputInterface
|
||||
{
|
||||
private $consoleSectionOutputs = [];
|
||||
|
||||
private $stream;
|
||||
/**
|
||||
* Gets the OutputInterface for errors.
|
||||
*
|
||||
|
@ -30,7 +30,14 @@ class OccOutput extends BufferedOutput implements ConsoleOutputInterface
|
|||
|
||||
}
|
||||
|
||||
public function __call($name, $arguments) {
|
||||
// TODO: Implement @method ConsoleSectionOutput section()
|
||||
/**
|
||||
* Creates a new output section.
|
||||
*/
|
||||
public function section(): ConsoleSectionOutput {
|
||||
if ($this->stream === null) {
|
||||
$this->stream = fopen('php://temp','w');
|
||||
}
|
||||
return new ConsoleSectionOutput($this->stream, $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue