Skip to content

Commit b2fdc83

Browse files
committed
Improve README.md
1 parent c323b31 commit b2fdc83

File tree

2 files changed

+208
-88
lines changed

2 files changed

+208
-88
lines changed

.images/step13.png

199 KB
Loading

README.md

+208-88
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
</div>
55
<br />
66
<div align="center">
7-
<a href="https://github.com/lighthousenotes/server">
7+
<a href="https://github.com/lighthousenotes/Docker">
88
<img src=".images/logo.jpg" alt="Logo" width="200" height="200">
99
</a>
1010
</div>
1111
<h2 align="center"> Lighthouse Notes Docker </h2>
1212
<p align="center">
1313
Lighthouse Notes is a source available digital forensics note taking application
1414
<br>
15-
<a href="https://github.com/lighthousenotes/server/issues">Report Bug</a>
15+
<a href="https://github.com/lighthousenotes/Docker/issues">Report Bug</a>
1616
·
17-
<a href="https://github.com/lighthousenotes/server/discussions">Request Feature</a>
17+
<a href="https://github.com/lighthousenotes/Docker/discussions">Request Feature</a>
1818
·
19-
<a href="https://github.com/lighthousenotes/server/discussions"> Get Support </a>
19+
<a href="https://github.com/lighthousenotes/Docker/discussions"> Get Support </a>
2020
</p>
2121

2222
## About
@@ -39,102 +39,159 @@ Lighthouse is a university dissertation project which implements a source availa
3939
**This repository holds a script to generate a docker-compose file, nginx site configurations and a database initialization script**. As well as the instructions for how to deploy Lighthouse notes using docker.
4040

