This one can be committed now to apps repo given that other patches this one depends on have been committed already.
Waldek On Tuesday, August 22, 2017 at 12:36:33 PM UTC-4, Waldek Kozaczuk wrote: > > This new HTML5 app is implemented in Typescript and served by OSv > httpserver > same way as OSv gui. It provides command line terminal functionality in > your favorite > webbrowser and the supported set of commands is identical to the one > supported by > OSv cli module. The app depends on httpserver-cli OSv module and external > project > https://github.com/wkozaczuk/osv-html5-terminal.git. > > You can build and run it a standalone: > ./scripts/build image=httpserver-html5-cli.fg > > Or add it to you favorite app: > ./scripts/build image=elasticsearch,httpserver-html5-cli > > You can open it in a browser by typing this URL: > http://localhost:8000/cli/ > > Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com> > --- > httpserver-html5-cli/.gitignore | 1 + > httpserver-html5-cli/Makefile | 23 +++++++++++++++++++++++ > httpserver-html5-cli/httpserver.conf | 20 ++++++++++++++++++++ > httpserver-html5-cli/module.py | 24 ++++++++++++++++++++++++ > 4 files changed, 68 insertions(+) > create mode 100644 httpserver-html5-cli/.gitignore > create mode 100644 httpserver-html5-cli/Makefile > create mode 100644 httpserver-html5-cli/httpserver.conf > create mode 100644 httpserver-html5-cli/module.py > > diff --git a/httpserver-html5-cli/.gitignore > b/httpserver-html5-cli/.gitignore > new file mode 100644 > index 0000000..27db1c8 > --- /dev/null > +++ b/httpserver-html5-cli/.gitignore > @@ -0,0 +1 @@ > +osv-html5-terminal > diff --git a/httpserver-html5-cli/Makefile b/httpserver-html5-cli/Makefile > new file mode 100644 > index 0000000..cadf793 > --- /dev/null > +++ b/httpserver-html5-cli/Makefile > @@ -0,0 +1,23 @@ > +src = $(shell readlink -f ../..) > +app-dir = $(src)/apps/httpserver-html5-cli > + > +all: module > +module: html5-cli > + > +html5-cli: osv-html5-terminal/.git > + cd $(app-dir) && \ > + (command -v node > /dev/null 2>&1 || (echo "Node not installed. > Install node (https://nodejs.org/en/download/package-manager/) and try > again" && exit 1)) && \ > + cd osv-html5-terminal && \ > + npm install && \ > + node_modules/grunt-cli/bin/grunt > + > +.PHONY: html5-cli > + > +osv-html5-terminal/.git: > + cd $(app-dir) && \ > + git clone --depth 1 > https://github.com/wkozaczuk/osv-html5-terminal.git > + > +clean: > + cd $(app-dir) && rm -rf osv-html5-terminal > + > +.SECONDARY: > diff --git a/httpserver-html5-cli/httpserver.conf > b/httpserver-html5-cli/httpserver.conf > new file mode 100644 > index 0000000..47a57b4 > --- /dev/null > +++ b/httpserver-html5-cli/httpserver.conf > @@ -0,0 +1,20 @@ > +{ > + "port": "8000", > + "redirects": [ > + { > + "path": "/", > + "target_path": "/cli/" > + } > + ], > + "file_mappings": [ > + { > + "path": "/cli", > + "file": "/usr/mgmt/cli/index.html", > + "exact_match": true > + }, > + { > + "path": "/cli", > + "directory": "/usr/mgmt/cli" > + } > + ] > +} > diff --git a/httpserver-html5-cli/module.py > b/httpserver-html5-cli/module.py > new file mode 100644 > index 0000000..cb56c6a > --- /dev/null > +++ b/httpserver-html5-cli/module.py > @@ -0,0 +1,24 @@ > +import os > +from osv.modules.api import * > +from osv.modules.filemap import FileMap > +from osv.modules import api > + > +_app = '${OSV_BASE}/apps/httpserver-html5-cli' > + > +usr_files = FileMap() > +usr_files.add(os.path.join(_app, > 'osv-html5-terminal/dist')).to('/usr/mgmt/cli') > +usr_files.add(os.path.join(_app, > 'httpserver.conf')).to('/tmp/httpserver.conf') > + > +api.require('httpserver-api') > + > +# httpserver will run regardless of an explicit command line > +# passed with "run.py -e". > +_exe = '/libhttpserver.so' > +daemon = api.run_on_init(_exe + ' &!') > + > +fg = api.run(_exe) > + > +fg_ssl = api.run(_exe + ' --ssl') > +fg_cors = api.run(_exe + ' --access-allow=true') > + > +default = daemon > -- > 2.7.4 > > -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.