Skip to content

Commit e787cb6

Browse files
hohodesenfans
authored andcommitted
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 d0d83fa commit e787cb6

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

deployment/samples/docker-compose/docker-compose.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,5 @@ services:
113113
- pyaleph
114114
command: ["daemon", "--enable-pubsub-experiment", "--migrate"]
115115

116-
teeproxy:
117-
restart: always
118-
image: chrislusf/teeproxy:latest
119-
ports:
120-
- "127.0.0.1:8888:8888"
121-
networks:
122-
- pyaleph
123-
command: ["-l", ":8888", "-a", "http://pyaleph-api:4024", "-b", "http://46.255.204.195:4024", "-a.timeout", "30000", "-b.timeout", "30000"]
124-
125116
networks:
126117
pyaleph:

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)