[PR #70] Outdated: Add JSON Documents for Each Script #2384

Closed
opened 2025-11-20 05:29:34 -05:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/community-scripts/ProxmoxVE/pull/70

State: closed
Merged: No


Acknowledgments

I want to acknowledge @tteck who put this all together in the first pace, this just builds upon their work.

I also want to acknowledge the amazing work @BramSuurdje put the database together on the database and suggested the json schema. Having this in the first place made this job a lot easier.

Also @havardthom who consulted during this process and helped move things along.

Description

This merge adds a json/ directory with a .json file for each script.

The json structure is in the format proposed by @havardthom with some minor changes due to discovery of information as I wrangled the data.

The data is extracted from the pocketbase DB in consultation with @BramSuurdje. It also parses the scripts (ct, vm and misc) for details.

The json format is as follows:

{
    "name": "Emby Media Server", # The human formatted name/title
    "slug": "emby", # The slug, which is the script name without the file ext.
    "categories": [
        "Media - Photo" # The categories
    ],
    "date_created": "2024-05-02", # When the script was first added
    "type": "ct", # This differs slightly from the db. The type is ct, vm or misc. The frontend can render ct as LCX etc.
    "updateable": 0, # 0 or 1
    "privileged": 0, # 0 or 1
    "interface_port": "8096", 
    "documentation": "",
    "website": "https://emby.media/",
    "logo": "https://github.com/home-assistant/brands/blob/master/core_integrations/emby/icon.png?raw=true", 
    "description": "Emby brings together your personal videos, music, photos, and live television.",
    "install_methods": [
        {
            "type": "default",
            "script": "ct/emby.sh", # this is the script path from the root of the repo. The frontend code can generate the installer command from this.
            "resources": {
                "cpu": "2",
                "ram": "2048", # This is the value extracted from the script itself, RAM is specified in MB
                "hdd": "8",  # Hdd is specified in GB
                "os": "ubuntu",
                "version": "22.04"
            }
        }
    ],
    "default_credentials": {
        "username": "",
        "password": ""
    },
    "alerts": [ # We can have multiple alerts.
        {
            "alert": "With Privileged/Unprivileged Hardware Acceleration Support" 
        }
    ]
}

Notes

I found a couple of scripts that are in the database but no longer exist as scripts:

  1. scrutiny
  2. collabora-online

So I think keeping the database in the repo as static files that can be committed or changed in lock-step with the scripts is a good idea. In the future we can automate checking that new scripts have a correct json file.

The script that generated these json files can be found here.

This wrangling job took quite a long time dealing with edge cases etc.

A script, or even a jq one liner could generate a categories.json file.

Type of change

Please check the relevant option(s):

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would cause existing functionality to change unexpectedly)
  • New script (a fully functional and thoroughly tested script or set of scripts.)
  • Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions)
  • Documentation update required (this change requires an update to the documentation)
**Original Pull Request:** https://github.com/community-scripts/ProxmoxVE/pull/70 **State:** closed **Merged:** No --- # Acknowledgments I want to acknowledge @tteck who put this all together in the first pace, this just builds upon their work. I also want to acknowledge the amazing work @BramSuurdje put the database together on the database and suggested the json schema. Having this in the first place made this job a lot easier. Also @havardthom who consulted during this process and helped move things along. ## Description This merge adds a json/ directory with a .json file for each script. The json structure is in the format proposed by @havardthom with some minor changes due to discovery of information as I wrangled the data. The data is extracted from the pocketbase DB in consultation with @BramSuurdje. It also parses the scripts (ct, vm and misc) for details. The json format is as follows: ```json { "name": "Emby Media Server", # The human formatted name/title "slug": "emby", # The slug, which is the script name without the file ext. "categories": [ "Media - Photo" # The categories ], "date_created": "2024-05-02", # When the script was first added "type": "ct", # This differs slightly from the db. The type is ct, vm or misc. The frontend can render ct as LCX etc. "updateable": 0, # 0 or 1 "privileged": 0, # 0 or 1 "interface_port": "8096", "documentation": "", "website": "https://emby.media/", "logo": "https://github.com/home-assistant/brands/blob/master/core_integrations/emby/icon.png?raw=true", "description": "Emby brings together your personal videos, music, photos, and live television.", "install_methods": [ { "type": "default", "script": "ct/emby.sh", # this is the script path from the root of the repo. The frontend code can generate the installer command from this. "resources": { "cpu": "2", "ram": "2048", # This is the value extracted from the script itself, RAM is specified in MB "hdd": "8", # Hdd is specified in GB "os": "ubuntu", "version": "22.04" } } ], "default_credentials": { "username": "", "password": "" }, "alerts": [ # We can have multiple alerts. { "alert": "With Privileged/Unprivileged Hardware Acceleration Support" } ] } ``` ## Notes I found a couple of scripts that are in the database but no longer exist as scripts: 1. scrutiny 2. collabora-online So I think keeping the database in the repo as static files that can be committed or changed in lock-step with the scripts is a good idea. In the future we can automate checking that new scripts have a correct json file. The script that generated these json files can be found [here](https://gist.github.com/newzealandpaul/897f59fb04cec2dc90fad15084e5a7de). This wrangling job took quite a long time dealing with edge cases etc. A script, or even a jq one liner could generate a categories.json file. ## Type of change Please check the relevant option(s): - [ ] Bug fix (non-breaking change that resolves an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (a fix or feature that would cause existing functionality to change unexpectedly) - [ ] New script (a fully functional and thoroughly tested script or set of scripts.) - [ ] Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions) - [ ] Documentation update required (this change requires an update to the documentation)
saavagebueno added the pull-request label 2025-11-20 05:29:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#2384