From 210b6080cd9ce40392baa4652c4a1569cc3cd1bc Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 29 Jan 2026 10:36:57 +0100 Subject: [PATCH] Update Anytype to use external MongoDB and Redis Stack Switches Anytype deployment to use external MongoDB and Redis Stack instead of embedded databases. Updates default resources to 4GB RAM, 16GB disk, Ubuntu 24.04, and configures MongoDB replica set and Redis Stack installation. Adjusts service dependencies and environment variables accordingly. --- ct/anytype.sh | 8 +++---- frontend/public/json/anytype.json | 10 ++++----- install/anytype-install.sh | 37 +++++++++++++++++++++++++------ 3 files changed, 39 insertions(+), 16 deletions(-) diff --git a/ct/anytype.sh b/ct/anytype.sh index b2af170e8..7525e1eaf 100644 --- a/ct/anytype.sh +++ b/ct/anytype.sh @@ -8,10 +8,10 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV APP="Anytype" var_tags="${var_tags:-notes;productivity;sync}" var_cpu="${var_cpu:-2}" -var_ram="${var_ram:-2048}" -var_disk="${var_disk:-10}" -var_os="${var_os:-debian}" -var_version="${var_version:-13}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-16}" +var_os="${var_os:-ubuntu}" +var_version="${var_version:-24.04}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" diff --git a/frontend/public/json/anytype.json b/frontend/public/json/anytype.json index 88c1abe61..a89835cc9 100644 --- a/frontend/public/json/anytype.json +++ b/frontend/public/json/anytype.json @@ -13,17 +13,17 @@ "website": "https://anytype.io/", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/anytype.webp", "config_path": "/opt/anytype/.env", - "description": "Anytype is a local-first, privacy-focused alternative to Notion. This script deploys the any-sync-bundle which provides a self-hosted sync server for Anytype clients with embedded MongoDB and Redis.", + "description": "Anytype is a local-first, privacy-focused alternative to Notion. This script deploys the any-sync-bundle which provides a self-hosted sync server for Anytype clients with external MongoDB and Redis Stack.", "install_methods": [ { "type": "default", "script": "ct/anytype.sh", "resources": { "cpu": 2, - "ram": 2048, - "hdd": 10, - "os": "Debian", - "version": "13" + "ram": 4096, + "hdd": 16, + "os": "Ubuntu", + "version": "24.04" } } ], diff --git a/install/anytype-install.sh b/install/anytype-install.sh index 458e70d3b..c6dc1e96b 100644 --- a/install/anytype-install.sh +++ b/install/anytype-install.sh @@ -13,21 +13,43 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt install -y ca-certificates -msg_ok "Installed Dependencies" +setup_mongodb + +msg_info "Configuring MongoDB Replica Set" +cat <>/etc/mongod.conf + +replication: + replSetName: "rs0" +EOF +systemctl restart mongod +sleep 3 +$STD mongosh --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "127.0.0.1:27017"}]})' +msg_ok "Configured MongoDB Replica Set" + +msg_info "Installing Redis Stack" +setup_deb822_repo \ + "redis-stack" \ + "https://packages.redis.io/gpg" \ + "https://packages.redis.io/deb" \ + "jammy" \ + "main" +$STD apt-get install -y \ + redis-stack-server +systemctl enable -q --now redis-stack-server +msg_ok "Installed Redis Stack" fetch_and_deploy_gh_release "anytype" "grishy/any-sync-bundle" "prebuild" "latest" "/opt/anytype" "any-sync-bundle_*_linux_amd64.tar.gz" chmod +x /opt/anytype/any-sync-bundle msg_info "Configuring Anytype" -mkdir -p /opt/anytype/data - +mkdir -p /opt/anytype/data/storage cat </opt/anytype/.env ANY_SYNC_BUNDLE_CONFIG=/opt/anytype/data/bundle-config.yml ANY_SYNC_BUNDLE_CLIENT_CONFIG=/opt/anytype/data/client-config.yml ANY_SYNC_BUNDLE_INIT_STORAGE=/opt/anytype/data/storage/ ANY_SYNC_BUNDLE_INIT_EXTERNAL_ADDRS=${LOCAL_IP} +ANY_SYNC_BUNDLE_INIT_MONGO_URI=mongodb://127.0.0.1:27017/ +ANY_SYNC_BUNDLE_INIT_REDIS_URI=redis://127.0.0.1:6379/ ANY_SYNC_BUNDLE_LOG_LEVEL=info EOF msg_ok "Configured Anytype" @@ -36,15 +58,16 @@ msg_info "Creating Service" cat </etc/systemd/system/anytype.service [Unit] Description=Anytype Sync Server (any-sync-bundle) -After=network-online.target +After=network-online.target mongod.service redis-stack-server.service Wants=network-online.target +Requires=mongod.service redis-stack-server.service [Service] Type=simple User=root WorkingDirectory=/opt/anytype EnvironmentFile=/opt/anytype/.env -ExecStart=/opt/anytype/any-sync-bundle start-all-in-one +ExecStart=/opt/anytype/any-sync-bundle start-bundle Restart=on-failure RestartSec=10