Compare commits

...

2 Commits

Author SHA1 Message Date
CanbiZ (MickLesk) 56c57c56dd Change default value of var_arm64 to 'yes' 2026-09-07 15:22:03 +02:00
push-app-to-main[bot] b80bb53160 Add journiv (ct) 2026-09-07 13:16:28 +00:00
3 changed files with 206 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
__ _
/ /___ __ ___________ (_) __
__ / / __ \/ / / / ___/ __ \/ / | / /
/ /_/ / /_/ / /_/ / / / / / / /| |/ /
\____/\____/\__,_/_/ /_/ /_/_/ |___/
+69
View File
@@ -0,0 +1,69 @@
#!/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/journiv/journiv-app
APP="Journiv"
var_tags="${var_tags:-journal;notes}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-12}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
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/journiv ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "journiv" "journiv/journiv-app"; then
msg_info "Stopping Services"
systemctl stop journiv journiv-worker journiv-beat
msg_ok "Stopped Services"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "journiv" "journiv/journiv-app" "tarball"
msg_info "Updating Python Environment"
cd /opt/journiv
$STD uv sync --locked --no-editable --no-install-project
msg_ok "Updated Python Environment"
msg_info "Running Database Migrations"
set -a
source /opt/journiv.env
set +a
$STD /opt/journiv/.venv/bin/python -c "from alembic.config import main; main(['upgrade', 'head'])"
msg_ok "Ran Database Migrations"
msg_info "Starting Services"
systemctl start journiv journiv-worker journiv-beat
msg_ok "Started Services"
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}http://${IP}:8000${CL}"
+131
View File
@@ -0,0 +1,131 @@
#!/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/journiv/journiv-app
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 \
libffi-dev \
libpq-dev \
libmagic1 \
libheif1 \
libde265-0 \
libpango-1.0-0 \
libpangoft2-1.0-0 \
redis-server
systemctl enable -q --now redis-server
msg_ok "Installed Dependencies"
setup_ffmpeg
PG_VERSION="17" setup_postgresql
PG_DB_NAME="journiv" PG_DB_USER="journiv" setup_postgresql_db
UV_PYTHON="3.12" setup_uv
fetch_and_deploy_gh_release "journiv" "journiv/journiv-app" "tarball"
msg_info "Setting up Python Environment"
cd /opt/journiv
$STD uv sync --locked --no-editable --no-install-project
msg_ok "Set up Python Environment"
msg_info "Configuring Journiv"
mkdir -p /opt/journiv_data/{media,logs,exports,imports/temp}
cat <<EOF >/opt/journiv.env
ENVIRONMENT=production
SECRET_KEY=$(openssl rand -hex 32)
DB_DRIVER=postgres
DATABASE_URL=postgresql://journiv:${PG_DB_PASS}@localhost:5432/journiv
REDIS_URL=redis://127.0.0.1:6379/0
MEDIA_ROOT=/opt/journiv_data/media
LOG_DIR=/opt/journiv_data/logs
EXPORT_DIR=/opt/journiv_data/exports
IMPORT_TEMP_DIR=/opt/journiv_data/imports/temp
DOMAIN_NAME=${LOCAL_IP}
DOMAIN_SCHEME=http
PYTHONPATH=/opt/journiv
EOF
chmod 600 /opt/journiv.env
msg_ok "Configured Journiv"
msg_info "Initializing Database"
set -a
source /opt/journiv.env
set +a
$STD /opt/journiv/.venv/bin/python -c "from alembic.config import main; main(['upgrade', 'head'])"
SKIP_DATA_SEEDING=false $STD /opt/journiv/.venv/bin/python -c "from app.core.database import seed_initial_data; seed_initial_data()"
msg_ok "Initialized Database"
msg_info "Creating Services"
cat <<EOF >/etc/systemd/system/journiv.service
[Unit]
Description=Journiv
Wants=network-online.target
After=network-online.target postgresql.service redis-server.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/journiv
EnvironmentFile=/opt/journiv.env
ExecStart=/opt/journiv/.venv/bin/python -m gunicorn app.main:app -w 2 -k uvicorn.workers.UvicornWorker --timeout 300 -b 0.0.0.0:8000
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/journiv-worker.service
[Unit]
Description=Journiv Celery Worker
Wants=network-online.target
After=network-online.target journiv.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/journiv
EnvironmentFile=/opt/journiv.env
ExecStart=/opt/journiv/.venv/bin/python -m celery -A app.core.celery_app worker --loglevel=info
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/journiv-beat.service
[Unit]
Description=Journiv Celery Beat
Wants=network-online.target
After=network-online.target journiv.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/journiv
EnvironmentFile=/opt/journiv.env
ExecStart=/opt/journiv/.venv/bin/python -m celery -A app.core.celery_app beat --loglevel=info --scheduler redbeat.RedBeatScheduler --pidfile=/run/journiv-beat.pid
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now journiv journiv-worker journiv-beat
msg_ok "Created Services"
motd_ssh
customize
cleanup_lxc