Compare commits
4 Commits
delete_fil
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e76681ed8e | ||
|
|
87bb2a34ca | ||
|
|
2b907821a7 | ||
|
|
16f7904371 |
81
.github/workflows/stale_pr_close.yml
generated
vendored
81
.github/workflows/stale_pr_close.yml
generated
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
const now = new Date();
|
||||
const owner = context.repo.owner;
|
||||
const repo = context.repo.repo;
|
||||
|
||||
|
||||
// --- When stale label is added, comment immediately ---
|
||||
if (context.eventName === "pull_request_target" && context.payload.action === "labeled") {
|
||||
const label = context.payload.label?.name;
|
||||
@@ -37,19 +37,74 @@ jobs:
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// --- Scheduled run: check all stale PRs ---
|
||||
|
||||
// --- Scheduled run: fetch all open PRs ---
|
||||
const { data: prs } = await github.rest.pulls.list({
|
||||
owner,
|
||||
repo,
|
||||
state: "open",
|
||||
per_page: 100
|
||||
});
|
||||
|
||||
|
||||
for (const pr of prs) {
|
||||
const hasStale = pr.labels.some(l => l.name === "stale");
|
||||
if (!hasStale) continue;
|
||||
|
||||
const labels = pr.labels.map(l => l.name);
|
||||
const hasStale = labels.includes("stale");
|
||||
const hasKeepOpen = labels.includes("keep-open");
|
||||
|
||||
// -------------------------------------------------------
|
||||
// NEW: Auto-label PRs with no activity in the last 14 days
|
||||
// -------------------------------------------------------
|
||||
if (!hasStale && !hasKeepOpen) {
|
||||
// Find the most recent commit date
|
||||
const { data: commits } = await github.rest.pulls.listCommits({
|
||||
owner,
|
||||
repo,
|
||||
pull_number: pr.number
|
||||
});
|
||||
const lastCommitDate = commits.length > 0
|
||||
? new Date(commits[commits.length - 1].commit.author.date)
|
||||
: new Date(pr.created_at);
|
||||
|
||||
// Find the most recent non-bot comment date
|
||||
const { data: comments } = await github.rest.issues.listComments({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: pr.number,
|
||||
per_page: 100
|
||||
});
|
||||
const humanComments = comments.filter(c => c.user?.type !== "Bot");
|
||||
const lastCommentDate = humanComments.length > 0
|
||||
? new Date(humanComments[humanComments.length - 1].created_at)
|
||||
: null;
|
||||
|
||||
// Most recent activity across commits and comments
|
||||
const lastActivityDate = lastCommentDate && lastCommentDate > lastCommitDate
|
||||
? lastCommentDate
|
||||
: lastCommitDate;
|
||||
|
||||
const daysSinceActivity = (now - lastActivityDate) / (1000 * 60 * 60 * 24);
|
||||
|
||||
if (daysSinceActivity > 14) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: pr.number,
|
||||
labels: ["stale"]
|
||||
});
|
||||
// The pull_request_target labeled event will fire the comment automatically.
|
||||
// Skip further processing for this PR in this run.
|
||||
continue;
|
||||
}
|
||||
|
||||
// Not stale, nothing else to do for this PR.
|
||||
continue;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
// EXISTING: Manage already-stale PRs
|
||||
// -------------------------------------------------------
|
||||
if (!hasStale) continue; // has keep-open but not stale — skip
|
||||
|
||||
// Get timeline events to find when stale label was added
|
||||
const { data: events } = await github.rest.issues.listEvents({
|
||||
owner,
|
||||
@@ -57,27 +112,27 @@ jobs:
|
||||
issue_number: pr.number,
|
||||
per_page: 100
|
||||
});
|
||||
|
||||
|
||||
// Find the most recent time the stale label was added
|
||||
const staleLabelEvents = events
|
||||
.filter(e => e.event === "labeled" && e.label?.name === "stale")
|
||||
.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
|
||||
|
||||
|
||||
if (staleLabelEvents.length === 0) continue;
|
||||
|
||||
|
||||
const staleLabelDate = new Date(staleLabelEvents[0].created_at);
|
||||
const daysSinceStale = (now - staleLabelDate) / (1000 * 60 * 60 * 24);
|
||||
|
||||
|
||||
// Check for new commits since stale label was added
|
||||
const { data: commits } = await github.rest.pulls.listCommits({
|
||||
owner,
|
||||
repo,
|
||||
pull_number: pr.number
|
||||
});
|
||||
|
||||
|
||||
const lastCommitDate = new Date(commits[commits.length - 1].commit.author.date);
|
||||
const author = pr.user.login;
|
||||
|
||||
|
||||
// If there are new commits after the stale label, remove it
|
||||
if (lastCommitDate > staleLabelDate) {
|
||||
await github.rest.issues.removeLabel({
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/versity/versitygw
|
||||
|
||||
APP="VersityGW"
|
||||
var_tags="${var_tags:-s3;storage;gateway}"
|
||||
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 /usr/bin/versitygw ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "versitygw" "versity/versitygw"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop versitygw@gateway
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
fetch_and_deploy_gh_release "versitygw" "versity/versitygw" "binary"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start versitygw@gateway
|
||||
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 "${TAB}${GATEWAY}${BGN}http://${IP}:7070${CL}"
|
||||
if grep -qs 'VGW_WEBUI_PORT' /etc/versitygw.d/gateway.conf 2>/dev/null; then
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7071${CL} (WebGUI)"
|
||||
fi
|
||||
@@ -22,27 +22,20 @@ setup_deb822_repo \
|
||||
|
||||
msg_info "Installing step-ca and step-cli"
|
||||
$STD apt install -y step-ca step-cli
|
||||
msg_ok "Installed step-ca and step-cli"
|
||||
|
||||
msg_info "Define smallstep environment variables"
|
||||
STEPHOME="/root/.step"
|
||||
$STD export STEPPATH=/etc/step-ca
|
||||
$STD export STEPHOME=$STEPHOME
|
||||
msg_ok "Defined smallstep environment variables"
|
||||
|
||||
msg_info "Add smallstep environment variables to /etc/profile"
|
||||
$STD sed -i '1i export STEPPATH=/etc/step-ca' /etc/profile
|
||||
$STD sed -i '1i export STEPHOME=/root/.step' /etc/profile
|
||||
msg_ok "Added smallstep environment variables to /etc/profile"
|
||||
|
||||
msg_info "Authorize step-ca binary with low port-binding capabilities"
|
||||
$STD setcap CAP_NET_BIND_SERVICE=+eip $(which step-ca)
|
||||
msg_ok "Authorized low port-binding capabilities"
|
||||
|
||||
msg_info "Add a smallstep CA service user - Will only be used by systemd to manage the CA"
|
||||
$STD useradd --user-group --system --home $(step path) --shell /bin/false step
|
||||
msg_ok "Created smallstep CA service user"
|
||||
msg_ok "Installed step-ca and step-cli"
|
||||
|
||||
msg_info "Initializing step-ca"
|
||||
DeploymentType="standalone"
|
||||
FQDN=$(hostname -f)
|
||||
DomainName=$(hostname -d)
|
||||
@@ -77,7 +70,6 @@ X509DefaultDur=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "step
|
||||
|
||||
done
|
||||
|
||||
msg_info "Initializing step-ca"
|
||||
EncryptionPwdDir="$(step path)/encryption"
|
||||
PwdFile="$EncryptionPwdDir/ca.pwd"
|
||||
ProvisionerPwdFile="$EncryptionPwdDir/provisioner.pwd"
|
||||
@@ -100,25 +92,19 @@ $STD step ca init \
|
||||
ln -s "$PwdFile" "$(step path)/password.txt"
|
||||
chown -R step:step $(step path)
|
||||
chmod -R 700 $(step path)
|
||||
msg_ok "Initialized step-ca"
|
||||
|
||||
msg_info "Add ACME provisioner"
|
||||
$STD step ca provisioner add "$AcmeProvisioner" --type ACME --admin-name "$AcmeProvisioner"
|
||||
msg_ok "Added ACME provisioner"
|
||||
|
||||
msg_info "Update provisioner configurations"
|
||||
$STD step ca provisioner update "$PKIProvisioner" \
|
||||
--x509-min-dur=$X509MinDur \
|
||||
--x509-max-dur=$X509MaxDur \
|
||||
--x509-default-dur=$X509DefaultDur \
|
||||
--allow-renewal-after-expiry
|
||||
|
||||
$STD step ca provisioner update "$AcmeProvisioner" \
|
||||
--x509-min-dur=$X509MinDur \
|
||||
--x509-max-dur=$X509MaxDur \
|
||||
--x509-default-dur=$X509DefaultDur \
|
||||
--allow-renewal-after-expiry
|
||||
msg_ok "Updated provisioner configurations"
|
||||
msg_ok "Initialized step-ca"
|
||||
|
||||
msg_info "Start step-ca as a Daemon"
|
||||
cat <<'EOF' >/etc/systemd/system/step-ca.service
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/versity/versitygw
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "versitygw" "versity/versitygw" "binary"
|
||||
|
||||
WEBUI_CONF=""
|
||||
read -rp "Would you like to enable the VersityGW WebGUI (Beta)? (y/N): " webui_prompt
|
||||
if [[ "${webui_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
WEBUI_CONF="\nVGW_WEBUI_PORT=:7071\nVGW_WEBUI_NO_TLS=true"
|
||||
msg_ok "WebGUI will be enabled on port 7071"
|
||||
fi
|
||||
|
||||
msg_info "Configuring VersityGW"
|
||||
mkdir -p /opt/versitygw-data
|
||||
ACCESS_KEY=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-20)
|
||||
SECRET_KEY=$(openssl rand -base64 36 | tr -dc 'a-zA-Z0-9' | cut -c1-40)
|
||||
|
||||
cat <<EOF >/etc/versitygw.d/gateway.conf
|
||||
VGW_BACKEND=posix
|
||||
VGW_BACKEND_ARG=/opt/versitygw-data
|
||||
VGW_PORT=:7070
|
||||
ROOT_ACCESS_KEY_ID=${ACCESS_KEY}
|
||||
ROOT_SECRET_ACCESS_KEY=${SECRET_KEY}
|
||||
EOF
|
||||
|
||||
if [[ -n "$WEBUI_CONF" ]]; then
|
||||
echo -e "$WEBUI_CONF" >>/etc/versitygw.d/gateway.conf
|
||||
fi
|
||||
msg_ok "Configured VersityGW"
|
||||
|
||||
msg_info "Enabling Service"
|
||||
systemctl enable -q --now versitygw@gateway
|
||||
msg_ok "Enabled Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -1,48 +0,0 @@
|
||||
{
|
||||
"name": "VersityGW",
|
||||
"slug": "versitygw",
|
||||
"categories": [
|
||||
11
|
||||
],
|
||||
"date_created": "2026-03-10",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 7070,
|
||||
"documentation": "https://github.com/versity/versitygw/wiki",
|
||||
"config_path": "/etc/versitygw.d/gateway.conf",
|
||||
"website": "https://www.versity.com/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/versitygw.webp",
|
||||
"description": "VersityGW is a high-performance, cloud-native S3-compatible gateway that provides S3 API access to various storage backends including POSIX filesystems.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/versitygw.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 8,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "S3 access credentials are generated during installation and stored in /etc/versitygw.d/gateway.conf",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Data is stored in /opt/versitygw-data (POSIX backend)",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use any S3-compatible client to connect to the gateway endpoint",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user