diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE new file mode 100644 index 0000000000..ed551bc0d8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE @@ -0,0 +1,12 @@ +## Expected behaviour + + +## Actual behaviour + + +## Steps to reproduce the error + + +## (Optinal) Browser and OS information + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..1026aaf13a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ +Proposed changes in this pull-request: + +- +- +- + +--- + +*Please make sure that you read the guidelines and test your code before submission, or else your request might be rejected* diff --git a/.gitignore b/.gitignore index 44fe08df27..b7c778f7ca 100644 --- a/.gitignore +++ b/.gitignore @@ -8,39 +8,27 @@ twistd.* .vagrant/* *.pyc +# Misc .nightly .standalone .debian .nw +# Storage vfs/*/* +# Config files src/conf/999-* src/conf/900-custom.json src/server/settings.json src/server/packages.json src/installer/installer.exe -dist/test* -dist/settings.js -dist/locales.js -dist/osjs.js -dist/osjs.css -dist/packages.json -dist/packages.js -dist/themes.json -dist/themes -dist/packages -dist/dialogs.html -dist/schemes.js - -dist-dev/test.* -dist-dev/locales.js -dist-dev/settings.js -dist-dev/packages.json -dist-dev/packages.js -dist-dev/themes.json +# Builds +dist/* +dist-dev/* +# Vendor vendor/dropbox* vendor/zip.js vendor/html2canvas diff --git a/.travis.yml b/.travis.yml index 75ba945d8f..ed1a52c1c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,6 @@ branches: before_script: - npm install mocha -g - npm install grunt-cli -g - - grunt config manifest + - grunt config manifest dist-files after_success: - grunt all diff --git a/AUTHORS b/AUTHORS index dfa2fbf6c9..4de826982d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,4 +9,3 @@ I'm using the following resources from outside sources: * Gnome - Icon theme * Freedesktop - Sound theme * Jonathan Pinhorn - 'Karla' fonts -* William Warby - 'Desert Road' Wallpaper diff --git a/CHANGELOG.md b/CHANGELOG.md index fbcbb9724c..fa9c79bff4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,248 @@ -# 2.0.0 +# 2.0.0-alpha74 + +New wallpaper, UI improvements, bugfixes and many improvements to the build system(s). Also new developer features! + +**API CHANGE**: http://community.os.js.org/t/notice-updated-gui-methods/33 + +**API CHANGE**: http://community.os.js.org/t/notice-recent-api-changes/31 + +* UI: New Wallpaper +* UI: Added loading bar to boot +* UI: Added WAI-ARIA support +* UI: Schemes can now change window properties (like dimensions) +* GUI: Fixed menu not disappearing in certain cases +* GUI: Added `getNextElement()` helper method +* GUI: Better `show()` and `hide()` methods for GUI Elements +* GUI: GUI Elements now has `appendHTML()` method +* GUI: GUI Elements now has `remove()` and `empty()` methods +* GUI: `append()` in GUI Elements now builds items correctly (when doing it dynamically) +* GUI: Added minimum sizes to some containers where missing +* GUI: gui-image src checked if null +* GUI: Fixed radios not getting unselected properly +* GUI: Better Scheme APIs +* GUI: Added DnD support to TreeView +* GUI: Updated gui-richtext error handling +* GUI: Updated gui-paned-view resize events to be more precise +* GUI: All elements now support clipboard +* GUI: Better DataView abstractions for ease of development (extensions) +* API: Updated cURL method with new functionality +* API: Added onhashchange support for application messaging +* API: Deprecated `Application::_call()` in favour of `Application::_api()` +* API: `API.call()` now has pattern `=> fn(err, res)` +* API: Moved `API::createDraggable()` to `GUI::Helpers::createDraggable()` +* API: Moved `API::createDroppable()` to `GUI::Helpers::createDroppable()` +* Dialogs: Prevent HTML injection in confirm dialog +* Dialogs: Focus the 'abort' button by default +* Windows: Updated next tab support +* Windows: Added `_find()` shortcut for scheme +* Windows: Added `_findByQuery()` shortcut for scheme +* Utils: Better $hasClass +* ProcessViewer: Remaned forgotten file +* MusicPlayer: Updated compability +* FileManager: Now has clipboard support +* FileManager: Added new keyboard shortcuts +* Calculator: Focus is now always on the input field +* locales: Added missing it_IT translations +* locales: Improved ru_RU translations +* package-manager: Better extension support +* package-manager: Updated user-installed package support +* platform: Updated edison support +* build: Updated NW support +* build: Removed all dist files, now generated from template +* build: Updated config generation and setting +* build: Updated manifest generation +* build: Fixed setting configs with leading zeroes +* build: Metadata now supports `uses` property +* build: Metadata now supports `depends` property +* build: Apache files now generated with proxies from config +* build: Enabling/Disabling packages now happends in config, not manifest +* server-node: Added 'rawtype' option to `VFS::write()` +* server-node: Prevent crash when loading of extension fails +* server-node: Added support for proxies +* server-node: Now supports spawning child processes +* server-node: Now uses proper sessions via cookie +* config: Updated to relative paths +* misc: Updated Travis support +* misc: Updated Vagrant support +* misc: Updated Docker support +* misc: Updated packages.json dependencies +* misc: Updated MIME database +* misc: Cleanups +* doc: Updated CONTRIBUTING +* doc: Updated README +* doc: Updated INSTALL +* doc: Updated homepage +* doc: Updated docs + +# 2.0.0-alpha73 + +A ton of fixes, improvements and developer support updates! + +Now also supports Intel Edison platforms. + +* GUI: Better touch support +* GUI: Better scaling support +* GUI: Added media-queries for devices <800px +* GUI: gui-grid now dynamic +* GUI: Added some more generics to CSS (like % containers) +* API: Added relaunc() to relaunch/reload apps +* API: getIcon() should now always return proper file icons +* VFS: General improvements +* VFS: WebDAV implementation complete +* VFS: Better handling of copy/move between identical transports +* VFS: General improvements +* About: Rewritten +* Preview: Fixed video position +* Calculator: Refactored completely +* Settings: Package Management moved to its own app +* Settings: Now only shows physically loaded languages +* CoreWM: Updated weather panel item +* CoreWM: Updated windowlist panel item +* CoreWM: Cleaned up CSS +* CoreWM: Fixed loading indicators +* CoreWM: Updated touch menu +* CoreWM: Improved notification area +* CoreWM: No longer shows handles on non-resizable windows +* CoreWM: Improved resize clamping +* CoreWM: Simplified Window HTML markup a bit +* FileManager: Added create connection dialog +* iframe-application: Better initialization +* iframe-application: Better bi-directional communications support +* dialogs: Support for creating from custom callback and scheme +* utils: Added `acceptcodes` to XHR call +* handlers: Updated init() patterns +* handlers: Updated NW support +* handlers: Simplified integration +* handlers: Now supports blacklisting of apps +* handlers: Now reads settings from src/conf +* handlers: Better mysql handler +* handlers: bcrypt in mysql handler +* handlers: Demo handler fixes for PHP +* locales: Updated en_EN +* locales: Updated fr_FR +* locales: Updated ko_KR +* server-node: Updated APIs +* server-node: Better extension support +* server-node: Fixed where curl would returned garbled binaries +* server-node: Bugfixes +* server-node: Updated HTTP return codes +* server-node: Deny deletion of protocol root dirs +* server-node: Better logging +* server-php: Deny deletion of protocol root dirs +* build: Added support for generating Handlers +* build: Grunt now handles extensions better +* build: Renamed `package.json` to `metadata.json` for apps +* build: Better package extension support +* build: Added `autostart` parameter to package metadata +* build: Better feedback on grunt create-package tasks +* build: Now supports making opkg dists +* build: Better deb dist support +* build: Includes a "packaging" script +* doc: Updated INSTALL +* doc: Updated README +* doc: Updated CONTRIBUTING +* doc: Updated all platform docs +* doc: Updated all installation docs +* doc: Updated code docs +* misc: Added .github (new) features +* misc: Updated templates +* misc: Removed deprecated methods +* misc: Updated browser compabilty +* misc: Fixed some possible vulnerabilities +* platform: Now fully supports Intel Edison + +# 2.0.0-alpha72 + +New Logo, Moved repo to organization, Better privilege and group support, a ton of bugfixes and improvements! + +* Calculator: Updates +* Writer: Updates +* FileManager: Locale updates +* FileManager: UI improvements and better VFS triggers +* CoreWM: Improved notifications +* CoreWM: When shut down, settings are reset to defaults +* CoreWM: Fixed desktop shortcuts +* CoreWM: Fixed loading indicators +* Draw: Locale updates and bugfixes +* dialogs: Updated File dialog, bugfixes +* dialogs: API::createDialog() now has default callback +* windowmanager: Bugfixes +* windownanager: Clamp resize values when resizing +* gui: StatusBar improvements +* gui: PanedView improvements +* gui: FileView improvements and fixes +* gui: Updated login screen look +* scheme: Bugfixes +* handler: Improved API +* handler: Updated NW support +* handler: Included server handlers now use bcrypt +* settings-manager: Improved saving +* application: _onMessage() now returns boolean +* application: Moved get/set Argument functions down to process +* iframe-application: IE/Edge improvements +* default-application: Added CTRL+S shortcut +* default-application: Added CTRL+O shortcut +* zip-archiver: Added removal support and many fixes and improvements +* vfs: Added 'Blob' support +* vfs: Added support for custom mountpoints via client API +* vfs: Added WebDAV support +* vfs: Overhault of apis +* vfs: Support for HTTP reads over general api +* vfs: Better handling of datauri data transfers +* vfs: File upload abstraction improvements +* api: HTTP API URI overhalut (entirely new and improved) +* server-node: Now has checkserver-nodePrivilege +* server-node: Now has checkVFSPrivilege +* server-node: Now has checkPackagePrivilege +* server-node: Added exif info in fileinfo() +* server-node: Added permission info in fileinfo() +* server-node: General improvements and cleanups +* server: Reworked handler server integration +* themes: Some Firefox related fixes +* themes: updated Wallpaper +* themes: updated favicon +* themes: Updated 'Material' theme +* locales: Added Portuguese (pt_BR) +* locales: Added Korean (ko_KR) +* locales: Updated French (fr_FR) +* locales: Updated Polish (pl_PL) +* utils: XHR call now has timeout argument +* utils: XHR IE/Edge updates +* utils: Added parseurl() function +* build: Added 'ReloadOnShutdown' client config +* build: Updated Windows symlinks script +* build: Grunt compress task now also does core files +* build: Improved Windows support +* build: Added support for creating dummy packages +* build: Updated Gruntfile +* build: Improved 'dist' file generation +* build: Updated unit-tests +* build: CSS is now also linted +* build: Code style check improvements +* build: Now places manifest in server dir for backend as well +* build: Support for custom server src/conf entries +* misc: Added .editorconfig +* misc: Updated installer scripts +* misc: Updated locales overall +* misc: Code file-tree updates +* misc: Removed deprecated code +* misc: Cleaned up a lot of stuff +* misc: Improved error logging +* misc: Updated Vagrantfile +* misc: Added new error handling to async functions +* misc: jshint +* misc: Updated MIME database +* misc: Moved some dependencies to devDependencies +* doc: Updated README +* doc: Updated INSTALL +* doc: Added logo SVG sources +* doc: Added complete node backend documentation +* doc: Cleaned up all documentation +* doc: Updated bithoundrc +* doc: Updated package.json +* doc: Updated badges + +# 2.0.0-alpha71 OS.js exploded on social media and there was a lot of activity. This is just a digest of all the changes. @@ -422,7 +666,7 @@ Bugfixes, build system updates, size reduction, new API helpers, touch event com Also features the new IFrame Applications which help developers EASILY create applications that not relies on OS.js APIs. You can convert your existing JavaScript application in no-time :) -http://os.js.org/doc/tutorials/iframe-application.html +https://os.js.org/doc/tutorials/iframe-application.html * API: Added IFrameApplication helper * API: Added IFrameApplicationWindow helper diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aefa45cf05..7c3927c3bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,63 +2,30 @@ These are some of the ways you can contribute to OS.js: -* **Open issues** You can post any issues to [Github](https://github.com/os-js/OS.js/issues). -* **New features** Create a [pull request](https://github.com/os-js/OS.js/pulls) or open a new issue if you have any ideas for new features. +* **Open issues** You can post any issues/bugs/requests to [Github](https://github.com/os-js/OS.js/issues). +* **Code** Create a [pull request](https://github.com/os-js/OS.js/pulls) to contribute to the codebase * **Translating** Language support is a bit lacking, so any help is appreciated! [Join the Translation team](https://github.com/os-js/OS.js/wiki/Join-the-translation-team) * **Testing** Things are always changing, and automated tests are not enough to ensure everything is working 100%. [Join the Testing team](https://github.com/os-js/OS.js/wiki/Join-the-testing-team) * **Documentation** Found something in the [homepage or documentation](https://github.com/andersevenrud/os.js.org) that does not seem right? -* **Community** Join in our [Gitter](https://gitter.im/os-js/OS.js) chat room for fun and tech talk! +* **Chat** Join in our [Gitter](https://gitter.im/os-js/OS.js) chat room for fun and tech talk! +* **Community** Join our [community](http://community.os.js.org/) where you can post your ideas and questions etc (that does not fit into Github Issues) +* **Anonymous tips** Donate/tip anonymously with [Gratipay](https://gratipay.com/os-js/) +* **Donate** Donate via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=andersevenrud%40gmail%2ecom&lc=NO¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted) +* **Support** by becoming a [Patreon](https://www.patreon.com/user?u=2978551&ty=h&u=2978551) You can also submit patches and questions directly to me via [email](mailto:andersevenrud@gmail.com), but using GitHub is preferred. -# Resources +## Information -* [Homepage](http://os.js.org/) -* [Documentation](http://os.js.org/doc/) +Please read http://os.js.org/doc/manuals/man-development.html before you start making and submitting contributions to the repository. + +## Resources + +* [Homepage](https://os.js.org/) +* [Documentation](https://os.js.org/doc/) * [FAQ and discussion](https://github.com/os-js/OS.js/issues/49) * [Chat room](https://gitter.im/os-js/OS.js) * [Subreddit](https://www.reddit.com/r/osjs) -* [PayPal donation](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=andersevenrud%40gmail%2ecom&lc=NO¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted) -* [Gratipay donation](https://gratipay.com/os-js/) - -# Source Code - -* [OS.js Source Code](https://github.com/os-js/OS.js) -* [OS.js Homepage Code](https://github.com/andersevenrud/os.js.org) - - -# Setting up the development environment - -To get started you need a [Github](https://github.com/) account. - -## Prepare - -Then proceed to **fork** OS.js via the official [project page](https://github.com/os-js/OS.js). - -Follow the official documentation on how to [install and run OS.js](http://os.js.org/doc/manuals/man-install.html), with one exception -- run the development server instead: - -``` -./bin/start-node-dev.sh -``` - -## Making and submitting changes - -* Fork OS.js on github -* Follow the [style guide](https://github.com/os-js/OS.js/wiki/Style-guide) -* Use **UTF-8** file encoding -* I **strongly** recommend using a separate branch for your changes. -* I **strongly** recommend [squashing](http://makandracards.com/makandra/527-squash-several-git-commits-into-a-single-commit) your commits if you have spread out a task into several pieces. -* Make sure you test **all your changes** before commiting so it does not lead to extra commits with corrections. -* Keep your [commit messages](https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message) as short as possible and don't include filenames. Write a short description of **what was done**, not *where*. Example: "Themes: Corrected colors" or "Locales: Added ru_RU locales" -* Send a [pull-request](https://help.github.com/articles/using-pull-requests/) when you are done -* Keep your fork [up-to-date](https://robots.thoughtbot.com/keeping-a-github-fork-updated) - -Tip: Have `grunt watch` running in the background to automatically run tasks for you when something changes. - -Tip: Run `grunt jscs jshint` to check for syntax problems and style guide violations - -Tip: Run `grunt mochaTest` to run server-side checks - -Tip: Run `grunt test` to test everything +* [OS.js Core Source](https://github.com/os-js/OS.js) +* [OS.js Homepage Source](https://github.com/andersevenrud/os.js.org) -**NOTE THAT I DO NOT ACCEPT PULL-REQUESTS THAT DO NOT FOLLOW THE GUIDELINES ABOVE (AS OF 2016)** diff --git a/Dockerfile b/Dockerfile index f4a14fbed2..54ced97646 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,18 +12,16 @@ USER root RUN apt-get -y update ## Install dependencies and build tools. ## -RUN apt-get install -y git -RUN apt-get install -y npm -RUN apt-get install -y nodejs-legacy +RUN apt-get -y install git npm nodejs-legacy ## Clone the Repo and install grunt ## RUN git clone https://github.com/os-js/OS.js.git -RUN npm install -g grunt-cli +RUN npm install -g grunt-cli supervisor RUN cd OS.js/ ## Install and Compile OS.js ## WORKDIR OS.js/ -RUN npm install +RUN npm install --production RUN grunt ## Start Application and Expose Port ## diff --git a/Gruntfile.js b/Gruntfile.js index 99c80936dd..7ed284132c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -38,6 +38,8 @@ module.exports = function(grunt) { + grunt.file.defaultEncoding = 'utf-8'; + // // Load plugins // @@ -45,15 +47,28 @@ require('time-grunt')(grunt); } catch (e) { } - grunt.file.defaultEncoding = 'utf-8'; + // Make sure we only load required modules (ignore warnings) + var checks = ['test', 'jshint', 'jscs', 'csslint', 'validate_xml', 'mochaTest']; + checks.forEach(function(k) { + if ( grunt.cli.tasks.indexOf(k) >= 0 ) { + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-mocha-test'); + //grunt.loadNpmTasks('grunt-mocha'); + grunt.loadNpmTasks('grunt-jscs'); + grunt.loadNpmTasks('grunt-contrib-csslint'); + grunt.loadNpmTasks('grunt-contrib-validate-xml'); + return false; + } + return true; + }); + + if ( grunt.cli.tasks.indexOf('nw') >= 0 ) { + grunt.loadNpmTasks('grunt-nw-builder'); + } - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-mocha-test'); - //grunt.loadNpmTasks('grunt-mocha'); - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-jscs'); - grunt.loadNpmTasks('grunt-contrib-csslint'); - grunt.loadNpmTasks('grunt-nw-builder'); + if ( grunt.cli.tasks.indexOf('watch') >= 0 ) { + grunt.loadNpmTasks('grunt-contrib-watch'); + } // // Load tasks @@ -74,8 +89,7 @@ 'src/packages/default/**/*.js', '!src/packages/default/Broadway/**', '!src/packages/default/**/locales.js', - '!src/packages/default/**/locale.js', - '!src/packages/default/Calculator/main.js' + '!src/packages/default/**/locale.js' ] }, csslint: { @@ -140,7 +154,7 @@ 'src/client/themes/styles/*/metadata.json', 'src/client/themes/sounds/*/metadata.json', 'src/client/themes/icons/*/metadata.json', - 'src/packages/*/*/package.json' + 'src/packages/*/*/metadata.json' ], tasks: ['config', 'manifest'] } @@ -155,8 +169,7 @@ 'src/client/javascript/*.js', 'src/client/javascript/**/*.js', 'src/packages/default/**/*.js', - '!src/packages/default/Broadway/**', - '!src/packages/default/Calculator/main.js' + '!src/packages/default/Broadway/**' ], options: { config: '.jscsrc', @@ -165,6 +178,14 @@ requireCurlyBraces: ['if'] } }, + validate_xml: { + all: { + src: [ + 'src/client/dialogs.html', + 'src/packages/default/*/scheme.html' + ] + } + }, nwjs: { options: { version: '0.12.3', @@ -197,6 +218,8 @@ } else if ( fn === 'preload' ) { result = _build.addPreload(grunt, key, value, arg); console.log(result); + } else if ( fn === 'mount' ) { + result = _build.addMountpoint(grunt, key, value, arg); } else if ( fn === 'add-repository' ) { result = _build.addRepository(grunt, key); console.log(result); @@ -229,7 +252,11 @@ if ( arg === 'disable' || arg === 'enable' ) { _build.togglePackage(grunt, arg2, arg === 'enable'); return; + } else if ( arg === 'list' ) { + _build.listPackages(grunt); + return; } + _build.buildPackages(grunt, arg); }); @@ -281,6 +308,11 @@ _build.createPackage(grunt, arg1, arg2); }); + grunt.registerTask('create-handler', 'Create a new handler with given name', function(arg1, arg2) { + grunt.log.writeln('Creating handler...'); + _build.createHandler(grunt, arg1); + }); + // // Register aliases // @@ -290,7 +322,7 @@ grunt.registerTask('nw', ['config', 'core:nw', 'themes', 'packages', 'manifest', 'standalone:nw', 'nwjs']); grunt.registerTask('dist', ['config', 'dist-files:dist', 'core', 'themes', 'packages', 'manifest']); grunt.registerTask('dist-dev', ['config', 'dist-files:dist-dev', 'themes:fonts', 'themes:styles', 'manifest']); - grunt.registerTask('test', ['jshint', 'jscs', 'csslint', 'mochaTest'/*, 'mocha'*/]); + grunt.registerTask('test', ['jshint', 'jscs', 'csslint', 'validate_xml', 'mochaTest'/*, 'mocha'*/]); }; })(require('node-fs-extra'), require('path'), require('./src/build.js'), require('grunt'), require('less')); diff --git a/INSTALL.md b/INSTALL.md index 2b86f088d5..64d7fb0cfa 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,95 +1,57 @@ # Installation instructions -Server runs on Linux, OS X, BSD and Windows. - Installation is done in a few simple steps and only takes a minute to get running. -For more general information look at the [README](README.md) file or in the [official documentation](http://os.js.org/doc/). - -I have also made a [simplified installation guide](http://os.js.org/doc/manuals/man-install.html) so you don't have to read this entire thing. +For more general information look at the [README](README.md) file or in the [official documentation](https://os.js.org/doc/). #### Table of Contents * [Dependencies](#dependencies) -* Installation methods - 1. Automated - * [NIX](#automated) - * [Windows](#automated-1) - 2. Manual - * [NIX](#manual) - * [Windows](#manual-1) - 3. Containers and Virtual Machines +* [Installation methods](#installation) + 1. Standard Installation + * [*NIX](#nix) + * [Windows](#windows) + 2. Containers and Virtual Machines * [Vagrant](#vagrant) * [Docker](#docker) * [NW.js](#nwjs) - * [X11](#x11) -* [Running](#running) - 2. [Node](#node) - 3. PHP - * [Apache](#apache) - * [Lighttpd](#lighttpd) - * [Nginx](#nginx) - * [WAMP](#wamp) + 3. Single-board-computers + * [Raspberry PI](#raspberry-pi) + * [Arduino](#arduino) + * [Intel Edison](#intel-edison) + 4. Linux distribution * [Setting up optional features](#setting-up-optional-features) # Dependencies -You just need **node** and **npm**. Install them with your package manager or download the [official installer](https://nodejs.org). +You only need these packages installed: -**Debian\Ubuntu:** Also install package `nodejs-legacy`. +- `git` +- `node` (debian users also need `nodejs-legacy`) +- `npm` # Installation -To easily apply updates and other changes, I recommend using **git** to download instead of using a zip-file/automated installer. - -If you install npm packages without `--production` parameter, you need to install mocha `sudo npm install -g mocha` - -## NIX - -### Automated - -Run `curl -sS http://os.js.org/installer | sh`. - -### Manual - -```shell -$ sudo npm install -g grunt-cli +OS.js runs on all patforms and web-servers. Choose one of the methods described below, then proceed to the [run](#running) section. -# You can also download and extarct the latest zip -$ git clone https://github.com/os-js/OS.js.git -$ cd OS.js -$ npm install --production -$ grunt -``` +## Standard Installation -## Windows +You can also find documentation on this on the [official homepage](https://os.js.org/doc/manuals/man-install.html). -### Automated +If you want to install on your computer or server directly: -Download and run http://os.js.org/installer.exe. +### *NIX -### Manual +See [install-nix.md](https://github.com/os-js/OS.js/blob/master/doc/install-nix.md). -[Official video instruction on YouTube](https://www.youtube.com/watch?v=Cj3OdxTdGGc) +### Windows -Run `cmd` as *Administrator* (important)! - -```shell -$ npm install -g grunt-cli - -# You can also download and extarct the latest zip -$ git clone https://github.com/os-js/OS.js.git -$ cd OS.js -$ npm install --production - -# This is required to make the Development Environment work, but is optional. -$ bin\create-windows-symlinks - -$ grunt --force -``` +See [install-windows.md](https://github.com/os-js/OS.js/blob/master/doc/install-windows.md). ## Containers and Virtual Machines +If you want to install on your computer, but in an isolated environment (container) + ### Vagrant See [Vagrant.md](https://github.com/os-js/OS.js/blob/master/doc/Vagrant.md). @@ -102,68 +64,26 @@ See [Docker.md](https://github.com/os-js/OS.js/blob/master/doc/Docker.md). See [NW.md](https://github.com/os-js/OS.js/blob/master/doc/NW.md). -### X11 - -See [X11.md](https://github.com/os-js/OS.js/blob/master/doc/X11.md). - -# Running +## Single-board-computers -*If you built OS.js using a container (above) you can skip this.* +You can also install/deploy OS.js on these platforms, but has some spesific documentation: -Make sure the _VFS_ directories in `vfs/` are given the same permissions as the web-servers running user. +### Raspberry PI -After you have started a server, simply navigate to http://localhost:8000 (port 8000 is default). +See [platform-raspi.md](https://github.com/os-js/OS.js/blob/master/doc/platform-raspi.md). -## Node +### Arduino -Node is the prefered server for OS.js. +See [platform-arduino.md](https://github.com/os-js/OS.js/blob/master/doc/platform-arduino.md). -### Production (dist) +### Intel Edison -``` -./bin/start-dist.sh` or `bin\win-start-dist -``` +See [platform-edison.md](https://github.com/os-js/OS.js/blob/master/doc/platform-edison.md). -### Development (dist-dev) +## Linux distribution -``` -./bin/start-dev.sh` or `bin\win-start-dev -``` - -You can install [node supervisor](https://github.com/petruisfan/node-supervisor) and the development (dist-dev) server will automatically reload on change. - -## PHP5 - -You can start a server manually with `(cd dist; php -S 0.0.0.0:8000 ../src/server/php/server.php)` or look below for webserver alternatives. - -If you have a "webhost" (or "webhotel") with ex. cPanel without shell access (or no node support), you can run OS.js, but has to be built on another computer, then transfered over to the target machine. The only downside here is that you'd have to run from /OS.js/dist/ without doing modifications to the setup (if you don't have access to mod_rewrite to create proxy rules). You can find more info on this [here](https://github.com/os-js/OS.js/blob/master/doc/cpanel-host.md). - -*By default PHP uses 'dist' as the default root* - -### Apache - -Run `grunt apache-vhost` to generate config file (or look in doc/ for example) - -*Note* You have to enable mod_rewrite for Apache and make sure htaccess is allowed. - -### Lighttpd - -Run `grunt lighttpd-config` to generate config file (or look in doc/ for example) - -### Nginx - -Run `grunt nginx-config` to generate config file (or look in doc/ for example) - -### WAMP - -Works fine. Just look up the Apache section above for configuration. +OS.js can run as a Linux distribution on top of X11. See [X11.md](https://github.com/os-js/OS.js/blob/master/doc/X11.md) for more information. # Setting up optional features -* [Add packages](http://os.js.org/doc/manuals/man-package-manager.html) -* [Google API and Google Drive](http://os.js.org/doc/manuals/man-google-api.html) -* [Windows Live API and OneDrive](http://os.js.org/doc/manuals/man-windows-live-api.html) -* [Dropbox](http://os.js.org/doc/manuals/man-dropbox.html) -* [Broadway](http://os.js.org/doc/manuals/man-broadway.html) -* [ZIP support](http://os.js.org/doc/manuals/man-zip.html) - +Visit the [official documentation](https://os.js.org/doc/manuals/) for more information. diff --git a/README.md b/README.md index 27d6d6fb83..56f8b6f5eb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ # Arduino-OS -Arduino-OS is a web deskop solution for Arduino boards. - -## License - Arduino-OS is based on [OS.js](http://os.js.org/) by Anders Evenrud diff --git a/Vagrantfile b/Vagrantfile index c7d4da75c4..8af88bf532 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,10 +2,7 @@ # vi: set ft=ruby : # Install Plugins... -unless Vagrant.has_plugin?("vagrant-omnibus") and Vagrant.has_plugin?("vagrant-hostsupdater") and Vagrant.has_plugin?("vagrant-vbguest") - unless Vagrant.has_plugin?("vagrant-omnibus") - system('vagrant plugin install vagrant-omnibus') - end +unless Vagrant.has_plugin?("vagrant-hostsupdater") and Vagrant.has_plugin?("vagrant-vbguest") unless Vagrant.has_plugin?("vagrant-hostsupdater") system('vagrant plugin install vagrant-hostsupdater') end @@ -22,41 +19,24 @@ Vagrant.configure(2) do |config| v.customize ["modifyvm", :id, "--cpus", 1] v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] v.customize ["modifyvm", :id, "--natdnsproxy1", "on"] + v.name = "osjs" end config.ssh.forward_agent = true - config.vm.hostname = "osjs.dev" + config.vm.hostname = "osjs.vagrant.dev" config.vm.network :private_network, ip: "192.168.60.4" config.vm.provision "shell", inline: <<-SHELL - # update system - aptitude -y update - - # configure apache2 and php5 - aptitude -y install apache2 libapache2-mod-php5 - a2enmod rewrite - service apache2 restart - - # install tools - aptitude -y install make git npm - ln -s /usr/bin/nodejs /usr/bin/node - - # build OS.js - sudo npm install -g grunt-cli - git clone https://github.com/os-js/OS.js.git + # Install dependencies + echo "Installing apt dependencies" + apt-get install -y git nodejs npm nodejs-legacy >/dev/null + npm install --silent --quiet -g grunt-cli supervisor >/dev/null + + # Install OS.js + echo "Installing OS.js" + git clone https://github.com/os-js/OS.js.git >/dev/null pushd OS.js - npm install - grunt - - # configure apache2 to serve OS.js dist-dev - grunt apache-vhost:dist-dev:apache-vhost.conf - sed -i -e 's/#Require/Require/' apache-vhost.conf - sudo cp apache-vhost.conf /etc/apache2/sites-available/000-default.conf - sudo service apache2 restart - - # update permissions - popd - sudo chown -R vagrant:vagrant OS.js - sudo chown -R www-data:www-data OS.js/vfs + npm install --production >/dev/null + grunt >/dev/null SHELL end diff --git a/bin/build-deb.sh b/bin/build-deb.sh new file mode 100755 index 0000000000..4420a42203 --- /dev/null +++ b/bin/build-deb.sh @@ -0,0 +1,83 @@ +#!/bin/bash +# +# Creates a Debian image for OS.js +# + +NAME=$1 +VERSION=$2 +ARCH=$3 + +if [ -z $VERSION ]; then + echo "Missing version argument" + echo "usage: build-deb.sh " + exit 1 +fi +if [ -z $NAME ]; then + echo "Missing name argument" + echo "usage: build-deb.sh " + exit 1 +fi +if [ -z $ARCH ]; then + echo "Missing architechture argument" + echo "usage: build-deb " + exit 1 +fi + +SRCDIR=".build/output" +OUTDIR=".build/deb" +PKGNAME="${NAME}_${VERSION}" + +echo "[deb] Preparing..." + +# +# Prepare +# + +rm -rf $OUTDIR + +npm install nan@1.1.0 +npm install authenticate-pam +npm install userid + +./bin/make-packaged.sh deb + +echo "[deb] Building..." + +# +# Create package files +# + +# Prepare tree +mkdir -p $OUTDIR/etc/init.d +mkdir -p $OUTDIR/etc/osjs +mkdir -p $OUTDIR/etc/X11 +mkdir -p $OUTDIR/opt/osjs +mkdir -p $OUTDIR/usr/local/lib +mkdir -p $OUTDIR/usr/local/bin + +cp -r $SRCDIR/* $OUTDIR/opt/osjs/ + +# Make launcher +(cd src/x11-launcher; make) +mv src/x11-launcher/session-launch $OUTDIR/usr/local/bin/osjs-launcher + +# Copy system image +cp -r src/templates/deb/* $OUTDIR/ + +# +# Debian CONTROL +# +mkdir -p $OUTDIR/DEBIAN +awk '{gsub("ARCH", "'"$ARCH"'", $0); print }' $OUTDIR/DEBIAN_tmpl | awk '{gsub("VER", "'"${VERSION}"'", $0); print }' > $OUTDIR/DEBIAN/control +rm $OUTDIR/DEBIAN_tmpl + +echo "[deb] Packing..." + +# +# Create package +# +dpkg-deb --build $OUTDIR $PKGNAME.deb + +echo "[deb] Done :)" + +exit 0 diff --git a/bin/build-debian-image.sh b/bin/build-debian-image.sh deleted file mode 100755 index f6f8fa6936..0000000000 --- a/bin/build-debian-image.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -NAME="osjs_2.0-07001" -OUTDIR="$NAME" - -rm -rf $OUTDIR - -# Prepare build -(cd src/conf; ln -sf ../templates/conf/500-x11.json 500-x11.json) - -# -# Debian Image -# - -# Prepare tree -mkdir -p $OUTDIR/etc/init.d -mkdir -p $OUTDIR/etc/osjs -mkdir -p $OUTDIR/etc/X11 -mkdir -p $OUTDIR/opt/osjs -mkdir -p $OUTDIR/opt/osjs/dist -mkdir -p $OUTDIR/opt/osjs/server -mkdir -p $OUTDIR/usr/local/lib -mkdir -p $OUTDIR/usr/local/bin - -# Install npm dependencies -npm install -npm install nan@1.1.0 -npm install authenticate-pam -npm install userid - -# Build -grunt - -# Server and Client files -cp -r vendor $OUTDIR/opt/osjs -cp -r src/packages $OUTDIR/opt/osjs/ -cp -r src/client $OUTDIR/opt/osjs/ -cp -r node_modules $OUTDIR/opt/osjs/server/ -cp -r src/server/node/* $OUTDIR/opt/osjs/server/ -cp src/server/settings.json $OUTDIR/opt/osjs/ -cp src/conf/130-mime.json $OUTDIR/opt/osjs/mime.json -cp dist-dev/blank.css $OUTDIR/opt/osjs/dist/ -cp dist-dev/index.html $OUTDIR/opt/osjs/dist/ -cp dist-dev/packages.js $OUTDIR/opt/osjs/dist/ -cp dist-dev/settings.js $OUTDIR/opt/osjs/dist/ -cp dist-dev/favicon.* $OUTDIR/opt/osjs/dist/ -cp dist-dev/osjs-logo.png $OUTDIR/opt/osjs/dist/ -(cd $OUTDIR/opt/osjs/dist; ln -sf ../packages packages) -(cd $OUTDIR/opt/osjs/dist; ln -sf ../client client) -cp -r dist/themes $OUTDIR/opt/osjs/dist/ -cp -r dist/vendor $OUTDIR/opt/osjs/dist/ -rm -rf $OUTDIR/opt/osjs/source/client/themes - -# Make launcher -(cd src/x11-launcher; make) -mv src/x11-launcher/session-launch $OUTDIR/usr/local/bin/osjs-launcher - -# Copy system image -cp -r src/templates/debian-image/* $OUTDIR/ - -# -# Debian CONTROL -# -mv $OUTDIR/DEBIAN $OUTDIR/DEBIAN.tmp -mkdir -p $OUTDIR/DEBIAN -mv $OUTDIR/DEBIAN.tmp $OUTDIR/DEBIAN/control - -# -# Create package -# -dpkg-deb --build $NAME diff --git a/bin/build-opkg.sh b/bin/build-opkg.sh new file mode 100755 index 0000000000..65194f2c1d --- /dev/null +++ b/bin/build-opkg.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# +# This script creates an `ipkg` file ready for deployment +# + +NAME=$1 +VERSION=$2 +ARCH=$3 +TEMPLATE=$4 + +if [ -z $ARCH ]; then + echo "Missing architechture argument" + echo "usage: build-opkg.sh