git: 369efb359c7a - main - www/remark42: stop baking REMARK_URL at build time

From: Xin LI <delphij_at_FreeBSD.org>
Date: Fri, 02 Oct 2026 05:36:40 UTC
The branch main has been updated by delphij:

URL: https://cgit.FreeBSD.org/ports/commit/?id=369efb359c7a5d9415f99395992f8bc3d1bd732a

commit 369efb359c7a5d9415f99395992f8bc3d1bd732a
Author:     Xin LI <delphij@FreeBSD.org>
AuthorDate: 2026-10-02 05:36:05 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2026-10-02 05:36:05 +0000

    www/remark42: stop baking REMARK_URL at build time
    
    Since 1.17.0 the server fills the {% REMARK_URL %} placeholder into
    the embedded frontend at serve time, using the REMARK_URL it was
    started with.  The port was still substituting the placeholder with
    http://127.0.0.1:8080 before embedding, which left nothing for the
    server to fill in, so the widget pointed at an unreachable host
    whenever a page omitted remark_config.host.
    
    - Drop the build-time substitution and the REMARK_URL make variable;
      remark_url in rc.conf now reaches the frontend as well.
    - Document remark_remark_web_root in the rc script.
---
 www/remark42/Makefile        | 5 +----
 www/remark42/files/remark.in | 3 +++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/www/remark42/Makefile b/www/remark42/Makefile
index 9da639cdc36b..8d32bcde2da9 100644
--- a/www/remark42/Makefile
+++ b/www/remark42/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	remark42
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.17.1
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	LOCAL/delphij:npmcache
 DISTFILES=	${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX}:npmcache
@@ -94,8 +95,6 @@ REMARK_PIDDIR=	/var/run/${PORTNAME}/
 REMARK_USER?=	www
 REMARK_DATADIR?=/var/db/${PORTNAME}
 
-REMARK_URL?=	http://127.0.0.1:8080
-
 USE_RC_SUBR=	remark
 
 SUB_LIST+=	REMARK_PIDDIR=${REMARK_PIDDIR} \
@@ -118,8 +117,6 @@ pre-build:
 	cd ${WRKSRC}/frontend/apps/${PORTNAME} && ${SETENV} HOME=${WRKDIR} npm run build
 	${RM} -r ${WRKSRC}/backend/app/cmd/web/
 	${MV} ${WRKSRC}/frontend/apps/remark42/public ${WRKSRC}/backend/app/cmd/web
-	${FIND} ${WRKSRC}/backend/app/cmd/web -type f \( -name '*.html' -or -name '*.js' -or -name '*.mjs' \) \
-		-print -exec ${REINPLACE_CMD} -e "s|{% REMARK_URL %}|${REMARK_URL}|g" {} +
 
 do-build:
 	cd ${WRKSRC}/backend && ${SETENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=off ${GO_CMD} build ${GO_BUILDFLAGS} \
diff --git a/www/remark42/files/remark.in b/www/remark42/files/remark.in
index caf4ccfdb555..74257b7450f6 100644
--- a/www/remark42/files/remark.in
+++ b/www/remark42/files/remark.in
@@ -37,6 +37,9 @@
 #				Default: %%REMARK_DATADIR%%/pictures.staging
 # remark_image_bolt_file (str):	images bolt file location
 #				Default: %%REMARK_DATADIR%%/pictures.db
+# remark_remark_web_root (str):	directory overriding the embedded frontend,
+#				e.g. %%WWWDIR%% (not created by the package)
+#				Default: unset (use the embedded frontend)
 #
 # Additional configuration variables available at https://remark42.com/docs/configuration/parameters/
 # are exposed with similar naming convention.