diff --git a/default.conf b/default.conf index c723440..adb2f0d 100644 --- a/default.conf +++ b/default.conf @@ -11,8 +11,6 @@ server { add_header Cache-Control "public, max-age=604800, immutable"; } - # Additional configurations can be added here if needed - # For example, error handling, logging, etc. error_page 404 /index.html; error_page 500 502 503 504 /index.html; } diff --git a/postcss.config.js b/postcss.config.js deleted file mode 100644 index 2e7af2b..0000000 --- a/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/readme.md b/readme.md index 7b24439..35b683f 100644 --- a/readme.md +++ b/readme.md @@ -32,6 +32,11 @@ Inspired by [Ben Phelps' Homepage](https://gethomepage.dev/) and [Umbrel](https: # Change history +## 1.4.0 + +- Rewrote the entire application to not use React. Now it's just a Node application that emits static HTML. +- Removed lots of packages + ## 1.3.0 - Removed all JavaScript as part of the build step. The image will be slightly larger and take longer to start up and shut down, but the page will be even lighter. diff --git a/start.js b/start.js deleted file mode 100644 index d66f678..0000000 --- a/start.js +++ /dev/null @@ -1,61 +0,0 @@ -import { exec } from "child_process"; -import fs from "fs/promises"; -import puppeteer from "puppeteer"; - -function runNpmCommand(command) { - return new Promise((resolve, reject) => { - exec(`npm ${command}`, (error, stdout, stderr) => { - if (error) { - console.error(`Error executing command: ${error}`); - reject(error); - } else { - console.log(`Command output: ${stdout}`); - resolve(stdout); - } - }); - }); -} - -async function renderHomePage() { - const browser = await puppeteer.launch({ - headless: true, - args: ["--no-sandbox", "--disable-setuid-sandbox"], - executablePath: "chromium", // Remove this when running locally - }); - const page = await browser.newPage(); - - await page.goto("http://localhost:4173", { waitUntil: "networkidle0" }); - - // Wait for any additional content to load - await page.waitForNetworkIdle(); - - // Get the rendered HTML content - const renderedHTML = await page.content(); - - // Save the rendered HTML to a file - fs.writeFile("./dist/index.html", renderedHTML); - - await browser.close(); -} - -async function runCommands() { - try { - console.log("Building React site"); - await runNpmCommand("run build"); - - setTimeout(async () => { - console.log("Taking snapshot"); - await renderHomePage(); - await runNpmCommand("run html"); - await runNpmCommand("run replace"); - }, 2000); - - console.log("Starting web server"); - await runNpmCommand("run serve"); - } catch (err) { - // Handle errors - console.error("An error occurred:", err); - } -} - -runCommands();