mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-16 19:05:07 +02:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7fdf7258d4 | |||
| e15db754a6 | |||
| 772430de7e | |||
| 04a84f5052 | |||
| 12dec08523 | |||
| 775f1a98c2 | |||
| 6d6d66eec6 | |||
| 9bb99c59c5 | |||
| d122341a47 | |||
| b9f26d66ed | |||
| c44789f5f6 | |||
| 5144f8d0cc | |||
| d23a2e64e7 |
+163
@@ -0,0 +1,163 @@
|
||||
name: Close PRs Missing Template
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
branches: ["main"]
|
||||
types: [opened, edited, reopened, synchronize, labeled]
|
||||
|
||||
jobs:
|
||||
validate-pr-template:
|
||||
if: github.repository == 'community-scripts/ProxmoxVE'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Close PR if it does not follow the PR template
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const pr = context.payload.pull_request;
|
||||
const prNumber = pr.number;
|
||||
const author = pr.user.login;
|
||||
const owner = context.repo.owner;
|
||||
const repo = context.repo.repo;
|
||||
|
||||
const allowedBots = [
|
||||
"push-app-to-main[bot]",
|
||||
"push-app-to-main",
|
||||
"community-scripts-pr-app",
|
||||
"github-actions[bot]",
|
||||
"dependabot[bot]",
|
||||
];
|
||||
|
||||
if (allowedBots.includes(author) || author.endsWith("[bot]")) {
|
||||
core.info(`PR #${prNumber} by bot "${author}" — skipping template validation.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const association = pr.author_association;
|
||||
const exemptAssociations = ["OWNER", "MEMBER", "COLLABORATOR"];
|
||||
if (exemptAssociations.includes(association)) {
|
||||
core.info(`PR #${prNumber} by ${association} "${author}" — skipping template validation.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const labels = pr.labels.map((label) => label.name);
|
||||
const skipLabels = ["automated pr", "keep open"];
|
||||
|
||||
if (skipLabels.some((label) => labels.includes(label))) {
|
||||
core.info(`PR #${prNumber} has a skip label (${labels.join(", ")}) — skipping template validation.`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pr.draft) {
|
||||
core.info(`PR #${prNumber} is a draft — skipping template validation.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const body = pr.body || "";
|
||||
const failures = [];
|
||||
|
||||
const requiredSections = [
|
||||
"## ✍️ Description",
|
||||
"## ✅ Prerequisites",
|
||||
"## 🛠️ Type of Change",
|
||||
];
|
||||
|
||||
for (const section of requiredSections) {
|
||||
if (!body.includes(section)) {
|
||||
failures.push(`Missing required section: \`${section}\``);
|
||||
}
|
||||
}
|
||||
|
||||
const descriptionMatch = body.match(
|
||||
/## ✍️ Description\s*\n+([\s\S]*?)(?=\n## )/i
|
||||
);
|
||||
const description = (descriptionMatch?.[1] || "").trim();
|
||||
if (!description) {
|
||||
failures.push("The **Description** section is empty.");
|
||||
}
|
||||
|
||||
const prerequisiteCheckboxes = [
|
||||
"**Self-review completed**",
|
||||
"**Tested thoroughly**",
|
||||
"**No security risks**",
|
||||
];
|
||||
|
||||
for (const checkbox of prerequisiteCheckboxes) {
|
||||
const escaped = checkbox.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
|
||||
const regex = new RegExp(`- \\[(x|X)\\]\\s*${escaped}`, "i");
|
||||
if (!regex.test(body)) {
|
||||
failures.push(`Prerequisite not checked: ${checkbox}`);
|
||||
}
|
||||
}
|
||||
|
||||
const typeOfChangeCheckboxes = [
|
||||
"🐞 **Bug fix**",
|
||||
"✨ **New feature**",
|
||||
"💥 **Breaking change**",
|
||||
"🆕 **New script**",
|
||||
"🌍 **Website update**",
|
||||
"🔧 **Refactoring / Code Cleanup**",
|
||||
"📝 **Documentation update**",
|
||||
];
|
||||
|
||||
const hasTypeChecked = typeOfChangeCheckboxes.some((checkbox) => {
|
||||
const escaped = checkbox.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
|
||||
const regex = new RegExp(`- \\[(x|X)\\]\\s*${escaped}`, "i");
|
||||
return regex.test(body);
|
||||
});
|
||||
|
||||
if (!hasTypeChecked) {
|
||||
failures.push("At least one **Type of Change** checkbox must be checked.");
|
||||
}
|
||||
|
||||
if (failures.length === 0) {
|
||||
core.info(`PR #${prNumber} follows the PR template.`);
|
||||
return;
|
||||
}
|
||||
|
||||
core.info(`Closing PR #${prNumber} — template validation failed.`);
|
||||
|
||||
const templateUrl =
|
||||
"https://github.com/community-scripts/ProxmoxVE/blob/main/.github/pull_request_template.md";
|
||||
const failureList = failures.map((item) => `- ${item}`).join("\n");
|
||||
|
||||
const comment = [
|
||||
`👋 Hi @${author},`,
|
||||
``,
|
||||
`This pull request was closed because it does not follow the [PR template](${templateUrl}).`,
|
||||
``,
|
||||
`Please fix the following and open a new PR (or reopen this one after updating the description):`,
|
||||
``,
|
||||
failureList,
|
||||
``,
|
||||
`> Use the template sections, fill in the description, check all prerequisite boxes, and select at least one type of change.`,
|
||||
``,
|
||||
`Maintainers can add the \`keep open\` label to exempt a PR from this check.`,
|
||||
``,
|
||||
`Thank you for contributing! 🙏`,
|
||||
].join("\n");
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: prNumber,
|
||||
body: comment,
|
||||
});
|
||||
|
||||
await github.rest.pulls.update({
|
||||
owner,
|
||||
repo,
|
||||
pull_number: prNumber,
|
||||
state: "closed",
|
||||
});
|
||||
|
||||
await github.rest.issues.addLabels({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: prNumber,
|
||||
labels: ["missing pr template"],
|
||||
});
|
||||
@@ -502,6 +502,20 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
</details>
|
||||
|
||||
## 2026-07-16
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
- Sync-In ([#15812](https://github.com/community-scripts/ProxmoxVE/pull/15812))
|
||||
- Beaverhabits ([#15813](https://github.com/community-scripts/ProxmoxVE/pull/15813))
|
||||
- Notediscovery ([#15811](https://github.com/community-scripts/ProxmoxVE/pull/15811))
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- Pin Immich to v3.0.3 [@vhsdream](https://github.com/vhsdream) ([#15790](https://github.com/community-scripts/ProxmoxVE/pull/15790))
|
||||
|
||||
## 2026-07-15
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/daya0576/beaverhabits
|
||||
|
||||
APP="BeaverHabits"
|
||||
var_tags="${var_tags:-habits;tracking;productivity}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/beaverhabits ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "beaverhabits" "daya0576/beaverhabits"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop beaverhabits
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
create_backup /opt/beaverhabits/.user
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "beaverhabits" "daya0576/beaverhabits" "tarball"
|
||||
|
||||
msg_info "Syncing Dependencies"
|
||||
cd /opt/beaverhabits
|
||||
$STD uv sync --no-dev
|
||||
msg_ok "Synced Dependencies"
|
||||
|
||||
restore_backup
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start beaverhabits
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
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 "${GATEWAY}${BGN}http://${IP}:8080/register{CL}"
|
||||
@@ -0,0 +1,6 @@
|
||||
____ __ __ __ _ __
|
||||
/ __ )___ ____ __ _____ _____/ / / /___ _/ /_ (_) /______
|
||||
/ __ / _ \/ __ `/ | / / _ \/ ___/ /_/ / __ `/ __ \/ / __/ ___/
|
||||
/ /_/ / __/ /_/ /| |/ / __/ / / __ / /_/ / /_/ / / /_(__ )
|
||||
/_____/\___/\__,_/ |___/\___/_/ /_/ /_/\__,_/_.___/_/\__/____/
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
_ __ __ ____ _
|
||||
/ | / /___ / /____ / __ \(_)_____________ _ _____ _______ __
|
||||
/ |/ / __ \/ __/ _ \/ / / / / ___/ ___/ __ \ | / / _ \/ ___/ / / /
|
||||
/ /| / /_/ / /_/ __/ /_/ / (__ ) /__/ /_/ / |/ / __/ / / /_/ /
|
||||
/_/ |_/\____/\__/\___/_____/_/____/\___/\____/|___/\___/_/ \__, /
|
||||
/____/
|
||||
@@ -0,0 +1,6 @@
|
||||
_____ _
|
||||
/ ___/__ ______ _____ (_)___
|
||||
\__ \/ / / / __ \/ ___/_____/ / __ \
|
||||
___/ / /_/ / / / / /__/_____/ / / / /
|
||||
/____/\__, /_/ /_/\___/ /_/_/ /_/
|
||||
/____/
|
||||
+1
-1
@@ -110,7 +110,7 @@ EOF
|
||||
msg_ok "Image-processing libraries up to date"
|
||||
fi
|
||||
|
||||
RELEASE="v3.0.2"
|
||||
RELEASE="v3.0.3"
|
||||
if check_for_gh_release "Immich" "immich-app/immich" "${RELEASE}" "each release is tested individually before the version is updated. Please do not open issues for this"; then
|
||||
if [[ $(cat ~/.immich) > "2.5.1" ]]; then
|
||||
msg_info "Enabling Maintenance Mode"
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/gamosoft/NoteDiscovery
|
||||
|
||||
APP="NoteDiscovery"
|
||||
var_tags="${var_tags:-notes;wiki;knowledge-base}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/notediscovery ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "notediscovery" "gamosoft/NoteDiscovery"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop notediscovery
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
create_backup /opt/notediscovery/data /opt/notediscovery/config.yaml
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "notediscovery" "gamosoft/NoteDiscovery" "tarball"
|
||||
|
||||
msg_info "Syncing Dependencies"
|
||||
cd /opt/notediscovery
|
||||
$STD uv sync --no-dev
|
||||
msg_ok "Synced Dependencies"
|
||||
|
||||
restore_backup
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start notediscovery
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
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 "${GATEWAY}${BGN}http://${IP}:8000${CL}"
|
||||
+48
-2
@@ -30,12 +30,58 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "snapotter" "snapotter-hq/SnapOtter"; then
|
||||
NEEDS_V2_MIGRATION=false
|
||||
grep -q '^DB_PATH=' /opt/snapotter_data/.env 2>/dev/null && NEEDS_V2_MIGRATION=true
|
||||
UPDATE_AVAILABLE=false
|
||||
check_for_gh_release "snapotter" "snapotter-hq/SnapOtter" && UPDATE_AVAILABLE=true
|
||||
|
||||
if [[ "$NEEDS_V2_MIGRATION" == true || "$UPDATE_AVAILABLE" == true ]]; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop snapotter
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "snapotter" "snapotter-hq/SnapOtter" "prebuild" "latest" "/opt/snapotter" "snapotter-*-linux-amd64.tar.gz"
|
||||
PG_VERSION="17" setup_postgresql
|
||||
if ! sudo -u postgres psql -tAc "SELECT 1 FROM pg_database WHERE datname = 'snapotter'" | grep -qx '1'; then
|
||||
PG_DB_NAME="snapotter" PG_DB_USER="snapotter" setup_postgresql_db
|
||||
else
|
||||
PG_DB_NAME="snapotter"
|
||||
PG_DB_USER="snapotter"
|
||||
PG_DB_PASS=$(sed -n 's|^DATABASE_URL=postgres://snapotter:\([^@]*\)@.*|\1|p' /opt/snapotter_data/.env | head -n1)
|
||||
if [[ -z "$PG_DB_PASS" ]]; then
|
||||
msg_error "SnapOtter's PostgreSQL database exists, but its password is not available in /opt/snapotter_data/.env"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
msg_info "Installing Redis"
|
||||
$STD apt install -y redis-server
|
||||
if grep -q '^appendonly ' /etc/redis/redis.conf; then
|
||||
sed -i 's/^appendonly .*/appendonly yes/' /etc/redis/redis.conf
|
||||
else
|
||||
echo 'appendonly yes' >>/etc/redis/redis.conf
|
||||
fi
|
||||
$STD systemctl enable --now redis-server
|
||||
msg_ok "Installed Redis"
|
||||
|
||||
msg_info "Migrating SnapOtter Configuration"
|
||||
sed -i '/^DB_PATH=/d; /^DATABASE_URL=/d; /^REDIS_URL=/d; /^SQLITE_MIGRATE_PATH=/d' /opt/snapotter_data/.env
|
||||
cat <<EOF >>/opt/snapotter_data/.env
|
||||
DATABASE_URL=postgres://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME}
|
||||
REDIS_URL=redis://127.0.0.1:6379
|
||||
EOF
|
||||
if [[ -f /opt/snapotter_data/snapotter.db ]]; then
|
||||
echo 'SQLITE_MIGRATE_PATH=/opt/snapotter_data/snapotter.db' >>/opt/snapotter_data/.env
|
||||
fi
|
||||
if ! grep -q '^Requires=postgresql.service redis-server.service$' /etc/systemd/system/snapotter.service; then
|
||||
sed -i '/^After=/c\After=network-online.target postgresql.service redis-server.service' /etc/systemd/system/snapotter.service
|
||||
sed -i '/^\[Unit\]/a Wants=network-online.target\nRequires=postgresql.service redis-server.service' /etc/systemd/system/snapotter.service
|
||||
fi
|
||||
systemctl daemon-reload
|
||||
msg_ok "Migrated SnapOtter Configuration"
|
||||
|
||||
if [[ "$UPDATE_AVAILABLE" == true ]]; then
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "snapotter" "snapotter-hq/SnapOtter" "prebuild" "latest" "/opt/snapotter" "snapotter-*-linux-amd64.tar.gz"
|
||||
fi
|
||||
|
||||
msg_info "Updating SnapOtter"
|
||||
$STD uv python install 3.11
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/Sync-in/server
|
||||
|
||||
APP="Sync-in"
|
||||
var_tags="${var_tags:-files;sync;collaboration}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-20}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/sync-in/node_modules/@sync-in ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "sync-in" "Sync-in/server"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop sync-in
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Updating Sync-in"
|
||||
$STD npm install --prefix /opt/sync-in "@sync-in/server@${CHECK_UPDATE_RELEASE#v}"
|
||||
msg_ok "Updated Sync-in"
|
||||
|
||||
msg_info "Running Database Migrations"
|
||||
cd /opt/sync-in
|
||||
$STD npx sync-in-server migrate-db
|
||||
msg_ok "Ran Database Migrations"
|
||||
|
||||
VERSION=$(node -pe "require('/opt/sync-in/node_modules/@sync-in/server/package.json').version" 2>/dev/null || echo "")
|
||||
[[ -n "$VERSION" ]] && echo "$VERSION" >~/.sync-in
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start sync-in
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
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 "${GATEWAY}${BGN}http://${IP}:8080${CL}"
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/daya0576/beaverhabits
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
PYTHON_VERSION="3.14" setup_uv
|
||||
|
||||
fetch_and_deploy_gh_release "beaverhabits" "daya0576/beaverhabits" "tarball"
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
cd /opt/beaverhabits
|
||||
$STD uv sync --no-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Configuring BeaverHabits"
|
||||
mkdir -p /opt/beaverhabits/.user
|
||||
msg_ok "Configured BeaverHabits"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/beaverhabits.service
|
||||
[Unit]
|
||||
Description=BeaverHabits Habit Tracker
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/beaverhabits
|
||||
Environment=HABITS_STORAGE=USER_DISK
|
||||
Environment=NICEGUI_STORAGE_PATH=/opt/beaverhabits/.user/.nicegui
|
||||
ExecStart=/opt/beaverhabits/.venv/bin/gunicorn beaverhabits.main:app --bind 0.0.0.0:8080 -w 1 -k uvicorn_worker.UvicornWorker --max-requests 10000 --log-level info
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now beaverhabits
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -312,7 +312,7 @@ ML_DIR="${APP_DIR}/machine-learning"
|
||||
GEO_DIR="${INSTALL_DIR}/geodata"
|
||||
mkdir -p {"${APP_DIR}","${UPLOAD_DIR}","${GEO_DIR}","${INSTALL_DIR}"/cache}
|
||||
|
||||
fetch_and_deploy_gh_release "Immich" "immich-app/immich" "tarball" "v3.0.2" "$SRC_DIR"
|
||||
fetch_and_deploy_gh_release "Immich" "immich-app/immich" "tarball" "v3.0.3" "$SRC_DIR"
|
||||
PNPM_VERSION="$(jq -r '.packageManager | split("@")[1] | split("+")[0]' ${SRC_DIR}/package.json)"
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/gamosoft/NoteDiscovery
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
setup_uv
|
||||
|
||||
fetch_and_deploy_gh_release "notediscovery" "gamosoft/NoteDiscovery" "tarball"
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
cd /opt/notediscovery
|
||||
$STD uv sync --no-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Configuring NoteDiscovery"
|
||||
mkdir -p /opt/notediscovery/data
|
||||
msg_ok "Configured NoteDiscovery"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/notediscovery.service
|
||||
[Unit]
|
||||
Description=NoteDiscovery Knowledge Base
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/notediscovery
|
||||
ExecStart=/opt/notediscovery/.venv/bin/python /opt/notediscovery/run.py
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now notediscovery
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -39,6 +39,19 @@ msg_ok "Installed Dependencies"
|
||||
|
||||
PYTHON_VERSION="3.11" setup_uv
|
||||
NODE_VERSION="22" NODE_MODULE="pnpm" setup_nodejs
|
||||
PG_VERSION="17" setup_postgresql
|
||||
PG_DB_NAME="snapotter" PG_DB_USER="snapotter" setup_postgresql_db
|
||||
|
||||
msg_info "Installing Redis"
|
||||
$STD apt install -y redis-server
|
||||
if grep -q '^appendonly ' /etc/redis/redis.conf; then
|
||||
sed -i 's/^appendonly .*/appendonly yes/' /etc/redis/redis.conf
|
||||
else
|
||||
echo 'appendonly yes' >>/etc/redis/redis.conf
|
||||
fi
|
||||
$STD systemctl enable --now redis-server
|
||||
msg_ok "Installed Redis"
|
||||
|
||||
fetch_and_deploy_gh_release "caire" "esimov/caire" "prebuild" "latest" "/usr/local/bin" "caire-*-linux-amd64.tar.gz"
|
||||
fetch_and_deploy_gh_release "snapotter" "snapotter-hq/SnapOtter" "prebuild" "latest" "/opt/snapotter" "snapotter-*-linux-amd64.tar.gz"
|
||||
|
||||
@@ -61,7 +74,8 @@ mkdir -p /tmp/snapotter-workspace
|
||||
cat <<EOF >/opt/snapotter_data/.env
|
||||
PORT=1349
|
||||
NODE_ENV=production
|
||||
DB_PATH=/opt/snapotter_data/snapotter.db
|
||||
DATABASE_URL=postgres://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME}
|
||||
REDIS_URL=redis://127.0.0.1:6379
|
||||
WORKSPACE_PATH=/tmp/snapotter-workspace
|
||||
FILES_STORAGE_PATH=/opt/snapotter_data/files
|
||||
PYTHON_VENV_PATH=/opt/snapotter_data/ai/venv
|
||||
@@ -85,7 +99,9 @@ PNPM_BIN="$(command -v pnpm)"
|
||||
cat <<EOF >/etc/systemd/system/snapotter.service
|
||||
[Unit]
|
||||
Description=SnapOtter Service
|
||||
After=network.target
|
||||
Wants=network-online.target
|
||||
After=network-online.target postgresql.service redis-server.service
|
||||
Requires=postgresql.service redis-server.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
@@ -99,6 +115,7 @@ RestartSec=5
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl enable -q --now snapotter
|
||||
msg_ok "Created Service"
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/Sync-in/server
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
setup_mariadb
|
||||
MARIADB_DB_NAME="sync_in" MARIADB_DB_USER="sync_in" setup_mariadb_db
|
||||
|
||||
msg_info "Installing Sync-in"
|
||||
mkdir -p /opt/sync-in/data
|
||||
$STD npm install --prefix /opt/sync-in @sync-in/server
|
||||
msg_ok "Installed Sync-in"
|
||||
|
||||
msg_info "Configuring Sync-in"
|
||||
ENCRYPT_KEY=$(openssl rand -hex 32)
|
||||
ACCESS_SECRET=$(openssl rand -hex 32)
|
||||
REFRESH_SECRET=$(openssl rand -hex 32)
|
||||
cat <<EOF >/opt/sync-in/environment.yaml
|
||||
server:
|
||||
port: 8080
|
||||
mysql:
|
||||
url: 'mysql://${MARIADB_DB_USER}:${MARIADB_DB_PASS}@localhost:3306/${MARIADB_DB_NAME}'
|
||||
auth:
|
||||
encryptionKey: '${ENCRYPT_KEY}'
|
||||
token:
|
||||
access:
|
||||
secret: '${ACCESS_SECRET}'
|
||||
refresh:
|
||||
secret: '${REFRESH_SECRET}'
|
||||
applications:
|
||||
files:
|
||||
dataPath: '/opt/sync-in/data'
|
||||
EOF
|
||||
msg_ok "Configured Sync-in"
|
||||
|
||||
msg_info "Running Database Migrations"
|
||||
cd /opt/sync-in
|
||||
$STD npx sync-in-server migrate-db
|
||||
msg_ok "Ran Database Migrations"
|
||||
|
||||
msg_info "Creating Admin User"
|
||||
cd /opt/sync-in
|
||||
$STD npx sync-in-server create-user
|
||||
msg_ok "Created Admin User"
|
||||
|
||||
VERSION=$(node -pe "require('/opt/sync-in/node_modules/@sync-in/server/package.json').version" 2>/dev/null || echo "")
|
||||
[[ -n "$VERSION" ]] && echo "$VERSION" >~/.sync-in
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/sync-in.service
|
||||
[Unit]
|
||||
Description=Sync-in Server
|
||||
After=network.target mariadb.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/sync-in
|
||||
ExecStart=/opt/sync-in/node_modules/.bin/sync-in-server start
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now sync-in
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
+179
-22
@@ -8677,6 +8677,7 @@ setup_postgresql_db() {
|
||||
export PG_DB_USER
|
||||
export PG_DB_PASS
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Installs rbenv and ruby-build, installs Ruby and optionally Rails.
|
||||
#
|
||||
@@ -8696,8 +8697,26 @@ setup_ruby() {
|
||||
local RBENV_DIR="$HOME/.rbenv"
|
||||
local RBENV_BIN="$RBENV_DIR/bin/rbenv"
|
||||
local PROFILE_FILE="$HOME/.profile"
|
||||
local BASH_PROFILE_FILE="$HOME/.bash_profile"
|
||||
local BASHRC_FILE="$HOME/.bashrc"
|
||||
local TMP_DIR=$(mktemp -d)
|
||||
|
||||
if ! grep -q 'rbenv init' "$PROFILE_FILE" 2>/dev/null; then
|
||||
cat <<'EOF' >>"$PROFILE_FILE"
|
||||
export PATH="$HOME/.rbenv/bin:$PATH"
|
||||
eval "$(rbenv init -)"
|
||||
EOF
|
||||
fi
|
||||
if ! grep -q '.rbenv/shims' "$PROFILE_FILE" 2>/dev/null; then
|
||||
echo 'export PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"' >>"$PROFILE_FILE"
|
||||
fi
|
||||
if [[ -f "$BASH_PROFILE_FILE" ]] && ! grep -q '.rbenv/shims' "$BASH_PROFILE_FILE"; then
|
||||
echo 'export PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"' >>"$BASH_PROFILE_FILE"
|
||||
fi
|
||||
if [[ -f "$BASHRC_FILE" ]] && ! grep -q '.rbenv/shims' "$BASHRC_FILE"; then
|
||||
echo 'export PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"' >>"$BASHRC_FILE"
|
||||
fi
|
||||
|
||||
# Get currently installed Ruby version
|
||||
local CURRENT_RUBY_VERSION=""
|
||||
if [[ -x "$RBENV_BIN" ]]; then
|
||||
@@ -8795,42 +8814,32 @@ setup_ruby() {
|
||||
return 150
|
||||
}
|
||||
|
||||
# Setup profile
|
||||
if ! grep -q 'rbenv init' "$PROFILE_FILE" 2>/dev/null; then
|
||||
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >>"$PROFILE_FILE"
|
||||
echo 'eval "$(rbenv init -)"' >>"$PROFILE_FILE"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install ruby-build plugin
|
||||
_install_ruby_build_plugin() {
|
||||
if [[ ! -d "$RBENV_DIR/plugins/ruby-build" ]]; then
|
||||
local RUBY_BUILD_RELEASE
|
||||
RUBY_BUILD_RELEASE=$(get_latest_github_release "rbenv/ruby-build") || {
|
||||
msg_error "Failed to fetch latest ruby-build version from GitHub"
|
||||
rm -rf "$TMP_DIR"
|
||||
return 7
|
||||
}
|
||||
|
||||
if ! curl_with_retry "https://github.com/rbenv/ruby-build/archive/refs/tags/v${RUBY_BUILD_RELEASE}.tar.gz" "$TMP_DIR/ruby-build.tar.gz"; then
|
||||
msg_error "Failed to download ruby-build"
|
||||
msg_error "Hint: Check connectivity to github.com/rbenv/ruby-build"
|
||||
rm -rf "$TMP_DIR"
|
||||
return 7
|
||||
fi
|
||||
|
||||
tar -xzf "$TMP_DIR/ruby-build.tar.gz" -C "$TMP_DIR" || {
|
||||
msg_error "Failed to extract ruby-build"
|
||||
rm -rf "$TMP_DIR"
|
||||
return 251
|
||||
}
|
||||
|
||||
mkdir -p "$RBENV_DIR/plugins/ruby-build"
|
||||
cp -r "$TMP_DIR/ruby-build-${RUBY_BUILD_RELEASE}/." "$RBENV_DIR/plugins/ruby-build/"
|
||||
return 0
|
||||
}
|
||||
|
||||
if [[ ! -d "$RBENV_DIR/plugins/ruby-build" ]]; then
|
||||
_install_ruby_build_plugin || {
|
||||
rm -rf "$TMP_DIR"
|
||||
return 7
|
||||
}
|
||||
fi
|
||||
|
||||
# Setup PATH and install Ruby version
|
||||
@@ -8838,14 +8847,6 @@ setup_ruby() {
|
||||
eval "$("$RBENV_BIN" init - bash)" 2>/dev/null || true
|
||||
|
||||
if ! "$RBENV_BIN" versions --bare 2>/dev/null | grep -qx "$RUBY_VERSION"; then
|
||||
if [[ ! -f "$RBENV_DIR/plugins/ruby-build/share/ruby-build/$RUBY_VERSION" ]]; then
|
||||
msg_info "Updating ruby-build definitions"
|
||||
_install_ruby_build_plugin || {
|
||||
rm -rf "$TMP_DIR"
|
||||
return 7
|
||||
}
|
||||
msg_ok "Updated ruby-build definitions"
|
||||
fi
|
||||
$STD "$RBENV_BIN" install "$RUBY_VERSION" || {
|
||||
msg_error "Failed to install Ruby $RUBY_VERSION"
|
||||
rm -rf "$TMP_DIR"
|
||||
@@ -9029,6 +9030,162 @@ setup_rust() {
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Installs Rust toolchain and optional global crates via cargo.
|
||||
#
|
||||
# Description:
|
||||
# - Installs rustup (if missing)
|
||||
# - Installs or updates desired Rust toolchain (stable, nightly, or versioned)
|
||||
# - Installs or updates specified global crates using `cargo install`
|
||||
#
|
||||
# Notes:
|
||||
# - Skips crate install if exact version is already present
|
||||
# - Updates crate if newer version or different version is requested
|
||||
#
|
||||
# Variables:
|
||||
# RUST_TOOLCHAIN - Rust toolchain to install (default: stable)
|
||||
# RUST_PROFILE - Rust installation profile (default: default, e.g. minimal)
|
||||
# RUST_CRATES - Comma-separated list of crates (e.g. "cargo-edit,wasm-pack@0.12.1")
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
setup_rust() {
|
||||
local RUST_TOOLCHAIN="${RUST_TOOLCHAIN:-stable}"
|
||||
local RUST_PROFILE="${RUST_PROFILE:-default}"
|
||||
local RUST_CRATES="${RUST_CRATES:-}"
|
||||
local CARGO_BIN="${HOME}/.cargo/bin"
|
||||
|
||||
# Get currently installed version
|
||||
local CURRENT_VERSION=""
|
||||
if command -v rustc &>/dev/null; then
|
||||
CURRENT_VERSION=$(rustc --version 2>/dev/null | awk '{print $2}' 2>/dev/null) || true
|
||||
fi
|
||||
|
||||
# Scenario 1: Rustup not installed - fresh install
|
||||
if ! command -v rustup &>/dev/null; then
|
||||
msg_info "Setup Rust ($RUST_TOOLCHAIN, profile: $RUST_PROFILE)"
|
||||
curl -fsSL https://sh.rustup.rs | $STD sh -s -- -y --profile "$RUST_PROFILE" --default-toolchain "$RUST_TOOLCHAIN" || {
|
||||
msg_error "Failed to install Rust"
|
||||
msg_error "Hint: Check connectivity to sh.rustup.rs and static.rust-lang.org"
|
||||
return 7
|
||||
}
|
||||
export PATH="$CARGO_BIN:$PATH"
|
||||
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >>"$HOME/.profile"
|
||||
|
||||
# Verify installation
|
||||
if ! command -v rustc >/dev/null 2>&1; then
|
||||
msg_error "Rust binary not found after installation"
|
||||
return 127
|
||||
fi
|
||||
|
||||
local RUST_VERSION
|
||||
RUST_VERSION=$(rustc --version 2>/dev/null | awk '{print $2}' 2>/dev/null) || true
|
||||
if [[ -z "$RUST_VERSION" ]]; then
|
||||
msg_error "Failed to determine Rust version"
|
||||
return 250
|
||||
fi
|
||||
|
||||
cache_installed_version "rust" "$RUST_VERSION"
|
||||
msg_ok "Setup Rust $RUST_VERSION"
|
||||
else
|
||||
# Scenario 2: Rustup already installed - update/maintain
|
||||
msg_info "Update Rust ($RUST_TOOLCHAIN)"
|
||||
|
||||
# Ensure default toolchain is set
|
||||
$STD rustup default "$RUST_TOOLCHAIN" 2>/dev/null || {
|
||||
# If default fails, install the toolchain first
|
||||
$STD rustup install "$RUST_TOOLCHAIN" || {
|
||||
msg_error "Failed to install Rust toolchain $RUST_TOOLCHAIN"
|
||||
return 150
|
||||
}
|
||||
$STD rustup default "$RUST_TOOLCHAIN" || {
|
||||
msg_error "Failed to set default Rust toolchain"
|
||||
return 150
|
||||
}
|
||||
}
|
||||
|
||||
# Update to latest patch version
|
||||
$STD rustup update "$RUST_TOOLCHAIN" </dev/null || {
|
||||
msg_warn "Rust toolchain update had issues"
|
||||
}
|
||||
|
||||
# Ensure PATH is updated for current shell session
|
||||
export PATH="$CARGO_BIN:$PATH"
|
||||
|
||||
local RUST_VERSION
|
||||
RUST_VERSION=$(rustc --version 2>/dev/null | awk '{print $2}' 2>/dev/null) || true
|
||||
if [[ -z "$RUST_VERSION" ]]; then
|
||||
msg_error "Failed to determine Rust version after update"
|
||||
return 250
|
||||
fi
|
||||
|
||||
cache_installed_version "rust" "$RUST_VERSION"
|
||||
msg_ok "Update Rust $RUST_VERSION"
|
||||
fi
|
||||
|
||||
# Install global crates
|
||||
if [[ -n "$RUST_CRATES" ]]; then
|
||||
msg_info "Processing Rust crates: $RUST_CRATES"
|
||||
IFS=',' read -ra CRATES <<<"$RUST_CRATES"
|
||||
for crate in "${CRATES[@]}"; do
|
||||
crate=$(echo "$crate" | xargs) # trim whitespace
|
||||
[[ -z "$crate" ]] && continue # skip empty entries
|
||||
|
||||
local NAME VER INSTALLED_VER CRATE_LIST
|
||||
if [[ "$crate" == *"@"* ]]; then
|
||||
NAME="${crate%@*}"
|
||||
VER="${crate##*@}"
|
||||
else
|
||||
NAME="$crate"
|
||||
VER=""
|
||||
fi
|
||||
|
||||
# Get list of installed crates once
|
||||
CRATE_LIST=$(cargo install --list 2>/dev/null || echo "")
|
||||
|
||||
# Check if already installed
|
||||
if echo "$CRATE_LIST" | grep -q "^${NAME} "; then
|
||||
INSTALLED_VER=$(echo "$CRATE_LIST" | grep "^${NAME} " | head -1 | awk '{print $2}' 2>/dev/null | tr -d 'v:' || echo '')
|
||||
|
||||
if [[ -n "$VER" && "$VER" != "$INSTALLED_VER" ]]; then
|
||||
msg_info "Upgrading $NAME from v$INSTALLED_VER to v$VER"
|
||||
$STD cargo install "$NAME" --version "$VER" --force || {
|
||||
msg_error "Failed to install $NAME@$VER"
|
||||
return 150
|
||||
}
|
||||
msg_ok "Upgraded $NAME to v$VER"
|
||||
elif [[ -z "$VER" ]]; then
|
||||
msg_info "Upgrading $NAME to latest"
|
||||
$STD cargo install "$NAME" --force || {
|
||||
msg_error "Failed to upgrade $NAME"
|
||||
return 150
|
||||
}
|
||||
local NEW_VER=$(cargo install --list 2>/dev/null | grep "^${NAME} " | head -1 | awk '{print $2}' 2>/dev/null | tr -d 'v:' || echo 'unknown')
|
||||
msg_ok "Upgraded $NAME to v$NEW_VER"
|
||||
else
|
||||
msg_ok "$NAME v$INSTALLED_VER already installed"
|
||||
fi
|
||||
else
|
||||
msg_info "Installing $NAME${VER:+@$VER}"
|
||||
if [[ -n "$VER" ]]; then
|
||||
$STD cargo install "$NAME" --version "$VER" || {
|
||||
msg_error "Failed to install $NAME@$VER"
|
||||
return 150
|
||||
}
|
||||
msg_ok "Installed $NAME v$VER"
|
||||
else
|
||||
$STD cargo install "$NAME" || {
|
||||
msg_error "Failed to install $NAME"
|
||||
return 150
|
||||
}
|
||||
local NEW_VER=$(cargo install --list 2>/dev/null | grep "^${NAME} " | head -1 | awk '{print $2}' 2>/dev/null | tr -d 'v:' || echo 'unknown')
|
||||
msg_ok "Installed $NAME v$NEW_VER"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
msg_ok "Processed Rust crates"
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Installs or upgrades uv (Python package manager) from GitHub releases.
|
||||
# - Downloads platform-specific tarball (no install.sh!)
|
||||
|
||||
Reference in New Issue
Block a user