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

update URL fragment whenever changed, other doc and UX minor updates #305

Merged
merged 5 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "22"
cache: npm
- name: Setup Pages
id: pages
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
{
"name": "mozilla-ssl-config-generator",
"version": "1.0.0",
"version": "5.7.1",
"description": "Mozilla SSL Configuration Generator",
"license": "MPL-2.0",
"scripts": {
"analyze": "NODE_ENV=analyze webpack --config=config/webpack.config.js --progress",
"build": "NODE_ENV=production webpack --config=config/webpack.config.js --progress",
"watch": "NODE_ENV=development webpack --config=config/webpack.config.js --watch --progress"
"watch": "NODE_ENV=development webpack --config=config/webpack.config.js --watch --progress",
"start": "npm run watch"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mozilla/server-side-tls"
"url": "https://github.com/mozilla/ssl-config-generator.git"
},
"bugs": {
"url": "https://github.com/mozilla/server-side-tls/issues"
"url": "https://github.com/mozilla/ssl-config-generator/issues"
},
"homepage": "https://github.com/mozilla/server-side-tls",
"homepage": "https://ssl-config.mozilla.org",
"dependencies": {
"bootstrap.native": "^5.1.1",
"clipboard": "^2.0.11",
Expand Down
13 changes: 9 additions & 4 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ const render = async () => {
document.getElementById('hsts').classList.toggle('d-none', _state.output.supportsHsts === false);
document.getElementById('ocsp').classList.toggle('d-none', !_state.output.supportsOcspStapling);

// update the fragment
if (gHaveSettingsChanged) {
gHaveSettingsChanged = false;
// update the fragment only if changed
if (window.location.hash !== _state.output.fragment) {
gHashUpdatedInternal = true;
window.location.hash = _state.output.fragment;
}

gHaveSettingsChanged = false;

// render the output header
let header = `<h3>${_state.form.version_tags}</h3>\n`;
if (_state.output.showSupports) {
Expand Down Expand Up @@ -125,6 +126,8 @@ function form_config_init() {
params.set('openssl', params.get('openssl-version'));
}

gHaveSettingsChanged = true;

// set the default server version, if we're loading and have "server" but not "version"
if (params.get('server') !== null && params.get('version') === null) {
const e_version = document.getElementById('version')
Expand Down Expand Up @@ -152,11 +155,14 @@ function form_config_init() {

}
}

gHaveSettingsChanged = false;
}


function form_change_event (server_change) {
if (gHaveSettingsChanged) { return; }
gHaveSettingsChanged = true;
if (server_change) {
const form = document.getElementById('form-generator').elements;
const version = document.getElementById('version');
Expand All @@ -166,7 +172,6 @@ function form_change_event (server_change) {
openssl.value = configs.openssl.latestVersion;
}
}
gHaveSettingsChanged = true;
render();
}

Expand Down
20 changes: 9 additions & 11 deletions src/templates/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="<%= htmlWebpackPlugin.options.csp %>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="<%= htmlWebpackPlugin.options.constants.author %>">
<meta name="description" content="<%= htmlWebpackPlugin.options.constants.description %>">
Expand Down Expand Up @@ -141,32 +140,31 @@
<h5>Company</h5>
<ul class="list-unstyled">
<li><a class="text-white" href="https://www.mozilla.org/about/">About</a></li>
<li><a class="text-white" href="https://blog.mozilla.org/press/">Press Center</a></li>
<li><a class="text-white" href="https://careers.mozilla.org/?utm_source=ssl-config.mozilla.org&utm_medium=referral&utm_campaign=footer&utm_content=company">Careers</a></li>
<li><a class="text-white" href="https://www.mozilla.org/contribute/">Get involved</a></li>
<li><a class="text-white" href="https://www.mozilla.org/careers/">Careers</a></li>
</ul>
</div>

<div class="col-12 col-md-4">
<h5>Resources</h5>
<ul class="list-unstyled">
<li><a class="text-white" href="https://developer.mozilla.org/">Mozilla Developer Network</a></li>
<li><a class="text-white" href="https://observatory.mozilla.org/">Mozilla Observatory</a></li>
<li><a class="text-white" href="https://wiki.mozilla.org/Security/Server_Side_TLS">Mozilla Server Side TLS configurations</a></li>
<li><a class="text-white" href="https://infosec.mozilla.org/guidelines/web_security">Mozilla's own Web Security guidelines</a></li>
<li><a class="text-white" href="https://developer.mozilla.org/docs/Web/Security/Transport_Layer_Security">Transport Layer Security on MDN</a></li>
<li><a class="text-white" href="https://observatory.mozilla.org/">Mozilla HTTP Observatory</a></li>
<li><a class="text-white" href="https://www.ssllabs.com/ssltest/">Qualys SSL Labs Server Test</a></li>
<li><a class="text-white" href="https://wiki.mozilla.org/Security/Server_Side_TLS">Server Side TLS guidelines</a></li>
<li><a class="text-white" href="https://infosec.mozilla.org/guidelines/web_security">Web Security guidelines</a></li>
</ul>
</div>

<div class="col-12 col-md-4">
<h5>Product Help</h5>
<h5>Contribute & report issues</h5>
<ul class="list-unstyled">
<li><a class="text-white" href="https://github.com/mozilla/ssl-config-generator/issues">File a bug</a></li>
<li><a class="text-white" href="https://github.com/mozilla/ssl-config-generator#creating-templates">Supporting new software</a></li>
<li><a class="text-white" href="https://github.com/mozilla/ssl-config-generator/releases">Changelog and version history</a></li>
</ul>
</div>
</div>
</div>

</div>
<% if (htmlWebpackPlugin.options.production) { %>
<div class="w-100 d-none d-md-block pr-3 pb-1 small text-right text-muted"><a class="text-secondary" href="https://github.com/mozilla/ssl-config-generator/commit/<%= htmlWebpackPlugin.options.revision %>">build <%= htmlWebpackPlugin.options.revision %></a>, generated <%= htmlWebpackPlugin.options.date %></div>
<% } %>
Expand Down
Loading