From 23a27bcda4535f16f859d78109333a723179cde2 Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 14:18:06 +0100 Subject: [PATCH] Flatnotes (#10857) * Add flatnotes (ct) * Update flatnotes.json --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- ct/flatnotes.sh | 79 +++++++++++++++++++++++++++++ frontend/public/json/flatnotes.json | 35 +++++++++++++ install/flatnotes-install.sh | 63 +++++++++++++++++++++++ 3 files changed, 177 insertions(+) create mode 100644 ct/flatnotes.sh create mode 100644 frontend/public/json/flatnotes.json create mode 100644 install/flatnotes-install.sh diff --git a/ct/flatnotes.sh b/ct/flatnotes.sh new file mode 100644 index 000000000..ec928b69b --- /dev/null +++ b/ct/flatnotes.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: luismco +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/dullage/flatnotes + +APP="Flatnotes" +var_tags="${var_tags:-notes}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-4}" +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/flatnotes ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "flatnotes" "dullage/flatnotes"; then + msg_info "Stopping Service" + systemctl stop flatnotes + msg_ok "Stopped Service" + + msg_info "Backing up Configuration and Data" + cp /opt/flatnotes/.env /opt/flatnotes.env + cp -r /opt/flatnotes/data /opt/flatnotes_data_backup + msg_ok "Backed up Configuration and Data" + + fetch_and_deploy_gh_release "flatnotes" "dullage/flatnotes" + + msg_info "Updating Frontend" + cd /opt/flatnotes/client + $STD npm install + $STD npm run build + msg_ok "Updated Frontend" + + msg_info "Updating Backend" + cd /opt/flatnotes + rm -f uv.lock + $STD /usr/local/bin/uvx migrate-to-uv + $STD /usr/local/bin/uv sync + msg_ok "Updated Backend" + + msg_info "Restoring Configuration and Data" + cp /opt/flatnotes.env /opt/flatnotes/.env + cp -r /opt/flatnotes_data_backup/. /opt/flatnotes/data + rm -f /opt/flatnotes.env + rm -r /opt/flatnotes_data_backup + msg_ok "Restored Configuration and Data" + + msg_info "Starting Service" + systemctl start flatnotes + 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 "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}" + diff --git a/frontend/public/json/flatnotes.json b/frontend/public/json/flatnotes.json new file mode 100644 index 000000000..733e80026 --- /dev/null +++ b/frontend/public/json/flatnotes.json @@ -0,0 +1,35 @@ +{ + "name": "Flatnotes", + "slug": "flatnotes", + "categories": [ + 12 + ], + "date_created": "2026-01-16", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8080, + "documentation": "https://github.com/dullage/flatnotes/wiki", + "website": "https://github.com/dullage/flatnotes", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/flatnotes.webp", + "config_path": "/opt/flatnotes/.env", + "description": "A self-hosted, database-less note-taking web app that utilises a flat folder of markdown files for storage.", + "install_methods": [ + { + "type": "default", + "script": "ct/flatnotes.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 4, + "os": "debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} diff --git a/install/flatnotes-install.sh b/install/flatnotes-install.sh new file mode 100644 index 000000000..e0f66387e --- /dev/null +++ b/install/flatnotes-install.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: luismco +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/dullage/flatnotes + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +fetch_and_deploy_gh_release "flatnotes" "dullage/flatnotes" +USE_UVX=YES setup_uv +setup_nodejs + +msg_info "Installing Backend" +cd /opt/flatnotes +$STD /usr/local/bin/uvx migrate-to-uv +$STD /usr/local/bin/uv sync +mkdir /opt/flatnotes/data +msg_ok "Installed Backend" + +msg_info "Installing Frontend" +cd /opt/flatnotes/client +$STD npm install +$STD npm run build +msg_ok "Installed Frontend" + + +msg_info "Creating Service" +cat </opt/flatnotes/.env +FLATNOTES_AUTH_TYPE='none' +FLATNOTES_PATH='/opt/flatnotes/data/' +#FLATNOTES_USERNAME='username' +#FLATNOTES_PASSWORD='password' +#FLATNOTES_SECRET_KEY='secret-key' +EOF +cat </etc/systemd/system/flatnotes.service +[Unit] +Description=Flatnotes +After=network.target + +[Service] +Type=simple +WorkingDirectory=/opt/flatnotes +EnvironmentFile=/opt/flatnotes/.env +ExecStart=/opt/flatnotes/.venv/bin/python -m uvicorn main:app --app-dir server --host 0.0.0.0 --port 8080 --proxy-headers +Restart=on-failure +RestartSec=10 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now flatnotes +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc