Skip to content
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

Chris/fix docker compose and url #247

Merged
merged 2 commits into from Jun 11, 2019
Merged

Conversation

chrisdickinson
Copy link
Collaborator

  • Fixes new URL's pickiness about needing a FQDN param if given a partial path.
  • new URL spells context.url.query.page as context.url.searchParams.get('page')
  • Add default docker environment values so that they all know about each other in docker-compose mode.
  • Add an admonition that "we don't mean for you to deploy a production entropic using docker-compose."

@@ -1,3 +1,5 @@
# docker-compose is provided for development purposes only and is not
Copy link
Contributor

@zacanger zacanger Jun 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an extremely good and important warning

Copy link
Collaborator

@ceejbot ceejbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, about the hard-coded url.

@@ -1,3 +1,5 @@
# docker-compose is provided for development purposes only and is not
# intended for use as a production entropic setup.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contact your doctor if symptoms persist for more than three days.

@@ -29,7 +29,7 @@ class Context {
if (this._parsedUrl) {
return this._parsedUrl;
}
this._parsedUrl = new URL(this.request.url);
this._parsedUrl = new URL(this.request.url, 'http://entropic.dev');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, should be EXTERNAL_HOST, yes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to go with an (inert) URL here because the host value is never used except to keep new URL() from throwing an exception; whereas this code is used from a lot of different services which may not all need (or specify) EXTERNAL_HOST.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good LORD. Fine then.

page: Number(context.url.query.page) || 0,
status: context.url.query.status,
page: Number(context.url.searchParams.get('page')) || 0,
status: context.url.searchParams.get('status'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sure there's a Good Reason™ why url.parse had to go away, leaving us with this less-nice API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will (grudgingly) cede that if you wanted to port this entire thing to a service worker based system of some cloudflare-y variety, you'd have to make this change anyway.

@ceejbot ceejbot merged commit 15ec6fd into master Jun 11, 2019
REDIS_URL: redis://redis:6379
PORT: 3002
PGUSER: postgres
PGDATABASE: entorpic_dev

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo? entorpic instead of entropic 😛

@@ -52,8 +52,8 @@
"lint-fix": "prettier --write '**/*.js'",
"lint-md": "markdownlint \"**/*.md\" -i \"**/node_modules/**\"",
"lint-registry": "cd services/registry; npm run lint",
"postinstall": "for d in cli services/{registry,workers,web,common/boltzmann}; do cd $d; npm i; cd -; done",
"postinstall": "for d in cli services/{registry,workers,web,storage,common/boltzmann}; do cd $d; npm i; cd -; done",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I don't think this will work on Windows.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would with git-bash or WSL. There's a lot in this project that I don't think would work with cmd.exe or powershell, I don't know of a good way around that besides maybe adding links to docs on WSL in HACKING.md.

@zacanger zacanger mentioned this pull request Jun 12, 2019
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants