diff options
Diffstat (limited to 'usr')
-rw-r--r-- | usr/share/mirror/docs/README.txt | 7 | ||||
-rw-r--r-- | usr/share/mirror/docs/mirror.spec | 36 | ||||
-rw-r--r-- | usr/share/mirror/examples/sites/10.1.8.63.conf | 5 | ||||
-rw-r--r-- | usr/share/mirror/examples/sites/mirror.conf | 65 | ||||
-rw-r--r-- | usr/share/mirror/examples/sites/mntscripts.conf | 24 | ||||
-rw-r--r-- | usr/share/mirror/examples/sites/zz_proxy.conf | 41 | ||||
-rwxr-xr-x | usr/share/mirror/inc/localize_git.sh | 2 | ||||
-rwxr-xr-x | usr/share/mirror/inc/pack | 4 | ||||
-rw-r--r-- | usr/share/mirror/inc/scrub.txt | 2 |
9 files changed, 163 insertions, 23 deletions
diff --git a/usr/share/mirror/docs/README.txt b/usr/share/mirror/docs/README.txt index cb768fe..ef5ddbf 100644 --- a/usr/share/mirror/docs/README.txt +++ b/usr/share/mirror/docs/README.txt @@ -1,5 +1,5 @@ File: etc/mirror/README.txt -Package: mirror 1.0-7 +Package: mirror 1.0-8 Author: bgstack15@gmail.com Startdate: 2016-06-08 Title: Readme file for mirror @@ -90,3 +90,8 @@ Updated all scripts for the bgscripts-1.1-28 directory migration to /usr/share/b Rearranged directory structure to comply with FHS 3.0 Included a zz_proxy.conf example Added deploy.sh --noupdate option + +2017-02-07 mirror-1.0-8 +Fixed mirror.conf to point to correct directory of /usr/share/mirror/scripts +Added contents of /usr/share/mirror/scripts as %config directives in ./pack spec instructions +Moved httpd/sites contents to /usr/share/mirror/examples/sites so it will not overwrite any existing files. These are just examples and should be deployed manually. diff --git a/usr/share/mirror/docs/mirror.spec b/usr/share/mirror/docs/mirror.spec index 69c3163..66cb578 100644 --- a/usr/share/mirror/docs/mirror.spec +++ b/usr/share/mirror/docs/mirror.spec @@ -1,7 +1,7 @@ Summary: Mirror Name: mirror Version: 1.0 -Release: 7 +Release: 8 License: CC BY-SA 4.0 Group: Applications/System Source: mirror.tgz @@ -38,26 +38,22 @@ rm -rf ${buildroot} %config /etc/cron.d/mirror.cron %config /etc/mirror/deploy.conf %config /etc/mirror/mirror.conf -%config /etc/httpd/sites/zz_proxy.conf -%config /etc/httpd/sites/10.1.8.63.conf -%config /etc/httpd/sites/mntscripts.conf -%config /etc/httpd/sites/mirror.conf %config /etc/httpd/conf.d/local_mirror.conf %verify(link) /usr/local/bin/deploy /usr/share/mirror/mirror-master.sh -/usr/share/mirror/scripts/ssh -/usr/share/mirror/scripts/libreoffice -/usr/share/mirror/scripts/linuxmint-repos -/usr/share/mirror/scripts/ubuntu -/usr/share/mirror/scripts/putty -/usr/share/mirror/scripts/rsyslog -/usr/share/mirror/scripts/centos -/usr/share/mirror/scripts/fedora-epel -/usr/share/mirror/scripts/old-scripts.tgz -/usr/share/mirror/scripts/ubuntu-releases -/usr/share/mirror/scripts/linuxmint-isos -/usr/share/mirror/scripts/fedora-releases -/usr/share/mirror/scripts/fedora-updates +%config /usr/share/mirror/scripts/ssh +%config /usr/share/mirror/scripts/libreoffice +%config /usr/share/mirror/scripts/linuxmint-repos +%config /usr/share/mirror/scripts/ubuntu +%config /usr/share/mirror/scripts/putty +%config /usr/share/mirror/scripts/rsyslog +%config /usr/share/mirror/scripts/centos +%config /usr/share/mirror/scripts/fedora-epel +%config /usr/share/mirror/scripts/old-scripts.tgz +%config /usr/share/mirror/scripts/ubuntu-releases +%config /usr/share/mirror/scripts/linuxmint-isos +%config /usr/share/mirror/scripts/fedora-releases +%config /usr/share/mirror/scripts/fedora-updates /usr/share/mirror/docs/debian/postinst /usr/share/mirror/docs/debian/conffiles /usr/share/mirror/docs/debian/prerm @@ -76,6 +72,10 @@ rm -rf ${buildroot} /usr/share/mirror/examples/favicon.ico /usr/share/mirror/examples/FOOTER.html /usr/share/mirror/examples/HEADER.html +%config /usr/share/mirror/examples/sites/zz_proxy.conf +%config /usr/share/mirror/examples/sites/10.1.8.63.conf +%config /usr/share/mirror/examples/sites/mntscripts.conf +%config /usr/share/mirror/examples/sites/mirror.conf /usr/share/mirror/examples/example-debian/example-debian.list /usr/share/mirror/examples/example-debian/update-example-debian.sh /usr/share/mirror/examples/example-debian/FOOTER.html diff --git a/usr/share/mirror/examples/sites/10.1.8.63.conf b/usr/share/mirror/examples/sites/10.1.8.63.conf new file mode 100644 index 0000000..7afda1b --- /dev/null +++ b/usr/share/mirror/examples/sites/10.1.8.63.conf @@ -0,0 +1,5 @@ +# File: /etc/httpd/sites/{ipaddress}.conf +# Package: mirror +# Purpose: A template for the mirror apache listeners. This is probably redundant, but in case it's needed, fix the IP address here and in the filename. +Listen 10.1.8.63:80 +Listen 10.1.8.63:443 diff --git a/usr/share/mirror/examples/sites/mirror.conf b/usr/share/mirror/examples/sites/mirror.conf new file mode 100644 index 0000000..5f2e761 --- /dev/null +++ b/usr/share/mirror/examples/sites/mirror.conf @@ -0,0 +1,65 @@ +# File: /etc/httpd/sites/mirror.conf +# Package: mirror +# Title: Apache mirror config +# Purpose: To provide a standard mirror http and https site +# Reference: +# Instructions: +# you can make a simple IP listener conf with the following +# thisip=$( ifconfig 2>/dev/null | awk '/Bcast|broadcast/{print $2}' | tr -cd '[^0-9\.\n]' | head -n1) +# printf "Listen %s\nListen %s" "${thisip}:80" "${thisip}:443" > /etc/httpd/sites/${thisip}.conf +# Be sure to fix the IP addresses here for the virtual hosts. +# Also ensure /etc/hosts has the right hostnames configured for the ssl vhost below +# Document: Below this line + +<VirtualHost 10.1.8.63:80> + + ServerName mirror.example.com:80 + ServerAlias mirror brass mirror-brass mirrorbrass brassmirror *.mirror.example.com brass.example.com + # this server also provides bgscripts.repo at http://mirror.example.com/bgscripts which is /var/www/html/mirror.example.com/bgscripts + + DocumentRoot "/var/www/html/mirror.example.com" + + Alias /mirror /mnt/mirror + + # Index options + Options +Indexes + IndexOptions IgnoreCase FancyIndexing FoldersFirst NameWidth=* DescriptionWidth=* SuppressHTMLPreamble + IndexIgnore FOOTER.html repodata tivoli *.so bgscripts + ReadmeName FOOTER.html + + # Useful additions for the mirror + AddIcon /icons/rpm.png .rpm + AddIcon /icons/repo.png .repo + AddType application/octet-stream .iso + + <Directory "/var/www/html/mirror.example.com"> + AllowOverride None + Order allow,deny + Allow from all + Options Indexes FollowSymLinks + </Directory> + + # Allows "centos.mirror.example.com" redirection to "mirror.example.com/centos" behavior + RewriteEngine On + RewriteCond %{HTTP_HOST} ^([^.]*)\.mirror\.example\.com$ + RewriteRule /(.*) http://mirror.example.com/%1/$1 [R,L] + +</VirtualHost> + +<VirtualHost 10.1.8.63:443> + SSLEngine on + SSLProtocol all -SSLv2 -SSLv3 + SSLHonorCipherOrder on + SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS" + SSLCertificateFile /etc/pki/tls/certs/wildcard.crt + SSLCertificateKeyFile /etc/pki/tls/private/wildcard.key + SSLCACertificateFile /etc/pki/tls/certs/rapidssl.crt + + LogLevel warn + # Reverse proxy all ssl traffic to the nonencrypted site. This is a template for any and all sites. + # Observe that this depends on /etc/hosts or DNS to look up the variable SERVER_NAME + SSLProxyEngine On + RewriteEngine On + RewriteRule ^/(.*)$ http://%{SERVER_NAME}/$1 [P,L] + +</VirtualHost> diff --git a/usr/share/mirror/examples/sites/mntscripts.conf b/usr/share/mirror/examples/sites/mntscripts.conf new file mode 100644 index 0000000..31cdc6b --- /dev/null +++ b/usr/share/mirror/examples/sites/mntscripts.conf @@ -0,0 +1,24 @@ +<VirtualHost 10.1.8.63:80> + + ServerName mntscripts.example.com:80 + ServerAlias mntscripts scripts scripts.example.com + + DocumentRoot "/var/www/html/mntscripts.example.com" + + AddType application/octet-stream .iso + + #Alias /mirror /mnt/mirror + + Options +Indexes + IndexOptions FancyIndexing NameWidth=* DescriptionWidth=* + IndexIgnore FOOTER.html repodata + ReadmeName FOOTER.html + + <Directory "/var/www/html/mntscripts.example.com"> + AllowOverride None + Order allow,deny + Allow from all + Options Indexes FollowSymLinks + </Directory> + +</VirtualHost> diff --git a/usr/share/mirror/examples/sites/zz_proxy.conf b/usr/share/mirror/examples/sites/zz_proxy.conf new file mode 100644 index 0000000..c6221de --- /dev/null +++ b/usr/share/mirror/examples/sites/zz_proxy.conf @@ -0,0 +1,41 @@ +# File: /etc/httpd/sites/zz_proxy.conf +<Proxy *> + Order deny,allow + Deny from all + # Allow each host or range as desired. + + Allow from 203.0.193.232/255.255.255.255 + Allow from 10.1.9.194/32 + # Whole Linux dev subnet + Allow from 10.1.9.0/24 + # Whole IT-192 network in vmware so I do not have to keep doing this + Allow from 203.0.192.0/23 + # onyx for webtatic + Allow from 10.1.9.121/32 + # company-owned wireless devices subnets + Allow from 10.48.0.0/16 + # personally-owned wireless devices + Allow from 10.21.0.0/16 + +</Proxy> + +Listen 10.1.8.63:8090 +<VirtualHost 10.1.8.63:8080> + + ServerName junk.example.com:8080 + ServerAlias * + + DocumentRoot /var/www/html/notfound + + RewriteEngine On + ProxyRequests On + RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} + ProxyPass / http://%{HTTP_HOST}%{REQUEST_URI} + + # if this apache server is behind a proxy: + #ProxyRemote * http://proxy.example.com:8080/ + + CustomLog "logs/proxy_log" combinedvhost env=!dontlog + ErrorLog "logs/proxy_error_log" + +</VirtualHost> diff --git a/usr/share/mirror/inc/localize_git.sh b/usr/share/mirror/inc/localize_git.sh index e386977..6ac5525 100755 --- a/usr/share/mirror/inc/localize_git.sh +++ b/usr/share/mirror/inc/localize_git.sh @@ -1,2 +1,2 @@ #!/bin/sh -\cp -pRf /home/work/mirror.clean/.git /home/bgstack15/rpmbuild/SOURCES/mirror-1.0-7/ +\cp -pRf /home/work/mirror.clean/.git /home/bgstack15/rpmbuild/SOURCES/mirror-1.0-8/ diff --git a/usr/share/mirror/inc/pack b/usr/share/mirror/inc/pack index 0fe61de..fb17d85 100755 --- a/usr/share/mirror/inc/pack +++ b/usr/share/mirror/inc/pack @@ -19,7 +19,7 @@ esac echo " $@ " | grep -qiE -- "help|usage|\s-h\s|\s-\?" 1>/dev/null 2>&1 && { # display help and exit less -F <<EOF -pack utility version 2017-02-06a-mirror +pack utility version 2017-02-07a-mirror usage: pack [ rpm | deb | tar | scrub ] [ --debug | -d {0-10} ] Provides a single command for building a package. This script is customized to each package. optional arguments: @@ -54,7 +54,7 @@ rpmbuilddir=~/rpmbuild/ packagespecfile="${package}-${version}/usr/share/${package}/docs/${package}.spec" sed -i -n '1,/^\%files$/p;' "${rpmbuilddir}/SOURCES/${packagespecfile}" cd "${rpmbuilddir}/SOURCES/${package}-${version}" -find * ! -type d ! -regex '.*?.swp' ! -regex '.*?DEBIAN.*?' | sed -e 's/^/\//;' -e 's/\(.*\.txt\)/%doc %attr(444, -, -) \1/;' -e 's/\(.*\.\(conf\|cron\)\|.*sudoers\.d\)/%config \1/;' -e 's/\(.*bin.*\)/%verify(link) \1/;' -e 's/\(.*\)\.py$/\1\.py\n\1\.pyc\n\1\.pyo/;' >> "${rpmbuilddir}/SOURCES/${packagespecfile}" +find * ! -type d ! -regex '.*?.swp' ! -regex '.*?DEBIAN.*?' | sed -e 's/^/\//;' -e 's/\(.*\.txt\)/%doc %attr(444, -, -) \1/;' -e 's/\(.*\.\(conf\|cron\)\|.*sudoers\.d\|\/usr\/share\/mirror\/scripts\/.\+\)/%config \1/;' -e 's/\(.*bin.*\)/%verify(link) \1/;' -e 's/\(.*\)\.py$/\1\.py\n\1\.pyc\n\1\.pyo/;' >> "${rpmbuilddir}/SOURCES/${packagespecfile}" rm -rf "${rpmbuilddir}/SOURCES/${package}-${shortversion}" cp -prf "${rpmbuilddir}/SOURCES/${package}-${version}" "${rpmbuilddir}/SOURCES/${package}-${shortversion}" rm -rf "${rpmbuilddir}/SOURCES/${package}-${shortversion}/DEBIAN" diff --git a/usr/share/mirror/inc/scrub.txt b/usr/share/mirror/inc/scrub.txt index f7d5b53..caee809 100644 --- a/usr/share/mirror/inc/scrub.txt +++ b/usr/share/mirror/inc/scrub.txt @@ -1,5 +1,5 @@ # for scrubpy version 2016-11-16a or newer -source /home/bgstack15/rpmbuild/SOURCES/mirror-1.0-7 +source /home/bgstack15/rpmbuild/SOURCES/mirror-1.0-8 target /home/work/mirror.clean ignore "tgz png gif jpg pyc pyo git swp ico" # rest of the lines are "OLD WORD" "NEW WORD" |