Skip to content
Open

Yopass #16778

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ct/headers/yopass
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__ __
\ \/ /___ ____ ____ ___________
\ / __ \/ __ \/ __ `/ ___/ ___/
/ / /_/ / /_/ / /_/ (__ |__ )
/_/\____/ .___/\__,_/____/____/
/_/
67 changes: 67 additions & 0 deletions ct/yopass.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash
_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main"
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/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/jhaals/yopass

APP="Yopass"
var_tags="${var_tags:-security;secrets}"
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_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified
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/yopass ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi

if check_for_gh_release "yopass" "jhaals/yopass"; then
msg_info "Stopping Service"
systemctl stop yopass
msg_ok "Stopped Service"

CLEAN_INSTALL=1 fetch_and_deploy_gh_release "yopass" "jhaals/yopass" "tarball"

msg_info "Building Yopass"
cd /opt/yopass
$STD go build -ldflags "-X main.version=$(cat ~/.yopass)" ./cmd/yopass-server
cd /opt/yopass/website
$STD yarn install --network-timeout 600000
$STD yarn build
msg_ok "Built Yopass"

msg_info "Starting Service"
systemctl start yopass
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}https://${IP}:1337${CL}"
echo -e "${INFO}${YW}Uses a self-signed certificate - accept the browser warning once.${CL}"
echo -e "${INFO}${YW}Yopass encrypts in the browser and needs HTTPS, plain HTTP will not work.${CL}"
Comment thread
asylumexp marked this conversation as resolved.
Outdated
69 changes: 69 additions & 0 deletions install/yopass-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/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/jhaals/yopass

source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os

msg_info "Installing Dependencies"
$STD apt install -y redis-server
systemctl enable -q --now redis-server
msg_ok "Installed Dependencies"

setup_go
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs

fetch_and_deploy_gh_release "yopass" "jhaals/yopass" "tarball"

msg_info "Building Yopass"
cd /opt/yopass
$STD go build -ldflags "-X main.version=$(cat ~/.yopass)" ./cmd/yopass-server
cd /opt/yopass/website
$STD yarn install --network-timeout 600000
$STD yarn build
msg_ok "Built Yopass"

msg_info "Generating SSL Certificate"
mkdir -p /opt/yopass/certificates
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
-keyout /opt/yopass/certificates/key.pem \
-out /opt/yopass/certificates/cert.pem \
-subj "/C=US/ST=State/L=City/O=Yopass/CN=${LOCAL_IP}" \
-addext "subjectAltName=IP:${LOCAL_IP},DNS:localhost,IP:127.0.0.1" \
2>/dev/null
chmod 600 /opt/yopass/certificates/key.pem
chmod 644 /opt/yopass/certificates/cert.pem
msg_ok "Generated SSL Certificate"

msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/yopass.service
[Unit]
Description=Yopass
Wants=network-online.target
After=network-online.target redis-server.service

[Service]
Type=simple
User=root
WorkingDirectory=/opt/yopass
ExecStart=/opt/yopass/yopass-server --address 0.0.0.0 --port 1337 --tls-cert /opt/yopass/certificates/cert.pem --tls-key /opt/yopass/certificates/key.pem --database redis --redis redis://127.0.0.1:6379/0 --asset-path /opt/yopass/website/dist
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now yopass
msg_ok "Created Service"

motd_ssh
customize
cleanup_lxc