@@ -186,18 +186,13 @@ module.exports = function () {
186186
187187 // 2. rename archive folder name
188188 new_archive_path = new_archive_path + 'npm-' + certificate . id ;
189- //logger.debug('Renaming archive folder:', full_archive_path, '->', new_archive_path);
190-
191189 fs . renameSync ( full_archive_path , new_archive_path ) ;
192190
193191 return certificate ;
194192 } )
195193 . then ( certificate => {
196194 // 3. rename live folder name
197195 new_live_path = new_live_path + 'npm-' + certificate . id ;
198-
199- //logger.debug('Renaming live folder:', full_live_path, '->', new_live_path);
200-
201196 fs . renameSync ( full_live_path , new_live_path ) ;
202197
203198 // and also update the symlinks in this folder:
@@ -211,8 +206,6 @@ module.exports = function () {
211206 ] ;
212207
213208 names . map ( function ( name ) {
214- //logger.debug('Live Link:', name);
215-
216209 // remove symlink
217210 try {
218211 fs . unlinkSync ( new_live_path + '/' + name [ 0 ] ) ;
@@ -221,7 +214,6 @@ module.exports = function () {
221214 logger . error ( err ) ;
222215 }
223216
224- //logger.debug('Creating Link:', '../../archive/npm-' + certificate.id + '/' + name[1]);
225217 // create new symlink
226218 fs . symlinkSync ( '../../archive/npm-' + certificate . id + '/' + name [ 1 ] , name [ 0 ] ) ;
227219 } ) ;
@@ -356,8 +348,6 @@ module.exports = function () {
356348 certificate_id = certificate_map [ host . hostname ] ;
357349 }
358350
359- // TODO: Advanced nginx config
360-
361351 return proxyHostModel
362352 . query ( )
363353 . insertAndFetch ( {
@@ -370,6 +360,7 @@ module.exports = function () {
370360 ssl_forced : host . force_ssl || false ,
371361 caching_enabled : host . asset_caching || false ,
372362 block_exploits : host . block_exploits || false ,
363+ advanced_config : host . advanced || '' ,
373364 meta : meta
374365 } )
375366 . then ( row => {
@@ -405,16 +396,15 @@ module.exports = function () {
405396 certificate_id = certificate_map [ host . hostname ] ;
406397 }
407398
408- // TODO: Advanced nginx config
409-
410399 return deadHostModel
411400 . query ( )
412401 . insertAndFetch ( {
413- owner_user_id : 1 ,
414- domain_names : [ host . hostname ] ,
415- certificate_id : certificate_id ,
416- ssl_forced : host . force_ssl || false ,
417- meta : meta
402+ owner_user_id : 1 ,
403+ domain_names : [ host . hostname ] ,
404+ certificate_id : certificate_id ,
405+ ssl_forced : host . force_ssl || false ,
406+ advanced_config : host . advanced || '' ,
407+ meta : meta
418408 } )
419409 . then ( row => {
420410 // re-fetch with cert
@@ -449,8 +439,6 @@ module.exports = function () {
449439 certificate_id = certificate_map [ host . hostname ] ;
450440 }
451441
452- // TODO: Advanced nginx config
453-
454442 return redirectionHostModel
455443 . query ( )
456444 . insertAndFetch ( {
@@ -460,6 +448,7 @@ module.exports = function () {
460448 block_exploits : host . block_exploits || false ,
461449 certificate_id : certificate_id ,
462450 ssl_forced : host . force_ssl || false ,
451+ advanced_config : host . advanced || '' ,
463452 meta : meta
464453 } )
465454 . then ( row => {
@@ -483,8 +472,6 @@ module.exports = function () {
483472 const importStream = function ( access , host ) {
484473 logger . info ( 'Creating Stream: ' + host . incoming_port ) ;
485474
486- // TODO: Advanced nginx config
487-
488475 return streamModel
489476 . query ( )
490477 . insertAndFetch ( {
@@ -537,7 +524,7 @@ module.exports = function () {
537524 } )
538525 . then ( ( ) => {
539526 // Write the /config/v2-imported file so we don't import again
540- fs . writeFile ( '/config/v2-imported' , 'true' , function ( err ) {
527+ fs . writeFile ( '/config/v2-imported' , 'true' , function ( err ) {
541528 if ( err ) {
542529 logger . err ( err ) ;
543530 }
0 commit comments