Commit a3c929db authored by Ray Schamp's avatar Ray Schamp

Finish setup of backpack, assets, projects hosts

parent d5384123
...@@ -23,6 +23,11 @@ env: ...@@ -23,6 +23,11 @@ env:
- ASSET_HOST_VAR=ASSET_HOST_$TRAVIS_BRANCH - ASSET_HOST_VAR=ASSET_HOST_$TRAVIS_BRANCH
- ASSET_HOST=${!ASSET_HOST_VAR} - ASSET_HOST=${!ASSET_HOST_VAR}
- ASSET_HOST=${ASSET_HOST:-$ASSET_HOST_STAGING} - ASSET_HOST=${ASSET_HOST:-$ASSET_HOST_STAGING}
- BACKPACK_HOST_master=https://backpack.scratch.mit.edu
- BACKPACK_HOST_STAGING=https://backpack.scratch.ly
- BACKPACK_HOST_VAR=BACKPACK_HOST_$TRAVIS_BRANCH
- BACKPACK_HOST=${!BACKPACK_HOST_VAR}
- BACKPACK_HOST=${BACKPACK_HOST:-$BACKPACK_HOST_STAGING}
- ROOT_URL_master=https://scratch.mit.edu - ROOT_URL_master=https://scratch.mit.edu
- ROOT_URL_STAGING=https://scratch.ly - ROOT_URL_STAGING=https://scratch.ly
- ROOT_URL_VAR=ROOT_URL_$TRAVIS_BRANCH - ROOT_URL_VAR=ROOT_URL_$TRAVIS_BRANCH
......
...@@ -84,7 +84,9 @@ To stop the process that is making the site available to your web browser (creat ...@@ -84,7 +84,9 @@ To stop the process that is making the site available to your web browser (creat
| Variable | Default | Description | | Variable | Default | Description |
| --------------- | ---------------------------------- | ---------------------------------------------- | | --------------- | ---------------------------------- | ---------------------------------------------- |
| `API_HOST` | `https://api.scratch.mit.edu` | Hostname for API requests | | `API_HOST` | `https://api.scratch.mit.edu` | Hostname for API requests |
| `ASSETS_HOST` | `https://assets.scratch.mit.edu` | Hostname for asset requests |
| `BACKPACK_HOST` | `https://backpack.scratch.mit.edu` | Hostname for backpack requests | | `BACKPACK_HOST` | `https://backpack.scratch.mit.edu` | Hostname for backpack requests |
| `PROJECTS_HOST` | `https://projects.scratch.mit.edu` | Hostname for project requests |
| `SENTRY_DSN` | `''` | DSN for Sentry | | `SENTRY_DSN` | `''` | DSN for Sentry |
| `FALLBACK` | `''` | Pass-through location for old site | | `FALLBACK` | `''` | Pass-through location for old site |
| `GA_TRACKER` | `''` | Where to log Google Analytics data | | `GA_TRACKER` | `''` | Where to log Google Analytics data |
......
...@@ -288,17 +288,13 @@ class Preview extends React.Component { ...@@ -288,17 +288,13 @@ class Preview extends React.Component {
); );
} }
render () { render () {
const backpackOptions = {
host: process.env.BACKPACK_HOST,
visible: true
};
return ( return (
this.props.playerMode ? this.props.playerMode ?
<Page> <Page>
<PreviewPresentation <PreviewPresentation
addToStudioOpen={this.state.addToStudioOpen} addToStudioOpen={this.state.addToStudioOpen}
assetHost={this.props.assetHost} assetHost={this.props.assetHost}
backpackOptions={backpackOptions} backpackOptions={this.props.backpackOptions}
comments={this.props.comments} comments={this.props.comments}
editable={this.state.editable} editable={this.state.editable}
extensions={this.state.extensions} extensions={this.state.extensions}
...@@ -338,7 +334,7 @@ class Preview extends React.Component { ...@@ -338,7 +334,7 @@ class Preview extends React.Component {
enableCommunity enableCommunity
hideIntro hideIntro
assetHost={this.props.assetHost} assetHost={this.props.assetHost}
backpackOptions={backpackOptions} backpackOptions={this.props.backpackOptions}
basePath="/" basePath="/"
className="gui" className="gui"
projectHost={this.props.projectHost} projectHost={this.props.projectHost}
...@@ -350,6 +346,10 @@ class Preview extends React.Component { ...@@ -350,6 +346,10 @@ class Preview extends React.Component {
Preview.propTypes = { Preview.propTypes = {
assetHost: PropTypes.string.isRequired, assetHost: PropTypes.string.isRequired,
backpackOptions: PropTypes.shape({
host: PropTypes.string,
visible: PropTypes.bool
}),
comments: PropTypes.arrayOf(PropTypes.object), comments: PropTypes.arrayOf(PropTypes.object),
faved: PropTypes.bool, faved: PropTypes.bool,
fullScreen: PropTypes.bool, fullScreen: PropTypes.bool,
...@@ -366,8 +366,8 @@ Preview.propTypes = { ...@@ -366,8 +366,8 @@ Preview.propTypes = {
original: projectShape, original: projectShape,
parent: projectShape, parent: projectShape,
playerMode: PropTypes.bool, playerMode: PropTypes.bool,
projectInfo: projectShape,
projectHost: PropTypes.string.isRequired, projectHost: PropTypes.string.isRequired,
projectInfo: projectShape,
projectStudios: PropTypes.arrayOf(PropTypes.object), projectStudios: PropTypes.arrayOf(PropTypes.object),
remixes: PropTypes.arrayOf(PropTypes.object), remixes: PropTypes.arrayOf(PropTypes.object),
replies: PropTypes.objectOf(PropTypes.array), replies: PropTypes.objectOf(PropTypes.array),
...@@ -394,6 +394,10 @@ Preview.propTypes = { ...@@ -394,6 +394,10 @@ Preview.propTypes = {
Preview.defaultProps = { Preview.defaultProps = {
assetHost: process.env.ASSET_HOST, assetHost: process.env.ASSET_HOST,
backpackOptions: {
host: process.env.BACKPACK_HOST,
visible: true
},
projectHost: process.env.PROJECT_HOST, projectHost: process.env.PROJECT_HOST,
sessionStatus: sessionActions.Status.NOT_FETCHED, sessionStatus: sessionActions.Status.NOT_FETCHED,
user: {} user: {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment