-
Notifications
You must be signed in to change notification settings - Fork 3
Add automated Ubuntu & Proxmox LXC installers for Riven (Docker-based) #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
16629f7
c553786
715555b
53d5420
e1c792c
f145477
6d04766
470938f
d6bedff
af27509
83a1eb8
02866f7
39a4d47
acda2fc
cfe06f8
f08672b
24f4f70
9e6cb5e
18e87dc
442b758
b21c2c9
10808bf
efa8921
334e22f
4aaeb3c
a32a685
6bc6a79
39b9455
a8233a8
fd12c05
2e73616
9ed9403
df2f6e2
26238d1
79fbcb1
87deb50
833f13f
895d33b
f38f411
0b5256f
3a7fdf9
8178487
5e64e8a
c517541
5de0d07
4dcad20
15e0582
53c67db
b71ec72
0739542
ebebd12
036644f
1358025
02340f6
e2ad13c
0b57405
9cce47c
adb0b81
f182126
08617df
f2c6a8e
f2a4fcb
addb915
bf1d1a8
18a96c8
c4f32c2
256dc20
f31d951
9fd5898
ee97341
67823cc
5f3ae75
33823aa
c7b44a7
d35053a
ec8f23d
22aca96
5851218
36f5852
46cf8fc
5b08a87
19f2285
a248d27
88fbc2e
ec5491f
32da6bc
386d48d
578dda4
8ddd4ab
4a3de97
6b053d4
c0a094a
de234ca
89d7a80
d18725e
742a3d4
7197573
fad468c
4865d5f
7cc408f
6f7a7d7
c3d0cda
244dddc
f514614
193bcbf
696605d
38cb7bd
2dea217
c39415a
395e105
4330501
d3ff007
2e4ab18
42f508e
95da4fe
b1f3674
260d3b5
91546fa
dbe720b
2524630
3ab9293
6d7f4f3
19b97bc
9afabfe
fb9dd22
2854313
11e20bf
747ca6f
7b30a96
0e7835f
890681a
67a65b2
c936c22
0aa78e4
fb61906
436922c
7611dd0
434a940
0f619b4
0729193
12da4ca
b3e2c5f
7ea56ad
74296f2
fc06f7e
7c8f7ef
f01d509
5e5b8e8
5532411
731e5b4
7b45b18
9037c1e
63b6ad2
bec7731
0a94986
9326719
e25155d
3692574
9b538b4
48b8128
38c93ae
999d2d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,68 @@ | ||
| ## Riven Distributables | ||
| # Riven Scripts | ||
|
|
||
| This repository contains helper scripts and installers for deploying Riven on | ||
| different platforms (for example, Proxmox VE and Unraid). Each platform has its | ||
| own subdirectory and documentation. | ||
| This repository contains official helper scripts and installers for deploying | ||
| **Riven** on supported platforms. | ||
|
|
||
| Each platform has its own subdirectory with a dedicated installer and | ||
| documentation. | ||
|
|
||
| --- | ||
|
|
||
| ## Quick start: Proxmox VE LXC | ||
| ## Quick Start | ||
|
|
||
| ### Proxmox VE (LXC) | ||
|
|
||
| To create a Debian 12, unprivileged LXC running Riven on a Proxmox VE host, | ||
| run this from the **Proxmox host shell**: | ||
| To create a **Debian 12 unprivileged LXC** configured to run Riven on a | ||
| **Proxmox VE host**, run the following command **from the Proxmox host shell**: | ||
|
|
||
| ```bash | ||
| bash -c "$(wget -qLO - https://raw.githubusercontent.com/rivenmedia/distributables/main/proxmox/riven.sh)" | ||
| bash -c "$(wget -qLO - https://raw.githubusercontent.com/AquaHorizonGaming/Riven-Scripts/main/proxmox/install.sh)" | ||
| ``` | ||
|
Comment on lines
+19
to
20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider security guidance for direct script execution. Both installer commands execute remote scripts directly (with elevated privileges for Ubuntu). While this is a common installation pattern, consider adding security guidance such as:
Example addition to documentation: > **Security Note:** Always review scripts before executing them with elevated privileges.
> You can download and inspect the script first:
> ```bash
> curl -fsSL https://raw.githubusercontent.com/.../install.sh -o install.sh
> # Review install.sh
> sudo bash install.sh
> ```Also applies to: 39-40 🤖 Prompt for AI Agents |
||
|
|
||
| For detailed Proxmox instructions (requirements, configuration, and troubleshooting), | ||
| see: | ||
| This installer handles: | ||
| - LXC creation and configuration | ||
| - Docker + FUSE setup | ||
| - Required mount propagation for Riven | ||
| - Optional GPU passthrough support | ||
|
|
||
| Full Proxmox documentation: | ||
| - [`proxmox/README.md`](proxmox/README.md) | ||
|
|
||
| Additional installers (such as Unraid) will live in their own subdirectories | ||
| with their own README files. | ||
| --- | ||
|
|
||
| ### Ubuntu (Bare Metal / VM) | ||
|
|
||
| To install Riven directly on an **Ubuntu system** (VM or bare metal), | ||
| run the installer below: | ||
|
|
||
| ```bash | ||
| sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/AquaHorizonGaming/Riven-Scripts/main/ubuntu/install.sh)" | ||
| ``` | ||
|
|
||
| This installer handles: | ||
| - System dependency installation | ||
| - Docker and Docker Compose setup | ||
| - Riven service preparation and directory layout | ||
|
|
||
| Full Ubuntu documentation: | ||
| - [`ubuntu/readme.md`](ubuntu/readme.md) | ||
|
|
||
| --- | ||
|
|
||
| ## Repository Structure | ||
|
|
||
| ```text | ||
| Riven-Scripts/ | ||
| ├── proxmox/ # Proxmox VE LXC installer + docs | ||
| ├── ubuntu/ # Ubuntu installer + docs | ||
| └── README.md # This file | ||
| ``` | ||
|
Comment on lines
+54
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Repository structure shows incorrect directory name. The repository structure diagram shows ```text
-Riven-Scripts/
+distributables/
├── proxmox/ # Proxmox VE LXC installer + docs
├── ubuntu/ # Ubuntu installer + docs
└── README.md # This fileIn |
||
|
|
||
| --- | ||
|
|
||
| ## Notes | ||
|
|
||
| - Each platform is self-contained and documented independently | ||
| - Always follow the README inside the platform directory for configuration | ||
| and troubleshooting | ||
| - Additional platforms can be added later using the same structure | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,144 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Function to check if the Docker container is running | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| check_container_status() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker ps | grep -q "riven-db" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ $? -ne 0 ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Error: The 'riven-db' container is not running. Please start the container and try again." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+4
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Container name match is too loose.
🛡️ Proposed fix: use docker inspect or filter check_container_status() {
- docker ps | grep -q "riven-db"
- if [ $? -ne 0 ]; then
+ if ! docker ps --filter "name=^riven-db$" --format '{{.Names}}' | grep -q '^riven-db$'; then
echo "Error: The 'riven-db' container is not running. Please start the container and try again."
exit 1
fi
}🧰 Tools🪛 Shellcheck (0.11.0)[style] 6-6: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. (SC2181) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Function to perform a backup | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backup_database() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| local timestamp=$(date +"%Y-%m-%d_%H-%M-%S") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Apply Shellcheck recommendations for robustness. Several Shellcheck hints apply:
♻️ Example fixes backup_database() {
- local timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
+ local timestamp
+ timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
local backup_file="/tmp/riven_backup_${timestamp}.sql"
echo "Do you want to create a backup of the database before proceeding?"
- read -p "Type 'y' to back up or 'n' to skip: " backup_choice
+ read -rp "Type 'y' to back up or 'n' to skip: " backup_choiceApply check_container_status() {
- docker ps | grep -q "riven-db"
- if [ $? -ne 0 ]; then
+ if ! docker ps | grep -q "riven-db"; thenAlso applies to: 18-18, 41-41, 58-58, 87-87 🧰 Tools🪛 Shellcheck (0.11.0)[warning] 14-14: Declare and assign separately to avoid masking return values. (SC2155) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| local backup_file="/tmp/riven_backup_${timestamp}.sql" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Do you want to create a backup of the database before proceeding?" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| read -p "Type 'y' to back up or 'n' to skip: " backup_choice | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ "$backup_choice" =~ ^[Yy]$ ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Creating a backup of the database..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Use docker exec to dump the database | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker exec riven-db pg_dump -U postgres -d riven -f "$backup_file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ $? -eq 0 ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Backup created successfully: $backup_file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Backup is written inside the container, not on the host.
🐛 Proposed fix: stream the dump to the host- # Use docker exec to dump the database
- docker exec riven-db pg_dump -U postgres -d riven -f "$backup_file"
+ # Stream pg_dump output to host filesystem
+ docker exec riven-db pg_dump -U postgres -d riven > "$backup_file"📝 Committable suggestion
Suggested change
🧰 Tools🪛 Shellcheck (0.11.0)[style] 26-26: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. (SC2181) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Error: Backup failed." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "No backup created. Proceeding with the reset." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Function to fetch and display state items with confirmation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fetch_state_items() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| local state=$1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Do you want to see the items in the '$state' state?" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| read -p "Type 'y' to view them or 'n' to skip: " view_choice | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ "$view_choice" =~ ^[Yy]$ ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Fetching items in the '$state' state..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker exec riven-db psql -U postgres -d riven -c "SELECT id, title, last_state, scraped_times FROM \"MediaItem\" WHERE last_state = '$state';" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Skipping viewing '$state' items." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Function to reset state items (Unknown, Paused, Failed) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reset_state_items() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| local state=$1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "You are about to reset the '$state' items to 'Indexed'." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "This will reset the following attributes:" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - 'scraped_times' to 0" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - 'scraped_at' to NULL" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - 'active_stream' to NULL" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| read -p "Press Enter to confirm or CTRL+C to cancel..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Perform the reset in the database | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Resetting '$state' items..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker exec riven-db psql -U postgres -d riven -c " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BEGIN; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| UPDATE \"MediaItem\" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SET last_state = 'Indexed', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| scraped_at = NULL, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| scraped_times = 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| active_stream = NULL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WHERE last_state = '$state'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COMMIT; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ $? -eq 0 ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "'$state' items successfully reset to 'Indexed'." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Error: Database update failed for '$state'. Rolling back changes." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker exec riven-db psql -U postgres -d riven -c "ROLLBACK;" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+62
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ROLLBACK on failure is ineffective—transaction already ended. The Consider using 🔧 Proposed fix: simplify error handling docker exec riven-db psql -U postgres -d riven -c "
BEGIN;
UPDATE \"MediaItem\"
SET last_state = 'Indexed',
scraped_at = NULL,
scraped_times = 0,
active_stream = NULL
WHERE last_state = '$state';
COMMIT;
"
if [ $? -eq 0 ]; then
echo "'$state' items successfully reset to 'Indexed'."
else
echo "Error: Database update failed for '$state'."
- docker exec riven-db psql -U postgres -d riven -c "ROLLBACK;"
exit 1
fiFor true atomicity with rollback on error, consider using 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Shellcheck (0.11.0)[style] 72-72: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. (SC2181) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Function to ask the user which states they want to reset | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ask_reset_states() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Select which states you want to reset (you can choose multiple states):" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "1) Unknown" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "2) Paused" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "3) Failed" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| read -p "Enter your choices (e.g., '1 3' for Unknown and Failed, '2 3' for Paused and Failed, etc.): " -a choices | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Loop through the choices and perform actions for each selected state | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for choice in "${choices[@]}"; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case $choice in | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fetch_state_items "Unknown" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reset_state_items "Unknown" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fetch_state_items "Paused" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reset_state_items "Paused" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fetch_state_items "Failed" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reset_state_items "Failed" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Invalid choice: $choice. Skipping." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| esac | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Function to display current state counts after reset | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| show_current_counts() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Fetching current counts of MediaItem states..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| indexed_count=$(docker exec riven-db psql -U postgres -d riven -t -c "SELECT count(*) FROM \"MediaItem\" WHERE last_state = 'Indexed';") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paused_count=$(docker exec riven-db psql -U postgres -d riven -t -c "SELECT count(*) FROM \"MediaItem\" WHERE last_state = 'Paused';") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| unknown_count=$(docker exec riven-db psql -U postgres -d riven -t -c "SELECT count(*) FROM \"MediaItem\" WHERE last_state = 'Unknown';") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| failed_count=$(docker exec riven-db psql -U postgres -d riven -t -c "SELECT count(*) FROM \"MediaItem\" WHERE last_state = 'Failed';") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| completed_count=$(docker exec riven-db psql -U postgres -d riven -t -c "SELECT count(*) FROM \"MediaItem\" WHERE last_state = 'Completed';") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Current MediaItem States:" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - Indexed: $indexed_count" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - Paused: $paused_count" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - Unknown: $unknown_count" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - Failed: $failed_count" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - Completed: $completed_count" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+111
to
+127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Counts output includes leading whitespace from psql.
♻️ Proposed fix: trim whitespace- indexed_count=$(docker exec riven-db psql -U postgres -d riven -t -c "SELECT count(*) FROM \"MediaItem\" WHERE last_state = 'Indexed';")
+ indexed_count=$(docker exec riven-db psql -U postgres -d riven -t -c "SELECT count(*) FROM \"MediaItem\" WHERE last_state = 'Indexed';" | tr -d '[:space:]')Apply to all count variables. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Main script execution | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Starting the reset process for MediaItem states..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Step 1: Check if the Docker container is running | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| check_container_status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Step 2: Ask the user if they want to create a backup | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backup_database | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Step 3: Ask the user which states they want to reset (can select multiple) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ask_reset_states | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Step 4: Show the current counts after the reset | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| show_current_counts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Script completed successfully." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: rivenmedia/distributables
Length of output: 476
🏁 Script executed:
Repository: rivenmedia/distributables
Length of output: 1073
🏁 Script executed:
Repository: rivenmedia/distributables
Length of output: 624
🏁 Script executed:
Repository: rivenmedia/distributables
Length of output: 227
Fix inconsistent repository references in installer URLs.
README.md lines 19 and 39 reference
AquaHorizonGaming/Riven-Scripts, but this repository isrivenmedia/distributables. Additionally,ubuntu/readme.mdreferencesAquaHorizonGaming/distributables(different repo name), creating inconsistency across installation documentation.If these are intentional upstream mirrors, clarify and align all references consistently. Otherwise, update URLs to use
rivenmedia/distributablesso users install from the correct repository.🤖 Prompt for AI Agents