Repository: os-js/OS.js Branch: master Commit: 0aa874455e1c Files: 20 Total size: 29.4 KB Directory structure: gitextract_uwb8vc1n/ ├── .github/ │ ├── FUNDING.yml │ └── workflows/ │ ├── node.yml │ └── test.yml ├── .gitignore ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── docker-compose.yml ├── entrypoint.sh ├── package.json ├── src/ │ ├── cli/ │ │ └── index.js │ ├── client/ │ │ ├── config.js │ │ ├── index.ejs │ │ ├── index.js │ │ └── index.scss │ ├── packages/ │ │ └── .gitignore │ └── server/ │ ├── config.js │ └── index.js └── webpack.config.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: andersevenrud patreon: andersevenrud open_collective: osjs liberapay: os-js custom: https://paypal.me/andersevenrud ================================================ FILE: .github/workflows/node.yml ================================================ name: Node tests on: push: branches: - master pull_request: jobs: build: strategy: matrix: version: [12, 13, 14, 15, 16] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: ${{ matrix.version }} - run: npm ci - run: npm run package:discover - run: npm run build ================================================ FILE: .github/workflows/test.yml ================================================ name: Lint tests on: push: branches: - master pull_request: jobs: build: name: Lint tests (node latest) runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: '13.x' - run: npm install - run: npm run eslint - run: npm run stylelint ================================================ FILE: .gitignore ================================================ .swp .tern-* node_modules /packages.json /sessions /.env* /session-store.db ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing If you want to contribute, but not sure what to do, here's a list of things that I always need help with: * Translations * Bug-hunting * Finding security problems * Themes and general graphics * Website design (like the homepage and manuals) * Documentation If you need help, or just up for some general discussion, head into the [community forums](https://community.os-js.org/) or [community chat](https://gitter.im/os-js/OS.js). See [manual](https://manual.os-js.org/v3/development/) for more information. You can view all open issues on github, which is usually a good starting point if you want to start contributing: https://github.com/search?q=org%3Aos-js+is%3Aopen+is%3Aissue+archived%3Afalse&type=Issues # Support You can also donate or become a patreon, which helps out covering server costs and potentially make it possible to put out bounties: * **Sponsor on [Github](https://github.com/sponsors/andersevenrud)** * **Become a [Patreon](https://www.patreon.com/user?u=2978551&ty=h&u=2978551)** * **Support on [Open Collective](https://opencollective.com/osjs)** * Donate via [Liberapay](https://liberapay.com/os-js/) * Donate via [PayPal](https://paypal.me/andersevenrud) Or via Bitcoin: bc1q8wd9e9xlppr7nft09n4guz89j0cp9gepl606s0 bitcoin qr code # Members If you are a member of the official OS.js developer Team: * [Discussions](http://community.os-js.org/c/team) * [Tasks](https://trello.com/osjs) * [Chat](https://gitter.im/os-js/OS.js/teams) ================================================ FILE: Dockerfile ================================================ # # OS.js - JavaScript Cloud/Web Desktop Platform # # Copyright (c) 2011-2020, Anders Evenrud # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # @author Anders Evenrud # @licence Simplified BSD License # # THIS IS ONLY INTENDED FOR DEVELOPMENT USAGE FROM node:10 RUN npm install -g nodemon WORKDIR /usr/src/osjs COPY entrypoint.sh . CMD ./entrypoint.sh ================================================ FILE: LICENSE ================================================ BSD 2-Clause License OS.js - JavaScript Cloud/Web Desktop Platform Copyright (c) Anders Evenrud All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: README.md ================================================

OS.js Logo

