diff --git a/config.json.example b/config.json.example index 94c5c7b043..2caba18448 100644 --- a/config.json.example +++ b/config.json.example @@ -77,5 +77,6 @@ "STRIPE_PUB_KEY": "22223333444455556666777788889999", "TEST_DB_URI": "mongodb://localhost/habitrpg_test", "TRANSIFEX_SLACK_CHANNEL": "transifex", - "WEB_CONCURRENCY": 1 + "WEB_CONCURRENCY": 1, + "SKIP_SSL_CHECK_KEY": "key" } diff --git a/package-lock.json b/package-lock.json index 46df006ee8..300f4e7be9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "habitica", - "version": "4.80.5", + "version": "4.80.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f21197bcfb..d34240eadd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "habitica", "description": "A habit tracker app which treats your goals like a Role Playing Game.", - "version": "4.80.5", + "version": "4.80.8", "main": "./website/server/index.js", "dependencies": { "@slack/client": "^3.8.1", diff --git a/test/api/unit/middlewares/redirects.js b/test/api/unit/middlewares/redirects.js index d93ed5345c..fdbff0d879 100644 --- a/test/api/unit/middlewares/redirects.js +++ b/test/api/unit/middlewares/redirects.js @@ -73,6 +73,56 @@ describe('redirects middleware', () => { expect(res.redirect).to.have.not.been.called; }); + + it('does not redirect if passed skip ssl request param is passed with corrrect key', () => { + let nconfStub = sandbox.stub(nconf, 'get'); + nconfStub.withArgs('BASE_URL').returns('https://habitica.com'); + nconfStub.withArgs('IS_PROD').returns(true); + nconfStub.withArgs('SKIP_SSL_CHECK_KEY').returns('test-key'); + + req.header = sandbox.stub().withArgs('x-forwarded-proto').returns('http'); + req.originalUrl = '/static/front'; + req.query.skipSSLCheck = 'test-key'; + + const attachRedirects = requireAgain(pathToRedirectsMiddleware); + attachRedirects.forceSSL(req, res, next); + + expect(res.redirect).to.have.not.been.called; + }); + + it('does redirect if skip ssl request param is passed with incorrrect key', () => { + let nconfStub = sandbox.stub(nconf, 'get'); + nconfStub.withArgs('BASE_URL').returns('https://habitica.com'); + nconfStub.withArgs('IS_PROD').returns(true); + nconfStub.withArgs('SKIP_SSL_CHECK_KEY').returns('test-key'); + + req.header = sandbox.stub().withArgs('x-forwarded-proto').returns('http'); + req.originalUrl = '/static/front?skipSSLCheck=INVALID'; + req.query.skipSSLCheck = 'INVALID'; + + const attachRedirects = requireAgain(pathToRedirectsMiddleware); + attachRedirects.forceSSL(req, res, next); + + expect(res.redirect).to.be.calledOnce; + expect(res.redirect).to.be.calledWith('https://habitica.com/static/front?skipSSLCheck=INVALID'); + }); + + it('does redirect if skip ssl check key is not set', () => { + let nconfStub = sandbox.stub(nconf, 'get'); + nconfStub.withArgs('BASE_URL').returns('https://habitica.com'); + nconfStub.withArgs('IS_PROD').returns(true); + nconfStub.withArgs('SKIP_SSL_CHECK_KEY').returns(null); + + req.header = sandbox.stub().withArgs('x-forwarded-proto').returns('http'); + req.originalUrl = '/static/front'; + req.query.skipSSLCheck = 'INVALID'; + + const attachRedirects = requireAgain(pathToRedirectsMiddleware); + attachRedirects.forceSSL(req, res, next); + + expect(res.redirect).to.be.calledOnce; + expect(res.redirect).to.be.calledWith('https://habitica.com/static/front'); + }); }); context('forceHabitica', () => { diff --git a/website/client/assets/css/sprites/spritesmith-largeSprites-0.css b/website/client/assets/css/sprites/spritesmith-largeSprites-0.css index 06149b04b0..f3f555dc73 100644 --- a/website/client/assets/css/sprites/spritesmith-largeSprites-0.css +++ b/website/client/assets/css/sprites/spritesmith-largeSprites-0.css @@ -1,72 +1,78 @@ .promo_armoire_backgrounds_201901 { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: 0px -148px; + background-position: -445px 0px; width: 423px; height: 147px; } .promo_bird_buddies_bundle { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -424px 0px; + background-position: -421px -337px; width: 420px; height: 147px; } .promo_g1g1 { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -241px -444px; + background-position: -241px -633px; width: 237px; height: 150px; } .promo_npc_alex { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -403px -296px; + background-position: -566px -485px; width: 162px; height: 138px; } .promo_seasonal_shop { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -566px -296px; + background-position: -403px -485px; width: 162px; height: 138px; } .promo_snow_potions { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: 0px 0px; + background-position: -445px -148px; width: 423px; height: 147px; } .promo_take_this { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -729px -296px; + background-position: -729px -485px; width: 96px; height: 69px; } .promo_winter_wonderland_2019 { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: 0px -296px; + background-position: 0px -485px; width: 402px; height: 147px; } .promo_wintery_skins { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -424px -148px; + background-position: 0px -337px; width: 420px; height: 147px; } .customize-option.promo_wintery_skins { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -449px -163px; + background-position: -25px -352px; width: 60px; height: 60px; } +.scene_hat_guild { + background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); + background-position: 0px 0px; + width: 444px; + height: 336px; +} .scene_starting_over { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: -479px -444px; + background-position: -479px -633px; width: 150px; height: 150px; } .scene_todo_list { background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png'); - background-position: 0px -444px; + background-position: 0px -633px; width: 240px; height: 195px; } diff --git a/website/client/assets/images/sprites/spritesmith-largeSprites-0.png b/website/client/assets/images/sprites/spritesmith-largeSprites-0.png index d42f54252e..9f32d0b22b 100644 Binary files a/website/client/assets/images/sprites/spritesmith-largeSprites-0.png and b/website/client/assets/images/sprites/spritesmith-largeSprites-0.png differ diff --git a/website/raw_sprites/spritesmith_large/scene_hat_guild.png b/website/raw_sprites/spritesmith_large/scene_hat_guild.png new file mode 100644 index 0000000000..1c432698ea Binary files /dev/null and b/website/raw_sprites/spritesmith_large/scene_hat_guild.png differ diff --git a/website/server/controllers/api-v3/news.js b/website/server/controllers/api-v3/news.js index 9d9f6fc559..305a27d863 100644 --- a/website/server/controllers/api-v3/news.js +++ b/website/server/controllers/api-v3/news.js @@ -3,7 +3,7 @@ import { authWithHeaders } from '../../middlewares/auth'; let api = {}; // @TODO export this const, cannot export it from here because only routes are exported from controllers -const LAST_ANNOUNCEMENT_TITLE = 'LAST CHANCE: GIFT A SUBSCRIPTION AND GET ONE FREE!'; +const LAST_ANNOUNCEMENT_TITLE = 'GUILD SPOTLIGHT: NEW AND NOTABLE!'; const worldDmg = { // @TODO bailey: false, }; @@ -30,16 +30,13 @@ api.getNews = {
Tomorrow is your last chance to take advantage of our promotion where if you gift somebody a subscription, you get the same subscription for yourself for free!
-Subscribers get tons of perks every month, including exclusive items, the ability to buy Gems with Gold, and a cute exclusive Jackalope Pet. Plus, it helps keep Habitica running :) To gift a subscription to someone, just open their profile and click on the present icon in the upper right.
-The special promotion will only run until tomorrow, so if you've been curious about trying out a subscription, now's the time! Make a friend happy and use all your new Gems to go questing together.
-Please note that if you or your gift recipient already have a recurring subscription, the gifted subscription will only start after that subscription is cancelled or has expired. Thanks so much for your support! <3
-There's a new Guild Spotlight on the blog that highlights some of Habitica's new and interesting Guilds! Check it out now and find a new group where you can share your interests and goals!
+