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
+27-29Lines changed: 27 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
Repo management for Nethsecurity installations.
4
4
5
5
Something went wrong with some packages? Go straight to
6
-
the [faulty packages section](#list-of-behaviours-in-case-of-distribution-of-faulty-packages). :rocket:
6
+
the [faulty packages section](#list-of-behaviors-when-faulty-packages-get-accidentally-distributed). :rocket:
7
7
8
8
## Application Structure
9
9
@@ -13,8 +13,10 @@ The application is structured as follows:
13
13
-`php`: Main application that handles the logic and dispatches the jobs.
14
14
-`scheduler`: Scheduler that handles cron jobs for the php application.
15
15
-`worker`: Worker that handles the jobs dispatched by the php application.
16
+
-`redis`: Redis instance for cache.
17
+
-`nightwatch-agent`: Agent for nightwatch stats.
16
18
17
-
The storage can be configured to use different disks, however a local shared storage is mandatory due to the `sqlite`
19
+
The storage can be configured to use different disks, however, a local shared storage is mandatory due to the `sqlite`
18
20
database that `php`, `scheduler` and `worker` containers share.
19
21
20
22
## Application Behavior
@@ -24,19 +26,20 @@ Base file request:
24
26
```mermaid
25
27
sequenceDiagram
26
28
client ->> nginx/php: Request file
27
-
database ->> nginx/php: Get repository
29
+
nginx/php ->>database: Get repository
30
+
database ->> nginx/php:
28
31
opt repository not found
29
32
nginx/php ->> client: 404 Not Found
30
33
end
31
-
database ->> nginx/php: Check cache
34
+
nginx/php ->> redis: Check cache
35
+
redis ->> nginx/php:
32
36
alt cache miss
33
37
nginx/php ->> my: Ask for authorization
34
38
my ->> nginx/php:
35
-
alt authorized
36
-
nginx/php ->> database: Save cache
37
-
else not authorized
38
-
nginx/php ->> client: 403 Forbidden
39
-
end
39
+
nginx/php ->> redis: Save authorization status
40
+
end
41
+
opt not authorized
42
+
nginx/php ->> client: 403 Forbidden
40
43
end
41
44
nginx/php ->> filesystem: Check if file exists
42
45
alt file does not exists
@@ -79,7 +82,7 @@ been done with these tools.
79
82
80
83
Copy the `.env.example` file to `.env` and edit the entries as needed.
81
84
82
-
Most of the environment variables are self-explanatory and there's no need to change their defaults unless explicitly
85
+
Most of the environment variables are self-explanatory, and there's no need to change their defaults unless explicitly
83
86
told so.
84
87
However, there are a few that you might want to change:
85
88
@@ -159,7 +162,7 @@ php artisan test
159
162
### Build the production image
160
163
161
164
GitHub Actions takes care of the deployment of the images to the registry, however if you want to build the production
162
-
image yourself follow the instructions below.
165
+
image yourself, follow the instructions below.
163
166
164
167
```bash
165
168
docker buildx bake -f docker-bake.hcl production
@@ -169,19 +172,13 @@ You will find the images tagged as `ghcr.io/nethserver/parceler-*:latest`.
169
172
170
173
## Production
171
174
172
-
The production environment is composed by the following services:
173
-
174
-
-`nginx`: nginx frontend that handles http requests.
175
-
-`php`: php-fpm that runs a Parceler instance.
176
-
-`scheduler`: scheduler dispatcher for worker.
177
-
-`worker`: worker that handles all jobs sent to queues.
178
-
179
-
It's advised to use a reverse proxy to handle the SSL termination and load balancing.
175
+
The same services used for development are used for production, it's advised to use a reverse proxy to handle the SSL
176
+
termination and load balancing.
180
177
181
178
### Parceler Configuration
182
179
183
180
The parceler service is being configured through an environment file, you can find the example in `.env.prod.example`.
184
-
While some of the values are self-explanatory, there are a few that you need to manually set:
181
+
While most values are self-explanatory, there are a few that you need to manually set:
185
182
186
183
-`APP_KEY`: The application key, you can generate one using the development environment
187
184
using `php artisan key:generate --show`.
@@ -190,11 +187,13 @@ While some of the values are self-explanatory, there are a few that you need to
190
187
-`FILESYSTEM_DISK`: Disk to use during production, works same as development, more info in the development setup.
191
188
-`REPOSITORY_MILESTONE_TOKEN`: Token used to trigger from remote the milestone creation, you can set this to a random
192
189
value, it's used to avoid unwanted requests.
190
+
-`NIGHTWATCH_TOKEN`: In case you want to enable nightwatch stats, you need to set this to the token provided by
191
+
nightwatch.
193
192
194
193
### Container Configuration
195
194
196
195
Now that parceler is out the way, there's additional configuration needed for the containers to run properly, here's
197
-
containerspecific configuration:
196
+
container-specific configuration:
198
197
199
198
`nginx` needs variables to wait for the `php` container to be ready before starting, you can set the following:
200
199
@@ -229,16 +228,15 @@ found [in the documentation](https://rclone.org/docs/#config-file).
229
228
### Maintenance mode
230
229
231
230
To avoid any issues with the files served by the service, if you are operating with the files, you can put the service
232
-
in maintenance mode, this will prevent any new requests from being processed and will return a 503 status code. Be aware
233
-
that even crons and queues will stop working, to force queues you
234
-
can [resort to this command](https://laravel.com/docs/11.x/queues#maintenance-mode-queues).
231
+
in maintenance mode. This will prevent any new requests from being processed and will return a 503 status code. Be aware
232
+
that even cron jobs and queues will stop working; to force queues, you can [resort to this command](https://laravel.com/docs/11.x/queues#maintenance-mode-queues).
235
233
To enable maintenance mode, you can use the following command:
236
234
237
235
```bash
238
236
php artisan down
239
237
```
240
238
241
-
To disable maintenance mode, you can use the following command:
239
+
To disable the maintenance mode, you can use the following command:
242
240
243
241
```bash
244
242
php artisan up
@@ -256,14 +254,14 @@ To add a repository, you need to enter to the `php` container and run the follow
256
254
php artisan repository:create
257
255
```
258
256
259
-
The command will guide you through the process of adding a repository, here's the fields that will be asked:
257
+
The command will guide you through the process of adding a repository; here are the fields that will be asked:
260
258
261
-
-`name`: name of the repository, will be used to identify the repository under the
259
+
-`name`: name of the repository will be used to identify the repository under the
0 commit comments