mirror of
https://github.com/penpot/penpot.git
synced 2026-08-10 23:08:41 +00:00
Add PENPOT_INTERNAL_URI environment variable to the exporter. This allows separating the URI used for internal communication (headless browser to frontend) from the public URI used for resource references in exported SVGs. Previously, PENPOT_PUBLIC_URI served both purposes, which caused exported SVGs to contain broken font URLs when the internal Docker address was used. Changes: - Add :internal-uri to exporter config schema with fallback to :public-uri - Add get-internal-uri helper function - Use internal-uri for browser navigation in SVG/PDF/bitmap renderers - Post-process SVG output to replace internal URI with public URI - Use internal-uri for backend API calls in resource handler - Log both URIs on startup - Update docker-compose.yaml to use both variables - Document the new variable in configuration.md Closes #10627 AI-assisted-by: mimo-v2.5-pro
51 lines
1.1 KiB
Clojure
51 lines
1.1 KiB
Clojure
;; This Source Code Form is subject to the terms of the Mozilla Public
|
|
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
;;
|
|
;; Copyright (c) KALEIDOS INC Sucursal en España SL
|
|
|
|
(ns app.core
|
|
(:require
|
|
["node:process" :as proc]
|
|
[app.browser :as bwr]
|
|
[app.common.logging :as l]
|
|
[app.config :as cf]
|
|
[app.http :as http]
|
|
[app.redis :as redis]
|
|
[promesa.core :as p]))
|
|
|
|
(enable-console-print!)
|
|
(l/setup! {:app :info})
|
|
|
|
(defn start
|
|
[& _]
|
|
(l/info :msg "initializing"
|
|
:public-uri (str (cf/get :public-uri))
|
|
:internal-uri (str (cf/get-internal-uri))
|
|
:version (:full cf/version))
|
|
(p/do!
|
|
(bwr/init)
|
|
(redis/init)
|
|
(http/init)))
|
|
|
|
(def main start)
|
|
|
|
(defn stop
|
|
[done]
|
|
;; an empty line for visual feedback of restart
|
|
(js/console.log "")
|
|
|
|
(l/info :msg "stopping")
|
|
(p/do!
|
|
(bwr/stop)
|
|
(redis/stop)
|
|
(http/stop)
|
|
(done)))
|
|
|
|
(.on proc/default "uncaughtException"
|
|
(fn [cause]
|
|
(js/console.error cause)))
|
|
|
|
(.on proc/default "SIGTERM" (fn [] (proc/exit 0)))
|
|
(.on proc/default "SIGINT" (fn [] (proc/exit 0)))
|