Skip to content

Commit

Permalink
Use CDN domains for asset prefixes (#2541)
Browse files Browse the repository at this point in the history
* Move asset prefixes to CDN domains

* Move static assets to /assets

* Add robots.txt
Disallow all agents from fe-project.zooniverse.org and fe-content-pages.zooniverse.org.
  • Loading branch information
eatyourgreens authored Nov 16, 2021
1 parent b8d77e1 commit 2759719
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions kubernetes/deployment-production.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
- containerPort: 3000
env:
- name: PROJECT_ASSET_PREFIX
value: https://fe-project.zooniverse.org/projects
value: https://www.zooniverse.org/projects
- name: COMMIT_ID
value: __IMAGE_TAG__
- name: NEWRELIC_LICENSE_KEY
Expand Down Expand Up @@ -169,7 +169,7 @@ spec:
- containerPort: 3000
env:
- name: CONTENT_ASSET_PREFIX
value: https://fe-content-pages.zooniverse.org/about
value: https://www.zooniverse.org/about
- name: COMMIT_ID
value: __IMAGE_TAG__
- name: CONTENTFUL_ACCESS_TOKEN
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/deployment-staging.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
- containerPort: 3000
env:
- name: PROJECT_ASSET_PREFIX
value: https://fe-project.preview.zooniverse.org/projects
value: https://frontend.preview.zooniverse.org/projects
- name: COMMIT_ID
value: __IMAGE_TAG__
- name: NEWRELIC_LICENSE_KEY
Expand Down Expand Up @@ -151,7 +151,7 @@ spec:
- containerPort: 3000
env:
- name: CONTENT_ASSET_PREFIX
value: https://fe-content-pages.preview.zooniverse.org/about
value: https://frontend.preview.zooniverse.org/about
- name: COMMIT_ID
value: __IMAGE_TAG__
- name: CONTENTFUL_ACCESS_TOKEN
Expand Down
2 changes: 2 additions & 0 deletions packages/app-content-pages/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /
2 changes: 2 additions & 0 deletions packages/app-project/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function RecentSubjects ({
const height = (size === 1) ? '40vw' : '200px'
const { publicRuntimeConfig = {} } = getConfig() || {}
const assetPrefix = publicRuntimeConfig.assetPrefix || ''
const placeholderUrl = `${assetPrefix}/subject-placeholder.png`
const placeholderUrl = `${assetPrefix}/assets/subject-placeholder.png`
const displayedRecents = recents.slice(0, size)

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const TeamMember = ({ user }) => {

const { publicRuntimeConfig = {} } = getConfig() || {}
const assetPrefix = publicRuntimeConfig.assetPrefix || ''
const placeholderAvatar = `${assetPrefix}/simple-avatar.png`
const placeholderAvatar = `${assetPrefix}/assets/simple-avatar.png`

return (
<StyledTeamMember as='li'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function SubjectSetCard ({
const [subject] = subjects
const { publicRuntimeConfig = {} } = getConfig() || {}
const assetPrefix = publicRuntimeConfig.assetPrefix || ''
const placeholderUrl = `${assetPrefix}/subject-placeholder.png`
const placeholderUrl = `${assetPrefix}/assets/subject-placeholder.png`
const subjectURLs = subject ? subject.locations.map(location => Object.values(location)[0]) : []
const alt = subject ? `Subject ${subject.id}` : 'Loading'
const percentComplete = parseInt(100 * completeness)
Expand Down

0 comments on commit 2759719

Please sign in to comment.