mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-29 05:30:53 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 556151b797 | |||
| 79c99264fb |
@@ -0,0 +1,6 @@
|
|||||||
|
_____ __ __ __
|
||||||
|
/ ___// /_____ _______ __/ /_ ____ ____ / /__
|
||||||
|
\__ \/ __/ __ \/ ___/ / / / __ \/ __ \/ __ \/ //_/
|
||||||
|
___/ / /_/ /_/ / / / /_/ / /_/ / /_/ / /_/ / ,<
|
||||||
|
/____/\__/\____/_/ \__, /_.___/\____/\____/_/|_|
|
||||||
|
/____/
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
#!/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/storybookjs/storybook
|
||||||
|
|
||||||
|
APP="Storybook"
|
||||||
|
var_tags="${var_tags:-dev-tools;frontend;ui}"
|
||||||
|
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 /opt/storybook/.projectpath ]]; then
|
||||||
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
PROJECT_PATH=$(cat /opt/storybook/.projectpath)
|
||||||
|
|
||||||
|
if [[ ! -d "$PROJECT_PATH" ]]; then
|
||||||
|
msg_error "Project directory not found: $PROJECT_PATH"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg_info "Updating Storybook"
|
||||||
|
cd "$PROJECT_PATH"
|
||||||
|
$STD npx storybook@latest upgrade --yes
|
||||||
|
msg_ok "Updated Storybook"
|
||||||
|
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}:6006${CL}"
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
#!/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/storybookjs/storybook
|
||||||
|
|
||||||
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||||
|
color
|
||||||
|
verb_ip6
|
||||||
|
catch_errors
|
||||||
|
setting_up_container
|
||||||
|
network_check
|
||||||
|
update_os
|
||||||
|
|
||||||
|
NODE_VERSION="24" NODE_MODULE="pnpm" setup_nodejs
|
||||||
|
|
||||||
|
msg_info "Preparing Storybook"
|
||||||
|
mkdir -p /opt/storybook
|
||||||
|
cd /opt/storybook
|
||||||
|
msg_ok "Important: Interactive configuration will start now."
|
||||||
|
|
||||||
|
npx -y storybook@latest init --yes --no-dev
|
||||||
|
PROJECT_PATH=$(find /opt/storybook -maxdepth 2 -name ".storybook" -type d 2>/dev/null | head -n1 | xargs dirname)
|
||||||
|
|
||||||
|
if [[ -z "$PROJECT_PATH" ]]; then
|
||||||
|
PROJECT_PATH="/opt/storybook"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$PROJECT_PATH"
|
||||||
|
echo "$PROJECT_PATH" >/opt/storybook/.projectpath
|
||||||
|
|
||||||
|
msg_info "Creating Service"
|
||||||
|
cat <<EOF >/etc/systemd/system/storybook.service
|
||||||
|
[Unit]
|
||||||
|
Description=Storybook Dev Server
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=root
|
||||||
|
WorkingDirectory=${PROJECT_PATH}
|
||||||
|
ExecStart=/usr/bin/npx storybook dev --host 0.0.0.0 --port 6006 --no-open
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
systemctl enable -q --now storybook
|
||||||
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
motd_ssh
|
||||||
|
customize
|
||||||
|
cleanup_lxc
|
||||||
Reference in New Issue
Block a user