Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair lockdown meta url notice on Source Code page #1549

Merged
merged 1 commit into from
Dec 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions controllers/script.js
Original file line number Diff line number Diff line change
@@ -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;
5 changes: 5 additions & 0 deletions controllers/user.js
Original file line number Diff line number Diff line change
@@ -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);

2 changes: 1 addition & 1 deletion views/pages/documentPage.html
Original file line number Diff line number Diff line change
@@ -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>