/[smecontribs]/rpms/smeserver-wordpress/contribs10/smeserver-wordpress-1.2-Remove-need-for-wordpress-rpm.patch
ViewVC logotype

Contents of /rpms/smeserver-wordpress/contribs10/smeserver-wordpress-1.2-Remove-need-for-wordpress-rpm.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri Mar 12 12:25:50 2021 UTC (3 years, 8 months ago) by brianr
Branch: MAIN
CVS Tags: smeserver-wordpress-1_2-12_el7_sme, smeserver-wordpress-1_2-11_el7_sme, HEAD
* Tue Mar 09 2021 Brian Read <brianr@bjsystems.co.uk> 1.2-11.sme
- Update wp-config.php with AUTO UPDATE and DIRECT download [SME: 11428]
- Remove requirement for wordpress rpm, and set script to download and install

1 diff -urN smeserver-wordpress-1.2.old/createlinks smeserver-wordpress-1.2/createlinks
2 --- smeserver-wordpress-1.2.old/createlinks 2021-03-09 10:01:31.136796105 +0000
3 +++ smeserver-wordpress-1.2/createlinks 2021-03-11 11:57:58.780424420 +0000
4 @@ -3,7 +3,7 @@
5 use esmith::Build::CreateLinks qw(:all);
6
7 # our event specific for updating with yum without reboot
8 -$event = "smeserver-wordpress-update"; #not needed, but here for completion and edification!
9 +$event = "smeserver-wordpress-update";
10 #add here the path to your templates needed to expand
11 #see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event
12 # Not needed if no task to be started.
13 @@ -26,6 +26,8 @@
14 #safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
15 #safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init");
16
17 +safe_symlink("../actions/wordpress-install.sh", "root/etc/e-smith/events/$event/10wordpress-install");
18 +
19 ####################
20 # links to add
21
22 diff -urN smeserver-wordpress-1.2.old/root/etc/e-smith/events/actions/wordpress-install.sh smeserver-wordpress-1.2/root/etc/e-smith/events/actions/wordpress-install.sh
23 --- smeserver-wordpress-1.2.old/root/etc/e-smith/events/actions/wordpress-install.sh 1970-01-01 01:00:00.000000000 +0100
24 +++ smeserver-wordpress-1.2/root/etc/e-smith/events/actions/wordpress-install.sh 2021-03-11 12:13:04.191529389 +0000
25 @@ -0,0 +1,104 @@
26 +#!/bin/bash
27 +# Script Name: WordPress Install Shell Script for SME10 https://koozali.com
28 +# Brian Read brianr@bjsystems.co.uk March 2021
29 +
30 +# Based on:
31 +# Script URI: http://www.redbridgenet.com/wordpress/wordpress-upgrade-shell-script/
32 +# Description: Upgrades your WordPress installation following more closely the WordPress guidelines.
33 +# Version: 1.0.0
34 +# Author: Ed Reckers
35 +# Author URI: http://www.redbridgenet.com/
36 +# License: GPL2
37 +#
38 +# Usage ./upgrade.wordpress.sh
39 +#
40 +# Linux bin paths
41 +MYSQLDUMP="$(which mysqldump)"
42 +TAR="$(which tar)"
43 +GZIP="$(which gzip)"
44 +WGET="$(which wget)"
45 +UNZIP="$(which unzip)"
46 +CP="$(which cp)"
47 +RM="$(which rm)"
48 +CD="$(which cd)"
49 +MKDIR="$(which mkdir)"
50 +CHOWN="$(which chown)"
51 +
52 +# Set mysql account credentials
53 +MyNAME=$(db configuration getprop wordpress DbName)
54 +MyUSER=$(db configuration getprop wordpress DbUser)
55 +MyPASS=$(db configuration getprop wordpress DbPassword)
56 +MyHOST="localhost"
57 +
58 +#Temp working area
59 +TEMPDIR=$(mktemp -d)
60 +
61 +# Directory containing your wordpress installation
62 +WEBROOT="/usr/share/wordpress/"
63 +
64 +# Get a sortable date like 2011-01-01 for full backups
65 +FULLDATE="$(date +"%Y-%m-%d")"
66 +
67 +# Create progress dots function
68 +show_dots() {
69 + while ps $1 >/dev/null ; do
70 + printf "."
71 + sleep 1
72 + done
73 + printf "\n"
74 +}
75 +
76 +#Place to find the latest WordPress
77 +LATEST_WP="latest.zip"
78 +URL_FOR_WP_DOWNLOAD="http://wordpress.org/"$LATEST_WP
79 +
80 +# Check if Wordpress already here, if so exit
81 +$MKDIR -p $WEBROOT
82 +$CD $WEBROOT
83 +if [[ -d wp-admin && -d wp-includes && -d wp-content ]]; then
84 + echo "Found WordPress in $WEBROOT - exiting"
85 + exit
86 +fi
87 +$CD $TEMPDIR
88 +
89 +# Get the latest WordPress package
90 +$RM -f $LATEST_WP
91 +echo "get WordPress package..."
92 +$WGET -qq $URL_FOR_WP_DOWNLOAD &
93 +show_dots $!
94 +
95 +#Check download worked
96 +if [ ! -f "$LATEST_WP" ]; then
97 + echo "Unable to download WordPress from $URL_FOR_WP_DOWNLOAD"
98 + exit
99 +fi
100 +
101 +# Unzip the files
102 +echo "unzip WordPress package..."
103 +$UNZIP -q latest.zip;
104 +
105 +# Remove the zip file
106 +echo "remove WordPress package..."
107 +$RM latest.zip;
108 +
109 +# Copy all new files from unziped WordPress package into your installation
110 +echo "copy new WordPress files..."
111 +$CP -r wordpress/* $WEBROOT;
112 +echo "Create link to /etc/wordpress/wp-config.php"
113 +touch /etc/wordpress/wp-config.php
114 +ln -s /etc/wordpress/wp-config.php $WEBROOT/wp-config.php
115 +echo "..and reset ownership"
116 +$CHOWN -R www:root $WEBROOT;
117 +
118 +# Remove the unzipped folder
119 +echo "cleanup unzipped WordPress package..."
120 +$RM -r wordpress/;
121 +
122 +# And remove Temp dir
123 +$RM -R ${TEMPDIR}
124 +
125 +# Output that all steps are complete
126 +echo "Wordpress Successfully Installed";
127 +
128 +#exit from script execution
129 +
130 diff -urN smeserver-wordpress-1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress smeserver-wordpress-1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress
131 --- smeserver-wordpress-1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress 2021-03-09 10:01:31.136796105 +0000
132 +++ smeserver-wordpress-1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress 2021-03-12 10:44:50.795719669 +0000
133 @@ -65,11 +65,10 @@
134 $OUT .= "\n";
135 $OUT .= "<Directory /usr/share/wordpress>\n";
136
137 -$version = "73";
138 -$OUT .= "<FilesMatch \.php\$\>\n";
139 -$OUT .= "SetHandler \"proxy:unix:/var/run/php-fpm/php$version.sock|fcgi://localhost\"\n";
140 -$OUT .= "</FilesMatch>\n";
141 -
142 + $version = "73";
143 + $OUT .= "<FilesMatch \.php\$\>\n";
144 + $OUT .= "SetHandler \"proxy:unix:/var/run/php-fpm/php$version.sock|fcgi://localhost\"\n";
145 + $OUT .= "</FilesMatch>\n";
146
147 $OUT .= " AddType application/x-httpd-php .php\n";
148 $OUT .= " #php_admin_value open_basedir /usr/share/wordpress:/etc/wordpress:/tmp/:/usr/share/pear:/usr/share/php/\n";
149 @@ -85,6 +84,7 @@
150 $OUT .= " #php_value mysql.default_user $wordpress{DbUser}\n";
151 $OUT .= " #php_value mysql.default_password $wordpress{DbPassword}\n";
152 $OUT .= " #php_admin_value upload_tmp_dir /tmp\n";
153 +
154 if ($pass)
155 {
156 $OUT .= " AuthName \"$name\"\n";
157 diff -urN smeserver-wordpress-1.2.old/root/etc/e-smith/templates/etc/wordpress/wp-config.php/20inc_dist smeserver-wordpress-1.2/root/etc/e-smith/templates/etc/wordpress/wp-config.php/20inc_dist
158 --- smeserver-wordpress-1.2.old/root/etc/e-smith/templates/etc/wordpress/wp-config.php/20inc_dist 2015-02-10 08:27:41.000000000 +0000
159 +++ smeserver-wordpress-1.2/root/etc/e-smith/templates/etc/wordpress/wp-config.php/20inc_dist 2021-03-12 12:00:46.095236092 +0000
160 @@ -64,14 +64,17 @@
161 * See http://make.wordpress.org/core/2013/10/25/the-definitive-guide-to-disabling-auto-updates-in-wordpress-3-7
162 */
163
164 -/* Disable all file change, as RPM base installation are read-only */
165 +/*Allow filees to be modified allowing in place updates */
166 define('DISALLOW_FILE_MODS', false);
167
168 -/* Disable automatic updater, in case you want to allow
169 - above FILE_MODS for plugins, themes, ... */
170 -define('AUTOMATIC_UPDATER_DISABLED', true);
171 +/* Move to install wordpress direct, no rpm, so need to enable in place changes and updates */
172 +define('AUTOMATIC_UPDATER_DISABLED', false);
173
174 -/* Core update is always disabled, WP_AUTO_UPDATE_CORE value is ignore */
175 +/* Need this to avoid the ftp questions on every update */
176 +define('FS_METHOD','direct');
177 +
178 +/* Enable all core updates, including minor and major: */
179 +define( 'WP_AUTO_UPDATE_CORE', true );
180
181
182 /**

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed