Skip to content

Commit 1d2246c

Browse files
authored
hoh simplify config (#395)
Instead of making the defaults developer friendly (assuming the developer runs all these services on localhost), assume that users use docker-compose by default.
1 parent 493fd37 commit 1d2246c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/aleph/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def get_defaults():
9292
"sync_contract": "KT1FfEoaNvooDfYrP61Ykct6L8z7w7e2pgnT",
9393
},
9494
"postgres": {
95-
"host": "127.0.0.1",
95+
"host": "postgres",
9696
"port": 5432,
9797
"database": "aleph",
9898
"user": "aleph",
@@ -105,7 +105,7 @@ def get_defaults():
105105
},
106106
"ipfs": {
107107
"enabled": True,
108-
"host": "127.0.0.1",
108+
"host": "ipfs",
109109
"port": 5001,
110110
"gateway_port": 8080,
111111
"id": None,
@@ -118,7 +118,7 @@ def get_defaults():
118118
],
119119
},
120120
"rabbitmq": {
121-
"host": "127.0.0.1",
121+
"host": "rabbitmq",
122122
"port": 5672,
123123
"username": "aleph-p2p",
124124
"password": "change-me!",
@@ -127,7 +127,7 @@ def get_defaults():
127127
"message_exchange": "aleph-messages",
128128
},
129129
"redis": {
130-
"host": "127.0.0.1",
130+
"host": "redis",
131131
"port": 6379,
132132
},
133133
"sentry": {

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ def session_factory(mock_config):
6767
@pytest.fixture
6868
def mock_config(mocker):
6969
config = Config(aleph.config.get_defaults())
70+
71+
# The postgres/redis hosts use Docker network names in the default config.
72+
# We always use localhost for tests.
73+
config.postgres.host.value = "127.0.0.1"
74+
config.redis.host.value = "127.0.0.1"
75+
7076
# To test handle_new_storage
7177
config.storage.store_files.value = True
7278

0 commit comments

Comments
 (0)