txtdot/templates/configuration.ejs
Artemy Egorov 7c72d985f7
Merge pull request from GHSA-4gj5-xj97-j8fp
* ci: add build check to pull requests

* Build(deps-dev): Bump @types/node from 20.10.6 to 20.11.24 (#91)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.10.6 to 20.11.24.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: image compression (#101)

* feat: image compression

* fix: not compress svg

Maybe we should add a function to disable this fix. Since I noticed that if you compress svg in webp it becomes magically smaller.

* Configuration page (#104)

* feat: image compression

* feat: configuration page

* refactor: json stringify

and change engine buttons to ordered list

* fix: engine distributor matching

* fix: formatting

* build: update txtdot version to 1.7.0

* fix: configuration page title

* doc: features (#102)

* fix: ssrf

GHSA-4gj5-xj97-j8fp

Doesn't fully correct the error! You need to configure the server to block requests.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-07 14:49:54 +03:00

55 lines
1.6 KiB
Plaintext

<%
// hide private properties from config
const to_hide = ["host", "port"];
function replacer(key,value) {
if (to_hide.includes(key)) return undefined;
else return value;
}
function to_pretty(obj) {
return JSON.stringify(obj, replacer, 2).replace(/[\[\]{}"]/g, "").replace(/,/g, "");
}
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="<%= packageJSON.description %>">
<title>txt. configuration</title>
<link rel="stylesheet" href="/static/common.css">
<link rel="stylesheet" href="/static/configuration.css">
</head>
<body>
<main>
<header>
<h1>txt<span class="dot">.</span></h1>
<div class="menu">
<a class="button secondary" href="/">Home</a>
</div>
<p><%= packageJSON.description %></p>
</header>
<div class="configuration">
<h2>Configuration</h2>
<pre> version: <%= packageJSON.version %><%= to_pretty(config) %></pre>
<h2>Available engines</h2>
<ol>
<%
for (const engine of engines) {
%><li><%= engine.name %>: <%= engine.description %></li><%
}
%>
</ol>
<h2>Available routes</h2>
<%
for (const route of dynConfig.routes) {
%><a class="button secondary" href="<%= route %>"><%= route %></a><%
}
%>
</div>
</main>
</body>
</html>