initial commit of file from CVS for smeserver-wordpress on Sat Sep 7 21:15:59 AEST 2024
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{
|
||||
$OUT .= "--go-into usr/share/wordpress/wp-content\n" if (($wordpress{BackupFiles} || 'enabled') eq 'enabled');
|
||||
}
|
20
root/etc/e-smith/templates/etc/e-smith/sql/init/80wordpress
Normal file
20
root/etc/e-smith/templates/etc/e-smith/sql/init/80wordpress
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
my $db = $wordpress{DbName} || 'wordpress';
|
||||
my $user = $wordpress{DbUser} || 'wordpress';
|
||||
my $pass = $wordpress{DbPassword} || 'changeme';
|
||||
$OUT .= <<END
|
||||
#! /bin/sh
|
||||
if [ -d /var/lib/mysql/$db ]; then
|
||||
exit
|
||||
fi
|
||||
/usr/bin/mysql <<EOF
|
||||
CREATE DATABASE $db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
|
||||
use $db;
|
||||
#create tables manually wiki.contribs.org/wordpress
|
||||
use mysql;
|
||||
GRANT ALL PRIVILEGES ON $db.* TO $user\@localhost
|
||||
IDENTIFIED BY '$pass';
|
||||
flush privileges;
|
||||
EOF
|
||||
END
|
||||
}
|
102
root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress
Normal file
102
root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
my $status = $wordpress{'status'} || "disabled";
|
||||
return " # wordpress is disabled in this VirtualHost"
|
||||
unless $status eq 'enabled';
|
||||
|
||||
$OUT = "";
|
||||
my $allow = 'all granted';
|
||||
my $pass = '0';
|
||||
my $satisfy = 'all';
|
||||
my $name = $wordpress{'Name'} || 'Wordpress weblog';
|
||||
|
||||
for ('exit-if-none')
|
||||
{
|
||||
if ($wordpress{'PublicAccess'})
|
||||
{
|
||||
if ($wordpress{'PublicAccess'} eq 'none')
|
||||
{
|
||||
next;
|
||||
}
|
||||
elsif ($wordpress{'PublicAccess'} eq 'local')
|
||||
{
|
||||
$allow = "ip $localAccess";
|
||||
$pass = 0;
|
||||
$satisfy = 'all';
|
||||
}
|
||||
elsif ($wordpress{'PublicAccess'} eq 'local-pw')
|
||||
{
|
||||
$allow = "ip $localAccess";
|
||||
$pass = 1;
|
||||
$satisfy = 'all';
|
||||
}
|
||||
elsif ($wordpress{'PublicAccess'} eq 'global')
|
||||
{
|
||||
$allow = 'all granted';
|
||||
$pass = 0;
|
||||
$satisfy = 'all';
|
||||
}
|
||||
elsif ($wordpress{'PublicAccess'} eq 'global-pw')
|
||||
{
|
||||
$allow = 'all granted';
|
||||
$pass = 1;
|
||||
$satisfy = 'all';
|
||||
}
|
||||
elsif ($wordpress{'PublicAccess'} eq 'global-pw-remote')
|
||||
{
|
||||
$allow = "ip $localAccess";
|
||||
$pass = 1;
|
||||
$satisfy = 'any';
|
||||
}
|
||||
}
|
||||
|
||||
$OUT .= "#------------------------------------------------------------\n";
|
||||
$OUT .= "# wordpress - $name\n";
|
||||
$OUT .= "#------------------------------------------------------------\n";
|
||||
|
||||
|
||||
if (exists $wordpress{'URL'}) {
|
||||
$OUT .= "Alias /$wordpress{'URL'} /usr/share/wordpress\n";
|
||||
}
|
||||
|
||||
else {
|
||||
$OUT .= "Alias /wordpress /usr/share/wordpress\n";
|
||||
}
|
||||
|
||||
$OUT .= "\n";
|
||||
$OUT .= "<Directory /usr/share/wordpress>\n";
|
||||
|
||||
$version = "73";
|
||||
$OUT .= " <FilesMatch \.php\$\>\n";
|
||||
$OUT .= " SetHandler \"proxy:unix:/var/run/php-fpm/php$version.sock|fcgi://localhost\"\n";
|
||||
$OUT .= " </FilesMatch>\n";
|
||||
|
||||
$OUT .= " AddType application/x-httpd-php .php\n";
|
||||
#$OUT .= " php_admin_value open_basedir /usr/share/wordpress:/etc/wordpress:/tmp/:/usr/share/pear:/usr/share/php/\n";
|
||||
$OUT .= " Options ";
|
||||
$OUT .= " FollowSymLinks " if ( ($wordpress{'SymLinks'} || 'disabled') eq 'enabled');
|
||||
$OUT .= " Indexes " if ( ($wordpress{'Indexes'} || 'disabled') eq 'enabled');
|
||||
$OUT .= " None " if ((($wordpress{'Indexes'} || 'disabled') ne 'enabled') && (($wordpress{'SymLinks'} || 'disabled') ne 'enabled'));
|
||||
$OUT .= "\n AllowOverride All" if ( ($wordpress{'AllowOverrideAll'} || 'disabled') eq 'enabled');
|
||||
|
||||
#$OUT .= "\n order deny,allow\n";
|
||||
#$OUT .= " deny from all\n";
|
||||
#$OUT .= " allow from $allow\n";
|
||||
$OUT .= "\n Require $allow \n";
|
||||
|
||||
#$OUT .= " php_value mysql.default_host $wordpress{DbName}\n";
|
||||
#$OUT .= " php_value mysql.default_user $wordpress{DbUser}\n";
|
||||
#$OUT .= " php_value mysql.default_password $wordpress{DbPassword}\n";
|
||||
#$OUT .= " php_admin_value upload_tmp_dir /tmp\n";
|
||||
|
||||
if ($pass)
|
||||
{
|
||||
$OUT .= " AuthName \"$name\"\n";
|
||||
$OUT .= " AuthBasicProvider external\n";
|
||||
$OUT .= " AuthType Basic\n";
|
||||
$OUT .= " AuthExternal pwauth\n";
|
||||
$OUT .= " require valid-user\n";
|
||||
$OUT .= " Satisfy $satisfy\n";
|
||||
}
|
||||
$OUT .= "</Directory>\n";
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
{
|
||||
my $status = $wordpress{'status'} || "disabled";
|
||||
return " # wordpress is disabled in this VirtualHost"
|
||||
unless $status eq 'enabled';
|
||||
my $HTTPS = $wordpress{'Https'} || 'enabled';
|
||||
|
||||
$haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ? 'yes' : 'no';
|
||||
if (($port eq "80") && ($haveSSL eq 'yes') && ($HTTPS eq 'enabled'))
|
||||
{
|
||||
if (exists $wordpress{'URL'}) {
|
||||
$OUT .= " RewriteRule ^/$wordpress{'URL'}(/.*|\$) https://%{HTTP_HOST}/$wordpress{'URL'}\$1 [L,R]\n";
|
||||
}
|
||||
else {
|
||||
$OUT .= " RewriteRule ^/wordpress(/.*|\$) https://%{HTTP_HOST}/wordpress\$1 [L,R]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
21
root/etc/e-smith/templates/etc/wordpress/wp-config.php/10db
Normal file
21
root/etc/e-smith/templates/etc/wordpress/wp-config.php/10db
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
$OUT .= "define('DB_NAME', \'$wordpress{DbName}\'); \n";
|
||||
$OUT .= "define('DB_USER', \'$wordpress{DbUser}\'); \n";
|
||||
$OUT .= "define('DB_PASSWORD', \'$wordpress{DbPassword}\'); \n";
|
||||
$OUT .= "define('DB_HOST', \'localhost\'); \n";
|
||||
}
|
||||
|
||||
/** Database Charset to use in creating database tables. */
|
||||
define('DB_CHARSET', 'utf8');
|
||||
|
||||
/** The Database Collate type. Don't change this if in doubt. */
|
||||
define('DB_COLLATE', '');
|
||||
|
||||
/**
|
||||
* WordPress Database Table prefix.
|
||||
*
|
||||
* You can have multiple installations in one database if you give each a unique
|
||||
* prefix. Only numbers, letters, and underscores please!
|
||||
*/
|
||||
$table_prefix = 'wp_';
|
||||
|
@@ -0,0 +1,99 @@
|
||||
/**#@+
|
||||
* Authentication Unique Keys and Salts.
|
||||
*
|
||||
* Change these to different unique phrases!
|
||||
* You can generate these using the @link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service
|
||||
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
{
|
||||
use MIME::Base64;
|
||||
my $pw=$wordpress{'Salt'} || "enabled";
|
||||
if ( $pw eq "enabled" )
|
||||
{
|
||||
if ( open( RANDOM, "/dev/urandom" ) )
|
||||
{
|
||||
my $buf;
|
||||
# 57 bytes is a full line of Base64 coding, and contains
|
||||
# 456 bits of randomness - given a perfectly random /dev/random
|
||||
if ( read( RANDOM, $buf, 57 ) != 57 )
|
||||
{
|
||||
warn("Short read from /dev/random: $!");
|
||||
}
|
||||
else
|
||||
{
|
||||
$pw = encode_base64($buf);
|
||||
chomp $pw;
|
||||
}
|
||||
close RANDOM;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pw= 'put your unique phrase here';
|
||||
}
|
||||
}
|
||||
|
||||
$OUT .= "define('AUTH_KEY', '$pw');
|
||||
define('SECURE_AUTH_KEY', '$pw');
|
||||
define('LOGGED_IN_KEY', '$pw');
|
||||
define('NONCE_KEY', '$pw');
|
||||
define('AUTH_SALT', '$pw');
|
||||
define('SECURE_AUTH_SALT', '$pw');
|
||||
define('LOGGED_IN_SALT', '$pw');
|
||||
define('NONCE_SALT', '$pw');";
|
||||
}
|
||||
/**#@-*/
|
||||
|
||||
|
||||
/**
|
||||
* WordPress Localized Language, defaults to English.
|
||||
*
|
||||
* Change this to localize WordPress. A corresponding MO file for the chosen
|
||||
* language must be installed to wp-content/languages. For example, install
|
||||
* de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
|
||||
* language support.
|
||||
*/
|
||||
|
||||
{
|
||||
my $lang = $wordpress{'WpLang'} || '';
|
||||
$OUT .= "define('WPLANG', '$lang');\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* See http://make.wordpress.org/core/2013/10/25/the-definitive-guide-to-disabling-auto-updates-in-wordpress-3-7
|
||||
*/
|
||||
|
||||
/*Allow filees to be modified allowing in place updates */
|
||||
define('DISALLOW_FILE_MODS', false);
|
||||
|
||||
/* Move to install wordpress direct, no rpm, so need to enable in place changes and updates */
|
||||
define('AUTOMATIC_UPDATER_DISABLED', false);
|
||||
|
||||
/* Need this to avoid the ftp questions on every update */
|
||||
define('FS_METHOD','direct');
|
||||
|
||||
/* Enable all core updates, including minor and major: */
|
||||
define( 'WP_AUTO_UPDATE_CORE', true );
|
||||
|
||||
|
||||
/**
|
||||
* For developers: WordPress debugging mode.
|
||||
*
|
||||
* Change this to true to enable the display of notices during development.
|
||||
* It is strongly recommended that plugin and theme developers use WP_DEBUG
|
||||
* in their development environments.
|
||||
*/
|
||||
{
|
||||
my $debug = $wordpress{'debug'} || "false";
|
||||
$OUT .= "define('WP_DEBUG', $debug);\n";
|
||||
}
|
||||
|
||||
/* That's all, stop editing! Happy blogging. */
|
||||
|
||||
/** Absolute path to the WordPress directory. */
|
||||
define('ABSPATH', '/usr/share/wordpress/');
|
||||
|
||||
/** Sets up WordPress vars and included files. */
|
||||
require_once(ABSPATH . 'wp-settings.php');
|
||||
|
@@ -0,0 +1,14 @@
|
||||
{
|
||||
$OUT = <<HERE;
|
||||
<?php
|
||||
/*
|
||||
HERE
|
||||
|
||||
$OUT .=
|
||||
Text::Template::_load_text("/etc/e-smith/templates-default/template-begin");
|
||||
|
||||
$OUT .= <<HERE;
|
||||
*/
|
||||
HERE
|
||||
|
||||
}
|
@@ -0,0 +1 @@
|
||||
?>
|
Reference in New Issue
Block a user