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
<a href="https://github.com/lighthousenotes/server/discussions"> Get Support </a>
19
+
<a href="https://github.com/lighthousenotes/Docker/discussions"> Get Support </a>
20
20
</p>
21
21
22
22
## About
@@ -39,102 +39,159 @@ Lighthouse is a university dissertation project which implements a source availa
39
39
**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.
40
40
41
41
## Prerequisites
42
+
42
43
- 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:
- 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
+
44
55
## Getting Started
56
+
45
57
### 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
51
65
```
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
+
53
73
### 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.
55
80
56
81
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:
57
82
58
83
- Platform - select ASP.NET, ASP.NET Core and Blazor
59
84
- Change version to 24.x.x
60
85
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
+
62
88
> [!IMPORTANT]
63
89
> 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).
66
94
67
95
2. Navigate to Dashboard > Applications > APIs and create an API.
68
-

69
-
1. Navigate to Dashboard > Applications > Applications and create an application. Making sure to select "Regular Web Applications".
70
-

96
+

97
+
98
+
> [!NOTE]
99
+
>
100
+
> Replace example.com with your own domain name.
101
+
102
+
71
103
104
+
3. Navigate to Dashboard > Applications > Applications and create an application. Making sure to select "Regular Web Applications".
105
+

106
+
72
107
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
-

79
-
- Change to the "Organizations" section.
80
-

81
-
- Click "Disable Grants Now".
82
-
- Change "Types of Users" to "Business Users".
83
-
- Change "Login Flow" to "Prompt for Credentials".
84
-

85
-
1. Create another application, this time selecting "Machine to Machine Applications".
86
-

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
+

127
+
- Change to the "Organizations" section.
128
+

129
+
- Click "Disable Grants Now".
130
+
- Change "Types of Users" to "Business Users".
131
+
- Change "Login Flow" to "Prompt for Credentials".
132
+

133
+
134
+
4. Create another application, this time selecting "Machine to Machine Applications".
135
+

94
136
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
+
95
149

96
150
97
-
2. Navigate to Dashboard > User Management > Users and create a user.
98
-

99
-
1. Navigate to Dashboard > Organizations and create an organization.
100
-

151
+
6. Navigate to Dashboard > User Management > Users and create a user.
152
+

101
153
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
-

154
+
7. Navigate to Dashboard > Organizations and create an organization.
155
+

104
156
105
-
1. Add the user to the organization by changing to the "Members" tab and clicking "Add Members".
106
-

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
+

107
159
108
-
1. Click the "..." next to the member you just added and click "Assign Roles".
109
-

160
+
9. Add the user to the organization by changing to the "Members" tab and clicking "Add Members".
161
+

110
162
111
-
1. Assign all the roles we created in step 5 (user, sio, and organization-administrator).
112
-

163
+
10. Click the "..." next to the member you just added and click "Assign Roles".
164
+

113
165
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
+

115
168
116
-
1. Navigate to Dashboard > Actions > Flows > Login. Click the + to add an action and choose Build from scratch".
117
-

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".
118
170
171
+
13. Navigate to Dashboard > Actions > Flows > Login. Click the + to add an action and choose Build from scratch".
- Click "Deploy" and then click "Add to flow" in the notification.
132
187
133
188
- Then drag the "Custom Claims" into the flow.
134
-

189
+

190
+
135
191
- Click "Apply".
136
192
137
193
### Script
194
+
138
195
1. Clone the Github repository with `git clone https://github.com/LighthouseNotes/Docker.git`.
139
196
2. Navigate to the repository with `cd Docker`.
140
197
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
144
201
7. Follow the instructions.
145
202
146
203
### 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
+
148
207
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
-

159
-
10. Click on the newly created bucket.
160
-
11. Click "Lifecycle", then "Add Lifecycle Rule" and set the lifecycle rule as follows:
161
-

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
+

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
+

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.
0 commit comments