Skip to content

Commit 0fa9720

Browse files
Add yopass (ct)
1 parent ff252a8 commit 0fa9720

3 files changed

Lines changed: 142 additions & 0 deletions

File tree

ct/headers/yopass

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/yopass.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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}"

install/yopass-install.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/jhaals/yopass
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 install -y redis-server
18+
systemctl enable -q --now redis-server
19+
msg_ok "Installed Dependencies"
20+
21+
setup_go
22+
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
23+
24+
fetch_and_deploy_gh_release "yopass" "jhaals/yopass" "tarball"
25+
26+
msg_info "Building Yopass"
27+
cd /opt/yopass
28+
$STD go build -ldflags "-X main.version=$(cat ~/.yopass)" ./cmd/yopass-server
29+
cd /opt/yopass/website
30+
$STD yarn install --network-timeout 600000
31+
$STD yarn build
32+
msg_ok "Built Yopass"
33+
34+
msg_info "Generating SSL Certificate"
35+
mkdir -p /opt/yopass/certificates
36+
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
37+
-keyout /opt/yopass/certificates/key.pem \
38+
-out /opt/yopass/certificates/cert.pem \
39+
-subj "/C=US/ST=State/L=City/O=Yopass/CN=${LOCAL_IP}" \
40+
-addext "subjectAltName=IP:${LOCAL_IP},DNS:localhost,IP:127.0.0.1" \
41+
2>/dev/null
42+
chmod 600 /opt/yopass/certificates/key.pem
43+
chmod 644 /opt/yopass/certificates/cert.pem
44+
msg_ok "Generated SSL Certificate"
45+
46+
msg_info "Creating Service"
47+
cat <<EOF >/etc/systemd/system/yopass.service
48+
[Unit]
49+
Description=Yopass
50+
Wants=network-online.target
51+
After=network-online.target redis-server.service
52+
53+
[Service]
54+
Type=simple
55+
User=root
56+
WorkingDirectory=/opt/yopass
57+
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
58+
Restart=on-failure
59+
RestartSec=5
60+
61+
[Install]
62+
WantedBy=multi-user.target
63+
EOF
64+
systemctl enable -q --now yopass
65+
msg_ok "Created Service"
66+
67+
motd_ssh
68+
customize
69+
cleanup_lxc

0 commit comments

Comments
 (0)