diff --git a/tools/webpack b/tools/webpack index f463bd06af..d2b553dca1 100755 --- a/tools/webpack +++ b/tools/webpack @@ -11,6 +11,7 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..") os.chdir(os.path.join(os.path.dirname(__file__), "../web")) +from scripts.lib.zulip_tools import get_config, get_config_file from version import ZULIP_VERSION webpack_command = [ @@ -39,6 +40,10 @@ def build_for_prod_or_puppeteer(quiet: bool, config_name: str | None = None) -> webpack_args += [f"--config-name={config_name}"] if "PUPPETEER_TESTS" in os.environ: webpack_args.append("--env=puppeteer_tests") + else: + custom_5xx_file = get_config(get_config_file(), "application_server", "5xx_file") + if custom_5xx_file is not None: + webpack_args.append(f"--env=custom_5xx_file={custom_5xx_file}") # Silence warnings from "browserslist" about using old data; those # warnings are only useful for development diff --git a/web/html/5xx-cloud.html b/web/html/5xx-cloud.html new file mode 100644 index 0000000000..921e08e9d9 --- /dev/null +++ b/web/html/5xx-cloud.html @@ -0,0 +1,33 @@ + + + + + 500 internal server error | Zulip + + + + +
+
+ +
+
+
+ +
+
+

Internal server error

+

Zulip Cloud is currently experiencing some technical difficulties. Sorry about that!

+

You can check our status page for more information.

+

The page will reload automatically soon after service is restored.

+
+
+
+ + diff --git a/web/html/5xx.html b/web/html/5xx.html index ee6fb77970..eb3d0fefe7 100644 --- a/web/html/5xx.html +++ b/web/html/5xx.html @@ -7,9 +7,6 @@ - - -
diff --git a/web/webpack.config.ts b/web/webpack.config.ts index c10f2afc24..bc65801673 100644 --- a/web/webpack.config.ts +++ b/web/webpack.config.ts @@ -17,7 +17,12 @@ import assets from "./webpack.assets.json" with {type: "json"}; import dev_assets from "./webpack.dev-assets.json" with {type: "json"}; const config = ( - env: {minimize?: true; puppeteer_tests?: true; ZULIP_VERSION?: string} = {}, + env: { + minimize?: true; + puppeteer_tests?: true; + ZULIP_VERSION?: string; + custom_5xx_file?: string; + } = {}, argv: {mode?: string}, ): webpack.Configuration[] => { const production: boolean = argv.mode === "production"; @@ -50,7 +55,7 @@ const config = ( }), new HtmlWebpackPlugin({ filename: "5xx.html", - template: "html/5xx.html", + template: env.custom_5xx_file ? "html/" + env.custom_5xx_file : "html/5xx.html", chunks: ["error-styles"], publicPath: production ? "/static/webpack-bundles/" : "/webpack/", }),