From f0e5b09f2769fb89ef5d6144ef790579fa703538 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Tue, 3 Aug 2021 20:02:33 +1000 Subject: docker: Add basic configuration for running local php5 instance --- config-docker.patch | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 14 +++++++++ readme-php5.sh | 21 ++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 config-docker.patch create mode 100644 docker-compose.yml create mode 100755 readme-php5.sh diff --git a/config-docker.patch b/config-docker.patch new file mode 100644 index 0000000..34f8f8b --- /dev/null +++ b/config-docker.patch @@ -0,0 +1,81 @@ +diff --git a/h-source/.htaccess b/h-source/.htaccess +index 56ccf22..61012e2 100755 +--- a/h-source/.htaccess ++++ b/h-source/.htaccess +@@ -1,7 +1,7 @@ + RewriteEngine On + +-RewriteCond %{HTTPS} !^on$ +-RewriteRule (.*) https://www.h-node.org/$1 [R,L] ++#RewriteCond %{HTTPS} !^on$ ++#RewriteRule (.*) https://www.h-node.org/$1 [R,L] + + # + # Options +FollowSymlinks +diff --git a/h-source/Application/Hooks/BeforeChecks.php b/h-source/Application/Hooks/BeforeChecks.php +index 6f200e6..47e7936 100755 +--- a/h-source/Application/Hooks/BeforeChecks.php ++++ b/h-source/Application/Hooks/BeforeChecks.php +@@ -13,7 +13,7 @@ if (!defined('EG')) die('Direct access not allowed!'); + + Params::$htmlentititiesCharset = "UTF-8"; + +-Params::$useHttps = true; ++Params::$useHttps = false; + + Params::$allowedSanitizeFunc .= ",sanitizeString,sanitizeAlphanum"; + +diff --git a/h-source/Config/Config.php b/h-source/Config/Config.php +index bea5562..1290751 100755 +--- a/h-source/Config/Config.php ++++ b/h-source/Config/Config.php +@@ -23,10 +23,10 @@ + if (!defined('EG')) die('Direct access not allowed!'); + + +-define('DB', ''); +-define('USER', ''); ++define('DB', 'hnode'); ++define('USER', 'root'); + define('PWD', ''); +-define('HOST', ''); ++define('HOST', 'localhost'); + + /*default controller name*/ + define('DEFAULT_CONTROLLER','home'); +@@ -35,7 +35,7 @@ define('DEFAULT_CONTROLLER','home'); + define('DEFAULT_ACTION','index'); + + /*website parameters*/ +-define('DOMAIN_NAME','h-source'); ++define('DOMAIN_NAME','localhost'); + + /*type of database.*/ + //it can be: Mysql, Mysqli or None (first letter in uppercase) +diff --git a/h-source/admin/Config/Config.php b/h-source/admin/Config/Config.php +index 24d2e57..3f7866d 100755 +--- a/h-source/admin/Config/Config.php ++++ b/h-source/admin/Config/Config.php +@@ -6,10 +6,10 @@ + if (!defined('EG')) die('Direct access not allowed!'); + + +-define('DB', ''); +-define('USER', ''); ++define('DB', 'hnode'); ++define('USER', 'root'); + define('PWD', ''); +-define('HOST', ''); ++define('HOST', 'localhost'); + + /*default controller name*/ + define('DEFAULT_CONTROLLER','adminusers'); +@@ -18,7 +18,7 @@ define('DEFAULT_CONTROLLER','adminusers'); + define('DEFAULT_ACTION','login'); + + /*website parameters*/ +-define('DOMAIN_NAME','h-source/admin'); ++define('DOMAIN_NAME','localhost/admin'); + + /*type of database.*/ + //it can be: Mysql, Mysqli or None (first letter in uppercase) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3b70319 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +# Image for LAMP based on Dockerfile in https://github.com/jakejarvis/docker-lamp-php5 +# WARNING: Not suitable for production environments, only for testing legacy php5 application. +# (Docker image supplementary files licenced under Apache 2.0) + +version: "3" +services: + lamp-php5: + image: docker.io/jakejarvis/lamp-php5:latest + ports: + - 80:80 + - 3306:3306 + volumes: + - "./h-source:/app" + - "./mysql:/var/lib/mysql" diff --git a/readme-php5.sh b/readme-php5.sh new file mode 100755 index 0000000..d401f23 --- /dev/null +++ b/readme-php5.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# INSTRUCTIONS for testing with docker-lamp-php5: +# +# After the docker container spins up, +# the mysql password will be displayed. +# - MySQL on port 3306 +# - Apache on port 80 +# +# Don't forget to create the database: +# mysql -uadmin -pXXX -h127.0.0.1 +# > create database hnode; +# > ^D +# and populate the schema/initial data with: +# mysql -uadmin -pXXX -h127.0.0.1 hnode < h-source/tables.sql +# mysql -uadmin -pXXX -h127.0.0.1 hnode < h-source/admin/tables.sql + +patch -p1 < config-docker.patch + +docker-compose up --build lamp-php5 + -- cgit v1.2.3 From 75cfe0492776b8e4ab89912918929f845c92f74c Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Tue, 10 Aug 2021 19:45:41 +1000 Subject: Remove incorrect instruction from readme --- readme-php5.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/readme-php5.sh b/readme-php5.sh index d401f23..4bad3aa 100755 --- a/readme-php5.sh +++ b/readme-php5.sh @@ -13,7 +13,6 @@ # > ^D # and populate the schema/initial data with: # mysql -uadmin -pXXX -h127.0.0.1 hnode < h-source/tables.sql -# mysql -uadmin -pXXX -h127.0.0.1 hnode < h-source/admin/tables.sql patch -p1 < config-docker.patch -- cgit v1.2.3 From f17018962bfc6cc38a0b2ccc5f40a939f5fe49fa Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Tue, 10 Aug 2021 19:16:48 +1000 Subject: Use relative URLs instead of hardcoding domain --- .../Application/Controllers/WikiController.php | 2 +- h-source/Library/Helper/List.php | 2 +- h-source/Library/Helper/Menu.php | 2 +- h-source/Library/Helper/Popup.php | 4 +- h-source/Library/Theme.php | 6 +- h-source/Library/Url.php | 4 +- h-source/admin/Application/Include/myFunctions.php | 12 ++-- h-source/admin/Library/Helper/Popup.php | 4 +- h-source/admin/Library/Theme.php | 4 +- h-source/admin/Library/Url.php | 2 +- h-source/config.xml | 78 +++++++++++----------- 11 files changed, 58 insertions(+), 62 deletions(-) diff --git a/h-source/Application/Controllers/WikiController.php b/h-source/Application/Controllers/WikiController.php index 5dc05b8..f3da19f 100644 --- a/h-source/Application/Controllers/WikiController.php +++ b/h-source/Application/Controllers/WikiController.php @@ -496,7 +496,7 @@ class WikiController extends BaseController // if ($this->m['WikitalkModel']->queryResult) // { -// header('Refresh: 0;url=http://'.DOMAIN_NAME.$_SERVER['REQUEST_URI']); +// header('Refresh: 0;url='.$_SERVER['REQUEST_URI']); // die(); // } } diff --git a/h-source/Library/Helper/List.php b/h-source/Library/Helper/List.php index ba59643..57aeeff 100755 --- a/h-source/Library/Helper/List.php +++ b/h-source/Library/Helper/List.php @@ -73,7 +73,7 @@ class Helper_List extends Helper_Html { //get the generic language class $this->strings = Factory_Strings::generic(Params::$language); - $baseUrl = 'http://'.DOMAIN_NAME.'/Public/Img/Icons/elementary_2_5/'; + $baseUrl = '/Public/Img/Icons/elementary_2_5/'; //set the files of the images $this->submitImages = array( diff --git a/h-source/Library/Helper/Menu.php b/h-source/Library/Helper/Menu.php index 8fd4bf4..86ee24a 100755 --- a/h-source/Library/Helper/Menu.php +++ b/h-source/Library/Helper/Menu.php @@ -36,7 +36,7 @@ class Helper_Menu extends Helper_Html public function __construct() { - $baseUrl = "http://".DOMAIN_NAME.'/Public/Img/Icons/elementary_2_5/'; + $baseUrl = '/Public/Img/Icons/elementary_2_5/'; //get the generic language class $this->strings = Factory_Strings::generic(Params::$language); diff --git a/h-source/Library/Helper/Popup.php b/h-source/Library/Helper/Popup.php index 18bb00d..43140fe 100755 --- a/h-source/Library/Helper/Popup.php +++ b/h-source/Library/Helper/Popup.php @@ -133,10 +133,10 @@ class Helper_Popup extends Helper_Html { $returnString .= "\n"; } if (count($this->popupArray)>0) { - $returnString .= "\n"; + $returnString .= "\n"; } } return $returnString; } -} \ No newline at end of file +} diff --git a/h-source/Library/Theme.php b/h-source/Library/Theme.php index 10c0fce..fe938ee 100755 --- a/h-source/Library/Theme.php +++ b/h-source/Library/Theme.php @@ -39,11 +39,9 @@ class Theme { function __construct($controller) { - $protocol = Params::$useHttps ? "https" : "http"; - $this->controller = $controller; - $this->baseUrl = MOD_REWRITE_MODULE === true ? "$protocol://" . DOMAIN_NAME : "$protocol://" . DOMAIN_NAME . '/index.php'; - $this->baseUrlSrc = "$protocol://" . DOMAIN_NAME; + $this->baseUrl = MOD_REWRITE_MODULE === true ? '': '/index.php'; + $this->baseUrlSrc = ''; } diff --git a/h-source/Library/Url.php b/h-source/Library/Url.php index efb8e6e..5124047 100755 --- a/h-source/Library/Url.php +++ b/h-source/Library/Url.php @@ -27,9 +27,7 @@ class Url { //get the url starting from the root folder public static function getRoot($pathFromRootFolder = null) { - $protocol = Params::$useHttps ? "https" : "http"; - - $url = MOD_REWRITE_MODULE === true ? "$protocol://" . DOMAIN_NAME . '/' . $pathFromRootFolder : "$protocol://" . DOMAIN_NAME . '/index.php/' . $pathFromRootFolder; + $url = MOD_REWRITE_MODULE === true ? '/' . $pathFromRootFolder : '/index.php/' . $pathFromRootFolder; return $url; } diff --git a/h-source/admin/Application/Include/myFunctions.php b/h-source/admin/Application/Include/myFunctions.php index ab32bbf..355c181 100644 --- a/h-source/admin/Application/Include/myFunctions.php +++ b/h-source/admin/Application/Include/myFunctions.php @@ -166,7 +166,7 @@ function getLinkToUser($user) } else { - return "$user"; + return "$user"; } } @@ -271,7 +271,7 @@ function linkToNotebook($match) $hardware = new HardwareModel(); $clean['id_hard'] = (int)$match[2]; $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - $href = "HTTP://".DOMAIN_NAME."/notebooks/view/".Lang::$current."/".$clean['id_hard']."/$name"; + $href = "/notebooks/view/".Lang::$current."/".$clean['id_hard']."/$name"; return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; } @@ -281,7 +281,7 @@ function linkToWifi($match) $hardware = new HardwareModel(); $clean['id_hard'] = (int)$match[2]; $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - $href = "HTTP://".DOMAIN_NAME."/wifi/view/".Lang::$current."/".$clean['id_hard']."/$name"; + $href = "/wifi/view/".Lang::$current."/".$clean['id_hard']."/$name"; return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; } @@ -291,7 +291,7 @@ function linkToVideocard($match) $hardware = new HardwareModel(); $clean['id_hard'] = (int)$match[2]; $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - $href = "HTTP://".DOMAIN_NAME."/videocards/view/".Lang::$current."/".$clean['id_hard']."/$name"; + $href = "/videocards/view/".Lang::$current."/".$clean['id_hard']."/$name"; return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; } @@ -309,10 +309,10 @@ function getMotivation($row,$controller) $clean['id_hard'] = (int)$row['deletion']['id_duplicate']; $hardware = new HardwareModel(); $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - return "duplication of the model having id ".$clean['id_hard'].""; + return "duplication of the model having id ".$clean['id_hard'].""; } else { return "".$row['deletion']['object'].""; } -} \ No newline at end of file +} diff --git a/h-source/admin/Library/Helper/Popup.php b/h-source/admin/Library/Helper/Popup.php index 9ceac72..17ba908 100755 --- a/h-source/admin/Library/Helper/Popup.php +++ b/h-source/admin/Library/Helper/Popup.php @@ -78,10 +78,10 @@ class Helper_Popup extends Helper_Html { $this->viewArgs[$field] = $tempArg; } if (count($this->popupArray)>0) { - $returnString .= "\n"; + $returnString .= "\n"; } } return $returnString; } -} \ No newline at end of file +} diff --git a/h-source/admin/Library/Theme.php b/h-source/admin/Library/Theme.php index 692697e..afa3660 100755 --- a/h-source/admin/Library/Theme.php +++ b/h-source/admin/Library/Theme.php @@ -22,8 +22,8 @@ class Theme { function __construct($controller) { $this->controller = $controller; - $this->baseUrl = MOD_REWRITE_MODULE === true ? 'http://' . DOMAIN_NAME : 'http://' . DOMAIN_NAME . '/index.php'; - $this->baseUrlSrc = 'http://' . DOMAIN_NAME; + $this->baseUrl = MOD_REWRITE_MODULE === true ? '/admin' : '/admin/index.php'; + $this->baseUrlSrc = '/admin'; } diff --git a/h-source/admin/Library/Url.php b/h-source/admin/Library/Url.php index 4e2ca5e..54d6e3e 100755 --- a/h-source/admin/Library/Url.php +++ b/h-source/admin/Library/Url.php @@ -9,7 +9,7 @@ class Url { //get the url starting from the root folder public static function getRoot($pathFromRootFolder = null) { - $url = MOD_REWRITE_MODULE === true ? 'http://' . DOMAIN_NAME . '/' . $pathFromRootFolder : 'http://' . DOMAIN_NAME . '/index.php/' . $pathFromRootFolder; + $url = MOD_REWRITE_MODULE === true ? '/admin/' . $pathFromRootFolder : '/admin/index.php/' . $pathFromRootFolder; return $url; } diff --git a/h-source/config.xml b/h-source/config.xml index 30b0dd5..0ac72f1 100644 --- a/h-source/config.xml +++ b/h-source/config.xml @@ -5,35 +5,35 @@ TopLink Help - + TopLink Aiuto - + TopLink Ayuda - + TopLink Télécharger - + TopLink Βοήθεια - + @@ -42,35 +42,35 @@ TopLink FAQ - + TopLink FAQ - + TopLink FAQ - + TopLink FAQ - + TopLink FAQ - + @@ -128,7 +128,7 @@ raw
discover_hardware
+ ]]> @@ -155,7 +155,7 @@ subscribe to our
- +
]]>
@@ -166,7 +166,7 @@ raw client for h-node -
Please help in the development of the client for h-node (h-client project). See here and here +
Please help in the development of the client for h-node (h-client project). See here and here
]]> @@ -177,7 +177,7 @@ raw related projects
-
Please help in the development of the IsMyHWOK software, a different h-node client +
Please help in the development of the IsMyHWOK software, a different h-node client
]]> @@ -189,7 +189,7 @@ download the source code
- +
]]>
@@ -280,7 +280,7 @@ iscriviti alla nostra
- +
]]>
@@ -291,7 +291,7 @@ raw client per h-node -
Puoi aiutare nello sviluppo del client per h-node (progetto h-client). Leggi qui e qui +
Puoi aiutare nello sviluppo del client per h-node (progetto h-client). Leggi qui e qui
]]> @@ -302,7 +302,7 @@ raw progetti correlati
-
Puoi aiutare nello sviluppo del software IsMyHWOK, un diverso client per h-node +
Puoi aiutare nello sviluppo del software IsMyHWOK, un diverso client per h-node
]]> @@ -314,7 +314,7 @@ scarica il codice sorgente
- +
]]>
@@ -405,7 +405,7 @@ suscríbase a nuestra
- +
]]>
@@ -416,7 +416,7 @@ raw cliente para h-node -
Por favor ayude en el desarrollo del cliente de h-node (proyecto h-client). Vea aquí y aquí +
Por favor ayude en el desarrollo del cliente de h-node (proyecto h-client). Vea aquí y aquí
]]> @@ -427,7 +427,7 @@ raw proyectos relacionados
-
Por favor ayuda en el desarrollo del programa IsMyHWOK, un cliente diferente para h-node +
Por favor ayuda en el desarrollo del programa IsMyHWOK, un cliente diferente para h-node
]]> @@ -439,7 +439,7 @@ descargue el código fuente
- +
]]>
@@ -516,13 +516,13 @@ raw - guidelines on how to compile a hardware device page ]]> + guidelines on how to compile a hardware device page ]]> raw - guida su come compilare una pagina di hardware ]]> + guida su come compilare una pagina di hardware ]]> @@ -530,19 +530,19 @@ raw - learn how to find it ]]> + learn how to find it ]]> raw - scopri come individuarlo ]]> + scopri come individuarlo ]]> raw - aprenda como encontrarlo ]]> + aprenda como encontrarlo ]]> @@ -550,37 +550,37 @@ raw - discover all the wiki tags ]]> + discover all the wiki tags ]]> raw - scopri tutti i tag della wiki ]]> + scopri tutti i tag della wiki ]]> raw - mostrar todas las etiquetas del wiki ]]> + mostrar todas las etiquetas del wiki ]]> raw - voir tous les tags wiki ]]> + voir tous les tags wiki ]]> raw - Wiki-Elemente ]]> + Wiki-Elemente ]]> raw - Wiki-Elemente ]]> + Wiki-Elemente ]]> @@ -665,19 +665,19 @@ raw - learn how to find it ]]> + learn how to find it ]]> raw - scopri come individuarlo ]]> + scopri come individuarlo ]]> raw - aprenda como encontrarlo ]]> + aprenda como encontrarlo ]]> @@ -689,13 +689,13 @@ raw - learn how to fill this entry ]]> + learn how to fill this entry ]]> raw - guida su come scegliere questo campo ]]> + guida su come scegliere questo campo ]]> -- cgit v1.2.3 From a57a3fa7241f33a94d41a1fd22a0d07c8fb6286d Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 18 Aug 2021 09:42:08 +1000 Subject: Removing mentions of gnewsense and blag. These changes were already made on the prod server. --- h-source/Application/Views/Desktop/Help/index.php | 2 -- .../Application/Views/Desktop/Help/index_de.php | 4 +--- .../Application/Views/Desktop/Help/index_es.php | 2 -- .../Application/Views/Desktop/Help/index_fr.php | 4 +--- .../Application/Views/Desktop/Help/index_it.php | 4 +--- h-source/Application/Views/Desktop/Home/left.php | 1 - .../Application/Views/Desktop/Home/left_de.php | 1 - .../Application/Views/Desktop/Home/left_es.php | 1 - .../Application/Views/Desktop/Home/left_fr.php | 1 - .../Application/Views/Desktop/Home/left_gr.php | 1 - .../Application/Views/Desktop/Home/left_it.php | 1 - h-source/Application/Views/Mobile/Home/left.php | 1 - h-source/Application/Views/Mobile/Home/left_de.php | 1 - h-source/Application/Views/Mobile/Home/left_es.php | 1 - h-source/Application/Views/Mobile/Home/left_fr.php | 1 - h-source/Application/Views/Mobile/Home/left_gr.php | 1 - h-source/Application/Views/Mobile/Home/left_it.php | 1 - h-source/config.xml | 24 ---------------------- 18 files changed, 3 insertions(+), 49 deletions(-) diff --git a/h-source/Application/Views/Desktop/Help/index.php b/h-source/Application/Views/Desktop/Help/index.php index bec0d54..c4fcee7 100644 --- a/h-source/Application/Views/Desktop/Help/index.php +++ b/h-source/Application/Views/Desktop/Help/index.php @@ -434,10 +434,8 @@ Bus 002 Device 003: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sens
    -
  • BLAG GNU/Linux
  • Dragora GNU/Linux
  • Dynebolic GNU/Linux
  • -
  • gNewSense GNU/Linux
  • Musix GNU+Linux
  • Parabola GNU/Linux
  • Trisquel GNU/Linux
  • diff --git a/h-source/Application/Views/Desktop/Help/index_de.php b/h-source/Application/Views/Desktop/Help/index_de.php index 8301eda..e53693e 100644 --- a/h-source/Application/Views/Desktop/Help/index_de.php +++ b/h-source/Application/Views/Desktop/Help/index_de.php @@ -431,10 +431,8 @@ Device Descriptor:

    (In alphabetischer Reihenfolge)

    - \ No newline at end of file + diff --git a/h-source/Application/Views/Desktop/Help/index_es.php b/h-source/Application/Views/Desktop/Help/index_es.php index c3ceb02..acbdf6b 100644 --- a/h-source/Application/Views/Desktop/Help/index_es.php +++ b/h-source/Application/Views/Desktop/Help/index_es.php @@ -428,10 +428,8 @@ Bus 002 Device 003: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sens

    (En orden alfabético)

      -
    • BLAG GNU/Linux
    • Dragora GNU/Linux
    • Dynebolic GNU/Linux
    • -
    • gNewSense GNU/Linux
    • Musix GNU+Linux
    • Parabola GNU/Linux
    • Trisquel GNU/Linux
    • diff --git a/h-source/Application/Views/Desktop/Help/index_fr.php b/h-source/Application/Views/Desktop/Help/index_fr.php index c3a507b..3e46137 100644 --- a/h-source/Application/Views/Desktop/Help/index_fr.php +++ b/h-source/Application/Views/Desktop/Help/index_fr.php @@ -419,10 +419,8 @@ Bus 002 Device 003: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sens

      (Dans l'ordre alphabétique)

      - \ No newline at end of file + diff --git a/h-source/Application/Views/Desktop/Help/index_it.php b/h-source/Application/Views/Desktop/Help/index_it.php index 6183d18..c3c968e 100644 --- a/h-source/Application/Views/Desktop/Help/index_it.php +++ b/h-source/Application/Views/Desktop/Help/index_it.php @@ -424,10 +424,8 @@ Bus 002 Device 003: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sens

      In ordine alfabetico

      - \ No newline at end of file + diff --git a/h-source/Application/Views/Desktop/Home/left.php b/h-source/Application/Views/Desktop/Home/left.php index 8635564..0f6ce30 100644 --- a/h-source/Application/Views/Desktop/Home/left.php +++ b/h-source/Application/Views/Desktop/Home/left.php @@ -71,7 +71,6 @@ diff --git a/h-source/Application/Views/Desktop/Home/left_de.php b/h-source/Application/Views/Desktop/Home/left_de.php index 42bfff7..7317124 100644 --- a/h-source/Application/Views/Desktop/Home/left_de.php +++ b/h-source/Application/Views/Desktop/Home/left_de.php @@ -72,7 +72,6 @@ diff --git a/h-source/Application/Views/Desktop/Home/left_es.php b/h-source/Application/Views/Desktop/Home/left_es.php index 0ac26d0..882a7b1 100644 --- a/h-source/Application/Views/Desktop/Home/left_es.php +++ b/h-source/Application/Views/Desktop/Home/left_es.php @@ -71,7 +71,6 @@ diff --git a/h-source/Application/Views/Desktop/Home/left_fr.php b/h-source/Application/Views/Desktop/Home/left_fr.php index 2e17468..2056c75 100644 --- a/h-source/Application/Views/Desktop/Home/left_fr.php +++ b/h-source/Application/Views/Desktop/Home/left_fr.php @@ -74,7 +74,6 @@ diff --git a/h-source/Application/Views/Desktop/Home/left_gr.php b/h-source/Application/Views/Desktop/Home/left_gr.php index 26fc83a..a0a4279 100644 --- a/h-source/Application/Views/Desktop/Home/left_gr.php +++ b/h-source/Application/Views/Desktop/Home/left_gr.php @@ -73,7 +73,6 @@ diff --git a/h-source/Application/Views/Desktop/Home/left_it.php b/h-source/Application/Views/Desktop/Home/left_it.php index fe74850..561c3a1 100644 --- a/h-source/Application/Views/Desktop/Home/left_it.php +++ b/h-source/Application/Views/Desktop/Home/left_it.php @@ -74,7 +74,6 @@ diff --git a/h-source/Application/Views/Mobile/Home/left.php b/h-source/Application/Views/Mobile/Home/left.php index 21a62f9..b4ec21e 100644 --- a/h-source/Application/Views/Mobile/Home/left.php +++ b/h-source/Application/Views/Mobile/Home/left.php @@ -73,7 +73,6 @@ diff --git a/h-source/Application/Views/Mobile/Home/left_de.php b/h-source/Application/Views/Mobile/Home/left_de.php index 5f99701..75467ea 100644 --- a/h-source/Application/Views/Mobile/Home/left_de.php +++ b/h-source/Application/Views/Mobile/Home/left_de.php @@ -72,7 +72,6 @@ diff --git a/h-source/Application/Views/Mobile/Home/left_es.php b/h-source/Application/Views/Mobile/Home/left_es.php index e17a448..4b310c7 100644 --- a/h-source/Application/Views/Mobile/Home/left_es.php +++ b/h-source/Application/Views/Mobile/Home/left_es.php @@ -71,7 +71,6 @@ diff --git a/h-source/Application/Views/Mobile/Home/left_fr.php b/h-source/Application/Views/Mobile/Home/left_fr.php index db51f4a..f68a53f 100644 --- a/h-source/Application/Views/Mobile/Home/left_fr.php +++ b/h-source/Application/Views/Mobile/Home/left_fr.php @@ -73,7 +73,6 @@ diff --git a/h-source/Application/Views/Mobile/Home/left_gr.php b/h-source/Application/Views/Mobile/Home/left_gr.php index 38cb594..5e15b4c 100644 --- a/h-source/Application/Views/Mobile/Home/left_gr.php +++ b/h-source/Application/Views/Mobile/Home/left_gr.php @@ -73,7 +73,6 @@ diff --git a/h-source/Application/Views/Mobile/Home/left_it.php b/h-source/Application/Views/Mobile/Home/left_it.php index 1be8bf0..dc9a6bb 100644 --- a/h-source/Application/Views/Mobile/Home/left_it.php +++ b/h-source/Application/Views/Mobile/Home/left_it.php @@ -73,7 +73,6 @@ diff --git a/h-source/config.xml b/h-source/config.xml index 0ac72f1..8f87304 100644 --- a/h-source/config.xml +++ b/h-source/config.xml @@ -222,10 +222,6 @@ FSF Europe -
      - BLAG -
      - @@ -234,10 +230,6 @@ Dynebolic -
      - gNewSense -
      - @@ -347,10 +339,6 @@ FSF Europe -
      - BLAG -
      - @@ -359,10 +347,6 @@ Dynebolic -
      - gNewSense -
      - @@ -472,10 +456,6 @@ FSF Europe -
      - BLAG -
      - @@ -484,10 +464,6 @@ Dynebolic -
      - gNewSense -
      - -- cgit v1.2.3 From 7b2c76f23be47a8753cfe6d197843a82c6ebf26d Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 26 Aug 2021 11:24:58 +1000 Subject: Moving docker files to its own directory. Also applied the docker patch and removed some commented code. --- config-docker.patch | 81 ----------------------------- docker-compose.yml | 14 ----- docker/docker-compose.yml | 14 +++++ docker/readme-php5.sh | 18 +++++++ h-source/.htaccess | 15 ++---- h-source/Application/Hooks/BeforeChecks.php | 2 +- h-source/Config/Config.php | 8 +-- h-source/admin/Config/Config.php | 8 +-- readme-php5.sh | 20 ------- 9 files changed, 44 insertions(+), 136 deletions(-) delete mode 100644 config-docker.patch delete mode 100644 docker-compose.yml create mode 100644 docker/docker-compose.yml create mode 100755 docker/readme-php5.sh delete mode 100755 readme-php5.sh diff --git a/config-docker.patch b/config-docker.patch deleted file mode 100644 index 34f8f8b..0000000 --- a/config-docker.patch +++ /dev/null @@ -1,81 +0,0 @@ -diff --git a/h-source/.htaccess b/h-source/.htaccess -index 56ccf22..61012e2 100755 ---- a/h-source/.htaccess -+++ b/h-source/.htaccess -@@ -1,7 +1,7 @@ - RewriteEngine On - --RewriteCond %{HTTPS} !^on$ --RewriteRule (.*) https://www.h-node.org/$1 [R,L] -+#RewriteCond %{HTTPS} !^on$ -+#RewriteRule (.*) https://www.h-node.org/$1 [R,L] - - # - # Options +FollowSymlinks -diff --git a/h-source/Application/Hooks/BeforeChecks.php b/h-source/Application/Hooks/BeforeChecks.php -index 6f200e6..47e7936 100755 ---- a/h-source/Application/Hooks/BeforeChecks.php -+++ b/h-source/Application/Hooks/BeforeChecks.php -@@ -13,7 +13,7 @@ if (!defined('EG')) die('Direct access not allowed!'); - - Params::$htmlentititiesCharset = "UTF-8"; - --Params::$useHttps = true; -+Params::$useHttps = false; - - Params::$allowedSanitizeFunc .= ",sanitizeString,sanitizeAlphanum"; - -diff --git a/h-source/Config/Config.php b/h-source/Config/Config.php -index bea5562..1290751 100755 ---- a/h-source/Config/Config.php -+++ b/h-source/Config/Config.php -@@ -23,10 +23,10 @@ - if (!defined('EG')) die('Direct access not allowed!'); - - --define('DB', ''); --define('USER', ''); -+define('DB', 'hnode'); -+define('USER', 'root'); - define('PWD', ''); --define('HOST', ''); -+define('HOST', 'localhost'); - - /*default controller name*/ - define('DEFAULT_CONTROLLER','home'); -@@ -35,7 +35,7 @@ define('DEFAULT_CONTROLLER','home'); - define('DEFAULT_ACTION','index'); - - /*website parameters*/ --define('DOMAIN_NAME','h-source'); -+define('DOMAIN_NAME','localhost'); - - /*type of database.*/ - //it can be: Mysql, Mysqli or None (first letter in uppercase) -diff --git a/h-source/admin/Config/Config.php b/h-source/admin/Config/Config.php -index 24d2e57..3f7866d 100755 ---- a/h-source/admin/Config/Config.php -+++ b/h-source/admin/Config/Config.php -@@ -6,10 +6,10 @@ - if (!defined('EG')) die('Direct access not allowed!'); - - --define('DB', ''); --define('USER', ''); -+define('DB', 'hnode'); -+define('USER', 'root'); - define('PWD', ''); --define('HOST', ''); -+define('HOST', 'localhost'); - - /*default controller name*/ - define('DEFAULT_CONTROLLER','adminusers'); -@@ -18,7 +18,7 @@ define('DEFAULT_CONTROLLER','adminusers'); - define('DEFAULT_ACTION','login'); - - /*website parameters*/ --define('DOMAIN_NAME','h-source/admin'); -+define('DOMAIN_NAME','localhost/admin'); - - /*type of database.*/ - //it can be: Mysql, Mysqli or None (first letter in uppercase) diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 3b70319..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,14 +0,0 @@ -# Image for LAMP based on Dockerfile in https://github.com/jakejarvis/docker-lamp-php5 -# WARNING: Not suitable for production environments, only for testing legacy php5 application. -# (Docker image supplementary files licenced under Apache 2.0) - -version: "3" -services: - lamp-php5: - image: docker.io/jakejarvis/lamp-php5:latest - ports: - - 80:80 - - 3306:3306 - volumes: - - "./h-source:/app" - - "./mysql:/var/lib/mysql" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..c3f2349 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,14 @@ +# Image for LAMP based on Dockerfile in https://github.com/jakejarvis/docker-lamp-php5 +# WARNING: Not suitable for production environments, only for testing legacy php5 application. +# (Docker image supplementary files licenced under Apache 2.0) + +version: "3" +services: + lamp-php5: + image: docker.io/jakejarvis/lamp-php5:latest + ports: + - 80:80 + - 3306:3306 + volumes: + - "../h-source:/app" + - "./mysql:/var/lib/mysql" diff --git a/docker/readme-php5.sh b/docker/readme-php5.sh new file mode 100755 index 0000000..fb62a4d --- /dev/null +++ b/docker/readme-php5.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# INSTRUCTIONS for testing with docker-lamp-php5: +# +# After the docker container spins up, +# the mysql password will be displayed. +# - MySQL on port 3306 +# - Apache on port 80 +# +# Don't forget to create the database: +# mysql -uadmin -pXXX -h127.0.0.1 +# > create database hnode; +# > ^D +# and populate the schema/initial data with: +# mysql -uadmin -pXXX -h127.0.0.1 hnode < ../h-source/tables.sql + +docker-compose up --build lamp-php5 + diff --git a/h-source/.htaccess b/h-source/.htaccess index 56ccf22..95ab62f 100755 --- a/h-source/.htaccess +++ b/h-source/.htaccess @@ -1,14 +1,5 @@ RewriteEngine On -RewriteCond %{HTTPS} !^on$ -RewriteRule (.*) https://www.h-node.org/$1 [R,L] - -# -# Options +FollowSymlinks -# RewriteEngine on - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] -# - - +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] diff --git a/h-source/Application/Hooks/BeforeChecks.php b/h-source/Application/Hooks/BeforeChecks.php index 6f200e6..47e7936 100755 --- a/h-source/Application/Hooks/BeforeChecks.php +++ b/h-source/Application/Hooks/BeforeChecks.php @@ -13,7 +13,7 @@ if (!defined('EG')) die('Direct access not allowed!'); Params::$htmlentititiesCharset = "UTF-8"; -Params::$useHttps = true; +Params::$useHttps = false; Params::$allowedSanitizeFunc .= ",sanitizeString,sanitizeAlphanum"; diff --git a/h-source/Config/Config.php b/h-source/Config/Config.php index bea5562..1290751 100755 --- a/h-source/Config/Config.php +++ b/h-source/Config/Config.php @@ -23,10 +23,10 @@ if (!defined('EG')) die('Direct access not allowed!'); -define('DB', ''); -define('USER', ''); +define('DB', 'hnode'); +define('USER', 'root'); define('PWD', ''); -define('HOST', ''); +define('HOST', 'localhost'); /*default controller name*/ define('DEFAULT_CONTROLLER','home'); @@ -35,7 +35,7 @@ define('DEFAULT_CONTROLLER','home'); define('DEFAULT_ACTION','index'); /*website parameters*/ -define('DOMAIN_NAME','h-source'); +define('DOMAIN_NAME','localhost'); /*type of database.*/ //it can be: Mysql, Mysqli or None (first letter in uppercase) diff --git a/h-source/admin/Config/Config.php b/h-source/admin/Config/Config.php index 24d2e57..3f7866d 100755 --- a/h-source/admin/Config/Config.php +++ b/h-source/admin/Config/Config.php @@ -6,10 +6,10 @@ if (!defined('EG')) die('Direct access not allowed!'); -define('DB', ''); -define('USER', ''); +define('DB', 'hnode'); +define('USER', 'root'); define('PWD', ''); -define('HOST', ''); +define('HOST', 'localhost'); /*default controller name*/ define('DEFAULT_CONTROLLER','adminusers'); @@ -18,7 +18,7 @@ define('DEFAULT_CONTROLLER','adminusers'); define('DEFAULT_ACTION','login'); /*website parameters*/ -define('DOMAIN_NAME','h-source/admin'); +define('DOMAIN_NAME','localhost/admin'); /*type of database.*/ //it can be: Mysql, Mysqli or None (first letter in uppercase) diff --git a/readme-php5.sh b/readme-php5.sh deleted file mode 100755 index 4bad3aa..0000000 --- a/readme-php5.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# INSTRUCTIONS for testing with docker-lamp-php5: -# -# After the docker container spins up, -# the mysql password will be displayed. -# - MySQL on port 3306 -# - Apache on port 80 -# -# Don't forget to create the database: -# mysql -uadmin -pXXX -h127.0.0.1 -# > create database hnode; -# > ^D -# and populate the schema/initial data with: -# mysql -uadmin -pXXX -h127.0.0.1 hnode < h-source/tables.sql - -patch -p1 < config-docker.patch - -docker-compose up --build lamp-php5 - -- cgit v1.2.3 From cf8584c645ca1178c027268b9fd273db6d15248a Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 26 Aug 2021 11:44:01 +1000 Subject: change mysql dir --- docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index c3f2349..9a7aa44 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -11,4 +11,4 @@ services: - 3306:3306 volumes: - "../h-source:/app" - - "./mysql:/var/lib/mysql" + - "../mysql:/var/lib/mysql" -- cgit v1.2.3 From efa352a6de4de467e645c50503257e17254f436e Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 26 Aug 2021 11:45:47 +1000 Subject: add mysql to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e4e5f6c..c06b95f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*~ \ No newline at end of file +*~ +mysql/ \ No newline at end of file -- cgit v1.2.3 From 6995bcca056862e52d1167d6ee7e67d73a2bdd95 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 26 Aug 2021 11:56:07 +1000 Subject: updating the database creation command to be more "batchy" --- docker/readme-php5.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/readme-php5.sh b/docker/readme-php5.sh index fb62a4d..7ec58b1 100755 --- a/docker/readme-php5.sh +++ b/docker/readme-php5.sh @@ -8,9 +8,7 @@ # - Apache on port 80 # # Don't forget to create the database: -# mysql -uadmin -pXXX -h127.0.0.1 -# > create database hnode; -# > ^D +# mysql -uadmin -pXXX -h127.0.0.1 -e "create database hnode;" # and populate the schema/initial data with: # mysql -uadmin -pXXX -h127.0.0.1 hnode < ../h-source/tables.sql -- cgit v1.2.3 From e5d8adfe0cda67173cae706708e0b4e7a67f5713 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 6 Sep 2021 10:27:36 +1000 Subject: Adding lamp-php7 docker command. - Tested locally. The website up and running. - Also updated the readme script to run either php5 or php7. --- docker/docker-compose.yml | 20 +++++++++++++++----- docker/lamp-php7.Dockerfile | 3 +++ docker/readme-lamp.sh | 26 ++++++++++++++++++++++++++ docker/readme-php5.sh | 16 ---------------- 4 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 docker/lamp-php7.Dockerfile create mode 100755 docker/readme-lamp.sh delete mode 100755 docker/readme-php5.sh diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 9a7aa44..dcc4ed1 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,9 +1,7 @@ -# Image for LAMP based on Dockerfile in https://github.com/jakejarvis/docker-lamp-php5 -# WARNING: Not suitable for production environments, only for testing legacy php5 application. -# (Docker image supplementary files licenced under Apache 2.0) - -version: "3" services: + # Image for LAMP based on Dockerfile in https://github.com/jakejarvis/docker-lamp-php5 + # WARNING: Not suitable for production environments, only for testing legacy php5 application. + # (Docker image supplementary files licenced under Apache 2.0) lamp-php5: image: docker.io/jakejarvis/lamp-php5:latest ports: @@ -12,3 +10,15 @@ services: volumes: - "../h-source:/app" - "../mysql:/var/lib/mysql" + # Image for LAMP based on https://github.com/mattrayner/docker-lamp + # (Docker image licenced under Apache 2.0) + lamp-php7: + build: + dockerfile: lamp-php7.Dockerfile + context: . + ports: + - 8001:80 + - 3306:3306 + volumes: + - "../h-source:/app" + - "../mysql:/var/lib/mysql" diff --git a/docker/lamp-php7.Dockerfile b/docker/lamp-php7.Dockerfile new file mode 100644 index 0000000..4dc7b50 --- /dev/null +++ b/docker/lamp-php7.Dockerfile @@ -0,0 +1,3 @@ +FROM mattrayner/lamp:latest-1804 + +CMD ["/run.sh"] \ No newline at end of file diff --git a/docker/readme-lamp.sh b/docker/readme-lamp.sh new file mode 100755 index 0000000..c73cbfa --- /dev/null +++ b/docker/readme-lamp.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Spin up a docker lamp image. +# +# Usage: +# ./readme-lamp.sh [php-version] +# +# php-version: 5 or 7 (default) +# +# INSTRUCTIONS for testing with docker-lamp-php{5,7}: +# +# After the docker container spins up, +# the mysql password will be displayed. +# - MySQL on port 3306 +# - Apache on port 80 +# +# Don't forget to create the database: +# mysql -uadmin -pXXX -h127.0.0.1 -e "create database hnode;" +# and populate the schema/initial data with: +# mysql -uadmin -pXXX -h127.0.0.1 hnode < ../h-source/tables.sql + +if [ -z "$1"]; then + docker-compose up --build lamp-php7 +else + docker-compose up --build lamp-php"$1" +fi diff --git a/docker/readme-php5.sh b/docker/readme-php5.sh deleted file mode 100755 index 7ec58b1..0000000 --- a/docker/readme-php5.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# -# INSTRUCTIONS for testing with docker-lamp-php5: -# -# After the docker container spins up, -# the mysql password will be displayed. -# - MySQL on port 3306 -# - Apache on port 80 -# -# Don't forget to create the database: -# mysql -uadmin -pXXX -h127.0.0.1 -e "create database hnode;" -# and populate the schema/initial data with: -# mysql -uadmin -pXXX -h127.0.0.1 hnode < ../h-source/tables.sql - -docker-compose up --build lamp-php5 - -- cgit v1.2.3 From 06934eb28d86775cf1472c9a83cfce80e71597d8 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 6 Sep 2021 10:27:36 +1000 Subject: Adding lamp-php7 docker command. - Tested locally. The website up and running. - Also updated the readme script to run either php5 or php7. --- docker/docker-compose.yml | 19 +++++++++++++++---- docker/lamp-php7.Dockerfile | 3 +++ docker/readme-lamp.sh | 26 ++++++++++++++++++++++++++ docker/readme-php5.sh | 16 ---------------- 4 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 docker/lamp-php7.Dockerfile create mode 100755 docker/readme-lamp.sh delete mode 100755 docker/readme-php5.sh diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 9a7aa44..35e4623 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,9 +1,8 @@ -# Image for LAMP based on Dockerfile in https://github.com/jakejarvis/docker-lamp-php5 -# WARNING: Not suitable for production environments, only for testing legacy php5 application. -# (Docker image supplementary files licenced under Apache 2.0) - version: "3" services: + # Image for LAMP based on Dockerfile in https://github.com/jakejarvis/docker-lamp-php5 + # WARNING: Not suitable for production environments, only for testing legacy php5 application. + # (Docker image supplementary files licenced under Apache 2.0) lamp-php5: image: docker.io/jakejarvis/lamp-php5:latest ports: @@ -12,3 +11,15 @@ services: volumes: - "../h-source:/app" - "../mysql:/var/lib/mysql" + # Image for LAMP based on https://github.com/mattrayner/docker-lamp + # (Docker image licenced under Apache 2.0) + lamp-php7: + build: + dockerfile: lamp-php7.Dockerfile + context: . + ports: + - 80:80 + - 3306:3306 + volumes: + - "../h-source:/app" + - "../mysql:/var/lib/mysql" diff --git a/docker/lamp-php7.Dockerfile b/docker/lamp-php7.Dockerfile new file mode 100644 index 0000000..4dc7b50 --- /dev/null +++ b/docker/lamp-php7.Dockerfile @@ -0,0 +1,3 @@ +FROM mattrayner/lamp:latest-1804 + +CMD ["/run.sh"] \ No newline at end of file diff --git a/docker/readme-lamp.sh b/docker/readme-lamp.sh new file mode 100755 index 0000000..d5aa572 --- /dev/null +++ b/docker/readme-lamp.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Spin up a docker lamp image. +# +# Usage: +# ./readme-lamp.sh [php-version] +# +# php-version: 5 or 7 (default) +# +# INSTRUCTIONS for testing with docker-lamp-php{5,7}: +# +# After the docker container spins up, +# the mysql password will be displayed. +# - MySQL on port 3306 +# - Apache on port 80 +# +# Don't forget to create the database: +# mysql -uadmin -pXXX -h127.0.0.1 -e "create database hnode;" +# and populate the schema/initial data with: +# mysql -uadmin -pXXX -h127.0.0.1 hnode < ../h-source/tables.sql + +if [ -z "$1" ]; then + docker-compose up --build lamp-php7 +else + docker-compose up --build lamp-php"$1" +fi diff --git a/docker/readme-php5.sh b/docker/readme-php5.sh deleted file mode 100755 index 7ec58b1..0000000 --- a/docker/readme-php5.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# -# INSTRUCTIONS for testing with docker-lamp-php5: -# -# After the docker container spins up, -# the mysql password will be displayed. -# - MySQL on port 3306 -# - Apache on port 80 -# -# Don't forget to create the database: -# mysql -uadmin -pXXX -h127.0.0.1 -e "create database hnode;" -# and populate the schema/initial data with: -# mysql -uadmin -pXXX -h127.0.0.1 hnode < ../h-source/tables.sql - -docker-compose up --build lamp-php5 - -- cgit v1.2.3 From 737f4cd5e986024ab953ff81d8f8d54d33e22bf4 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 9 Sep 2021 10:28:58 +1000 Subject: simplifying the docker-compose for php7. tested locally. --- docker/docker-compose.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 35e4623..544ac17 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -14,9 +14,7 @@ services: # Image for LAMP based on https://github.com/mattrayner/docker-lamp # (Docker image licenced under Apache 2.0) lamp-php7: - build: - dockerfile: lamp-php7.Dockerfile - context: . + image: mattrayner/lamp:latest-1804 ports: - 80:80 - 3306:3306 -- cgit v1.2.3 From e98b991a5870b8af01b6987118efd4f3ee60834d Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 9 Sep 2021 11:42:53 +1000 Subject: remove redundant dockerfile --- docker/lamp-php7.Dockerfile | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 docker/lamp-php7.Dockerfile diff --git a/docker/lamp-php7.Dockerfile b/docker/lamp-php7.Dockerfile deleted file mode 100644 index 4dc7b50..0000000 --- a/docker/lamp-php7.Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM mattrayner/lamp:latest-1804 - -CMD ["/run.sh"] \ No newline at end of file -- cgit v1.2.3 From ad2cfad59b62b1b188d76d83ebf89b3dc69787f3 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 9 Sep 2021 17:33:45 +1000 Subject: minor changes to dispel php notices - end(): https://stackoverflow.com/questions/4636166/only-variables-should-be-passed-by-reference - get_magic_quotes_gpc() always returns false: https://www.php.net/manual/en/function.get-magic-quotes-gpc.php - __autoload(): https://stackoverflow.com/questions/50780678/deprecated-autoload-is-deprecated-use-spl-autoload-register --- h-source/Library/Call.php | 8 +++++--- h-source/Library/Functions.php | 5 +---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/h-source/Library/Call.php b/h-source/Library/Call.php index c75508b..a9145c2 100755 --- a/h-source/Library/Call.php +++ b/h-source/Library/Call.php @@ -257,7 +257,7 @@ function getQueryString() return ''; } -function __autoload($className) +function autoloader($className) { $backupName = $className; @@ -290,6 +290,7 @@ function __autoload($className) } } +spl_autoload_register('autoloader'); try { @@ -324,7 +325,8 @@ try { //load the files defined inside Config/Autoload.php foreach (Autoload::$files as $file) { - $ext = strtolower(end(explode('.', $file))); + $parts = explode('.', $file); + $ext = strtolower(end($parts)); $path = ROOT . DS . APPLICATION_PATH . DS . 'Include' . DS . $file; if (file_exists($path) and $ext === 'php') { @@ -354,4 +356,4 @@ try { echo '
      Message: '.$e->getMessage().'
      '; -} \ No newline at end of file +} diff --git a/h-source/Library/Functions.php b/h-source/Library/Functions.php index 1477680..e0e77bf 100755 --- a/h-source/Library/Functions.php +++ b/h-source/Library/Functions.php @@ -107,9 +107,6 @@ SANITIZE DEEP */ function stripslashesDeep($value) { - if(get_magic_quotes_gpc()) {#if stripslashes - return array_map('stripslashes', $value); - } return $value; } @@ -304,4 +301,4 @@ function xml_encode($string) } return strtr($string, $trans); -} \ No newline at end of file +} -- cgit v1.2.3 From 7083cc43ea352cf45d4325aaf859effd4dc4f6e9 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 22 Sep 2021 12:34:53 +1000 Subject: 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 +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'; +
      + +
      +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'; +
      +
      +
      +-
      ++
      ++ STAGING ++
      +
      +
      + +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 @@ + + + ++ ++ raw ++ This is a staging instance of h-node. For the official site please visit h-node.org. ++
      ++ ++ ]]> ++ + + raw + Date: Wed, 22 Sep 2021 17:01:58 +1000 Subject: updating url::getroot otherwise things may look weird e.g. urls in confirmation email would start with `/` --- h-source/Library/Url.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/h-source/Library/Url.php b/h-source/Library/Url.php index 5124047..efb8e6e 100755 --- a/h-source/Library/Url.php +++ b/h-source/Library/Url.php @@ -27,7 +27,9 @@ class Url { //get the url starting from the root folder public static function getRoot($pathFromRootFolder = null) { - $url = MOD_REWRITE_MODULE === true ? '/' . $pathFromRootFolder : '/index.php/' . $pathFromRootFolder; + $protocol = Params::$useHttps ? "https" : "http"; + + $url = MOD_REWRITE_MODULE === true ? "$protocol://" . DOMAIN_NAME . '/' . $pathFromRootFolder : "$protocol://" . DOMAIN_NAME . '/index.php/' . $pathFromRootFolder; return $url; } -- cgit v1.2.3 From 5f2346668dd0f7f265d08fb02e097822f5517883 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 7 Oct 2021 18:11:31 +1100 Subject: Update README with documentation on php module requirements. --- h-source/README | 3 --- h-source/README.org | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) delete mode 100644 h-source/README create mode 100644 h-source/README.org diff --git a/h-source/README b/h-source/README deleted file mode 100644 index 16de4dc..0000000 --- a/h-source/README +++ /dev/null @@ -1,3 +0,0 @@ -When deploying to staging, run - -patch -p2 Date: Thu, 26 Aug 2021 09:53:44 +1000 Subject: Updating contact section. Removing info@h-node.com adding irc and mailing list. couldn't do nonenglish version because I don't know the languages. --- h-source/Application/Views/Desktop/Contact/index.php | 2 +- h-source/Application/Views/Mobile/Contact/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/h-source/Application/Views/Desktop/Contact/index.php b/h-source/Application/Views/Desktop/Contact/index.php index 62822d8..ac6e7d5 100644 --- a/h-source/Application/Views/Desktop/Contact/index.php +++ b/h-source/Application/Views/Desktop/Contact/index.php @@ -31,7 +31,7 @@
      - If you want to directly contact the team use this e-mail address: info@h-node.com + Discussions about also take place on the h-source-users mailing list and #h-node libera.chat IRC channel.
      diff --git a/h-source/Application/Views/Mobile/Contact/index.php b/h-source/Application/Views/Mobile/Contact/index.php index 51e0466..20faef1 100644 --- a/h-source/Application/Views/Mobile/Contact/index.php +++ b/h-source/Application/Views/Mobile/Contact/index.php @@ -33,7 +33,7 @@
      - If you want to directly contact the team use this e-mail address: info@h-node.com + Discussions about also take place on the h-source-users mailing list and #h-node libera.chat IRC channel.
      -- cgit v1.2.3