You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-2Lines changed: 43 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,32 +2,73 @@
2
2
3
3
Original repo : https://github.com/ABouveron/example-csharp-cryptographic-machine-files
4
4
5
-
# How to run
5
+
# Test official and localhost API
6
+
7
+
The goal of this project is to be able to contact the API while online & offline. The official API can be contacted while online, and the localhost one will be used when you are offline.
8
+
You can only access the dashboard when online.
9
+
10
+
*Not functional on Windows.*
11
+
12
+
**Requirements:**
13
+
- Docker
14
+
- scripts working on Ubuntu (other distributions not tested)
15
+
- filling `install.env` with the credentials you want to use in localhost mode
16
+
- filling `.env`*\*_OFFICIAL* and *\*_LOCALHOST* variables with the appropriate values
17
+
18
+
OFFICIAL values can be found on [keygen.sh](https://app.keygen.sh/settings).
19
+
A token for the API will be generated on the first run. Execute the run.sh script two times to get both tokens: one while having Internet access and one without.
20
+
21
+
**Linux:**
22
+
23
+
```shell
24
+
source install.sh
25
+
```
26
+
27
+
```shell
28
+
source run.sh
29
+
```
30
+
In another terminal:
31
+
```shell
32
+
sudo dotnet run api
33
+
```
34
+
35
+
(You need to run it as root because sending an async ping is limited to root. If not running as root, the official API
36
+
cannot be contacted.)
37
+
38
+
# Run basic offline file verification
39
+
6
40
## Example config:
7
41
8
42
**Linux / Windows:**
43
+
9
44
```shell
10
45
dotnet run examples/license.lic examples/machine.lic 198e9fe586114844f6a4eaca5069b41a7ed43fb5a2df84892b69826d64573e39
11
46
```
12
47
13
48
## Normal config:
14
-
* Your fingerprint should be the hash of the serial number of your machine (you can execute the program to see it) computed with **SHA3_512** ([Online Converter](https://emn178.github.io/online-tools/sha3_512.html)).
49
+
50
+
* Your fingerprint should be the hash of the serial number of your machine (you can execute the program to see it)
51
+
computed with **SHA3_512** ([Online Converter](https://emn178.github.io/online-tools/sha3_512.html)).
15
52
* Replace the public key from [keygen.sh](keygen.sh) line 96 of `Program.cs`.
16
53
* Get your machine file on [keygen.sh](keygen.sh) and put the raw license key in a new file named `license.lic`.
17
54
* Put your `machine.lic` & `license.lic` in the same folder as `Program.cs` and run:
18
55
19
56
**Linux:**
57
+
20
58
```shell
21
59
sudo dotnet run
22
60
```
61
+
23
62
(You need to run it as root because it needs to access `/dev/sda` to get the serial number of your machine.)
0 commit comments