diff --git a/.travis.yml b/.travis.yml index cf81c325c..f11973cb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ env: - SKIP_CLEANUP=true - BUILD_ARCHIVE=$TRAVIS_BUILD_ID.zip before_deploy: -- zip -r $BUILD_ARCHIVE . +- zip -qr $BUILD_ARCHIVE . deploy: - provider: elasticbeanstalk access_key_id: $EB_AWS_ACCESS_KEY_ID diff --git a/en.json b/en.json index b8a25b811..19a2f7f1a 100644 --- a/en.json +++ b/en.json @@ -14,6 +14,7 @@ "general.forParents": "For Parents", "general.forEducators": "For Educators", "general.guidelines": "Community Guidelines", + "general.help": "Help", "general.jobs": "Jobs", "general.joinScratch": "Join Scratch", "general.legal": "Legal", @@ -27,11 +28,13 @@ "general.scratchEd": "ScratchEd", "general.scratchFoundation": "Scratch Foundation", "general.scratchJr": "ScratchJr", + "general.search": "Search", "general.signIn": "Sign in", "general.statistics": "Statistics", "general.support": "Support", "general.termsOfUse": "Terms of Use", "general.username": "Username", + "general.viewAll": "View All", "general.whatsHappening": "What's Happening?", "general.wiki": "Scratch Wiki", "footer.about": "About Scratch", @@ -47,6 +50,7 @@ "intro.tryItOut": "TRY IT OUT", "login.forgotPassword": "Forgot Password?", "navigation.signOut": "Sign out", + "news.scratchNews": "Scratch News", "parents.FaqAgeRangeA": "While Scratch is primarily designed for 8 to 16 year olds, it is also used by people of all ages, including younger children with their parents.", "parents.FaqAgeRangeQ": "What is the age range for Scratch?", "parents.FaqResourcesQ": "What resources are available for learning Scratch?", diff --git a/server/config.js b/server/config.js index a11cf8bd2..393219278 100644 --- a/server/config.js +++ b/server/config.js @@ -7,11 +7,14 @@ module.exports = { 'and animations.', // Open graph - og_image: 'https://scratch.mit.edu/images/og_image.jpg', - og_image_type: 'image/jpeg', + og_image: 'https://scratch.mit.edu/images/scratch-og.png', + og_image_type: 'image/png', og_image_width: 986, og_image_height: 860, // Analytics & Monitoring - ga_tracker: process.env.GA_TRACKER || '' + ga_tracker: process.env.GA_TRACKER || '', + + // Use minified JS libraries + min: (process.env.NODE_ENV === 'production') ? '.min' : '' }; diff --git a/server/index.js b/server/index.js index 954769e13..e206d2955 100644 --- a/server/index.js +++ b/server/index.js @@ -13,9 +13,23 @@ var log = require('./log'); var proxies = require('./proxies.json'); var routes = require('./routes.json'); -// Server setup +// Create server var app = express(); app.disable('x-powered-by'); + +// Block POST & PUT requests in production +if (process.env.NODE_ENV === 'production') { + app.use(function (req, res, next) { + if (req.method === 'GET') return next(); + if (req.method === 'OPTIONS') return next(); + if (req.method === 'HEAD') return next(); + + res.writeHead(405, {'content-type' : 'application/json'}); + res.end('{"error": "Method not allowed"}'); + }); +} + +// Server setup app.use(log()); app.use(compression()); app.use(express.static(path.resolve(__dirname, '../build'), { diff --git a/server/proxies.json b/server/proxies.json index ffff8ca4c..4298ae271 100644 --- a/server/proxies.json +++ b/server/proxies.json @@ -6,6 +6,7 @@ "/i18n/setlang/", "/login_retry/", "/media/", + "/scratch_admin/homepage/clear-cache/", "/session/", "/site-api", "/static/" diff --git a/server/template.html b/server/template.html index b2c0452f7..6102ec4bf 100644 --- a/server/template.html +++ b/server/template.html @@ -41,8 +41,8 @@
- - + + @@ -59,7 +59,5 @@ }); ga('send', 'pageview'); - -