Add Sure scripts
This commit is contained in:
parent
c1e05b5400
commit
295b004e25
59
ct/sure.sh
Normal file
59
ct/sure.sh
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||||
|
# Copyright (c) 2021-2026 community-scripts ORG
|
||||||
|
# Author: vhsdream
|
||||||
|
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||||
|
# Source: https://sure.am
|
||||||
|
|
||||||
|
APP="Sure"
|
||||||
|
var_tags="${var_tags:-finance}"
|
||||||
|
var_cpu="${var_cpu:-2}"
|
||||||
|
var_ram="${var_ram:-2048}"
|
||||||
|
var_disk="${var_disk:-6}"
|
||||||
|
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 [[ ! -d /opt/sure ]]; then
|
||||||
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
NODE_VERSION="24" setup_nodejs
|
||||||
|
|
||||||
|
if check_for_gh_release "Sure" "we-promise/sure"; then
|
||||||
|
msg_info "Stopping Sure"
|
||||||
|
$STD systemctl stop sure
|
||||||
|
msg_ok "Stopped Sure"
|
||||||
|
|
||||||
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Sure" "we-promise/sure" "tarball" "latest" "/opt/sure"
|
||||||
|
|
||||||
|
msg_info "Updating Sure"
|
||||||
|
msg_ok "Updated Sure"
|
||||||
|
|
||||||
|
msg_info "Starting Sure"
|
||||||
|
$STD systemctl start sure
|
||||||
|
msg_ok "Started Sure"
|
||||||
|
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 "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
|
||||||
35
frontend/public/json/sure.json
Normal file
35
frontend/public/json/sure.json
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "Sure",
|
||||||
|
"slug": "sure",
|
||||||
|
"categories": [
|
||||||
|
23
|
||||||
|
],
|
||||||
|
"date_created": "2026-02-18",
|
||||||
|
"type": "ct",
|
||||||
|
"updateable": true,
|
||||||
|
"privileged": false,
|
||||||
|
"interface_port": 3000,
|
||||||
|
"documentation": "https://github.com/we-promise/sure",
|
||||||
|
"website": "https://sure.am",
|
||||||
|
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/sure.webp",
|
||||||
|
"config_path": "/etc/sure/.env",
|
||||||
|
"description": "The personal finance app for everyone. NOT affiliated with or endorsed by Maybe Finance Inc..",
|
||||||
|
"install_methods": [
|
||||||
|
{
|
||||||
|
"type": "default",
|
||||||
|
"script": "ct/sure.sh",
|
||||||
|
"resources": {
|
||||||
|
"cpu": 2,
|
||||||
|
"ram": 2048,
|
||||||
|
"hdd": 6,
|
||||||
|
"os": "Debian",
|
||||||
|
"version": "13"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"default_credentials": {
|
||||||
|
"username": null,
|
||||||
|
"password": null
|
||||||
|
},
|
||||||
|
"notes": []
|
||||||
|
}
|
||||||
77
install/sure-install.sh
Normal file
77
install/sure-install.sh
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright (c) 2021-2026 community-scripts ORG
|
||||||
|
# Author: vhsdream
|
||||||
|
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||||
|
# Source: https://sure.am
|
||||||
|
|
||||||
|
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 \
|
||||||
|
build-essential \
|
||||||
|
redis-server \
|
||||||
|
pkg-config \
|
||||||
|
libpq-dev \
|
||||||
|
libvips
|
||||||
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "Sure" "we-promise/sure" "tarball" "latest" "/opt/sure"
|
||||||
|
|
||||||
|
PG_VERSION="$(sed -n '/postgres:/s/[^[:digit:]]*//p' /opt/sure/compose.example.yml)" setup_postgresql
|
||||||
|
PG_DB_NAME=sure_db PG_DB_USER=sure_user setup_postgresql_db
|
||||||
|
RUBY_VERSION="$(cat /opt/sure/.ruby-version)" RUBY_INSTALL_RAILS=true setup_ruby
|
||||||
|
|
||||||
|
# msg_info "Building Sure"
|
||||||
|
# cd /opt/sure
|
||||||
|
# export RAILS_ENV=production
|
||||||
|
# export BUNDLE_DEPLOYMENT=1
|
||||||
|
# export BUNDLE_WITHOUT=development
|
||||||
|
# $STD bundle install
|
||||||
|
# $STD bundle exec bootsnap precompile --gemfile -j 0
|
||||||
|
# $STD bundle exec bootsnap precompile -j 0 app/ lib/
|
||||||
|
# export SECRET_KEY_BASE_DUMMY=1 && $STD ./bin/rails assets:precompile
|
||||||
|
# $STD ./bin/rails db:prepare
|
||||||
|
# msg_ok "Built Sure"
|
||||||
|
#
|
||||||
|
# msg_info "Configuring Sure"
|
||||||
|
# KEY="$(openssl rand -hex 64)"
|
||||||
|
# mkdir -p /etc/sure
|
||||||
|
# mv /opt/sure/.env.example /etc/sure/.env
|
||||||
|
# sed -i -e "/SECRET_KEY_BASE=/s/&.*/&${KEY}/" \
|
||||||
|
# -e "/POSTGRES_PASSWORD=/s/&.*/&${PG_DB_PASS}/" \
|
||||||
|
# -e "/POSTGRES_USER=/s/&.*/&${PG_DB_USER}/" \
|
||||||
|
# -e "s|^APP_DOMAIN=|&${LOCAL_IP}|" /etc/sure/.env
|
||||||
|
# msg_ok "Configured Sure"
|
||||||
|
|
||||||
|
msg_info "Creating Service"
|
||||||
|
cat <<EOF >/etc/systemd/system/sure.service
|
||||||
|
[Unit]
|
||||||
|
Description=Sure Service
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
WorkingDirectory=/opt/sure
|
||||||
|
EnvironmentFile=/etc/sure/.env
|
||||||
|
ExecStart=/opt/sure/bin/rails server
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
$STD systemctl enable -q --now sure
|
||||||
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
motd_ssh
|
||||||
|
customize
|
||||||
|
cleanup_lxc
|
||||||
Loading…
x
Reference in New Issue
Block a user