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

Run backoffice locally #1148

Merged
merged 8 commits into from
Jul 2, 2020
Merged

Run backoffice locally #1148

merged 8 commits into from
Jul 2, 2020

Conversation

mheinzel
Copy link
Contributor

@mheinzel mheinzel commented Jun 25, 2020

See https://github.com/zinfra/backend-issues/issues/1496.

This took me longer than I thought, but it's mostly working now.

  • get backoffice endpoints shown in a separate tab
  • when sending request from the swagger-ui webapp, they reach stern
  • copy changes to the respective -docker files where they exist
  • document how to run stern locally in the stern README

Also, there's still a weird bug I haven't figured out yet:

When I load swagger-ui, everythings works. If I reload the page, it still works. When I switch to the Back Office tab and expand the endpoints and then reload the page, it doesn't work anymore. More specifically, instead of loading /backoffice/api-docs/, the JavaScript tries to load /backoffice. After a hard refresh it works again.

The same happens with /sso in the Swagger-2.0 tab, too, so it doesn't seem like a new issue. Might not fix it for now.

@mheinzel mheinzel force-pushed the mheinzel/run-backoffice-locally branch 2 times, most recently from 0de8ba8 to 28fa9d3 Compare June 25, 2020 19:15
@mheinzel
Copy link
Contributor Author

mheinzel commented Jun 26, 2020

As discussed in #1146, I will look into also running stern automatically in services/start-services-only.sh (although it's not one of the services per se, living in tools/stern).

(edit: this doesn't seem to be the right place, see https://github.com/zinfra/backend-issues/issues/1496#issuecomment-650180806)

@mheinzel mheinzel changed the title [WIP] Run backoffice locally Run backoffice locally Jun 26, 2020
mheinzel added 4 commits June 30, 2020 17:56
the API not gets shown correctly in the browser, but sending requests
doesn't work, as they don't get routed to stern yet.
@mheinzel mheinzel force-pushed the mheinzel/run-backoffice-locally branch from 5cf02e7 to 71df527 Compare June 30, 2020 15:56
proxy_pass http://stern;
}

# The trailing slash matters, as it makes sure the `/stern` prefix is removed.
Copy link
Contributor

Choose a reason for hiding this comment

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

you changed this in deploy/services-demo/conf/nginz/nginx.conf, are you sure it should stay like this here?

@mheinzel mheinzel force-pushed the mheinzel/run-backoffice-locally branch from 0b248ba to 7fdb47c Compare July 1, 2020 18:18
@mheinzel
Copy link
Contributor Author

mheinzel commented Jul 1, 2020

I now added support for running stern as part of the services-demo. In the process I had to resort to a few hacks, mostly to support

  1. only optionally running stern (which I think is justifiable since exposing the backoffice API by default is risky in case anyone runs this exposed to the internet)
  2. working both with the native and Docker mode of the script

Dropping any of those two would make things easier, so tell me if you would strongly prefer that.

Also, tell me if there is a nicer way of making nginx still start up when the stern Docker container is not running. I didn't find a nicer way, but there might be some tricks I don't know.

Copy link
Contributor

@fisx fisx left a comment

Choose a reason for hiding this comment

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

works! \o/

@mheinzel mheinzel merged commit fdafba7 into develop Jul 2, 2020
@mheinzel mheinzel deleted the mheinzel/run-backoffice-locally branch July 2, 2020 12:54
@fisx fisx mentioned this pull request Jul 13, 2020
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.

2 participants