@fabioplunser/epd 0.5.5 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +16 -12
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -684,7 +684,7 @@ function normalize(raw, configPath, root, destination) {
684
684
  passwordEnv
685
685
  };
686
686
  }
687
- const image = asString(raw.image, "epd.yml.image", registry ? `${registry.server ? registry.server + "/" : ""}${registry.username}/${name}` : name);
687
+ const image = asString(raw.image, "epd.yml.image", registry ? `${registry.server ? registry.server + "/" : ""}${registry.username}/${name}` : name).toLowerCase();
688
688
  const buildRaw = raw.build ?? {};
689
689
  checkKeys(buildRaw, ["dockerfile", "context", "platform", "target", "args", "secrets", "cache", "remote"], "epd.yml.build");
690
690
  const sshRaw = raw.ssh ?? {};
@@ -866,12 +866,6 @@ function validateCrossReferences(cfg) {
866
866
  }
867
867
  }
868
868
  }
869
- if (cfg.proxy.enabled && cfg.proxy.ssl && cfg.proxy.challenge !== "dns" && !cfg.proxy.email) {
870
- const anySsl = cfg.services.some((s) => s.routes.some((r) => r.ssl));
871
- if (anySsl)
872
- fail("epd.yml.proxy.email", "is required for Let's Encrypt certificates", `proxy:
873
- email: you@example.com`);
874
- }
875
869
  if (cfg.mode === "docker" && !cfg.registry && cfg.services.some((s) => s.hosts.length > 1)) {}
876
870
  }
877
871
 
@@ -2804,8 +2798,8 @@ http:
2804
2798
  - url: "http://${upstreamHost}:${upstreamPort}"
2805
2799
  `;
2806
2800
  }
2807
- function updateLocalConfigDisableProxy() {
2808
- const configFile = resolve2("epd.yml");
2801
+ function updateLocalConfigDisableProxy(configPath = "epd.yml") {
2802
+ const configFile = resolve2(configPath);
2809
2803
  if (!existsSync5(configFile))
2810
2804
  return;
2811
2805
  try {
@@ -2843,7 +2837,7 @@ async function handleExistingProxy(host, cfg, detected) {
2843
2837
  if (!useExisting)
2844
2838
  return false;
2845
2839
  cfg.proxy.enabled = false;
2846
- updateLocalConfigDisableProxy();
2840
+ updateLocalConfigDisableProxy(cfg.configPath);
2847
2841
  if (detected.type === "caddy") {
2848
2842
  const snippet = generateCaddyConfig(cfg, "127.0.0.1", upstreamPort);
2849
2843
  log.plain(`
@@ -3308,6 +3302,13 @@ async function ensureProxy(host, cfg, opts = {}) {
3308
3302
  if (!cfg.proxy.enabled)
3309
3303
  return;
3310
3304
  }
3305
+ if (cfg.proxy.ssl && cfg.proxy.challenge !== "dns" && !cfg.proxy.email) {
3306
+ const anySsl = cfg.services.some((s) => s.routes.some((r) => r.ssl));
3307
+ if (anySsl) {
3308
+ throw new EpdError("epd.yml.proxy.email: is required for Let's Encrypt certificates", `proxy:
3309
+ email: you@example.com`);
3310
+ }
3311
+ }
3311
3312
  await host.writeFile(p.proxyApp, JSON.stringify(declaration, null, 2), "644");
3312
3313
  const where = containerMode ? CONTAINER_PATHS : { dynamicDir: p.proxyDynamicDir, acmeFile: `${p.acmeDir}/acme.json` };
3313
3314
  const staticJson = JSON.stringify(staticConfig(merged, where), null, 2);
@@ -4358,7 +4359,10 @@ async function syncDns(cfg, opts = {}) {
4358
4359
  provider = opts.provider;
4359
4360
  } else if (opts.client) {
4360
4361
  provider = opts.client;
4361
- } else if (cfg.dns?.enabled && cfg.dns.apiToken) {
4362
+ } else if (cfg.dns?.enabled) {
4363
+ if (!cfg.dns.apiToken) {
4364
+ throw new EpdError(`${cfg.dns.provider} DNS API token is missing`, `Set ${cfg.dns.provider === "cloudflare" ? "CLOUDFLARE_API_TOKEN" : "HETZNER_DNS_API_TOKEN"} in your environment or specify api_token in epd.yml under dns.`);
4365
+ }
4362
4366
  provider = createDnsProvider(cfg.dns);
4363
4367
  } else if (cfg.cloudflare) {
4364
4368
  const token = cfg.cloudflare.apiToken || process.env.CLOUDFLARE_API_TOKEN || process.env.CF_DNS_API_TOKEN;
@@ -6823,7 +6827,7 @@ async function promptAutoUpdate(currentVersion) {
6823
6827
  }
6824
6828
 
6825
6829
  // src/version.ts
6826
- var VERSION = "0.5.5";
6830
+ var VERSION = "0.5.7";
6827
6831
 
6828
6832
  // src/commands/update.ts
6829
6833
  var update = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabioplunser/epd",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Easy Project Deployer — deploy any project to one or many servers with Docker or PM2, fronted by Traefik.",
5
5
  "type": "module",
6
6
  "author": "Fabio Plünser",