Skip to content

Commit

Permalink
Adds support for proxying. Refactors CORS for server.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlittman committed Sep 6, 2020
1 parent 8733e60 commit 0e454cc
Show file tree
Hide file tree
Showing 6 changed files with 595 additions and 21 deletions.
3 changes: 3 additions & 0 deletions Dockerfile.proxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM httpd:2.4-alpine

COPY ./docker/proxy-httpd.conf /usr/local/apache2/conf/httpd.conf
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ Otherwise, to use the static fixtures (USE_FIXTURES=true) add the fixture to the
direcotry and update the `templateFilenames` constant in the `_tests_/testUtilities/fixtureLoaderHelper.js` with the
filename of the new test fixture.

If there is a resource template you would like to copy, you can go to the direct URI in the sinopia api
(e.g. `https://api.development.sinopia.io/repository/ld4p:RT:bf2:Monograph:Work:Un-nested`) and copy everything returned
If there is a resource template you would like to copy, you can go to the direct URI in the sinopia api
(e.g. `https://api.development.sinopia.io/repository/ld4p:RT:bf2:Monograph:Work:Un-nested`) and copy everything returned
for the data list. Make sure you change (e.g.) `"@id": "https://api.development.sinopia.io/repository/ld4p:RT:bf2:Monograph:Work:Un-nested"` to
`"@id": "http://localhost:3000/repository/ld4p:RT:bf2:Monograph:Work:Un-nested"`

Expand Down Expand Up @@ -142,6 +142,16 @@ If you add environment variables to which the Editor needs to pay attention (e.g
* the env specific `docker build` commands in the `register_image` section of `.circleci/config.yml`
* e.g. https://github.com/LD4P/sinopia_editor/commit/1d3e381cb0f937300242cf896f62c2508e4a57e2#diff-1d37e48f9ceff6d8030570cd36286a61R63

### Proxying to a different environment
Proxying allows using the Sinopia API and search from a different environment, rather than local instances.

To proxy to development:
1. Build the proxy image: `docker build -t proxy-apache2:latest -f Dockerfile.proxy .`
2. Start the proxy: `docker run --rm --name proxy-apache2 -p 8080:8080 -e ENV_HOSTNAME=development.sinopia.io proxy-apache2:latest`
3. Start the Sinopia Editor: `SINOPIA_API_BASE_URL=http://localhost:8080/repository SEARCH_HOST=http://localhost:8080 npm run dev-start`

Note that proxying to other environments may require additional Cognito configuration.

## Release Management

The steps to create a tagged release are documented in the tagged-release ticket template. Please create a tagged-release ticket when performing a release.
Expand Down
Loading

0 comments on commit 0e454cc

Please sign in to comment.