Skip to content

Commit

Permalink
Repair lockdown meta url notice on Source Code page (#1549)
Browse files Browse the repository at this point in the history
* Link in the FAQ for this

Post #944 #970 #389 ... missed somewhere around #976 to #1208 *(vaguely recall this was on the script homepage originally and moved to source code page)*. Needed for #1548 to calm network traffic issues which appear to be global with Level3. Over 17,000 sites are down according to pingdom.

Auto-merge
  • Loading branch information
Martii committed Dec 15, 2018
1 parent cecbc2e commit 996dd3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 0 additions & 5 deletions controllers/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,6 @@ exports.view = function (aReq, aRes, aNext) {
options.isMod = authedUser && authedUser.isMod;
options.isAdmin = authedUser && authedUser.isAdmin;

// Lockdown
options.lockdown = {};
options.lockdown.scriptStorageRO = process.env.READ_ONLY_SCRIPT_STORAGE === 'true';
options.lockdown.updateURLCheck = process.env.FORCE_BUSY_UPDATEURL_CHECK === 'true';

// Script
options.script = script = modelParser.parseScript(aScript);
options.isOwner = authedUser && authedUser._id == script._authorId;
Expand Down
5 changes: 5 additions & 0 deletions controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2059,6 +2059,11 @@ exports.editScript = function (aReq, aRes, aNext) {
return;
}

// Lockdown
options.lockdown = {};
options.lockdown.scriptStorageRO = process.env.READ_ONLY_SCRIPT_STORAGE === 'true';
options.lockdown.updateURLCheck = process.env.FORCE_BUSY_UPDATEURL_CHECK === 'true';

// Script
options.script = script = modelParser.parseScript(aScript);

Expand Down
2 changes: 1 addition & 1 deletion views/pages/documentPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h3><a id="welcome" rel="bookmark"></a>Welcome<a class="anchor" href="#welcome">
<p>Welcome to {{#pkg.name}}{{pkg.name}} <em>(OUJS)</em>{{#pkg.version}} v{{pkg.version}}{{/pkg.version}}{{/pkg.name}}{{#process.version}} using Node {{process.version}}{{/process.version}}{{#lastRestart}} last restarted <time datetime="{{lastRestartISOFormat}}" title="{{lastRestart}}">{{lastRestartHumanized}}</time>.{{/lastRestart}}</p>
<ul>
{{#lockdown.scriptStorageRO}}<li>Read-Only Script storage mode is in effect.</li>{{/lockdown.scriptStorageRO}}
{{#lockdown.updateURLCheck}}<li>UserScript metadata block <code>// @updateURL</code> is required.</li>{{/lockdown.updateURLCheck}}
{{#lockdown.updateURLCheck}}<li>UserScript metadata block <code>// @updateURL</code> is required. See <a href="/about/Frequently-Asked-Questions#q-does-openuserjs-org-have-meta-">this FAQ</a>.</li>{{/lockdown.updateURLCheck}}
<li><em>No other site status messages at this time.</em></li>
</ul>
<h3><a id="mission" rel="bookmark"></a>Mission<a class="anchor" href="#mission"><em class="fa fa-link"></em></a></h3>
Expand Down

0 comments on commit 996dd3c

Please sign in to comment.