Commit graph

122 commits

Author SHA1 Message Date
rschamp
a13e6947b7 Ignore querystrings when matching routes
This should eliminate the issue where querystrings would cause URLs to skip S3 and fall back to scratchr2
2021-09-15 15:25:30 -04:00
rschamp
2d3600479a Revert "Merge pull request #5925 from LLK/revert-5922-release/2021-08-11"
This reverts commit 905ed609f9, reversing
changes made to 99c819916b.
2021-08-12 16:00:58 -04:00
Eric Rosenbaum
a8aead3a10
Revert "Master release/2021-08-11" 2021-08-12 11:28:18 -04:00
Chris Garrity
5edb223ec1 Fix tx-push script for conference 2021 page
Fixes #5912  : handling of the conference 2021 translation updates.

Testing:
* run `./bin/tx-push-www`:
    * output shows what would run with the --execute flag.
    * look for `tx-push-src` wtih resource name 'conference-index-2021-l10njson', for the conference 2021 view.

DO NOT RUN THE SCRIPT WITH `--execute`

Steps to land this PR:
1. rename the resource on transifex: `conference-2021-index-l10njson` to `conference-index-2021-l10njson` so that we don't lose any current translations.
2. merge the PR. Nightly update-translations job will execute the script.
3. rename or remove [conference-2021-index-l10njson](https://github.com/LLK/scratch-l10n/tree/master/www/scratch-website.conference-2021-index-l10njson) in scratch-l10n.
2021-08-10 11:16:56 -04:00
Ben Wheeler
37a5dd9365 use hyphen instead of underscore 2021-05-14 19:17:22 -04:00
Ben Wheeler
c8445561b3 set, purge static_assets surrogate key on deploy 2021-05-14 18:44:21 -04:00
Ben Wheeler
80b87bc8cd revised usage string 2020-01-21 14:07:26 -05:00
Ben Wheeler
2d3158a8f7 Introduce new tx-push-www script to automate string push to transifex 2020-01-16 16:06:55 -05:00
Chris Garrity
45d672ab30 Add translation resource mapping
When the name of the view in `routes.json` does not match the name of the resource in transifex there needs to be a mapping added to the script that generates translations. _Note: the resource name in transifex is usually based on the name of the source file in the `views` directory. Usually the name of the view in the routes file matches._

Since `routes.json` is a JSON file that does not support comments there’s no way to add a warning to the file when someone is adding a route.

The sympton was the message that there were no translations for ‘vernier’ or ‘embed’ when running translate. The `vernier` route is actually the `gdxfor` view, and `embed` is just another version of `preview`
2019-10-29 17:48:01 -04:00
Ben Wheeler
88abed34e9 revised fastly tests, added more 2019-09-26 10:59:55 -04:00
Ben Wheeler
de5e712305 when looking for latest fastly VCL to clone, use only active VCLs 2019-09-19 14:27:42 -04:00
Paul Kaplan
5ac67cc033 Revert "Merge pull request #3217 from LLK/hotfix/fastly-concurrency"
This reverts commit fecf3a81d7, reversing
changes made to 76473c97fe.
2019-08-07 14:03:48 -04:00
rschamp
21dccf60fe Rename and make concurrency limit configurable 2019-08-05 15:58:17 -04:00
rschamp
802c6bff22 Add concurrency limits to async requests of 2019-08-05 15:33:46 -04:00
rschamp
5e79449334 Add concurrency limits to async requests 2019-08-05 15:09:36 -04:00
Ray Schamp
03e6a49b44 Update for async v2
async.auto / async.waterfall now take the callback as the last argument in functions with dependencies.

Async is modularized so eachLimit can be required specifically
2019-07-12 11:44:52 -04:00
Ben Wheeler
033a0f5dcd don't overwrite english defaults from local l10n.json source files with transifex download 2019-05-13 11:24:38 -04:00
chrisgarrity
f3d60a1a2d Remove dependency on scratchr2_translations 2019-03-27 11:08:09 +01:00
chrisgarrity
94a8396713 Make list of languages on www consistent with gui
start to depend on `scratch-l10n`

So far only the supported locales is used.

There is one small difference between scratch-l10n and the `languages.json` that was removed.
languages was:
`{locale: ‘languagename’, …}` key value pairs.

l10n exports:
`{locale: {name: ‘languagename’},…}

That required an additional change to the language chooser.
2018-12-13 16:00:41 -05:00
chrisgarrity
1a1122d984 show embed view
* detect `embed` in the URL
* initialize GUI in embed mode if detected
* match `embed` in the project page route
* add fastly config rules to redirect `/projects/embed/:id` to `/projects/:id/embed`
2018-12-05 17:35:44 -05:00
chrisgarrity
84884bebf2 Revised ?tip_bar= fastly rules
Added missing request condition
2018-12-05 14:57:30 -05:00
Paul Kaplan
214b81cf6d
Revert "Add tip_bar fastly config" 2018-12-05 11:42:30 -05:00
chrisgarrity
39a3af8732 Add tip_bar fastly config
Add another section to the fastly config that will permanently redirect any URL with `tip_bar=` to a matching `tutorial=`
2018-12-03 09:47:26 -05:00
chrisgarrity
6df58e41fd Correct preview route for fastly
- use more explicit route
- handle fastly error in the callback correctly
- more succinct parsing of the URL path
2018-05-02 17:04:14 -04:00
Ray Schamp
590f505a61 Revert "Merge pull request #1788 from LLK/revert-1775-hotfix/es6-upgrade"
This reverts commit 1b1b396e92, reversing
changes made to a144bab0e6.
2018-01-30 11:53:12 -05:00
Ray Schamp
46511e1253
Revert "[Develop] Upgrade to ES6" 2018-01-30 09:54:45 -05:00
Matthew Taylor
6d1f2fbccd initial es6 commit 2018-01-19 14:06:26 -05:00
Matthew Taylor
758371dadd
Merge pull request #1671 from mewtaylor/issue/node-upgrade
Upgrade compatibility to node 8
2017-12-11 15:52:35 -05:00
Colby Gutierrez-Kraybill
cd27b68cd1
Merge pull request #1720 from LLK/hotfix/cache-nav-session-endpoints
[Develop] Hotfix/cache nav session endpoints
2017-12-01 16:01:19 -05:00
Ray Schamp
51d980cfb3 Conditionally purge on deploys
We can configure this within Travis
2017-12-01 15:34:31 -05:00
Colby Gutierrez-Kraybill
0ba2693c0e Cache logged out account-nav.json and session
Cache ^/fragment/account-nav.json and ^/session for logged out users
2017-12-01 13:50:43 -05:00
Colby Gutierrez-Kraybill
c65b0ef907 Stomp set-cookie
set-cookie causes the cache to not cache the page. Since we’re not trying to track the user beyond, we don’t want to try resetting the cookie again with the same info
2017-12-01 11:22:24 -05:00
Colby Gutierrez-Kraybill
1083a7a79f Fix typos and correct cookie
scratchsessionsid not scratchsessionid
Cookie needs key added for assigned value of scratchlanguage
2017-12-01 10:18:47 -05:00
Colby Gutierrez-Kraybill
91b3feb0b1 Merge pull request #1708 from colbygk/session-caching
[Master] Project page caching
2017-12-01 09:59:26 -05:00
Colby Gutierrez-Kraybill
69757e6bec
Revert "[Master] Project page caching" 2017-12-01 09:24:17 -05:00
Colby Gutierrez-Kraybill
0c109113c7 Failed on actual run, needs to load languages from directory below 2017-11-30 15:01:08 -05:00
Colby Gutierrez-Kraybill
1e8bf2653c Correct brace addition to VCL 2017-11-30 11:38:14 -05:00
Colby Gutierrez-Kraybill
785667691e Fix up lint errors 2017-11-30 11:30:45 -05:00
Colby Gutierrez-Kraybill
66edcb60a8 Remove unused vcl code generators, setBackend and setFrontend 2017-11-30 11:28:53 -05:00
Colby Gutierrez-Kraybill
279e25eb69 Simplify how the conditional is created for setting the S3 backend, caching related behavior for non-logged in users and maintaining language settings and passing to backend 2017-11-30 11:11:38 -05:00
Colby Gutierrez-Kraybill
7a6be0306b Cache ^/projects/ to users who are not logged-in 2017-11-30 11:11:38 -05:00
Colby Gutierrez-Kraybill
9efd8e65eb Add specific /projects cache handling when user is not logged-in 2017-11-30 11:11:26 -05:00
Matthew Taylor
2dd82e858e use writeFileSync
Thanks @thisandagain!
2017-11-16 09:58:08 -05:00
Matthew Taylor
b584bb80e7 Upgrade compatibility to node 8
This fixes an issue in compilation by upgrading node-sass to v4.6, and also upgrades express in the process.

Callback added to `writeFile` in `get-localized-urls` in order to avoid a deprecation warning during `make translations`.
2017-11-15 13:28:10 -05:00
chrisgarrity
13284dee21 Rename AnimateYourNameGuide to NameGuide
remove obsolete static URL so localizations get picked up correctly.

git-ignore localized-urls.json as it’s pulled from scratch-resources now.
2017-09-26 16:56:34 -04:00
chrisgarrity
1d08a9e201 Rename AnimateYourNameGuide to NameGuide
remove obsolete static URL so localizations get picked up correctly.

git-ignore localized-urls.json as it’s pulled from scratch-resources now.
2017-09-25 17:16:58 -04:00
chrisgarrity
376aee0eb3 Add error checking and testing for translations (#1401)
* Add error checking and testing for translations. Also make build-locales quieter if there are no problems.

* Allow build with broken translations (to allow development), but fail test so that broken translations don't get merged or deployed
2017-08-15 09:32:18 -04:00
chrisgarrity
39b1400705 Handle /help redirect (#1363) 2017-06-23 10:28:34 -04:00
chrisgarrity
74e315dc71 Add new Tips page (#1357)
New of tips page, uses cards from new resources server (s3)

* added get-localized-urls script to get the generated json from the s3 bucket
* added /tips route
* correct localized-urls for other pages
* remove thingstotry
* redirect /go
* fix up /info/cards view to use resources (s3).
* redirect /go to /tips
* change /hoc redirect from /go to /tips
* Add full set of cards pdf download to tips localization
* removed cards and guides from static PDFs, they are all coming from resources.scratch.mit.edu now.
* removed things to try view

Corrections for reviews:
* decided to pretty print the localized URLs
* replaced console.errors with process.stdout and fail with exit(1)
* formatted localized-urls to make it easier to read
* moved link outside  `<Button…` makes whole button clickable instead of just text
* fixed up css styles, removed unnecessary classes
* corrected “unused” resource links
2017-06-21 16:20:18 -04:00
Matthew Taylor
a8cf1af73c Merge pull request #1316 from mewtaylor/issue/explore-projects
Fix r2-3978: Use regex in express patterns to limit scope
2017-05-24 12:49:09 -04:00