mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-11-04 01:15:14 +00:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			lang-persi
			...
			8e9e033a72
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					8e9e033a72 | ||
| 
						 | 
					e6ec74c2f7 | 
@@ -832,6 +832,7 @@ const internalCertificate = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		const cmd = `${certbotCommand} certonly ` +
 | 
							const cmd = `${certbotCommand} certonly ` +
 | 
				
			||||||
			`--config '${letsencryptConfig}' ` +
 | 
								`--config '${letsencryptConfig}' ` +
 | 
				
			||||||
 | 
								`--key-type '${certificate.ssl_key_type}' ` +
 | 
				
			||||||
			'--work-dir "/tmp/letsencrypt-lib" ' +
 | 
								'--work-dir "/tmp/letsencrypt-lib" ' +
 | 
				
			||||||
			'--logs-dir "/tmp/letsencrypt-log" ' +
 | 
								'--logs-dir "/tmp/letsencrypt-log" ' +
 | 
				
			||||||
			`--cert-name "npm-${certificate.id}" ` +
 | 
								`--cert-name "npm-${certificate.id}" ` +
 | 
				
			||||||
@@ -873,6 +874,7 @@ const internalCertificate = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		let mainCmd = certbotCommand + ' certonly ' +
 | 
							let mainCmd = certbotCommand + ' certonly ' +
 | 
				
			||||||
			`--config '${letsencryptConfig}' ` +
 | 
								`--config '${letsencryptConfig}' ` +
 | 
				
			||||||
 | 
								`--key-type '${certificate.ssl_key_type}' ` +
 | 
				
			||||||
			'--work-dir "/tmp/letsencrypt-lib" ' +
 | 
								'--work-dir "/tmp/letsencrypt-lib" ' +
 | 
				
			||||||
			'--logs-dir "/tmp/letsencrypt-log" ' +
 | 
								'--logs-dir "/tmp/letsencrypt-log" ' +
 | 
				
			||||||
			`--cert-name 'npm-${certificate.id}' ` +
 | 
								`--cert-name 'npm-${certificate.id}' ` +
 | 
				
			||||||
@@ -969,6 +971,7 @@ const internalCertificate = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		const cmd = certbotCommand + ' renew --force-renewal ' +
 | 
							const cmd = certbotCommand + ' renew --force-renewal ' +
 | 
				
			||||||
			`--config '${letsencryptConfig}' ` +
 | 
								`--config '${letsencryptConfig}' ` +
 | 
				
			||||||
 | 
								`--key-type '${certificate.ssl_key_type}' ` +
 | 
				
			||||||
			'--work-dir "/tmp/letsencrypt-lib" ' +
 | 
								'--work-dir "/tmp/letsencrypt-lib" ' +
 | 
				
			||||||
			'--logs-dir "/tmp/letsencrypt-log" ' +
 | 
								'--logs-dir "/tmp/letsencrypt-log" ' +
 | 
				
			||||||
			`--cert-name 'npm-${certificate.id}' ` +
 | 
								`--cert-name 'npm-${certificate.id}' ` +
 | 
				
			||||||
@@ -1002,6 +1005,7 @@ const internalCertificate = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		let mainCmd = certbotCommand + ' renew --force-renewal ' +
 | 
							let mainCmd = certbotCommand + ' renew --force-renewal ' +
 | 
				
			||||||
			`--config "${letsencryptConfig}" ` +
 | 
								`--config "${letsencryptConfig}" ` +
 | 
				
			||||||
 | 
								`--key-type '${certificate.ssl_key_type}' ` +
 | 
				
			||||||
			'--work-dir "/tmp/letsencrypt-lib" ' +
 | 
								'--work-dir "/tmp/letsencrypt-lib" ' +
 | 
				
			||||||
			'--logs-dir "/tmp/letsencrypt-log" ' +
 | 
								'--logs-dir "/tmp/letsencrypt-log" ' +
 | 
				
			||||||
			`--cert-name 'npm-${certificate.id}' ` +
 | 
								`--cert-name 'npm-${certificate.id}' ` +
 | 
				
			||||||
