Skip to content

Commit fe8afd9

Browse files
committed
Update instraction after installation path changes
Signed-off-by: Hugues de Valon <[email protected]>
1 parent 0cd2467 commit fe8afd9

File tree

3 files changed

+79
-36
lines changed

3 files changed

+79
-36
lines changed

src/parsec_service/build_run.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ replaced by a subset of the features mentioned above, space or comma separated.
2020
test the TPM or PKCS check the [related
2121
guides](tests#testing-the-tpm-provider-using-the-software-tpm).
2222

23-
For the `DomainSocket` listener, the socket folder needs to be created:
24-
25-
```````
26-
mkdir /tmp/parsec
27-
```````
28-
2923
On a real deployment (as explained in our [installation guide](install_parsec_linux.md)) specific
30-
owners and permissions need to be set up on this folder. Those security settings will be checked by
31-
the clients for them to make sure they are communicating with a trusted Parsec service. For testing
32-
only, it is fine to keep the folder as it is.
24+
owners and permissions need to be set up on multiple folders. Those security settings will be
25+
checked by the clients for them to make sure they are communicating with a trusted Parsec service.
26+
For testing only, it is fine to keep the folder as it is. Make sure however to disable the
27+
`security_check` configuration option in `config.toml`:
28+
29+
```
30+
-#security_checks=true
31+
+security_checks=false
32+
```
3333

3434
To build and run Parsec from source:
3535

src/parsec_service/install_parsec_linux.md

+65-26
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,50 @@ can be a space or comma-separated subset of: `mbed-crypto-provider`, `pkcs11-pro
1212
`tpm-provider`. Choose the providers you want to install depending on what is available on the
1313
platform.
1414

15-
Create the Parsec socket directory.
15+
## From an admin user with privileges
16+
17+
Create the `parsec` user.
18+
19+
```
20+
sudo useradd -m parsec
21+
sudo passwd parsec
22+
```
23+
24+
Create the following Parsec directories, with good permissions.
25+
26+
`/var/lib/parsec` for storing persistent data like the `mappings` folder. The service will run from
27+
here.
1628

1729
```
18-
mkdir /tmp/parsec
30+
sudo mkdir /var/lib/parsec
31+
sudo chown parsec /var/lib/parsec
32+
sudo chmod 700 /var/lib/parsec
1933
```
2034

21-
Create the `parsec-clients` group and set the correct permissions on the socket folder. Mutually
35+
`/etc/parsec` to contain the configuration file.
36+
37+
```
38+
sudo mkdir /etc/parsec
39+
sudo chown parsec /etc/parsec
40+
sudo chmod 700 /etc/parsec
41+
```
42+
43+
`/usr/libexec/parsec` to contain the `parsec` executable binary file.
44+
45+
```
46+
sudo mkdir /usr/libexec/parsec
47+
sudo chown parsec /usr/libexec/parsec
48+
sudo chmod 700 /usr/libexec/parsec
49+
```
50+
51+
`/run/parsec` to contain the socket file. The `parsec-clients` group needs to be created. Mutually
2252
trusted Parsec Clients will need to be in that group.
2353

2454
```
2555
sudo groupadd parsec-clients
26-
sudo chown :parsec-clients /tmp/parsec
27-
sudo chmod 750 /tmp/parsec
56+
sudo mkdir /run/parsec
57+
sudo chown parsec:parsec-clients /run/parsec
58+
sudo chmod 750 /run/parsec
2859
```
2960

3061
For example, adding the imaginary `parsec-client-1` user to the `parsec-clients` group:
@@ -34,32 +65,36 @@ sudo usermod -a -G parsec-clients parsec-client-1
3465
```
3566

3667
Users just added to that group might need to log-out and log-in again to make sure the change apply.
68+
They can also try the `newgrp` command with no parameters to re-initialize their environment.
69+
70+
## From the parsec user
3771

38-
Create and log in to a new user named `parsec`.
72+
Log in to `parsec`.
3973

4074
```
41-
sudo useradd -m parsec
42-
sudo passwd parsec
4375
su --login parsec
4476
```
4577

4678
Depending on which features of Parsec the `parsec` user is going to use, it might need to be given
4779
more privileges in order to access some resources on the system. Refer to the
4880
[Providers](providers.md) page for more information.
4981

50-
In its home directory, pull and install Parsec as a daemon. If a Rust toolchain is not available
51-
widely on the system, it will need to be [installed](https://www.rust-lang.org/tools/install) for
52-
that specific user.
82+
In its home directory, clone and compile Parsec. If a Rust toolchain is not available widely on the
83+
system, it will need to be [installed](https://www.rust-lang.org/tools/install) for that specific
84+
user.
85+
86+
Below is an example with Parsec 0.5.0, update with the version you want!
5387

5488
```
55-
cargo install parsec-service --features $DESIRED_FEATURES
89+
git clone --branch 0.5.0 https://github.com/parallaxsecond/parsec
90+
cargo build --manifest-path parsec --features $DESIRED_FEATURES --release
91+
cp parsec/target/release/parsec /usr/libexec/parsec
5692
```
5793

58-
Copy and adapt the [configuration](configuration.md) you want to use. For a secure deployment, make
59-
sure to activate the `log_error_details` option and to use a `trace` log level.
94+
Copy and adapt the [configuration](configuration.md) you want to use.
6095

6196
```
62-
cp parsec/config.toml config.toml
97+
cp parsec/config.toml /etc/parsec/config.toml
6398
```
6499

65100
Install the systemd unit files and activate the Parsec socket.
@@ -71,27 +106,31 @@ systemctl --user enable parsec
71106
systemctl --user start parsec
72107
```
73108

74-
`parsec-clients` users can now use Parsec! You can test it (having logged in a `parsec-clients`
75-
user) going inside the `parsec/e2e_tests` directory and:
109+
Check the Parsec logs with:
76110

77111
```
78-
cargo test normal_tests
112+
journalclt --user -u parsec
79113
```
80114

81-
*Note:* if you encounter a "Permission Denied" error while executing the end-to-end tests, make sure
82-
that the group change has taken effect. You can check it by calling `groups` with no arguments. If
83-
you do not see `parsec-clients`, please try logging the user out and in again to apply the change.
84-
85-
Check the Parsec logs with:
115+
Also reload the service with:
86116

87117
```
88-
journalclt --user -u parsec
118+
systemctl --user kill -s HUP parsec
89119
```
90120

91-
Reload the service:
121+
## From a parsec-clients user
122+
123+
`parsec-clients` users can now use Parsec! You can test it (having logged in a `parsec-clients`
124+
user) by installing the [`parsec-tool`](https://github.com/parallaxsecond/parsec-tool):
92125

93126
```
94-
systemctl --user kill -s HUP parsec
127+
$ parsec-tool ping
128+
[INFO] Pinging Parsec service...
129+
[SUCCESS] Service wire protocol version is 1.0.
95130
```
96131

132+
*Note:* if you encounter a "Permission Denied" error while executing the end-to-end tests, make sure
133+
that the group change has taken effect. You can check it by calling `groups` with no arguments. If
134+
you do not see `parsec-clients`, please try logging the user out and in again to apply the change.
135+
97136
*Copyright 2019 Contributors to the Parsec project.*

src/parsec_service/listeners.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
This listener communicates with its client using a [Unix domain
66
socket](https://en.wikipedia.org/wiki/Unix_domain_socket).
77

8-
The socket path is: `/tmp/parsec/parsec.sock`.
8+
The socket path is: `/run/parsec/parsec.sock`.
9+
10+
The `socket_path` option can be used to modify the socket path, for example for testing. Clients
11+
will expect the socket to be at the default path and hence this option should not be modified for
12+
deployment.
913

1014
*Copyright 2020 Contributors to the Parsec project.*

0 commit comments

Comments
 (0)