Skip to content

Commit 3e4420e

Browse files
'Add new script' (#7967)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
1 parent 38f7e81 commit 3e4420e

File tree

4 files changed

+191
-0
lines changed

4 files changed

+191
-0
lines changed

ct/headers/verdaccio

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_ __ __ _
2+
| | / /__ _________/ /___ ___________(_)___
3+
| | / / _ \/ ___/ __ / __ `/ ___/ ___/ / __ \
4+
| |/ / __/ / / /_/ / /_/ / /__/ /__/ / /_/ /
5+
|___/\___/_/ \__,_/\__,_/\___/\___/_/\____/
6+

ct/verdaccio.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: BrynnJKnight
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://verdaccio.org/
7+
8+
APP="Verdaccio"
9+
var_tags="${var_tags:-dev-tools;npm;registry}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-2048}"
12+
var_disk="${var_disk:-8}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -f /etc/systemd/system/verdaccio.service ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
31+
msg_info "Updating LXC Container"
32+
$STD apt update
33+
$STD apt -y upgrade
34+
msg_ok "Updated LXC Container"
35+
36+
NODE_VERSION="22" NODE_MODULE="verdaccio" setup_nodejs
37+
systemctl restart verdaccio
38+
msg_ok "Updated Successfully"
39+
exit
40+
}
41+
42+
start
43+
build_container
44+
description
45+
46+
msg_ok "Completed Successfully!\n"
47+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
48+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
49+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:4873${CL}"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Verdaccio",
3+
"slug": "verdaccio",
4+
"categories": [
5+
20
6+
],
7+
"date_created": "2025-09-19",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 4873,
12+
"documentation": "https://verdaccio.org/docs/what-is-verdaccio",
13+
"website": "https://verdaccio.org/",
14+
"logo": "https://verdaccio.org/img/logo/symbol/png/verdaccio-tiny.png",
15+
"config_path": "/opt/verdaccio/config/config.yaml",
16+
"description": "Verdaccio is a lightweight private npm proxy registry built with Node.js. It allows you to host your own npm registry with minimal configuration, providing a private npm repository for your projects. Verdaccio supports npm, yarn, and pnpm, and can cache packages from the public npm registry, allowing for faster installs and protection against npm registry outages. It includes a web interface for browsing packages, authentication and authorization features, and can be easily integrated into your development workflow.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/verdaccio.sh",
21+
"resources": {
22+
"cpu": 2,
23+
"ram": 2048,
24+
"hdd": 8,
25+
"os": "debian",
26+
"version": "13"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "To create the first user, run: npm adduser --registry http://<container-ip>:4873",
37+
"type": "info"
38+
}
39+
]
40+
}

install/verdaccio-install.sh

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: BrynnJKnight
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://verdaccio.org/
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
ca-certificates \
19+
build-essential
20+
msg_ok "Installed Dependencies"
21+
22+
NODE_VERSION="22" NODE_MODULE="verdaccio" setup_nodejs
23+
24+
msg_info "Configuring Verdaccio"
25+
mkdir -p /opt/verdaccio/config
26+
mkdir -p /opt/verdaccio/storage
27+
28+
cat <<EOF >/opt/verdaccio/config/config.yaml
29+
# Verdaccio configuration
30+
storage: /opt/verdaccio/storage
31+
auth:
32+
htpasswd:
33+
file: /opt/verdaccio/storage/htpasswd
34+
max_users: 1000
35+
uplinks:
36+
npmjs:
37+
url: https://registry.npmjs.org/
38+
packages:
39+
'@*/*':
40+
access: \$all
41+
publish: \$authenticated
42+
proxy: npmjs
43+
'**':
44+
access: \$all
45+
publish: \$authenticated
46+
proxy: npmjs
47+
middlewares:
48+
audit:
49+
enabled: true
50+
logs:
51+
- {type: stdout, format: pretty, level: http}
52+
listen:
53+
- 0.0.0.0:4873
54+
web:
55+
enable: true
56+
title: Verdaccio
57+
gravatar: true
58+
sort_packages: asc
59+
login: true
60+
EOF
61+
62+
chown -R root:root /opt/verdaccio
63+
chmod -R 755 /opt/verdaccio
64+
msg_ok "Configured Verdaccio"
65+
66+
msg_info "Creating Service"
67+
cat <<EOF >/etc/systemd/system/verdaccio.service
68+
[Unit]
69+
Description=Verdaccio lightweight private npm proxy registry
70+
After=network.target
71+
72+
[Service]
73+
Type=simple
74+
ExecStart=/usr/bin/verdaccio --config /opt/verdaccio/config/config.yaml
75+
Restart=on-failure
76+
StandardOutput=journal
77+
StandardError=journal
78+
SyslogIdentifier=verdaccio
79+
KillMode=control-group
80+
81+
[Install]
82+
WantedBy=multi-user.target
83+
EOF
84+
85+
systemctl enable -q --now verdaccio
86+
msg_ok "Created Service"
87+
88+
89+
motd_ssh
90+
customize
91+
92+
msg_info "Cleaning up"
93+
$STD apt -y autoremove
94+
$STD apt -y autoclean
95+
$STD apt -y clean
96+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)