File | Date | Author | Commit |
---|---|---|---|
natural | 2016-12-09 |
![]() |
[7172be] Added NFileOpen |
node_modules | 2016-12-09 |
![]() |
[7172be] Added NFileOpen |
private | 2016-12-09 |
![]() |
[7172be] Added NFileOpen |
public | 2016-12-09 |
![]() |
[b2c249] Added user screen |
servercore | 2016-12-09 |
![]() |
[7172be] Added NFileOpen |
.gitignore | 2016-08-15 |
![]() |
[82b3e3] Change gitignore |
LICENSE | 2016-11-29 |
![]() |
[5bf543] Added Readme |
README.md | 2016-12-06 |
![]() |
[b09930] Fixed bug in the combobox widget |
index.js | 2016-12-09 |
![]() |
[b2c249] Added user screen |
package.json | 2016-12-01 |
![]() |
[680d55] Now uses serve-favicon instead of link tags |
Note: This program is in development, some features can not be implemented
Node Natural (for differenciating with CNatural, the version written in C)
is a remote web desktop for embed systems written using JavaScript and NodeJS.
It's API provides you a simple way for design remote control apps, you can
have a secure, bidirectional comunication with the server using
socket.io and authentication with JSON tokens. Nothing in the
system uses eval
or the DOM innerHTML
-like functions, it runs using
CSP (Content Security Policy) and multiples users can use the system
at the same time.
natural/config.json
JSON file with a text editor"locale": "es"
replace "es"
with the selected languageFor now, Natural only supports es
for spanish and en
for english.
Go to the file private/pure/locale.js
and copy any of the existing languages
(are inside the JSON-like JavaScript map, identified with it's codename es
or en
)
and edit the inner messages:
var PureLocaleStrings = {
...
...
"my-awesome-lang": {
...
...
"closesession": "My close-session button message"
...
...
}
...
...
};
If your desktop environment is not Pure, edit your DE locale.js
file instead.
You can send the new language as a pull request.
The server needs to run as a superuser, but the connected users will not have
any of the permissions of the server because the server handles each user
in base of it system permissions.
sudo npm start
# or
su root -c "npm start"
When a user tries to connect, the server reads the file /etc/passwd
and
/etc/shadow
(without decrypt them) and if the user exists and the
password matches, generates a unique authentication token.
The token have the form:
SHA256.Crypt(iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiissssseeeeettttttttttttttt)
Where:
i
is a generated user ID.s
and e
are random bytes.t
is a timestamp.One copy of the token it's saved on the server and one copy is sended to
the client. At each request, the client needs to send the token via
socket.io
: if the two tokens matches: the user can made the request.
All of this work it's realized on the server, the client have a pseudocode
like:
global token = ""
function receive_token(socket)
{
socket.on("token", function(tk)
{
token = tk;
});
}
function made_request(socket, request, arguments)
{
socket.emit("client", {
"request": request,
"params": arguments,
"token": global token
});
}
The frontend uses Generation.
The server not have HTTPS activated by default, but you can enable it
with the NodeJS HTTPS
builtin library.
Natural requires new APIs, applications and some other features, if you are
interesed in contributing with Natural, add your feature (or correct something),
made a pull request and add your name in the contributors section of this
file.
Add your name here with after doing a contribution
Node Natural (or Natural, for short) is licensed under the Apache 2.0
license. See the LICENSE file.