Skip to content

Commit 675306c

Browse files
committed
doc: README.md
1 parent 4fa61b9 commit 675306c

3 files changed

Lines changed: 94 additions & 11 deletions

File tree

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,16 @@ Furthermore, the following executables are included:
6363
creates a tunnel connection from your local machine (Windows, macOS) to a remote Windows device
6464
(which must have the remote desktop feature enabled), then launches a Microsoft Remote Desktop (RDP)
6565
client using that tunnel connection.
66+
- [`remote-login`](WebTunnel/WebTunnelLogin/README.md): This executable obtains an OAuth 2 token from
67+
the macchina.io REMOTE server and stores it locally.
68+
The token can be used by the other client programs to authenticate against the server, without
69+
the user having to enter the credentials each time, until the token expires.
6670

67-
There are also [`WebTunnelAgentLib`](WebTunnel/WebTunnelAgentLib/README.md) and
68-
[`WebTunnelClientLib`](WebTunnel/WebTunnelClientLib/README.md), which provide the functionality of
71+
There are also [`WebTunnelAgentLib`](WebTunnel/WebTunnelAgentLib/README.md) and
72+
[`WebTunnelClientLib`](WebTunnel/WebTunnelClientLib/README.md), which provide the functionality of
6973
`WebTunnelAgent` and `remote-client`, respetively, in a C API, suitable for integration into applications (not written in C++).
7074

