From d6ff47a71c62876312c2c0d043eed18b73bb1174 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Sun, 25 Oct 2026 12:11:59 +0100 Subject: [PATCH] Anytype Server: keep the .env across updates and recreate a lost one (#18155) --- ct/anytype-server.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ct/anytype-server.sh b/ct/anytype-server.sh index 3c08a9563..bb6fa8783 100644 --- a/ct/anytype-server.sh +++ b/ct/anytype-server.sh @@ -37,13 +37,25 @@ function update_script() { systemctl stop anytype msg_ok "Stopped Service" - create_backup /opt/anytype/data + create_backup /opt/anytype/data /opt/anytype/.env CLEAN_INSTALL=1 fetch_and_deploy_gh_release "anytype" "grishy/any-sync-bundle" "prebuild" "latest" "/opt/anytype" "any-sync-bundle_*_linux_$(arch_resolve).tar.gz" chmod +x /opt/anytype/any-sync-bundle restore_backup + if [[ ! -f /opt/anytype/.env ]]; then + 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=$(hostname -I | awk '{print $1}') +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 + fi + msg_info "Starting Service" systemctl start anytype msg_ok "Started Service"