Skip to content
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
4 changes: 2 additions & 2 deletions app/client/public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
return result;
}

const smartLookId = parseConfig("__APPSMITH_SMART_LOOK_ID__");
const sentryDSN = parseConfig("__APPSMITH_SENTRY_DSN__");
const smartLookId = parseConfig('{{env "APPSMITH_SMART_LOOK_ID"}}');
const sentryDSN = parseConfig('{{env "APPSMITH_SENTRY_DSN"}}');
</script>
<script type='text/javascript'>
if(smartLookId) {
Expand Down
17 changes: 9 additions & 8 deletions deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,15 @@ if (CUSTOM_DOMAIN !== "") {
}

if (!process.argv.includes("--no-finalize-index-html")) {
finalizeIndexHtml()
finalizeHtmlFiles()
}

fs.mkdirSync(dirname(CaddyfilePath), { recursive: true })
fs.writeFileSync(CaddyfilePath, parts.join("\n"))
spawnSync(AppsmithCaddy, ["fmt", "--overwrite", CaddyfilePath])
spawnSync(AppsmithCaddy, ["reload", "--config", CaddyfilePath])

function finalizeIndexHtml() {
function finalizeHtmlFiles() {
let info = null;
try {
info = JSON.parse(fs.readFileSync("/opt/appsmith/info.json", "utf8"))
Expand All @@ -248,17 +248,18 @@ function finalizeIndexHtml() {
APPSMITH_VERSION_RELEASE_DATE: info?.imageBuiltAt ?? "",
}

const content = fs.readFileSync("/opt/appsmith/editor/index.html", "utf8").replaceAll(
/\{\{env\s+"(APPSMITH_[A-Z0-9_]+)"}}/g,
(_, name) => (process.env[name] || extraEnv[name] || "")
)
for (const file of ["index.html", "404.html"]) {
const content = fs.readFileSync("/opt/appsmith/editor/" + file, "utf8").replaceAll(
/\{\{env\s+"(APPSMITH_[A-Z0-9_]+)"}}/g,
(_, name) => (process.env[name] || extraEnv[name] || "")
)

fs.writeFileSync(process.env.WWW_PATH + "/index.html", content)
fs.writeFileSync(process.env.WWW_PATH + "/" + file, content)
}
}

function isCertExpired(path) {
const cert = new X509Certificate(fs.readFileSync(path, "utf-8"))
console.log(path, cert)
return new Date(cert.validTo) < new Date()
}