ui: funnel hash through firmware-product file #2367

Part one makes it possible to inject branding info from the Makefile
which is not fully complete yet but can always be finished.  The new
hash value can thus be used as a unqiue identifier for page resources
that may be subject to caching.  By using the git hash it allows us
to have this effect on test commits as well as earch working version
as we don't want to track the changes for each file but still get a
good amount of caching.
This commit is contained in:
Franco Fichtner 2018-09-02 09:41:28 +02:00
parent dc027455b4
commit 08569103ce
6 changed files with 20 additions and 14 deletions

View File

@ -56,7 +56,7 @@ CORE_NAME?= opnsense-devel
CORE_TYPE?= development
CORE_MESSAGE?= Insert Name Here
CORE_MAINTAINER?= franco@opnsense.org
CORE_MAINTAINER?= project@opnsense.org
CORE_PACKAGESITE?= https://pkg.opnsense.org
CORE_ORIGIN?= opnsense/${CORE_NAME}
CORE_COMMENT?= OPNsense ${CORE_TYPE} package
@ -214,7 +214,8 @@ scripts:
install:
@${MAKE} -C ${.CURDIR}/contrib install DESTDIR=${DESTDIR}
@${MAKE} -C ${.CURDIR}/src install DESTDIR=${DESTDIR} \
CORE_NAME=${CORE_NAME} CORE_ABI=${CORE_ABI} \
CORE_NAME=${CORE_NAME} CORE_ABI=${CORE_ABI} CORE_WWW=${CORE_WWW} \
CORE_MAINTAINER=${CORE_MAINTAINER} CORE_HASH=${CORE_HASH} \
CORE_PACKAGESITE=${CORE_PACKAGESITE} \
CORE_REPOSITORY=${CORE_REPOSITORY}
@ -229,7 +230,9 @@ collect:
bootstrap:
@${MAKE} -C ${.CURDIR}/src install-bootstrap DESTDIR=${DESTDIR} \
NO_SAMPLE=please CORE_PACKAGESITE=${CORE_PACKAGESITE} \
CORE_NAME=${CORE_NAME} CORE_ABI=${CORE_ABI} \
CORE_NAME=${CORE_NAME} CORE_ABI=${CORE_ABI} CORE_WWW=${CORE_WWW} \
CORE_MAINTAINER=${CORE_MAINTAINER} CORE_HASH=${CORE_HASH} \
CORE_PACKAGESITE=${CORE_PACKAGESITE} \
CORE_REPOSITORY=${CORE_REPOSITORY}
plist:

View File

@ -56,10 +56,13 @@ install-${TARGET}:
@(cd ${TREE}; find * -type f ${_IGNORES}) | while read FILE; do \
if [ "$${FILE%%.in}" != "$${FILE}" ]; then \
sed -i '' \
-e "s=%%CORE_ABI%%=${CORE_ABI}=g" \
-e "s=%%CORE_HASH%%=${CORE_HASH}=g" \
-e "s=%%CORE_MAINTAINER%%=${CORE_MAINTAINER}=g" \
-e "s=%%CORE_NAME%%=${CORE_NAME}=g" \
-e "s=%%CORE_PACKAGESITE%%=${CORE_PACKAGESITE}=g" \
-e "s=%%CORE_REPOSITORY%%=${CORE_REPOSITORY}=g" \
-e "s=%%CORE_NAME%%=${CORE_NAME}=g" \
-e "s=%%CORE_ABI%%=${CORE_ABI}=g" \
-e "s=%%CORE_WWW%%=${CORE_WWW}=g" \
"${DESTDIR}${ROOT_${TARGET}}/${TREE}/$${FILE}"; \
mv -v "${DESTDIR}${ROOT_${TARGET}}/${TREE}/$${FILE}" \
"${DESTDIR}${ROOT_${TARGET}}/${TREE}/$${FILE%%.in}"; \

View File

@ -373,8 +373,8 @@ function display_login_form($Login_Error)
</main>
<div class="login-foot text-center">
<a target="_blank" href="<?=$g['product_website']?>" class="redlnk"><?=$g['product_name']?></a> (c) <?=$g['product_copyright_years']?>
<a href="<?=$g['product_copyright_url']?>" class="tblnk"><?=$g['product_copyright_owner']?></a>
<a target="_blank" href="<?=$g['product_website']?>"><?=$g['product_name']?></a> (c) <?=$g['product_copyright_years']?>
<a target="_blank" href="<?=$g['product_copyright_url']?>"><?=$g['product_copyright_owner']?></a>
</div>
</div>

View File

@ -2,8 +2,9 @@
"product_copyright_owner": "Deciso B.V.",
"product_copyright_url": "https://www.deciso.com/",
"product_copyright_years": "2014-2018",
"product_email": "project@opnsense.org",
"product_email": "%%CORE_MAINTAINER%%",
"product_hash": "%%CORE_HASH%%",
"product_id": "opnsense",
"product_name": "OPNsense",
"product_website": "https://opnsense.org/"
"product_website": "%%CORE_WWW%%"
}

View File

@ -265,9 +265,8 @@
<!-- page footer -->
<footer class="page-foot">
<div class="container-fluid">
<a target="_blank" href="{{ product_website }}" class="redlnk">{{ product_name }}</a>
(c) {{ product_copyright_years }}
<a href="{{ product_copyright_url }}" class="tblnk">{{ product_copyright_owner }}</a>
<a target="_blank" href="{{ product_website }}">{{ product_name }}</a> (c) {{ product_copyright_years }}
<a target="_blank" href="{{ product_copyright_url }}">{{ product_copyright_owner }}</a>
</div>
</footer>
</div>

View File

@ -1,8 +1,8 @@
<footer class="page-foot">
<div class="container-fluid">
<a target="_blank" href="<?=$g['product_website']?>" class="redlnk"><?=$g['product_name']?></a> (c)
<?=$g['product_copyright_years']?> <a href="<?=$g['product_copyright_url']?>" class="tblnk"><?=$g['product_copyright_owner']?></a>
<a target="_blank" href="<?=$g['product_website']?>"><?=$g['product_name']?></a> (c) <?=$g['product_copyright_years']?>
<a target="_blank" href="<?=$g['product_copyright_url']?>"><?=$g['product_copyright_owner']?></a>
</div>
</footer>