remove legacy code and add a general config file
authoreostre <eostre.danne@protonmail.com>
Tue, 15 Sep 2020 17:20:00 +0000 (13:20 -0400)
committereostre <eostre.danne@protonmail.com>
Tue, 15 Sep 2020 17:20:00 +0000 (13:20 -0400)
drupal-automake-generic/conf/conf [new file with mode: 0644]
drupal-automake-generic/conf/dbd.conf [deleted file]
drupal-automake-generic/conf/redirect-domains.conf [deleted file]
drupal-automake-generic/files/RELEASE [deleted file]
drupal-automake-generic/files/do-mysql.sh
drupal-automake-generic/files/install-drupal-toolchain.sh
drupal-automake-generic/files/install-packages.sh

diff --git a/drupal-automake-generic/conf/conf b/drupal-automake-generic/conf/conf
new file mode 100644 (file)
index 0000000..fee9638
--- /dev/null
@@ -0,0 +1,3 @@
+DRUPAL_DB_PASSWORD=changemeplease
+DRUPAL_DB_NAME=nameofdrupaltable
+DRUPAL_DB_USER=drupaluser
diff --git a/drupal-automake-generic/conf/dbd.conf b/drupal-automake-generic/conf/dbd.conf
deleted file mode 100644 (file)
index 81a6895..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-# <aliases for dbd>
-<VirtualHost *:80>
-       ServerName www0.defectivebydesign.org
-       ServerAlias www.defectivebydesign.org
-       ServerAlias defectivebydesign.com
-       ServerAlias defectivebydesign.net
-       ServerAlias www.defectivebydesign.com
-       ServerAlias www.defectivebydesign.net
-       ServerAlias dbd.fsf.org
-       ServerAlias defectivebydesign.org
-       ServerAdmin webmaster@fsf.org
-       ### redirect to same domain name, but HTTPS. required for HSTS  
-       RewriteEngine On
-       RewriteCond %{HTTPS} !=on
-       RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
-</VirtualHost>
-
-<VirtualHost *:443>
-       ServerName www0.defectivebydesign.org
-       ServerAlias defectivebydesign.com
-       ServerAlias defectivebydesign.net
-       ServerAlias www.defectivebydesign.com
-       ServerAlias www.defectivebydesign.net
-       ServerAlias dbd.fsf.org
-       ServerAlias defectivebydesign.org
-       ServerAdmin webmaster@fsf.org
-       RedirectMatch permanent (.*) https://www.defectivebydesign.org$1
-</VirtualHost>
-
-<VirtualHost *:443>
-       ServerName www.defectivebydesign.org
-       ServerAdmin webmaster@fsf.org
-</VirtualHost>
-# </aliases>
-
-# <configure some basic server parameters>
-# Possible values include: debug, info, notice, warn, error, crit,
-# alert, emerg.
-LogLevel warn
-ServerSignature On
-# </basic params>
-
-# if we have mod_status, use it
-<IfModule mod_status.c>
-       #
-       # Allow server status reports generated by mod_status,
-       # with the URL of http://servername/server-status
-       # Uncomment and change the ".example.com" to allow
-       # access from other hosts.
-       #
-       <Location /server-status>
-               SetHandler server-status
-               Require host 127.0.0.1 74.94.156.210
-       </Location>
-</IfModule>
-
-# <redirects/shortenings of URLs>
-Redirect /day http://www.defectivebydesign.org/dayagainstdrm/2019
-Redirect ^/dayagainstdrm/?$ http://www.defectivebydesign.org/dayagainstdrm/2019
-RedirectPermanent /node/9 /join
-RedirectPermanent /feed.xml /rss.xml
-
-# we can't seem to standardize on using underscores or hyphens, so we're going to use both
-# we can probably have apache use regex for this, I'll investigate that next
-# - Eostre, 2020-08-04
-Redirect ^/amazon-kindle-swindle\. /amazon-kindle-swindle
-Redirect ^/amazon_kindle_swindle\. /amazon-kindle-swindle
-Redirect ^/kindle-swindle\. /amazon-kindle-swindle
-Redirect ^/kindle_swindle\. /amazon-kindle-swindle
-
-# Cf. RT #716003. Ward, 2011-11-30
-RedirectPermanent /user/register https://crm.fsf.org/civicrm/profile/create?gid=36&reset=1
-
-# Cf. RT #839159. Ward, 2013-07-09
-RedirectPermanent /what-is-drm http://www.defectivebydesign.org/what_is_drm_digital_restrictions_management
-RedirectPermanent /what_is_drm http://www.defectivebydesign.org/what_is_drm_digital_restrictions_management
-
-#k054 RT #1044876 2015-09-09 
-RedirectPermanent /donate https://my.fsf.org/civicrm/contribute/transact?reset=1&id=40
-RedirectPermanent /no-drm-in-html5 https://my.fsf.org/civicrm/profile/create?gid=183&reset=1
-RedirectPermanent /no-drm-in-html-5 https://my.fsf.org/civicrm/profile/create?gid=183&reset=1
-RedirectPermanent /no_drm_in_html5 https://my.fsf.org/civicrm/profile/create?gid=183&reset=1
-RedirectPermanent /no_drm_in_html_5 https://my.fsf.org/civicrm/profile/create?gid=183&reset=1
-
-# broken links to /en/printable, etc
-# Ward, 2010-01-28
-RewriteRule ^/en/(.*) /$1 [R]
-# </redirects>
-
-# <I think this is for security? idk why we would be messing with / when our webroot is /var/www/html>
-# I'm just an intern, fiddling with code written before I could `echo Hello World`
-# - Eostre, 2020-08-04
-<Directory />
-       Options FollowSymLinks
-       AllowOverride None
-</Directory>
-# </weird stuff>
-
-# <add CGI scripts shipping by our distro>
-ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
-<Directory "/usr/lib/cgi-bin">
-       AllowOverride None
-       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
-       Require all granted
-</Directory>
-# </cgi>
-
-# <allow us to access usr/share/doc over HTTP, but only from localhost, e.g. allow us to use an SSH tunnel to access it>
-Alias /doc/ "/usr/share/doc/"
-<Directory "/usr/share/doc/">
-       Options Indexes MultiViews FollowSymLinks
-       AllowOverride None
-       Require host 127.0.0.0/255.0.0.0 ::1/128
-</Directory>
-# </share/doc fuckery>
-
-# <manage caching: sets the Expires and Cache-Control headers so that clients know when to use their cache vs. when to refetch a resource>
-<FilesMatch "\.(ico|pdf|jpe?g|png|gif|js|css)$">
-       ExpiresActive On
-       ExpiresDefault "access plus 1 month"
-</FilesMatch>
-
-<FilesMatch ".*">
-       ExpiresActive On
-       ExpiresDefault "access plus 5 minutes"
-</FilesMatch>
-# </caching>
diff --git a/drupal-automake-generic/conf/redirect-domains.conf b/drupal-automake-generic/conf/redirect-domains.conf
deleted file mode 100644 (file)
index 7613093..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-### directives for making sure that boycottsony.org, dayagainstdrm.org, and rotten-apple.org redirect to their appropriate pages on DBD
-
-<VirtualHost *:80>
-       ServerName boycottsony.org
-       ServerAlias www.boycottsony.org
-       ### redirect to same domain name, but HTTPS. required for HSTS  
-       RewriteEngine On
-       RewriteCond %{HTTPS} !=on
-       RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
-</VirtualHost>
-
-<VirtualHost *:80>
-       ServerName dayagainstdrm.org
-       ServerAlias www.dayagainstdrm.org
-       ### redirect to same domain name, but HTTPS. required for HSTS  
-       RewriteEngine On
-       RewriteCond %{HTTPS} !=on
-       RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
-</VirtualHost>
-
-<VirtualHost *:80>
-       ServerName rotten-apple.org
-       ServerAlias www.rotten-apple.org
-       ### redirect to same domain name, but HTTPS. required for HSTS  
-       RewriteEngine On
-       RewriteCond %{HTTPS} !=on
-       RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
-</VirtualHost>
-
-<VirtualHost *:443>
-       ServerName boycottsony.org
-       ServerAlias www.boycottsony.org
-       Redirect / https://www.defectivebydesign.org/sony/
-</VirtualHost>
-
-<VirtualHost *:443>
-       ServerName dayagainstdrm.org
-       ServerAlias www.dayagainstdrm.org
-       Header set Access-Control-Allow-Origin "my.fsf.org"
-       RewriteEngine On
-       RewriteRule ^/$ https://defectivebydesign.org/dayagainstdrm
-       RewriteRule ^/2016$ https://www.defectivebydesign.org/dayagainstdrm/2016
-       RewriteRule ^/2017$ https://www.defectivebydesign.org/dayagainstdrm/2017
-       RewriteRule ^/2018$ https://www.defectivebydesign.org/dayagainstdrm/2018
-       RewriteRule ^/2019$ https://www.defectivebydesign.org/dayagainstdrm/2019
-</VirtualHost>
-
-<VirtualHost *:443>
-       ServerName rotten-apple.org
-       ServerAlias www.rotten-apple.org
-       Redirect / https://www.fsf.org/campaigns/apple-patents
-</VirtualHost>
diff --git a/drupal-automake-generic/files/RELEASE b/drupal-automake-generic/files/RELEASE
deleted file mode 100644 (file)
index e69de29..0000000
index 350650db2b21dc903deeefde85285fdec77adb1b..ee2e4815a7b31a0f403cc3f7366f460d60d0c4eb 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/bash -xe
 #!/bin/bash -xe
