Properly escape apps.config

This commit is contained in:
2026-07-11 14:37:43 -07:00
parent ce948a86ce
commit ce4882816b

View File

@@ -821,9 +821,19 @@ h1, h2, h3, h4, h5, h6 {
(volume-destroy . ,(search "volume_attachment.machine: Destruction complete" "volume_attachment.machine: Destroying..." "XXX - nothing"))))
(define (write-config-entry name value)
(display name)
(display "='")
(display (if value
(string-translate* (->string value) '(("'" . "\\'"))) ;; escape any single quotes
""))+
(print "'"))
(define (write-terraform-config-entry name value)
(display name)
(display "=\"")
(display value)
(display (if value
(string-translate* (->string value) '(("\"" . "\\\""))) ;; escape any double quotes
""))+
(print "\""))
(define (progress-status->text status)
@@ -1632,7 +1642,7 @@ chmod -R 777 /opt/keys")))
(with-output-to-file (string-append dir "/config/production.tfvars")
(lambda ()
(map (lambda (e)
(write-config-entry (car e) (cdr e)))
(write-terraform-config-entry (car e) (cdr e)))
`(("server_type" . ,(alist-ref 'digitalocean-size service-config))
("do_token" . ,(alist-ref 'digitalocean-api-token service-config))
("digitalocean_volume_size" . ,(alist-ref 'digitalocean-volume-size service-config))