Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

πŸ”’ Fail save-config early if preventWriteToDisk set

Alicia Sykesfafe9ad95d01
diff --git a/services/app.js b/services/app.js
index 18aae180..b54d7635 100644
--- a/services/app.js
+++ b/services/app.js
@@ -268,6 +268,9 @@ const app = express()
}))
// POST Endpoint used to save config, by writing config file to disk
.use(ENDPOINTS.save, protectConfig, requireAdmin, method('POST', (req, res) => {
+ if (config?.appConfig?.preventWriteToDisk) {
+ return res.status(403).json({ error: 'Editing config has been disabled by your administrator' });
+ }
let responded = false;
const respond = (jsonBody) => {
if (responded || res.headersSent) return;