diff --git a/index.html b/index.html index 901fbf0ea..2a4d4e5d9 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,6 @@ - diff --git a/public/robots.txt b/public/robots.txt deleted file mode 100644 index e9e57dc4d..000000000 --- a/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/server/server.js b/server/server.js index 845310e2d..62fe15d15 100644 --- a/server/server.js +++ b/server/server.js @@ -88,16 +88,26 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); // Normal Router here - app.use("/", express.static("dist")); + // Robots.txt + app.get("/robots.txt", async (_request, response) => { + let txt = "User-agent: *\nDisallow:"; + if (! await setting("searchEngineIndex")) { + txt += " /"; + } + response.setHeader("Content-Type", "text/plain"); + response.send(txt); + }); // Basic Auth Router here // Prometheus API metrics /metrics // With Basic Auth using the first user's username/password - app.get("/metrics", basicAuth, prometheusAPIMetrics()) + app.get("/metrics", basicAuth, prometheusAPIMetrics()); + + app.use("/", express.static("dist")); // Universal Route Handler, must be at the end - app.get("*", function(_request, response) { + app.get("*", async (_request, response) => { response.send(indexHTML); }); diff --git a/src/pages/Settings.vue b/src/pages/Settings.vue index 164c169b0..56d307d9b 100644 --- a/src/pages/Settings.vue +++ b/src/pages/Settings.vue @@ -42,13 +42,13 @@
- +
- + @@ -185,7 +185,7 @@ export default { saveGeneral() { localStorage.timezone = this.$root.userTimezone; - toast.success("Saved.") + this.saveSettings(); }, savePassword() {