+. conf/conf
 
 
-DRUPAL_DB_PASSWORD="H0z7WC8Xq8yRE"
+DRUPAL_DB_PASSWORD="${DRUPAL_DB_PASSWORD:-password}"
 
 # install the mysql server
 apt install -y mariadb-server ||:
 
 # install the mysql server
 apt install -y mariadb-server ||:
@@ -12,8 +13,8 @@ apt install -y mariadb-server ||:
 mysql_secure_installation < /sqldefaults
 
 # add the drupal db
 mysql_secure_installation < /sqldefaults
 
 # add the drupal db
-mysql -u root -p -e 'CREATE DATABASE dbd_drupal CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;'
-mysql -u root -p -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON dbd_drupal.* TO 'w_dbd'@'localhost' IDENTIFIED BY '$DRUPAL_DB_PASSWORD';"
+mysql -u root -e "CREATE DATABASE $DRUPAL_DB_NAME CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
+mysql -u root -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON $DRUPAL_DB_NAME.* TO '$DRUPAL_DB_USER'@'localhost' IDENTIFIED BY '$DRUPAL_DB_PASSWORD';"
 
 ## and have drupal do the site-install
 #cd /var/www/html
 
 ## and have drupal do the site-install
 #cd /var/www/html
index 0aa585a2b8980701a0b5207e03e3a2e27aab1a07..6029239a9b0fcd347139976b50a9bb0cfc4ae7c0 100644 (file)
@@ -1,4 +1,5 @@
 #!/bin/bash -xe
 #!/bin/bash -xe