71-
The macchina.io REMOTE SDK, like the [POCO C++ Libraries](https://github.com/pocoproject/poco) the SDK is based on,
75+
The macchina.io REMOTE SDK, like the [POCO C++ Libraries](https://github.com/pocoproject/poco) the SDK is based on,
7276
is licensed under the [Boost Software License](https://spdx.org/licenses/BSL-1.0).
7377

7478

@@ -221,7 +225,7 @@ increases their size.
221225
You should run `xxx-yyy-linux-strip` on the resulting executables to reduce their
222226
size before deploying them to the device.
223227

224-
NOTE: See [README_iOS.md](README_iOS.md) for iOS builds
228+
NOTE: See [README_iOS.md](README_iOS.md) for iOS builds
225229
and [README_Android.md](README_Android.md) for Android builds.
226230

227231
### Installing

WebTunnel/WebTunnelClient/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ programs for specific protocols:
3535
`remote-client` usually does not need a configuration file, most parameters can be passed
3636
via command-line arguments. Some settings can be set using a configuration file
3737
(see the `WebTunnelAgent` [documentation](../WebTunnelAgent/README.md#configuration-file-format) for more
38-
information on configuration files). Also, see the [Configuration](#configuration) section below.
38+
information on configuration files). Also, see the [Configuration](#configuration) section below.
3939

40-
At startup, `remote-client` will look for a configuration file `.remote-client.properties`
40+
At startup, `remote-client` will look for a configuration file `.remote-client.properties`
4141
in the current user's home directory, and read it if it's present.
4242

4343
To run `remote-client`, you'll need to specify the URL of the remote device to connect
@@ -102,7 +102,7 @@ or `/help` on Windows) to see a help screen with available command-line options.
102102
In some environments it may be required to connect to the macchina.io REMOTE server
103103
via a HTTP proxy. This can be done by providing the address of the proxy server
104104
on the command-line (`--proxy`, `-P` for short, or `/proxy` on Windows), or by providing the
105-
proxy server and optionally credentials for the proxy server in a configuration file
105+
proxy server and optionally credentials for the proxy server in a configuration file
106106
(see below).
107107

108108
Below is an example for specifying a proxy server on the command-line:
@@ -132,11 +132,12 @@ The following settings can be provided via a configuration file:
132132
- `remote.username`: The username for the macchina.io REMOTE server.
133133
- `remote.password`: The password for the macchina.io REMOTE server.
134134
- `remote.token`: A token (JSON Web Token) for authenticating against the macchina.io REMOTE server.
135-
If a token is given, username and password are not required. NOTE: A token is supported
136-
by `remote-client` only, not any of the other client programs like `remote-ssh`.
135+
If a token is given, username and password are not required. The `remote-login` program
136+
will create a configuration file containing the token, which is read by all
137+
client applications.
137138

138-
Credentials specified in command-line arguments or via environment variables
139-
(`REMOTE_USERNAME`, `REMOTE_PASSWORD`) will override those in a configuration file.
139+
Credentials specified in command-line arguments or via environment variables
140+
(`REMOTE_USERNAME`, `REMOTE_PASSWORD`, `REMOTE_TOKEN`) will override those in a configuration file.
140141

141142
When storing credentials in the configuration file, make sure to keep your configuration
142143
file secure. From a security perspective it's recommended to not store the credentials

WebTunnel/WebTunnelLogin/README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# macchina.io REMOTE Login (remote-login)
2+
3+
`remote-login` is a command-line program that obtains an OAuth 2.0 token (JWT) from
4+
the macchina.io REMOTE server. The program will ask the user for their
5+
username and password (unless these are provided via command-line parameters).
6+
7+
The program then uses the macchina.io REMOTE server API to request a token,
8+
using the given credentials. If the user has two-factor authentication enabled
9+
on the server, the program will also ask for a time-based one-time password (TOTP),
10+
typically provided by an authenticator app like Authy or Google Authenticator.
11+
12+
The received token will then be stored in the file `.remote-credentials.properties`
13+
in the user's home directory. If present, this file will be read by all macchina.io REMOTE
14+
client programs (`remote-client`, `remote-ssh`, etc.) on startup, and the stored
15+
token will be used for authentication against the macchina.io REMOTE server.
16+
17+
The main advantage of `remote-login` over using environment variables or
18+
configuration files to store the credentials is that only the token is
19+
stored on the local machine. The token has a limited validity, typically
20+
24 hours, but depending on the macchina.io REMOTE server configuration.
21+
22+
## Running remote-login
23+
24+
`remote-login` usually does not need a configuration file, any parameters can be passed
25+
via command-line arguments. Some settings can be set using a configuration file
26+
(see the `remote-client` [documentation](../WebTunnelClient/README.md) for more
27+
information on configuration files).
28+
29+
At startup, `remote-login` will look for a configuration file named
30+
`.remote-login.properties` in the current user's home directory, and read it if it's present.
31+
32+
To request a token, run `remote-login` without parameters. The program will ask
33+
for a username and password, and, if two-factor authentication has been enabled for
34+
the user, will also ask for a time-based one-time password.
35+
36+
If no further command-line parameters or configuration files are given, `remote-login`
37+
will use https://remote.macchina.io to obtain the token. To use a different server,
38+
specify the `--reflector-uri` command-line parameter, e.g.:
39+
40+
```
41+
remote-login --reflector-uri=https://remote.company.com
42+
```
43+
44+
Alternatively, you can create a configuration file
45+
(`.remote-login.properties` in the home directory) containing:
46+
47+
```
48+
remote.reflectorURI = https://remote.company.com
49+
```
50+
51+
To check the validity of an existing token, run:
52+
53+
```
54+
remote-login --status
55+
```
56+
57+
To clear the token (and delete the `.remote-credentials.properties` file), run:
58+
59+
```
60+
remote-login --clear
61+
``
62+
63+
## Configuration
64+
65+
### Command-Line Arguments Help
66+
67+
You can run `remote-ssh` without command-line options (or with `--help`
68+
or `/help` on Windows) to see a help screen with available command-line options.
69+
70+
### SSL/TLS Configuration
71+
72+
Please refer to the [`WebTunnelAgent`](../WebTunnelAgent/README.md#ssltls-configuration)
73+
documentation for SSL/TLS configuration settings.
74+
75+
### HTTP Proxy Configuration
76+
77+
Please refer to the [`WebTunnelAgent`](../WebTunnelAgent/README.md#http-configuration)
78+
documentation for configuring a HTTP proxy, including proxy credentials.

0 commit comments

Comments
 (0)