ante-erp-cli 1.11.38 → 1.11.40

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ante-erp-cli",
3
- "version": "1.11.38",
3
+ "version": "1.11.40",
4
4
  "description": "Comprehensive CLI tool for managing ANTE ERP self-hosted installations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -766,11 +766,12 @@ export async function setDomain(options) {
766
766
 
767
767
  if (isHttps && isDomainName && needsNginx) {
768
768
  // SSL setup workflow
769
- let enableSsl = options.ssl || false;
769
+ // Note: --ssl flag maps to options.enableSsl due to Commander.js option syntax
770
+ let enableSsl = options.ssl || options.enableSsl || false;
770
771
  let sslEmail = options.email || '';
771
772
 
772
773
  // If not specified via flags, ask in interactive mode
773
- if (options.interactive !== false && !options.ssl) {
774
+ if (options.interactive !== false && !options.ssl && !options.enableSsl) {
774
775
  console.log(chalk.cyan('\nšŸ”’ SSL/HTTPS Configuration\n'));
775
776
  console.log(chalk.gray('You\'re using HTTPS URLs. Would you like to obtain SSL certificates now?\n'));
776
777
  console.log(chalk.gray('This will:'));
@@ -1,7 +1,7 @@
1
1
  import chalk from 'chalk';
2
2
  import ora from 'ora';
3
3
  import { execa } from 'execa';
4
- import { writeFileSync, existsSync, mkdirSync } from 'fs';
4
+ import { writeFileSync, existsSync, mkdirSync, unlinkSync } from 'fs';
5
5
  import { join } from 'path';
6
6
 
7
7
  /**
@@ -818,6 +818,18 @@ export async function configureNginx(config) {
818
818
 
819
819
  // Write configuration to sites-enabled (direct, not using sites-available)
820
820
  const configPath = join(sitesEnabledDir, 'ante');
821
+ const backupPath = `${configPath}.backup`;
822
+
823
+ // Clean up any existing backup file to prevent "conflicting server name" warnings
824
+ // Nginx reads ALL files in sites-enabled, including .backup files
825
+ if (existsSync(backupPath)) {
826
+ try {
827
+ unlinkSync(backupPath);
828
+ } catch {
829
+ // Ignore cleanup errors
830
+ }
831
+ }
832
+
821
833
  writeFileSync(configPath, nginxConfig);
822
834
 
823
835
  spinner.text = 'Testing NGINX configuration...';
package/src/utils/ssl.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import chalk from 'chalk';
2
2
  import ora from 'ora';
3
3
  import { execa } from 'execa';
4
- import { writeFileSync, existsSync, copyFileSync } from 'fs';
4
+ import { writeFileSync, existsSync, copyFileSync, unlinkSync } from 'fs';
5
5
  import { generateNginxConfig } from './nginx.js';
6
6
 
7
7
  /**
@@ -223,6 +223,16 @@ export async function updateNginxForSSL(config) {
223
223
  throw new Error('NGINX failed to start after configuration update');
224
224
  }
225
225
 
226
+ // Clean up backup file after successful reload
227
+ // This prevents nginx "conflicting server name" warnings since nginx reads all files in sites-enabled
228
+ if (existsSync(backupPath)) {
229
+ try {
230
+ unlinkSync(backupPath);
231
+ } catch {
232
+ // Ignore cleanup errors
233
+ }
234
+ }
235
+
226
236
  spinner.succeed('NGINX configured for HTTPS');
227
237
 
228
238
  // Show configuration info