-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix orion environment not working #4857
Conversation
Fixes the current orion environment not working. I have also removed the squid-archive services in favour of our new endpoint `https://archive.joystream.org/graphql`
c9a643d
to
dfd8667
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well, but the default archive gateway on startup is the production chain which doesn't make sense. I think we should keep an archive + gateway in the setup. If we choose to run orion from this repo for the production chain then we set the CUSTOM_ARCHIVE_GATEWAY_URL
env variable to https://archive.joystream.org/graphql
TRUSTED_REVERSE_PROXIES=1 | ||
SESSION_EXPIRY_AFTER_INACTIVITY_MINUTES=60 | ||
SESSION_MAX_DURATION_HOURS=720 | ||
EMAIL_CONFIRMATION_ROUTE=http://localhost:4074/api/v1/confirm-email?token={token} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obviously this will only work when opening email from the machine. But I gather we would most likely disable email confirmation and notifications in a playground setup so thats fine.
@ignazio-bovo The CI check that is failing: because it tries to use the adjacent docker-compose file Please apply the same fixes to that as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple minor fixes needed of archive explorer config. Otherwise working nicely.
With so env variables now in the .env
file and with some similarly named ones, i think in future we need to do a bit of refactoring to make it more manageable.
.env
Outdated
TRUST_PROXY=uniquelocal | ||
|
||
# Sendgrid API | ||
SENDGRID_API_KEY= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an identical SENDGRID_API_KEY
variable below for the faucet.
perhaps we can prefix the one for orion with ORION_SENDGRID_API_KEY
then pass that env variable in docker-compose environment section (so you don't have to modify orion code to expect a different variable name)
postgres.conf
Outdated
@@ -0,0 +1,4 @@ | |||
listen_addresses = '*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename this file to orion-postgres.conf
, there is another PR where I was planning to add a postgres.conf file for the query-node db. It makes sense to have two different conf files for each db instance.
docker-compose-no-bind-volumes.yml
Outdated
- .env | ||
environment: | ||
DB_TYPE: postgres # set to `cockroach` for Cockroach DB | ||
DB_HOST: archive_db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the hostname is incorrect, (should it be orion_archive_db), also the correct port for the archive db ARCHIVE_DB_PORT
is not used here.
I'm seeing connection error log for the explorer container:
2023-09-11 10:54:19 {"level":3,"time":1694415259620,"ns":"sqd:substrate-explorer","msg":"failed to connect to postgres://postgres@archive_db:5432/squid-archive","err":{"errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"archive_db","stack":"Error: getaddrinfo ENOTFOUND archive_db\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)"}}
2023-09-11 10:54:19 {"level":2,"time":1694415259730,"ns":"sqd:substrate-explorer","msg":"listening on port 3000"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need the DB_PORT
also to be set for the explorer, and the renamed postgres.conf
file needs to be adjusted in the docker-compose file for the orion-db service to match the new name:
volumes:
- orion-db-data:/var/lib/postgresql/data
- ./orion-postgres.conf:/etc/postgresql/postgresql.conf
|
||
# Sendgrid API | ||
ORION_SENDGRID_API_KEY= | ||
[email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be used in docker-compose to pass the expected env var name to orion like so:
environment:
- SENDGRID_API_KEY=${ORION_SENDGRID_API_KEY}
- SENDGRID_FROM_EMAIL=${ORION_SENDGRID_FROM_EMAIL}
Fixes the current orion environment not working when starting the playground
I have also removed the squid-archive services in favour of our new archive endpoint