|
| 1 | +#!/usr/bin/env bash |
| 2 | +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main" |
| 3 | +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" |
| 4 | +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") |
| 5 | +# Copyright (c) 2021-2026 community-scripts ORG |
| 6 | +# Author: MickLesk (CanbiZ) |
| 7 | +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE |
| 8 | +# Source: https://github.com/jhaals/yopass |
| 9 | + |
| 10 | +APP="Yopass" |
| 11 | +var_tags="${var_tags:-security;secrets}" |
| 12 | +var_cpu="${var_cpu:-2}" |
| 13 | +var_ram="${var_ram:-2048}" |
| 14 | +var_disk="${var_disk:-8}" |
| 15 | +var_os="${var_os:-debian}" |
| 16 | +var_version="${var_version:-13}" |
| 17 | +#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified |
| 18 | +var_unprivileged="${var_unprivileged:-1}" |
| 19 | + |
| 20 | +header_info "$APP" |
| 21 | +variables |
| 22 | +color |
| 23 | +catch_errors |
| 24 | + |
| 25 | +function update_script() { |
| 26 | + header_info |
| 27 | + check_container_storage |
| 28 | + check_container_resources |
| 29 | + |
| 30 | + if [[ ! -d /opt/yopass ]]; then |
| 31 | + msg_error "No ${APP} Installation Found!" |
| 32 | + exit |
| 33 | + fi |
| 34 | + |
| 35 | + if check_for_gh_release "yopass" "jhaals/yopass"; then |
| 36 | + msg_info "Stopping Service" |
| 37 | + systemctl stop yopass |
| 38 | + msg_ok "Stopped Service" |
| 39 | + |
| 40 | + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "yopass" "jhaals/yopass" "tarball" |
| 41 | + |
| 42 | + msg_info "Building Yopass" |
| 43 | + cd /opt/yopass |
| 44 | + $STD go build -ldflags "-X main.version=$(cat ~/.yopass)" ./cmd/yopass-server |
| 45 | + cd /opt/yopass/website |
| 46 | + $STD yarn install --network-timeout 600000 |
| 47 | + $STD yarn build |
| 48 | + msg_ok "Built Yopass" |
| 49 | + |
| 50 | + msg_info "Starting Service" |
| 51 | + systemctl start yopass |
| 52 | + msg_ok "Started Service" |
| 53 | + msg_ok "Updated successfully!" |
| 54 | + fi |
| 55 | + exit |
| 56 | +} |
| 57 | + |
| 58 | +start |
| 59 | +build_container |
| 60 | +description |
| 61 | + |
| 62 | +msg_ok "Completed Successfully!\n" |
| 63 | +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" |
| 64 | +echo -e "${INFO}${YW}Access it using the following URL:${CL}" |
| 65 | +echo -e "${GATEWAY}${BGN}https://${IP}:1337${CL}" |
| 66 | +echo -e "${INFO}${YW}Uses a self-signed certificate - accept the browser warning once.${CL}" |
| 67 | +echo -e "${INFO}${YW}Yopass encrypts in the browser and needs HTTPS, plain HTTP will not work.${CL}" |
0 commit comments