Merge branch 'community-unscripted:main' into swarmUI

This commit is contained in:
BillyOutlast
2026-03-08 13:25:35 -04:00
committed by GitHub
13 changed files with 1388 additions and 21 deletions
+135
View File
@@ -0,0 +1,135 @@
name: Migration to ProxmoxVE
description: Request migration of a script from ProxmoxVED to ProxmoxVE
title: '<script-name>'
labels: ['Migration To ProxmoxVE']
assignees: []
body:
- type: markdown
attributes:
value: |
## Migration Request
This form creates a request to migrate a script from ProxmoxVED (development) to ProxmoxVE (main repository).
The workflow will automatically:
1. Copy script files to ProxmoxVE
2. Update repository URLs
3. Create a pull request for review
4. Link the PR to this issue
- type: input
id: script_name
attributes:
label: Script Name
description: |
The name of the script to migrate (lowercase, no spaces).
This should match the filename without extension.
Example: `pihole`, `ubuntu-vm`, `filebrowser`
placeholder: 'e.g., pihole'
validations:
required: true
- type: dropdown
id: script_type
attributes:
label: Script Type
description: |
Select the type of script being migrated.
This determines which files will be copied.
options:
- CT (LXC Container)
- VM (Virtual Machine)
- Addon (tools/addon)
- PVE Tool (tools/pve)
validations:
required: true
- type: checkboxes
id: required_files_ct
attributes:
label: Required Files (CT Scripts)
description: |
For CT (LXC Container) scripts, verify these files exist:
options:
- label: '`ct/<name>.sh` exists'
- label: '`install/<name>-install.sh` exists'
- label: '`frontend/public/json/<name>.json` exists (or alpine fallback)'
- label: '`ct/headers/<name>` exists (if applicable)'
- type: checkboxes
id: required_files_vm
attributes:
label: Required Files (VM Scripts)
description: |
For VM (Virtual Machine) scripts, verify these files exist:
options:
- label: '`vm/<name>-vm.sh` exists'
- label: '`vm/headers/<name>-vm` exists (if applicable)'
- label: '`frontend/public/json/<name>.json` exists (optional)'
- type: checkboxes
id: required_files_addon
attributes:
label: Required Files (Addon Scripts)
description: |
For Addon scripts, verify these files exist:
options:
- label: '`tools/addon/<name>.sh` exists'
- label: '`tools/headers/<name>` exists (if applicable)'
- label: '`frontend/public/json/<name>.json` exists (optional)'
- type: checkboxes
id: required_files_pve
attributes:
label: Required Files (PVE Tool Scripts)
description: |
For PVE Tool scripts, verify these files exist:
options:
- label: '`tools/pve/<name>.sh` exists'
- label: '`tools/headers/<name>` exists (if applicable)'
- type: checkboxes
id: testing_checklist
attributes:
label: Testing Checklist
description: Verify the script has been tested before migration
options:
- label: 'Script has been tested in ProxmoxVED'
- label: 'Update script function works correctly (if applicable)'
- label: 'No critical bugs or issues pending'
- label: 'Documentation is up to date'
- type: textarea
id: additional_notes
attributes:
label: Additional Notes
description: |
Any additional information about the migration (breaking changes,
special requirements, dependencies, etc.)
placeholder: 'e.g., Requires new dependencies, has breaking changes from previous version...'
- type: checkboxes
id: final_checklist
attributes:
label: Final Checklist
description: Confirm before submitting
options:
- label: 'I have verified all required files exist in ProxmoxVED'
- label: 'I have tested the script and it works correctly'
- label: 'The script name matches the filename (lowercase, no spaces)'
- label: 'I have selected the correct script type'
- type: markdown
attributes:
value: |
---
**What happens next?**
1. Add the `Migration To ProxmoxVE` label to this issue
2. The workflow will automatically process the migration
3. A pull request will be created in ProxmoxVE
4. The PR link will be added as a comment here
5. The label will be updated to `Started Migration To ProxmoxVE`
If the workflow fails, check the [Migration Workflow Documentation](../docs/contribution/MIGRATION_WORKFLOW.md) for troubleshooting.
+2 -2
View File
@@ -25,7 +25,7 @@ concurrency:
jobs:
build:
if: github.repository == 'community-scripts/ProxmoxVED'
if: github.repository == 'community-unscripted/ProxmoxVED'
runs-on: ubuntu-latest
defaults:
run:
@@ -64,7 +64,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main' && github.repository == 'community-scripts/ProxmoxVED'
if: github.ref == 'refs/heads/main' && github.repository == 'community-unscripted/ProxmoxVED'
permissions:
pages: write
id-token: write
+21 -17
View File
@@ -14,7 +14,7 @@ permissions:
jobs:
move-to-main-repo:
runs-on: ubuntu-latest
if: github.event.label.name == 'Migration To ProxmoxVE' && github.repository == 'community-scripts/ProxmoxVED'
if: (github.event_name == 'workflow_dispatch' || github.event.label.name == 'Migration To ProxmoxVE') && github.repository == 'community-unscripted/ProxmoxVED'
steps:
- name: Generate a token
id: app-token
@@ -22,7 +22,7 @@ jobs:
with:
app-id: ${{ vars.PUSH_MAIN_APP_ID }}
private-key: ${{ secrets.PUSH_MAIN_APP_SECRET }}
owner: community-scripts
owner: community-unscripted
repositories: |
ProxmoxVE
ProxmoxVED
@@ -31,8 +31,8 @@ jobs:
uses: actions/checkout@v4
with:
ref: main
repository: community-scripts/ProxmoxVED
token: ${{ secrets.GH_MERGE_PAT }}
repository: community-unscripted/ProxmoxVED
token: ${{ steps.app-token.outputs.token }}
- name: List Issues and Extract Script Type
id: list_issues
@@ -192,7 +192,7 @@ jobs:
script_type="${{ steps.list_issues.outputs.script_type }}"
json_fallback="${{ steps.check_files.outputs.json_fallback }}"
git clone https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/community-scripts/ProxmoxVE.git ProxmoxVE
git clone https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/community-unscripted/ProxmoxVE.git ProxmoxVE
cd ProxmoxVE
# Check if branch already exists remotely and delete it
@@ -235,18 +235,18 @@ jobs:
fi
# Update URLs in ct script
sed -i "s|https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func|https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func|" ct/${script_name}.sh
sed -i "s|https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func|https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func|" ct/${script_name}.sh
sed -i "s|community-scripts/ProxmoxVED|community-scripts/ProxmoxVE|g" ct/${script_name}.sh
sed -i "s|community-scripts/ProxmoxVED|community-scripts/ProxmoxVE|g" install/${script_name}-install.sh
sed -i "s|https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func|https://raw.githubusercontent.com/community-unscripted/ProxmoxVE/main/misc/build.func|" ct/${script_name}.sh
sed -i "s|https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func|https://raw.githubusercontent.com/community-unscripted/ProxmoxVE/main/misc/build.func|" ct/${script_name}.sh
sed -i "s|community-scripts/ProxmoxVED|community-unscripted/ProxmoxVE|g" ct/${script_name}.sh
sed -i "s|community-scripts/ProxmoxVED|community-unscripted/ProxmoxVE|g" install/${script_name}-install.sh
;;
vm)
cp ../vm/${script_name}.sh vm/
cp ../frontend/public/json/${script_name}.json frontend/public/json/ 2>/dev/null || true
# Update URLs in vm script
sed -i "s|https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func|https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func|" vm/${script_name}.sh
sed -i "s|community-scripts/ProxmoxVED|community-scripts/ProxmoxVE|g" vm/${script_name}.sh
sed -i "s|https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func|https://raw.githubusercontent.com/community-unscripted/ProxmoxVE/main/misc/build.func|" vm/${script_name}.sh
sed -i "s|community-scripts/ProxmoxVED|community-unscripted/ProxmoxVE|g" vm/${script_name}.sh
;;
addon)
mkdir -p tools/addon
@@ -254,14 +254,14 @@ jobs:
cp ../frontend/public/json/${script_name}.json frontend/public/json/ 2>/dev/null || true
# Update URLs in addon script
sed -i "s|community-scripts/ProxmoxVED|community-scripts/ProxmoxVE|g" tools/addon/${script_name}.sh
sed -i "s|community-scripts/ProxmoxVED|community-unscripted/ProxmoxVE|g" tools/addon/${script_name}.sh
;;
pve)
mkdir -p tools/pve
cp ../tools/pve/${script_name}.sh tools/pve/
# Update URLs in pve script
sed -i "s|community-scripts/ProxmoxVED|community-scripts/ProxmoxVE|g" tools/pve/${script_name}.sh
sed -i "s|community-scripts/ProxmoxVED|community-unscripted/ProxmoxVE|g" tools/pve/${script_name}.sh
;;
esac
@@ -286,12 +286,12 @@ jobs:
script_name="${{ steps.list_issues.outputs.script_name }}"
script_type="${{ steps.list_issues.outputs.script_type }}"
gh pr create \
--repo community-scripts/ProxmoxVE \
--repo community-unscripted/ProxmoxVE \
--head "$branch_name" \
--base main \
--title "${script_name}" \
--body "Automated migration of **${script_name}** (type: ${script_type}) from ProxmoxVED to ProxmoxVE."
PR_NUMBER=$(gh pr list --repo community-scripts/ProxmoxVE --head "$branch_name" --json number --jq '.[].number')
PR_NUMBER=$(gh pr list --repo community-unscripted/ProxmoxVE --head "$branch_name" --json number --jq '.[].number')
echo "PR_NUMBER=$PR_NUMBER"
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
@@ -300,5 +300,9 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh issue comment ${{ steps.list_issues.outputs.issue_nr }} --body "A PR has been created for ${{ steps.list_issues.outputs.script_name }}: community-scripts/ProxmoxVE#${{ steps.create_pull_request.outputs.pr_number }}"
gh issue edit ${{ steps.list_issues.outputs.issue_nr }} --remove-label "Migration To ProxmoxVE" --add-label "Started Migration To ProxmoxVE"
gh issue comment ${{ steps.list_issues.outputs.issue_nr }} --body "A PR has been created for ${{ steps.list_issues.outputs.script_name }}: community-unscripted/ProxmoxVE#${{ steps.create_pull_request.outputs.pr_number }}"
# Remove the migration label (ignore error if label doesn't exist)
gh issue edit ${{ steps.list_issues.outputs.issue_nr }} --remove-label "Migration To ProxmoxVE" || true
# Add the started label (create it if it doesn't exist)
gh label create "Started Migration To ProxmoxVE" --description "Migration to ProxmoxVE has been started" --color "0E8A16" 2>/dev/null || true
gh issue edit ${{ steps.list_issues.outputs.issue_nr }} --add-label "Started Migration To ProxmoxVE" || true
+6
View File
@@ -0,0 +1,6 @@
__ ________ ____ __ __ __
/ |/ / ____/ / __ \/ / / /_ __/ /_
/ /|_/ / / / /_/ / /_/ / / / / __ \
/ / / / /___ / ____/ __ / /_/ / /_/ /
/_/ /_/\____/ /_/ /_/ /_/\__,_/_.___/
+56
View File
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-unscripted/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: BillyOutlast
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://github.com/samanhappy/mcphub | Docs: https://docs.mcphubx.com/
APP="MCPHub"
var_tags="${var_tags:-ai;automation;tooling}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /etc/systemd/system/mcphub.service ]]; then
msg_error "No ${APP} Installation Found!"
exit 1
fi
if check_for_gh_release "mcphub" "samanhappy/mcphub"; then
msg_info "Stopping Service"
systemctl stop mcphub
msg_ok "Stopped Service"
msg_info "Updating MCPHub"
$STD npm update -g @samanhappy/mcphub
msg_ok "Updated MCPHub"
msg_info "Starting Service"
systemctl start mcphub
msg_ok "Started Service"
exit
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
+2 -1
View File
@@ -40,8 +40,9 @@ function update_script() {
RUST_TOOLCHAIN=$TOOLCHAIN setup_rust
msg_info "Updating OxiCloud"
PG_DB_PASS="$(sed -n '/Password:/s/[^:]*:[[:space:]]//p' ~/oxicloud.creds)"
cd /opt/oxicloud
export DATABASE_URL="postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost/${PG_DB_NAME}"
export DATABASE_URL="postgres://oxicloud:${PG_DB_PASS}@localhost/oxicloud"
$STD cargo build --release
mv target/release/oxicloud /usr/bin/oxicloud && chmod +x /usr/bin/oxicloud
msg_ok "Updated OxiCloud"
+3
View File
@@ -12,6 +12,9 @@ Complete guide to all ProxmoxVED documentation - quickly find what you need.
→ Start with: [contribution/README.md](contribution/README.md)
→ Then: [ct/DETAILED_GUIDE.md](ct/DETAILED_GUIDE.md) + [install/DETAILED_GUIDE.md](install/DETAILED_GUIDE.md)
**Migrate a script to main repository**
→ Read: [contribution/MIGRATION_WORKFLOW.md](contribution/MIGRATION_WORKFLOW.md)
**Understand the architecture**
→ Read: [TECHNICAL_REFERENCE.md](TECHNICAL_REFERENCE.md)
→ Then: [misc/README.md](misc/README.md)
+598
View File
@@ -0,0 +1,598 @@
# Migration Workflow Documentation
> **Automated Script Migration from ProxmoxVED to ProxmoxVE**
>
> *This document explains how the GitHub Actions workflow automates script migration*
---
## Table of Contents
1. [Overview](#overview)
2. [Creating a Migration Issue](#creating-a-migration-issue)
3. [Workflow File](#workflow-file)
4. [Prerequisites](#prerequisites)
5. [How It Works](#how-it-works)
6. [Workflow Steps](#workflow-steps)
7. [GitHub App Setup](#github-app-setup)
8. [Troubleshooting](#troubleshooting)
---
## Overview
The `move-to-main-repo.yaml` workflow automates the process of migrating scripts from the development repository (`ProxmoxVED`) to the main repository (`ProxmoxVE`). When a script is ready for production, maintainers can trigger this workflow to:
1. Copy script files from ProxmoxVED to ProxmoxVE
2. Update repository URLs in the scripts
3. Create a pull request in ProxmoxVE for review
4. Update the issue status automatically
---
## Creating a Migration Issue
To trigger the migration workflow, you need to create an issue with specific formatting.
### Issue Title Format
The issue title should be the **script name** (lowercase, no spaces):
```
<script-name>
```
**Examples**:
- `pihole` - for PiHole container script
- `ubuntu-vm` - for Ubuntu VM script
- `filebrowser` - for Filebrowser addon
- `netdata` - for Netdata addon
### Issue Body Format
The issue body must contain the **script type** in one of these formats:
| Script Type | Required Text in Body |
|-------------|------------------------|
| CT (LXC Container) | `CT (LXC Container)` |
| VM (Virtual Machine) | `VM (Virtual Machine)` |
| Addon (tools/addon) | `Addon (tools/addon)` |
| PVE Tool (tools/pve) | `PVE Tool (tools/pve)` |
### Required Label
Add the label: **`Migration To ProxmoxVE`**
### Complete Issue Template
```markdown
---
name: Migration Request
about: Request migration of a script to ProxmoxVE
title: '<script-name>'
labels: ['Migration To ProxmoxVE']
assignees: ''
---
## Script Information
**Script Name:** <script-name>
**Script Type:**
- [ ] CT (LXC Container)
- [ ] VM (Virtual Machine)
- [ ] Addon (tools/addon)
- [ ] PVE Tool (tools/pve)
## Checklist
- [ ] Script exists in ProxmoxVED repository
- [ ] Script has been tested
- [ ] All required files are present:
- For CT: `ct/<name>.sh`, `install/<name>-install.sh`, `frontend/public/json/<name>.json`
- For VM: `vm/<name>-vm.sh`
- For Addon: `tools/addon/<name>.sh`
- For PVE Tool: `tools/pve/<name>.sh`
## Additional Notes
<Any additional information about the migration>
```
### Example Issues
#### Container Script Migration
```markdown
**Script Name:** pihole
**Script Type:**
- [x] CT (LXC Container)
**Checklist:**
- [x] Script exists in ProxmoxVED repository
- [x] Script has been tested
- [x] All required files are present
```
#### VM Script Migration
```markdown
**Script Name:** ubuntu-vm
**Script Type:**
- [x] VM (Virtual Machine)
**Checklist:**
- [x] Script exists in ProxmoxVED repository
- [x] Script has been tested
```
#### Addon Migration
```markdown
**Script Name:** filebrowser
**Script Type:**
- [x] Addon (tools/addon)
**Checklist:**
- [x] Script exists in ProxmoxVED repository
- [x] Script has been tested
```
### How the Workflow Extracts Information
1. **Script Name**: Extracted from the issue title
- Converted to lowercase
- Spaces removed
- Example: `My App``myapp`
2. **Script Type**: Detected by searching the issue body for specific patterns:
```bash
# Detection patterns (case-insensitive)
"CT (LXC Container)" → script_type="ct"
"VM (Virtual Machine)" → script_type="vm"
"Addon (tools/addon)" → script_type="addon"
"PVE Tool (tools/pve)" → script_type="pve"
```
3. **Fallback Detection**: If no type is found in the body, the workflow checks if the script name contains `-vm`:
```bash
# Fallback
if [[ "$script_name" == *"-vm"* ]]; then
script_type="vm"
else
script_type="ct" # Default to container
fi
```
### Required Labels
The workflow uses two labels:
| Label | Purpose | Color |
|-------|---------|-------|
| `Migration To ProxmoxVE` | Triggers the workflow | Any color |
| `Started Migration To ProxmoxVE` | Marks migration in progress | Green (#0E8A16) |
**Note**: The `Started Migration To ProxmoxVE` label is automatically created by the workflow if it doesn't exist.
### Triggering the Workflow
After creating the issue:
1. **Automatic Trigger**: Add the `Migration To ProxmoxVE` label
- The workflow will automatically start
- It will find the issue with this label and process it
2. **Manual Trigger**: Go to Actions → "Move new Scripts to Main Repository" → Run workflow
- Requires an issue with the label to exist
---
## Overview
The `move-to-main-repo.yaml` workflow automates the process of migrating scripts from the development repository (`ProxmoxVED`) to the main repository (`ProxmoxVE`). When a script is ready for production, maintainers can trigger this workflow to:
1. Copy script files from ProxmoxVED to ProxmoxVE
2. Update repository URLs in the scripts
3. Create a pull request in ProxmoxVE for review
4. Update the issue status automatically
---
## Workflow File
**Location**: `.github/workflows/move-to-main-repo.yaml`
**Triggers**:
- `workflow_dispatch` - Manual trigger via GitHub UI or API
- `issues` with `labeled` event - Automatically when the "Migration To ProxmoxVE" label is added
**Permissions Required**:
```yaml
permissions:
contents: write # Push commits to repositories
issues: write # Comment on and modify issues
pull-requests: write # Create pull requests
```
---
## Prerequisites
### GitHub App Configuration
The workflow requires a GitHub App with the following setup:
| Requirement | Description |
|-------------|-------------|
| **App ID** | Stored as repository variable `PUSH_MAIN_APP_ID` |
| **Private Key** | Stored as repository secret `PUSH_MAIN_APP_SECRET` |
| **Installation** | App must be installed on both `ProxmoxVE` and `ProxmoxVED` repositories |
| **Permissions** | Contents (read/write), Issues (read/write), Pull requests (read/write) |
### Repository Variables
| Variable Name | Description | Example |
|---------------|-------------|---------|
| `PUSH_MAIN_APP_ID` | The numeric App ID from GitHub App settings | `3040335` |
### Repository Secrets
| Secret Name | Description |
|-------------|-------------|
| `PUSH_MAIN_APP_SECRET` | The private key (.pem file content) from the GitHub App |
---
## How It Works
### Trigger Flow
```
┌─────────────────────────────────────────────────────────────┐
│ Issue labeled with "Migration To ProxmoxVE" │
│ OR Manual workflow dispatch │
└────────────────────────┬────────────────────────────────────┘
v
┌─────────────────────────────────────────────────────────────┐
│ Workflow checks: │
│ - Repository is community-unscripted/ProxmoxVED │
│ - Label is "Migration To ProxmoxVE" (if issue trigger) │
└────────────────────────┬────────────────────────────────────┘
v
┌─────────────────────────────────────────────────────────────┐
│ Generate GitHub App Token │
│ - Authenticates as GitHub App │
│ - Creates token for both repositories │
└────────────────────────┬────────────────────────────────────┘
v
┌─────────────────────────────────────────────────────────────┐
│ Checkout ProxmoxVED (source repository) │
│ - Clones the development repository │
│ - Uses App token for authentication │
└────────────────────────┬────────────────────────────────────┘
v
┌─────────────────────────────────────────────────────────────┐
│ Extract Script Information from Issue │
│ - Finds issue with "Migration To ProxmoxVE" label │
│ - Extracts script name, type (ct/vm/addon/pve) │
└────────────────────────┬────────────────────────────────────┘
v
┌─────────────────────────────────────────────────────────────┐
│ Validate Required Files Exist │
│ - Checks for .sh files, install scripts, JSON metadata │
│ - Fails with comment if files missing │
└────────────────────────┬────────────────────────────────────┘
v
┌─────────────────────────────────────────────────────────────┐
│ Clone ProxmoxVE and Copy Files │
│ - Creates new branch in ProxmoxVE │
│ - Copies script files from ProxmoxVED │
│ - Updates repository URLs in scripts │
└────────────────────────┬────────────────────────────────────┘
v
┌─────────────────────────────────────────────────────────────┐
│ Create Pull Request in ProxmoxVE │
│ - Pushes branch to ProxmoxVE │
│ - Creates PR with migration details │
│ - Comments on original issue with PR link │
│ - Updates issue label to "Started Migration To ProxmoxVE" │
└─────────────────────────────────────────────────────────────┘
```
---
## Workflow Steps
### Step 1: Generate GitHub App Token
```yaml
- name: Generate a token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.PUSH_MAIN_APP_ID }}
private-key: ${{ secrets.PUSH_MAIN_APP_SECRET }}
owner: community-unscripted
repositories: |
ProxmoxVE
ProxmoxVED
```
**Purpose**: Creates an authentication token that can access both repositories.
**Outputs**:
- `token` - GitHub token for API and git operations
- `app-slug` - Used to construct bot identity for commits
### Step 2: Checkout Source Repository
```yaml
- name: Checkout ProxmoxVED (Source Repo)
uses: actions/checkout@v4
with:
ref: main
repository: community-unscripted/ProxmoxVED
token: ${{ steps.app-token.outputs.token }}
```
**Purpose**: Clones the development repository to access script files.
### Step 3: Extract Script Information
```yaml
- name: List Issues and Extract Script Type
id: list_issues
env:
GH_TOKEN: ${{ github.token }}
run: |
# Finds issue with "Migration To ProxmoxVE" label
# Extracts: script_name, issue_nr, script_type
```
**Purpose**: Determines which script to migrate and its type.
**Script Types**:
| Type | Directory | Required Files |
|------|-----------|----------------|
| `ct` | `ct/` | `<name>.sh`, `install/<name>-install.sh`, `frontend/public/json/<name>.json` |
| `vm` | `vm/` | `<name>-vm.sh`, `frontend/public/json/<name>.json` (optional) |
| `addon` | `tools/addon/` | `<name>.sh`, `frontend/public/json/<name>.json` (optional) |
| `pve` | `tools/pve/` | `<name>.sh` |
### Step 4: Validate Files
```yaml
- name: Check if script files exist
id: check_files
run: |
# Validates all required files exist
# Sets output: files_found, missing, json_fallback
```
**Purpose**: Ensures all necessary files are present before migration.
### Step 5: Configure Git Identity
```yaml
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Configure Git User
run: |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
```
**Purpose**: Sets up git identity for commits as the GitHub App bot.
### Step 6: Clone Target and Copy Files
```yaml
- name: Clone ProxmoxVE and Copy Files
run: |
# Clone ProxmoxVE
git clone https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/community-unscripted/ProxmoxVE.git ProxmoxVE
cd ProxmoxVE
# Create branch
git checkout -b "$branch_name"
# Copy files based on script type
# Update repository URLs
# Commit changes
```
**URL Updates Applied**:
```bash
# Old URLs (ProxmoxVED)
https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func
https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func
# New URLs (ProxmoxVE)
https://raw.githubusercontent.com/community-unscripted/ProxmoxVE/main/misc/build.func
```
### Step 7: Create Pull Request
```yaml
- name: Create Pull Request in ProxmoxVE
id: create_pull_request
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
gh pr create \
--repo community-unscripted/ProxmoxVE \
--head "$branch_name" \
--base main \
--title "${script_name}" \
--body "Automated migration of **${script_name}** (type: ${script_type}) from ProxmoxVED to ProxmoxVE."
```
**Purpose**: Creates a PR in the main repository for review.
### Step 8: Update Issue
```yaml
- name: Comment on Issue
if: steps.create_pull_request.outputs.pr_number
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh issue comment ${{ steps.list_issues.outputs.issue_nr }} --body "A PR has been created for ${{ steps.list_issues.outputs.script_name }}: community-unscripted/ProxmoxVE#${{ steps.create_pull_request.outputs.pr_number }}"
gh issue edit ${{ steps.list_issues.outputs.issue_nr }} --remove-label "Migration To ProxmoxVE" --add-label "Started Migration To ProxmoxVE"
```
**Purpose**: Links the PR to the original issue and updates status.
---
## GitHub App Setup
### Creating the GitHub App
1. **Navigate to GitHub Settings**:
- Go to https://github.com/settings/apps
- Click "New GitHub App"
2. **Configure App Details**:
| Field | Value |
|-------|-------|
| GitHub App name | `ProxmoxVED Migration Bot` (or your preference) |
| Homepage URL | `https://github.com/community-unscripted/ProxmoxVED` |
| Webhook | Uncheck "Active" |
3. **Set Permissions**:
| Permission | Access Level |
|------------|--------------|
| Contents | Read and Write |
| Issues | Read and Write |
| Pull requests | Read and Write |
| Metadata | Read (required) |
4. **Generate Private Key**:
- After creating, click "Generate a private key"
- Save the `.pem` file securely
5. **Install the App**:
- Go to App Settings → Install App
- Install on `community-unscripted` organization
- Select repositories: `ProxmoxVE` and `ProxmoxVED`
### Configuring Repository Variables and Secrets
1. **Add Variable**:
- Go to: Repository → Settings → Secrets and variables → Actions → Variables
- Click "New repository variable"
- Name: `PUSH_MAIN_APP_ID`
- Value: The numeric App ID (e.g., `3040335`)
2. **Add Secret**:
- Go to: Repository → Settings → Secrets and variables → Actions → Secrets
- Click "New repository secret"
- Name: `PUSH_MAIN_APP_SECRET`
- Value: The entire contents of the `.pem` private key file
---
## Troubleshooting
### Error: `appId option is required`
**Cause**: The `PUSH_MAIN_APP_ID` variable is not set or empty.
**Solution**:
1. Verify the variable exists in repository settings
2. Ensure the value is the numeric App ID (not the name)
3. Check the variable is set at the correct level (repository vs organization)
### Error: `Not Found` (404) on Installation Check
**Cause**: The GitHub App is not installed on the target repository.
**Solution**:
1. Go to GitHub App settings
2. Click "Install App"
3. Ensure both `ProxmoxVE` and `ProxmoxVED` are selected
4. Verify the app has the required permissions
### Error: `Input required and not supplied: token`
**Cause**: The checkout step is using a missing secret instead of the App token.
**Solution**: Ensure the checkout step uses `${{ steps.app-token.outputs.token }}` instead of `${{ secrets.GH_MERGE_PAT }}`.
### Error: `Resource not accessible by integration`
**Cause**: The GitHub App lacks necessary permissions.
**Solution**:
1. Go to App Settings → Permissions
2. Ensure Contents, Issues, and Pull requests have "Read and Write" access
3. Save changes and reinstall the app if prompted
### Files Not Found Error
**Cause**: Required script files are missing in ProxmoxVED.
**Solution**:
1. Check the issue contains correct script name
2. Verify all required files exist:
- For CT: `ct/<name>.sh`, `install/<name>-install.sh`, `frontend/public/json/<name>.json`
- For VM: `vm/<name>-vm.sh`
- For Addon: `tools/addon/<name>.sh`
- For PVE: `tools/pve/<name>.sh`
### Branch Already Exists Error
**Cause**: A previous migration attempt left a branch.
**Solution**: The workflow automatically deletes existing branches with the same name before creating new ones. If this fails, manually delete the branch in ProxmoxVE.
---
## Manual Trigger
To manually trigger the workflow:
1. Go to: `community-unscripted/ProxmoxVED` → Actions
2. Select "Move new Scripts to Main Repository"
3. Click "Run workflow"
4. Ensure an issue with "Migration To ProxmoxVE" label exists
---
## Security Considerations
1. **App Token Scope**: The token is scoped to only the specified repositories
2. **No PAT Required**: Uses GitHub App authentication instead of Personal Access Tokens
3. **Automatic Token Revocation**: Tokens are automatically revoked after workflow completion
4. **Minimal Permissions**: App only has necessary permissions for the workflow
---
## Document Information
| Field | Value |
|-------|-------|
| Version | 1.0 |
| Last Updated | March 2026 |
| Status | Current |
| License | MIT |
---
**For GitHub App setup guide, see: [GitHub App Setup Guide](../plans/github-app-setup-guide.md)**
+36
View File
@@ -0,0 +1,36 @@
{
"name": "MCPHub",
"slug": "mcphub",
"categories": [
20
],
"date_created": "2026-03-02",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 3000,
"documentation": "https://docs.mcphubx.com/",
"website": "https://github.com/samanhappy/mcphub",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/mcphub.webp",
"config_path": "/opt/mcphub/mcp_settings.json",
"description": "MCPHub is a unified hub for centrally managing and routing multiple Model Context Protocol (MCP) servers through a single dashboard and API endpoint.",
"install_methods": [
{
"type": "default",
"script": "ct/mcphub.sh",
"resources": {
"cpu": 2,
"ram": 2048,
"hdd": 8,
"os": "debian",
"version": "13"
}
}
],
"default_credentials": {
"username": "admin",
"password": "CHANGE_ME"
},
"notes": [
]
}
+64
View File
@@ -0,0 +1,64 @@
{
"name": "AMD ROCm",
"slug": "rocm",
"categories": [
20
],
"date_created": "2026-03-06",
"type": "addon",
"updateable": true,
"privileged": false,
"interface_port": null,
"documentation": "https://rocm.docs.amd.com/",
"website": "https://rocm.docs.amd.com/",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/amd.webp",
"config_path": "/etc/profile.d/rocm.sh",
"description": "AMD ROCm (Radeon Open Compute) is a software stack for GPU programming on AMD GPUs. It provides a comprehensive development platform for high-performance computing and machine learning applications.",
"install_methods": [
{
"type": "default",
"script": "tools/addon/rocm.sh",
"resources": {
"cpu": null,
"ram": null,
"hdd": null,
"os": null,
"version": null
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"text": "Execute within an existing LXC Console",
"type": "info"
},
{
"text": "Supported OS: Debian 12, Debian 13, Ubuntu 22.04, Ubuntu 24.04",
"type": "info"
},
{
"text": "Requires GPU passthrough to the LXC container before installation",
"type": "warning"
},
{
"text": "GPU passthrough: Find the GID from 'ls -la /dev/dri/renderD128' on host, then add to as a new device to /etc/pve/lxc/<CTID>.conf: dev<#>: /dev/kfd,gid=<GID>",
"type": "warning"
},
{
"text": "After installation, run 'source /etc/profile.d/rocm.sh' or log out/in to update PATH",
"type": "info"
},
{
"text": "Verify installation with: rocminfo and rocm-smi commands",
"type": "info"
},
{
"text": "If rocminfo shows 'Unable to open /dev/kfd', GPU passthrough is not configured correctly",
"type": "warning"
}
]
}
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: BillyOutlast
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://github.com/samanhappy/mcphub | Docs: https://docs.mcphubx.com/
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
NODE_VERSION="22" setup_nodejs
msg_info "Installing MCPHub"
$STD npm install -g @samanhappy/mcphub
msg_ok "Installed MCPHub"
msg_info "Creating Default Configuration"
mkdir -p /opt/mcphub
cat <<EOF >/opt/mcphub/mcp_settings.json
{
"mcpServers": {
"time": {
"command": "npx",
"args": ["-y", "time-mcp"]
}
}
}
EOF
msg_ok "Created Default Configuration"
msg_info "Creating Service"
NPM_GLOBAL_BIN="$(npm prefix -g)/bin"
MCPHUB_BIN="${NPM_GLOBAL_BIN}/mcphub"
cat <<EOF >/etc/systemd/system/mcphub.service
[Unit]
Description=MCPHub
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/mcphub
Environment=NODE_ENV=production
Environment=PORT=3000
Environment=MCPHUB_SETTING_PATH=/opt/mcphub/mcp_settings.json
ExecStart=${MCPHUB_BIN}
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now mcphub
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc
+1 -1
View File
@@ -35,7 +35,7 @@ msg_info "Configuring OxiCloud"
mkdir -p {/mnt/oxicloud,/etc/oxicloud}
sed -e 's|_STORAGE_PATH=.*|_STORAGE_PATH=/mnt/oxicloud|' \
-e 's|_SERVER_HOST=.*|_SERVER_HOST=0.0.0.0|' \
-e "s|^#OXICLOUD_BASE_URL=.*|OXICLOUD_BASE_URL=${LOCAL_IP}:8086|" \
-e "s|^#OXICLOUD_BASE_URL=.*|OXICLOUD_BASE_URL=http://${LOCAL_IP}:8086|" \
-e "s|_STRING=.*|_STRING=${DATABASE_URL}|" \
-e "s|DATABASE_URL=.*|DATABASE_URL=${DATABASE_URL}|" \
-e "s|^#OXICLOUD_JWT_SECRET=.*|OXICLOUD_JWT_SECRET=$(openssl rand -hex 32)|" \
+402
View File
@@ -0,0 +1,402 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: community-scripts
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://rocm.docs.amd.com
# ==============================================================================
# ROCm ADDON - AMD ROCm Installation for Debian/Ubuntu LXC Containers
# Supports: Debian 12, Debian 13, Ubuntu 22.04, Ubuntu 24.04
# ==============================================================================
ensure_dependencies curl
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/install.func)
# Enable error handling
set -Eeuo pipefail
trap 'error_handler' ERR
load_functions
init_tool_telemetry "" "addon"
function header_info {
clear
cat <<"EOF"
____ ____ ________ ___
/ __ \/ __ \/ ____/ |/ /
/ /_/ / / / / / / /|_/ /
/ _, _/ /_/ / /___/ / / /
/_/ |_|\____/\____/_/ /_/
ROCM Installer for Proxmox LXC Containers
EOF
}
# ==============================================================================
# ROCm REPOSITORY MAPPING
# ==============================================================================
# Sets ROCm-specific variables based on OS detection from install.func
# Variables set: OS, OS_CODENAME, ROCM_REPO_CODENAME, ROCM_VERSION
# Requires: OS_TYPE and OS_VERSION from detect_os() in install.func
# ==============================================================================
function setup_rocm_repo_mapping() {
ROCM_VERSION="7.2"
case "${OS_TYPE}" in
debian)
OS="Debian"
case "${OS_VERSION}" in
12)
OS_CODENAME="bookworm"
ROCM_REPO_CODENAME="jammy"
;;
13)
OS_CODENAME="trixie"
ROCM_REPO_CODENAME="noble"
;;
*)
msg_error "Unsupported Debian version: ${OS_VERSION}"
msg_info "Supported versions: Debian 12, Debian 13"
exit 1
;;
esac
;;
ubuntu)
OS="Ubuntu"
case "${OS_VERSION}" in
22.04)
OS_CODENAME="jammy"
ROCM_REPO_CODENAME="jammy"
;;
24.04)
OS_CODENAME="noble"
ROCM_REPO_CODENAME="noble"
;;
*)
msg_error "Unsupported Ubuntu version: ${OS_VERSION}"
msg_info "Supported versions: Ubuntu 22.04, Ubuntu 24.04"
exit 1
;;
esac
;;
*)
msg_error "Unsupported OS: ${OS_TYPE}"
msg_info "Supported OS: Debian 12, Debian 13, Ubuntu 22.04, Ubuntu 24.04"
exit 1
;;
esac
msg_ok "Detected: ${OS} ${OS_VERSION} (${OS_CODENAME})"
}
# ==============================================================================
# HELPER FUNCTIONS
# ==============================================================================
function check_lxc() {
if [[ -f "/proc/1/cgroup" ]] && grep -q "lxc" /proc/1/cgroup 2>/dev/null; then
return 0
fi
if grep -q "container=lxc" /proc/1/environ 2>/dev/null; then
return 0
fi
return 1
}
# ==============================================================================
# INSTALL FUNCTIONS
# ==============================================================================
function install_rocm_debian() {
msg_info "Adding ROCm repository GPG key"
if ! download_gpg_key "https://repo.radeon.com/rocm/rocm.gpg.key" "/etc/apt/keyrings/rocm.gpg" "dearmor"; then
msg_error "Failed to download or import ROCm GPG key"
exit 1
fi
msg_ok "Added ROCm GPG key"
msg_info "Adding ROCm repository (using ${ROCM_REPO_CODENAME} for ${OS} ${OS_VERSION})"
# Use deb822 format (new standard, replaces deprecated .list format)
cat <<EOF >/etc/apt/sources.list.d/rocm.sources
Types: deb
URIs: https://repo.radeon.com/rocm/apt/${ROCM_VERSION}
Suites: ${ROCM_REPO_CODENAME}
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/rocm.gpg
Types: deb
URIs: https://repo.radeon.com/graphics/${ROCM_VERSION}/ubuntu
Suites: ${ROCM_REPO_CODENAME}
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/rocm.gpg
EOF
msg_ok "Added ROCm repository"
msg_info "Setting package pin preferences"
cat <<EOF >/etc/apt/preferences.d/rocm-pin-600
Package: *
Pin: release o=repo.radeon.com
Pin-Priority: 600
EOF
msg_ok "Set package pin preferences"
msg_info "Updating package lists"
$STD apt update
msg_ok "Updated package lists"
msg_info "Installing ROCm packages"
$STD apt install -y rocm
msg_ok "Installed ROCm packages"
msg_info "Adding user to render and video groups"
usermod -aG render,video root
for user_home in /home/*/; do
[[ -d "$user_home" ]] || continue
user=$(basename "$user_home")
usermod -aG render,video "$user" 2>/dev/null || true
done
msg_ok "Added users to render and video groups"
msg_info "Configuring /dev/kfd permissions"
if [[ -e /dev/kfd ]]; then
chgrp render /dev/kfd 2>/dev/null || true
chmod 660 /dev/kfd
msg_ok "Configured /dev/kfd permissions"
else
msg_warn "/dev/kfd not found - GPU passthrough may not be configured"
fi
msg_info "Configuring environment"
cat <<EOF >/etc/profile.d/rocm.sh
export PATH=\$PATH:/opt/rocm/bin
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/opt/rocm/lib
EOF
chmod +x /etc/profile.d/rocm.sh
msg_ok "Configured environment"
}
function install_rocm_ubuntu() {
msg_info "Adding ROCm repository GPG key"
if ! download_gpg_key "https://repo.radeon.com/rocm/rocm.gpg.key" "/etc/apt/keyrings/rocm.gpg" "dearmor"; then
msg_error "Failed to download or import ROCm GPG key"
exit 1
fi
msg_ok "Added ROCm GPG key"
msg_info "Adding ROCm repository"
# Use deb822 format (new standard, replaces deprecated .list format)
cat <<EOF >/etc/apt/sources.list.d/rocm.sources
Types: deb
URIs: https://repo.radeon.com/rocm/apt/${ROCM_VERSION}
Suites: ${ROCM_REPO_CODENAME}
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/rocm.gpg
Types: deb
URIs: https://repo.radeon.com/graphics/${ROCM_VERSION}/ubuntu
Suites: ${ROCM_REPO_CODENAME}
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/rocm.gpg
EOF
msg_ok "Added ROCm repository"
msg_info "Setting package pin preferences"
cat <<EOF >/etc/apt/preferences.d/rocm-pin-600
Package: *
Pin: release o=repo.radeon.com
Pin-Priority: 600
EOF
msg_ok "Set package pin preferences"
msg_info "Updating package lists"
$STD apt update
msg_ok "Updated package lists"
msg_info "Installing ROCm packages"
$STD apt install -y rocm
msg_ok "Installed ROCm packages"
msg_info "Adding user to render and video groups"
usermod -aG render,video root
for user_home in /home/*/; do
[[ -d "$user_home" ]] || continue
user=$(basename "$user_home")
usermod -aG render,video "$user" 2>/dev/null || true
done
msg_ok "Added users to render and video groups"
msg_info "Configuring /dev/kfd permissions"
if [[ -e /dev/kfd ]]; then
chgrp render /dev/kfd 2>/dev/null || true
chmod 660 /dev/kfd
msg_ok "Configured /dev/kfd permissions"
else
msg_warn "/dev/kfd not found - GPU passthrough may not be configured"
fi
msg_info "Configuring environment"
cat <<EOF >/etc/profile.d/rocm.sh
export PATH=\$PATH:/opt/rocm/bin
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/opt/rocm/lib
EOF
chmod +x /etc/profile.d/rocm.sh
msg_ok "Configured environment"
}
# ==============================================================================
# UNINSTALL
# ==============================================================================
function uninstall_rocm() {
msg_info "Uninstalling ROCm"
msg_info "Removing ROCm packages"
$STD apt remove -y rocm
$STD apt autoremove -y
msg_ok "Removed ROCm packages"
msg_info "Removing ROCm repository and keyring"
# Remove both old .list and new .sources formats
rm -f /etc/apt/sources.list.d/rocm.list
rm -f /etc/apt/sources.list.d/rocm.sources
rm -f /etc/apt/preferences.d/rocm-pin-600
cleanup_tool_keyrings "rocm"
$STD apt update
msg_ok "Removed ROCm repository"
msg_info "Removing environment configuration"
rm -f /etc/profile.d/rocm.sh
msg_ok "Removed environment configuration"
msg_ok "ROCm has been uninstalled"
}
# ==============================================================================
# UPDATE
# ==============================================================================
function update_rocm() {
if [[ ! -f /etc/apt/keyrings/rocm.gpg ]]; then
msg_error "ROCm is not installed"
exit 1
fi
msg_info "Checking for ROCm updates"
$STD apt update
local updates
updates=$(apt list --upgradable 2>/dev/null | grep -c "rocm" || true)
if [[ "$updates" -gt 0 ]]; then
msg_ok "Found ${updates} ROCm package update(s)"
msg_info "Upgrading ROCm packages"
$STD apt install --only-upgrade rocm
msg_ok "Updated ROCm packages"
else
msg_ok "ROCm is already up-to-date"
fi
}
# ==============================================================================
# VERIFY INSTALLATION
# ==============================================================================
function verify_installation() {
msg_info "Verifying ROCm installation"
if [[ -x /opt/rocm/bin/rocminfo ]]; then
msg_ok "ROCm installed successfully"
echo ""
echo -e "${TAB}${BL}ROCm Version:${CL} $(/opt/rocm/bin/rocminfo --version 2>/dev/null | head -1 || echo 'Installed')"
echo -e "${TAB}${BL}Install Path:${CL} /opt/rocm"
echo ""
echo -e "${TAB}${YW}To use ROCm, either:${CL}"
echo -e "${TAB} 1. Log out and back in, or"
echo -e "${TAB} 2. Run: source /etc/profile.d/rocm.sh"
echo ""
echo -e "${TAB}${YW}Verify installation with:${CL}"
echo -e "${TAB} rocminfo"
echo -e "${TAB} rocm-smi"
else
msg_warn "ROCm installed but rocminfo not found. GPU may not be available."
fi
}
# ==============================================================================
# MAIN
# ==============================================================================
header_info
# Use detect_os from install.func (sets OS_TYPE, OS_VERSION, OS_FAMILY, etc.)
detect_os
# Set up ROCm-specific variables based on OS detection
setup_rocm_repo_mapping
# Use get_lxc_ip from core.func (sets LOCAL_IP environment variable)
get_lxc_ip
# Check if running in LXC container
if ! check_lxc; then
msg_warn "This script is designed for LXC containers."
msg_warn "Running on bare metal may work but is not officially supported."
echo ""
fi
# Check for existing installation
if [[ -f /etc/apt/keyrings/rocm.gpg ]]; then
msg_warn "ROCm is already installed."
echo ""
echo -n "${TAB}Uninstall ROCm? (y/N): "
read -r uninstall_prompt
if [[ "${uninstall_prompt,,}" =~ ^(y|yes)$ ]]; then
uninstall_rocm
exit 0
fi
echo -n "${TAB}Update ROCm? (y/N): "
read -r update_prompt
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
update_rocm
exit 0
fi
msg_warn "No action selected. Exiting."
exit 0
fi
# Fresh installation
msg_warn "ROCm is not installed."
echo ""
echo -e "${TAB}${BL}This will install AMD ROCm on ${OS} ${OS_VERSION}${CL}"
echo -e "${TAB}${BL}Supported GPUs: AMD Radeon Instinct, Radeon Pro, and some consumer GPUs${CL}"
echo ""
echo -n "${TAB}Install ROCm? (y/N): "
read -r install_prompt
if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
case "${OS}" in
Debian) install_rocm_debian ;;
Ubuntu) install_rocm_ubuntu ;;
*)
msg_error "Unsupported OS: ${OS}"
exit 1
;;
esac
verify_installation
echo ""
msg_ok "ROCm installation completed!"
echo -e "${TAB}${GN}Documentation: ${BL}https://rocm.docs.amd.com${CL}"
else
msg_warn "Installation cancelled. Exiting."
exit 0
fi