@@ -1035,6 +1039,7 @@ const internalCertificate = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		const mainCmd = certbotCommand + ' revoke ' +
 | 
							const mainCmd = certbotCommand + ' revoke ' +
 | 
				
			||||||
			`--config '${letsencryptConfig}' ` +
 | 
								`--config '${letsencryptConfig}' ` +
 | 
				
			||||||
 | 
								`--key-type '${certificate.ssl_key_type}' ` +
 | 
				
			||||||
			'--work-dir "/tmp/letsencrypt-lib" ' +
 | 
								'--work-dir "/tmp/letsencrypt-lib" ' +
 | 
				
			||||||
			'--logs-dir "/tmp/letsencrypt-log" ' +
 | 
								'--logs-dir "/tmp/letsencrypt-log" ' +
 | 
				
			||||||
			`--cert-path '/etc/letsencrypt/live/npm-${certificate.id}/fullchain.pem' ` +
 | 
								`--cert-path '/etc/letsencrypt/live/npm-${certificate.id}/fullchain.pem' ` +
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										39
									
								
								backend/migrations/20241209062244_ssl_key_type.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								backend/migrations/20241209062244_ssl_key_type.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
				
			|||||||
 | 
					const migrate_name = 'identifier_for_migrate';
 | 
				
			||||||
 | 
					const logger       = require('../logger').migrate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Migrate
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @see http://knexjs.org/#Schema
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @param {Object} knex
 | 
				
			||||||
 | 
					 * @param {Promise} Promise
 | 
				
			||||||
 | 
					 * @returns {Promise}
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					exports.up = function (knex) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						logger.info(`[${migrate_name}] Migrating Up...`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return knex.schema.alterTable('proxy_host', (table) => {
 | 
				
			||||||
 | 
							table.enum('ssl_key_type', ['ecdsa', 'rsa']).defaultTo('ecdsa').notNullable();
 | 
				
			||||||
 | 
						}).then(() => {
 | 
				
			||||||
 | 
							logger.info(`[${migrate_name}] Column 'ssl_key_type' added to table 'proxy_host'`);
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Undo Migrate
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @param {Object} knex
 | 
				
			||||||
 | 
					 * @param {Promise} Promise
 | 
				
			||||||
 | 
					 * @returns {Promise}
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					exports.down = function (knex) {
 | 
				
			||||||
 | 
						logger.info(`[${migrate_name}] Migrating Down...`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return knex.schema.alterTable('proxy_host', (table) => {
 | 
				
			||||||
 | 
							table.dropColumn('ssl_key_type');
 | 
				
			||||||
 | 
						}).then(() => {
 | 
				
			||||||
 | 
							logger.info(`[${migrate_name}] Column 'ssl_key_type' removed from table 'proxy_host'`);
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
@@ -23,6 +23,7 @@
 | 
				
			|||||||
		"locations",
 | 
							"locations",
 | 
				
			||||||
		"hsts_enabled",
 | 
							"hsts_enabled",
 | 
				
			||||||
		"hsts_subdomains",
 | 
							"hsts_subdomains",
 | 
				
			||||||
 | 
							"ssl_key_type",
 | 
				
			||||||
		"certificate"
 | 
							"certificate"
 | 
				
			||||||
	],
 | 
						],
 | 
				
			||||||
	"additionalProperties": false,
 | 
						"additionalProperties": false,
 | 
				
			||||||
@@ -149,6 +150,11 @@
 | 
				
			|||||||
					"$ref": "./access-list-object.json"
 | 
										"$ref": "./access-list-object.json"
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			]
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ssl_key_type": {
 | 
				
			||||||
 | 
								"type": "string",
 | 
				
			||||||
 | 
								"enum": ["ecdsa", "rsa"],
 | 
				
			||||||
 | 
								"description": "Type of SSL key (either ecdsa or rsa)"
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -79,6 +79,9 @@
 | 
				
			|||||||
						},
 | 
											},
 | 
				
			||||||
						"locations": {
 | 
											"locations": {
 | 
				
			||||||
							"$ref": "../../../../components/proxy-host-object.json#/properties/locations"
 | 
												"$ref": "../../../../components/proxy-host-object.json#/properties/locations"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											"ssl_key_type": {
 | 
				
			||||||
 | 
												"$ref": "../../../../components/proxy-host-object.json#/properties/ssl_key_type"
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,6 +67,9 @@
 | 
				
			|||||||
						},
 | 
											},
 | 
				
			||||||
						"locations": {
 | 
											"locations": {
 | 
				
			||||||
							"$ref": "../../../components/proxy-host-object.json#/properties/locations"
 | 
												"$ref": "../../../components/proxy-host-object.json#/properties/locations"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											"ssl_key_type": {
 | 
				
			||||||
 | 
												"$ref": "../../../components/proxy-host-object.json#/properties/ssl_key_type"
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,6 @@
 | 
				
			|||||||
text = True
 | 
					text = True
 | 
				
			||||||
non-interactive = True
 | 
					non-interactive = True
 | 
				
			||||||
webroot-path = /data/letsencrypt-acme-challenge
 | 
					webroot-path = /data/letsencrypt-acme-challenge
 | 
				
			||||||
key-type = ecdsa
 | 
					 | 
				
			||||||
elliptic-curve = secp384r1
 | 
					elliptic-curve = secp384r1
 | 
				
			||||||
preferred-chain = ISRG Root X1
 | 
					preferred-chain = ISRG Root X1
 | 
				
			||||||
server =
 | 
					server =
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,5 @@
 | 
				
			|||||||
text = True
 | 
					text = True
 | 
				
			||||||
non-interactive = True
 | 
					non-interactive = True
 | 
				
			||||||
webroot-path = /data/letsencrypt-acme-challenge
 | 
					webroot-path = /data/letsencrypt-acme-challenge
 | 
				
			||||||
key-type = ecdsa
 | 
					 | 
				
			||||||
elliptic-curve = secp384r1
 | 
					elliptic-curve = secp384r1
 | 
				
			||||||
preferred-chain = ISRG Root X1
 | 
					preferred-chain = ISRG Root X1
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -105,6 +105,15 @@
 | 
				
			|||||||
                                </select>
 | 
					                                </select>
 | 
				
			||||||
                            </div>
 | 
					                            </div>
 | 
				
			||||||
                        </div>
 | 
					                        </div>
 | 
				
			||||||
 | 
					                        <div class="col-sm-12 col-md-12">
 | 
				
			||||||
 | 
					                            <div class="form-group">
 | 
				
			||||||
 | 
					                                <label class="form-label"><%- i18n('all-hosts', 'ssl-key-type') %></label>
 | 
				
			||||||
 | 
					                                <select name="ssl_key_type" class="form-control custom-select">
 | 
				
			||||||
 | 
					                                    <option value="ecdsa" data-data="{"id":"ecdsa"}" <%- ssl_key_type == 'ecdsa' ? 'selected' : '' %>>ECDSA</option>
 | 
				
			||||||
 | 
					                                    <option value="rsa" data-data="{"id":"rsa"}" <%- ssl_key_type == 'rsa' ? 'selected' : '' %>>RSA</option>
 | 
				
			||||||
 | 
					                                </select>
 | 
				
			||||||
 | 
					                            </div>
 | 
				
			||||||
 | 
					                        </div>
 | 
				
			||||||
                        <div class="col-sm-6 col-md-6">
 | 
					                        <div class="col-sm-6 col-md-6">
 | 
				
			||||||
                            <div class="form-group">
 | 
					                            <div class="form-group">
 | 
				
			||||||
                                <label class="custom-switch">
 | 
					                                <label class="custom-switch">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -77,6 +77,7 @@
 | 
				
			|||||||
      "block-exploits": "Block Common Exploits",
 | 
					      "block-exploits": "Block Common Exploits",
 | 
				
			||||||
      "caching-enabled": "Cache Assets",
 | 
					      "caching-enabled": "Cache Assets",
 | 
				
			||||||
      "ssl-certificate": "SSL Certificate",
 | 
					      "ssl-certificate": "SSL Certificate",
 | 
				
			||||||
 | 
					      "ssl-key-type": "SSL Key Type",
 | 
				
			||||||
      "none": "None",
 | 
					      "none": "None",
 | 
				
			||||||
      "new-cert": "Request a new SSL Certificate",
 | 
					      "new-cert": "Request a new SSL Certificate",
 | 
				
			||||||
      "with-le": "with Let's Encrypt",
 | 
					      "with-le": "with Let's Encrypt",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,7 @@ const model = Backbone.Model.extend({
 | 
				
			|||||||
            modified_on:     null,
 | 
					            modified_on:     null,
 | 
				
			||||||
            domain_names:    [],
 | 
					            domain_names:    [],
 | 
				
			||||||
            certificate_id:  0,
 | 
					            certificate_id:  0,
 | 
				
			||||||
 | 
					            ssl_key_type:    'ecdsa',
 | 
				
			||||||
            ssl_forced:      false,
 | 
					            ssl_forced:      false,
 | 
				
			||||||
            http2_support:   false,
 | 
					            http2_support:   false,
 | 
				
			||||||
            hsts_enabled:    false,
 | 
					            hsts_enabled:    false,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,7 @@ const model = Backbone.Model.extend({
 | 
				
			|||||||
            forward_port:            null,
 | 
					            forward_port:            null,
 | 
				
			||||||
            access_list_id:          0,
 | 
					            access_list_id:          0,
 | 
				
			||||||
            certificate_id:          0,
 | 
					            certificate_id:          0,
 | 
				
			||||||
 | 
					            ssl_key_type:            'ecdsa',
 | 
				
			||||||
            ssl_forced:              false,
 | 
					            ssl_forced:              false,
 | 
				
			||||||
            hsts_enabled:            false,
 | 
					            hsts_enabled:            false,
 | 
				
			||||||
            hsts_subdomains:         false,
 | 
					            hsts_subdomains:         false,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,7 @@ const model = Backbone.Model.extend({
 | 
				
			|||||||
            forward_domain_name: '',
 | 
					            forward_domain_name: '',
 | 
				
			||||||
            preserve_path:       true,
 | 
					            preserve_path:       true,
 | 
				
			||||||
            certificate_id:      0,
 | 
					            certificate_id:      0,
 | 
				
			||||||
 | 
					            ssl_key_type:        'ecdsa',
 | 
				
			||||||
            ssl_forced:          false,
 | 
					            ssl_forced:          false,
 | 
				
			||||||
            hsts_enabled:        false,
 | 
					            hsts_enabled:        false,
 | 
				
			||||||
            hsts_subdomains:     false,
 | 
					            hsts_subdomains:     false,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user