Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Orion/Node/Getting started
Orion provides a minimal, single-user server deployment of Orion written in JavaScript that runs on Node.js. This implementation of Orion supports developing your own Node applications with Orion's editing environment.
Contents
Features
The JavaScript Orion server implementation is still very early access. There are many rough edges and missing features compared to the full Java-based Orion server. The JavaScript-based Orion server currently supports:
- Basic Navigator operations (Create file/folder, delete file/folder, copy/move/rename a file)
- Basic Editor operations (Edit file, save file, ETags)
- Plugin operations (Install/uninstall plugins)
- Gzip on server traffic to reduce download times
- Concatenation and minification of pages (requires a manual step)
Feature comparison
This table compares features between the Java and Node.js servers.
Java | Node | |
---|---|---|
Users | multiple | single or multiple |
Login API (/login) | ✔ | ✔ |
File operations (/file) | ✔ | ✔ |
Import zip/HTTP/SFTP (/import) | ✔ | ✔ |
Export zip/SFTP (/export) | ✔ | ✔ |
Import SFTP (/import) | ✔ | |
Export SFTP (/export) | ✔ | |
Persistent user preferences (/prefs) | ✔ | ✔ |
Git (/gitapi) | ✔ | ✔ |
Deploy to Cloud Foundry (/cfapi) | ✔ | |
Sites (/sites) | ✔ | ✔ |
Long running tasks (/task) | ✔ | ✔ |
User API (/users) | ✔ | † |
† Orion Node server supports these features in multi-user mode only.
Requirements
- Node.js
- A modern web browser.
Getting Orionode and starting it
You can obtain Orionode through npm (the easiest way) or by checking out its source repo and running it. Checking out the source is mainly of interest to developers wishing to work on or extend the Orion node server. For details on this approach see the Orion developer wiki page.
Installing with npm
To install Orion with the Node Package Manager (npm), simply run the following command from the shell:
npm install orion
This will install Orionode into a node_modules
subdirectory of your working directory.
- If you're not interested in developing the Orionode server, add the
--production
flag for a slightly smaller download.
Nodegit Installation
During the installation from NPM, Nodegit will try to find binaries for your installed version of Node.js / operating system. If it has them, they will be downloaded and the installation will complete normally. If however, it does not have a pre-built version ready to go, Nodegit will start up its builder to try and create the binaries it requires. Depending on your operating system and build-time tools you have installed, this will complete normally and everything will work fine. If you are missing build tools that it needs to build its binaries, the install will fail.
If your build / install does fail, please read the Nodegit build page to make sure you have all the expected tools installed and try running npm install orion
again.
Starting and stopping the server
- Launch Orion by running:
npm start orion
- If you need to pass command line arguments to the server, run the server.js file directly:
node node_modules/orion/server.js [arguments]
- If you need to pass command line arguments to the server, run the server.js file directly:
- Go to http://localhost:8081 (or whatever port you provided in the server arguments) in your web browser to start using Orionode.
- Stop the server by sending a kill signal from the console (typically Ctrl+C)
The orion.conf file
You can pass arguments to the server by editing the orion.conf
file. It is found in the directory where you installed Orion (when installing from npm, this is typically node_modules/orion/
). An alternate configuration file can be specified via command line arguments.
Password
Add a line in your orion.conf
file that looks like this:
pwd=mysecretpassword
Workspace
Edit the orion.conf
file and change the workspace
option to point to a directory in your user space. If not specified, a default .workspace
directory will be created in the Orion install directory. For example:
workspace=/home/pi/Workspace/
Using a global installation of Orionode
Installing with npm
To install Orion with the Node Package Manager (npm), simply run the following command from the shell:
npm install -g orion
This will install Orionode as a global package, enabling you to run from any directory.
- If you're not interested in developing the Orionode server, add the
--production
flag for a slightly smaller download. - If you run into permissions problems, you may need to run with sudo, e.g.
sudo npm install -g orion
. (A global installation attempts to install inbin
so that the commandorion
can be run in the shell.)
If your global installation fails because of Nodegit, please read the Nodegit Installation section above.
Starting and stopping the server
- Launch Orion by running:
orion
- There are a few different options for the global installation:
-
orion
: launches Orion on port 8081 using current working directory -
orion <workspaceDir>
: launches Orion on port 8081 using <workspaceDir> -
orion -p <portno>
: launches Orion on <portno> using current working directory -
orion <workspaceDir> -p <portno>
: launches Orion on <portno> using <workspaceDir> -
orion -w <workspaceDir> -p <portno>
: same as above, except order can be switched
-
- The global installation of Orion currently only supports the command line arguments -p and -w. It does not read from the orion.conf file.
- There are a few different options for the global installation:
- Go to http://localhost:8081 (or whatever port you provided in the server arguments) in your web browser to start using Orionode.
- Stop the server by sending a kill signal from the console (typically Ctrl+C)
Server command line arguments
When launching the server manually through node.js (node [orion install dir]/server.js
), a number of optional arguments can be provided:
-
-c
or-config
- Path to an alternate orionode configuration file. Defaults to orion.conf. This is useful to run orionode from git sources without modifying the version controlled orion.conf file in the git working tree.
-
-p
or-port
- The port that the Orion server will listen on. Defaults to 8081.
-
-pwd
or-password
- Path to a file containing a password. If provided, Orionode will enforce HTTP Basic Authentication with the password (the auth 'User' field is ignored -- Orionode only verifies the password). Use caution: if you don't provide a password file, no authentication is used (so anyone can access your Orionode server and read and write your files!).
-
-w
or-workspace
- The target directory for reading and writing files. Will be created if it doesn't exist. Defaults to a subdirectory named
.workspace
in the server directory. This option can also be set in your orion.conf file. -
-dev
- Starts the server in development mode. In this mode, some client-side code is not cached by the browser, to ease development.
-
-log
- Logs each request served to standard output.
Arguments passed on the command line override arguments set in the orion.conf file, when both are provided.
Developing a node.js application
Now in the browser you can start to develop your node.js applications. Orionode uses largely the UI you're accustomed to from Orion. (Refer to Orion user guide for basic instructions).
- Use the Navigator and Edit pages to create and edit your folders and node applications.
- Use the Console page to start, stop and manage your application.
Other ways of using Orionode
You can use Orionode as a file server, to access your local files from http://www.orionhub.org/ (or any other Orion installation). All you need is Orionode and a publicly-accessible URL pointing to your local Orionode server.
- Visit this page on your Orionode server (the hostname will differ from this example) and copy its URL:http://yourOrionNodeServer:8081/plugins/fileClientPlugin.html
- Log in to Orionhub.
- Click the user menu in the top right-hand corner of the page, then click Settings.
- Select the Plugins category, click Install, paste in the URL, click Submit.
- Return to the Navigator page. Your Orionode files should appear as a new filesystem in the left-hand sidebar.
Security Concerns
No security is guaranteed or even implied at this moment. Always run Orionode with the -pwd
flag to prevent unauthorized access to your files.
Known Issues
- See the list of open bugs.