4 Commits

Author SHA1 Message Date
Paul Jewell
00ab3b3065 #267 - Remove mysql instructions from site-generator 2025-07-24 08:27:39 +01:00
Paul Jewell
4af0c021eb #267 - Remove mysql instructions from GETTING_STARTED.md 2025-07-24 08:25:58 +01:00
Paul Jewell
3abeb25b03 #267 - Remove references to mysql from README.md 2025-07-24 08:21:50 +01:00
Paul Jewell
e2fd890669 #267 - remove dependency check for DBD::mysql 2025-07-24 08:18:51 +01:00
4 changed files with 40 additions and 83 deletions

View File

@@ -111,7 +111,7 @@ file are found in the comments within the file.
Any database supported by the Perl:DBI and Perl::DBD modules can be used with
the site-generator program. Currently the hpr_generator project works with
a MySQL or SQLite database.
an SQLite database.
Find the [DBI] section of the file. It should look like the following
@@ -146,26 +146,6 @@ The hpr.db section of the driver option `dbi:SQLite:hpr.db` is the path
to the sqlite file. The default assumes the hpr.db file is located in the same
directory as the site-generator.
### MySQL
Remove the comment character from the start of the database, driver,
user, and password option lines:
```
# Configuration settings for MySQL
database: mysql
driver: dbi:mysql:database=hpr_hpr:hostname=localhost
user: hpr-generator
password: *********
```
This assumes that the MySQL database service is available at the localhost
hostname, that the database name (hpr_hpr) is the database created from
the hpr.sql dump file or manually created by you, that the user (hpr-generator)
was added by you and has read rights to the hpr_hpr database, and that the
password (replace ********* with the actual password) matches the password set
for the hpr-generator database user.
## Configuring the website for viewing locally
For HTML links to work when viewing the files on your local machine using the

View File

@@ -15,15 +15,6 @@ Static web page generator for the Hacker Public Radio website.
2. Run `./utils/update-hpr.sh`
* SQLite v3.8.3 or greater is recommended. CTE WITH clauses are used in some template queries. Must convert WITH
clauses to sub-queries when using earlier versions of SQLite.
* With MySQL
* Create database hpr_hpr in the MySQL server from HPR dump file.
- ``sudo mysql --host=localhost < hpr.sql``
* Create a user that will be used by the site-generator.
- Suggested username: hpr-generator
- ``CREATE USER 'hpr-generator'@'localhost' IDENTIFIED BY '<password>';``
* Limit the user's privileges to EXECUTE and SELECT
- ``GRANT SELECT ON hpr_hpr.* TO 'hpr-generator'@'localhost';``
- ``GRANT EXECUTE ON `hpr_hpr`.* TO 'hpr-generator'@'localhost';``
* Install the needed Perl modules using preferred method (distribution packages, CPAN, etc.)
* Getopt::Long
* Pod::Usage
@@ -35,7 +26,7 @@ Static web page generator for the Hacker Public Radio website.
* Template::Plugin::HTML::Strip
* DBI
* Tie::DBI
* DBD::SQLite or DBD::mysql
* DBD::SQLite
* Date::Calc
* Text::CSV_XS
* HTML::Entities
@@ -76,4 +67,6 @@ and add the label "**Feature Request**".
* gordons
* Ken Fallon
* norrist
* Paul Jewell

View File

@@ -56,19 +56,9 @@ Perl Template Toolkit.
* SQLite v3.8.3 or greater is recommended. CTE WITH clauses are used in some template queries.
Must convert WITH clauses to sub-queries when using earlier versions of SQLite.
With MySQL
* Create database hpr_hpr in the MySQL server from HPR dump file.
- sudo mysql --host=localhost < hpr.sql
* Create a user that will be used by the site-generator.
- Suggested username: hpr-generator
- CREATE USER 'hpr-generator'@'localhost' IDENTIFIED BY '<password>';
* Limit the user's privileges to EXECUTE and SELECT
- GRANT SELECT ON hpr_hpr.* TO 'hpr-generator'@'localhost';
- GRANT EXECUTE ON `hpr_hpr`.* TO 'hpr-generator'@'localhost';
Install the needed Perl modules using preferred method (distribution packages, CPAN, etc.)
* Config::Std
* DBD::SQLite or DBD:mysql
* DBD::SQLite
* DBI
* Data::Dumper
* Date::Calc

View File

@@ -29,8 +29,7 @@ set -o nounset # Treat unset variables as an error
function is_module_installed {
HR="----------------------"
perl -e "use ${1} "
if [ $? -ne 0 ]
then
if [ $? -ne 0 ]; then
echo ${HR}
else
echo "Found module ${1}"
@@ -38,35 +37,30 @@ function is_module_installed {
fi
}
MODULES=( \
"Getopt::Long" \
"Pod::Usage" \
"Config::Std" \
"Template" \
"Template::Plugin::File" \
"Template::Plugin::DBI" \
"Template::Plugin::HTML::Strip" \
"DBI" \
"Tie::DBI" \
"DBD::SQLite" \
"DBD::mysql" \
"Date::Calc" \
"Text::CSV_XS" \
MODULES=(
"Getopt::Long"
"Pod::Usage"
"Config::Std"
"Template"
"Template::Plugin::File"
"Template::Plugin::DBI"
"Template::Plugin::HTML::Strip"
"DBI"
"Tie::DBI"
"DBD::SQLite"
"Date::Calc"
"Text::CSV_XS"
)
echo "The following modules must be installed for the site-generator to function: "
for module in "${MODULES[@]}"
do
for module in "${MODULES[@]}"; do
echo "* ${module}"
done
echo "When MySQL is used, the DBD:mysql module is required (otherwise it is optional)"
echo "When SQLite is used, then the DBD:SQLite module is required (otherwise it is optional)"
echo "Scanning for modules ..."
echo "----------------------"
for module in "${MODULES[@]}"
do
for module in "${MODULES[@]}"; do
is_module_installed "${module}"
done