+. conf/conf
 
 # install composer if it's not already installed
 which composer || (\
 
 # install composer if it's not already installed
 which composer || (\
@@ -12,6 +13,7 @@ which composer || (\
 cd /var/www
 composer require drush/drush:8.*
 # ^^ PLEASE note that we're installing DRUSH 8, not Drupal 8. drush8 works fine with drupal7
 cd /var/www
 composer require drush/drush:8.*
 # ^^ PLEASE note that we're installing DRUSH 8, not Drupal 8. drush8 works fine with drupal7
+
 ## actually don't install the drush launcher because it doesn't work with the latest release of drupal7
 #wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar
 #chmod +x drush.phar
 ## actually don't install the drush launcher because it doesn't work with the latest release of drupal7
 #wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar
 #chmod +x drush.phar
index beea2f93bdc70826bf4648f408dbfc5e76690061..da5ef1ed1875859cbaf8299e8e427fe88ac60218 100644 (file)
@@ -2,11 +2,6 @@
 
 apt update -y && apt upgrade -y
 
 
 apt update -y && apt upgrade -y
 
-# actually don't because it seems we don't need it. yet
-## add the php5 repo
-#add-apt-repository -y ppa:ondrej/php
-#apt update -y && apt upgrade -y
-
 for PKG in $(cat /pkgs); do
         apt install -y $PKG ||: # never fail to install a package, because some packages' postinstall hooks fail when /dev /proc /run etc aren't mounted
 done
 for PKG in $(cat /pkgs); do
         apt install -y $PKG ||: # never fail to install a package, because some packages' postinstall hooks fail when /dev /proc /run etc aren't mounted
 done