mirror of
https://github.com/anyproto/any-sync-dockercompose.git
synced 2025-06-08 14:07:02 +09:00
added EXTERNAL_LISTEN_HOST
added fileLimit
This commit is contained in:
parent
195891a3a1
commit
ea1ce33660
9 changed files with 50 additions and 14 deletions
2
.env
2
.env
|
@ -11,6 +11,8 @@ MONGO_VERSION=7.0.2
|
||||||
REDIS_VERSION=7.2.0-v6
|
REDIS_VERSION=7.2.0-v6
|
||||||
S3_EMULATOR_VERSION=0.0.1
|
S3_EMULATOR_VERSION=0.0.1
|
||||||
|
|
||||||
|
EXTERNAL_LISTEN_HOST="127.0.0.1"
|
||||||
|
|
||||||
ANY_SYNC_NODE_1_HOST=any-sync-node-1
|
ANY_SYNC_NODE_1_HOST=any-sync-node-1
|
||||||
ANY_SYNC_NODE_1_PORT=1001
|
ANY_SYNC_NODE_1_PORT=1001
|
||||||
ANY_SYNC_NODE_1_ADDRESSES=${ANY_SYNC_NODE_1_HOST}:${ANY_SYNC_NODE_1_PORT}
|
ANY_SYNC_NODE_1_ADDRESSES=${ANY_SYNC_NODE_1_HOST}:${ANY_SYNC_NODE_1_PORT}
|
||||||
|
|
|
@ -6,11 +6,11 @@ COPY --chmod=777 docker-generateconfig/generate_config.sh .env .
|
||||||
RUN ./generate_config.sh
|
RUN ./generate_config.sh
|
||||||
|
|
||||||
FROM alpine:3.18.4
|
FROM alpine:3.18.4
|
||||||
RUN apk add --no-cache bash perl
|
RUN apk add --no-cache bash yq perl python3 py3-yaml
|
||||||
WORKDIR /opt/processing
|
WORKDIR /opt/processing
|
||||||
COPY docker-generateconfig/etc/ tmp-etc/
|
COPY docker-generateconfig/etc/ tmp-etc/
|
||||||
COPY --chmod=777 docker-generateconfig/processing.sh .
|
COPY --chmod=777 docker-generateconfig/processing.sh .
|
||||||
|
COPY --chmod=777 docker-generateconfig/setListenIp.py .
|
||||||
COPY --from=generator /opt/generateconfig/ generateconfig/
|
COPY --from=generator /opt/generateconfig/ generateconfig/
|
||||||
|
|
||||||
CMD ./processing.sh
|
CMD ./processing.sh
|
||||||
|
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -19,6 +19,8 @@ pull:
|
||||||
|
|
||||||
down:
|
down:
|
||||||
docker compose down
|
docker compose down
|
||||||
|
logs:
|
||||||
|
docker compose logs -f
|
||||||
|
|
||||||
# build with "plain" log for debug
|
# build with "plain" log for debug
|
||||||
build:
|
build:
|
||||||
|
|
13
README.md
13
README.md
|
@ -65,9 +65,18 @@ Self-host for any-sync, designed for review and testing purposes.
|
||||||
db.getMongo().setReadPref('primaryPreferred'); db.nodeConf.find().sort( { _id: -1 } ).limit(1)
|
db.getMongo().setReadPref('primaryPreferred'); db.nodeConf.find().sort( { _id: -1 } ).limit(1)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Set specific versions
|
* run client
|
||||||
|
```
|
||||||
|
# macos example
|
||||||
|
ANYTYPE_LOG_LEVEL="*=DEBUG" ANYPROF=:6060 ANY_SYNC_NETWORK=<pathToRepo>/any-sync-dockercompose/etc/client.yml /Applications/Anytype.app/Contents/MacOS/Anytype
|
||||||
|
```
|
||||||
|
|
||||||
|
## configuration
|
||||||
Use file .env
|
Use file .env
|
||||||
### Compatible versions
|
* Set specific versions: find and edit variables with suffix "_VERSION"
|
||||||
|
* Set external listen host: default 127.0.0.1, for change you need edit variable "EXTERNAL_LISTEN_HOST"
|
||||||
|
|
||||||
|
## Compatible versions
|
||||||
You can find compatible versions on these pages:
|
You can find compatible versions on these pages:
|
||||||
* stable versions, used in [production](https://puppetdoc.anytype.io/api/v1/prod-any-sync-compatible-versions/)
|
* 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/)
|
* unstable versions, used in [test stand](https://puppetdoc.anytype.io/api/v1/stage1-any-sync-compatible-versions/)
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
version: "3.9"
|
|
||||||
services:
|
|
||||||
generateconfig:
|
|
||||||
image: generateconfig
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile-generateconfig
|
|
||||||
volumes:
|
|
||||||
- ./tmp/generateconfig/:/generateconfig/
|
|
||||||
command: /gen.sh
|
|
|
@ -24,3 +24,8 @@ quic:
|
||||||
- %ANY_SYNC_COORDINATOR_QUIC_ADDRESSES%
|
- %ANY_SYNC_COORDINATOR_QUIC_ADDRESSES%
|
||||||
writeTimeoutSec: 10
|
writeTimeoutSec: 10
|
||||||
dialTimeoutSec: 10
|
dialTimeoutSec: 10
|
||||||
|
|
||||||
|
fileLimit:
|
||||||
|
limitDefault: 1099511627776
|
||||||
|
limitAlphaUsers: 1099511627776
|
||||||
|
limitNightlyUsers: 1099511627776
|
||||||
|
|
|
@ -39,6 +39,7 @@ if ! [[ -s account0.yml ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
yq --indent 4 --inplace 'del(.creationTime)' nodes.yml
|
||||||
yq --indent 4 --inplace ".networkId |= \"${NETWORK_ID}\"" nodes.yml
|
yq --indent 4 --inplace ".networkId |= \"${NETWORK_ID}\"" nodes.yml
|
||||||
yq --indent 4 --inplace ".account.signingKey |= \"${NETWORK_SIGNING_KEY}\"" account3.yml
|
yq --indent 4 --inplace ".account.signingKey |= \"${NETWORK_SIGNING_KEY}\"" account3.yml
|
||||||
yq --indent 4 --inplace ".account.signingKey |= \"${NETWORK_SIGNING_KEY}\"" account5.yml
|
yq --indent 4 --inplace ".account.signingKey |= \"${NETWORK_SIGNING_KEY}\"" account5.yml
|
||||||
|
|
|
@ -16,6 +16,12 @@ for node_type in filenode coordinator consensusnode; do
|
||||||
mkdir -p "${dest_path}/any-sync-${node_type}"
|
mkdir -p "${dest_path}/any-sync-${node_type}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# add external listen host
|
||||||
|
./setListenIp.py "${EXTERNAL_LISTEN_HOST}" "generateconfig/nodes.yml"
|
||||||
|
|
||||||
|
# create config for clients
|
||||||
|
cp "generateconfig/nodes.yml" "${dest_path}/client.yml"
|
||||||
|
|
||||||
# Generate network file
|
# Generate network file
|
||||||
sed 's|^| |; 1s|^|network:\n|' "generateconfig/nodes.yml" > "${network_file}"
|
sed 's|^| |; 1s|^|network:\n|' "generateconfig/nodes.yml" > "${network_file}"
|
||||||
|
|
||||||
|
|
21
docker-generateconfig/setListenIp.py
Executable file
21
docker-generateconfig/setListenIp.py
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
listenHost = sys.argv[1]
|
||||||
|
yamlFile = sys.argv[2]
|
||||||
|
|
||||||
|
with open(yamlFile, 'r') as file:
|
||||||
|
config = yaml.load(file,Loader=yaml.Loader)
|
||||||
|
|
||||||
|
for index, nodes in enumerate(config['nodes']):
|
||||||
|
addresses = nodes['addresses']
|
||||||
|
port = addresses[0].split(':')[1]
|
||||||
|
listenAddress = listenHost +':'+ port
|
||||||
|
if listenAddress not in addresses:
|
||||||
|
addresses.append(listenAddress)
|
||||||
|
|
||||||
|
with open(yamlFile, 'w') as file:
|
||||||
|
yaml.dump(config, file)
|
Loading…
Add table
Add a link
Reference in a new issue