4141
## Prerequisites
42+
4243
- A domain name
43-
- A public facing sever with `Docker`, `Docker Compose`, `Python` and `DotNet SDK` installed on
44+
45+
- A public facing server with the following installed on:
46+
47+
- Docker [Install Docker Engine](https://docs.docker.com/engine/install/)
48+
49+
- Docker Compose [Install Docker Engine](https://docs.docker.com/engine/install/)
50+
51+
- Python
52+
53+
- DotNet SDK - [Install .NET on Linux distributions - .NET | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/core/install/linux) (SDK verison does not matter)
54+
4455
## Getting Started
56+
4557
### Domain
46-
Make sure the following DNS records are created for your domain:
47-
```
48-
api.example.com 1 IN A 1.2.3.4
49-
app.example.com 1 IN A 1.2.3.4
50-
s3.example.com 1 IN A 1.2.3.4
58+
59+
The following DNS records need to be created for your domain name:
60+
61+
```dns-zone-file
62+
api.example.com 1 IN A 1.2.3.4
63+
app.example.com 1 IN A 1.2.3.4
64+
s3.example.com 1 IN A 1.2.3.4
5165
```
52-
(Replace example.com with your own domain and 1.2.3.4 with the ip address of the public facing server).
66+
67+
> [!NOTE]
68+
>
69+
> Replace example.com with your own domain name and 1.2.3.4 with the ip address of the public facing server.
70+
71+
72+
5373
### Synfusion
54-
Register for a Synfusion license [here](https://www.syncfusion.com/sales/communitylicense). Depending on your company size and revenue you may be eligible for a free community license.
74+
75+
Register for a Synfusion license [here](https://www.syncfusion.com/sales/communitylicense).
76+
77+
> [!TIP]
78+
>
79+
> Depending on your company size and revenue you may be eligible for a free community license.
5580
5681
After you have create an account and obtained a license, navigate to https://www.syncfusion.com/account/downloads. Click "Get License Key" and chose the following options:
5782

5883
- Platform - select ASP.NET, ASP.NET Core and Blazor
5984
- Change version to 24.x.x
6085

61-
Click "Get License Key", copy the License Key and when prompted in the gen.py script enter it.
86+
Click "Get License Key", copy the license key and when prompted in the gen.py script enter it.
87+
6288
> [!IMPORTANT]
6389
> The license key will only be shown once!
64-
### Auth0
65-
1. Create an Auth0 account and tenant following the instructions [here](https://auth0.com/docs/get-started/auth0-overview/create-tenants)
90+
91+
### Auth0
92+
93+
1. Create an Auth0 account and tenant following the instructions [here](https://auth0.com/docs/get-started/auth0-overview/create-tenants).
6694

6795
2. Navigate to Dashboard > Applications > APIs and create an API.
68-
![Alt text](.images/step2.png)
69-
1. Navigate to Dashboard > Applications > Applications and create an application. Making sure to select "Regular Web Applications".
70-
![Alt text](.images/step3.png)
96+
![Alt text](.images/step2.png)
97+
98+
> [!NOTE]
99+
>
100+
> Replace example.com with your own domain name.
101+
102+
71103

104+
3. Navigate to Dashboard > Applications > Applications and create an application. Making sure to select "Regular Web Applications".
105+
![Alt text](.images/step3.png)
106+
72107
Configure application Settings as follows
73-
- Set "Application Login URI" to `https://app.example.com/account/login?returnUrl=` (replace example.com with your domain name).
74-
- Set "Allowed Callback URLs to `https://app.example.com/callback` (replace example.com with your domain name).
75-
- Set "Allowed Logout URLS to `https://app.example.com/` (replace example.com with your domain name).
76-
- Enable "Refresh Token Rotation"
77-
- Enable "Inactivity Expiration"..
78-
![Alt text](.images/step3-1.png)
79-
- Change to the "Organizations" section.
80-
![Alt text](.images/step3-2.png)
81-
- Click "Disable Grants Now".
82-
- Change "Types of Users" to "Business Users".
83-
- Change "Login Flow" to "Prompt for Credentials".
84-
![Alt text](.images/step3-3.png)
85-
1. Create another application, this time selecting "Machine to Machine Applications".
86-
![Alt text](.images/step4.png)
87-
88-
1. Navigate to Dashboard > User Management > Roles and create the following roles (case sensitive):
89-
```
90-
user
91-
sio
92-
organization-administrator
93-
```
108+
109+
- Set "Application Login URI" to `https://app.example.com/account/login?returnUrl=`
110+
111+
> [!NOTE]
112+
>
113+
> Replace example.com with your own domain name.
114+
- Set "Allowed Callback URLs to `https://app.example.com/callback`
115+
116+
> [!NOTE]
117+
>
118+
> Replace example.com with your own domain name.
119+
- Set "Allowed Logout URLS to `https://app.example.com/`
120+
121+
> [!NOTE]
122+
>
123+
> Replace example.com with your own domain name.
124+
- Enable "Refresh Token Rotation"
125+
- Enable "Inactivity Expiration".
126+
![Alt text](.images/step3-1.png)
127+
- Change to the "Organizations" section.
128+
![Alt text](.images/step3-2.png)
129+
- Click "Disable Grants Now".
130+
- Change "Types of Users" to "Business Users".
131+
- Change "Login Flow" to "Prompt for Credentials".
132+
![Alt text](.images/step3-3.png)
133+
134+
4. Create another application, this time selecting "Machine to Machine Applications".
135+
![Alt text](.images/step4.png)
94136

137+
5. Navigate to Dashboard > User Management > Roles and create the following roles:
138+
139+
```
140+
user
141+
sio
142+
organization-administrator
143+
```
144+
145+
> [!WARNING]
146+
>
147+
> Role names are case senstive
148+
95149
![Alt text](.images/step5.png)
96150

97-
2. Navigate to Dashboard > User Management > Users and create a user.
98-
![Alt text](.images/step6.png)
99-
1. Navigate to Dashboard > Organizations and create an organization.
100-
![Alt text](.images/step7.png)
151+
6. Navigate to Dashboard > User Management > Users and create a user.
152+
![Alt text](.images/step6.png)
101153

102-
1. Change to the "Connections" panel and enable "Username-Password-Authentication" database connection by clicking "Enable Connections" and then selecting "Username-Password-Authentication" and clicking "Enable Connection".
103-
![Alt text](.images/step8.png)
154+
7. Navigate to Dashboard > Organizations and create an organization.
155+
![Alt text](.images/step7.png)
104156

105-
1. Add the user to the organization by changing to the "Members" tab and clicking "Add Members".
106-
![Alt text](.images/step9.png)
157+
8. Change to the "Connections" panel and enable the "Username-Password-Authentication" database connection by clicking "Enable Connections" and then selecting "Username-Password-Authentication" and clicking "Enable Connection".
158+
![Alt text](.images/step8.png)
107159

108-
1. Click the "..." next to the member you just added and click "Assign Roles".
109-
![Alt text](.images/step10.png)
160+
9. Add the user to the organization by changing to the "Members" tab and clicking "Add Members".
161+
![Alt text](.images/step9.png)
110162

111-
1. Assign all the roles we created in step 5 (user, sio, and organization-administrator).
112-
![Alt text](.images/step11.png)
163+
10. Click the "..." next to the member you just added and click "Assign Roles".
164+
![Alt text](.images/step10.png)
113165

114-
1. Navigate to Dashboard > Applications > APIs > API we created in step 2. Then click the "Machine To Machine Applications" tab and enable "Lighthouse Notes".
166+
11. Assign all the roles we created in step 5 (user, sio, and organization-administrator).
167+
![Alt text](.images/step11.png)
115168

116-
1. Navigate to Dashboard > Actions > Flows > Login. Click the + to add an action and choose Build from scratch".
117-
![Alt text](.images/step13.png)
169+
12. Navigate to Dashboard > Applications > APIs > API we created in step 2. Then click the "Machine To Machine Applications" tab and enable "Lighthouse Notes".
118170

171+
13. Navigate to Dashboard > Actions > Flows > Login. Click the + to add an action and choose Build from scratch".
172+
<img title="" src=".images/step13.png" alt="Alt text" data-align="inline">
119173
- Add the following code inside the `exports.onExecutePostLogin` function:
120-
```javascript
121-
// Id token is the stored by the app
122-
api.idToken.setCustomClaim(`http://schemas.microsoft.com/ws/2008/06/identity/claims/role`, event.authorization.roles);
123-
api.idToken.setCustomClaim(`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`, event.user.email);
124-
125-
// Access token is used to call api
126-
api.accessToken.setCustomClaim(`http://schemas.microsoft.com/ws/2008/06/identity/claims/role`, event.authorization.roles);
127-
```
128-
174+
175+
```javascript
176+
// Id token is the stored by the app
177+
api.idToken.setCustomClaim(`http://schemas.microsoft.com/ws/2008/06/identity/claims/role`, event.authorization.roles);
178+
api.idToken.setCustomClaim(`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`, event.user.email);
179+
180+
// Access token is used to call api
181+
api.accessToken.setCustomClaim(`http://schemas.microsoft.com/ws/2008/06/identity/claims/role`, event.authorization.roles);
182+
```
183+
129184
![Alt text](.images/step13-1.png)
130185

131186
- Click "Deploy" and then click "Add to flow" in the notification.
132187

133188
- Then drag the "Custom Claims" into the flow.
134-
![Alt text](.images/step13-2.png)
189+
![Alt text](.images/step13-2.png)
190+
135191
- Click "Apply".
136192

137193
### Script
194+
138195
1. Clone the Github repository with `git clone https://github.com/LighthouseNotes/Docker.git`.
139196
2. Navigate to the repository with `cd Docker`.
140197
3. Create a virtual environment with `python -m venv env`.
@@ -144,28 +201,91 @@ Click "Get License Key", copy the License Key and when prompted in the gen.py sc
144201
7. Follow the instructions.
145202

146203
### Usage
147-
1. Download Synfusion Blink Libraries by visting https://www.syncfusion.com/account/downloads/studio/licensed/24_1_41, selecting Linux and scrolling down to the "Add-On" section and then clicking the "Download" button next to "HTML Converter for Linux".
204+
205+
1. Download Synfusion Blink Libraries by visting: https://www.syncfusion.com/account/downloads/studio/licensed/24_1_41 , selecting Linux and scrolling down to the "Add-On" section and then clicking the "Download" button next to "HTML Converter for Linux".
206+
148207
2. Unzip the file with `unzip syncfusionessentialhtmlconverter.zip "BlinkBinaries/*" -d "./BlinkBinaries"`
149-
> [!IMPORTANT]
150-
> The BlinkBinaries folder must be in the same directory as the docker-compose.yml file
151-
3. Generate a self signed certificate `dotnet dev-certs https -ep lighthousenotes.pfx -p CHANGME` (replace CHANGEME with the password you specified in the script for the "Certificate Password" prompt).
152-
4. Use the docker compose file `docker compose up -d`.
153-
5. After a few minutes run `mv site-confs/* swag/nginx/site-confs/`.
154-
6. Restart the SWAG container with `docker restart swag`.
155-
7. Navigate to the S3 console by opening the following in a browser `https://s3.example.com:9001` (replace example.com with your own domain name).
156-
8. Login with `minio` as the user and the password you specified in the script at the "Minio root password" prompt.
157-
9. Create a bucket named `lighthouse-notes` and enable "Versioning".
158-
![Alt text](.images/create-bucket.png)
159-
10. Click on the newly created bucket.
160-
11. Click "Lifecycle", then "Add Lifecycle Rule" and set the lifecycle rule as follows:
161-
![Alt text](.images/lifecycle.png)
162-
12. Navigate to the "Access Keys" section in the side menu, and create an access key.
163-
> [!IMPORTANT]
164-
> Store the access key and secret key somewhere temporarily as they are only shown once!
165-
13. Open the application in a private web browser, by visiting app.example.com (replace example.com with your own domain name).
166-
14. Login with the user you created in the Auth0 section.
167-
15. Navigate to organization settings and change the S3 Access Key and Secret Key to ones you created in step 10.
168-
16. Change the Meilisearch API key to the key outputted at the end of the the gen.py script.
169-
17. Click "Save".
170-
18. Click the profile icon in top right and click "Profile" on this page click "Submit", this is to save your user information to Meilisearch so your user is searchable.
171-
19. Close the private browser windows and then use the app as normal in a normal browser window.
208+
209+
> [!IMPORTANT]
210+
> The BlinkBinaries folder must be in the same directory as the docker-compose.yml file
211+
212+
3. Generate a self signed certificate `dotnet dev-certs https -ep lighthousenotes.pfx -p CHANGME`.
213+
214+
> [!NOTE]
215+
>
216+
> Replace CHANGEME with the password you specified in the script for the "Certificate Password" prompt
217+
218+
4. Start SWAG with `docker compose up -d swag`.
219+
220+
5. Once you see `successfully received certificate`and `Server ready` in the swag container logs, move to step 6.
221+
222+
> [!TIP]
223+
>
224+
> Use `docker logs swag` to view the container logs
225+
226+
6. Copy the Nginx site configs with `mv site-confs/* swag/nginx/site-confs/`.
227+
228+
7. Restart the SWAG container with `docker restart swag`.
229+
230+
8. Bring up the rest of the docker containers with `docker compose up -d`.
231+
232+
9. Navigate to the S3 console by opening the following in a browser https://s3.example.com:9001
233+
234+
> [!NOTE]
235+
>
236+
> Replace example.com with your own domain name.
237+
238+
10. Login with `minio` as the user and the password you specified in the script at the "Minio root password" prompt.
239+
240+
11. Create a bucket named `lighthouse-notes` and enable "Versioning".
241+
![Alt text](.images/create-bucket.png)
242+
243+
12. Click on the newly created bucket.
244+
245+
13. Click "Lifecycle", then "Add Lifecycle Rule" and set the lifecycle rule as follows:
246+
![Alt text](.images/lifecycle.png)
247+
248+
- Set "Object Version" to "Non-Current Version"
249+
250+
- Set "After" to 30 days
251+
252+
- Enable "Expire Delete Marker"
253+
254+
> [!IMPORTANT]
255+
>
256+
> Change "After" to the time period you wish to store edits to tabs for. E.g if you want to store edits to a tab for the past 30 days, set it to 30.
257+
258+
14. Navigate to the "Access Keys" section in the side menu, and create an access key.
259+
260+
> [!IMPORTANT]
261+
> Store the access key and secret key somewhere temporarily as they are only shown once
262+
263+
15. Open the application in a private web browser, by visiting [app.example.com](https://app.example.com).
264+
265+
> [!NOTE]
266+
>
267+
> Use a private web browser untill you have set the organization settings, this is because it wil cache the incorrect settings on first load.
268+
269+
---
270+
271+
> [!NOTE]
272+
>
273+
> Replace example.com with your own domain name.
274+
275+
16. Login with the user you created in the [Auth0](#auth0)
276+
277+
17. Navigate to organization settings and change the "S3 Access Key" and "S3 Secret Key" to ones you created in step 10.
278+
279+
18. Change the "Meilisearch API key "to the key outputted at the end of the the gen.py script.
280+
281+
19. Click "Save".
282+
283+
20. Click the profile icon in top right and click "Profile" on this page click "Submit".
284+
285+
> [!NOTE]
286+
>
287+
> This is to save your user information to Meilisearch so your user is searchable.
288+
289+
21. Close the private browser window and then use the app as normal.
290+
291+
22.

0 commit comments

Comments
 (0)