h-source-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[H-source-users] [PATCH] Adding a patch for staging deployment.


From: Yuchen Pei
Subject: [H-source-users] [PATCH] Adding a patch for staging deployment.
Date: Wed, 22 Sep 2021 12:38:22 +1000
User-agent: mu4e 1.4.13; emacs 27.2

Will push to the development branch if no opposition.

From 7083cc43ea352cf45d4325aaf859effd4dc4f6e9 Mon Sep 17 00:00:00 2001
From: Yuchen Pei <hi@ypei.me>
Date: Wed, 22 Sep 2021 12:34:53 +1000
Subject: [PATCH] Adding a patch for staging deployment.

- The patch displays prominant notices about the current site being a
  staging instance, and redirects visitors to the official site.
- Also added some instructions in a new README to apply the patch.
---
 h-source/README             |  3 ++
 h-source/mark-staging.patch | 83 +++++++++++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+)
 create mode 100644 h-source/README
 create mode 100644 h-source/mark-staging.patch

diff --git a/h-source/README b/h-source/README
new file mode 100644
index 0000000..16de4dc
--- /dev/null
+++ b/h-source/README
@@ -0,0 +1,3 @@
+When deploying to staging, run
+
+patch -p2 <mark-staging.patch
\ No newline at end of file
diff --git a/h-source/mark-staging.patch b/h-source/mark-staging.patch
new file mode 100644
index 0000000..d55e607
--- /dev/null
+++ b/h-source/mark-staging.patch
@@ -0,0 +1,83 @@
+From 4eccedeb80e83cf6e6b276a4ee91ee1efd603d5d Mon Sep 17 00:00:00 2001
+From: Yuchen Pei <hi@ypei.me>
+Date: Wed, 22 Sep 2021 12:23:40 +1000
+Subject: [PATCH] Adding prominant notice that the site is staging.
+
+And directing visitors to the official site.
+---
+ h-source/Application/Include/params.php       | 4 ++--
+ h-source/Application/Views/Desktop/header.php | 1 +
+ h-source/Application/Views/Mobile/header.php  | 4 +++-
+ h-source/config.xml                           | 9 +++++++++
+ 4 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/h-source/Application/Include/params.php 
b/h-source/Application/Include/params.php
+index 19f1ed7..29cdc6c 100644
+--- a/h-source/Application/Include/params.php
++++ b/h-source/Application/Include/params.php
+@@ -26,7 +26,7 @@ class Website
+       
+       static public $fromEmail = "noreply@h-node.org";
+       
+-      static public $generalName = "h-node.org";
++      static public $generalName = "h-node.org STAGING";
+       
+       static public $projectName = "h-node";
+       
+@@ -225,4 +225,4 @@ class Account
+               $result = $mailer->batchSend($message);
+ 
+       }
+-}
+\ No newline at end of file
++}
+diff --git a/h-source/Application/Views/Desktop/header.php 
b/h-source/Application/Views/Desktop/header.php
+index d153840..2a20ef6 100644
+--- a/h-source/Application/Views/Desktop/header.php
++++ b/h-source/Application/Views/Desktop/header.php
+@@ -105,6 +105,7 @@ $currPos = $querySanitized ? 
$this->controller."/".$this->action : 'home/index';
+ <div id="external_header">
+       <div id="header">
+               <img style="float:left;" src="<?php echo 
$this->baseUrl;?>/Public/Img/title.png">
++        <span style="font-size: 400%;">STAGING</span>
+               <a href="http://www.fsf.org";><img style="float:right;" 
src="<?php echo $this->baseUrl;?>/Public/Img/fsf_logo.png"></a>
+       </div>
+ </div>
+diff --git a/h-source/Application/Views/Mobile/header.php 
b/h-source/Application/Views/Mobile/header.php
+index 446f820..ac66d27 100644
+--- a/h-source/Application/Views/Mobile/header.php
++++ b/h-source/Application/Views/Mobile/header.php
+@@ -89,7 +89,9 @@ $currPos = $querySanitized ? 
$this->controller."/".$this->action : 'home/index';
+ <div data-role="page" data-theme="d">
+       <div data-role="header">
+               <div class="ui-grid-a">
+-                      <div class="ui-block-a"><img style="padding-top:5px;" 
width="110px" src="<?php echo $this->baseUrl;?>/Public/Img/title.png"></div>
++                      <div class="ui-block-a"><img style="padding-top:5px;" 
width="110px" src="<?php echo $this->baseUrl;?>/Public/Img/title.png">
++                   <span style="font-size: 300%; 
vertical-align:top;">STAGING</span>
++                   </div>
+                       <div class="ui-block-b"><a 
href="http://www.fsf.org";><img style="padding-top:10px;" width="150px" 
src="<?php echo $this->baseUrl;?>/Public/Img/fsf_logo.png"></a></div>
+               </div><!-- /grid-a -->
+ 
+diff --git a/h-source/config.xml b/h-source/config.xml
+index 8f87304..159eef5 100644
+--- a/h-source/config.xml
++++ b/h-source/config.xml
+@@ -77,6 +77,15 @@
+       </top_menu>
+       <top_news>
+               <en>
++                      <mod>
++                              <type>raw</type>
++                              <text><![CDATA[
++
++                              <div 
style="padding:0.5em;background:#FFA07A;margin:0.5em;border-top:1px solid 
#FF4500;border-bottom:1px solid #FF4500;color:#DC143C;font-size:16px;">This is 
a staging instance of h-node.  For the official site please visit <a 
href="https://h-node.org";>h-node.org</a>.
++                              </div>
++
++                              ]]></text>
++                      </mod>
+                       <mod>
+                               <type>raw</type>
+                               <text><![CDATA[
+-- 
+2.33.0
+
-- 
2.33.0


--
Best,
Yuchen

PGP Key: 47F9 D050 1E11 8879 9040  4941 2126 7E93 EF86 DFD0
          <https://ypei.me/assets/ypei-pubkey.txt>

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]