mirror of
https://github.com/anyproto/any-sync-dockercompose.git
synced 2025-06-08 14:07:02 +09:00
Merge pull request #23 from anyproto/fix_aws_credentials_config
Fix aws credentials config
This commit is contained in:
commit
fd764bf5f3
5 changed files with 25 additions and 16 deletions
|
@ -1,3 +0,0 @@
|
||||||
[default]
|
|
||||||
aws_access_key_id=minio_access_key
|
|
||||||
aws_secret_access_key=minio_secret_key
|
|
10
Makefile
10
Makefile
|
@ -4,7 +4,10 @@ include .env
|
||||||
generate_config:
|
generate_config:
|
||||||
mkdir -p ./storage/docker-generateconfig/
|
mkdir -p ./storage/docker-generateconfig/
|
||||||
docker build -t generateconfig -f Dockerfile-generateconfig .
|
docker build -t generateconfig -f Dockerfile-generateconfig .
|
||||||
docker run --rm --volume ${CURDIR}/etc:/opt/processing/etc --volume ${CURDIR}/storage/docker-generateconfig:/opt/processing/docker-generateconfig --name any-sync-generator generateconfig
|
docker run --rm \
|
||||||
|
--volume ${CURDIR}/etc:/opt/processing/etc \
|
||||||
|
--volume ${CURDIR}/storage/docker-generateconfig:/opt/processing/docker-generateconfig \
|
||||||
|
--name any-sync-generator generateconfig
|
||||||
|
|
||||||
start: generate_config
|
start: generate_config
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
@ -30,9 +33,8 @@ build:
|
||||||
docker compose build --no-cache --progress plain
|
docker compose build --no-cache --progress plain
|
||||||
|
|
||||||
restart: down start
|
restart: down start
|
||||||
update: down pull start
|
update: pull down start
|
||||||
upgrade: down clean start
|
upgrade: down clean start
|
||||||
|
|
||||||
cleanEtcStorage:
|
cleanEtcStorage:
|
||||||
rm -rf etc/
|
rm -rf etc/ storage/
|
||||||
rm -rf storage/
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ services:
|
||||||
- 8004:8000
|
- 8004:8000
|
||||||
volumes:
|
volumes:
|
||||||
- ./etc/any-sync-filenode/:/etc/any-sync-filenode/
|
- ./etc/any-sync-filenode/:/etc/any-sync-filenode/
|
||||||
- ./.aws:/root/.aws:ro
|
- ./etc/.aws:/root/.aws:ro
|
||||||
- ./storage/networkStore/any-sync-filenode/:/networkStore/
|
- ./storage/networkStore/any-sync-filenode/:/networkStore/
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
|
|
4
docker-generateconfig/etc/aws-credentials
Normal file
4
docker-generateconfig/etc/aws-credentials
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
[default]
|
||||||
|
aws_access_key_id=%AWS_ACCESS_KEY_ID%
|
||||||
|
aws_secret_access_key=%AWS_SECRET_ACCESS_KEY%
|
||||||
|
|
|
@ -6,16 +6,14 @@ source generateconfig/.env
|
||||||
dest_path="etc"
|
dest_path="etc"
|
||||||
network_file="${dest_path}/network.yml"
|
network_file="${dest_path}/network.yml"
|
||||||
|
|
||||||
# Create directories for all node
|
# Create directories for all node types
|
||||||
for i in {1..3}; do
|
for node_type in node-1 node-2 node-3 filenode coordinator consensusnode admin; do
|
||||||
mkdir -p "${dest_path}/any-sync-node-${i}"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Create directories for other node types
|
|
||||||
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
|
||||||
|
|
||||||
|
# Create directory for aws credentials
|
||||||
|
mkdir -p "${dest_path}/.aws"
|
||||||
|
|
||||||
# add external listen host
|
# add external listen host
|
||||||
./setListenIp.py "${EXTERNAL_LISTEN_HOST}" "generateconfig/nodes.yml"
|
./setListenIp.py "${EXTERNAL_LISTEN_HOST}" "generateconfig/nodes.yml"
|
||||||
|
|
||||||
|
@ -40,9 +38,17 @@ cat "${network_file}" tmp-etc/common.yml generateconfig/account5.yml tmp-etc/con
|
||||||
cp "generateconfig/nodes.yml" "${dest_path}/any-sync-coordinator/network.yml"
|
cp "generateconfig/nodes.yml" "${dest_path}/any-sync-coordinator/network.yml"
|
||||||
|
|
||||||
# Generate any-sync-admin config
|
# Generate any-sync-admin config
|
||||||
mkdir -p ${dest_path}/any-sync-admin
|
|
||||||
cp "tmp-etc/admin.yml" ${dest_path}/any-sync-admin/config.yml
|
cp "tmp-etc/admin.yml" ${dest_path}/any-sync-admin/config.yml
|
||||||
|
|
||||||
|
# Generate aws credentials
|
||||||
|
cp "tmp-etc/aws-credentials" ${dest_path}/.aws/credentials
|
||||||
|
|
||||||
|
# Replace placeholders for aws credentials
|
||||||
|
placeholders=( "AWS_ACCESS_KEY_ID" "AWS_SECRET_ACCESS_KEY")
|
||||||
|
for placeholder in "${placeholders[@]}"; do
|
||||||
|
perl -i -pe "s|%${placeholder}%|${!placeholder}|g" "${dest_path}/"/.aws/credentials
|
||||||
|
done
|
||||||
|
|
||||||
# Replace placeholders in config files
|
# Replace placeholders in config files
|
||||||
for node_type in node_1 node_2 node_3 coordinator filenode consensusnode; do
|
for node_type in node_1 node_2 node_3 coordinator filenode consensusnode; do
|
||||||
addresses="ANY_SYNC_${node_type^^}_ADDRESSES"
|
addresses="ANY_SYNC_${node_type^^}_ADDRESSES"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue