diff --git a/ct/romm.sh b/ct/romm.sh new file mode 100644 index 00000000..bcc0343e --- /dev/null +++ b/ct/romm.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/DevelopmentCats/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 DevelopmentCats +# Author: DevelopmentCats +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://romm.app +# Updated: 03/10/2025 + +APP="RomM" +var_tags="${var_tags:-emulation}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-20}" +var_os="${var_os:-ubuntu}" +var_version="${var_version:-24.04}" +var_unprivileged="${var_unprivileged:-1}" +var_fuse="${var_fuse:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/romm ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + msg_info "Stopping $APP" + systemctl stop romm + systemctl stop nginx + msg_ok "Stopped $APP" + + msg_info "Updating $APP" + cd /opt/romm/app + git pull + + # Update backend + cd /opt/romm/app + source /opt/romm/venv/bin/activate + pip install --upgrade pip + pip install poetry + poetry install + + # Update frontend + cd /opt/romm/app/frontend + npm install + npm run build + + echo "Updated on $(date)" >/opt/romm/version.txt + msg_ok "Updated $APP" + + msg_info "Starting $APP" + systemctl start romm + systemctl start nginx + msg_ok "Started $APP" + msg_ok "Update Successful" + 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}:8080${CL}" diff --git a/frontend/public/json/romm.json b/frontend/public/json/romm.json new file mode 100644 index 00000000..fc8ed35e --- /dev/null +++ b/frontend/public/json/romm.json @@ -0,0 +1,40 @@ +{ + "name": "RomM", + "slug": "romm", + "categories": [ + 2, + 3 + ], + "date_created": "2025-03-10", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8080, + "documentation": "https://docs.romm.app/latest/", + "website": "https://romm.app/", + "config_path": "/opt", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/romm.webp", + "description": "RomM (ROM Manager) allows you to scan, enrich, browse and play your game collection with a clean and responsive interface. Support for multiple platforms, various naming schemes, and custom tags.", + "install_methods": [ + { + "type": "default", + "script": "ct/romm.sh", + "resources": { + "cpu": 2, + "ram": 4096, + "hdd": 20, + "os": "ubuntu", + "version": "24.04" + } + } + ], + "default_credentials": { + "username": "romm", + "password": "changeme" + }, + "notes": [ + "API Keys: For full functionality, you'll need API keys from IGDB, MobyGames, and/or SteamGridDB.", + "ROM Directory: Your ROM files should follow the RomM folder structure outlined in the documentation.", + "Authentication: The admin username and password will be set during the first-run setup process." + ] +} diff --git a/install/romm-install.sh b/install/romm-install.sh new file mode 100644 index 00000000..c43acb10 --- /dev/null +++ b/install/romm-install.sh @@ -0,0 +1,222 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: DevelopmentCats +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://romm.app +# Updated: 03/10/2025 + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing dependencies" +$STD apt-get install -y \ + acl \ + build-essential \ + libssl-dev \ + libffi-dev \ + python3-dev \ + python3-pip \ + python3-venv \ + libmariadb3 \ + libmariadb-dev \ + libpq-dev \ + redis-tools \ + p7zip \ + tzdata \ + jq +msg_ok "Installed core dependencies" + +PYTHON_VERSION="3.12" setup_uv +NODE_VERSION="22" NODE_MODULE="serve" setup_nodejs + +msg_info "Configuring Database" +DB_NAME=romm +DB_USER=romm +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +$STD mariadb -u root -e "CREATE DATABASE $DB_NAME CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" +$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" +$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" +{ + echo "RomM-Credentials" + echo "RomM Database User: $DB_USER" + echo "RomM Database Password: $DB_PASS" + echo "RomM Database Name: $DB_NAME" +} >~/romm.creds +chmod 600 ~/romm.creds +msg_ok "Configured Database" + +msg_info "Creating romm user and directories" +id -u romm &>/dev/null || useradd -r -m -d /var/lib/romm -s /bin/bash romm +mkdir -p /opt/romm \ + /var/lib/romm/config \ + /var/lib/romm/resources \ + /var/lib/romm/assets/{saves,states,screenshots} \ + /var/lib/romm/library/roms/{gba,gbc,ps} \ + /var/lib/romm/library/bios/{gba,ps} +chown -R romm:romm /opt/romm /var/lib/romm +msg_ok "Created romm user and directories" + +msg_info "Configuring Database" +DB_NAME=romm +DB_USER=romm +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +$STD mariadb -u root -e "CREATE DATABASE $DB_NAME CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" +$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" +$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" +{ + echo "RomM-Credentials" + echo "RomM Database User: $DB_USER" + echo "RomM Database Password: $DB_PASS" + echo "RomM Database Name: $DB_NAME" +} >~/romm.creds +msg_ok "Configured Database" + +fetch_and_deploy_gh_release "romm" "rommapp/romm" + +msg_info "Creating environment file" +sed -i 's/^supervised no/supervised systemd/' /etc/redis/redis.conf +systemctl restart redis-server +systemctl enable -q --now redis-server +AUTH_SECRET_KEY=$(openssl rand -hex 32) + +cat >/opt/romm/.env </etc/systemd/system/romm-backend.service </etc/systemd/system/romm-frontend.service </etc/systemd/system/romm-worker.service </etc/systemd/system/romm-scheduler.service <