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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# docker-compose is provided for development purposes only and is not | ||
# intended for use as a production entropic setup. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Contact your doctor if symptoms persist for more than three days. |
||
version: '3.1' | ||
services: | ||
db: | ||
|
@@ -39,6 +41,12 @@ services: | |
- "3000:3000" | ||
env_file: | ||
- ./services/registry/.env | ||
environment: | ||
STORAGE_API_URL: http://storage:3002 | ||
PORT: 3000 | ||
WEB_HOST: http://localhost:3001 | ||
REDIS_URL: redis://redis:6379 | ||
EXTERNAL_HOST: http://localhost:3000 | ||
|
||
web: | ||
image: mhart/alpine-node:12 | ||
|
@@ -52,6 +60,12 @@ services: | |
- "3001:3001" | ||
env_file: | ||
- ./services/web/.env | ||
environment: | ||
STORAGE_API_URL: http://storage:3002 | ||
PORT: 3001 | ||
WEB_HOST: http://localhost:3001 | ||
REDIS_URL: redis://redis:6379 | ||
EXTERNAL_HOST: http://localhost:3001 | ||
|
||
storage: | ||
image: mhart/alpine-node:12 | ||
|
@@ -66,6 +80,13 @@ services: | |
# - "3002:3002" | ||
env_file: | ||
- ./services/storage/.env | ||
environment: | ||
POSTGRES_URL: postgres://postgres@db:5432 | ||
PGHOST: db | ||
REDIS_URL: redis://redis:6379 | ||
PORT: 3002 | ||
PGUSER: postgres | ||
PGDATABASE: entorpic_dev | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo? entorpic instead of entropic 😛 |
||
|
||
volumes: | ||
postgres_data: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... I don't think this will work on Windows. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
"start": "docker-compose up", | ||
"test": "for d in cli services/{registry,workers,web,common/boltzmann}; do cd $d; npm t; cd -; done" | ||
"test": "for d in cli services/{registry,workers,web,storage,common/boltzmann}; do cd $d; npm t; cd -; done" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hrm, should be EXTERNAL_HOST, yes? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh good LORD. Fine then. |
||
return this._parsedUrl; | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ module.exports = [ | |
async function namespaces(context, params) { | ||
const [err, result] = await context.storageApi | ||
.listNamespaces({ | ||
page: Number(context.url.query.page) || 0 | ||
page: Number(context.url.searchParams.get('page')) || 0 | ||
}) | ||
.then(xs => [null, xs], xs => [xs, null]); | ||
|
||
|
@@ -47,9 +47,9 @@ async function namespaces(context, params) { | |
async function members(context, { namespace, host }) { | ||
const [err, result] = await context.storageApi | ||
.listNamespaceMembers({ | ||
page: Number(context.url.query.page) || 0, | ||
page: Number(context.url.searchParams.get('page')) || 0, | ||
bearer: context.user ? context.user.name : null, | ||
status: context.url.query.status, | ||
status: context.url.searchParams.get('status'), | ||
namespace, | ||
host | ||
}) | ||
|
@@ -131,10 +131,10 @@ async function remove(context, { invitee, namespace, host }) { | |
async function memberships(context, { user }) { | ||
const [err, result] = await context.storageApi | ||
.listNamespaceMembers({ | ||
page: Number(context.url.query.page) || 0, | ||
page: Number(context.url.searchParams.get('page')) || 0, | ||
for: user, | ||
bearer: context.user.name, | ||
status: context.url.query.status | ||
status: context.url.searchParams.get('status') | ||
}) | ||
.then(xs => [null, xs], xs => [xs, null]); | ||
|
||
|
@@ -150,8 +150,8 @@ async function memberships(context, { user }) { | |
async function maintainerships(context, { namespace, host }) { | ||
const [err, result] = await context.storageApi | ||
.listNamespaceMaintainerships({ | ||
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'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
namespace, | ||
host, | ||
bearer: context.user.name | ||
|
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.
This is an extremely good and important warning