# OS.js [OS.js](https://www.os-js.org/) is an [open-source](https://raw.githubusercontent.com/os-js/OS.js/master/LICENSE) web desktop platform with a window manager, application APIs, GUI toolkit, filesystem abstractions and much more. **Backing/Donations:** [Github sponsorship](https://github.com/sponsors/andersevenrud), [Patreon](https://www.patreon.com/user?u=2978551&ty=h&u=2978551), [OpenCollective](https://opencollective.com/osjs), [LibrePay](https://liberapay.com/os-js/), [PayPal](https://paypal.me/andersevenrud), [Bitcoin](https://manual.os-js.org/wallet.png) **Support:** [Chat](https://gitter.im/os-js/OS.js), [Forums](https://community.os-js.org/), [Twitter](https://twitter.com/osjsorg), [Facebook](https://www.facebook.com/os.js.org) ## Introduction This is the OS.js base repository that you can use as a template to make your own distributions, installations and development environments. ## Try it yourself Visit the [official demo](https://demo.os-js.org/) for a preview version. Please note that some features are disabled and might be outdated or unavailable at times. ![ScreenShot](https://www.os-js.org/screenshot.png) ## Documentation See the [official manuals](https://manual.os-js.org/) for articles, tutorials and guides. There's also a [contribution guide](https://github.com/os-js/OS.js/blob/master/CONTRIBUTING.md) if you want to contribute to this project. ## Installation > OS.js runs on `http://localhost:8000` by default. ### Using a pre-made image You can use the official Docker base image to run OS.js without downloading this repository. This image is based on this source code and comes with a minimal setup. ```bash docker run -p 8000:8000 osjs/osjs:latest ``` ### Using this repository Clone the master branch: > You can also download an archived version (ex. zip file) instead of using git. ```bash git clone -b master --single-branch https://github.com/os-js/OS.js.git cd OS.js ``` #### Docker Compose installation The easiest way to install is to use Docker Compose. This allows you to run a single command to set everything up: ```bash docker-compose up ``` #### Local installation You can also install this directly onto your system by using the following set of commands. > **NOTE:** Requires Node v10 (or later. **[node 17 not currently supported without workaround](https://github.com/os-js/OS.js/issues/785)**). ```bash # Install dependencies npm install # It's recommended that you update dependencies npm update # Optionally install extra packages: # For a list of packages, see https://manual.os-js.org/resource/official/ npm install @osjs/example-application # Discover installed packages npm run package:discover # Build client npm run build # Start serving npm run serve ``` ================================================ FILE: docker-compose.yml ================================================ # # OS.js - JavaScript Cloud/Web Desktop Platform # # Copyright (c) 2011-2020, Anders Evenrud # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # @author Anders Evenrud # @licence Simplified BSD License # # THIS IS ONLY INTENDED FOR DEVELOPMENT USAGE version: '3' services: osjs: user: node build: context: . volumes: - .:/usr/src/osjs ports: - "${OSJS_NODE_PORT:-8000}:8000" ================================================ FILE: entrypoint.sh ================================================ #!/bin/bash # # OS.js - JavaScript Cloud/Web Desktop Platform # # Copyright (c) 2011-2020, Anders Evenrud # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # @author Anders Evenrud # @licence Simplified BSD License # # THIS IS ONLY INTENDED FOR DEVELOPMENT USAGE npm install npm run build npm run package:discover npx nodemon --watch package-lock.json --watch src/server --watch package.json --watch src/packages src/server/index.js ================================================ FILE: package.json ================================================ { "name": "@osjs/osjs", "version": "3.1.12", "description": "OS.js", "main": "index.js", "scripts": { "test": "npm run eslint && npm run stylelint", "eslint": "eslint 'src/client/**/*.js' 'src/server/**/*.js'", "stylelint": "stylelint 'src/client/*.scss'", "serve": "node src/server/index.js", "build:manifest": "osjs-cli package:discover", "package:discover": "osjs-cli package:discover", "package:create": "osjs-cli package:create", "make:auth": "osjs-cli make:auth", "make:settings": "osjs-cli make:settings", "make:vfs": "osjs-cli make:vfs", "make:application": "osjs-cli make:application", "make:iframe-application": "osjs-cli make:iframe-application", "make:provider": "osjs-cli make:provider", "build": "webpack", "watch": "webpack --watch" }, "keywords": [ "osjs" ], "author": "Anders Evenrud ", "license": "BSD-2-Clause", "devDependencies": { "@osjs/dev-meta": "^2.1.0", "html-webpack-plugin": "^3.2.0", "source-map-loader": "^0.2.4" }, "dependencies": { "@osjs/calculator-application": "^1.2.8", "@osjs/cli": "^3.1.3", "@osjs/client": "^3.7.1", "@osjs/dialogs": "^3.1.0", "@osjs/draw-application": "^1.2.12", "@osjs/filemanager-application": "^1.6.2", "@osjs/freedesktop-sounds": "^3.0.3", "@osjs/gnome-icons": "^4.0.5", "@osjs/gui": "^4.0.36", "@osjs/htmlviewer-application": "^1.2.6", "@osjs/musicplayer-application": "^1.2.8", "@osjs/panels": "^3.0.31", "@osjs/preview-application": "^1.1.17", "@osjs/server": "^3.2.3", "@osjs/settings-application": "^1.1.8", "@osjs/standard-theme": "^4.0.9", "@osjs/textpad-application": "^1.2.7", "hyperapp": "^1.2.10", "typeface-roboto": "0.0.75" }, "repository": { "type": "git", "url": "git+https://github.com/osjs/OS.js.git" }, "bugs": { "url": "https://github.com/osjs/OS.js/issues" }, "homepage": "https://www.os-js.org", "engines": { "node": ">=10.0.0" }, "eslintConfig": { "env": { "browser": true, "node": true }, "parserOptions": { "sourceType": "module", "ecmaVersion": 8 }, "extends": "@osjs/eslint-config" }, "stylelint": { "extends": "@osjs/stylelint-config" }, "babel": { "presets": [ [ "@babel/preset-env", {} ] ], "plugins": [ "@babel/plugin-transform-runtime" ] } } ================================================ FILE: src/cli/index.js ================================================ /*! * OS.js - JavaScript Cloud/Web Desktop Platform * * Copyright (c) 2011-2020, Anders Evenrud * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Anders Evenrud * @licence Simplified BSD License */ const path = require('path'); // // This is where you can place your custom CLI tasks // https://manual.os-js.org/guide/cli/ // https://manual.os-js.org/resource/official/ // module.exports = { discover: [ path.resolve(__dirname, '../packages') // OS.js/src/packages ], tasks: [] }; ================================================ FILE: src/client/config.js ================================================ /* * OS.js - JavaScript Cloud/Web Desktop Platform * * Copyright (c) 2011-2020, Anders Evenrud * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Anders Evenrud * @licence Simplified BSD License */ // // This is the client configuration tree. // Guide: https://manual.os-js.org/config/#client // Complete config tree: https://github.com/os-js/osjs-client/blob/master/src/config.js // export default { auth: { login: { username: 'demo', password: 'demo' } } }; ================================================ FILE: src/client/index.ejs ================================================ <%= htmlWebpackPlugin.options.title %> ================================================ FILE: src/client/index.js ================================================ /*! * OS.js - JavaScript Cloud/Web Desktop Platform * * Copyright (c) 2011-2020, Anders Evenrud * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Anders Evenrud * @licence Simplified BSD License */ // // This is the client bootstrapping script. // This is where you can register service providers or set up // your libraries etc. // // https://manual.os-js.org/guide/provider/ // https://manual.os-js.org/install/ // https://manual.os-js.org/resource/official/ // import { Core, CoreServiceProvider, DesktopServiceProvider, VFSServiceProvider, NotificationServiceProvider, SettingsServiceProvider, AuthServiceProvider } from '@osjs/client'; import {PanelServiceProvider} from '@osjs/panels'; import {GUIServiceProvider} from '@osjs/gui'; import {DialogServiceProvider} from '@osjs/dialogs'; import config from './config.js'; import './index.scss'; const init = () => { const osjs = new Core(config, {}); // Register your service providers osjs.register(CoreServiceProvider); osjs.register(DesktopServiceProvider); osjs.register(VFSServiceProvider); osjs.register(NotificationServiceProvider); osjs.register(SettingsServiceProvider, {before: true}); osjs.register(AuthServiceProvider, {before: true}); osjs.register(PanelServiceProvider); osjs.register(DialogServiceProvider); osjs.register(GUIServiceProvider); osjs.boot(); }; window.addEventListener('DOMContentLoaded', () => init()); ================================================ FILE: src/client/index.scss ================================================ /*! * OS.js - JavaScript Cloud/Web Desktop Platform * * Copyright (c) 2011-2020, Anders Evenrud * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Anders Evenrud * @licence Simplified BSD License */ // // This is the client base stylesheet. // This is where you add all your dependent styles and override any // OS.js defaults. // @import "~typeface-roboto/index.css"; @import "~@osjs/client/dist/main.css"; @import "~@osjs/gui/dist/main.css"; @import "~@osjs/dialogs/dist/main.css"; @import "~@osjs/panels/dist/main.css"; body, html { width: 100%; height: 100%; } ================================================ FILE: src/packages/.gitignore ================================================ ================================================ FILE: src/server/config.js ================================================ /* * OS.js - JavaScript Cloud/Web Desktop Platform * * Copyright (c) 2011-2020, Anders Evenrud * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Anders Evenrud * @licence Simplified BSD License */ // // This is the server configuration tree. // Guide: https://manual.os-js.org/config/#server // Complete config tree: https://github.com/os-js/osjs-server/blob/master/src/config.js // const path = require('path'); const root = path.resolve(__dirname, '../../'); module.exports = { root, port: 8000, public: path.resolve(root, 'dist') }; ================================================ FILE: src/server/index.js ================================================ /* * OS.js - JavaScript Cloud/Web Desktop Platform * * Copyright (c) 2011-2020, Anders Evenrud * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Anders Evenrud * @licence Simplified BSD License */ // // This is the server bootstrapping script. // This is where you can register service providers or set up // your libraries etc. // // https://manual.os-js.org/guide/provider/ // https://manual.os-js.org/install/ // https://manual.os-js.org/resource/official/ // const { Core, CoreServiceProvider, PackageServiceProvider, VFSServiceProvider, AuthServiceProvider, SettingsServiceProvider } = require('@osjs/server'); const config = require('./config.js'); const osjs = new Core(config, {}); osjs.register(CoreServiceProvider, {before: true}); osjs.register(PackageServiceProvider); osjs.register(VFSServiceProvider); osjs.register(AuthServiceProvider); osjs.register(SettingsServiceProvider); const shutdown = signal => (error) => { if (error instanceof Error) { console.error(error); } osjs.destroy(() => process.exit(signal)); }; process.on('SIGTERM', shutdown(0)); process.on('SIGINT', shutdown(0)); process.on('exit', shutdown(0)); osjs.boot().catch(shutdown(1)); ================================================ FILE: webpack.config.js ================================================ const path = require('path'); const mode = process.env.NODE_ENV || 'development'; const minimize = mode === 'production'; const webpack = require('webpack'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const {DefinePlugin} = webpack; const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const npm = require('./package.json'); const plugins = []; if (mode === 'production') { plugins.push(new OptimizeCSSAssetsPlugin({ cssProcessorOptions: { discardComments: true, map: { inline: false } }, })); } module.exports = { mode, devtool: 'source-map', entry: { osjs: path.resolve(__dirname, 'src/client/index.js') }, performance: { maxEntrypointSize: 500 * 1024, maxAssetSize: 500 * 1024 }, optimization: { minimize, splitChunks: { chunks: 'all' } }, plugins: [ new DefinePlugin({ OSJS_VERSION: npm.version }), new HtmlWebpackPlugin({ template: path.resolve(__dirname, 'src/client/index.ejs'), favicon: path.resolve(__dirname, 'src/client/favicon.png'), title: 'OS.js' }), new MiniCssExtractPlugin({ filename: '[name].css' }), ...plugins ], module: { rules: [ { test: /\.(svg|png|jpe?g|gif|webp)$/, use: [ { loader: 'file-loader' } ] }, { test: /\.(eot|svg|ttf|woff|woff2)$/, include: /typeface/, use: { loader: 'file-loader', options: { name: 'fonts/[name].[ext]' } } }, { test: /\.(sa|sc|c)ss$/, use: [ MiniCssExtractPlugin.loader, { loader: 'css-loader', options: { sourceMap: true } }, { loader: 'sass-loader', options: { sourceMap: true } } ] }, { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader' } }, { test: /\.js$/, enforce: 'pre', use: { loader: 'source-map-loader' } } ] } };