2024-12-22_16-33-15Z_Sunday

This commit is contained in:
Ken Fallon 2024-12-22 17:33:15 +01:00
parent 95fc593bf9
commit 0aeaa8f66d

View File

@ -4,7 +4,7 @@ This process involves requesting a slot and verifying that the request is valid.
[`calendar.php`](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/calendar.php) → [`request.php`](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/request.php) → [`request_confirm.php`](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/request_confirm.php) → `email` → [`upload.php`](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/upload.php) → [`upload_confirm.php`](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/upload_confirm.php) → `email`
## Summary
# Summary
- The host has their show recorded and wishes to select a slot.
- They go to https://hackerpublicradio.org/ and select the [⇧Upload⇧](https://hub.hackerpublicradio.org/calendar.php), which executes [calendar.php](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/calendar.php).
@ -14,9 +14,11 @@ This process involves requesting a slot and verifying that the request is valid.
- The host fills in the form which executes [upload_confirm.php](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/upload_confirm.php).
- The host receives a confirmation email.
## Sequence Diagram Requesting a slot
# Sequence Diagram Requesting a slot
### Picking a slot
## Picking a slot
The Host wishes to upload a show and wants to pick a date.
```mermaid
sequenceDiagram
@ -26,35 +28,43 @@ sequenceDiagram
HPR->>HPR: Remove any requests from this IP older than 15min
HPR->>Host: Display Calendar page
```
### Reserving the slot
The website provides a Calendar with a list of available slots.
![The Calendar page](calendar.png)
## Requesting a slot
The Host picks a slot and wants to reserve it.
```mermaid
sequenceDiagram
Host->>HPR: Pick a free slot
Host->>HPR: Request a free slot
Note over HPR: request.php
host->>HPR: Reserve Slot
HPR->>HPR: Remove unverified requests
HPR->>HPR: Check for existing upload from this IP
alt Existing Upload found
HPR->>host: You already made a request for a show
Note over host: 412 Precondition Failed
HPR->>Host: You already made a request for a show
Note over Host: 412 Precondition Failed
end
HPR->>HPR: Create a temporary entry for this host
HPR->>HPR: Create a temporary entry for this Host
Note over HPR: Workflow state REQUEST_UNVERIFIED
HPR->>HPR: Check for excessive uploads
alt Excessive uploads found
HPR->>host: Uploads have temporarily been suspended
Note over host: 412 Precondition Failed
HPR->>Host: Uploads have temporarily been suspended
Note over Host: 412 Precondition Failed
end
HPR->>HPR: Populate the list of posted shows
HPR->>HPR: Validate provided ID
alt Invalid ID found
HPR->>HPR: Log IP to naughty file.
HPR->>host: 412 Precondition Failed
Note over host: 412 Precondition Failed
HPR->>Host: 412 Precondition Failed
Note over Host: 412 Precondition Failed
end
HPR->>HPR: Generate webform of free slots
HPR->>HPR: Populate the list of posted shows
HPR->>host: Webform
host->>HPR: show ID and email
HPR->>Host: Webform
Host->>HPR: show ID and email
loop Preform Checks
alt If check fails
HPR->>HPR: Log Error
@ -64,8 +74,10 @@ sequenceDiagram
email-->>Host: email upload url
end
end
HPR->>Host: Thank You page
```
## Checks in request.php and request_confirm.php
### Checks in request.php and request_confirm.php
| 412 Error Code | Check |
| --- | ------ |
@ -95,6 +107,11 @@ sequenceDiagram
| 434cb53552ce1e2708e74a42f438028c | Problem mapping the date to the episode number |
| c7405e79b54f582e8db46c69ec4b0f24 | Problem writing to the database |
The website provides a "Thank You" page notifying the Host that the email is sent.
![The email confirmation page](request_slot_thank_you.png)
## Sequence Diagram uploading a show
```mermaid
@ -121,7 +138,7 @@ sequenceDiagram
end
```
## Checks in upload.php
### Checks in upload.php
| 412 Error Code | Check |
| --- | ------ |
@ -133,7 +150,7 @@ end
| 066c518314f0d3b1ad3e4af60fcf36ce | Unable to remove temporary lock |
| 5cb513b590ab5859bf7603b79402a5cb | Could not find Host in Database |
## Checks in upload_confirm.php
### Checks in upload_confirm.php
| 412 Error Code | Check |
| --- | ------ |