From 7ab27baaed9bc79375281240818b93a589230f82 Mon Sep 17 00:00:00 2001 From: Grigory Efimov Date: Fri, 5 Apr 2024 11:29:40 -0300 Subject: [PATCH 1/7] refactoring md documentation files --- CHANGELOG.md | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 28 ++++++++++-- UPGRADE.md | 31 +++++++++++++ 3 files changed, 181 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 UPGRADE.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..207f442 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,125 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + + +## Unreleased + +[Compare with latest](https://github.com/anyproto/any-sync-dockercompose/compare/v2.1.2...HEAD) + +### Added + +- added EXTERNAL_ANY_SYNC_ADMIN_PORT ([6f1e4e7](https://github.com/anyproto/any-sync-dockercompose/commit/6f1e4e7b9fddc019745d8b479ab7c70411c0520c) by Grigory Efimov). + +### Fixed + +- fix replica init command ([5339177](https://github.com/anyproto/any-sync-dockercompose/commit/5339177c69f9a67d24458aab0af6d81c7148e426) by Kirill Shklyaev). +- fix status 'unhealthy' in mongo replset configuration ([75eb15b](https://github.com/anyproto/any-sync-dockercompose/commit/75eb15ba344cec35d14880a78bd14a961218989a) by Kirill Shklyaev). + + +## [v2.1.2](https://github.com/anyproto/any-sync-dockercompose/releases/tag/v2.1.2) - 2024-02-19 + +[Compare with v2.1.1](https://github.com/anyproto/any-sync-dockercompose/compare/v2.1.1...v2.1.2) + +### Added + +- added automatic changelog generation ([e750942](https://github.com/anyproto/any-sync-dockercompose/commit/e7509426a08dba111f22cad8d7b39dd4a1faf01f) by Kirill Shklyaev). + +### Fixed + +- fixed replacement of variables in aws credentials file ([9c81b9f](https://github.com/anyproto/any-sync-dockercompose/commit/9c81b9f3c3f5e11ad4d3539e9a5c8a78425944a1) by Kirill Shklyaev). + +## [v2.1.1](https://github.com/anyproto/any-sync-dockercompose/releases/tag/v2.1.1) - 2024-02-14 + +[Compare with v2.1.0](https://github.com/anyproto/any-sync-dockercompose/compare/v2.1.0...v2.1.1) + +## [v2.1.0](https://github.com/anyproto/any-sync-dockercompose/releases/tag/v2.1.0) - 2024-02-14 + +[Compare with v2.0.1](https://github.com/anyproto/any-sync-dockercompose/compare/v2.0.1...v2.1.0) + +### Added + +- added docker-compose.any-sync-admin.yml fixed mongo url for any-sync-admin ([62618c0](https://github.com/anyproto/any-sync-dockercompose/commit/62618c074188ec1e462b03ab43e212e87540eb2c) by Grigory Efimov). +- added any-sync-admin ([93362b8](https://github.com/anyproto/any-sync-dockercompose/commit/93362b87eeefe2eca19ce5b2365b9940ea7bee11) by Grigory Efimov). + +## [v2.0.1](https://github.com/anyproto/any-sync-dockercompose/releases/tag/v2.0.1) - 2024-01-24 + +[Compare with v1.0.4](https://github.com/anyproto/any-sync-dockercompose/compare/v1.0.4...v2.0.1) + +### Added + +- Added warning about switching to new s3 backend ([383177a](https://github.com/anyproto/any-sync-dockercompose/commit/383177a7c5ac6289dcae50b3cb3b966e77b64022) by Kirill Shklyaev). +- Added new s3 backend: minio, added health checks for services ([0716d8b](https://github.com/anyproto/any-sync-dockercompose/commit/0716d8b60c2f6f5e94831b3a4c9230e0bb888c2b) by Kirill Shklyaev). +- Added information on how to use config file ([4c9ed0d](https://github.com/anyproto/any-sync-dockercompose/commit/4c9ed0d7644ccac482a0aed05a0c99b687356666) by Kirill Shklyaev). +- Added new variables for coordinator, filenode and minio s3 ([199be20](https://github.com/anyproto/any-sync-dockercompose/commit/199be204f5b4c33b52eb7b5d38244a993163fcf3) by Kirill Shklyaev). + +## [v1.0.4](https://github.com/anyproto/any-sync-dockercompose/releases/tag/v1.0.4) - 2024-01-15 + +[Compare with v1.0.3](https://github.com/anyproto/any-sync-dockercompose/compare/v1.0.3...v1.0.4) + +### Added + +- added EXTERNAL_LISTEN_HOST added fileLimit ([ea1ce33](https://github.com/anyproto/any-sync-dockercompose/commit/ea1ce33660ecc840b9509386069a4dfaada72eb1) by Grigory Efimov). + +### Fixed + +- fixed redis-servr data dir and fixed s3 emulator dns name ([ebf56e9](https://github.com/anyproto/any-sync-dockercompose/commit/ebf56e9190ef89d7abaa617bae862b082445cbe2) by Grigory Efimov). + +## [v1.0.3](https://github.com/anyproto/any-sync-dockercompose/releases/tag/v1.0.3) - 2024-01-15 + +[Compare with v1.0.2](https://github.com/anyproto/any-sync-dockercompose/compare/v1.0.2...v1.0.3) + +### Fixed + +- Fixed installation of yq-package in Dockerfile-generateconfig ([37aa8c8](https://github.com/anyproto/any-sync-dockercompose/commit/37aa8c8702b339b8ebf8e136a9a25e1cfa9899bf) by Kirill Shklyaev). + +## [v1.0.2](https://github.com/anyproto/any-sync-dockercompose/releases/tag/v1.0.2) - 2023-11-14 + +[Compare with v1.0.1](https://github.com/anyproto/any-sync-dockercompose/compare/v1.0.1...v1.0.2) + +### Added + +- added versions to env, fixed variable names in script, fixes in Makefile ([7e307b1](https://github.com/anyproto/any-sync-dockercompose/commit/7e307b1bd32421d874a378c0e1f72816ffb2ccdd) by Kirill Shklyaev). + +## [v1.0.1](https://github.com/anyproto/any-sync-dockercompose/releases/tag/v1.0.1) - 2023-10-25 + +[Compare with v1.0.0](https://github.com/anyproto/any-sync-dockercompose/compare/v1.0.0...v1.0.1) + +## [v1.0.0](https://github.com/anyproto/any-sync-dockercompose/releases/tag/v1.0.0) - 2023-10-02 + +[Compare with v0.0.1](https://github.com/anyproto/any-sync-dockercompose/compare/v0.0.1...v1.0.0) + +### Added + +- added quic support ([23e5db8](https://github.com/anyproto/any-sync-dockercompose/commit/23e5db8d0c0186645e67bdef930958196d2dfc05) by Grigory Efimov). + +## [v0.0.1](https://github.com/anyproto/any-sync-dockercompose/releases/tag/v0.0.1) - 2023-09-14 + +[Compare with first commit](https://github.com/anyproto/any-sync-dockercompose/compare/6a264d71210ff52aa7dc490b1c98d821844911f0...v0.0.1) + +### Added + +- added .github/workflows/release.yml ([bca1da3](https://github.com/anyproto/any-sync-dockercompose/commit/bca1da3ac10d6795dadc825c99c55a795c71839c) by Grigory Efimov). +- added .github/workflows/ossf.yml ([a1dd97f](https://github.com/anyproto/any-sync-dockercompose/commit/a1dd97f88ad446fe179b10fa25719eb162b6a0e9) by Grigory Efimov). +- added anyconf for generate configs ([ea780d0](https://github.com/anyproto/any-sync-dockercompose/commit/ea780d0b74d5eb1aa222860f36066e932e772924) by Grigory Efimov). +- added .github/CODEOWNERS ([1f640b0](https://github.com/anyproto/any-sync-dockercompose/commit/1f640b01683c17ed56d3ced1a546724611ef19db) by Grigory Efimov). +- added consensusnode ([6598910](https://github.com/anyproto/any-sync-dockercompose/commit/65989100628f4b4ec33959fdec017c1fca03e699) by Grigory Efimov). +- added docker-compose.any-sync-tools.yml ([89a5608](https://github.com/anyproto/any-sync-dockercompose/commit/89a56087d17d8df5c8faaa156bbae3417cd4c38a) by Grigory Efimov). +- Add default space deleter running configuration ([ea17f9d](https://github.com/anyproto/any-sync-dockercompose/commit/ea17f9d39622f49b6d994ca114c1fbed23774a84) by Dmitry Bilienko). +- added generate_etc ([81dbabe](https://github.com/anyproto/any-sync-dockercompose/commit/81dbabe0c7489eeef31d133fb96c06cf3a32af80) by Kirill). +- add specific versions support ([a52d495](https://github.com/anyproto/any-sync-dockercompose/commit/a52d4956a2611ac5550ac3200af8c755c72bf158) by Kirill). +- add s3-emulator ([e47a252](https://github.com/anyproto/any-sync-dockercompose/commit/e47a25222714bf8a6cbc9f4a5350734a8438e4fb) by Kirill). +- add README.md ([0da0f00](https://github.com/anyproto/any-sync-dockercompose/commit/0da0f00224edf8299469a3052714fefb83c563c5) by Kirill). + +### Fixed + +- fixed generateconfig - remove ssh ([88eaaf2](https://github.com/anyproto/any-sync-dockercompose/commit/88eaaf2eb26e9cc5c1d3c146a028cf6a22b0f216) by Grigory Efimov). +- fixed yq ([4284b10](https://github.com/anyproto/any-sync-dockercompose/commit/4284b105f5fc67a687a44073f71de88546df1330) by Grigory Efimov). +- fixed README.md ([762a2c7](https://github.com/anyproto/any-sync-dockercompose/commit/762a2c703aa8d61d1f6c4521999ead5dc200665c) by Kirill). +- fixed docker-compose ([9c2bcef](https://github.com/anyproto/any-sync-dockercompose/commit/9c2bceffad57a3cdcc47f468d3f2acb67c2f4379) by Kirill). +- fixed Makefile add info in README.md ([c30fc21](https://github.com/anyproto/any-sync-dockercompose/commit/c30fc210f068950ee9d9d6e39f0697d613decc52) by Kirill). +- fixed Makefile ([bbf60b1](https://github.com/anyproto/any-sync-dockercompose/commit/bbf60b117f279de6073633d62f04a00b8715b093) by Kirill). + diff --git a/README.md b/README.md index df256b7..235162a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,18 @@ Self-host for any-sync, designed for personal usage or for review and testing pu > If you plan to self-host a heavily used any-sync network, please consider other options. > [!WARNING] -> Starting from release version v2.0.1, we have transitioned from the **s3-emulator** to **minio** as the data storage for any-sync-filenode. Please note that this change will result in the loss of any-sync-filenode data (stored at the path `./storage/s3_root`). +> Before upgrading please read [Upgrading](#upgrading) + +## Table of Contents +- [Prepare](#prepare) +- [Usage](#usage) +- [Configuration](#configuration) +- [Compatible versions](#compatible-versions) +- [Local build](#local-build) +- [Limits web admin](#limits-web-admin) +- [Upgrading](#upgrading) +- [Changelog](#changelog) +- [Contribution](#contribution) ## Prepare * install docker and docker-compose https://docs.docker.com/compose/install/linux/ @@ -95,7 +106,7 @@ You can find compatible versions on these pages: * stable versions, used in [production](https://puppetdoc.anytype.io/api/v1/prod-any-sync-compatible-versions/) * unstable versions, used in [test stand](https://puppetdoc.anytype.io/api/v1/stage1-any-sync-compatible-versions/) -## "local build" images usage +## Local build If you need to create local build binaries for any-sync-*, you can do so by using the "overrides" functionality in docker-compose. * clone repos @@ -111,9 +122,20 @@ If you need to create local build binaries for any-sync-*, you can do so by usin make restart ``` -## limits web admin +## Limits web admin open link in browser: http://127.0.0.1:80 +## Upgrading +For detailed instructions of upgrading to the latest version, please see the [UPGRADE.md](./UPGRADE.md) file. + +## Changelog +For a detailed list of changes in each version, check out the [CHANGELOG.md](./CHANGELOG.md) file. +For auto generate CHANGELOG.md file please use commands: +``` +pip install git-changelog +git-changelog --output CHANGELOG.md +``` + ## Contribution Thank you for your desire to develop Anytype together! diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 0000000..8b6eba1 --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,31 @@ +# Upgrade Guide + +This document provides detailed instructions for upgrading between different versions of the project. + +## General Recommendations + +- Always back up data dir (./storage) and configuration (./etc) before starting the upgrade process. +- Follow the instructions for the specific version you are upgrading to. + +## Generic Update Routine + +### Before the Upgrade + +1. Ensure you have a complete backup of your data and configuration. + +### Upgrade Process + +usually enough to run this update command ```make update``` +in some cases it may be necessary to run ```make upgrade``` + + +### After the Upgrade + +1. Check logs for any errors. ```docker-compose logs -f``` +2. Verify that all critical functionalities are working as expected. + +## Upgrading from v1.x.x to 2.x.x + +Starting with version 2.0.1, we have switched from s3-emulator to MinIO for storing data uploaded via the any-sync-filenode daemon. +To preserve your data, you will need to manually migrate it from s3-emulator to MinIO. +For this You can use https://min.io/docs/minio/linux/reference/minio-mc/mc-mirror.html. From e2e673d8db55d323452c6b942fc24a0e41f8df8b Mon Sep 17 00:00:00 2001 From: Grigory Efimov Date: Fri, 5 Apr 2024 11:31:59 -0300 Subject: [PATCH 2/7] UPGRADE.md: small fix --- UPGRADE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADE.md b/UPGRADE.md index 8b6eba1..15eeff9 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -24,7 +24,7 @@ in some cases it may be necessary to run ```make upgrade``` 1. Check logs for any errors. ```docker-compose logs -f``` 2. Verify that all critical functionalities are working as expected. -## Upgrading from v1.x.x to 2.x.x +## Upgrading from v1.x.x to v2.x.x Starting with version 2.0.1, we have switched from s3-emulator to MinIO for storing data uploaded via the any-sync-filenode daemon. To preserve your data, you will need to manually migrate it from s3-emulator to MinIO. From 97ba90a0570a270dea6c338f8201aca697052f4b Mon Sep 17 00:00:00 2001 From: Grigory Efimov Date: Fri, 5 Apr 2024 11:32:09 -0300 Subject: [PATCH 3/7] docker-compose.yml: refactoring mongo - reduced to one instance --- docker-compose.yml | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 337089e..d13470c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,31 +3,13 @@ version: "3.9" services: mongo-1: image: "mongo:${MONGO_VERSION}" + environment: + MONGO_INITDB_REPLICA_SET_NAME: ${MONGO_REPLICA_SET} command: --replSet ${MONGO_REPLICA_SET} --port ${MONGO_1_PORT} ports: - "${MONGO_1_PORT}:${MONGO_1_PORT}" volumes: - ./storage/mongo-1/:/data/db - healthcheck: - test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'${MONGO_REPLICA_SET}',members:[{_id:0,host:'mongo-1:${MONGO_1_PORT}'},{_id:1,host:'mongo-2:${MONGO_2_PORT}'},{_id:2,host:'mongo-3:${MONGO_3_PORT}'}]}) }" | mongosh --port ${MONGO_1_PORT} --quiet - interval: 10s - start_period: 30s - - mongo-2: - image: "mongo:${MONGO_VERSION}" - command: --replSet ${MONGO_REPLICA_SET} --port ${MONGO_2_PORT} - ports: - - "${MONGO_2_PORT}:${MONGO_2_PORT}" - volumes: - - ./storage/mongo-2/:/data/db - - mongo-3: - image: "mongo:${MONGO_VERSION}" - command: --replSet ${MONGO_REPLICA_SET} --port ${MONGO_3_PORT} - ports: - - "${MONGO_3_PORT}:${MONGO_3_PORT}" - volumes: - - ./storage/mongo-3/:/data/db redis: image: "redis/redis-stack-server:${REDIS_VERSION}" @@ -208,8 +190,6 @@ services: depends_on: - redis - mongo-1 - - mongo-2 - - mongo-3 ports: - "${EXTERNAL_ANY_SYNC_ADMIN_PORT}:${ANY_SYNC_ADMIN_PORT}" volumes: From eeb22a00ad7d30f2be58160edcb1f44ca11b8108 Mon Sep 17 00:00:00 2001 From: Grigory Efimov Date: Fri, 5 Apr 2024 11:38:13 -0300 Subject: [PATCH 4/7] README.md fix UPGRADE.md link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 235162a..1ea2a4d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Self-host for any-sync, designed for personal usage or for review and testing pu > If you plan to self-host a heavily used any-sync network, please consider other options. > [!WARNING] -> Before upgrading please read [Upgrading](#upgrading) +> Before upgrading please read [UPGRADE.md](./UPGRADE.md) ## Table of Contents - [Prepare](#prepare) From 7b11efb32baec4681ae8f4fec157b02f301db4c8 Mon Sep 17 00:00:00 2001 From: Grigory Efimov Date: Fri, 5 Apr 2024 11:52:34 -0300 Subject: [PATCH 5/7] UPGRADE.md added mongo upgrade instruction --- UPGRADE.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 15eeff9..b8978a2 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -29,3 +29,15 @@ in some cases it may be necessary to run ```make upgrade``` Starting with version 2.0.1, we have switched from s3-emulator to MinIO for storing data uploaded via the any-sync-filenode daemon. To preserve your data, you will need to manually migrate it from s3-emulator to MinIO. For this You can use https://min.io/docs/minio/linux/reference/minio-mc/mc-mirror.html. + +## Upgrading from v2.x.x to v3.x.x +Starting with version 3.0.0, we have reduced mongo instances from 3 to 1. +For correctly working You need reconfigure mongo cluster. +After Upgrade please run: +``` +docker compose exec mongo-1 mongosh 127.0.0.1:27001/coordinator +use admin +var cfg = rs.conf() +cfg.members = [{ _id: 0, host: "mongo-1:27001" }] +rs.reconfig(cfg, {force: true}) +``` From 7f4550450e659a59fb16a5fa17f470ecb9566bb4 Mon Sep 17 00:00:00 2001 From: Grigory Efimov Date: Fri, 5 Apr 2024 13:08:58 -0300 Subject: [PATCH 6/7] .env: removed mongo-{2,3} UPGRADE.md: refactoring mongo upgrade command --- .env | 4 +--- UPGRADE.md | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.env b/.env index 80e3b1c..add49aa 100644 --- a/.env +++ b/.env @@ -57,9 +57,7 @@ ANY_SYNC_CONSENSUSNODE_QUIC_PORT=1016 ANY_SYNC_CONSENSUSNODE_QUIC_ADDRESSES=${ANY_SYNC_CONSENSUSNODE_HOST}:${ANY_SYNC_CONSENSUSNODE_QUIC_PORT} MONGO_1_PORT=27001 -MONGO_2_PORT=27002 -MONGO_3_PORT=27003 -MONGO_CONNECT=mongodb://mongo-1:${MONGO_1_PORT},mongo-2:${MONGO_2_PORT},mongo-3:${MONGO_3_PORT} +MONGO_CONNECT=mongodb://mongo-1:${MONGO_1_PORT} MONGO_REPLICA_SET=rs0 MONGO_URL=${MONGO_CONNECT}/?replicaSet=${MONGO_REPLICA_SET} diff --git a/UPGRADE.md b/UPGRADE.md index b8978a2..43b1f8d 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -35,9 +35,5 @@ Starting with version 3.0.0, we have reduced mongo instances from 3 to 1. For correctly working You need reconfigure mongo cluster. After Upgrade please run: ``` -docker compose exec mongo-1 mongosh 127.0.0.1:27001/coordinator -use admin -var cfg = rs.conf() -cfg.members = [{ _id: 0, host: "mongo-1:27001" }] -rs.reconfig(cfg, {force: true}) +docker compose exec mongo-1 mongosh --port 27001 --eval 'rs.reconfig({_id: rs.conf()._id, members: [{ _id: 0, host: "mongo-1:27001" }]}, {force: true});' ``` From 78ac4eda7217d3ec420dea675e25a7d96c5ca884 Mon Sep 17 00:00:00 2001 From: Grigory Efimov Date: Fri, 5 Apr 2024 16:27:07 -0300 Subject: [PATCH 7/7] docker-compose.yml fixed mongo rs init command --- docker-compose.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d13470c..dd5abbe 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,13 +3,15 @@ version: "3.9" services: mongo-1: image: "mongo:${MONGO_VERSION}" - environment: - MONGO_INITDB_REPLICA_SET_NAME: ${MONGO_REPLICA_SET} command: --replSet ${MONGO_REPLICA_SET} --port ${MONGO_1_PORT} ports: - "${MONGO_1_PORT}:${MONGO_1_PORT}" volumes: - ./storage/mongo-1/:/data/db + healthcheck: + test: echo "try { rs.status() } catch (err) { rs.initiate() }" | mongosh --port ${MONGO_1_PORT} --quiet + interval: 10s + start_period: 30s redis: image: "redis/redis-stack-server:${REDIS_VERSION}"