mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-16 19:05:07 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e15db754a6 | |||
| 772430de7e | |||
| 04a84f5052 | |||
| 12dec08523 | |||
| 775f1a98c2 | |||
| 6d6d66eec6 | |||
| 9bb99c59c5 | |||
| d122341a47 |
+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"],
|
||||
});
|
||||
@@ -504,6 +504,12 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
## 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
|
||||
|
||||
@@ -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,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}"
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user