From f0d2c229ca2f1e80b7021eb4c43a44553d5185f1 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Jan 16 2026 20:29:09 +0000 Subject: Drop all the old historical git stuff and update README.md All this content is from before we had a public ansible repo so we needed a place to put things we wanted to be public. So, drop all that before we migrate to forge and also update the README.md so it's set for the forge. Signed-off-by: Kevin Fenzi --- diff --git a/README.rst b/README.rst index 5d9c05f..eadb5ab 100644 --- a/README.rst +++ b/README.rst @@ -1,16 +1,18 @@ Fedora Infrastructure ===================== -Welcome! This is the Fedora Infrastructure Pagure project. +Welcome! This is the Fedora Infrastructure project. This project is mainly used as ticket tracker for Fedora Infrastructure. If you want to know how the tickets are processed by Fedora Infrastructure Team look at: -https://docs.fedoraproject.org/en-US/infra/sysadmin_guide/tickets/ +https://docs.fedoraproject.org/en-US/infra/day_to_day_fedora/ -Git repo of this project is misc scripts and tools for Fedora +The git repo of this project used to contain some scripts and content +from before our ansible repo was public. The content is still +in git history for historical needs. If you are looking for the Fedora Infrastructure ansible repo, that is not here, look at: @@ -24,46 +26,20 @@ https://fedoraproject.org/wiki/Infrastructure/GettingStarted and https://fedoraproject.org/wiki/Infrastructure_Apprentice -For more info how to communicate with Fedora Infra Team, see: +Incoming Tickets are triaged daily monday through thursday on matrix. -https://docs.fedoraproject.org/en-US/cpe/day_to_day_fedora/ +Triaged tickets will have appropriate labels set from +https://forge.fedoraproject.org/org/infra/settings/labels +At least: -Ticket priorities explained ---------------------------- +* points: 01, 03, 05, 08, 13 +* priority: high, medium, low -The tickets in Fedora Infrastructure have Priority field which on this project -isn't used for priority and instead it's used for ticket workflow. Following -is the description of each priority: +Larger Tickets are then planned into a 2 week sprint available at: +https://forge.fedoraproject.org/infra/tickets/projects +There will always be a current sprint and a next sprint, +with older ones closed. -* URGENT - - This means that this ticket defines fire (something critical doesn't work) and - should be resolved ASAP. - -* Needs Review - - Default priority assigned to new ticket. This means that ticket is waiting for - review from Fedora Infrastructure Team. - - .. note:: We sometimes forgot to change the priority from default state. - -* Next meeting - - Ticket will be discussed on next meeting. - -* Waiting on Assignee - - Ticket is waiting on somebody to take it. If somebody is already assigned than - ticket is waiting for the assignee to finish the work. - -* Waiting on Reporter - - Ticket is waiting for reply from reporter. This is used to clarify some information - about the ticket or validation from reporter. - -* Waiting on External - - Ticket is waiting for work that needs to be done outside Fedora Infrastructure - team and which the team usually couldn't influence. For example waiting for - hardware replacement. +Smaller day to day tickets will have the 'day-to-day' label applied +and added to the current sprint backlog. diff --git a/plugins/wordpress-plugin-fasauth/fasauth.php b/plugins/wordpress-plugin-fasauth/fasauth.php deleted file mode 100644 index f9ba934..0000000 --- a/plugins/wordpress-plugin-fasauth/fasauth.php +++ /dev/null @@ -1,164 +0,0 @@ -Error: You do not meet minimum requirements to login.')); - } - - // let's check wp db for user - $user = get_userdatabylogin($username); - - // user not found, let's create db entry for it - if ( !$user || ($user->user_login != $username) ) { - $user_id = create_wp_user($username); - if (!$user_id) { - return new WP_Error('fasauth_create_wp_user', __('Error: Unable to create account. Please contact the webmaster.')); - } - - error_log("FAS auth succeeded for $username", 0); - return new WP_User($user_id); - } - - // all good, let go on - error_log("FAS auth succeeded for $username", 0); - return new WP_User($user->ID); - - } else { - if ($_POST == null) { - //Just visited the page, this stops the weird login thing. Not the best way around it, would be nice to find out why it is doing it, but this works. - return new WP_Error(); //wp_authenticate must return WP_User or WP_Error, so WP_Error is our option, with no values returns nothing. - } elseif ($username == null || $password == null) { - //they forgot about, you know, the forms, and stuff. - return new WP_Error('fasauth_wrong_credentials', __('Error: Did you fill out the form?')); - } else { - error_log("FAS auth failed for $username: incorrect username or password", 0); - return new WP_Error('fasauth_wrong_credentials', __('Error: FAS login unsuccessful.')); - } - } - } - - /* - * Creates user in wp db - */ - function create_wp_user($username) { - - $config = fasauth_config(); - - $password = ''; - require_once(WPINC . DIRECTORY_SEPARATOR . 'registration.php'); - return wp_create_user($username, $password, $username.'@'.$config['fas_email_domain']); - } - - /* - * Used to disable certain login functions, e.g. retrieving a - * user's password. - */ - function disable_function() { - die('Feature disabled.'); - } - - /* - * Used to redirect all lost password request to FAS. - */ - function fas_password_redirect() { - $config = fasauth_config(); - wp_redirect($config['fas_pass_reset_url'], 302); - } - - - /* - * checks minimum login requirements - */ - function check_login_requirement($user) { - - $groups = $user["person"]["approved_memberships"]; - //echo "Group: ". print_r($groups); - - // checking other group memberships - $match = 0; - $in_cla_done = false; - for ($i = 0, $cnt = count($groups); $i < $cnt; $i++) { - // user must be in cla - if ($groups[$i]["name"] == "cla_done") { - $in_cla_done = true; - } - - // keep count of anything non-cla - if (!preg_match('/^cla_/', $groups[$i]["name"])) { - $match++; - } - } - - // yay! more than in 1 non-cla group - if ($match > 0 && $in_cla_done) { - return true; - } - - // requirements not met - return false; - } - -} - -?> diff --git a/scripts/Auth_FAS_MediaWiki/Auth_FAS.php b/scripts/Auth_FAS_MediaWiki/Auth_FAS.php deleted file mode 100644 index ce5b4a8..0000000 --- a/scripts/Auth_FAS_MediaWiki/Auth_FAS.php +++ /dev/null @@ -1,176 +0,0 @@ -fas_username = $user; - } - - function getFasUsername() { - return $this->fas_username; - } - - function authenticate(&$username, $password) { - - if ( ucfirst(strtolower($username)) != ucfirst($username) ) { - return false; - } - - $username = strtolower($username); - $ch = curl_init(); - - curl_setopt($ch, CURLOPT_URL, 'https://admin.fedoraproject.org/accounts/home'); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_USERAGENT, "Mediawiki FAS Auth 0.9.2"); - curl_setopt($ch, CURLOPT_POSTFIELDS, "user_name=".urlencode($username)."&password=".urlencode($password)."&login=Login"); - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json')); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - - # WARNING: Never enable this line when running in production, as it will - # cause plaintext passwords to show up in error logs. - #curl_setopt($ch, CURLOPT_VERBOSE, TRUE); - - # The following two lines need to be uncommented when using a test FAS - # with an invalid cert. Otherwise they should be commented out (or set - # to TRUE) for security. - #curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); - #curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); - - $response = json_decode(curl_exec($ch), true); - curl_close ($ch); - - if (!isset($response['person']['id'])) { - error_log("FAS auth failed for $username: incorrect username or password", 0); - return false; - } - - $groups = $response['memberships']; - // let's make sure the username is consistent - $this->setFasUsername(ucfirst(strtolower($response['person']['username']))); - $username = $this->getFasUsername(); - - for ($i = 0, $cnt = count($groups); $i < $cnt; $i++) { - if ($groups[$i]["name"] == 'cla_done' && $response['person']['status'] == 'active') { - error_log("FAS auth succeeded for $username", 0); - return true; - } - } - error_log("FAS auth failed for $username: insufficient group membership", 0); - return false; - } - - function userExists( $username ) { - error_log("FAS [userExists]: $username, " . $this->getFasUsername(), 0); - - if (ucfirst(strtolower($username)) != $this->getFasUsername()) { - error_log("FAS [userExists]: returned false", 0); - return false; - } - error_log("FAS [userExists]: returned true", 0); - return true; - } - - function modifyUITemplate(&$template) { - error_log("FAS [modifyUITemplate]: " . $this->getFasUsername(), 0); - $template->set('create', false); - $template->set('useemail', false); - $template->set('usedomain', false); - } - - function updateUser( &$user ){ - //error_log("FAS [updateUser]: " . $user->getName() . ", " . $this->getFasUsername(), 0); - $user->setName($this->getFasUsername()); - $user->mEmail = strtolower($user->getName())."@fedoraproject.org"; - //error_log("FAS [updateUser]: " . $user->getName() . ", " . $this->getFasUsername(), 0); - return true; - } - - function autoCreate() { - //error_log("FAS [autoCreate]: ", 0); - return true; - } - - function setPassword($password) { - //error_log("FAS [setPassword]: $password", 0); - return false; - } - - function setDomain( $domain ) { - //error_log("FAS [setDomain]: $domain", 0); - $this->domain = $domain; - } - - function validDomain( $domain ) { - //error_log("FAS [validDomain]: $domain", 0); - return true; - } - - function updateExternalDB($user) { - //error_log("FAS [updateExternalDB]: $user", 0); - return true; - } - - function canCreateAccounts() { - //error_log("FAS [canCreateAccounts]:", 0); - return false; - } - - function addUser($user, $password) { - //error_log("FAS [addUser]: $user, $password", 0); - return true; - } - - function strict() { - //error_log("FAS [strict]:", 0); - return true; - } - - function strictUserAuth( $username ) { - //error_log("FAS [strictUserAuth]: $username", 0); - return true; - } - - function allowPasswordChange() { - //error_log("FAS [allowPasswordChange]:" . $this->getFasUsername(), 0); - return false; - } - - function getCanonicalName( $username ) { - //error_log("FAS [getCanonicalName]: " . $username, 0); - - $username = str_replace('@fedoraproject.org', '', $username); - - //error_log("FAS [getCanonicalName]: returning... " . $username, 0); - return $username; - } - - function getUserInstance( &$user ) { - //error_log("FAS [getUserInstance]: " . print_r($user), 0); - return new AuthPluginUser( $user ); - } - - function initUser(&$user) { - //error_log("FAS [initUser]: " . $user->getName() . ", " . $this->getFasUsername(), 0); - $user->setName($this->getFasUsername()); - $user->mEmail = strtolower($user->getName())."@fedoraproject.org"; - $user->mEmailAuthenticated = wfTimestampNow(); - $user->setToken(); - $user->saveSettings(); - //error_log("FAS [initUser]: " . $user->getName() . ", " . $this->getFasUsername(), 0); - return true; - } -} - -/** - * Some extension information init - */ -$wgExtensionCredits['other'][] = array( - 'name' => 'Auth_FAS', - 'version' => '0.9.2', - 'author' => 'Nigel Jones', - 'description' => 'Authorisation plugin allowing login with FAS2 accounts' -); - -?> diff --git a/scripts/README b/scripts/README deleted file mode 100644 index dd6531a..0000000 --- a/scripts/README +++ /dev/null @@ -1,2 +0,0 @@ -This readme doesn't seem to have much in it. - diff --git a/scripts/backup-scripts/README b/scripts/backup-scripts/README deleted file mode 100644 index 47f73c2..0000000 --- a/scripts/backup-scripts/README +++ /dev/null @@ -1,4 +0,0 @@ -save-mysql: requires initial editing of the script. Please enter a valid - password for whoever can backup the information. Please note, - excessive usage of the script with failed attempts will lock you - out of mysql. diff --git a/scripts/backup-scripts/save-mysql b/scripts/backup-scripts/save-mysql deleted file mode 100755 index 4d178fb..0000000 Binary files a/scripts/backup-scripts/save-mysql and /dev/null differ diff --git a/scripts/cdp-sniff/sniff.sh b/scripts/cdp-sniff/sniff.sh deleted file mode 100755 index 8876087..0000000 --- a/scripts/cdp-sniff/sniff.sh +++ /dev/null @@ -1,2 +0,0 @@ -tcpdump -nn -v -i eth0 -s 1500 -c 1 'ether[20:2] == 0x2000' - diff --git a/scripts/checkBuilderCheckin/checkBuilderCheckin.py b/scripts/checkBuilderCheckin/checkBuilderCheckin.py deleted file mode 100755 index 0740645..0000000 --- a/scripts/checkBuilderCheckin/checkBuilderCheckin.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/python - -import urllib -import koji -import socket -import datetime -import time - -FIVE_MIN = 300 -FIFTEEN_MIN = 900 - -k = koji.ClientSession('https://koji.fedoraproject.org/kojihub', {}) -hosts = k.listHosts() - -me = socket.gethostname() -me = 'ppc3' -#k.getLastHostUpdate -for host in hosts: - if host['name'].startswith(me): - t = k.getLastHostUpdate(host['id']) - dt = time.strptime(t.split('.')[0], "%Y-%m-%d %H:%M:%S") - - print time.time() - time.mktime(dt) - - if host['ready'] == False and host['task_load'] >= host['capacity']: - print "restarting" - diff --git a/scripts/checkMirrors/README b/scripts/checkMirrors/README deleted file mode 100644 index 77d3782..0000000 --- a/scripts/checkMirrors/README +++ /dev/null @@ -1,4 +0,0 @@ -Mirror checking script by davivercillo -====================================== -Currently only checks the mirrors returned in the mirrorlist, perhaps add a -&country=global to try and get all mirrors back. diff --git a/scripts/checkMirrors/checkMirrors.py b/scripts/checkMirrors/checkMirrors.py deleted file mode 100644 index 117572d..0000000 --- a/scripts/checkMirrors/checkMirrors.py +++ /dev/null @@ -1,136 +0,0 @@ -#! /usr/bin/env python -# coding: utf-8 -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -__AUTHOR__ = "Davi Vercillo C. Garcia (davivercillo@gmail.com)" -__VERSION__ = "0.2" -__DATE__ = "21/07/2009" - -import sys -import urllib2 -from signal import signal, SIG_DFL - -class CheckMirrors: - """Class that check repodata on the mirrors. - """ - def __init__(self, directory, version, architecture): - """Class constructor. - directory -> (String) Ex: updates - version -> : (String) Ex: 11 - architecture -> (String) Ex: x86_64 - """ - if type(directory) != str or type(version) != str or type(architecture) != str: - raise TypeError, "Parameters need to be strings." - self.mirror_list_url = "http://mirrors.fedoraproject.org/mirrorlist?path=/pub/fedora/linux/%s/%s/%s/repodata&country=global" - self.main_mirror = "http://download.fedora.redhat.com/pub/fedora/linux/%s/%s/%s/repodata/" - print self.main_mirror - self.xml_filename = "repomd.xml" - self.directory = directory - self.version = version - self.architecture = architecture - self.number_total_mirrors = 0 - self.good_mirrors = [[], 0] - self.bad_mirrors = [[], 0] - self.error_mirrors = [[], 0] - - def get_mirror_list(self): - """Method that connect on fedoraproject.org, get the mirror list and the repomd.xml. - """ - temp = self.mirror_list_url % (self.directory, self.version, self.architecture) - try: - self.mirrors = [ url - for url in urllib2.urlopen(temp).read().split("\n") - if url != "" and not "#" in url ] - except Exception, error: - print "[ERROR] Failed to get mirror list:", error - sys.exit(-1) - temp = self.main_mirror % (self.directory, self.version, self.architecture) - try: - print temp + self.xml_filename - self.repodata = urllib2.urlopen(temp + self.xml_filename).read() - except Exception, error: - print "[ERROR] Failed to get XML repodata file:", error - sys.exit(-1) - self.number_total_mirrors = len(self.mirrors) - if self.number_total_mirrors == 0: - print "[ERROR] Did you specify the right options ?" - sys.exit(-1) - - def check_mirrors(self): - """Method that verify, for each mirror, if its repomd.xml is equal of that on main. - """ - print "\nChecking the repositories repodata !\n\nUsing:", self.main_mirror % (self.directory, self.version, self.architecture) - for url in self.mirrors: - print "\rTesting: %d/%d" % (self.good_mirrors[1] , self.number_total_mirrors), - sys.stdout.flush() - try: - if urllib2.urlopen(url + self.xml_filename, timeout=10).read() == self.repodata: - self.good_mirrors[0].append(url) - self.good_mirrors[1] += 1 - else: - self.bad_mirrors[0].append(url) - self.bad_mirrors[1] += 1 - except Exception, error: - self.error_mirrors[0].append(url + "\n[" + str(error) + "]") - self.error_mirrors[1] += 1 - - def print_results(self): - """Method that put the results on STDOUT. - """ - print """\n -=============== Valid Mirror Results ======================== -\tGood\tBad\tError\tTotal\tPerc.Good -\t%4d\t%3d\t%5d\t%5d\t%7.2f%% -============================================================= - -[Good Repositories] -%s - -[Bad Repositories] -%s - -[Errors] -%s -""" % (self.good_mirrors[1], - self.bad_mirrors[1], - self.error_mirrors[1], - self.number_total_mirrors, - float(self.good_mirrors[1])*100/self.number_total_mirrors, - "\n".join(self.good_mirrors[0]), - "\n".join(self.bad_mirrors[0]), - "\n".join(self.error_mirrors[0]),) - - def run(self): - """Method that execute all method in the right order. - """ - self.get_mirror_list() - self.check_mirrors() - self.print_results() - - -if __name__ == "__main__": - """Main Function. - If the programs was called as a script, this will be executed. - """ - signal(2, SIG_DFL) - if len(sys.argv) == 4: - CheckMirrors(sys.argv[1], sys.argv[2], sys.argv[3], ).run() - sys.exit(0) - else: - print "[ERROR] Use: ./mirror_checker.py " - sys.exit(-1) - diff --git a/scripts/checkSnapStatus/checkSnapStatus.sh b/scripts/checkSnapStatus/checkSnapStatus.sh deleted file mode 100755 index 3e64062..0000000 --- a/scripts/checkSnapStatus/checkSnapStatus.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -NETAPPMIB='/home/fedora/mmcgrath/netapp.mib' -COMMUNITY='public' -HOST='ntap-fedora1' - -function get { - snmpget -v 1 -Ov -m $NETAPPMIB -c $COMMUNITY $HOST $1 | awk -F": " '{ print $2 }' -} - -echo "PHX" -echo -n " Status: " -get .1.3.6.1.4.1.789.1.9.20.1.4.1 -echo -n " Lag: " -get .1.3.6.1.4.1.789.1.9.20.1.6.1 -echo -n " Mirror Timestamp: " -get .1.3.6.1.4.1.789.1.9.20.1.14.1 -echo -n " Last Transfer Size (MB): " -get .1.3.6.1.4.1.789.1.9.20.1.17.1 -echo -n " Last Transfer Time (seconds): " -get .1.3.6.1.4.1.789.1.9.20.1.18.1 - -echo "TPA" -echo -n " Status: " -get .1.3.6.1.4.1.789.1.9.20.1.4.2 -echo -n " Lag: " -get .1.3.6.1.4.1.789.1.9.20.1.6.2 -echo -n " Mirror Timestamp: " -get .1.3.6.1.4.1.789.1.9.20.1.14.2 -echo -n " Last Transfer Size (MB): " -get .1.3.6.1.4.1.789.1.9.20.1.17.2 -echo -n " Last Transfer Time (seconds): " -get .1.3.6.1.4.1.789.1.9.20.1.18.2 - - diff --git a/scripts/createReleases/createReleases.py b/scripts/createReleases/createReleases.py deleted file mode 100644 index 9594ead..0000000 --- a/scripts/createReleases/createReleases.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/python - -import os -import commands - -dirs = ['/git/', - '/hg/', - '/svn/', - '/bzr/', - '/mtn/',] - -for dir in dirs: - projects = os.listdir(dir) - for project in projects: - # strip off the .git - firstLetter = project[0] - secondLetter = project[1] - path = "%s%s" % (dir, project) - releaseName = project.replace('.git', '') - release = "/srv/web/releases/%s/%s/%s" % (firstLetter, secondLetter, releaseName) - if not os.path.islink(path): - stat = os.lstat(path) - if not os.path.isdir(release): - os.makedirs(release) - if os.lstat(release).st_gid != stat.st_gid: - os.chown(release, -1, stat.st_gid) - os.chmod(release, 02775) diff --git a/scripts/distgit/mkbranch b/scripts/distgit/mkbranch deleted file mode 100755 index 58a5da8..0000000 --- a/scripts/distgit/mkbranch +++ /dev/null @@ -1,183 +0,0 @@ -#!/bin/bash -# -# Create a new development branch for a module. -# THIS HAS TO BE RUN ON THE GIT SERVER! - -# WARNING: -# This file is maintained within puppet? -# All local changes will be lost. - - -# Figure out the environment we're running in -RUNDIR=$(cd $(dirname $0) && pwd) -GITROOT=/srv/git/rpms - -# check if a moron is driving me -if [ ! -d $GITROOT ] ; then - # we're not on the git server (this check is fragile) - echo "ERROR: This script has to be run on the git server." - echo "ERROR: Homer sez 'Duh'." - exit -9 -fi - -# where are the packages kept -TOPLEVEL=rpms - -# Local variables -VERBOSE=0 -TEST= -IGNORE= -BRANCH="" -PACKAGES="" -SRC_BRANCH="master" -AUTHOR="Fedora Release Engineering " - -Usage() { - cat <] ... - - Creates a new branch for the list of s. - The /master suffix on branch names is assumed. - -Options: - -s,--source= Use as the source branch. - Defaults is master - /master suffix on other branches assumed - -n,--test Don't do nothing, only test - -i,--ignore Ignore erroneous modules - -h,--help This help message - -v,--verbose Increase verbosity -EOF -} - -# parse the arguments -while [ -n "$1" ] ; do - case "$1" in - -h | --help ) - Usage - exit 0 - ;; - - -v | --verbose ) - VERBOSE=$(($VERBOSE + 1)) - ;; - - -i | --ignore ) - IGNORE="yes" - ;; - - -n | --test ) - TEST="yes" - ;; - - -s | --source ) - shift - SRC_BRANCH=$1 - ;; - - -b | --branch ) - shift - BRANCH=$1/master - ;; - - * ) - if [ -z "$BRANCH" ] ; then - BRANCH="$1" - else - PACKAGES="$PACKAGES $1" - fi - ;; - esac - shift -done - -# check the arguments -if [ -z "$BRANCH" -o -z "$PACKAGES" ] ; then - Usage - exit -1 -fi - -# Translate the source branch -if [ $SRC_BRANCH == 'master' ] ; then - echo > /dev/null -else - $SRC_BRANCH = $SRC_BRANCH/master -fi - -# Sanity checks before we start doing damage -NEWP= -for p in $PACKAGES ; do - [ $VERBOSE -gt 1 ] && echo "Checking package $p..." - if [ ! -d $GITROOT/$p.git ] ; then - echo "ERROR: Package module $p is invalid" >&2 - [ "$IGNORE" = "yes" ] && continue || exit -1 - fi - $(GIT_DIR=$GITROOT/$p.git git rev-parse -q --verify \ - $SRC_BRANCH >/dev/null) || \ - (echo "ERROR: Invalid source branch '$SRC_BRANCH' for package $p" >&2; \ - [ "$IGNORE" = "yes" ] && continue || exit -1) - $(GIT_DIR=$GITROOT/$p.git git rev-parse -q --verify \ - $BRANCH >/dev/null) && \ - (echo "IGNORING: Package module $p already has a branch $BRANCH" >&2; \ - [ "$IGNORE" = "yes" ] && continue || exit -1) - NEWP="$NEWP $p" -done -PACKAGES="$(echo $NEWP)" -if [ -z "$PACKAGES" ] ; then - echo "NOOP: no valid packages found to process" - exit -1 -fi - -if [ -n "$TEST" ] ; then - echo "Branch $BRANCH valid for $PACKAGES" - exit 0 -fi - -# This account must have the proper permissions as to not screw up the -# repository work. -if [ "$(id -un)" = "root" ] ; then - echo "Please run this script as yourself" - exit -3 -fi -#### Change this to check for proper git-admin rights - -# "global" permissions check -if [ ! -w $GITROOT ] ; then - echo "ERROR: You can not write to $GITROOT" - echo "ERROR: You can not perform branching operations" - exit -1 -fi - -# Now start working on creating those branches - -# For every module, "create" the branch -for NAME in $PACKAGES ; do - echo - echo "Creating new module branch '$BRANCH' for '$NAME' from branch '$SRC_BRANCH'..." - - # permissions checks for this particular module - if [ ! -w $GITROOT/$NAME.git/refs/heads/ ] ; then - echo "ERROR: You can not write to $d" - echo "ERROR: $NAME can not be branched by you" - continue - fi - #### Replace the above with a gitolite permission check - #[ $VERBOSE -gt 0 ] && echo "Creating $BRANCH-split tag for $NAME/$SRC_BRANCH..." - # Is the above needed? - #cvs -Q rtag -f "$BRANCH-split" $TOPLEVEL/$NAME/$SRC_BRANCH || { - #echo "ERROR: Branch split tag for $NAME/$SRC_BRANCH could not be created" >&2 - #exit -2 - #} - [ $VERBOSE -gt 0 ] && echo "Creating $NAME $BRANCH from $NAME $SRC_BRANCH..." - $(pushd $GITROOT/$NAME.git >/dev/null && \ - git branch --no-track $BRANCH $SRC_BRANCH && \ - popd >/dev/null) || { - echo "ERROR: Branch $NAME $BRANCH could not be created" >&2 - popd >/dev/null - exit -2 - } -done - -echo -echo "Done." diff --git a/scripts/distgit/pkgdb2branch.py b/scripts/distgit/pkgdb2branch.py deleted file mode 100755 index 02868f7..0000000 --- a/scripts/distgit/pkgdb2branch.py +++ /dev/null @@ -1,349 +0,0 @@ -#!/usr/bin/python -t -# Author: Toshio Kuratomi -# Copyright: 2007-2008 Red Hat Software -# License: GPLv2+ -# This needs a proper license and copyright here -__version__ = '0.3' - -import sys -import os -import optparse - -import subprocess - -from fedora.client import PackageDB, FedoraServiceError - -GITDIR='/srv/git/rpms' -BASEURL = os.environ.get('PACKAGEDBURL') or 'https://admin.fedoraproject.org/pkgdb/' -MKBRANCH='/usr/local/bin/mkbranch' -SETUP_PACKAGE='/usr/local/bin/setup_git_package' -BRANCHES = {'el4': 'master', 'el5': 'master', 'el6': 'f12', - 'olpc2': 'f7', - 'olpc3': 'f11', - 'master': None, - 'fc6': 'master', - 'f7': 'master', - 'f8': 'master', - 'f9': 'master', - 'f10': 'master', - 'f11': 'master', - 'f12': 'master', - 'f13': 'master', 'f14': 'master', - 'f15': 'master' - } - -# The branch names we get out of pkgdb have to be translated to git -GITBRANCHES = {'EL-4': 'el4', 'EL-5': 'el5', 'EL-6': 'el6', 'OLPC-2': 'olpc2', - 'FC-6': 'fc6', 'F-7': 'f7', 'F-8': 'f8', 'F-9': 'f9', - 'F-10': 'f10', 'OLPC-3': 'olpc3', - 'F-11': 'f11', 'F-12': 'f12', 'F-13': 'f13', 'f14': 'f14', 'f15': 'f15', - 'devel': 'master'} - -# The branch options we get from the CLI have to be translated to pkgdb -BRANCHBYGIT = dict([(v, k) for (k, v) in GITBRANCHES.iteritems()]) - -class InternalError(Exception): - pass - -class PackageDBError(InternalError): - pass - -class ProcessError(InternalError): - pass - -class ArgumentsError(InternalError): - pass - -class InvalidBranchError(PackageDBError): - pass - -class PackageDBClient(PackageDB): - def __init__(self, baseURL, cache=False, debug=False): - '''Initialize the connection. - - Args: - :baseURL: URL from which the packageDB is accessed - :cache: Whether to download a list of all vcs acls. - ''' - # We're only performing read operations so we don't need a username - super(PackageDBClient, self).__init__(baseURL, useragent=None, - debug=debug, insecure=True) - self.cacheEnabled = cache - self.__cache = None - self.branchCache = {} - - def _cache(self): - '''cache property which returns returns all the package acls. - ''' - if self.__cache: - return self.__cache - data = self.get_vcs_acls() - - if self.cacheEnabled: - self.__cache = data - else: - self.__cache = None - return self.__cache - cache = property(_cache) - - def get_package_branches(self, pkgname): - '''Return the branches to which a package belongs. - - Args: - :pkgname: The package to retrieve branch information about - ''' - if self.cacheEnabled: - # If the cache is enabled, the information is in the whole - # package dump - try: - return self.cache[pkgname].keys() - except KeyError: - raise PackageDBError('%s is not a known package' % pkgname) - - data = self.get_package_info(pkgname) - branches = [] - for packageListing in data.packageListings: - branches.append(packageListing['collection']['branchname']) - return branches - - def get_package_list(self, branchName): - '''Retrieve all the packages in a specific branch. - - Args: - :branchName: to return the packages for - ''' - ### FIXME: At some point we could enhance the server to filter by - # branchName - try: - # If branch is in the cache use that - return self.branchCache[branchName] - except KeyError: - pass - pkgList = [] - for pkg in self.cache: - # If the package has a branch record, we'll branch it - if branchName in self.cache[pkg]: - pkgList.append(pkg) - - if self.cacheEnabled: - self.branchCache[branchName] = pkgList - return pkgList - -class Brancher(object): - ''' Make branches in the GIT Repository.''' - - def __init__(self, pkgdburl, cache, verbose): - # Connect to the package database - self.verbose = verbose - self.client = PackageDBClient(BASEURL, cache=cache, debug=verbose) - - def _invoke(self, program, args): - '''Run a command and raise an exception if an error occurred. - - Args: - :program: The program to invoke - :args: List of arguments to pass to the program - - raises ProcessError if there's a problem. - ''' - cmdLine = [program] - cmdLine.extend(args) - print ' '.join(cmdLine) - - stdoutfd = subprocess.PIPE - if self.verbose: - program = subprocess.Popen(cmdLine, stderr=subprocess.STDOUT) - else: - program = subprocess.Popen(cmdLine, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - retCode = program.wait() - if retCode != 0: - e = ProcessError() - e.returnCode = retCode - e.cmd = ' '.join(cmdLine) - if self.verbose: - output = program.stdout.read() - e.message = 'Error, "%s" returned %s: %s' % (e.cmd, e.returnCode, output) - else: - e.message = 'Error, "%s" returned %s' % (e.cmd, e.returnCode) - raise e - - def _create_branch(self, pkgname, branch): - '''Create a specific branch for a package. - - Args: - :pkgname: Name of the package to branch - :branch: Name of the branch to create - - raises InvalidBranchError if a branchname is unknown. - - Will ignore a branch which is EOL. - ''' - try: - branchFrom = '%s/master' % BRANCHES[branch] - except KeyError: - raise InvalidBranchError( - 'PackageDB returned an invalid branch %s for %s' % - (branch, pkgname)) - - # Add the master to the branch - # No longer add this after the new branching setup. - #branch = '%s/master' % branch - # If branchFrom is None, this is an EOL release - # If the directory already exists, no need to invoke mkbranch - if branchFrom: - # Fall back to branching from master. - frombranchpath = os.path.join(GITDIR, '%s.git' % pkgname, - 'refs/heads', branchFrom) - if not os.path.exists(frombranchpath): - branchFrom = 'master' - - branchpath = os.path.join(GITDIR, '%s.git' % pkgname, - 'refs/heads', branch) - if not os.path.exists(branchpath): - try: - self._invoke(MKBRANCH, ['-s', branchFrom, branch, pkgname]) - except ProcessError, e: - if e.returnCode == 255: - # This is a warning, not an error - return - raise - - def branch_package(self, pkgname): - '''Create all the branches that are listed in the pkgdb for a package. - - Args: - :pkgname: The package to create branches for - - Note: this will ignore branches which are EOL. - - raises PackageDBError if the package is not present in the Package - Database. - ''' - # Retrieve branch information - try: - branches = self.client.get_package_branches(pkgname) - except FedoraServiceError, e: - raise PackageDBError( - 'Unable to retrieve information about %s: %s' % - (pkgname, str(e))) - - # Create the devel branch if necessary - if not os.path.exists(os.path.join(GITDIR, - '%s.git' % pkgname)): - self._invoke(SETUP_PACKAGE, [pkgname]) - # Create all the required branches for the package - # Use the translated branch name until pkgdb falls inline - for branch in branches: - if branch == 'devel': - continue - if not branch in GITBRANCHES.keys(): - print 'Skipping unknown branch %s' % branch - continue - self._create_branch(pkgname, GITBRANCHES[branch]) - - def mass_branch(self, branchName): - '''Make sure all packages listed for a specific branch in the PackageDB - have a CVS branch. - - Args: - :branchName: The branch to ensure. - ''' - # Retrieve all the packages in this branch - pkglist = self.client.get_package_list(branchName) - pkglist.sort() - for pkg in pkglist: - # Create a branch for this release for each of them - # Use the translated branch name until pkgdb falls inline - self._create_branch(pkg, GITBRANCHES[branchName]) - -def parse_commands(): - parser = optparse.OptionParser(version=__version__, usage='''pkgdb2branch.py [options] PACKAGENAME [packagename, ...] [-] - pkgdb2branch.py [options] --branchfor BRANCH - -pkgdb2branch reads package information from the packagedb and creates branches -on the git server based on what branches are listed there. pkgdb2branch can -read the list of packages from stdin if you specify '-' as an argument. - -pkgdb2branch has two modes of operation. In the first mode, you specify which -packages you want to branch. This mode is more efficient for a small number -of packages. - -In the second mode, pkgdb2branch will find every package lacking a BRANCH and -will create one if the pkgdb says it's needed. This mode is very efficient for -mass branching. This implies --cache-branches. - -For those with a moderate number of packages, using a list of packages and ---cache-branches may be fastest.''') - parser.add_option('-b', '--branch-for', - dest='branchFor', - action='store', - help='Make sure all the packages have been branched for BRANCHFOR. Implies -c.') - parser.add_option('-c', '--cache-branches', - dest='enableCache', - action='store_true', - help='Download a complete cache of packages') - parser.add_option('--verbose', - dest='verbose', - action='store_true', - help='Enable verbose output') - (opts, args) = parser.parse_args() - - if opts.branchFor: - if args: - raise ArgumentsError('Cannot specify packages with --branchFor') - opts.enableCache = True - - if '-' in args: - opts.fromStdin = True - del (args[args.index('-')]) - else: - opts.fromStdin = False - - if not (args or opts.fromStdin or opts.branchFor): - raise ArgumentsError('You must list packages to operate on') - - return opts, args - -if __name__ == '__main__': - try: - options, packages = parse_commands() - except ArgumentsError, e: - print e - sys.exit(1) - - unbranchedPackages = [] - brancher = Brancher(BASEURL, options.enableCache, options.verbose) - - if options.branchFor: - try: - unbranchedPackages = \ - brancher.mass_branch(BRANCHBYGIT[options.branchFor]) - except PackageDBError, e: - print 'Unable contact the PackageDB. Error: %s' % str(e) - sys.exit(1) - else: - # Process packages specified on the cmdline - for pkgname in packages: - try: - brancher.branch_package(pkgname) - except InternalError, e: - print str(e) - unbranchedPackages.append(pkgname) - - # Process packages from stdin - if options.fromStdin: - for pkgname in sys.stdin: - pkgname = pkgname.strip() - try: - brancher.branch_package(pkgname) - except InternalError, e: - print str(e) - unbranchedPackages.append(pkgname) - - if unbranchedPackages: - print 'The following packages were unbranched:' - print '\n'.join(unbranchedPackages) - sys.exit(100) - - sys.exit(0) diff --git a/scripts/distgit/setup_git_package b/scripts/distgit/setup_git_package deleted file mode 100755 index 8b0490f..0000000 --- a/scripts/distgit/setup_git_package +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash -# -# Create a new repo. -# THIS HAS TO BE RUN ON THE GIT SERVER! - -# WARNING: -# This file is maintained within puppet? -# All local changes will be lost. - -# License: GPLv2 (see https://fedorahosted.org/fedora-infrastructure/ticket/3351#comment:2) - - -# Figure out the environment we're running in -GITROOT=/srv/git/rpms - -# check if a moron is driving me -if [ ! -d $GITROOT ] ; then - # we're not on the git server (this check is fragile) - echo "ERROR: This script has to be run on the git server." - echo "ERROR: Homer sez 'Duh'." - exit -9 -fi - -# Local variables -VERBOSE=0 -TEST= -IGNORE= -AUTHOR="Fedora Release Engineering " -GIT_SSH_URL="ssh://localhost" - -Usage() { - cat < - - Creates a new repo for - -Options: - -h,--help This help message -EOF -} - -if [ $# -gt 2 ]; then - Usage - exit -1 -fi - -# parse the arguments -while [ -n "$1" ] ; do - case "$1" in - -h | --help ) - Usage - exit 0 - ;; - - * ) - PACKAGE="$1" - ;; - esac - shift -done - -# I hate shell scripting. I'm sure the above is totally wrong - -# check the arguments -if [ -z "$PACKAGE" ] ; then - Usage - exit -1 -fi - -# Sanity checks before we start doing damage -[ $VERBOSE -gt 1 ] && echo "Checking package $PACKAGE..." -if [ -d $GITROOT/$PACKAGE.git ] ; then - echo "ERROR: Package module $PACKAGE already exists!" >&2 - exit -1 -fi - -# Just don't run as root, mmkey? -if [ "$(id -un)" = "root" ] ; then - echo "Please run this script as yourself" - exit -3 -fi - -# "global" permissions check -if [ ! -w $GITROOT ] ; then - echo "ERROR: You can not write to $GITROOT" - echo "ERROR: You can not create repos" - exit -1 -fi - -# Now start working on creating those branches -# Create a tmpdir to do some git work in -TMPDIR=$(mktemp -d /tmp/tmpXXXXXX) - -# First create the master repo -mkdir $GITROOT/$PACKAGE.git -pushd $GITROOT/$PACKAGE.git >/dev/null -git init -q --shared --bare -echo "$PACKAGE" > description # This is used to figure out who to send mail to. -git config --add hooks.mailinglist "$PACKAGE-owner@fedoraproject.org,scm-commits@lists.fedoraproject.org" -git config --add hooks.maildomain fedoraproject.org -popd >/dev/null - -# Now clone that repo and create the .gitignore and sources file -git clone -q $GITROOT/$PACKAGE.git $TMPDIR/$PACKAGE -pushd $TMPDIR/$PACKAGE >/dev/null -touch .gitignore sources -git add . -git commit -q -m 'Initial setup of the repo' --author "$AUTHOR" -git push -q origin master -popd >/dev/null - -# Put our special update hooks in place -ln -s /usr/share/gitolite/hooks/common/update $GITROOT/$PACKAGE.git/hooks/ -ln -s /usr/share/git-core/mail-hooks/gnome-post-receive-email \ - $GITROOT/$PACKAGE.git/hooks/post-receive - -rm -rf $TMPDIR -echo "Done." diff --git a/scripts/epel-repoclosure/PackageOwners.py b/scripts/epel-repoclosure/PackageOwners.py deleted file mode 100644 index 1902191..0000000 --- a/scripts/epel-repoclosure/PackageOwners.py +++ /dev/null @@ -1,270 +0,0 @@ -#!/usr/bin/python -# -*- mode: Python; indent-tabs-mode: nil; -*- -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Library General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -import commands -import errno -import os, sys, time -import shutil -import tempfile -from urllib import FancyURLopener - - -class PackageOwners: - """interface to Fedora package owners list (and Fedora Extras owners/owners.list file)""" - - def __init__(self): - self.dict = {} - self.how = 'unknown' - - - def FromURL(self, retries=3, retrysecs=300, url='https://admin.fedoraproject.org/pkgdb/acls/bugzilla?tg_format=plain', - pkgdb=True, repoid='Fedora', username=None, password=None): - # old url='http://cvs.fedora.redhat.com/viewcvs/*checkout*/owners/owners.list?root=extras' - if pkgdb: - self.how = 'pkgdb' - else: - self.how = 'url' - self.url = url - self.repoid = repoid - self.retries = retries - self.retrysecs = retrysecs - self.username = username - self.password = password - return self._refresh() - - - def FromCVS(self, retries=3, retrysecs=300, command='LC_ALL=C CVS_RSH=ssh cvs -f -d :pserver:anonymous@cvs.fedora.redhat.com:/cvs/extras co owners', workdir='',repoid='Fedora'): - self.how = 'cvs' - self.command = command - self.repoid = repoid - self.retries = retries - self.retrysecs = retrysecs - self.workdir = workdir - self.ownersfile = os.path.join('owners', 'owners.list') - self.cwdstack = [] - return self._refresh() - - - def __getitem__(self,rpmname): - """return e-mail address from initialowner field""" - return self.GetOwner(rpmname) - - - def GetOwner(self,rpmname): - """return e-mail address from initialowner field""" - try: - r = self.dict[rpmname]['mailto'] - except KeyError: - r = '' - return r - - - def GetOwners(self,rpmname): - """return list of e-mail addresses from initialowner+initialcclist fields""" - r = self.GetCoOwnerList(rpmname) - r2 = self.GetOwner(rpmname) - if len(r2): - r.append(r2) - return r - - - def GetCoOwnerList(self,rpmname): - """return list of e-mail addresses from initialcclist field""" - try: - r = self.dict[rpmname]['cc'] - except KeyError: - r = [] - return r - - - def _enterworkdir(self): - self.cwdstack.append( os.getcwd() ) - if self.workdir != '': - os.chdir(self.workdir) - - - def _leaveworkdir(self): - if len(self.cwdstack): - os.chdir( self.cwdstack.pop() ) - - - def _refresh(self): - self.dict = {} # map package name to email address, dict[name] - return self._download() - - - def _parse(self,ownerslist): - for line in ownerslist: - if line.startswith('#') or line.isspace(): - continue - try: - (repo,pkgname,summary,emails,qacontact,cc) = line.rstrip().split('|') - # This is commented, because we don't need the summary. - #summary.replace(r'\u007c','|').replace('\u005c','\\') - - # The PkgDb includes repo's other than Fedora (Fedora EPEL, - # Fedora OLPC, and Red Hat Linux, for example). Skip them. - if repo != self.repoid: - continue - def fixaddr(a): - # Old Fedora CVS owners.list contains e-mail addresses. - # PkgDb plain output contains usernames only. - if not self.how == 'pkgdb': - return a - if not self.usermap.has_key(a): - return a - return self.usermap[a] - - addrs = [] - mailto = '' # primary pkg owner - if len(emails): - if emails.find(',')>=0: - (addrs) = emails.split(',') - mailto = addrs[0] - addrs = addrs[1:] - else: - mailto = emails - mailto = fixaddr(mailto) - - ccaddrs = [] - if len(cc): - (ccaddrs) = cc.split(',') - addrs += ccaddrs - addrs = map(lambda a: fixaddr(a), addrs) - - self.dict[pkgname] = { - 'mailto' : mailto, - 'cc' : addrs - } - except: - print 'ERROR: owners.list is broken' - print line - - - def _downloadfromcvs(self): - self._enterworkdir() - # Dumb caching. Check that file exists and is "quite recent". - cached = False - try: - fstats = os.stat(self.ownersfile) - if ( fstats.st_size and - ((time.time() - fstats.st_ctime) < 3600*2) ): - cached = True - except OSError: - pass - - if not cached: - # Remove 'owners' directory contents, if it exists. - for root, dirs, files in os.walk( 'owners', topdown=False ): - for fname in files: - os.remove(os.path.join( root, fname )) - for dname in dirs: - os.rmdir(os.path.join( root, dname )) - # Retry CVS checkout a few times. - for count in range(self.retries): - (rc, rv) = commands.getstatusoutput(self.command) - if not rc: - break - print rv - time.sleep(self.retrysecs) - if rc: - # TODO: customise behaviour on error conditions - self._leaveworkdir() - return False - - try: - f = file( self.ownersfile ) - except IOError, (err, strerr): - print 'ERROR: %s' % strerr - # TODO: customise behaviour on error conditions - self._leaveworkdir() - return err - ownerslist = f.readlines() - f.close() - self._parse(ownerslist) - self._leaveworkdir() - return True - - - def _getlinesfromurl(self,url): - err = 0 - strerr = '' - # Retry URL download a few times. - for count in range(self.retries): - if count != 0: - time.sleep(self.retrysecs) - try: - opener = FancyURLopener() - f = opener.open(url, data='user_name=%s&password=%s&login=Login' % (self.username, self.password)) - rc = 0 - if 'www-authenticate' in f.headers: - rc = 1 - strerr = 'Authentication is required to access %s' % url - break - except IOError, (_err, _strerr): - rc = 1 - print url - print _strerr - (err,strerr) = (_err,_strerr) - if rc: - raise IOError, (err, strerr) - else: - l = f.readlines() - f.close() - return l - - - def _downloadfromurl(self): - self._parse(self._getlinesfromurl(self.url)) - return True - - - def _downloadfrompkgdb(self): - # Construct an URL that makes FancyURLopener use authentication - # with the first request and not just in return to 401. - fas2authurl = 'https://admin.fedoraproject.org/accounts/group/dump/' - - fasdump = self._getlinesfromurl(fas2authurl) - self.usermap = {} - for line in fasdump: - fields = line.split(',') - try: - user = fields[0] - addr = '%s@fedoraproject.org' % user - except IndexError: - print line - raise - if (addr.find('@') < 0): # unexpected, no addr - print 'No email in:', line - raise Exception - self.usermap[user] = addr - self._parse(self._getlinesfromurl(self.url)) - return True - - - def _download(self): - if self.how == 'url': - return self._downloadfromurl() - elif self.how == 'pkgdb': - return self._downloadfrompkgdb() - elif self.how == 'cvs': - return self._downloadfromcvs() - else: - self.__init__() - return False - - diff --git a/scripts/epel-repoclosure/checkEpel.sh b/scripts/epel-repoclosure/checkEpel.sh deleted file mode 100755 index c0016dd..0000000 --- a/scripts/epel-repoclosure/checkEpel.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -DATE=`date +%Y%m%d` -YUM_CONF_LOC=/etc/yum.repos.d/yum.epel.conf -OUTPUT_DIR=$HOME -RC_REPORT_CFG=/etc/rc-report-epel.cfg -PATH=$PATH:.:/usr/local/bin - -OUTFILE=/tmp/epel-deps-$DATE.txt ->$OUTFILE - -SEND_EMAIL="yes" - - -process_deps() -{ - release=$1 - arch=$2 - testing=$3 - [ $arch = "ppc" ] && arch_label=ppc64 || arch_label=$arch - [ $arch = "i386" ] && arch_label=i686 || arch_label=$arch - command="rc-modified -q -d mdcache -n -c $YUM_CONF_LOC -a $arch_label -r rhel-$release-$arch -r fedora-epel-$release-$arch -r buildsys-$release-$arch -r rhel-$arch-server-productivity-$release" - [ $release -eq 5 ] && command="$command -r rhel-$release-$arch-vt " - [ "$testing" = "testing" ] && command="$command -r fedora-epel-testing-$release-$arch " - $command >> $OUTFILE -} - -mailer() -{ - rc-report.py $OUTFILE -k epel -c $RC_REPORT_CFG -w testing -m summary -m owner -} - -# process_deps RHEL_RELEASE ARCH INCLUDE_TESTING? - -# RHEL 5 -process_deps 5 i386 testing -process_deps 5 x86_64 testing -process_deps 5 ppc testing - -# RHEL 4 -process_deps 4 i386 testing -process_deps 4 x86_64 testing -process_deps 4 ppc testing - -if [ "$SEND_EMAIL" = "yes" ] ; then - mailer -fi diff --git a/scripts/epel-repoclosure/rc-modified b/scripts/epel-repoclosure/rc-modified deleted file mode 100755 index 7aa3593..0000000 --- a/scripts/epel-repoclosure/rc-modified +++ /dev/null @@ -1,306 +0,0 @@ -#!/usr/bin/python -t -# -*- mode: Python; indent-tabs-mode: nil; -*- - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Library General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# seth vidal 2005 (c) etc etc -# mschwendt: modified for Fedora Extras buildsys - -#Read in the metadata of a series of repositories and check all the -# dependencies in all packages for resolution. Print out the list of -# packages with unresolved dependencies - -import sys -import os - -# For patched "yum" and "rpmUtils" (post 2.6.1 checkForObsolete support). -# Comment this to use system yum. -#sys.path.insert(0,'/srv/extras-push/work/buildsys-utils/pushscript') - -import yum -import yum.Errors -from yum.misc import getCacheDir -from optparse import OptionParser -import rpmUtils.arch -from yum.constants import * -if yum.__version__ < '3.0': # TODO: check - from repomd.packageSack import ListPackageSack -else: - from yum.packageSack import ListPackageSack - - -def parseArgs(): - usage = "usage: %s [-c ] [-a ] [-r ] [-r ]" % sys.argv[0] - parser = OptionParser(usage=usage) - parser.add_option("-c", "--config", default='/etc/yum.conf', - help='config file to use (defaults to /etc/yum.conf)') - parser.add_option("-a", "--arch", default=None, - help='check as if running the specified arch (default: current arch)') - parser.add_option("-r", "--repoid", default=[], action='append', - help="specify repo ids to query, can be specified multiple times (default is all enabled)") - parser.add_option("-t", "--tempcache", default=False, action="store_true", - help="use a temp dir for storing/accessing yum-cache") - parser.add_option("-d", "--cachedir", default='', - help="specify a custom directory for storing/accessing yum-cache") - parser.add_option("-q", "--quiet", default=0, action="store_true", - help="quiet (no output to stderr)") - parser.add_option("-n", "--newest", default=0, action="store_true", - help="check only the newest packages in the repos") - parser.add_option("", "--nomultilibhack", default=False, action="store_true", - help="disable multi-lib hack") - (opts, args) = parser.parse_args() - return (opts, args) - -class RepoClosure(yum.YumBase): - def __init__(self, arch = None, config = "/etc/yum.conf"): - yum.YumBase.__init__(self) - - self.arch = arch - if yum.__version__ < '3.0': # TODO: check - self.doConfigSetup(fn = config) - else: - self.doConfigSetup(fn = config, init_plugins = False) - if hasattr(self.repos, 'sqlite'): - self.repos.sqlite = False - self.repos._selectSackType() - - self.guessMultiLibProbs = True - - def evrTupletoVer(self,tuple): - """convert and evr tuple to a version string, return None if nothing - to convert""" - - e, v,r = tuple - - if v is None: - return None - - val = '' - if e is not None: - val = '%s:%s' % (e, v) - - if r is not None: - val = '%s-%s' % (val, r) - - return val - - def readMetadata(self): - self.doRepoSetup() - self.doSackSetup(rpmUtils.arch.getArchList(self.arch)) - for repo in self.repos.listEnabled(): - try: # TODO: when exactly did this change to "mdtype"? - self.repos.populateSack(which=[repo.id], mdtype='filelists') - except TypeError: - self.repos.populateSack(which=[repo.id], with='filelists') - - def isnewest(self, pkg): - newest = pkg.pkgtup in self.newestpkgtuplist - - if not self.guessMultiLibProbs: - return newest - - # Multi-lib hack: - # - # This is supposed to catch corner-cases, such as: - # Base-arch pkg was updated, but a corresponding compat-arch pkg - # is not included in the repo, because e.g. it was repackaged - # and no longer is pulled in by the multi-lib resolver. - # Assume, that if it the old compat-arch pkg is in the repo, - # there is no upgrade path from biarch installs to single-arch - # (the one pkg upgrades two installed pkgs with different arch) - - (n,a,e,v,r) = pkg.pkgtup - - if newest or a=='noarch': - return newest # the trivial case - - for provpkg in self.pkgSack.returnNewestByName(n): - prov_a = provpkg.pkgtup[1] - if prov_a=='noarch' or prov_a==a: - (prov_e, prov_v, prov_r) = provpkg.pkgtup[2:] - vercmp = rpmUtils.miscutils.compareEVR( (prov_e,prov_v,prov_r), (e,v,r) ) - if vercmp>0: # provpkg is newer - return False - # No noarch/same-arch pkg is newer, but a basearch pkg may be newer - # and therefore be the only one in newestpkgtuplist. - return True - - def getBrokenDeps(self, newest=False): - unresolved = {} - resolved = {} - self.newestpkgtuplist = [] - if newest: - if yum.__version__ >= '2.9': # TODO: check - pkgs = self.pkgSack.returnNewestByName() - else: - pkgs = [] - for l in self.pkgSack.returnNewestByName(): - pkgs.extend(l) - self.newestpkgtuplist = ListPackageSack(pkgs).simplePkgList() - - pkgs = self.pkgSack.returnNewestByNameArch() - else: - pkgs = self.pkgSack - self.numpkgs = len(pkgs) - - mypkgSack = ListPackageSack(pkgs) - pkgtuplist = mypkgSack.simplePkgList() - - # Support new checkForObsolete code in Yum (#190116) - # _if available_ - # so we don't examine old _obsolete_ sub-packages. - import rpmUtils.updates - self.up = rpmUtils.updates.Updates([],pkgtuplist) - self.up.rawobsoletes = mypkgSack.returnObsoletes() - - haveCheckForObsolete = hasattr(rpmUtils.updates.Updates,'checkForObsolete') - if not haveCheckForObsolete: - print 'WARNING: rpmUtils.updates.checkForObsolete missing!' - - for pkg in pkgs: - thispkgobsdict = {} - if haveCheckForObsolete: - try: - thispkgobsdict = self.up.checkForObsolete([pkg.pkgtup]) - if thispkgobsdict.has_key(pkg.pkgtup): - continue - except AttributeError: - pass - - for (req, flags, (reqe, reqv, reqr)) in pkg.returnPrco('requires'): - if req.startswith('rpmlib'): continue # ignore rpmlib deps - - ver = self.evrTupletoVer((reqe, reqv, reqr)) - if resolved.has_key((req,flags,ver)): - continue - try: - resolve_sack = self.whatProvides(req, flags, ver) - except yum.Errors.RepoError, e: - pass - - if len(resolve_sack) < 1: - if newest and not self.isnewest(pkg): - break - if not unresolved.has_key(pkg): - unresolved[pkg] = [] - unresolved[pkg].append((req, flags, ver)) - continue - - kernelprovides = True # make a false assumption - # If all providers are "kernel*" packages, we allow old ones. - for (pn,pa,pe,pv,pr) in resolve_sack.simplePkgList(): - kernelprovides &= pn.startswith('kernel') - - if newest and not kernelprovides and not req.startswith('kernel'): # we allow old kernels - resolved_by_newest = False - for po in resolve_sack:# look through and make sure any of our answers are newest-only - - # 2nd stage handling of obsoletes. Only keep providers, - # which are not obsolete. If no provider is left, the - # dep is unresolved. - thispkgobsdict = {} - if haveCheckForObsolete: - try: - thispkgobsdict = self.up.checkForObsolete([po.pkgtup]) - if thispkgobsdict.has_key(po.pkgtup): - continue - except AttributeError: - pass - - if po.pkgtup in pkgtuplist: - resolved_by_newest = True - break - - if resolved_by_newest: - resolved[(req,flags,ver)] = 1 - else: - if newest and not self.isnewest(pkg): - break - if not unresolved.has_key(pkg): - unresolved[pkg] = [] - unresolved[pkg].append((req, flags, ver)) - - return unresolved - - - def log(self, value, msg): - pass - -def main(): - (opts, cruft) = parseArgs() - my = RepoClosure(arch = opts.arch, config = opts.config) - my.guessMultiLibProbs = not opts.nomultilibhack - - if opts.repoid: - for repo in my.repos.repos.values(): - if repo.id not in opts.repoid: - repo.disable() - else: - repo.enable() - - if os.geteuid() != 0 or opts.tempcache or opts.cachedir != '': - if opts.cachedir != '': - cachedir = opts.cachedir - else: - cachedir = getCacheDir() - if cachedir is None: - print "Error: Could not make cachedir, exiting" - sys.exit(50) - - my.repos.setCacheDir(cachedir) - - if not opts.quiet: - print 'Reading in repository metadata - please wait....' - - try: - my.readMetadata() - except yum.Errors.RepoError, e: - print e - sys.exit(1) - - if not opts.quiet: - print 'Checking Dependencies' - - baddeps = my.getBrokenDeps(opts.newest) - num = my.numpkgs - - repos = my.repos.listEnabled() - - if not opts.quiet: - print 'Repos looked at: %s' % len(repos) - for repo in repos: - print ' %s' % repo - print 'Num Packages in Repos: %s' % num - - pkgs = baddeps.keys() - def sortbyname(a,b): - return cmp(a.__str__(),b.__str__()) - pkgs.sort(sortbyname) - for pkg in pkgs: - srcrpm = pkg.returnSimple('sourcerpm') - print 'source rpm: %s\npackage: %s from %s\n unresolved deps: ' % (srcrpm, pkg, pkg.repoid) - for (n, f, v) in baddeps[pkg]: - req = '%s' % n - if f: - flag = LETTERFLAGS[f] - req = '%s %s'% (req, flag) - if v: - req = '%s %s' % (req, v) - - print ' %s' % req - print - -if __name__ == "__main__": - main() - diff --git a/scripts/epel-repoclosure/rc-report-epel.cfg.erb b/scripts/epel-repoclosure/rc-report-epel.cfg.erb deleted file mode 100644 index 8c77d24..0000000 --- a/scripts/epel-repoclosure/rc-report-epel.cfg.erb +++ /dev/null @@ -1,9 +0,0 @@ -[FAS] -project = Fedora EPEL -user = fedorasy -passwd = <%= fedorasyUserPassword %> - -[Mail] -from = Fedora Extras repoclosure -replyto = epel-devel-list@redhat.com -subject = Broken dependencies in EPEL diff --git a/scripts/epel-repoclosure/rc-report.py b/scripts/epel-repoclosure/rc-report.py deleted file mode 100755 index 491c92c..0000000 --- a/scripts/epel-repoclosure/rc-report.py +++ /dev/null @@ -1,351 +0,0 @@ -#!/usr/bin/python -# -*- mode: Python; indent-tabs-mode: nil; -*- - -import errno, os, sys, stat -import re -import smtplib -import datetime, time -from optparse import OptionParser -import ConfigParser - -from PackageOwners import PackageOwners -#from FakeOwners import FakeOwners as PackageOwners - -FAS = { - 'project' : "Fedora EPEL", - 'user' : "", - 'passwd' : "", - } - -Mail = { - 'server' : "localhost", - 'user' : "", - 'passwd' : "", - 'maxsize' : 39*1024, - 'from' : "root@localhost", - 'replyto' : "root@localhost", - 'subject' : "Broken dependencies in EPEL", -} - -class BrokenDep: - def __init__(self): - self.pkgid = None # 'name - EVR.arch' - self.repoid = None # e.g. 'fedora-core-6-i386' - self.srp_mname = None - self.age = '' # e.g. '(14 days)' - self.owner = '' - self.coowners = [] - # disabled/stripped feature - self.mail = True # whether to notify owner by mail - # disabled/stripped feature - self.new = False - self.report = [] - - def GetRequires(self): - pkgid2 = self.pkgid.replace(' ','') - r = [] - for line in self.report: - if len(line) and not line.isspace() and not line.startswith('package: ') and line.find('unresolved deps:') < 0: - r.append( ' '+pkgid2+' requires '+line.lstrip() ) - return '\n'.join(r) - - -def whiteListed(b): # Just a hook, not a generic white-list feature. - # These two in Fedora 7 Everything most likely won't be fixed. - if b.pkgid.startswith('kmod-em8300') and b.repoid.startswith('fedora-7'): - return True - elif b.pkgid.startswith('kmod-sysprof') and b.repoid.startswith('fedora-7'): - return True - elif b.pkgid.startswith('kmod'): # gah ;) temporarily catch them all - return True - else: - return False - - -def makeOwners(brokendeps): - owners = PackageOwners() - try: - #if not owners.FromURL(): - if not owners.FromURL(repoid=FAS['project'],username=FAS['user'],password=FAS['passwd']): - raise IOError('ERROR: Could not retrieve package owner data.') - except IOError, e: - print e - sys.exit(1) - for b in brokendeps: - toaddr = owners.GetOwner(b.srpm_name) - if toaddr == '': - toaddr = 'UNKNOWN OWNER' - e = 'ERROR: "%s" not in owners.list!\n\n' % b.srpm_name - if e not in errcache: - errcache.append(e) - b.owner = toaddr - b.coowners = owners.GetCoOwnerList(b.srpm_name) - - -def mail(smtp, fromaddr, toaddrs, replytoaddr, subject, body): - from email.Header import Header - from email.MIMEText import MIMEText - msg = MIMEText( body, 'plain' ) - from email.Utils import make_msgid - msg['Message-Id'] = make_msgid() - msg['Subject'] = Header(subject) - msg['From'] = Header(fromaddr) - from email.Utils import formatdate - msg['Date'] = formatdate() - if len(replytoaddr): - msg['ReplyTo'] = Header(replytoaddr) - - if isinstance(toaddrs, basestring): - toaddrs = [toaddrs] - to = '' - for t in toaddrs: - if len(to): - to += ', ' - to += t - msg['To'] = Header(to) - - try: - r = smtp.sendmail( fromaddr, toaddrs, msg.as_string(False) ) - for (name, errormsg) in r.iteritems(): - print name, ':', errormsg - except smtplib.SMTPRecipientsRefused, obj: - print 'ERROR: SMTPRecipientsRefused' - for (addr, errormsg) in obj.recipients.iteritems(): - print addr, ':', errormsg - except smtplib.SMTPException: - print 'ERROR: SMTPException' - - -def mailsplit(smtp, fromaddr, toaddrs, replytoaddr, subject, body): - # Split mail body at line positions to keep it below maxmailsize. - parts = 0 - start = 0 - end = len(body) - slices = [] - while ( start < end ): - if ( (end-start) > Mail['maxsize'] ): - nextstart = body.rfind( '\n', start, start+Mail['maxsize'] ) - if ( nextstart<0 or nextstart==start ): - print 'ERROR: cannot split mail body cleanly' - nextstart = end - else: - nextstart = end - slices.append( (start, nextstart) ) - start = nextstart - parts += 1 - - curpart = 1 - for (start,end) in slices: - if (parts>1): - subjectmodified = ( '(%d/%d) %s' % (curpart, parts, subject) ) - time.sleep(1) - else: - subjectmodified = subject - slicedbody = body[start:end] - mail(smtp,fromaddr,toaddrs,replytoaddr,subjectmodified,slicedbody) - curpart += 1 - - -def loadConfigFile(filename): - if not filename: - return - - config = ConfigParser.ConfigParser() - try: - config.readfp(open(filename)) - except IOError, (e, errstr): - print filename, ':', errstr - sys.exit(e) - - try: - if config.has_section('FAS'): - for v in ['project','user','passwd']: - if config.has_option('FAS',v): - FAS[v] = config.get('FAS',v) - if config.has_section('Mail'): - for v in ['server','user','passwd','from','replyto','subject']: - if config.has_option('Mail',v): - Mail[v] = config.get('Mail',v) - if config.has_option('Mail','maxsize'): - Mail['maxsize'] = config.getint('Mail','maxsize') - - except (ConfigParser.NoSectionError, ConfigParser.NoOptionError), e: - print 'Configuration file error:', e - - -### main - -usage = "Usage: %s " % sys.argv[0] -parser = OptionParser(usage=usage) -parser.add_option("-c", "--config", default=None, - help="config file to use") -parser.add_option("-k", "--keyword", default=[], action='append', - help="a keyword to look for in repoids") -parser.add_option("-m", "--mail", default=[], action='append', - help="what mail to send (owner, summary)") -parser.add_option("-w", "--warn", default=[], action='append', - help="repository warnings to include (needsign, testing)") -parser.add_option("", "--noowners", default=False, action="store_true", - help="don't fetch package owner data from FAS") -(opts, args) = parser.parse_args() - -loadConfigFile(opts.config) - -domail = len(opts.mail)>0 -brokendeps = [] # list of BrokenDeps -errcache = [] # error messages to be included in the summary mail - -if not len(args): - print usage - sys.exit(errno.EINVAL) -# Parse extras-repoclosure output files and fill brokendeps array. -while len(args): - logfilename = args[0] - del args[0] - - f = file( logfilename ) - pkgre = re.compile('(?P.*)-[^-]+-[^-]+$') - inbody = False - srcrpm = '' - for line in f: - if line.startswith('source rpm: '): - w = line.rstrip().split(' ') - srcrpm = w[2] - res = pkgre.search( srcrpm ) # try to get src.rpm "name" - if not res: # only true for invalid input - inbody = False - else: - srpm_name = res.group('name') - inbody = True - continue - - elif inbody and line.startswith('package: '): - w = line.rstrip().split(' ') - repoid = w[5] - b = BrokenDep() - b.pkgid = w[1]+' - '+w[3] # name - EVR.arch - b.repoid = repoid - b.srpm_name = srpm_name - brokendeps.append(b) - - if inbody: - # Copy report per broken package. - b.report.append( line.rstrip() ) - - -def bdSortByOwnerAndName(a,b): - return cmp(a.owner+a.pkgid,b.owner+b.pkgid) - -def bdSortByRepoAndName(a,b): - return cmp(a.repoid+a.pkgid,b.repoid+b.pkgid) - - -# Filter out unwanted repoids. -for b in list(brokendeps): - for needle in opts.keyword: - if b.repoid.find( needle ) >= 0: # wanted? - break - else: - brokendeps.remove(b) - -# Filter out entries from whitelist. -for b in list(brokendeps): - if whiteListed(b): - brokendeps.remove(b) - -# Fill in package owners. -if not opts.noowners: - makeOwners(brokendeps) - -# Build full mail report per owner. Use a flag for new breakage. -reports = {} # map of lists [new,body] - a flag and the full report for a package owner -if not opts.noowners: - brokendeps.sort(bdSortByOwnerAndName) - for b in brokendeps: - if b.new: - print 'NEW breakage: %s in %s' % (b.pkgid, b.repoid) - if b.mail: - r = '\n'.join(b.report)+'\n' - reports.setdefault(b.owner,[b.new,'']) - reports[b.owner][1] += r - # Also build mails for co-owners. - for toaddr in b.coowners: - reports.setdefault(toaddr,[None,'']) - reports[toaddr][1] += r - - -sep = '='*70+'\n' -summail = '' # main summary mail text -reportssummary = '' # any NEW stuff for the summary - -def giveNeedsignMsg(): - if 'needsign' in opts.warn: - return sep+"The results in this summary consider unreleased updates in the\nbuild-system's needsign-queue!\n"+sep+'\n' - else: - return '' - -def giveTestingMsg(): - if 'testing' in opts.warn: - return sep+"The results in this summary consider Test Updates!\n"+sep+'\n' - else: - return '' - -# Create summary mail text. -reportssummary += giveNeedsignMsg() -reportssummary += giveTestingMsg() -summail += reportssummary - -if not opts.noowners and len(brokendeps): - summail += ('Summary of broken packages (by owner):\n') - brokendeps.sort(bdSortByOwnerAndName) - o = None - for b in brokendeps: - if o != b.owner: - o = b.owner - seenbefore = [] - summail += '\n '+b.owner.replace('@',' AT ')+'\n' - if b.pkgid not in seenbefore: - summail += ' '+b.pkgid+' '+b.age+'\n' - seenbefore.append(b.pkgid) - -# Broken deps sorted by repository id. -brokendeps.sort(bdSortByRepoAndName) -r = None -for b in brokendeps: - if r != b.repoid: - r = b.repoid - summail += '\n\n'+sep+('Broken packages in %s:\n\n' % b.repoid) - summail += b.GetRequires()+'\n' - -# Mail init. -if domail: - srv = smtplib.SMTP( Mail['server'] ) - if ( len(Mail['user']) and len(Mail['passwd']) ): - try: - srv.login( Mail['user'], Mail['passwd'] ) - except smtplib.SMTPException: - print 'ERROR: mailserver login failed' - sys.exit(-1) - -# Mail reports to owners. -for toaddr,(new,body) in reports.iteritems(): - # Send mail to every package owner with broken package dependencies. - mailtext = 'Your following packages in the repository suffer from broken dependencies:\n\n' - mailtext += giveNeedsignMsg() - mailtext += giveTestingMsg() - mailtext += body - if domail and ('owner' in opts.mail) and toaddr!='UNKNOWN OWNER': - subject = Mail['subject'] + ' - %s' % datetime.date.today() - mail( srv, Mail['from'], toaddr, Mail['replyto'], subject, mailtext ) - -# Mail summary to mailing-list. -if domail and ('summary' in opts.mail): - subject = Mail['subject'] + ' - %s' % datetime.date.today() - toaddr = Mail['replyto'] - mailsplit( srv, Mail['from'], toaddr, '', subject, summail ) - -if domail: - srv.quit() - -if len(summail): - print summail diff --git a/scripts/epel-repoclosure/yum.epel.conf b/scripts/epel-repoclosure/yum.epel.conf deleted file mode 100644 index cfff087..0000000 --- a/scripts/epel-repoclosure/yum.epel.conf +++ /dev/null @@ -1,188 +0,0 @@ -[main] -cachedir=/tmp/mdcache -debuglevel=2 -logfile=/var/log/yum.log -pkgpolicy=newest -distroverpkg=fedora-release -reposdir=/dev/null -exactarch=1 -obsoletes=1 -retries=20 - -### EL5 ### - -[rhel-5-i386] -name=RHEL5 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-i386-server-5/ -enabled=0 - -[rhel-5-i386-vt] -name=RHEL5 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-i386-server-vt-5/ -enabled=0 - -[rhel-5-x86_64] -name=RHEL 5 - x86_64 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-x86_64-server-5/ -enabled=0 - -[rhel-5-x86_64-vt] -name=RHEL5 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-x86_64-server-vt-5/ -enabled=0 - -[rhel-5-ppc] -name=RHEL 5 ppc -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-ppc-server-5/ - -[rhel-5-ppc-vt] -name=RHEL5 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-ppc-server-vt-5/ -enabled=0 - -[fedora-epel-5-i386] -name=Fedora EPEL 5 - i386 -baseurl=file:///pub/epel/5/i386/ -enabled=0 - -[fedora-epel-testing-5-i386] -name=Fedora EPEL Test Updates 5 - i386 -baseurl=file:///pub/epel/testing/5/i386/ -enabled=0 - -[fedora-epel-5-x86_64] -name=Fedora EPEL 5 - x86_64 -baseurl=file:///pub/epel/5/x86_64/ -enabled=0 - -[fedora-epel-testing-5-x86_64] -name=Fedora EPEL Test Updates 5 - x86_64 -baseurl=file:///pub/epel/testing/5/x86_64/ -enabled=0 - -[fedora-epel-5-ppc] -name=Fedora EPEL 5 - ppc -baseurl=file:///pub/epel/5/ppc/ -enabled=0 - -[fedora-epel-testing-5-ppc] -name=Fedora EPEL Test Updates 5 - ppc -baseurl=file:///pub/epel/testing/5/ppc/ -enabled=0 - - -### EL4 ### - -[rhel-4-i386] -name=RHEL 4 - i386 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-i386-as-4/ -enabled=0 - -[rhel-4-x86_64] -name=RHEL 4 - x86_64 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-x86_64-as-4/ -enabled=0 - -#Redhat doesnt ship a 32 bit ppc kernel. we use the CentOS one -[kernel] -name=kernel -baseurl=http://infrastructure.fedoraproject.org/buildsys/4/ppc/ - -[rhel-4-ppc] -name=RHEL 4 - ppc -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-ppc-as-4/ -enabled=0 - -[fedora-epel-4-i386] -name=Fedora EPEL 4 - i386 -baseurl=file:///pub/epel/4/i386/ -enabled=0 - -[fedora-epel-testing-4-i386] -name=Fedora EPEL Test Updates 4 - i386 -baseurl=file:///pub/epel/testing/4/i386/ -enabled=0 -[fedora-epel-4-x86_64] -name=Fedora EPEL 4 - x86_64 -baseurl=file:///pub/epel/4/x86_64/ -enabled=0 - -[fedora-epel-testing-4-x86_64] -name=Fedora EPEL Test Updates 4 - x86_64 -baseurl=file:///pub/epel/testing/4/x86_64/ -enabled=0 - - -[fedora-epel-4-ppc] -name=Fedora EPEL 4 - ppc -baseurl=file:///pub/epel/4/ppc/ -enabled=0 - -[fedora-epel-testing-4-ppc] -name=Fedora EPEL Test Updates 4 - ppc -baseurl=file:///pub/epel/testing/4/ppc/ -enabled=0 - - -# Custom created stuff for compatability -[rhel-ppc-server-productivity-5] -name=RHEL 5 - ppc -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-ppc-server-productivity-5/ -enabled=0 - -[rhel-x86_64-server-productivity-5] -name=RHEL 5 - x86_64 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-x86_64-server-productivity-5/ -enabled=0 - -[rhel-i386-server-productivity-5] -name=RHEL 5 - i386 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-i386-server-productivity-5/ -enabled=0 - -[rhel-ppc-server-productivity-4] -name=RHEL 4 - ppc -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-ppc-server-productivity-4/ -enabled=0 - -[rhel-x86_64-server-productivity-4] -name=RHEL 4 - x86_64 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-x86_64-server-productivity-4/ -enabled=0 - -[rhel-i386-server-productivity-4] -name=RHEL 4 - i386 -baseurl=http://infrastructure.fedoraproject.org/rhel/rhel-i386-server-productivity-4/ -enabled=0 - -[buildsys-5-x86_64] -name=buildsys 5 - x86_64 -baseurl=http://infrastructure.fedoraproject.org/buildsys/5/x86_64/ -enabled=0 - -[buildsys-5-i386] -name=buildsys 5 - i386 -baseurl=http://infrastructure.fedoraproject.org/buildsys/5/i386/ -enabled=0 - -[buildsys-5-ppc] -name=buildsys 5 - ppc -baseurl=http://infrastructure.fedoraproject.org/buildsys/5/ppc/ -enabled=0 - -[buildsys-4-x86_64] -name=buildsys 4 - x86_64 -baseurl=http://infrastructure.fedoraproject.org/buildsys/4/x86_64/ -enabled=0 - -[buildsys-4-i386] -name=buildsys 4 - i386 -baseurl=http://infrastructure.fedoraproject.org/buildsys/4/i386/ -enabled=0 - -[buildsys-4-ppc] -name=buildsys 4 - ppc -baseurl=http://infrastructure.fedoraproject.org/buildsys/4/ppc/ -enabled=0 - - diff --git a/scripts/fedoraUsage/fedoraUsage.sh b/scripts/fedoraUsage/fedoraUsage.sh deleted file mode 100755 index 50cc075..0000000 --- a/scripts/fedoraUsage/fedoraUsage.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -function updateIps { - release=$1 - YESTERDAY=`/bin/date -d yesterday +%Y-%m-%d` - YEAR=`/bin/date -d yesterday +%Y` - MONTH=`/bin/date -d yesterday +%m` - DAY=`/bin/date -d yesterday +%d` - - /bin/mkdir -p /srv/web/fedoraUsage.private - /bin/awk /$release/'{ print $1 }' /var/log/hosts/proxy*/$YEAR/$MONTH/$DAY/http/mirrors.fedoraproject.org-access.log | /bin/sort -u > /srv/web/fedoraUsage.private/$release.tmp - /bin/sort -u /srv/web/fedoraUsage.private/$release.tmp /srv/web/fedoraUsage.private/$release.ips > /srv/web/fedoraUsage.private/$release.ips.new - /bin/mv /srv/web/fedoraUsage.private/$release.ips.new /srv/web/fedoraUsage.private/$release.ips - /usr/bin/wc -l /srv/web/fedoraUsage.private/$release.ips > /srv/web/fedoraUsage/$release -} - -updateIps rawhide -updateIps updates-released-fc6 -updateIps updates-released-f7 -updateIps updates-released-f8 -updateIps updates-released-f9 -updateIps updates-released-f10 - diff --git a/scripts/fedorahosted/template.txt b/scripts/fedorahosted/template.txt deleted file mode 100644 index 1c52d04..0000000 --- a/scripts/fedorahosted/template.txt +++ /dev/null @@ -1,11 +0,0 @@ -Project name: myProject - -Project short summary: myProject does X and Y, for the purpose of Z. - -SCM choice (git/bzr/hg/svn): hg - -Project admin Fedora Account System account name: myAccountName - -Yes/No, would you like a Trac instance for your project?: yes - -Do you need a mailing list? If so, comma-separate a list of what you'd like them to be called. Otherwise, put "no": myProject-developers, myProject-commits diff --git a/scripts/fedorahosted/xmlrpc.py b/scripts/fedorahosted/xmlrpc.py deleted file mode 100644 index eb8293c..0000000 --- a/scripts/fedorahosted/xmlrpc.py +++ /dev/null @@ -1,454 +0,0 @@ -#!/usr/bin/env python -# XML_RPC interface to "Hosting request" tickets on fedorahosted Trac. - -# Project name: myProject -# -# Project short summary: myProject does X and Y, for the purpose of Z. -# -# SCM choice (git/bzr/hg/svn): hg -# -# Project admin Fedora Account System account name: myAccountName -# -# Yes/No, would you like a Trac instance for your project?: yes -# -# Do you need a mailing list? If so, comma-separate a list of what you'd like them to be called. Otherwise, put "no": myProject-developers, myProject-commits - -######################## Test ticket: 2172 ######################## -# TODOs: -# - Make LOGFILE global. - -import re, sys, os, urllib, xmlrpclib, random -import string, stat, pwd, grp, time -from fedora.client import * -from fedora.client.fas2 import * -from getpass import getpass -from optparse import OptionParser -from popen2 import popen2 as run_command - -verbose = True -parser = OptionParser() -parser.add_option("-t", "--ticket", dest="ticket", help="The ticket number we want to work with.") -parser.add_option("-v", "--verbose", dest="verbose", action="store_true", default=False, help="Produce verbose output.") -(options, args) = parser.parse_args() - -if options.ticket is None: - print "[*] Please supply a ticket number with -t " - sys.exit() - -print "Working with ticket #%s." % options.ticket - -# Stuff for FedoraHosted only. -HOSTED_USERNAME = raw_input("Hosted Username: ") -HOSTED_PASSWORD = getpass("Hosted (Trac) Password: ") -#HOSTED_PASSWORD='' -HOSTED_SERVER='fedorahosted.org' -PROJECT_PATH='fedora-infrastructure' - -# Stuff for FAS only -- when in production can probably be set to HOSTED_USERNAME and HOSTED_PASSWORD. -FAS_USERNAME='admin' -FAS_PASSWORD='admin' -FAS_SERVER='http://publictest3.fedoraproject.org/accounts' # Leave the /accounts at the end. - -LOGFILE='./%s/log.txt' % os.path.dirname(__file__) # Same directory as the script. - - -class Repo: - """ This class constructs the repo to be built. """ - - def __init__(self, scm, ticket, projectname, groupname, logfile, commitlist): - self.name = projectname - self.group = groupname - self.logfile = logfile - self.ticketid = ticket[0] - self.scm = scm - self.commitlist = commitlist - - def log(self, status): - """ Log actions done in the Repo class. """ - - log = open(self.logfile, 'a') - log.write("[" + self.ticketid + "] " + status + "\n") - log.close() - - return status - - def groupWrite(self, path): - # 1533: 256 | 128 | 64 | 32 | 16 | 8 | 1024 | 4 | 1 - # O: R W X G: R W X +s O: r x - chmod = 1533 - os.chmod(path, chmod) - for filename in os.listdir(path): - filepath = os.path.join(path, filename) - if os.path.isdir(filepath): - self.groupWrite(filepath) - else: - os.chmod(filepath, chmod) - - def chownDir(self, username, group, path): - uid = pwd.getpwnam(username)[2] - gid = grp.getgrnam(group)[2] - os.chown(path, uid, gid) - for filename in os.listdir(path): - filepath = os.path.join(path, filename) - if os.path.isdir(filepath): - self.chownDir(username,group,filepath) - else: - os.chown(filepath, uid, gid) - - def hg(self): - """ Create an Hg repository. """ - print 'Creating a Mercurial repo.' - # Initialize the repo. - os.mkdir("/hg/" + self.name) - os.chdir("/hg/" + self.name) - run_command("hg init") - - # Set permissions on it. - self.groupWrite("/hg/" + self.name) - self.chownDir("root", self.group, self.name) - - print "Created the Mercurial repo." - self.log("Created a Mercurial repo.") - - #Do we need to set up a commit hook for a mailing list? - if self.commitlist != "no": #Will it be passed as that? - file = open("/hg/" + self.name + "/.hg/hgrc", 'w') - file.write("[extensions]\nhgext.notify= \n") - file.write("[hooks]\nchangegroup.notify = python:hgext.notify.hook\n") - file.write("[email]\nfrom = admin@fedoraproject.org\n") - file.write("[smtp]\nhost = localhost\n") - file.write("[web]\nbaseurl = http://hg.fedoraproject.org/hg\n") - file.write("[notify]\nsources = serve push pull bundle\n") - file.write("test = False\n") - file.write("config = /hg/" + self.name + "/.hg/subscriptions\n") - file.write("maxdiff = -1\n") - file.close() - - file = open("/hg/"+ self.name + "/.hg/subscriptions") - file.write("[usersubs]\n" + self.commitlist + " = *\n") - file.write("[reposubs]\n") - file.close() - - return - - def git(self, description, owner): - """ Create a Git repository. """ - - # Initialize the repo. - os.mkdir("/git/" + self.name + ".git") - os.chdir("/git/" + self.name + ".git") - run_command("git --bare init --shared=true") - - time.sleep(1) - - description_fh = open("/git/" + self.name + ".git/description", "w") - description_fh.write(description) - description_fh.close() - - # Set up the post-update hook (and run it once) - os.remove("./hooks/post-update") - os.symlink("/usr/bin/git-update-server-info", "./hooks/post-update") - run_command("git update-server-info") - - # Permissions. - self.groupWrite("/git/" + self.name + ".git") - - # TODO, remove this one day (not a priority: no user input) - run_command("find . -perm /u+w -a ! -perm /g+w -exec chmod g+w \{\} \;") - self.chownDir(owner, self.group, "/git/" + self.name + ".git") - - print "Created the git repo." - self.log("Created a git repo.") - - if self.commitlist != "no": - os.chdir("/git") - f = open(self.name + ".git/commit-list", "w") - f.write(self.commitlist) - f.close() - os.remove(self.name + ".git/hooks/update") - os.symlink("/usr/bin/fedora/git-commit-mail-hook", self.name + ".git/hooks/update") - - return - - def bzr(self): - """ Create a Bazaar repository (shared storage between branches). """ - - os.mkdir("/bzr/" + self.name) - os.chdir("/bzr/" + self.name) - - # Initialize repo. - run_command("bzr init-repo . --no-trees") - self.groupWrite("/bzr/" + self.name) - self.chownDir("root", self.group, "/bzr/" + self.name) - - print "Created the bzr repo." - self.log("Created a bzr repo.") - return - - def svn(self): - """ Create a subversion repository. """ - - os.mkdir("/svn/" + self.name) - os.chdir("/svn/" + self.name) - - # Initialize repo. - run_command("svnadmin create .") - self.chownDir("root", self.group, "/svn/" + self.name) - self.groupWrite("/svn/" + self.name) - - print "Created the subversion repository." - self.log("Created a subversion repo.") - - if self.commitlist != "no": - os.chdir("/svn") - #run_command("echo " + self.commitlist + " | tee " + self.name + "/commit-list > /dev/null") - f = open(self.name + "/commit-list", "w") - f.write(self.commitlist) - f.close() - os.symlink("/usr/bin/fedora/svn-commit-mail-hook ", self.name + "/hooks/update") - return - -class Group: - def __init__(self, ticket, client, name, display_name, owner, group_type, logfile): - - self.client = client - self.name = name - self.display_name = display_name - self.owner = owner - self.group_type = group_type - self.logfile = logfile - self.ticketid = ticket[0] - - def log(self, status): - """ Logs actions done in the Group creation class.. """ - log = open(self.logfile, 'a') - log.write("[" + self.ticketid + "] " + status + "\n") - log.close() - - return status - - def create(self): - """ Creates an FAS group based on the information provided in __init__. """ - - groupinfo = {} - groupinfo['name'] = self.name - groupinfo['display_name'] = self.display_name - groupinfo['owner'] = self.owner - groupinfo['group_type'] = self.group_type - - self.log("Sending request to /group/create") - response = self.client.send_request('/group/create', groupinfo, auth=True) - try: - response['group']['id'] - self.log("Group creation: Success") - run_command("fasClient -i --force-refresh") - return True - except: - self.log("Group creation: Failed to create %s [%s]" % (groupinfo['name'], response)) - return False - - -class Ticket: - """ A class instance with methods to call for each hosting request ticket. """ - - def __init__(self, ticket, logfile='', xmlrpc=''): - self.ticket = ticket - self.logfile = logfile - self.id = ticket[0] - self.xmlrpc = xmlrpc - - # For now, assume [3] will always be the dictionary. - self.description = self.ticket[3]['description'].split("\n") - - project = {"mailing_lists": []} - warnings = [] - - def log(self, status): - """ Log the current status to the logfile. """ - log = open(self.logfile, 'a') - log.write("[" + self.id + "] " + status + "\n") - log.close() - - return status - - def parse_line(self, search, shortname, line): - """ The way this works is we search the line (for $search), and - if we match, we split at the first colon. Everything after that is considered - user input. We also do some on the fly validation here, simply so we don't have to call - a valdiation function every time. It all gets done at the same time.""" - - if search in line: - fieldvalue = line.split(": ", 1)[1] - - # See if the user's response is blank. - if fieldvalue == "": - self.warnings.append("The '%s' field has a blank answer. Please answer all questions." % search) - - - else: - # Has a response, and the value validates. - if shortname == 'name': - if len(fieldvalue) > 70: - self.warnings.append("The 'Project name' field should be less than 70 characters.") - - if not re.match(r'[\w\-\ ]+$', fieldvalue): - self.warnings.append("The 'Project name' field can only contain characters 0-9, a-z (upper/lowercase), , , and ") - - if shortname == 'summary': - if len(fieldvalue) > 1000: - self.warnings.append("Please make your entry for the 'Project short summary' field less than 1000 characters.") - if not re.match(r'[\w\-\ \.\,]+$', fieldvalue): - self.warnings.append("The 'Project short summary' field can only contain characters 0-9, a-z (upper/lowercase), , , , and .") - - if shortname == 'scm': - print '"%s"' % fieldvalue - if not fieldvalue in ["git" ,"svn", "hg", "bzr"]: - self.warnings.append("Please make sure your scm choice is one of: git, svn, hg, bzr") - - if shortname == 'trac': - if fieldvalue.lower() != ("yes" or "no"): - self.warnings.append("Please answer 'yes' or 'no' as to whether or not you need a Trac instance.") - - if shortname == 'mailinglist': - if fieldvalue.lower() != "no": - self.mailinglists = True - if not re.match(r'[\w\-\ \,]+$', fieldvalue): - self.warnings.append("The 'mailing list' field can only contain characters 0-9, a-z (upper/lowercase), , , , and .") - else: - self.mailinglists = False - - if shortname == 'commitnotices': - if fieldvalue.lower() != "no": - if not re.match(r'([0-9a-z\.\+\-]+)@(?:lists.fedoraproject.org|lists.fedorahosted.org)', fieldvalue.lower()): - self.warnings.append("The commit notices list must be hosted by the Fedora Project (i.e ending with @lists.fedoraproject.org or @lists.fedorahosted.org address") - - self.project[shortname] = fieldvalue - - - def parse_ticket(self): - """ This function actually makes the calls to parse_line() and puts the - content of the ticket into values that we can work with. That's all this does. """ - - self.log("Parsing ticket.") - - for line in self.description: - self.parse_line("Project name", "name", line) - self.parse_line("Project short summary", "summary", line) - self.parse_line("SCM choice", "scm", line) - self.parse_line("Trac instance", "trac", line) - self.parse_line("mailing list", "mailinglist", line) - self.parse_line("Send commits", "commitnotices", line) - - self.project['group'] = (self.project['scm'] + (self.project['name'].replace(" ",""))).lower() - self.project['owner'] = self.ticket[3]['reporter'] - - def handle_mailing_lists(self): - """ The purpose of this function is to see whether or not a user - wants a mailing list, and if they do, add those to a list, so we - can create them all. (self.create_mailing_lists())""" - - self.log("Dealing with mailing lists (not creating yet).") - - if self.mailinglists: - lists = self.project['mailinglist'].split(",") - for req_list in lists: - req_list = req_list.replace(" ", "") - self.project['mailing_lists'].append(req_list) - - def post_warnings(self): - """ This method takes all the warnings in self.warnings and puts them in a comment on the ticket. """ - - self.log("Posting warnings to the ticket.") - - comment = "Please fix the following issues, and create a *new* ticket. Please do not re-open already-processed tickets.\n\n" - - for warning in self.warnings: - comment += "- " + warning + "\n" - self.log("Warning: " + warning) - - self.xmlrpc.ticket.update(self.id, comment, {'resolution': 'Waiting on User Input', 'status': 'closed'}) - - return - - def decide(self): - """ This method decides whether or not a project gets added. """ - - if len(self.warnings) > 0: - self.log("Decided negatively on accepting the ticket.") - return False - else: - self.log("Decided positively on accepting the ticket.") - return True - - def add_project(self): - - self.log("Adding the project.") - run_command("sudo /usr/local/bin/hosted-setup.sh '%s' '%s' '%s'" % (self.project['name'], self.project['owner'], self.project['scm'])) - comment = "The project has been automatically created.\n" - comment += "If there are any issues, please comment on this ticket." - - self.xmlrpc.ticket.update(self.id, comment, {'resolution': 'Project Created', 'status': 'closed'}) - return - -class MailingList: - def __init__(self, username, client): - self.username = username - self.client = client - - def getClientEmail(self): - response = self.client.person_by_username(self.username) - return response['email'] - - def generatePassword(self): - return ''.join(random.choice(string.ascii_letters + string.digits) for x in range(random.randint(10,20))) - - def create(self, name, email, password): - run_command("sudo /usr/lib/mailman/bin/newlist %s %s %s" % (name, self.getClientEmail, password)) - -#for ticket in xmlrpc.ticket.query("summary=^Hosting request&status=new|open"): -print "Connecting to the Trac XMLRPC." -xmlrpc = xmlrpclib.ServerProxy("https://%s:%s@%s/%s/login/xmlrpc" % ( - urllib.quote(HOSTED_USERNAME), urllib.quote(HOSTED_PASSWORD), HOSTED_SERVER, PROJECT_PATH)) - -ticket_id = xmlrpc.ticket.get(options.ticket) - -ticket = Ticket(ticket_id, logfile=LOGFILE, xmlrpc=xmlrpc) -ticket.parse_ticket() - -accepted = ticket.decide() -if accepted: - # Create an FAS object. - client = AccountSystem(FAS_SERVER, username=FAS_USERNAME, password=FAS_PASSWORD) - - # Create the group. - group = Group( ticket_id, client, ticket.project['group'], ticket.project['name'], - ticket.project['owner'], ticket.project['scm'], LOGFILE) - group.create() - - # Meh, deal with mailing lists. - ticket.handle_mailing_lists() - mlist = MailingList(ticket.project['owner'], client) - owner_email = mlist.getClientEmail() - for mailinglist in ticket.project['mailing_lists']: - password = mlist.generatePassword() - mlist.create(mailinglist, owner_email, password) - - # Create the repository. - repo = Repo(ticket.project['scm'], ticket_id, ticket.project['name'], ticket.project['group'], LOGFILE, ticket.project['commitnotices']) - print "SCM: %s" % ticket.project['scm'] - if ticket.project['scm'] == 'git': repo.git(ticket.project['summary'], ticket.project['owner']) - elif ticket.project['scm'] == 'hg': repo.hg() - elif ticket.project['scm'] == 'bzr': repo.bzr() - elif ticket.project['scm'] == 'svn': repo.svn() - - # Add the project. - ticket.add_project() - -else: - ticket.post_warnings() - -if verbose: - for key, value in ticket.project.items(): - print "%s: %s" % (key, value) - - diff --git a/scripts/gather-diff-instances/gather-diff-instances.py b/scripts/gather-diff-instances/gather-diff-instances.py deleted file mode 100755 index bf74e4d..0000000 --- a/scripts/gather-diff-instances/gather-diff-instances.py +++ /dev/null @@ -1,173 +0,0 @@ -#!/usr/bin/python -# skvidal -# fedoraproject.org - -# run the json outputter -# output to /var/log/instance-lists/timestamp -# compare newest one to the last one -# mail results to mailto, if any -# ignore instances with a key_name in blacklist - - -destdir='/var/log/instance-lists/' -mailto='admin@fedoraproject.org' -blacklist=['buildsys'] - - -import sys -import time -import json -import glob -import os -import smtplib -from email.MIMEText import MIMEText - -from nova import context -from nova import db -from nova import flags - - - -def list_vms(host=None): - """ - make a list of vms and expand out their fixed_ip and floating ips sensibly - """ - flags.parse_args([]) - my_instances = [] - if host is None: - instances = db.instance_get_all(context.get_admin_context()) - else: - instances = db.instance_get_all_by_host( - context.get_admin_context(), host) - - for instance in instances: - my_inst = {} - my_inst = dict(instance).copy() - for (k,v) in my_inst.items(): - try: - json.encoder(v) - except TypeError, e: - v = str(v) - my_inst[k] = v - - ec2_id = db.get_ec2_instance_id_by_uuid(context.get_admin_context(), instance.uuid) - ec2_id = 'i-' + hex(int(ec2_id)).replace('0x', '').zfill(8) - my_inst['ec2_id'] = ec2_id - try: - fixed_ips = db.fixed_ip_get_by_instance(context.get_admin_context(), instance.uuid) - except: - pass - my_inst['fixed_ips'] = [ ip.address for ip in fixed_ips ] - my_inst['floating_ips'] = [] - for ip in fixed_ips: - my_inst['floating_ips'].extend([ f_ip.address for f_ip in db.floating_ip_get_by_fixed_address(context.get_admin_context(), ip.address)]) - - my_instances.append(my_inst) - return my_instances - - - -def diff_instances(old, new): - """ - Take 2 lists of instances @old, @new - diff them and return a list of strings citing changes. - """ - old_uuids = {} - new_uuids = {} - for vm in old: - old_uuids[vm['uuid']] = vm - - for vm in new: - new_uuids[vm['uuid']] = vm - - uuids = set(new_uuids.keys() + old_uuids.keys()) - ret = [] - ret_added = [] - ret_removed = [] - removed = [] - added = [] - for uuid in sorted(uuids): - if uuid not in new_uuids: - vm = old_uuids[uuid] - removed.append(vm) - - elif uuid not in old_uuids: - vm = new_uuids[uuid] - added.append(vm) - - - else: - old_vm = old_uuids[uuid] - new_vm = new_uuids[uuid] - changed = [] - for k,v in old_vm.items(): - if v != new_vm.get(k, 'NOT_A_MATCH'): - changed.append(k) - if changed: - ret.append('Changes to: %s' % uuid) - for k in changed: - ret.append(" %s changed from '%s' to '%s'" % (k, old_vm[k], new_vm[k])) - - for vm in added: - if vm['key_name'] not in blacklist: - ret_added.append(' %s %s %s %s' % (uuid, vm['display_name'], vm['floating_ips'][0], vm['key_name'])) - if ret_added: - ret_added[:0].append('Instance(s) Added:\n') - - for vm in removed: - if vm['floating_ips'][0] and (vm['key_name'] not in blacklist): - ret_removed.append(' %s %s %s %s' % (uuid, vm['display_name'], vm['floating_ips'][0], vm['key_name'])) - if ret_removed: - ret_removed[:0].append('Instance(s) Removed:\n') - - ret = ret + ret_added + ret_removed - return ret - - - -def email(to, subject, text): - """ - send email - """ - mail_from = 'cloudadmin@fedoraproject.org' - mail_to = '%s' % to - - output = text - - msg = MIMEText(output) - msg['Subject'] = subject - msg['From'] = mail_from - msg['To'] = mail_to - s = smtplib.SMTP() - s.connect() - s.sendmail(mail_from, [mail_to], msg.as_string()) - s.close() - - -def main(): - if not os.path.exists(destdir): - os.makedirs(destdir) - - - # get the instances list - new_instances = list_vms() - now=time.strftime('%Y-%m-%d-%H:%M.json') - f = open(destdir + '/' + now, 'w') - f.write(json.dumps(new_instances)) - f.close() - - # get the last one - fns = [fn for fn in glob.glob(destdir + '/*.json') ] - if len(fns) < 2: - return - - last = sorted(fns)[-2] - old_instances = json.load(open(last)) - res = diff_instances(old_instances, new_instances) - - if res: - email(mailto, "Changes to cloud instances", '\n'.join(res)) - - -if __name__ == "__main__": - main() - diff --git a/scripts/geoip/README b/scripts/geoip/README deleted file mode 100644 index 248d18c..0000000 --- a/scripts/geoip/README +++ /dev/null @@ -1,61 +0,0 @@ -GPL, initially created by mdomsch and adapted by |DrJef| - -Example Usage of python animated_clients.py.txt - -python animated_clients.py.txt --indir=./example_input/ --outdir=./example_output/ --header="Header string" --footer="Footer string" - -This script is still somewhat fragile and does not yet do all the path -and file existance checking that it should. To use the example -invocation you will need to make sure that the indir and outdir -locations exists. - -indir is used to hold file inputs that the script needs. -The example invocation requires that indir holds: - ips-with-epoch.txt : file with ip clients and epoch timestamp - glds05ag30.asc : population density data - regions.txt : region definitions - -indir defaults to ./ - -if the file saved_data.pickle exists in outdir, this file will be loaded -in an attempt to create image frames based on previous timestamp -imformatin stored in the pickle file. This allows you to generate -additional frames in a sequence without parsing the full ip log on each -run. For example, you can run this script daily, using ip client -information from the end of previous day stored in the pickle file. -Run in this manner, the script will generate 24 new frames daily using -only daily ip client logs for each day. - - -outdir defaults to ./animation-frames/ -you must make sure outdir exists. - -outdir holds: - the sequence of generated frame images with prefix frame_ - the pickle file saved_data.pickle, which stores previous frame data - summary client_per_capita: clientpop_.png - population density: population_.png - summary of client density: current_.png - - is the most recent epoch associate with a the script. - - -Gridder Population Data Citation: - -Center for International Earth Science Information Network (CIESIN), Columbia -University; United Nations Food and Agriculture Programme (FAO); and Centro -Internacional de Agricultura Tropical (CIAT). 2005. Gridded Population of the -World: Future Estimates (GPWFE). Palisades, NY: Socioeconomic Data and Applications -Center (SEDAC), Columbia University. Available at -http://sedac.ciesin.columbia.edu/gpw. (download date: 2007-10-19). - -ARCHIVE CONTENTS This archive contains the low-resolution vesion of the -UN-adjusted population density grids in ASCII format. The raster data -are at 0.5 degrees (30 arc-minutes) resolution. This archive contains -the following grid(s): - -ds05ag30 : population densities in 2005, adjusted to match UN totals, -persons per square km - - - diff --git a/scripts/geoip/animated_clients.py.txt b/scripts/geoip/animated_clients.py.txt deleted file mode 100644 index 940f06c..0000000 --- a/scripts/geoip/animated_clients.py.txt +++ /dev/null @@ -1,564 +0,0 @@ -#!/usr/bin/python -# -# convert -delay 5 `ls -rt *.png` animation.gif -import sys -import getopt -import GeoIP -import pickle -from pylab import * -from time import ctime -import matplotlib -from matplotlib.numerix import ma -from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas -from matplotlib.toolkits.basemap import Basemap -from matplotlib.colors import LogNorm -from matplotlib.ticker import LogFormatterMathtext as JefFormatter -import os.path as path - -gi = GeoIP.open("/usr/share/GeoIP/GeoLiteCity.dat", GeoIP.GEOIP_MEMORY_CACHE) - -# turn interactive mode on for dynamic updates. If you aren't in -# interactive mode, you'll need to use a GUI event handler/timer. -#p.ion() -#alphas = p.arange(0,1,0.01) -#x = 2*p.pi*alphas -#print x.shape -#lines=[] -#for i in xrange(len(alphas)): -# lines.append(p.scatter([x[i]], [p.sin(x[i])],alpha=alphas[i],edgecolor=(0,0,0,0))) -# -#for i in xrange(len(alphas)): -# for j in xrange(len(lines)): -# a=lines[j].get_alpha() -# lines[j].set_alpha(a+0.1 % 1) # update the data -# p.draw() # redraw the canvas - -class saved_frame_data: - def __init__(self,filename=None): - self.Z=None - self.C=None - self.total_clients=None - self.epoch=None - self.next_epoch=None - self.initial_epoch=None - self.framenum=None - self.lat_pixels=None - self.lon_pixels=None - self.lon_smooth=None - self.lat_smooth=None - if filename != None : self.gather(filename) - - def gather(self,filename): - print "Gathering data from pickle file:",filename - try: - output = open(filename, 'rb') - tmp=pickle.load(output) - output.close() - self.Z=tmp.Z - self.C=tmp.C - self.total_clients=tmp.total_clients - self.epoch=tmp.epoch - self.next_epoch=tmp.next_epoch - self.initial_epoch=tmp.initial_epoch - self.framenum=tmp.framenum - self.lat_pixels=tmp.lat_pixels - self.lat_smooth=tmp.lat_smooth - self.lon_pixels=tmp.lon_pixels - self.lon_smooth=tmp.lon_smooth - print "Done Gathering Data for epoch",self.epoch - except: - print "File not found" - - def dump(self,filename): - print "Pickling epoch:",self.epoch - output = open(filename, 'wb') - pickle.dump(self, output) - output.close() - print "Done Pickling" - - -def draw_client_animation(clients=None,r={}): - iplist={} - lons={} - lats={} - Zdict={} - Cdict={} - Tdict={} - offset=0 - total=0 - Z=ma.zeros((0,0)) - C={} - if frame_data.epoch is not None: - if frame_data.Z is not None: - Zdict[frame_data.epoch]=frame_data.Z - Z=frame_data.Z - if frame_data.C is not None: - Cdict[frame_data.epoch]=frame_data.C - C=frame_data.C - if frame_data.total_clients is not None: - Tdict[frame_data.epoch]=frame_data.total_clients - total=frame_data.total_clients - if frame_data.framenum is not None: offset=frame_data.framenum+1 - - for client in clients.keys(): - if clients[client]['epoch'] >= min_epoch : - client_hour=int((clients[client]['epoch']-min_epoch)/3600) - if not iplist.has_key(client_hour): iplist[client_hour]=set([]) - iplist[client_hour].add(client) -# cummulative_iplist={} - for hour in xrange(frame_hours): - current_hour_epoch=min_epoch+3600*hour - previous_hour_epoch=min_epoch+3600*(hour-1) - next_hour_epoch=min_epoch+3600*(hour+1) - print "Processing epoch: %d hour %d out of %d" % (current_hour_epoch,hour,frame_hours) - framefilename=make_path(outdir,frame_prefix+"%06d" % (int(offset+hour),)+"."+frame_filetype) - print framefilename -# if not cummulative_iplist.has_key(hour): cummulative_iplist[hour]=set([]) - m = Basemap(llcrnrlon=r['ll_lon'],llcrnrlat=r['ll_lat'],urcrnrlon=r['ur_lon'],urcrnrlat=r['ur_lat'],\ - resolution='l',projection='cyl') -# for h in xrange(hour+1): -# print h, len(iplist[h]) -# if iplist.has_key(h): cummulative_iplist[hour].update(iplist[h]) - if iplist.has_key(hour): - if Zdict.has_key(previous_hour_epoch): -# print "Previous hour found",previous_hour_epoch,current_hour_epoch,next_hour_epoch - Z,C=parse_iplist(iplist[hour],m,clients,oldZ=Zdict[previous_hour_epoch],oldC=Cdict[previous_hour_epoch]) - total=Tdict[previous_hour_epoch]+len(iplist[hour]) - else: -# print "Previous hour not found",previous_hour_epoch,current_hour_epoch,next_hour_epoch - Z,C=parse_iplist(iplist[hour],m,clients,oldZ=None,oldC=None) - total=len(iplist[hour]) - Zdict[current_hour_epoch]=Z - Cdict[current_hour_epoch]=C - Tdict[current_hour_epoch]=total -# print hour,total,Tdict[current_hour_epoch] - frame_data.Z=Z - frame_data.C=C - frame_data.framenum=int(hour+offset) - frame_data.epoch=current_hour_epoch - frame_data.next_epoch=next_hour_epoch - frame_data.total_clients=total - if frame_data.initial_epoch is None: frame_data.initial_epoch=current_hour_epoch - if pickle_frames: frame_data.dump(datafile) - - if iplist.has_key(hour): - if not lons.has_key(hour): lons[hour]=[] - for ip in iplist[hour]: - lons[hour].append(clients[ip]['lon']) - if not lats.has_key(hour): lats[hour]=[] - for ip in iplist[hour]: - lats[hour].append(clients[ip]['lat']) - - dpi=100 - dimx=800/dpi - dimy=400/dpi - - if plot_frames : - Zm = where(Z <= 0.,1.e10,Z) - Zm = ma.masked_values(Zm, 1.e10) - fig=figure(1,figsize=(dimx,dimy), dpi=dpi, frameon=True, facecolor='blue',edgecolor='white') - clf() - ax=fig.add_axes([0.05,0.1,0.8,0.8],axisbg=(0.05,0.65,0.05)) - canvas = FigureCanvas(fig) - # draw coasts and fill continents. - m.drawcoastlines(linewidth=0.5) - m.drawcountries(linewidth=0.5) - m.drawlsmask([100,100,100,0],[100,210,210,255]) - palette = cm.YlOrRd -# print len(lats),len(lons),Z.shape - -# imaxes=fig.add_axes([0.05,0.1,0.8,0.8]) - m.imshow(Zm,palette,extent=(m.xmin,m.xmax,m.ymin,m.ymax), norm=LogNorm(),interpolation='gaussian') - if lons.has_key(hour) :s=m.scatter(lons[hour],lats[hour],s=5,c='b',edgecolor=(0,0,0,0),alpha=0.8) - if lons.has_key(hour-1):s=m.scatter(lons[hour-1],lats[hour-1],s=5,c='b',edgecolor=(0,0,0,0),alpha=0.5) - if lons.has_key(hour-2):s=m.scatter(lons[hour-2],lats[hour-2],s=5,c='b',edgecolor=(0,0,0,0),alpha=0.2) - - l,b,w,h = ax.get_position() - cax = axes([l+w+0.005, b, 0.03, h]) - colorbar(cax=cax,format=JefFormatter()) # draw colorbar - figtext(l+w+0.1,0.5,"Client Density: clients per km^2",va="center",ha="center",rotation="vertical",fontsize=10) - figtext(0.05,0.05,footer,backgroundcolor='white',fontsize="smaller",va="bottom") - figtext(0.05,0.95,header,backgroundcolor='white',fontsize="smaller",va="top") - figtext(0.055,0.11,"Time: %s\n to : %s" % (ctime(current_hour_epoch),ctime(next_hour_epoch))\ - ,backgroundcolor='white',fontsize="smaller",va="bottom") - figtext(0.541,0.11,"Total Clients: %-12d\nsince %s " % (total,ctime(frame_data.initial_epoch))\ - ,backgroundcolor='white',fontsize="smaller",va="bottom") - canvas.print_figure(framefilename, dpi=100,facecolor='white',edgecolor='white') - - - P=parse_population(m,populationfile) -# Current Density Map - if len(Z) > 0 : - Zm = where(Z <= 0.,1.e10,Z) - Zm = ma.masked_values(Zm, 1.e10) - if not pickle_frames: frame_data.dump(datafile) - latestfilename=make_path(outdir,"latest_client_density" + "."+frame_filetype) - print latestfilename - fig=figure(2,figsize=(dimx,dimy), dpi=dpi, frameon=True, facecolor='blue',edgecolor='white') - clf() - ax=fig.add_axes([0.05,0.1,0.8,0.8],axisbg=(0.05,0.65,0.05)) - canvas = FigureCanvas(fig) - # draw coasts and fill continents. - m.drawcoastlines(linewidth=0.5) - m.drawcountries(linewidth=0.5) - m.drawlsmask([100,100,100,0],[100,210,210,255]) - palette = cm.YlOrRd -# print len(lats),len(lons),Z.shape -# imaxes=fig.add_axes([0.05,0.1,0.8,0.8]) - m.imshow(Zm,palette,extent=(m.xmin,m.xmax,m.ymin,m.ymax), norm=LogNorm(),interpolation='gaussian') - - l,b,w,h = ax.get_position() - cax = axes([l+w+0.005, b, 0.03, h]) - colorbar(cax=cax,format=JefFormatter()) # draw colorbar - figtext(l+w+0.1,0.5,"Client Density: clients per km^2",va="center",ha="center",rotation="vertical",fontsize=10) - figtext(0.055,0.11,"Time: %s\n to : %s" % (ctime(frame_data.initial_epoch),ctime(next_hour_epoch))\ - ,backgroundcolor='white',fontsize="smaller",va="bottom") - figtext(0.05,0.05,footer,backgroundcolor='white',fontsize="smaller",va="bottom") - figtext(0.05,0.95,header,backgroundcolor='white',fontsize="smaller",va="top") - figtext(0.541,0.11,"Total Clients: %-12d\nsince %s " % (total,ctime(frame_data.initial_epoch))\ - ,backgroundcolor='white',fontsize="smaller",va="bottom") - canvas.print_figure(latestfilename, dpi=100,facecolor='white',edgecolor='white') - - - if len(P) > 0 : - Pm = where(P <= 0.,1.e10,P) - Pm = ma.masked_values(Pm, 1.e10) -# Pm=log10(Pm) - if not pickle_frames: frame_data.dump(datafile) - popframefilename=make_path(outdir,"population_density" + "."+frame_filetype) - print popframefilename - fig=figure(3,figsize=(dimx,dimy), dpi=dpi, frameon=True, facecolor='blue',edgecolor='white') - clf() - ax=fig.add_axes([0.05,0.1,0.8,0.8],axisbg=(0.05,0.65,0.05)) - canvas = FigureCanvas(fig) - # draw coasts and fill continents. - m.drawcoastlines(linewidth=0.5) - m.drawcountries(linewidth=0.5) - m.drawlsmask([100,100,100,0],[100,210,210,255]) - palette = cm.cool -# print len(lats),len(lons),Z.shape -# imaxes=fig.add_axes([0.05,0.1,0.8,0.8]) - m.imshow(Pm,palette,extent=(m.xmin,m.xmax,m.ymax,m.ymin), norm=LogNorm(),interpolation='gaussian') -# imshow(Pm) - - l,b,w,h = ax.get_position() - cax = axes([l+w+0.005, b, 0.03, h]) - colorbar(cax=cax,format=JefFormatter()) # draw colorbar - figtext(l+w+0.1,0.5,"Pop Density 2005: pop per km^2",va="center",ha="center",rotation="vertical",fontsize=10) - figtext(0.055,0.11,"Time: %s\n to : %s" % (ctime(frame_data.initial_epoch),ctime(next_hour_epoch))\ - ,backgroundcolor='white',fontsize="smaller",va="bottom") - figtext(0.05,0.05,footer,backgroundcolor='white',fontsize="smaller",va="bottom") - figtext(0.05,0.95,header,backgroundcolor='white',fontsize="smaller",va="top") - canvas.print_figure(popframefilename, dpi=100,facecolor='white',edgecolor='white') - - if (len(P) > 0) and (len (Z) > 0) : - PZm = Zm/Pm -# Pm = ma.masked_values(Pm, 1.e10) -# Pm=log10(Pm) - if not pickle_frames: frame_data.dump(datafile) - popframefilename=make_path(outdir,"latest_client_per_capita" + "."+frame_filetype) - print popframefilename - fig=figure(4,figsize=(dimx,dimy), dpi=dpi, frameon=True, facecolor='blue',edgecolor='white') - clf() - ax=fig.add_axes([0.05,0.1,0.8,0.8],axisbg=(0.05,0.65,0.05)) - canvas = FigureCanvas(fig) - # draw coasts and fill continents. - m.drawcoastlines(linewidth=0.5) - m.drawcountries(linewidth=0.5) - m.drawlsmask([100,100,100,0],[100,210,210,255]) - palette = cm.spring -# print len(lats),len(lons),Z.shape -# imaxes=fig.add_axes([0.05,0.1,0.8,0.8]) - m.imshow(PZm,palette,extent=(m.xmin,m.xmax,m.ymax,m.ymin), vmin=1E-6, vmax=1E-3, norm=LogNorm(),interpolation='gaussian') -# imshow(PZm) - - l,b,w,h = ax.get_position() - cax = axes([l+w+0.005, b, 0.03, h]) - colorbar(cax=cax,format=JefFormatter()) # draw colorbar - figtext(l+w+0.1,0.5,"Clients per Capita",va="center",ha="center",rotation="vertical",fontsize=10) - figtext(0.055,0.11,"Time: %s\n to : %s" % (ctime(frame_data.initial_epoch),ctime(next_hour_epoch))\ - ,backgroundcolor='white',fontsize="smaller",va="bottom") - figtext(0.05,0.05,footer,backgroundcolor='white',fontsize="smaller",va="bottom") - figtext(0.05,0.95,header,backgroundcolor='white',fontsize="smaller",va="top") - canvas.print_figure(popframefilename, dpi=100,facecolor='white',edgecolor='white') - - if stats : - for country,count in C.items(): - print country," :: ",count - -def parse_iplist(iplist,m,clients,oldZ=None,oldC=None,latpixels=180,lonpixels=360,lat_smooth=1,lon_smooth=1): - rad_deg=pi/180.0 - r0=6378.1 - latscale=(m.ymax-m.ymin)/latpixels - lonscale=(m.xmax-m.xmin)/lonpixels - lat_array=arange(m.ymin,m.ymax+latscale,latscale) - lon_array=arange(m.xmin,m.xmax+lonscale,lonscale) - maxlat=len(lat_array)-1 - maxlon=len(lon_array)-1 - Z=zeros((len(lat_array),len(lon_array)),dtype='float') - if oldC is None : seen_countries={} - else: seen_countries=oldC - f = open(inputfile, 'r') - for ip in iplist: -# print clients[ip].keys() - country_code=clients[ip]['cc'] -# Deal with client - if stats == True: - if seen_countries.has_key(country_code) : seen_countries[country_code]+=1 - else : seen_countries[country_code]=1 - lat=clients[ip]['lat'] - lon=clients[ip]['lon'] - if ( lat == 0.0 ) and ( lon == 0.0 ) : -# print "Lat/Lon 0.0:",country_code - lat = -89.0 - i_lat=int(float((lat-lat_array[0]))/float(latscale)) - i_lon=int(float((lon-lon_array[0]))/float(lonscale)) - for i in xrange(-int(lat_smooth),int(lat_smooth+1),1): - for j in xrange(-int(lon_smooth),int(lon_smooth+1),1): - if ( i_lat+i >= 0 ) and (i_lat+i < maxlat) : - if ( i_lon+j >= 0) and ( i_lon+j < maxlon) : - Z[i_lat+i,i_lon+j]+=1.0 - f.close() -# End of file, now do summary density calculation - for i in xrange(len(lat_array)): - area=r0*r0*rad_deg*lonscale*abs( sin(rad_deg*(lat_array[i]-latscale/2.0) )-sin(rad_deg*(lat_array[i]+latscale/2.0) ) ) - for j in xrange(len(lon_array)): - if area == 0.0 : Z[i,j]=0.0 - else: Z[i,j]=Z[i,j]/area/(2.0*lon_smooth+1)/(2.0*lat_smooth+1) -# Lon,Lat=meshgrid(lon_array,lat_array) -# X,Y=m(Lon,Lat) - if oldZ is not None: -# print type(oldZ),type(Z) -# oldZ.unmask() - Z=oldZ+Z - return Z,seen_countries - - -def parse_population(m,populationfile=None,latpixels=180,lonpixels=360,lat_smooth=1,lon_smooth=1): - rad_deg=pi/180.0 - r0=6378.1 - latscale=(m.ymax-m.ymin)/latpixels - lonscale=(m.xmax-m.xmin)/lonpixels - lat_array=arange(m.ymin,m.ymax+latscale,latscale) - lon_array=arange(m.xmin,m.xmax+lonscale,lonscale) - - if not (populationfile is None): - P=zeros((len(lat_array),len(lon_array)),dtype='float') - pop_latstep=0.5 - pop_latmin=-58.0 - pop_lonstep=0.5 - pop_lonmin=-180.0 - try: - pop_data=load(populationfile,skiprows=6) - print "Success processing population file" - except: - print "error processing population file" - P=zeros((0,0)) - return P - - print pop_data.shape,P.shape - pop_latlen,pop_lonlen=pop_data.shape - pop_latmax=pop_latmin+pop_latstep*pop_latlen - pop_lonmax=pop_lonmin+pop_lonstep*pop_lonlen - for i in xrange(pop_latlen): - pop_lat=pop_latmax-float(pop_latstep)*float(i) - pop_lat_index=int(float(pop_lat-lat_array[0])/float(latscale)) - for j in xrange(pop_lonlen): - pop_lon=pop_lonmin+float(pop_lonstep)*float(j) - pop_lon_index=int(float(pop_lon-lon_array[0])/float(lonscale)) - if (pop_lat_index > 0) and (pop_lat_index < len(lat_array)): - if (pop_lon_index > 0) and (pop_lon_index < len(lon_array)): - if pop_data[i,j] > P[pop_lat_index,pop_lon_index] : P[pop_lat_index,pop_lon_index]=pop_data[i,j] - return P - else : return zeros((0,0)) - -def parse_file(min_epoch=None): - clients={} - if min_epoch is None : min_epoch=float('inf') - max_epoch=int(0) - if not (inputfile is None): - try: - f = open(inputfile, 'r') - for line in f: - epoch=int(line.strip().split()[0].strip()) - ip=line.strip().split()[1].strip() - gir=None - try: - gir = gi.record_by_addr(ip) - except: - continue - if not clients.has_key(ip): - clients[ip]={} - clients[ip]['epoch']=epoch - if gir != None: - clients[ip]['cc']=str(gir['country_code']) - clients[ip]['lat']=gir['latitude'] - clients[ip]['lon']=gir['longitude'] - else : - clients[ip]['cc']='AP' - clients[ip]['lat']=0.0 - clients[ip]['lon']=0.0 - - if epoch < clients[ip]['epoch'] : clients[ip]['epoch']=epoch - if epoch < min_epoch : min_epoch=epoch - if epoch > max_epoch : max_epoch=epoch - f.close() - except: - print "Error parsing inputfile %s" % inputfile - sys.exit(2) - return clients,min_epoch,max_epoch - - -def parse_regions(region=None): - r={} - if region is None: - r={'name':'World','ll_lat':-90,'ur_lat':90,'ll_lon':-180,'ur_lon':180} - else: - if not (regionsfile is None): - try: - f = open(regionsfile, 'r') - for line in f: - if region==line.strip().split(":")[0].strip(): - r['name']=line.strip().split(":")[0].strip() - r['ll_lat']=float(line.strip().split(":")[1]) - r['ur_lat']=float(line.strip().split(":")[2]) - r['ll_lon']=float(line.strip().split(":")[3]) - r['ur_lon']=float(line.strip().split(":")[4]) - break - f.close() - except: - print "Error parsing regionsfile %s" % regionsfile - sys.exit(2) - return r - -def make_path(dirstub,filename): - head,tail=path.split(path.expanduser(path.expandvars(dirstub))) - finalpath=path.join(head,path.expanduser(path.expandvars(filename))) - return path.normpath(finalpath) - -def list_regions(): - if not (regionsfile is None): - try: - f = open(regionsfile, 'r') - for line in f: - print line.strip().split(":")[0].strip() - f.close() - except: - print "Error parsing regionsfile %s" % regionsfile - sys.exit(2) - -def usage(): - print "%s --header=header --footer=footer --input=inputfile --output=outputfile --indir=indir" % sys.argv[0] +\ - " --region=region --regionsfile=regionsfile --outdir=outdir -v" - -def main(): - try: - opts, args = getopt.getopt(sys.argv[1:], "h:f:i:o:v:r:s",\ - ["help","verbose","stats","list-regions","indir=",\ - "outdir=","input=","output=","footer=","header=","region=","regionsfile=",\ - "frame_prefix=","frame_filetype=","datafile=","min_epoch="]) - except getopt.GetoptError: - # print help information and exit: - usage() - sys.exit(2) - global header, footer, inputfile,populationfile,outputfile,regionsfile - global indir,outdir, stats, verbose,datafile - global frame_prefix,frame_filetype,fade_hours,frame_hours,min_epoch,max_epoch - global frame_data,plot_frames,pickle_frames - - plot_frames=True - pickle_frames=True - verbose = False - stats = False - listregions=False - regionsfile=None - inputfile=None - populationfile=None - outputfile=None - datafile=None - region=None - header="" - footer="" - indir='./' - outdir='./animation-frames/' - frame_prefix=None - frame_filetype='png' - min_epoch=None - arg_epoch=None - latpixels=180 - lonpixels=360 - lat_smooth=1 - lon_smooth=1 - - - for o, a in opts: - if o in ("-h","--header"): - header = a - if o in ("-f","--footer"): - footer = a - if o in ("-i","--input"): - inputfile = a - if o in ("-o","--output"): - outputfile = a - if o == "--indir": - indir = a - if o == "--outdir": - outdir = a - if o == "--regionsfile": - regionsfile = a - if o in ("-r","--region"): - region = a - if o in ("--min_epoch"): - arg_epoch=a - if o in ("-v","--verbose"): - verbose = True - if o in ("-s","--stats"): - stats = True - if o in ("--help"): - usage() - sys.exit() - if o in ("--list-regions"): - listregions=True - - if outputfile is None : outputfile = 'clientmap.png' - if inputfile is None : inputfile = 'ips-with-epoch.txt' - if populationfile is None : populationfile = 'glds05ag30.asc' - if regionsfile is None : regionsfile = 'regions.txt' - - if frame_prefix is None : frame_prefix='frame_' - if datafile is None : datafile = 'saved_data.pickle' - - outputfile=make_path(outdir,outputfile) - datafile=make_path(outdir,datafile) - inputfile=make_path(indir,inputfile) - populationfile=make_path(indir,populationfile) - regionsfile=make_path(indir,regionsfile) - - if listregions: - list_regions() - sys.exit() - - - print outputfile - print datafile - print inputfile - print populationfile - print regionsfile - - frame_data=saved_frame_data() - frame_data.gather(datafile) - - clients,min_epoch,max_epoch=parse_file(min_epoch) - if arg_epoch is not None: min_epoch=arg_epoch - if frame_data.next_epoch is not None: min_epoch=frame_data.next_epoch - r=parse_regions(region) - fade_hours=3 - frame_hours=(max_epoch-min_epoch)/3600+1+fade_hours - print min_epoch,max_epoch,frame_hours - draw_client_animation(clients,r) - - - -if __name__ == "__main__": - sys.exit(main()) - diff --git a/scripts/geoip/generate-worldmap.py b/scripts/geoip/generate-worldmap.py deleted file mode 100644 index 5b7db61..0000000 --- a/scripts/geoip/generate-worldmap.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/python -import GeoIP -import random -import matplotlib -matplotlib.use('Agg2') -from pylab import * -from matplotlib.numerix import ma -from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas -from matplotlib.toolkits.basemap import Basemap - -indir='/home/jspaleta/Desktop/Fedora_World_Maps' -outdir='/home/jspaleta/Desktop/Fedora_World_Maps' -gi = GeoIP.open("/usr/share/GeoIP/GeoLiteCity.dat", GeoIP.GEOIP_MEMORY_CACHE) -random.seed() - -def lookup_client_locations(): - results = [] - f = open(indir+'/ips.txt', 'r') - for line in f: - try: - gir = gi.record_by_addr(line.strip()) - except: - continue - if gir != None: - t = (line.strip(), gir['country_code'], gir['latitude'], gir['longitude']) - results.append(t) - f.close() - return results - - -def lookup_host_locations(): - results = [] - for h in Host.select(): - if h.private or h.site.private or \ - not h.user_active or not h.admin_active or \ - not h.site.user_active or not h.site.admin_active: - continue - try: - gir = gi.record_by_name(h.name) - except: - print "Cannot find location for %s" % (h.name) - continue - if gir != None: - t = (h.name, gir['country_code'], gir['latitude'], gir['longitude']) - results.append(t) - - return results - -def draw_client_density(): - - m = Basemap(llcrnrlon=-180.,llcrnrlat=-90,urcrnrlon=180.,urcrnrlat=90.,\ - resolution='c',projection='cyl') - - # plot them as filled circles on the map. - # first, create a figure. - dpi=100 - dimx=800/dpi - dimy=400/dpi - fig=figure(figsize=(dimx,dimy), dpi=dpi, frameon=False, facecolor='blue') -# ax=fig.add_axes([0.1,0.1,0.7,0.7],axisbg='g') - ax=fig.add_axes([0.0,0.0,1.0,1.0],axisbg='g') - canvas = FigureCanvas(fig) - results = lookup_client_locations() - X,Y,Z = find_client_density(m,results) -# s = random.sample(results, 40000) -# for t in s: -# lat=t[2] -# lon=t[3] -# # draw a red dot at the center. -# xpt, ypt = m(lon, lat) -# m.plot([xpt],[ypt],'ro', zorder=10) - # draw coasts and fill continents. - m.drawcoastlines(linewidth=0.5) - m.drawcountries(linewidth=0.5) - m.drawlsmask([100,100,100,0],[0,0,255,255]) -# m.fillcontinents(color='green') - palette = cm.YlOrRd - m.imshow(Z,palette,extent=(m.xmin,m.xmax,m.ymin,m.ymax),interpolation='gaussian',zorder=0) -# l,b,w,h = ax.get_position() -# cax = axes([l+w+0.075, b, 0.05, h]) -# colorbar(cax=cax) # draw colorbar - - canvas.print_figure(outdir+'/clientmap.png', dpi=100) - - -def find_client_density(m,client_locations,latscale=1.0,lonscale=1.0,lat_smooth=1,lon_smooth=1): - lat_array=arange(m.ymin,m.ymax+latscale,latscale) - lon_array=arange(m.xmin,m.xmax+lonscale,lonscale) - maxlat=len(lat_array)-1 - maxlon=len(lon_array)-1 - Z=zeros((len(lat_array),len(lon_array)),dtype='float') - for client in client_locations: - lat=client[2] - i_lat=int(float((lat-lat_array[0]))/float(latscale)) - lon=client[3] - i_lon=int(float((lon-lon_array[0]))/float(lonscale)) - for i in xrange(-int(lat_smooth),int(lat_smooth+1),1): - for j in xrange(-int(lon_smooth),int(lon_smooth+1),1): - if ( i_lat+i >= 0 ) and (i_lat+i < maxlat) : - if ( i_lon+j >= 0) and ( i_lon+j < maxlon) : - Z[i_lat+i,i_lon+j]+=1.0 - Lon,Lat=meshgrid(lon_array,lat_array) - X,Y=m(Lon,Lat) - Z= Z + 1.0 - Z=log(Z) - Z = where(Z <= 0.,1.e10,Z) - Z = ma.masked_values(Z, 1.e10) - return X,Y,Z - -def main(): - draw_client_density() - - - -if __name__ == "__main__": - sys.exit(main()) - diff --git a/scripts/lock-wrapper/lock-wrapper.sh b/scripts/lock-wrapper/lock-wrapper.sh deleted file mode 100755 index d8add48..0000000 --- a/scripts/lock-wrapper/lock-wrapper.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright (C) 2009 - Ricky Zhou ricky fedoraproject.org -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 or later. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA -# - - -if [ $# -lt 2 ]; then - echo "Usage: $0 [name] [script]" - exit 1; -fi - -NAME=$1 -SCRIPT=$2 - -LOCKDIR="/var/tmp/$NAME" -PIDFILE="$LOCKDIR/pid" - -function cleanup { - rm -rf "$LOCKDIR" -} - -RESTORE_UMASK=$(umask -p) -umask 0077 -if ! mkdir "$LOCKDIR"; then - echo "$LOCKDIR already exists, exiting" - PID=$(cat "$PIDFILE") - if [ -n "$PID" ]; then - echo "(pid $PID)" - fi - exit 1; -fi - -trap cleanup EXIT SIGQUIT SIGHUP SIGTERM -echo $$ > "$PIDFILE" - -$RESTORE_UMASK -eval "$SCRIPT" - diff --git a/scripts/moin2mw/moin-mw-upload.py b/scripts/moin2mw/moin-mw-upload.py deleted file mode 100755 index db49efd..0000000 --- a/scripts/moin2mw/moin-mw-upload.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/python -tt - -# written by seth vidal -# Altered by Mike McGrath -import mechanize -import sys -import os - -# Run this from the data/pages directory in your moin install! - -print "Logging in" -b = mechanize.Browser(factory=mechanize.DefaultFactory(i_want_broken_xhtml_support=True)) -b.set_handle_robots(False) -b.open("https://publictest2.fedoraproject.org/wiki/Special:Userlogin") -b.select_form(nr=1) -b["wpName"] = "admin" -b["wpPassword"] = "adminadmin" -b.submit() -print "win!" -print - -def upload(source, dest): - b.open("https://publictest2.fedoraproject.org/wiki/Special:Upload") - b.select_form(nr=1) - b["wpDestFile"] = dest - b['wpUploadDescription'] = 'Migrated from previous wiki' - b['wpIgnoreWarning'] = ['true'] - b.form.add_file(open(source), filename=source) - b.submit() - r = b.response() - results='\n'.join(r.readlines()) - if results.find('Success') != -1 or results.find('Migrated from previous wiki') != -1: - print "%s - Success (%s)" % (source, dest) - else: - f = open('/var/tmp/%s.html' % dest, 'w') - f.write(results) - f.close() - print "%s - Failure" % source - -for root, directories, files in os.walk('./'): - for file in [f for f in files]: - target = root + '/' + file - if target.find('attachment') != -1 and os.path.isfile(target): - dest = target - dest = dest.replace('./', '', 1) - dest = dest.replace('/attachments', '', 1) - dest = dest.replace('(2f)', '_') - dest = dest.replace('/', '_') - upload(target, dest) - - -sys.exit() - -#r = b.response() - - diff --git a/scripts/moin2mw/moin2mw.py b/scripts/moin2mw/moin2mw.py deleted file mode 100755 index 2aa31d8..0000000 --- a/scripts/moin2mw/moin2mw.py +++ /dev/null @@ -1,504 +0,0 @@ -#!/usr/bin/python - -# moin2media - convert a MoinMoin wiki to MediaWiki 1.5 import format - -# Copyright 2006 Free Standards Group, Inc. -# Author: Jeff Licquia -# Author: Mike McGrath -# Permission granted to release under GPL - -# Altered 2008 by Ignacio Vazquez-Abrams - -import sys -import os -import re -import elementtree.ElementTree as etree -import mx.DateTime -import cgi -import codecs - -def _table_xlat(data): - in_table = False - has_class = False - result = [] - #sys.stderr.write("Data: %s" % data) - for line in data.splitlines(True): - if line.strip(':').strip().startswith(u"||"): - # Gut the html stuff until we figure out what to do with it - #line = re.sub(r'<([a-zA-Z\/][^>])*>', '\1|', line) - if not in_table: - if line.strip().startswith(u"||]*)>.*', r'\1', line.split('>')[0] + '>') - tableclass = re.sub(r'.*<([a-zA-Z\/][^>]*)>(.*)', r'\1 | \2', line).replace('tableclass="', 'Template:').replace(' ', '/', 1).replace('"', '', 1) - result.append(u"{{ %s" % tableclass) - has_class = True - elif line.strip().startswith(u"||]*)>.*', r'\1', line.split('>')[0] + '>') - tablestyle = tablestyle.replace('tablestyle', 'style') - result.append(u"{| %s" % tablestyle) - else: - result.append(u"{| border=\"1\"") - in_table = True - newline = line[1:] - while newline[-1] in (u"|", u" "): - newline = newline[:-1] - - #newline = re.sub('\', '', newline) - #newline = re.sub('\', '', newline) - newline = newline.rstrip().rstrip('||').rstrip() - #newline = re.sub(r'.*<([a-zA-Z\/][^>]*)>.*', r'\1 |', newline) - #newline = re.sub(r'<([a-zA-Z\/][^>]*)>', r'\1 |', newline) - newline = re.sub(r']*>', r'', newline) - # Ugh nasty - if newline.find('rowstyle') != -1: - newline = re.sub(r'<([a-zA-Z\/][^>]*)>', r'\1 \n|', newline) - newline = newline.replace('|rowstyle', 'style') - newline = newline.replace('| rowstyle', 'style') - result.append(u"\n|- %s" % newline) - else: - newline = newline.replace('', '" |') - newline = newline.replace('" >', '" |') - newline = newline.replace("'>", "' |") - newline = newline.replace("' >", "' |") - if not has_class: - result.append(u"\n|-") - result.append("\n" + newline) - else: - if in_table: - if has_class: - result.append(u"\n}}\n") - else: - result.append(u"\n|}\n") - in_table = False - has_class=False - result.append(line) - - return u''.join(result) - -def _escape(line): - return (line, {}) -# line = line.replace(u">", u">") -# line = line.replace(u"<", u"<") -# line = re.sub(ur'&(?![a-z]+;)', u"&", line) - -def _fix_comments(line): - if line.startswith(u"##"): - line = u"\n" % line[2:] - - return (line, {}) - -def _fix_redirect(line): - if line.startswith(u"#redirect"): - line = u"#REDIRECT %s" % line.split(" ")[2:] - return(line, {}) - -def _find_meta(line): - try: - if line.startswith(u"#"): - (name, value) = line[1:].split(u" ", 1) - return (u"", { name: value }) - except: - pass - - return (line, {}) - -def _studlycaps(line): -# line = re.sub(ur'\b(?\>', '}}', line, 1)[0] - return (line, {}) - -def _fix_bullets(line): - if re.match(ur'^\s+\*', line): - while line[0].isspace(): - line = line[1:] - - return (line, {}) - -def _fix_numlists(line): - if re.match(ur'^\s+1\.', line): - while line[0].isspace(): - line = line[1:] - line = u"# %s" % line[2:] - - return (line, {}) - -def _fix_tips(line): - line = line.replace('{i}', '{{Template:Note}}') - line = line.replace('(!)', '{{Template:Tip}}') - line = line.replace('{*}', '{{Template:Important}}') - line = line.replace('', '{{Template:Caution}}') - line = line.replace('/!\\', '{{Template:Warning}}') - - return (line, {}) - -def _fix_admonition(line): -# while line.find(ur'[[Admonition') != -1: -# line = re.subn(ur'\[\[Admonition', '<>', line, 1)[0] - if line.find('[[Admonition') != -1: - line = line.replace('[[Admonition', 'Admonition') - line = line.replace('")]', '")') - return (line, {}) - -def _fix_get_val(line): - if line.find('[[GetVal') == -1: - return (line, {}) - if line.find('Category:') != -1: - return (line, {}) - split_line = line.split(']]') - e = [] - for s in split_line: - if s.find('[[GetVal') != -1: - s = s.replace('[[GetVal', '{{Template:',1) - s = s.replace(',', '/', 1) - s = s.replace('(', '', 1) - s = s.replace(')', '', 1) - s = s.strip() + '}}\n' - else: - s = s + ']]' - e.append(s) - line = ' '.join(e) - - return (line, {}) - -def _fix_include(line): - if line.find('[[Include') != -1: - line = line.replace('[[Include(', '{{:') - line = line.replace(')]]', '}}') - return (line, {}) - -def _fix_pre(line): - if line.find('{{{') != -1 and line.find('}}}') != -1: - line = re.sub(r'\{\{\{', "", line) - line = re.sub(r'\}\}\}', "", line) - else: - line = re.sub(r'\{\{\{', "
", line)
-        line = re.sub(r'\}\}\}', "
", line) - return (line, {}) - -#def _fix_big_links(line): -# line = re.sub(ur'\[:([^:]+):([^]]+)]', ur'[\1|\2]', line) -# return (line, {}) - -def _fix_code_blocks(line): - while line.find('`') != -1: - line = re.subn(ur'`', '', line, 1)[0] - line = re.subn(ur'`', '', line, 1)[0] - return (line, {}) - -def _unspace_text(line): - return (line, {}) - if len(line) > 0 and line[0] == " ": - while len(line) > 0 and line[0] == " ": - line = line[1:] - line = ": " + line - #line = u": %s" % line.lstrip(' ') - - return (line, {}) - -def _kill_link_prefixes(line): - line = re.sub(ur'[A-Za-z]+\:\[\[', u"[[", line) - return (line, {}) - -def _fix_line_breaks(line): - line = line.replace('[[BR]]', '
') - return (line, {}) - -def _fix_categories(line): - if line.startswith('["Category'): - line = line.replace('["', '') - line = line.replace('"]', '') - if line.startswith('Category'): - line = line.replace('Category', '[[Category:') - line = line.strip() + ']]\n' - return (line, {}) - -def _fix_headers(line): - ''' This is Fedora specific ''' - line = line.replace('

', '==') - line = line.replace('

', '==') - line = line.replace('

', '==') - line = line.replace('

', '==') - return (line, {}) - -def _fix_links(line): - if line.find('Category:') != -1: - return (line, {}) - split_line = line.split(']') -#while f.find('[:') != -1: - e = [] - for s in split_line: -# sys.stderr.write("s before: %s\n" % s) - if s.find('[:') != -1: - s = s.replace('[:', '[[',1) - tmp = s.split('[[') - #sys.stderr.write("0: " + tmp[0]) - #sys.stderr.write("1: " + tmp[1]) - s = tmp[0] + '[[' + tmp[1].replace(':', '| ', 1) - s = s.replace(']', ']]', 1) - s = s + ']]' -# elif s.find('[http') != -1: -# s = s.replace('[http', 'http', 1) - elif s.find('[') != -1: - s = s + ']' - #sys.stderr.write("s after: %s\n" % s) - e.append(s) - line = ' '.join(e) -# line = re.sub(ur'\[\:(.*)\:(.*)\]', ur"[[\1 |\2]]", line) -# line = re.sub(r'\[\[', "[[ ", line) -# line = re.sub(r'\]\]', " ]]", line) - return (line, {}) - -def _remove_toc(line): - line = line.replace('[[TableOfContents]]', '') - line = line.replace('[[ TableOfContents ]]', '') - return (line, {}) - -def _fix_image_link(line, page_name): - result=[] - if line.find('ImageLink') != -1: - for l in line.split('[[ImageLink('): - if not l.strip(): - continue - dest = page_name.replace('(2f)', '_') + '_' - l = l.replace(')]]', ']]') - l = l.replace(') ]]', ']]') - l = "[[Image:%s%s" % (dest, l) - result.append(l) - line = ''.join(result) - return (line) - -def _fix_attachments(line, page_name): - - result = [] - if line.find('attachment:') != -1: - dest = page_name.replace('(2f)', '_') + '_' - skipFirst=1 - for l in line.split('attachment:'): - if skipFirst==1: - result.append(l) - skipFirst=0 - continue - l = "[[Image:%s%s" % (dest, l) - l = re.subn(ur'([A-Za-z0-9:_\.\-]*)([A-Za-z0-9])', ur'\1\2]]', l, 1)[0] - result.append(l) - line = ''.join(result) - # crazy hack, fix triples (they happen from linked moin images) - line = line.replace('[[[', '[[') - line = line.replace(']]]', ']]') - return (line) - - -chain = [ _remove_toc, _fix_line_breaks, _fix_categories, _fix_headers, _fix_anchors, - _fix_include, _fix_get_val, _fix_links, _escape, - _fix_redirect, _fix_comments, _find_meta, _studlycaps, _fix_bullets, - _fix_numlists, _unspace_text, _kill_link_prefixes, _fix_code_blocks, - _fix_pre, _fix_admonition, _fix_tips ] - -class MoinWiki(object): - def __init__(self, wiki_path): - if not os.path.isdir(wiki_path): - raise RuntimeError(u"%s: incorrect path to wiki" % - wiki_path) - if not os.path.exists(u"%s/pages/FrontPage/current" % - wiki_path): - raise RuntimeError(u"%s: path does not appear to be a" - u" MoinMoin wiki" % wiki_path) - - self.wiki_path = wiki_path - - def _check_valid_page(self, orig_page_name): - if not os.path.exists(u"%s/pages/%s/current" - % (self.wiki_path, orig_page_name)): - raise RuntimeError(u"page %s does not exist in" - u" wiki at %s" % (self.wiki_path, orig_page_name)) - - def _translate_page_name(self, page_name): - new_page_name = page_name - if page_name.find(u"(") != -1: - for match in re.finditer(ur'\((\w+)\)', page_name): - hex = u"\"\\x%s\"" % match.group(1) - if len(hex) > 6: - #hex = u"%s\\x%s" % (hex[:5], hex[5:]) - hex = match.group(1).decode('hex').decode('utf-8') - try: - newchar = eval(hex) # WTH? -iva - except ValueError: - raise RuntimeError(u"invalid escaping of %s: %s" % - (page_name, hex)) - except SyntaxError: - newchar = hex - try: - new_page_name = new_page_name.replace(match.group(0), newchar) - except: - sys.stderr.write("Error2 - on page: %s\n" % page_name) - - return new_page_name - - def _chain_translate_file(self, f, page_name): - result = [] - resultmeta = {} - if page_name.find('MoinEditorBackup') != -1: - return (result, resultmeta) - for line in f: - line = _fix_image_link(line.strip(), page_name) + "\n" - for chaincall in chain: - #sys.stderr.write(line + "\n") - (line, meta) = chaincall(line) - resultmeta.update(meta) - # fix_attachments is fedora specific and requites pagename - line = _fix_attachments(line, page_name) - result.append(line) - - result = _table_xlat(u''.join(result)) - - return (result, resultmeta) - - def has_page(self, page_name): - try: - self._check_valid_page(page_name) - except RuntimeError: - return False - - return True - - def get_orig_page_names(self): - for page in os.listdir(self.wiki_path + u"/pages"): - try: - self._check_valid_page(page) - except RuntimeError: - continue - - yield page - - def get_page(self, orig_page_name): - self._check_valid_page(orig_page_name) - page_name = self._translate_page_name(orig_page_name) - - results = { u"name": page_name, - u"orig-name": orig_page_name } - - page_path = u"%s/pages/%s" % (self.wiki_path, orig_page_name) - revnum_file = codecs.open(u"%s/current" % page_path, 'r', - 'utf-8') - revnum = revnum_file.read() - revnum_file.close() - revnum = revnum.rstrip(u'\n') - - while not os.path.exists(u"%s/revisions/%s" % (page_path, revnum)): - revnum_len = len(revnum) - #revnum = str(int(revnum) - 1) - revnum = int(revnum) - 1 - revnum = u'%0*d' % (revnum_len, revnum) - - text_file = codecs.open(u"%s/revisions/%s" % (page_path, - revnum), 'r', 'utf-8') - (results[u"text"], results[u"meta"]) = \ - self._chain_translate_file(text_file, orig_page_name) - #sys.stderr.write("page_path: %s\n" % orig_page_name) - text_file.close() - - return results - - def get_pages(self): - for page in self.get_orig_page_names(): - yield self.get_page(page) - -class MWExport(object): - def __init__(self, source): - self.source_wiki = source - - self.etroot = etree.Element(u"mediawiki") - self.etroot.set(u"xml:lang", u"en") - self.etdoc = etree.ElementTree(self.etroot) - - self.timestr = mx.DateTime.ISO.strUTC(mx.DateTime.utc()) - self.timestr = self.timestr.replace(u" ", u"T") - self.timestr = self.timestr.replace(u"+0000", u"Z") - - def _create_blank_page(self): - mwpage = etree.Element(u"page") - - mwpagetitle = etree.SubElement(mwpage, u"title") - - mwrevision = etree.SubElement(mwpage, u"revision") - mwrevtime = etree.SubElement(mwrevision, u"timestamp") - mwrevtime.text = self.timestr - - mwcontrib = etree.SubElement(mwrevision, u"contributor") - mwuser = etree.SubElement(mwcontrib, u"username") - mwuser.text = u"ImportUser" - - mwcomment = etree.SubElement(mwrevision, u"comment") - mwcomment.text = u"Imported from MoinMoin" - - mwtext = etree.SubElement(mwrevision, u"text") - - return mwpage - - def add_page(self, page): - mwpage = self._create_blank_page() - mwpage[0].text = page[u"name"] - for subelem in mwpage[1]: - if subelem.tag == u"text": - subelem.text = page[u"text"] - self.etroot.append(mwpage) - - talk_page_content = [] - - if self.source_wiki.has_page(page[u"name"] + u"(2f)Comments"): - comment_page = self.source_wiki.get_page(page[u"name"] + - u"(2f)Comments") - talk_page_content.append(comment_page[u"text"]) - - if len(page[u"meta"]) > 0: - talk_page_content.append(u""" - -The following metadata was found in MoinMoin that could not be converted -to a useful value in MediaWiki: - -""") - for key, value in page[u"meta"].iteritems(): - talk_page_content.append(u"* %s: %s\n" % (key, value)) - - if talk_page_content: - mwpage = self._create_blank_page() - mwpage[0].text = u"Talk:%s" % page[u"name"] - for subelem in mwpage[1]: - if subelem.tag == u"text": - subelem.text = u''.join(talk_page_content) - self.etroot.append(mwpage) - - def add_pages(self): - for page in self.source_wiki.get_pages(): - if not page[u"name"].endswith(u"(2f)Comments"): - self.add_page(page) - - def write(self, f): - self.etdoc.write(f) - -def main(): - wiki_path = sys.argv[1] - - export = MWExport(MoinWiki(wiki_path)) - export.add_pages() - out = codecs.EncodedFile(sys.stdout, 'utf-8') - out.write(u"\n") - export.write(out) - -if __name__ == "__main__": - main() diff --git a/scripts/moin2mw/mw-upload.py b/scripts/moin2mw/mw-upload.py deleted file mode 100755 index 9d8e015..0000000 --- a/scripts/moin2mw/mw-upload.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/python -tt - -# written by seth vidal -# Altered by Mike McGrath -import mechanize -import sys - -try: - sys.argv[2] -except IndexError: - print "Please specify [source] [dest name]" - sys.exit() -try: - sys.argv[3] -except IndexError: - pass -else: - print "Please specify [source] [dest name]" - sys.exit() - -try: - f = open(sys.argv[1]) -except IOError: - print "Could not open %s" % sys.argv[1] - sys.exit() - -b = mechanize.Browser(factory=mechanize.DefaultFactory(i_want_broken_xhtml_support=True)) -b.set_handle_robots(False) -b.open("https://publictest1.fedoraproject.org/wiki/Special:Userlogin") -b.select_form(nr=1) -b["wpName"] = "admin" -b["wpPassword"] = "adminadmin" -b.submit() -r = b.response() - -b.open("https://publictest1.fedoraproject.org/wiki/Special:Upload") -b.select_form(nr=1) -b["wpDestFile"] = sys.argv[2] -b['wpUploadDescription'] = 'Migrated from previous wiki' -b.form.add_file(open(sys.argv[1]), filename=sys.argv[1]) -b.submit() -r = b.response() -results='\n'.join(r.readlines()) -if results.find('Success') != -1 or results.find('Migrated from previous wiki') != -1: - print "%s - Success" % sys.argv[1] -else: - print "%s - Failure" % sys.argv[1] diff --git a/scripts/moin2mw/upAttach.sh b/scripts/moin2mw/upAttach.sh deleted file mode 100644 index ee4fa03..0000000 --- a/scripts/moin2mw/upAttach.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -for f in `find -type f | grep attachment` -do - dest=`echo $f | sed -e 's,/attachments,,' -e 's,./,,' -e 's/(2f)/_/' -e 's,/,_,g'` - src=$f - echo "/root/mw-upload.py '$src' '$dest'" -done diff --git a/scripts/nagios/README b/scripts/nagios/README deleted file mode 100644 index 29c71bb..0000000 --- a/scripts/nagios/README +++ /dev/null @@ -1,2 +0,0 @@ -check_ipmi - Checks fan and temperature on a box with ipmi support -check_koji - Check for failed koji builds and warn when in a critical range diff --git a/scripts/nagios/check_ipmi b/scripts/nagios/check_ipmi deleted file mode 100755 index f85397e..0000000 --- a/scripts/nagios/check_ipmi +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/python -# mmcgrath#redhat.com -# Aug 08 2007 -# License: GPL -from optparse import OptionParser -import commands -import sys - -parser = OptionParser(version='0.1') -parser.add_option('-t', '--temperature', - dest = 'temp', - default = False, - action = 'store_true', - help = 'Check Temperatures') -parser.add_option('-f', '--fans', - dest = 'fans', - default = False, - action = 'store_true', - help = 'Check Fans') - - - -(opts, args) = parser.parse_args() - -class ipmiValue: - def __init__(self, param='', value='', status=''): - self.param = param - try: - self.value = (int(value.split(' ')[0], 10) * 9) / 5 + 32 - except ValueError: - self.value = value - self.status = status - -class ipmi: - def __init__(self): - self.rawOutput = commands.getstatusoutput('/usr/bin/ipmitool sdr')[1].split('\n') - self.sdr = [] - for i in self.rawOutput: - try: - param = i.split('|')[0].strip() - value = i.split('|')[1].strip() - status = i.split('|')[2].strip() - self.sdr.append(ipmiValue(param, value, status)) - except IndexError: - print "ERROR - Invalid output from ipmi tool (is it installed? /usr/bin/ipmitool)" - sys.exit(3) - - def temps(self): - ''' Return Known Temperatures ''' - temps = [] - for i in self.sdr: - if i.param.find('Temp') != -1 and i.status.find('ns') == -1: - temps.append(i) - return temps - - def fans(self): - ''' Return Known Fan Speeds ''' - temps = [] - for i in self.sdr: - if i.param.find('FAN') != -1 and i.status.find('ns') == -1: - temps.append(i) - return temps - -str = False -exitCode = 0 -if opts.temp: - ok=True - str='Temps (F)' - i = ipmi() - for temp in i.temps(): - str = '%s:%s' % (str, temp.value) - if temp.status != 'ok': - ok=temp.status - if ok: - str = str + ' OK!' - else: - str = str + ' %s' % ok - exitCode = 2 - -if opts.fans: - ok=True - str='Fans (RPM)' - i = ipmi() - for fan in i.fans(): - str = '%s:%s' % (str, fan.value) - if fan.status != 'ok': - ok=fan.status - if ok: - str = str + ' OK!' - else: - str = str + ' %s' % ok - exitCode = 2 - -if str: - print str - sys.exit(0) -else: - print 'Please see -h for help' - sys.exit(2) diff --git a/scripts/nagios/check_koji b/scripts/nagios/check_koji deleted file mode 100755 index 31f7d18..0000000 --- a/scripts/nagios/check_koji +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -FAILURES=$(/usr/bin/wget -q --no-check-certificate -O- http://koji1.fedora.phx.redhat.com/koji/builds | /bin/grep -c failed.png) -WARNING=20 -CRITICAL=25 - -if [ $FAILURES -gt $CRITICAL ] -then - echo "Koji: CRITICAL failed builds: $FAILURES" - exit 2 -elif [ $FAILURES -gt $WARNING ] -then - echo "Koji: WARNING failed builds: $FAILURES" - exit 1 -else - echo "Koji: OK failed builds: $FAILURES" - exit 0 -fi - diff --git a/scripts/newer_packages/newer_pkgs_in_old_repos.py b/scripts/newer_packages/newer_pkgs_in_old_repos.py deleted file mode 100644 index 2072501..0000000 --- a/scripts/newer_packages/newer_pkgs_in_old_repos.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/python -tt - -import yum -import sys -from operator import attrgetter -from fedora.client.pkgdb import PackageDB - -pkgdb = PackageDB() - -bugzacl = pkgdb.get_bugzilla_acls() - -my = yum.YumBase() -my.preconf.root ='/var/tmp/skvidal-chroot' -my.preconf.debuglevel=0 -my.arch.archlist.append('src') -my.setCacheDir() -my.repos.disableRepo('*') -my.add_enable_repo('f14', - baseurls=['http://download.fedora.redhat.com/pub/fedora/linux/development/14/source/SRPMS/']) -my.add_enable_repo('f14-updates', - baseurls=['http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/14/SRPMS/']) -#my.add_enable_repo('f14-updates', -# baseurls=['http://download.fedora.redhat.com/pub/fedora/linux/updates/14/SRPMS/', -# 'http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/14/SRPMS/']) -my.add_enable_repo('f13', - baseurls=['http://fedora.mirrors.tds.net/pub/fedora/releases/13/Everything/source/SRPMS/']) -my.add_enable_repo('f13-updates', - baseurls=['http://fedora.mirrors.tds.net/pub/fedora/updates/13/SRPMS/', - 'http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/13/SRPMS/']) - -len(my.pkgSack) # just to frob the sack - -f14repo = my.repos.findRepos('f14')[0] -f14updates = my.repos.findRepos('f14-updates')[0] - -def whoowns(package): - """ - - Retrieve the owner of a given package - """ - try: - mainowner = bugzacl['Fedora'][package]['owner'] - except KeyError: - irc.reply("No such package exists.") - return - others = [] - for key in bugzacl.keys(): - if key == 'Fedora': - continue - try: - owner = bugzacl[key][package]['owner'] - if owner == mainowner: - continue - except KeyError: - continue - others.append("%s in %s" % (owner, key)) - return mainowner - - -owners = [] -for pkg in sorted(my.pkgSack.returnNewestByNameArch()): - if not pkg.repoid.startswith('f14'): - f14pkgs = [] - f14upkgs = [] - f14all = [] - try: - f14pkgs = f14repo.sack.returnNewestByNameArch((pkg.name, pkg.arch)) - f14upkgs = f14updates.sack.returnNewestByNameArch((pkg.name, pkg.arch)) - except yum.Errors.PackageSackError, e: - pass - f14all.extend(f14upkgs) - f14all.extend(f14pkgs) - if f14all: - f14all.sort() - f14all.reverse() - if f14all[0].EVR != pkg.EVR: - owner = whoowns(pkg.name) - owners.append(owner) - print 'greater for f13: %s (%s)' % (pkg.name, owner) - print ' f13 = %s' % pkg - print ' f14 = %s' % f14all[0] - -print '%s@fedoraproject.org' % '@fedoraproject.org,'.join(sorted(set(owners))) diff --git a/scripts/pkgdb_bulk_comaint/comaint.py b/scripts/pkgdb_bulk_comaint/comaint.py deleted file mode 100644 index 1ff8e98..0000000 --- a/scripts/pkgdb_bulk_comaint/comaint.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/python -tt - -import sys -import getpass - -from fedora.client import PackageDB - -if __name__ == '__main__': - print 'Username: ', - username = sys.stdin.readline().strip() - password = getpass.getpass('Password: ') - - # Note: in order not to send email: - # ssh bapp01 - # /usr/sbin/puppetd --disable - # edit /etc/pkgdb.cfg and set: - # mail.on = False - # /etc/init.d/httpd restart - # - # Then run this script on a host that can talk to bapp01. - pkgdb = PackageDB('http://bapp01/pkgdb/', username=username, password=password) - collections = dict([(c[0]['id'], c[0]) for c in pkgdb.get_collection_list(eol=False)]) - pkgs = pkgdb.user_packages('mmaslano', acls=['owner', 'approveacls']).pkgs - - for pkg in (p for p in pkgs if p['name'].startswith('perl-')): - c_ids = (p['collectionid'] for p in pkg['listings'] if p['collectionid'] in collections) - branches = [collections[c]['branchname'] for c in c_ids] - pkgdb.edit_package(pkg['name'], comaintainers=['ppisar'], branches=branches) - - sys.exit(0) diff --git a/scripts/pkgs-update-hook/update.secondary b/scripts/pkgs-update-hook/update.secondary deleted file mode 100644 index 7f387b7..0000000 --- a/scripts/pkgs-update-hook/update.secondary +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -# Maximum file size in bytes -MAX_SIZE=20000 - -bad_file_found=0 -new_rev=$3 -old_rev=$2 -tmp=$(mktemp /tmp/git.update.XXXXXX) -tree=$(mktemp /tmp/git.diff-tree.XXXXXX) -zero="0000000000000000000000000000000000000000" - -if [[ "$old_rev" == "$zero" ]]; then - git diff-tree -r --root "$new_rev" | sed '1d' > $tree -else - git diff-tree -r "$old_rev" "$new_rev" > $tree -fi -while read old_mode new_mode old_sha1 new_sha1 status name; do - # skip lines showing parent commit - [[ -z "$new_sha1" ]] && continue; - - # skip deletions - [[ "$new_sha1" = "$zero" ]] && continue - - # Skip files named *patch - if [[ "$name" =~ [.]patch$ ]]; then - continue - fi - - git cat-file blob $new_sha1 > $tmp - ftype="$((file "$tmp" | awk -F': ' '{print $2}') 2>/dev/null)" - fsize=$(stat -c%s "$tmp") - - if [[ $fsize -gt $MAX_SIZE ]]; then - echo "File $name - exceeds maximum permitted size $MAX_SIZE" - bad_file_found=1 - fi - - # Banned archive types - #echo $ftype - if [[ $ftype =~ "Zip archive" ]]; then - echo "File $name - please upload zip files to the lookaside instead" - bad_file_found=1 - fi - if [[ $ftype =~ "compressed data" ]]; then - echo "File $name - please upload compressed files to the lookaside instead" - bad_file_found=1 - fi - if [[ $ftype =~ "tar archive" ]]; then - echo "File $name - please upload tarballs to the lookaside instead" - bad_file_found=1 - fi - -done < $tree - -rm -f $tmp $tree -if [[ $bad_file_found -eq 1 ]]; then - echo "====================" - echo "Your commit contained problematic files." - echo "Please see http://fedoraproject.org/wiki/foo for more information." - echo "====================" -fi - -exit $bad_file_found diff --git a/scripts/planet/people/css/content.css b/scripts/planet/people/css/content.css deleted file mode 100644 index 982924e..0000000 --- a/scripts/planet/people/css/content.css +++ /dev/null @@ -1,237 +0,0 @@ -.name-project, .name-release, .name-version { -} - -/* Front page H1 */ -#page-main h1 { - font-size: 1.35em; -} - -#page-main h1.center { - text-align: center; -} - -h1, h2, h3, h4 { - /* - font-style: italic; - */ - font-family: luxi sans,sans-serif; -} -h1 { - font-size: 1.75em; -} - -h2 { - font-size: 1.25em; -# background-color: #eee; -} - -h3 { - font-size: 1.1em; -} - -hr { - border: 0; - border-bottom: 1px solid #ccc; -} - -.fedora-side-right-content { - padding: 1 5px 1.5em; - font-size: 1em; -} -#fedora-side-right h1, #fedora-side-right h2, #fedora-side-right h3 { - margin: 0; - padding: 0 4pt 0; - font-size: 1em; - letter-spacing: 2pt; - border-bottom: 1px solid #bbb; -} -#fedora-side-right hr { - border-bottom: 1px solid #aaa; - margin: 0.5em 0; -} - -table tr { - font-size: 0.9em; -} - - -#link-offsite { -} -.link-offsite-notation { - font-size: 0.9em; - color: #777; - padding-left: 1pt; - text-decoration: none !important; -} -#fedora-content .link-offsite-notation { - color: #999; -} -#link-redhat { -} -#fedora-content #link-redhat { -} -#link-internal { -} - -#fedora-content li { - padding: 1pt; -} -#fedora-content h1 { - margin-top: 0; -} - -#fedora-content a img { - margin: 1px; - border: 0; -} -#fedora-content a:hover img { - margin: 0; - border: 1px solid #f00; -} -#fedora-content a img.noborder { - margin: 0; - border: 0; -} -#fedora-content a:hover img .noborder { - margin: 0; - border: 0; -} - -#fedora-project-maintainers p, #fedora-project-contributors p, #fedora-project-bugs p { - margin-left: 5pt; -} - -#fedora-project-download dt { - font-weight: bold; - margin-top: 8pt; - margin-left: 5pt; -} -#fedora-project-download dd { - padding: 0; - margin: 10px 20px 0; -} -#fedora-project-screenshots a img { - margin: 5px; -} -#fedora-project-screenshots a:hover img { - margin: 4px; -} -#fedora-project-todo ul { - border: 1px solid #cad4e9; - margin: 0 1em; - padding: 0; - list-style: none; - border-radius: 2.5px; - -moz-border-radius: 2.5px; -} -#fedora-project-todo li { - margin: 0; - padding: 6px 8px; -} -#fedora-project-todo li.odd { - background-color: #ecf0f7; -} -#fedora-project-todo li.even { - background-color: #f7f9fc; -} - -#fedora-list-packages { - border-collapse: collapse; - border: 1px solid #cad4e9; - border-radius: 2.5px; - -moz-border-radius: 2.5px; -} -#fedora-list-packages tr.odd td { - background-color: #ecf0f7; -} -#fedora-list-packages tr.even td { - background-color: #f7f9fc; -} -#fedora-list-packages th, -#fedora-list-packages td { - margin: 0; - padding: 6px 8px; -} -#fedora-list-packages td.column-2 { - text-align: center; -} -#fedora-list-packages th { - background-color: #cad4e9; - color: #000; - font-weight: bold; - text-align: center; - -} - -/* pre.screen is for DocBook HTML output */ -code.screen, pre.screen { - font-family: monospace; - font-size: 1em; - display: block; - padding: 10px; - border: 1px solid #bbb; - background-color: #eee; - color: #000; - overflow: auto; - border-radius: 2.5px; - -moz-border-radius: 2.5px; - margin: 0.5em 2em; -} -#fedora-project code.screen { - margin: 0; -} - -code.command, code.filename { - font-family: monospace; -} - -code.citetitle { - font-family: sans-serif; - font-style: italic; -} - -strong.application { - font-weight: bold; -} -.indent { - margin: 0 2em; -} -.fedora-docs-nav { - text-align: center; - position: relative; - padding: 1em; - margin-top: 2em; - border-top: 1px solid #ccc; -} -.fedora-docs-nav a { - padding: 0 1em; -} -.fedora-docs-nav-left { - position: absolute; - left: 0; -} -.fedora-docs-nav-right { - position: absolute; - right: 0; -} - -.fedoraEntry { - -padding-left: 10px; -padding-right: 10px; -padding-bottom: 10px; -padding-top: 10px; -border-bottom: 1px solid #ccc; -} - -.fedoraStory { -} - -.fedoraFace { - margin: 0 0 10px 10px; - float: right; -} - -.fedoraTitle { - font-size: 1.25em; -} diff --git a/scripts/planet/people/css/docbook.css b/scripts/planet/people/css/docbook.css deleted file mode 100644 index 3181bce..0000000 --- a/scripts/planet/people/css/docbook.css +++ /dev/null @@ -1,71 +0,0 @@ -#fedora-content li p { - margin: 0.2em; -} - -#fedora-content div.table table { - width: 95%; - background-color: #DCDCDC; - color: #000000; - border-spacing: 0; -} - -#fedora-content div.table table th { - border: 1px solid #A9A9A9; - background-color: #A9A9A9; - color: #000000; -} - -#fedora-content div.table table td { - border: 1px solid #A9A9A9; - background-color: #DCDCDC; - color: #000000; - padding: 0.5em; - margin-bottom: 0.5em; - margin-top: 2px; - -} - -div.note table, div.tip table, div.important table, div.caution table, div.warning table { - width: 95%; - border: 2px solid #B0C4DE; - background-color: #F0F8FF; - color: #000000; - /* padding inside table area */ - padding: 0.5em; - margin-bottom: 0.5em; - margin-top: 0.5em; -} - -/* "Just the FAQs, ma'm." */ -.qandaset table { - border-collapse: collapse; -} -.qandaset { -} -.qandaset tr.question { -} -.qandaset tr.question td { - font-weight: bold; - padding: 0 0.5em; - margin: 0; -} -.qandaset tr.answer td { - padding: 0 0.5em 1.5em; - margin: 0; -} -.qandaset tr.question td, .qandaset tr.answer td { - vertical-align: top; -} -.qandaset strong { - text-align: right; -} - -.article .table table { - border: 0; - margin: 0 auto; - border-collapse: collapse; -} -.article .table table th { - padding: 5px; - text-align: center; -} diff --git a/scripts/planet/people/css/layout.css b/scripts/planet/people/css/layout.css deleted file mode 100644 index 6ceba83..0000000 --- a/scripts/planet/people/css/layout.css +++ /dev/null @@ -1,362 +0,0 @@ - body { - font-size: 0.9em; - font-family: bitstream vera sans,sans-serif; - margin: 0; - padding: 0; - /* (The background color is specified elsewhere, so do a global replacement if it ever changes) */ - background-color: #d9d9d9; -} - -a:link { - color: #900; -} -a:visited { - color: #48468f; -} -a:hover { - color: #f20; -} -a[name] { - color: inherit; - text-decoration: inherit; -} - -#fedora-header { - background-color: #fff; - height: 62px; -} -#fedora-header img { - border: 0; - vertical-align: middle; -} -#fedora-header-logo { - /* position is offset by the header padding amount */ - position: absolute; - left: 26px; - top: 13px; - z-index: 3; -} -#fedora-header-logo img { - width: 110px; - height: 40; -} -#fedora-header-items { - /* position is offset by the header padding amount */ - position: absolute; - right: 10px; - top: 15px; - text-align: right; - display: inline; -} -#fedora-header-items a { - color: #000; - text-decoration: none; - padding: 7pt; - font-size: 0.8em; -} -#fedora-header-items a:hover, #fedora-header-search-button:hover { - color: #f20; - cursor: pointer; -} -#fedora-header-items img { - margin-right: 1px; - width: 36px; - height: 36px; -} -#fedora-header-search { - height: 25px; -} -#fedora-header-search-entry { - vertical-align: top; - margin: 0.65em 4px 0 10px; - padding: 2px 4px; - background-color: #f5f5f5; - border: 1px solid #999; - font-size: 0.8em !important; -} -#fedora-header-search-entry:focus { - background-color: #fff; - border: 1px solid #555; -} -#fedora-header-search-button { - font-size: 0.8em !important; - vertical-align: top; - margin-top: 0.2em; - border: 0; - padding: 7px; - background: #fff url('../images/header-search.png') no-repeat left; - padding-left: 21px; -} -#fedora-header-items form { - float: right; -} -#fedora-header-items input { - font-size: 0.85em; -} -#fedora-nav { - margin: 0; - padding: 0; - background-color: #22437f; - font-size: 0; - height: 5px; - border-top: 1px solid #000; - border-bottom: 1px solid #f5f5f5; -} -#fedora-nav ul { - margin: 0; - padding: 0; -} -#fedora-nav li { - display: inline; - list-style: none; - padding: 0 5pt; -} -#fedora-nav li + li { - padding-left: 8pt; - border-left: 1px solid #99a5bf; -} -#fedora-nav a { - color: #c5ccdb; - text-decoration: none; -} -#fedora-nav a:hover { - color: #fff; -} - -#fedora-side-left { - position: absolute; - z-index: 2; - width: 11em; - /* Space down for the approx line height (fonts) */ - left: 12px; -} -#fedora-side-right { - position: absolute; - z-index: 1; - width: 20em; - right: 12px; - padding-top: 3px; - } -#fedora-side-left, #fedora-side-right { - top: 2px; - /* add to the top margin to compensate for the fixed sizes */ - margin-top: 75px; - color: #555; - font-size: 0.9em; -} -#fedora-side-right ul { - list-style: square inside; - padding: 0; - margin: 0; -} - -/* Left-side naviagation */ -#fedora-side-nav-label { - display: none; -} -#fedora-side-nav { - list-style: none; - margin: 0; - padding: 0; - border: 1px solid #5976b2; - border-top: 0; - background-color: #22437f; -} -#fedora-side-nav li { - margin: 0; - padding: 0; - border-top: 1px solid #5976b2; - /* IE/Win gets upset if there is no bottom border... Go figure. */ - border-bottom: 1px solid #22437f; -} -#fedora-side-nav a { - margin: 0; - color: #c5ccdb; - display: block; - text-decoration: none; - padding: 4px 6px; -} -#fedora-side-nav a:hover { - background-color: #34548f; - color: #fff; -} -#fedora-side-nav ul { - list-style: none; - margin: 0; - padding: 0; -} -#fedora-side-nav ul li { - border-top: 1px solid #34548e; - background-color: #34548e; - /* IE/Win gets upset if there is no bottom border... Go figure. */ - border-bottom: 1px solid #34548e; -} -#fedora-side-nav ul li:hover { - border-bottom: 1px solid #34548f; -} -#fedora-side-nav ul li a { - padding-left: 12px; - color: #a7b2c9; -} -#fedora-side-nav ul li a:hover { - background-color: #46659e; -} -#fedora-side-nav ul ul li a { - padding-left: 18px; -} -#fedora-side-nav strong a { - font-weight: normal; - color: #fff !important; - background-color: #10203b; -} -#fedora-side-nav strong a:hover { - background-color: #172e56 !important; -} - -/* content containers */ -#fedora-middle-one, #fedora-middle-two, #fedora-middle-three { - font-size: 0.9em; - /* position: relative; */ /* relative to utilize z-index */ - width: auto; - min-width: 120px; - margin: 10px; - z-index: 3; /* content can overlap when the browser is narrow */ -} -/* -#fedora-middle-two, #fedora-middle-three { - margin-left: 11em; - padding-left: 24px; -} -*/ -#fedora-middle-three { - margin-right: 20em; - padding-right: 24px; -} - -#fedora-content { - padding: 24px; - border: 1px solid #aaa; - background-color: #fff; -} - -#fedora-content > .fedora-corner-bottom { top: 0 } - -.fedora-corner-tl, .fedora-corner-tr, .fedora-corner-bl, .fedora-corner-br { - background-color: #d9d9d9; - position: relative; - width: 19px; - height: 19px; - /* The following line is to render PNGs with alpha transparency within IE/Win, using DirectX */ - /* Work-around for IE6/Mac borkage (Part 1) */ - display: none; -} - -.fedora-corner-tl, .fedora-corner-bl { float: left; left: 0px; } -.fedora-corner-tr, .fedora-corner-br { float: right; right: 0px; } -.fedora-corner-tl, .fedora-corner-tr { top: 0px; } -.fedora-corner-bl, .fedora-corner-br { bottom: 0px; margin-top: -19px; } - - -html>body .fedora-corner-tl { background: #d9d9d9 url("../images/corner-tl.png") no-repeat left top; } -html>body .fedora-corner-tr { background: #d9d9d9 url("../images/corner-tr.png") no-repeat right top; } -html>body .fedora-corner-bl { background: #d9d9d9 url("../images/corner-bl.png") no-repeat left bottom; } -html>body .fedora-corner-br { background: #d9d9d9 url("../images/corner-br.png") no-repeat right bottom; } - -.fedora-corner-tl { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/corner-tl.png',sizingMethod='scale'); } -.fedora-corner-tr { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/corner-tr.png',sizingMethod='scale'); } -.fedora-corner-br { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/corner-br.png',sizingMethod='scale'); } -.fedora-corner-bl { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/corner-bl.png',sizingMethod='scale'); } - -/* \*/ -.fedora-corner-tl, .fedora-corner-tr, .fedora-corner-bl, .fedora-corner-br { - /* Restore the view for everything but IE6/Mac (part 2 of the "IE/Mac fix") */ - display: block; -} -/* */ - -html*.fedora-corner-bl, html*.fedora-corner-br { - /* Compensate for Opera's inability to position some things correctly (Part 2) */ - top: 0px; -} - -.content { margin: 0 1em } - -#fedora-sidelist { - position: relative; - bottom: 3px; - margin: 0; - padding: 3px !important; - border: 1px solid #bbb; - background-color: #ccc; - border-radius: 2.5px; - -moz-border-radius: 2.5px; -} -#fedora-sidelist strong a { - font-weight: normal; - background-color: #555; - color: #fff; -} -#fedora-sidelist strong a:hover { - background-color: #333; - color: #fff; -} -#fedora-sidelist li { - list-style-position: outside; - font-size: 0.9em; - list-style: none; - border: 1px solid #ccc; - border-width: 1px 0; - padding: 0; - list-style: none; -} -#fedora-sidelist li a { - text-decoration: none; - display: block; - padding: 6px 8px; - border-radius: 2.5px; - -moz-border-radius: 2.5px; -} -#fedora-sidelist li a:hover { - background-color: #999; - color: #eee; -} - -#fedora-footer { - font-size: 0.75em; - text-align: center; - color: #777; - margin-bottom: 2em; -} -#fedora-printable { - text-align: center; - margin: 1em 0; - font-size: 0.85em; -} -#fedora-printable a { - text-decoration: none; - padding: 5px 0; - padding-left: 18px; - background: transparent url("../images/printable.png") no-repeat left; -} -#fedora-printable a:hover { - text-decoration: underline; -} - - -.left { - margin: 10px; - padding: 0px; - float: left; -} - -.right { - margin: 10px; - padding: 0px; - float: right; -} - - -.blosxomStory p { - margin-top: 7px; - margin-bottom: 7px; -} \ No newline at end of file diff --git a/scripts/planet/people/css/people-style.css b/scripts/planet/people/css/people-style.css deleted file mode 100644 index 9f95fc7..0000000 --- a/scripts/planet/people/css/people-style.css +++ /dev/null @@ -1,169 +0,0 @@ -html, body { - border: 0; - padding: 0; - margin: 0; - font-family: Verdana, Arial, Helvetica, sans-serif; - min-width: 912px; - background-color: #eeeff1; -} -#header { - margin-bottom: 23px; /* sync this value with margin-top of #content */ - background: #2963a5 url("../images/people-header.png") repeat-y 20% 0%; - height: 74px; -} -#header .logo { - position: absolute; - display: block; - left: 5px; - top: 3px; -} -#content { - margin-top: -23px; /* sync this value with margin-top of #content */ - margin-right: 210px; - background-color: white; -} -.blog-entries-daily { - background: white url("../images/people-entry-group-date-header.png") no-repeat top right; - margin-right: 25px; - position: relative; - padding-bottom: 12px; - margin-bottom: 30px; -} -.blog-date { - text-align: center; - background: transparent url("../images/people-entry-group-date-background.png") repeat-y top right; - color: white; - margin-top: 11px; - position: absolute; - right: 0; - font-size: 0.9em; - width: 229px; - height: 100%; -} -.blog-entry { - clear: both; - margin: 11px 0; - position: relative; - top: 40px; -} -.blog-entry-author { - float: left; - margin-top: 30px; - padding: 0 20px 30px 0; - width: 125px; - font-size: 0.8em; - text-align: center; -} -.blog-entry-author :link, .blog-entry-author :visited { - font-size: 0.9em; -} -.blog-entry-author .head { - display: block; - margin: 1ex auto; - border: 0; -} -.blog-entry-post { - margin: 1em 0 1em 145px; - border-radius: 20px; - background: transparent url("../images/people-entry-center-left.png") repeat-y center left; -} -.blog-entry-header { - background: transparent url("../images/people-entry-top-center.png") repeat-x top center; - height: 50px; -} -.blog-entry-title { - font-size: larger; - background: transparent url("../images/people-entry-top-left.png") no-repeat top left; - height: 50px; -} -.blog-entry-title a { - padding: 1em 0; - display: block; - margin-left: 25px; - background: transparent url("../images/people-entry-top-right.png") no-repeat top right; - height: 50px; -} -.blog-entry-content { - padding-top:10px; - padding-right: 3em; - margin-left: 25px; - text-align: justify; - font-size: 0.8em; - font-weight: normal; - background: transparent url("../images/people-entry-center-right.png") repeat-y center right; - padding-bottom:10px; - position: relative; - overflow: auto; -} -.blog-entry-content img { - max-width: 575px; - margin-left: 2ex; -} -.blog-entry-footer { - background: transparent url("../images/people-entry-bottom-center.png") repeat-x bottom center; -} -.blog-entry-timestamp { - font-size: x-small; - text-align: right; - color: #b3b3b3; - background: transparent url("../images/people-entry-bottom-left.png") no-repeat bottom left; -} -.blog-entry-timestamp a { - display: block; - color: #b3b3b3; - text-decoration: none; - height: 35px; - background: transparent url("../images/people-entry-bottom-right.png") no-repeat bottom right; - padding: 1em 5em 0 0; -} -#disclaimer { - font-size: x-small; - color: #b3b3b3; - text-align: center; - padding: 1em; -} -#sidebar { - color: #555555; - background-color: #eeeff1; - font-size: 0.8em; - position: absolute; - width: 210px; - min-width: 210px; - max-width: 210px; - top: 0; - right: 0; - margin: 0; - border-left: 2px solid white; - height: 100%; -} -#sidebar #sidebar-header { - display: block; - background-color: #2963a5; -} -#sidebar-inner { - padding: 10px; -} -#sidebar h2 { - font-size: 1.4em; - font-weight: normal; - border-bottom: 1px solid #cfd4d9; - margin: 5px 0px; - padding: 0px 5px; -} - -#sidebar ul { - list-style: square inside; - padding: 0; - margin: 0 0 1em 0; - color: #22538b; -} -#spacer { - height: 1em; -} -:link { - color: #337ACC; -} -:visited { - color: #6A3B18; -} - diff --git a/scripts/planet/people/css/print.css b/scripts/planet/people/css/print.css deleted file mode 100644 index 0be9bea..0000000 --- a/scripts/planet/people/css/print.css +++ /dev/null @@ -1,86 +0,0 @@ -body { - background: white; - color: black; - font-size: 10pt; - font-family: sans-serif; - line-height: 1.25em; -} - -div { - border: 1px solid white; -} -li { - border: 1px solid white; - margin: 0; -} -li p { - display: inline; -} - -h1 { - font-size: 16pt; -} -h2 { - font-size: 12pt; -} -h3,h4,h5 { - font-size: 10pt; -} -img { - border: 1px solid white; - background-color: white; -} -hr { - border: 1px dotted gray; - border-width: 0 0 1 0; - margin: 1em; -} -table { - border-collapse: collapse; -} -td,th { - border: 1px solid gray; - padding: 8pt; - font-size: 10pt; -} -th { - font-weight: bold; -} -#fedora-header, #fedora-footer { - text-align: center; -} -#fedora-header-items, #fedora-side-left, #fedora-side-right { - display: none; -} - -#fedora-project-download dt { - font-weight: bold; - margin-top: 8pt; - margin-left: 5pt; -} -#fedora-project-download dd { - padding: 0; - margin: 10px 20px 0; -} - -code.screen, pre.screen { - font-family: monospace; - font-size: 1em; - display: block; - padding: 5pt; - border: 1px dashed gray; - margin: 0.5em 2em; -} -#fedora-project code.screen { - margin: 0; -} - -/* -#fedora-content a:link:after, #fedora-content a:visited:after { - content: " (" attr(href) ") "; - font-size: 80%; -} -*/ -.navheader table, .navheader table td { - border: 0 !important; -} diff --git a/scripts/planet/people/images/blue.png b/scripts/planet/people/images/blue.png deleted file mode 100644 index 6987cab..0000000 Binary files a/scripts/planet/people/images/blue.png and /dev/null differ diff --git a/scripts/planet/people/images/corner-bl.png b/scripts/planet/people/images/corner-bl.png deleted file mode 100644 index 58d269c..0000000 Binary files a/scripts/planet/people/images/corner-bl.png and /dev/null differ diff --git a/scripts/planet/people/images/corner-br.png b/scripts/planet/people/images/corner-br.png deleted file mode 100644 index c03dd92..0000000 Binary files a/scripts/planet/people/images/corner-br.png and /dev/null differ diff --git a/scripts/planet/people/images/corner-tl.png b/scripts/planet/people/images/corner-tl.png deleted file mode 100644 index 08ab7a3..0000000 Binary files a/scripts/planet/people/images/corner-tl.png and /dev/null differ diff --git a/scripts/planet/people/images/corner-tr.png b/scripts/planet/people/images/corner-tr.png deleted file mode 100644 index b279db2..0000000 Binary files a/scripts/planet/people/images/corner-tr.png and /dev/null differ diff --git a/scripts/planet/people/images/favicon.ico b/scripts/planet/people/images/favicon.ico deleted file mode 100644 index d1ae2d2..0000000 Binary files a/scripts/planet/people/images/favicon.ico and /dev/null differ diff --git a/scripts/planet/people/images/header-download.png b/scripts/planet/people/images/header-download.png deleted file mode 100644 index a1cf3e5..0000000 Binary files a/scripts/planet/people/images/header-download.png and /dev/null differ diff --git a/scripts/planet/people/images/header-faq.png b/scripts/planet/people/images/header-faq.png deleted file mode 100644 index 1e7c3c9..0000000 Binary files a/scripts/planet/people/images/header-faq.png and /dev/null differ diff --git a/scripts/planet/people/images/header-fedora_logo.png b/scripts/planet/people/images/header-fedora_logo.png deleted file mode 100644 index 552f201..0000000 Binary files a/scripts/planet/people/images/header-fedora_logo.png and /dev/null differ diff --git a/scripts/planet/people/images/header-projects.png b/scripts/planet/people/images/header-projects.png deleted file mode 100644 index aad307e..0000000 Binary files a/scripts/planet/people/images/header-projects.png and /dev/null differ diff --git a/scripts/planet/people/images/heads/default.png b/scripts/planet/people/images/heads/default.png deleted file mode 100644 index 407185b..0000000 Binary files a/scripts/planet/people/images/heads/default.png and /dev/null differ diff --git a/scripts/planet/people/images/heads/fdp.png b/scripts/planet/people/images/heads/fdp.png deleted file mode 100644 index 5d00abe..0000000 Binary files a/scripts/planet/people/images/heads/fdp.png and /dev/null differ diff --git a/scripts/planet/people/images/heads/map_brazil_fedora_small.png b/scripts/planet/people/images/heads/map_brazil_fedora_small.png deleted file mode 100644 index 7362552..0000000 Binary files a/scripts/planet/people/images/heads/map_brazil_fedora_small.png and /dev/null differ diff --git a/scripts/planet/people/images/intro-computer.png b/scripts/planet/people/images/intro-computer.png deleted file mode 100644 index 9298aec..0000000 Binary files a/scripts/planet/people/images/intro-computer.png and /dev/null differ diff --git a/scripts/planet/people/images/intro-download.png b/scripts/planet/people/images/intro-download.png deleted file mode 100644 index c77db0b..0000000 Binary files a/scripts/planet/people/images/intro-download.png and /dev/null differ diff --git a/scripts/planet/people/images/logo-spacer.png b/scripts/planet/people/images/logo-spacer.png deleted file mode 100644 index a104f55..0000000 Binary files a/scripts/planet/people/images/logo-spacer.png and /dev/null differ diff --git a/scripts/planet/people/images/logo.png b/scripts/planet/people/images/logo.png deleted file mode 100644 index f277bf9..0000000 Binary files a/scripts/planet/people/images/logo.png and /dev/null differ diff --git a/scripts/planet/people/images/mainBack.png b/scripts/planet/people/images/mainBack.png deleted file mode 100644 index 1372780..0000000 Binary files a/scripts/planet/people/images/mainBack.png and /dev/null differ diff --git a/scripts/planet/people/images/people-entry-bottom-center.png b/scripts/planet/people/images/people-entry-bottom-center.png deleted file mode 100644 index 8d8ee6a..0000000 Binary files a/scripts/planet/people/images/people-entry-bottom-center.png and /dev/null differ diff --git a/scripts/planet/people/images/people-entry-bottom-left.png b/scripts/planet/people/images/people-entry-bottom-left.png deleted file mode 100644 index 1aadc48..0000000 Binary files a/scripts/planet/people/images/people-entry-bottom-left.png and /dev/null differ diff --git a/scripts/planet/people/images/people-entry-bottom-right.png b/scripts/planet/people/images/people-entry-bottom-right.png deleted file mode 100644 index 047c908..0000000 Binary files a/scripts/planet/people/images/people-entry-bottom-right.png and /dev/null differ diff --git a/scripts/planet/people/images/people-entry-center-left.png b/scripts/planet/people/images/people-entry-center-left.png deleted file mode 100644 index 9da8d17..0000000 Binary files a/scripts/planet/people/images/people-entry-center-left.png and /dev/null differ diff --git a/scripts/planet/people/images/people-entry-center-right.png b/scripts/planet/people/images/people-entry-center-right.png deleted file mode 100644 index 379c8c0..0000000 Binary files a/scripts/planet/people/images/people-entry-center-right.png and /dev/null differ diff --git a/scripts/planet/people/images/people-entry-group-date-background.png b/scripts/planet/people/images/people-entry-group-date-background.png deleted file mode 100644 index f029a67..0000000 Binary files a/scripts/planet/people/images/people-entry-group-date-background.png and /dev/null differ diff --git a/scripts/planet/people/images/people-entry-group-date-header.png b/scripts/planet/people/images/people-entry-group-date-header.png deleted file mode 100644 index 47ee607..0000000 Binary files a/scripts/planet/people/images/people-entry-group-date-header.png and /dev/null differ diff --git a/scripts/planet/people/images/people-entry-top-center.png b/scripts/planet/people/images/people-entry-top-center.png deleted file mode 100644 index 6b3b33a..0000000 Binary files a/scripts/planet/people/images/people-entry-top-center.png and /dev/null differ diff --git a/scripts/planet/people/images/people-entry-top-left.png b/scripts/planet/people/images/people-entry-top-left.png deleted file mode 100644 index 007a1e2..0000000 Binary files a/scripts/planet/people/images/people-entry-top-left.png and /dev/null differ diff --git a/scripts/planet/people/images/people-entry-top-right.png b/scripts/planet/people/images/people-entry-top-right.png deleted file mode 100644 index bfb41fb..0000000 Binary files a/scripts/planet/people/images/people-entry-top-right.png and /dev/null differ diff --git a/scripts/planet/people/images/people-header.png b/scripts/planet/people/images/people-header.png deleted file mode 100644 index d1fcbbc..0000000 Binary files a/scripts/planet/people/images/people-header.png and /dev/null differ diff --git a/scripts/planet/people/images/people-logo.png b/scripts/planet/people/images/people-logo.png deleted file mode 100644 index 6404e08..0000000 Binary files a/scripts/planet/people/images/people-logo.png and /dev/null differ diff --git a/scripts/planet/people/images/people-logo.png.bak b/scripts/planet/people/images/people-logo.png.bak deleted file mode 100644 index 1543ebe..0000000 Binary files a/scripts/planet/people/images/people-logo.png.bak and /dev/null differ diff --git a/scripts/planet/people/images/people-sidebar-header.png b/scripts/planet/people/images/people-sidebar-header.png deleted file mode 100644 index c820256..0000000 Binary files a/scripts/planet/people/images/people-sidebar-header.png and /dev/null differ diff --git a/scripts/planet/people/images/planet.png b/scripts/planet/people/images/planet.png deleted file mode 100644 index 9606a0c..0000000 Binary files a/scripts/planet/people/images/planet.png and /dev/null differ diff --git a/scripts/planet/people/templates/atom.xml.tmpl b/scripts/planet/people/templates/atom.xml.tmpl deleted file mode 100644 index 578f075..0000000 --- a/scripts/planet/people/templates/atom.xml.tmpl +++ /dev/null @@ -1,64 +0,0 @@ - - - - <TMPL_VAR name> - "/> - "/> - - - - - - xml:lang=""> - xml:lang="<TMPL_VAR title_language>"</TMPL_IF>><TMPL_VAR title ESCAPE="HTML"> - "/> - - - xml:lang=""> - - <img src="" width="" height="" alt="" style="float: right;"> - - - - - - - - - - - - - - - - - - - - - - <TMPL_VAR channel_title ESCAPE="HTML"> - - <TMPL_VAR channel_name ESCAPE="HTML"> - - - - - "/> - - - - - - - - - - - - - - - - diff --git a/scripts/planet/people/templates/foafroll.xml.tmpl b/scripts/planet/people/templates/foafroll.xml.tmpl deleted file mode 100644 index b2cecf3..0000000 --- a/scripts/planet/people/templates/foafroll.xml.tmpl +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - " /> - - - - - - - "> - - - " /> - - - - - - - - - diff --git a/scripts/planet/people/templates/heads.html.tmpl b/scripts/planet/people/templates/heads.html.tmpl deleted file mode 100644 index 1b3c377..0000000 --- a/scripts/planet/people/templates/heads.html.tmpl +++ /dev/null @@ -1,111 +0,0 @@ - - - -Planet Fedora - - - - - - - - - - - - - - -
- - - - - - -
-
-
-
    - - -
  • -
    -
- -
-
-
- -
- - - - diff --git a/scripts/planet/people/templates/index.html.tmpl b/scripts/planet/people/templates/index.html.tmpl deleted file mode 100644 index ecfae31..0000000 --- a/scripts/planet/people/templates/index.html.tmpl +++ /dev/null @@ -1,125 +0,0 @@ - - - -Planet Fedora - - - - - - - - - - - - - -
- - - - - - -
-
- - - -
- -
-

- - - -
-
-
- - -
Untitled Post
-
- -
- -
- -
- -
-
- -
-
-
-
- -
- - - - diff --git a/scripts/planet/people/templates/opml.xml.tmpl b/scripts/planet/people/templates/opml.xml.tmpl deleted file mode 100644 index 50bbabe..0000000 --- a/scripts/planet/people/templates/opml.xml.tmpl +++ /dev/null @@ -1,16 +0,0 @@ - - - - <TMPL_VAR name> - - - - - - - - - " xmlUrl=""/> - - - diff --git a/scripts/planet/people/templates/rss10.xml.tmpl b/scripts/planet/people/templates/rss10.xml.tmpl deleted file mode 100644 index a8d6bc0..0000000 --- a/scripts/planet/people/templates/rss10.xml.tmpl +++ /dev/null @@ -1,33 +0,0 @@ - - -"> - <TMPL_VAR name> - - Fedora People: http://planet.fedoraproject.org - - - - " /> - - - - - - -"> - <TMPL_VAR channel_name><TMPL_IF title>: <TMPL_VAR title></TMPL_IF> - - - - - - - - - diff --git a/scripts/planet/people/templates/rss20.xml.tmpl b/scripts/planet/people/templates/rss20.xml.tmpl deleted file mode 100644 index 6ca5dee..0000000 --- a/scripts/planet/people/templates/rss20.xml.tmpl +++ /dev/null @@ -1,27 +0,0 @@ - - - - <TMPL_VAR name> - - en - Fedora People: http://planet.fedoraproject.org - - - - <TMPL_VAR channel_name><TMPL_IF title>: <TMPL_VAR title></TMPL_IF> - - - - - - - <img src="" width="" height="" alt="" style="float: right;"> - - - - - - - - - diff --git a/scripts/planet/planetconfigbuilder.py b/scripts/planet/planetconfigbuilder.py deleted file mode 100755 index 3e85e21..0000000 --- a/scripts/planet/planetconfigbuilder.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/python -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Library General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# Copyright 2008 (c) Red Hat, Inc - written by Seth Vidal - -from ConfigParser import ConfigParser, ParsingError -import os -import os.path -import sys -import pwd -import time - -class Config(object): - def __init__(self, fn='/etc/planetbuilder.conf'): - """read in our config data""" - self.ignore_users = [] - self.banned_stanzas = ['Planet', 'main', 'DEFAULT'] - self.base_config = None - self.group = None - self.output = sys.stdout - self.output_fn = None - - cp = ConfigParser() - cp.read(fn) - if cp.has_section('main'): - if cp.has_option('main', 'base_config'): - self.base_config = cp.get('main', 'base_config') - if cp.has_option('main', 'group'): - self.group = cp.get('main', 'group') - - if cp.has_option('main', 'ignore_users'): - iu = cp.get('main', 'ignore_users') - iu = iu.replace(',',' ') - for user in iu.split(' '): - self.ignore_users.append(user) - if cp.has_option('main', 'banned_stanzas'): - bs = cp.get('main', 'banned_stanzas') - bs = bs.replace(',',' ') - for banned in bs.split(' '): - self.banned_stanzas.append(banned) - if cp.has_option('main', 'output'): - of = cp.get('main', 'output') - self.output = open(of, 'w') - self.output_fn = of - -def error_print(msg): - print >> sys.stderr, msg - -class PlanetBuilderException(Exception): - def __init__(self, value=None): - Exception.__init__(self) - self.value = value - - def __str__(self): - return "%s" %(self.value,) - - -class PlanetBuilder(object): - def __init__(self, config_file): - self.entries = {} - self.conf = Config(config_file) - - def add(self, entry): - if not entry.feed or not entry.name: - raise PlanetBuilderException, "entry %s lacks feed or name" % entry - - if entry.feed in self.conf.banned_stanzas: - raise PlanetBuilderException, "entry %s is in banned list" % entry - - if self.entries.has_key(entry.feed): - raise PlanetBuilderException, "entry %s already exists in list" % entry - - self.entries[entry.feed] = entry - - def compile(self): - result = "#planet config compiled on %s\n" % time.ctime() - result += "#using group %s and config %s\n" % (self.conf.group, self.conf.base_config) - if self.conf.base_config: - bc = open(self.conf.base_config, 'r').read() - result += bc - - for e in self.entries.values(): - fasname = os.path.split(os.path.split(e.origin)[0])[1] - e_format = "# Origin: %s\n" % (e.origin) - e_format += "[%s]\nname=%s (%s)\n" % (e.feed, e.name, fasname) - if e.face: - e_format += "face=%s\n" % (e.face) - result += e_format - result += "\n" - - self.result = result - - def produce_output(self): - self.conf.output.write(self.result) - self.conf.output.close() - -class PlanetEntry(object): - - def __init__(self, origin, feed=None, name=None, face=None): - self.origin = origin - self.feed = feed - self.name = name - if not name: - self.name = origin - self.face = face - - def __str__(self): - return '%s:%s' % (self.origin, self.feed) - -class PlanetFile(object): - def __init__(self, filename): - self.entries = [] - # open up with cp - cp = ConfigParser() - try: - cp.read(filename) - except ParsingError, e: - error_print("Problem parsing %s - %s" % (filename, str(e))) - return - - for s in cp.sections(): - name = face = None - if cp.has_option(s, 'name'): - name = cp.get(s, 'name') - if cp.has_option(s, 'face'): - face = cp.get(s, 'face') - e = PlanetEntry(filename, feed=s, name=name, face=face) - self.entries.append(e) - - def __iter__(self): - return self.entries.__iter__() - -def main(config_file='/etc/planetbuilder.conf'): - pb = PlanetBuilder(config_file) - - fn = '.planet' - if pb.conf.group: - fn = '.planet.%s' % pb.conf.group - - for (n, p, u, g, c, h, s) in pwd.getpwall(): - if u < 500: - continue - if n in pb.conf.ignore_users: - continue - - if os.path.exists(h + '/' + fn): - for entry in PlanetFile(h + '/' + fn): - pb.add(entry) - - pb.compile() - pb.produce_output() - print pb.conf.output_fn - - -if __name__ == "__main__": - if len(sys.argv) > 1: - main(sys.argv[1]) - else: - main() diff --git a/scripts/process-git-requests/README b/scripts/process-git-requests/README deleted file mode 100644 index 1a9a354..0000000 --- a/scripts/process-git-requests/README +++ /dev/null @@ -1,3 +0,0 @@ -processing scm is moving to be part of releng, as a result the home of this script is now -https://git.fedorahosted.org/cgit/releng/tree/scripts/process-git-requests - diff --git a/scripts/proxy-mirror/README b/scripts/proxy-mirror/README deleted file mode 100644 index 4eb603e..0000000 --- a/scripts/proxy-mirror/README +++ /dev/null @@ -1 +0,0 @@ -These files are scripts and examples to help you to configure your own proxy mirror. diff --git a/scripts/proxy-mirror/example-squid-config/README b/scripts/proxy-mirror/example-squid-config/README deleted file mode 100644 index e69de29..0000000 --- a/scripts/proxy-mirror/example-squid-config/README +++ /dev/null diff --git a/scripts/proxy-mirror/example-squid-config/squid.conf b/scripts/proxy-mirror/example-squid-config/squid.conf deleted file mode 100644 index 1f24e92..0000000 --- a/scripts/proxy-mirror/example-squid-config/squid.conf +++ /dev/null @@ -1,4352 +0,0 @@ - -# WELCOME TO SQUID 2.6.STABLE12 -# ---------------------------- -# -# This is the default Squid configuration file. You may wish -# to look at the Squid home page (http://www.squid-cache.org/) -# for the FAQ and other documentation. -# -# The default Squid config file shows what the defaults for -# various options happen to be. If you don't need to change the -# default, you shouldn't uncomment the line. Doing so may cause -# run-time problems. In some cases "none" refers to no default -# setting at all, while in other cases it refers to a valid -# option - the comments for that keyword indicate if this is the -# case. -# - - -# NETWORK OPTIONS -# ----------------------------------------------------------------------------- - -# TAG: http_port -# Usage: port [options] -# hostname:port [options] -# 1.2.3.4:port [options] -# -# The socket addresses where Squid will listen for HTTP client -# requests. You may specify multiple socket addresses. -# There are three forms: port alone, hostname with port, and -# IP address with port. If you specify a hostname or IP -# address, Squid binds the socket to that specific -# address. This replaces the old 'tcp_incoming_address' -# option. Most likely, you do not need to bind to a specific -# address, so you can use the port number alone. -# -# The default port number is 3128. -# -# If you are running Squid in accelerator mode, you -# probably want to listen on port 80 also, or instead. -# -# The -a command line option will override the *first* port -# number listed here. That option will NOT override an IP -# address, however. -# -# You may specify multiple socket addresses on multiple lines. -# -# options are: -# -# transparent Support for transparent interception of -# outgoing requests without browser settings -# -# accel Accelerator mode. Also needs at least one -# of vhost/vport/defaultsite. -# -# defaultsite= Main web site name for accelerators. Implies -# accel. -# -# vhost Accelerator using the Host header for -# virtual domain support. Implies accel. -# -# vport Accelerator with IP based virtual host support. -# Implies accel. -# -# vport= As above, but uses specified port number -# rather than the http_port number. Implies accel. -# -# urlgroup= Default urlgroup to mark requests -# with (see also acl urlgroup and -# url_rewrite_program) -# -# protocol= Protocol to reconstruct accelerated -# requests with. Defaults to http. -# -# no-connection-auth -# Prevent forwarding of Microsoft -# connection oriented authentication -# (NTLM, Negotiate and Kerberos) -# -# tproxy Support Linux TPROXY for spoofing -# outgoing connections using the client -# IP address. -# -# If you run Squid on a dual-homed machine with an internal -# and an external interface we recommend you to specify the -# internal address:port in http_port. This way Squid will only be -# visible on the internal address. -# -# Squid normally listens to port 3128 -http_port 80 accel defaultsite=download.fedora.redhat.com -cache_peer 209.132.176.220 parent 80 0 no-query originserver - -# TAG: https_port -# Usage: [ip:]port cert=certificate.pem [key=key.pem] [options...] -# -# The socket address where Squid will listen for HTTPS client -# requests. -# -# This is really only useful for situations where you are running -# squid in accelerator mode and you want to do the SSL work at the -# accelerator level. -# -# You may specify multiple socket addresses on multiple lines, -# each with their own SSL certificate and/or options. -# -# Options: -# -# accel Accelerator mode. Also needs at least one of -# defaultsite or vhost. -# -# defaultsite= The name of the https site presented on -# this port. Implies accel. -# -# vhost Domain based virtual host support. Useful -# in combination with a wildcard certificate or -# other certificates valid for more than one domain. -# Implies accel. -# -# urlgroup= Default urlgroup to mark requests with (see -# also acl urlgroup and url_rewrite_program) -# -# protocol= Protocol to reconstruct accelerated requests -# with. Defaults to https. -# -# cert= Path to SSL certificate (PEM format) -# -# key= Path to SSL private key file (PEM format) -# if not specified, the certificate file is -# assumed to be a combined certificate and -# key file -# -# version= The version of SSL/TLS supported -# 1 automatic (default) -# 2 SSLv2 only -# 3 SSLv3 only -# 4 TLSv1 only -# -# cipher= Colon separated list of supported ciphers -# -# options= Various SSL engine options. The most important -# being: -# NO_SSLv2 Disallow the use of SSLv2 -# NO_SSLv3 Disallow the use of SSLv3 -# NO_TLSv1 Disallow the use of TLSv1 -# SINGLE_DH_USE Always create a new key when using -# temporary/ephemeral DH key exchanges -# See src/ssl_support.c or OpenSSL SSL_CTX_set_options -# documentation for a complete list of options. -# -# clientca= File containing the list of CAs to use when -# requesting a client certificate -# -# cafile= File containing additional CA certificates to -# use when verifying client certificates. If unset -# clientca will be used. -# -# capath= Directory containing additional CA certificates -# and CRL lists to use when verifying client certificates -# -# crlfile= File of additional CRL lists to use when verifying -# the client certificate, in addition to CRLs stored in -# the capath. Implies VERIFY_CRL flag below. -# -# dhparams= File containing DH parameters for temporary/ephemeral -# DH key exchanges -# -# sslflags= Various flags modifying the use of SSL: -# DELAYED_AUTH -# Don't request client certificates -# immediately, but wait until acl processing -# requires a certificate (not yet implemented) -# NO_DEFAULT_CA -# Don't use the default CA lists built in -# to OpenSSL. -# NO_SESSION_REUSE -# Don't allow for session reuse. Each connection -# will result in a new SSL session. -# VERIFY_CRL -# Verify CRL lists when accepting client -# certificates -# VERIFY_CRL_ALL -# Verify CRL lists for all certificates in the -# client certificate chain -# -# sslcontext= SSL session ID context identifier. -# -# -#Default: -# none - -# TAG: ssl_unclean_shutdown -# Some browsers (especially MSIE) bugs out on SSL shutdown -# messages. -# -#Default: -# ssl_unclean_shutdown off - -# TAG: ssl_engine -# The OpenSSL engine to use. You will need to set this if you -# would like to use hardware SSL acceleration for example. -# -#Default: -# none - -# TAG: sslproxy_client_certificate -# Client SSL Certificate to use when proxying https:// URLs -# -#Default: -# none - -# TAG: sslproxy_client_key -# Client SSL Key to use when proxying https:// URLs -# -#Default: -# none - -# TAG: sslproxy_version -# SSL version level to use when proxying https:// URLs -# -#Default: -# sslproxy_version 1 - -# TAG: sslproxy_options -# SSL engine options to use when proxying https:// URLs -# -#Default: -# none - -# TAG: sslproxy_cipher -# SSL cipher list to use when proxying https:// URLs -# -#Default: -# none - -# TAG: sslproxy_cafile -# TAG: sslproxy_capath -# TAG: sslproxy_flags -# TAG: sslpassword_program -# Specify a program used for entering SSL key passphrases -# when using encrypted SSL certificate keys. If not specified -# keys must either be unencrypted, or Squid started with the -N -# option to allow it to query interactively for the passphrase. -# -#Default: -# none - -# TAG: icp_port -# The port number where Squid sends and receives ICP queries to -# and from neighbor caches. Default is 3130. To disable use -# "0". May be overridden with -u on the command line. -# -#Default: -# icp_port 3130 - -# TAG: htcp_port -# Note: This option is only available if Squid is rebuilt with the -# --enable-htcp option -# -# The port number where Squid sends and receives HTCP queries to -# and from neighbor caches. Default is 4827. To disable use -# "0". -# -#Default: -# htcp_port 4827 - -# TAG: mcast_groups -# This tag specifies a list of multicast groups which your server -# should join to receive multicasted ICP queries. -# -# NOTE! Be very careful what you put here! Be sure you -# understand the difference between an ICP _query_ and an ICP -# _reply_. This option is to be set only if you want to RECEIVE -# multicast queries. Do NOT set this option to SEND multicast -# ICP (use cache_peer for that). ICP replies are always sent via -# unicast, so this option does not affect whether or not you will -# receive replies from multicast group members. -# -# You must be very careful to NOT use a multicast address which -# is already in use by another group of caches. -# -# If you are unsure about multicast, please read the Multicast -# chapter in the Squid FAQ (http://www.squid-cache.org/FAQ/). -# -# Usage: mcast_groups 239.128.16.128 224.0.1.20 -# -# By default, Squid doesn't listen on any multicast groups. -# -#Default: -# none - -# TAG: udp_incoming_address -# TAG: udp_outgoing_address -# udp_incoming_address is used for the ICP socket receiving packets -# from other caches. -# udp_outgoing_address is used for ICP packets sent out to other -# caches. -# -# The default behavior is to not bind to any specific address. -# -# A udp_incoming_address value of 0.0.0.0 indicates Squid -# should listen for UDP messages on all available interfaces. -# -# If udp_outgoing_address is set to 255.255.255.255 (the default) -# it will use the same socket as udp_incoming_address. Only -# change this if you want to have ICP queries sent using another -# address than where this Squid listens for ICP queries from other -# caches. -# -# NOTE, udp_incoming_address and udp_outgoing_address can not -# have the same value since they both use port 3130. -# -#Default: -# udp_incoming_address 0.0.0.0 -# udp_outgoing_address 255.255.255.255 - - -# OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM -# ----------------------------------------------------------------------------- - -# TAG: cache_peer -# To specify other caches in a hierarchy, use the format: -# -# cache_peer hostname type http_port icp_port [options] -# -# For example, -# -# # proxy icp -# # hostname type port port options -# # -------------------- -------- ----- ----- ----------- -# cache_peer parent.foo.net parent 3128 3130 [proxy-only] -# cache_peer sib1.foo.net sibling 3128 3130 [proxy-only] -# cache_peer sib2.foo.net sibling 3128 3130 [proxy-only] -# -# type: either 'parent', 'sibling', or 'multicast'. -# -# proxy_port: The port number where the cache listens for proxy -# requests. -# -# icp_port: Used for querying neighbor caches about -# objects. To have a non-ICP neighbor -# specify '7' for the ICP port and make sure the -# neighbor machine has the UDP echo port -# enabled in its /etc/inetd.conf file. -# -# options: proxy-only -# weight=n -# ttl=n -# no-query -# default -# round-robin -# multicast-responder -# closest-only -# no-digest -# no-netdb-exchange -# no-delay -# login=user:password | PASS | *:password -# connect-timeout=nn -# digest-url=url -# allow-miss -# max-conn -# htcp -# htcp-oldsquid -# carp-load-factor -# originserver -# userhash -# sourcehash -# name=xxx -# monitorurl=url -# monitorsize=sizespec -# monitorinterval=seconds -# monitortimeout=seconds -# group=name -# forceddomain=name -# ssl -# sslcert=/path/to/ssl/certificate -# sslkey=/path/to/ssl/key -# sslversion=1|2|3|4 -# sslcipher=... -# ssloptions=... -# front-end-https[=on|auto] -# connection-auth[=on|off|auto] -# -# use 'proxy-only' to specify objects fetched -# from this cache should not be saved locally. -# -# use 'weight=n' to specify a weighted parent. -# The weight must be an integer. The default weight -# is 1, larger weights are favored more. -# -# use 'ttl=n' to specify a IP multicast TTL to use -# when sending an ICP queries to this address. -# Only useful when sending to a multicast group. -# Because we don't accept ICP replies from random -# hosts, you must configure other group members as -# peers with the 'multicast-responder' option below. -# -# use 'no-query' to NOT send ICP queries to this -# neighbor. -# -# use 'default' if this is a parent cache which can -# be used as a "last-resort." You should probably -# only use 'default' in situations where you cannot -# use ICP with your parent cache(s). -# -# use 'round-robin' to define a set of parents which -# should be used in a round-robin fashion in the -# absence of any ICP queries. -# -# 'multicast-responder' indicates the named peer -# is a member of a multicast group. ICP queries will -# not be sent directly to the peer, but ICP replies -# will be accepted from it. -# -# 'closest-only' indicates that, for ICP_OP_MISS -# replies, we'll only forward CLOSEST_PARENT_MISSes -# and never FIRST_PARENT_MISSes. -# -# use 'no-digest' to NOT request cache digests from -# this neighbor. -# -# 'no-netdb-exchange' disables requesting ICMP -# RTT database (NetDB) from the neighbor. -# -# use 'no-delay' to prevent access to this neighbor -# from influencing the delay pools. -# -# use 'login=user:password' if this is a personal/workgroup -# proxy and your parent requires proxy authentication. -# Note: The string can include URL escapes (i.e. %20 for -# spaces). This also means % must be written as %%. -# -# use 'login=PASS' to forward authentication to the peer. -# Needed if the peer requires login. -# Note: To combine this with local authentication the Basic -# authentication scheme must be used, and both servers must -# share the same user database as HTTP only allows for -# a single login (one for proxy, one for origin server). -# -# use 'login=*:password' to pass the username to the -# upstream cache, but with a fixed password. This is meant -# to be used when the peer is in another administrative -# domain, but it is still needed to identify each user. -# The star can optionally be followed by some extra -# information which is added to the username. This can -# be used to identify this proxy to the peer, similar to -# the login=username:password option above. -# -# use 'connect-timeout=nn' to specify a peer -# specific connect timeout (also see the -# peer_connect_timeout directive) -# -# use 'digest-url=url' to tell Squid to fetch the cache -# digest (if digests are enabled) for this host from -# the specified URL rather than the Squid default -# location. -# -# use 'allow-miss' to disable Squid's use of only-if-cached -# when forwarding requests to siblings. This is primarily -# useful when icp_hit_stale is used by the sibling. To -# extensive use of this option may result in forwarding -# loops, and you should avoid having two-way peerings -# with this option. (for example to deny peer usage on -# requests from peer by denying cache_peer_access if the -# source is a peer) -# -# use 'max-conn' to limit the amount of connections Squid -# may open to this peer. -# -# use 'htcp' to send HTCP, instead of ICP, queries -# to the neighbor. You probably also want to -# set the "icp port" to 4827 instead of 3130. -# -# use 'htcp-oldsquid' to send HTCP to old Squid versions -# -# use 'carp-load-factor=f' to define a parent -# cache as one participating in a CARP array. -# The 'f' values for all CARP parents must add -# up to 1.0. -# -# 'originserver' causes this parent peer to be contacted as -# a origin server. Meant to be used in accelerator setups. -# -# use 'userhash' to load-balance amongst a set of parents -# based on the client proxy_auth or ident username. -# -# use 'sourcehash' to load-balanse amongs a set of parents -# based on the client source ip. -# -# use 'name=xxx' if you have multiple peers on the same -# host but different ports. This name can then be used to -# differentiate the peers in cache_peer_access and similar -# directives. -# -# use 'monitorurl=url' to have periodically request a given -# URL from the peer, and only consider the peer as alive -# if this monitoring is successful (default none) -# -# use 'monitorsize=min[-max]' to limit the size range of -# 'monitorurl' replies considered valid. Defaults to 0 to -# accept any size replies as valid. -# -# use 'monitorinterval=seconds' to change frequency of -# how often the peer is monitored with 'monitorurl' -# (default 300 for a 5 minute interval). If set to 0 -# then monitoring is disabled even if a URL is defined. -# -# use 'monitortimeout=seconds' to change the timeout of -# 'monitorurl'. Defaults to 'monitorinterval'. -# -# use 'forceddomain=name' to forcibly set the Host header -# of requests forwarded to this peer. Useful in accelerator -# setups where the server (peer) expects a certain domain -# name and using redirectors to feed this domain name -# is not feasible. -# -# use 'ssl' to indicate that connections to this peer should -# be SSL/TLS encrypted. -# -# use 'sslcert=/path/to/ssl/certificate' to specify a client -# SSL certificate to use when connecting to this peer. -# -# use 'sslkey=/path/to/ssl/key' to specify the private SSL -# key corresponding to sslcert above. If 'sslkey' is not -# specified then 'sslcert' is assumed to reference a -# combined file containing both the certificate and the key. -# -# use sslversion=1|2|3|4 to specify the SSL version to use -# when connecting to this peer -# 1 = automatic (default) -# 2 = SSL v2 only -# 3 = SSL v3 only -# 4 = TLS v1 only -# -# use sslcipher=... to specify the list of valid SSL ciphers -# to use when connecting to this peer. -# -# use ssloptions=... to specify various SSL engine options: -# NO_SSLv2 Disallow the use of SSLv2 -# NO_SSLv3 Disallow the use of SSLv3 -# NO_TLSv1 Disallow the use of TLSv1 -# See src/ssl_support.c or the OpenSSL documentation for -# a more complete list. -# -# use sslcafile=... to specify a file containing -# additional CA certificates to use when verifying the -# peer certificate. -# -# use sslcapath=... to specify a directory containing -# additional CA certificates to use when verifying the -# peer certificate. -# -# use sslcrlfile=... to specify a certificate revocation -# list file to use when verifying the peer certificate. -# -# use sslflags=... to specify various flags modifying the -# SSL implementation: -# DONT_VERIFY_PEER -# Accept certificates even if they fail to -# verify. -# NO_DEFAULT_CA -# Don't use the default CA list built in -# to OpenSSL. -# -# use ssldomain= to specify the peer name as advertised -# in it's certificate. Used for verifying the correctness -# of the received peer certificate. If not specified the -# peer hostname will be used. -# -# use front-end-https to enable the "Front-End-Https: On" -# header needed when using Squid as a SSL frontend in front -# of Microsoft OWA. See MS KB document Q307347 for details -# on this header. If set to auto then the header will -# only be added if the request is forwarded as a https:// -# URL. -# -# use connection-auth=off to tell Squid that this peer does -# not support Microsoft connection oriented authentication, -# and any such challenges received from there should be -# ignored. Default is auto to automatically determine the -# status of the peer. -# -# NOTE: non-ICP/HTCP neighbors must be specified as 'parent'. -# -#Default: -# none - -# TAG: cache_peer_domain -# Use to limit the domains for which a neighbor cache will be -# queried. Usage: -# -# cache_peer_domain cache-host domain [domain ...] -# cache_peer_domain cache-host !domain -# -# For example, specifying -# -# cache_peer_domain parent.foo.net .edu -# -# has the effect such that UDP query packets are sent to -# 'bigserver' only when the requested object exists on a -# server in the .edu domain. Prefixing the domain name -# with '!' means the cache will be queried for objects -# NOT in that domain. -# -# NOTE: * Any number of domains may be given for a cache-host, -# either on the same or separate lines. -# * When multiple domains are given for a particular -# cache-host, the first matched domain is applied. -# * Cache hosts with no domain restrictions are queried -# for all requests. -# * There are no defaults. -# * There is also a 'cache_peer_access' tag in the ACL -# section. -# -#Default: -# none - -# TAG: neighbor_type_domain -# usage: neighbor_type_domain neighbor parent|sibling domain domain ... -# -# Modifying the neighbor type for specific domains is now -# possible. You can treat some domains differently than the the -# default neighbor type specified on the 'cache_peer' line. -# Normally it should only be necessary to list domains which -# should be treated differently because the default neighbor type -# applies for hostnames which do not match domains listed here. -# -#EXAMPLE: -# cache_peer parent cache.foo.org 3128 3130 -# neighbor_type_domain cache.foo.org sibling .com .net -# neighbor_type_domain cache.foo.org sibling .au .de -# -#Default: -# none - -# TAG: icp_query_timeout (msec) -# Normally Squid will automatically determine an optimal ICP -# query timeout value based on the round-trip-time of recent ICP -# queries. If you want to override the value determined by -# Squid, set this 'icp_query_timeout' to a non-zero value. This -# value is specified in MILLISECONDS, so, to use a 2-second -# timeout (the old default), you would write: -# -# icp_query_timeout 2000 -# -#Default: -# icp_query_timeout 0 - -# TAG: maximum_icp_query_timeout (msec) -# Normally the ICP query timeout is determined dynamically. But -# sometimes it can lead to very large values (say 5 seconds). -# Use this option to put an upper limit on the dynamic timeout -# value. Do NOT use this option to always use a fixed (instead -# of a dynamic) timeout value. To set a fixed timeout see the -# 'icp_query_timeout' directive. -# -#Default: -# maximum_icp_query_timeout 2000 - -# TAG: mcast_icp_query_timeout (msec) -# For multicast peers, Squid regularly sends out ICP "probes" to -# count how many other peers are listening on the given multicast -# address. This value specifies how long Squid should wait to -# count all the replies. The default is 2000 msec, or 2 -# seconds. -# -#Default: -# mcast_icp_query_timeout 2000 - -# TAG: dead_peer_timeout (seconds) -# This controls how long Squid waits to declare a peer cache -# as "dead." If there are no ICP replies received in this -# amount of time, Squid will declare the peer dead and not -# expect to receive any further ICP replies. However, it -# continues to send ICP queries, and will mark the peer as -# alive upon receipt of the first subsequent ICP reply. -# -# This timeout also affects when Squid expects to receive ICP -# replies from peers. If more than 'dead_peer' seconds have -# passed since the last ICP reply was received, Squid will not -# expect to receive an ICP reply on the next query. Thus, if -# your time between requests is greater than this timeout, you -# will see a lot of requests sent DIRECT to origin servers -# instead of to your parents. -# -#Default: -# dead_peer_timeout 10 seconds - -# TAG: hierarchy_stoplist -# A list of words which, if found in a URL, cause the object to -# be handled directly by this cache. In other words, use this -# to not query neighbor caches for certain objects. You may -# list this option multiple times. Note: never_direct overrides -# this option. -#We recommend you to use at least the following line. -hierarchy_stoplist cgi-bin ? - -# TAG: cache -# A list of ACL elements which, if matched, cause the request to -# not be satisfied from the cache and the reply to not be cached. -# In other words, use this to force certain objects to never be cached. -# -# You must use the word 'DENY' to indicate the ACL names which should -# NOT be cached. -# -# Default is to allow all to be cached -#We recommend you to use the following two lines. -acl QUERY urlpath_regex cgi-bin \? -cache deny QUERY - -# TAG: cache_vary -# Set to off to disable caching of Vary:in objects. -# -#Default: -# cache_vary on - -# TAG: broken_vary_encoding -# Many servers have broken support for on-the-fly Content-Encoding, -# returning the same ETag on both plain and gzip:ed variants. -# Vary replies matching this access list will have the cache split -# on the Accept-Encoding header of the request and not trusting the -# ETag to be unique. -# -# Apache mod_gzip and mod_deflate known to be broken so don't trust -# Apache to signal ETag correctly on such responses -acl apache rep_header Server ^Apache -broken_vary_encoding allow apache - - -# OPTIONS WHICH AFFECT THE CACHE SIZE -# ----------------------------------------------------------------------------- - -# TAG: cache_mem (bytes) -# NOTE: THIS PARAMETER DOES NOT SPECIFY THE MAXIMUM PROCESS SIZE. -# IT ONLY PLACES A LIMIT ON HOW MUCH ADDITIONAL MEMORY SQUID WILL -# USE AS A MEMORY CACHE OF OBJECTS. SQUID USES MEMORY FOR OTHER -# THINGS AS WELL. SEE THE SQUID FAQ SECTION 8 FOR DETAILS. -# -# 'cache_mem' specifies the ideal amount of memory to be used -# for: -# * In-Transit objects -# * Hot Objects -# * Negative-Cached objects -# -# Data for these objects are stored in 4 KB blocks. This -# parameter specifies the ideal upper limit on the total size of -# 4 KB blocks allocated. In-Transit objects take the highest -# priority. -# -# In-transit objects have priority over the others. When -# additional space is needed for incoming data, negative-cached -# and hot objects will be released. In other words, the -# negative-cached and hot objects will fill up any unused space -# not needed for in-transit objects. -# -# If circumstances require, this limit will be exceeded. -# Specifically, if your incoming request rate requires more than -# 'cache_mem' of memory to hold in-transit objects, Squid will -# exceed this limit to satisfy the new requests. When the load -# decreases, blocks will be freed until the high-water mark is -# reached. Thereafter, blocks will be used to store hot -# objects. -# -#Default: - cache_mem 384 MB - -# TAG: cache_swap_low (percent, 0-100) -# TAG: cache_swap_high (percent, 0-100) -# -# The low- and high-water marks for cache object replacement. -# Replacement begins when the swap (disk) usage is above the -# low-water mark and attempts to maintain utilization near the -# low-water mark. As swap utilization gets close to high-water -# mark object eviction becomes more aggressive. If utilization is -# close to the low-water mark less replacement is done each time. -# -# Defaults are 90% and 95%. If you have a large cache, 5% could be -# hundreds of MB. If this is the case you may wish to set these -# numbers closer together. -# -#Default: -# cache_swap_low 90 -# cache_swap_high 95 - -# TAG: maximum_object_size (bytes) -# Objects larger than this size will NOT be saved on disk. The -# value is specified in kilobytes, and the default is 4MB. If -# you wish to get a high BYTES hit ratio, you should probably -# increase this (one 32 MB object hit counts for 3200 10KB -# hits). If you wish to increase speed more than your want to -# save bandwidth you should leave this low. -# -# NOTE: if using the LFUDA replacement policy you should increase -# this value to maximize the byte hit rate improvement of LFUDA! -# See replacement_policy below for a discussion of this policy. -# -#Default: - maximum_object_size 2000000 KB - -# TAG: minimum_object_size (bytes) -# Objects smaller than this size will NOT be saved on disk. The -# value is specified in kilobytes, and the default is 0 KB, which -# means there is no minimum. -# -#Default: -# minimum_object_size 0 KB - -# TAG: maximum_object_size_in_memory (bytes) -# Objects greater than this size will not be attempted to kept in -# the memory cache. This should be set high enough to keep objects -# accessed frequently in memory to improve performance whilst low -# enough to keep larger objects from hoarding cache_mem. -# -#Default: -# maximum_object_size_in_memory 8 KB - -# TAG: ipcache_size (number of entries) -# TAG: ipcache_low (percent) -# TAG: ipcache_high (percent) -# The size, low-, and high-water marks for the IP cache. -# -#Default: -# ipcache_size 1024 -# ipcache_low 90 -# ipcache_high 95 - -# TAG: fqdncache_size (number of entries) -# Maximum number of FQDN cache entries. -# -#Default: -# fqdncache_size 1024 - -# TAG: cache_replacement_policy -# The cache replacement policy parameter determines which -# objects are evicted (replaced) when disk space is needed. -# -# lru : Squid's original list based LRU policy -# heap GDSF : Greedy-Dual Size Frequency -# heap LFUDA: Least Frequently Used with Dynamic Aging -# heap LRU : LRU policy implemented using a heap -# -# Applies to any cache_dir lines listed below this. -# -# The LRU policies keeps recently referenced objects. -# -# The heap GDSF policy optimizes object hit rate by keeping smaller -# popular objects in cache so it has a better chance of getting a -# hit. It achieves a lower byte hit rate than LFUDA though since -# it evicts larger (possibly popular) objects. -# -# The heap LFUDA policy keeps popular objects in cache regardless of -# their size and thus optimizes byte hit rate at the expense of -# hit rate since one large, popular object will prevent many -# smaller, slightly less popular objects from being cached. -# -# Both policies utilize a dynamic aging mechanism that prevents -# cache pollution that can otherwise occur with frequency-based -# replacement policies. -# -# NOTE: if using the LFUDA replacement policy you should increase -# the value of maximum_object_size above its default of 4096 KB to -# to maximize the potential byte hit rate improvement of LFUDA. -# -# For more information about the GDSF and LFUDA cache replacement -# policies see http://www.hpl.hp.com/techreports/1999/HPL-1999-69.html -# and http://fog.hpl.external.hp.com/techreports/98/HPL-98-173.html. -# -#Default: -# cache_replacement_policy lru - -# TAG: memory_replacement_policy -# The memory replacement policy parameter determines which -# objects are purged from memory when memory space is needed. -# -# See cache_replacement_policy for details. -# -#Default: -# memory_replacement_policy lru - - -# LOGFILE PATHNAMES AND CACHE DIRECTORIES -# ----------------------------------------------------------------------------- - -# TAG: cache_dir -# Usage: -# -# cache_dir Type Directory-Name Fs-specific-data [options] -# -# You can specify multiple cache_dir lines to spread the -# cache among different disk partitions. -# -# Type specifies the kind of storage system to use. Only "ufs" -# is built by default. To enable any of the other storage systems -# see the --enable-storeio configure option. -# -# 'Directory' is a top-level directory where cache swap -# files will be stored. If you want to use an entire disk -# for caching, this can be the mount-point directory. -# The directory must exist and be writable by the Squid -# process. Squid will NOT create this directory for you. -# Only using COSS, a raw disk device or a stripe file can -# be specified, but the configuration of the "cache_wap_log" -# tag is mandatory. -# -# The ufs store type: -# -# "ufs" is the old well-known Squid storage format that has always -# been there. -# -# cache_dir ufs Directory-Name Mbytes L1 L2 [options] -# -# 'Mbytes' is the amount of disk space (MB) to use under this -# directory. The default is 100 MB. Change this to suit your -# configuration. Do NOT put the size of your disk drive here. -# Instead, if you want Squid to use the entire disk drive, -# subtract 20% and use that value. -# -# 'Level-1' is the number of first-level subdirectories which -# will be created under the 'Directory'. The default is 16. -# -# 'Level-2' is the number of second-level subdirectories which -# will be created under each first-level directory. The default -# is 256. -# -# The aufs store type: -# -# "aufs" uses the same storage format as "ufs", utilizing -# POSIX-threads to avoid blocking the main Squid process on -# disk-I/O. This was formerly known in Squid as async-io. -# -# cache_dir aufs Directory-Name Mbytes L1 L2 [options] -# -# see argument descriptions under ufs above -# -# The diskd store type: -# -# "diskd" uses the same storage format as "ufs", utilizing a -# separate process to avoid blocking the main Squid process on -# disk-I/O. -# -# cache_dir diskd Directory-Name Mbytes L1 L2 [options] [Q1=n] [Q2=n] -# -# see argument descriptions under ufs above -# -# Q1 specifies the number of unacknowledged I/O requests when Squid -# stops opening new files. If this many messages are in the queues, -# Squid won't open new files. Default is 64 -# -# Q2 specifies the number of unacknowledged messages when Squid -# starts blocking. If this many messages are in the queues, -# Squid blocks until it receives some replies. Default is 72 -# -# When Q1 < Q2 (the default), the cache directory is optimized -# for lower response time at the expense of a decrease in hit -# ratio. If Q1 > Q2, the cache directory is optimized for -# higher hit ratio at the expense of an increase in response -# time. -# -# The COSS store type: -# -# block-size=n defines the "block size" for COSS cache_dir's. -# Squid uses file numbers as block numbers. Since file numbers -# are limited to 24 bits, the block size determines the maximum -# size of the COSS partition. The default is 512 bytes, which -# leads to a maximum cache_dir size of 512<<24, or 8 GB. Note -# you should not change the COSS block size after Squid -# has written some objects to the cache_dir. -# -# overwrite-percent=n defines the percentage of disk that COSS -# must write to before a given object will be moved to the -# current stripe. A value of "n" closer to 100 will cause COSS -# to waste less disk space by having multiple copies of an object -# on disk, but will increase the chances of overwriting a popular -# object as COSS overwrites stripes. A value of "n" close to 0 -# will cause COSS to keep all current objects in the current COSS -# stripe at the expense of the hit rate. The default value of 50 -# will allow any given object to be stored on disk a maximum of -# 2 times. -# -# max-stripe-waste=n defines the maximum amount of space that COSS -# will waste in a given stripe (in bytes). When COSS writes data -# to disk, it will potentially waste up to "max-size" worth of disk -# space for each 1MB of data written. If "max-size" is set to a -# large value (ie >256k), this could potentially result in large -# amounts of wasted disk space. Setting this value to a lower value -# (ie 64k or 32k) will result in a COSS disk refusing to cache -# larger objects until the COSS stripe has been filled to within -# "max-stripe-waste" of the maximum size (1MB). -# -# membufs=n defines the number of "memory-only" stripes that COSS -# will use. When an cache hit is performed on a COSS stripe before -# COSS has reached the overwrite-percent value for that object, -# COSS will use a series of memory buffers to hold the object in -# while the data is sent to the client. This will define the maximum -# number of memory-only buffers that COSS will use. The default value -# is 10, which will use a maximum of 10MB of memory for buffers. -# -# maxfullbufs=n defines the maximum number of stripes a COSS partition -# will have in memory waiting to be freed (either because the disk is -# under load and the stripe is unwritten, or because clients are still -# transferring data from objects using the memory). In order to try -# and maintain a good hit rate under load, COSS will reserve the last -# 2 full stripes for object hits. (ie a COSS cache_dir will reject -# new objects when the number of full stripes is 2 less than maxfullbufs) -# -# Common options: -# -# read-only, this cache_dir is read only. -# -# max-size=n, refers to the max object size this storedir supports. -# It is used to initially choose the storedir to dump the object. -# Note: To make optimal use of the max-size limits you should order -# the cache_dir lines with the smallest max-size value first and the -# ones with no max-size specification last. -# -# Note that for coss, max-size must be less than COSS_MEMBUF_SZ -# (hard coded at 1 MB). -# -#Default: - cache_dir ufs /var/spool/squid 53000 16 256 - -# TAG: logformat -# Usage: -# -# logformat -# -# Defines an access log format. -# -# The is a string with embedded % format codes -# -# % format codes all follow the same basic structure where all but -# the formatcode is optional. Output strings are automatically escaped -# as required according to their context and the output format -# modifiers are usually not needed, but can be specified if an explicit -# output format is desired. -# -# % ["|[|'|#] [-] [[0]width] [{argument}] formatcode -# -# " output in quoted string format -# [ output in squid text log format as used by log_mime_hdrs -# # output in URL quoted format -# ' output as-is -# -# - left aligned -# width field width. If starting with 0 then the -# output is zero padded -# {arg} argument such as header name etc -# -# Format codes: -# -# >a Client source IP address -# >A Client FQDN -# >p Client source port -# h Request header. Optional header name argument -# on the format header[:[separator]element] -# h -# un User name -# ul User login -# ui User ident -# us User SSL -# ue User external acl -# Hs HTTP status code -# Ss Squid request status (TCP_MISS etc) -# Sh Squid hierarchy status (DEFAULT_PARENT etc) -# mt MIME content type -# rm Request method (GET/POST etc) -# ru Request URL -# rv Request protocol version -# ea Log string returned by external acl -# st Request size including HTTP headers -# st Request+Reply size including HTTP headers -# % a literal % character -# -#logformat squid %ts.%03tu %6tr %>a %Ss/%03Hs %a %Ss/%03Hs %h] [%a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %h" "%{User-Agent}>h" %Ss:%Sh -# -#Default: -# none - -# TAG: access_log -# These files log client request activities. Has a line every HTTP or -# ICP request. The format is: -# access_log [ [acl acl ...]] -# -# Will log to the specified file using the specified format (which -# must be defined in a logformat directive) those entries which match -# ALL the acl's specified (which must be defined in acl clauses). -# If no acl is specified, all requests will be logged to this file. -# -# To disable logging of a request use the filepath "none", in which case -# a logformat name should not be specified. -# -# To log the request via syslog specify a filepath of "syslog" -access_log /var/log/squid/access.log squid - -# TAG: cache_log -# Cache logging file. This is where general information about -# your cache's behavior goes. You can increase the amount of data -# logged to this file with the "debug_options" tag below. -# -#Default: -# cache_log /var/log/squid/cache.log - -# TAG: cache_store_log -# Logs the activities of the storage manager. Shows which -# objects are ejected from the cache, and which objects are -# saved and for how long. To disable, enter "none". There are -# not really utilities to analyze this data, so you can safely -# disable it. -# -#Default: -# cache_store_log /var/log/squid/store.log - -# TAG: cache_swap_log -# Location for the cache "swap.state" file. This log file holds -# the metadata of objects saved on disk. It is used to rebuild -# the cache during startup. Normally this file resides in each -# 'cache_dir' directory, but you may specify an alternate -# pathname here. Note you must give a full filename, not just -# a directory. Since this is the index for the whole object -# list you CANNOT periodically rotate it! -# -# If %s can be used in the file name it will be replaced with a -# a representation of the cache_dir name where each / is replaced -# with '.'. This is needed to allow adding/removing cache_dir -# lines when cache_swap_log is being used. -# -# If have more than one 'cache_dir', and %s is not used in the name -# these swap logs will have names such as: -# -# cache_swap_log.00 -# cache_swap_log.01 -# cache_swap_log.02 -# -# The numbered extension (which is added automatically) -# corresponds to the order of the 'cache_dir' lines in this -# configuration file. If you change the order of the 'cache_dir' -# lines in this file, these log files will NOT correspond to -# the correct 'cache_dir' entry (unless you manually rename -# them). We recommend you do NOT use this option. It is -# better to keep these log files in each 'cache_dir' directory. -# -#Default: -# none - -# TAG: emulate_httpd_log on|off -# The Cache can emulate the log file format which many 'httpd' -# programs use. To disable/enable this emulation, set -# emulate_httpd_log to 'off' or 'on'. The default -# is to use the native log format since it includes useful -# information Squid-specific log analyzers use. -# -#Default: -# emulate_httpd_log off - -# TAG: log_ip_on_direct on|off -# Log the destination IP address in the hierarchy log tag when going -# direct. Earlier Squid versions logged the hostname here. If you -# prefer the old way set this to off. -# -#Default: -# log_ip_on_direct on - -# TAG: mime_table -# Pathname to Squid's MIME table. You shouldn't need to change -# this, but the default file contains examples and formatting -# information if you do. -# -#Default: -# mime_table /etc/squid/mime.conf - -# TAG: log_mime_hdrs on|off -# The Cache can record both the request and the response MIME -# headers for each HTTP transaction. The headers are encoded -# safely and will appear as two bracketed fields at the end of -# the access log (for either the native or httpd-emulated log -# formats). To enable this logging set log_mime_hdrs to 'on'. -# -#Default: -# log_mime_hdrs off - -# TAG: useragent_log -# Squid will write the User-Agent field from HTTP requests -# to the filename specified here. By default useragent_log -# is disabled. -# -#Default: -# none - -# TAG: referer_log -# Squid will write the Referer field from HTTP requests to the -# filename specified here. By default referer_log is disabled. -# Note that "referer" is actually a misspelling of "referrer" -# however the misspelt version has been accepted into the HTTP RFCs -# and we accept both. -# -#Default: -# none - -# TAG: pid_filename -# A filename to write the process-id to. To disable, enter "none". -# -#Default: -# pid_filename /var/run/squid.pid - -# TAG: debug_options -# Logging options are set as section,level where each source file -# is assigned a unique section. Lower levels result in less -# output, Full debugging (level 9) can result in a very large -# log file, so be careful. The magic word "ALL" sets debugging -# levels for all sections. We recommend normally running with -# "ALL,1". -# -#Default: -# debug_options ALL,1 - -# TAG: log_fqdn on|off -# Turn this on if you wish to log fully qualified domain names -# in the access.log. To do this Squid does a DNS lookup of all -# IP's connecting to it. This can (in some situations) increase -# latency, which makes your cache seem slower for interactive -# browsing. -# -#Default: -# log_fqdn off - -# TAG: client_netmask -# A netmask for client addresses in logfiles and cachemgr output. -# Change this to protect the privacy of your cache clients. -# A netmask of 255.255.255.0 will log all IP's in that range with -# the last digit set to '0'. -# -#Default: -# client_netmask 255.255.255.255 - - -# OPTIONS FOR EXTERNAL SUPPORT PROGRAMS -# ----------------------------------------------------------------------------- - -# TAG: ftp_user -# If you want the anonymous login password to be more informative -# (and enable the use of picky ftp servers), set this to something -# reasonable for your domain, like wwwuser@somewhere.net -# -# The reason why this is domainless by default is the -# request can be made on the behalf of a user in any domain, -# depending on how the cache is used. -# Some ftp server also validate the email address is valid -# (for example perl.com). -# -#Default: -# ftp_user Squid@ - -# TAG: ftp_list_width -# Sets the width of ftp listings. This should be set to fit in -# the width of a standard browser. Setting this too small -# can cut off long filenames when browsing ftp sites. -# -#Default: -# ftp_list_width 32 - -# TAG: ftp_passive -# If your firewall does not allow Squid to use passive -# connections, turn off this option. -# -#Default: -# ftp_passive on - -# TAG: ftp_sanitycheck -# For security and data integrity reasons Squid by default performs -# sanity checks of the addresses of FTP data connections ensure the -# data connection is to the requested server. If you need to allow -# FTP connections to servers using another IP address for the data -# connection turn this off. -# -#Default: -# ftp_sanitycheck on - -# TAG: ftp_telnet_protocol -# The FTP protocol is officially defined to use the telnet protocol -# as transport channel for the control connection. However, many -# implementations are broken and does not respect this aspect of -# the FTP protocol. -# -# If you have trouble accessing files with ASCII code 255 in the -# path or similar problems involving this ASCII code you can -# try setting this directive to off. If that helps, report to the -# operator of the FTP server in question that their FTP server -# is broken and does not follow the FTP standard. -# -#Default: -# ftp_telnet_protocol on - -# TAG: check_hostnames -# For security and stability reasons Squid by default checks -# hostnames for Internet standard RFC compliance. If you do not want -# Squid to perform these checks then turn this directive off. -# -#Default: -# check_hostnames on - -# TAG: allow_underscore -# Underscore characters is not strictly allowed in Internet hostnames -# but nevertheless used by many sites. Set this to off if you want -# Squid to be strict about the standard. -# -#Default: -# allow_underscore on - -# TAG: cache_dns_program -# Note: This option is only available if Squid is rebuilt with the -# --disable-internal-dns option -# -# Specify the location of the executable for dnslookup process. -# -#Default: -# cache_dns_program /usr/lib64/squid/dnsserver - -# TAG: dns_children -# Note: This option is only available if Squid is rebuilt with the -# --disable-internal-dns option -# -# The number of processes spawn to service DNS name lookups. -# For heavily loaded caches on large servers, you should -# probably increase this value to at least 10. The maximum -# is 32. The default is 5. -# -# You must have at least one dnsserver process. -# -#Default: -# dns_children 5 - -# TAG: dns_retransmit_interval -# Initial retransmit interval for DNS queries. The interval is -# doubled each time all configured DNS servers have been tried. -# -# -#Default: -# dns_retransmit_interval 5 seconds - -# TAG: dns_timeout -# DNS Query timeout. If no response is received to a DNS query -# within this time all DNS servers for the queried domain -# are assumed to be unavailable. -# -#Default: -# dns_timeout 2 minutes - -# TAG: dns_defnames on|off -# Normally the RES_DEFNAMES resolver option is disabled -# (see res_init(3)). This prevents caches in a hierarchy -# from interpreting single-component hostnames locally. To allow -# Squid to handle single-component names, enable this option. -# -#Default: -# dns_defnames off - -# TAG: dns_nameservers -# Use this if you want to specify a list of DNS name servers -# (IP addresses) to use instead of those given in your -# /etc/resolv.conf file. -# On Windows platforms, if no value is specified here or in -# the /etc/resolv.conf file, the list of DNS name servers are -# taken from the Windows registry, both static and dynamic DHCP -# configurations are supported. -# -# Example: dns_nameservers 10.0.0.1 192.172.0.4 -# -#Default: -# none - -# TAG: hosts_file -# Location of the host-local IP name-address associations -# database. Most Operating Systems have such a file on different -# default locations: -# - Un*X & Linux: /etc/hosts -# - Windows NT/2000: %SystemRoot%\system32\drivers\etc\hosts -# (%SystemRoot% value install default is c:\winnt) -# - Windows XP/2003: %SystemRoot%\system32\drivers\etc\hosts -# (%SystemRoot% value install default is c:\windows) -# - Windows 9x/Me: %windir%\hosts -# (%windir% value is usually c:\windows) -# - Cygwin: /etc/hosts -# -# The file contains newline-separated definitions, in the -# form ip_address_in_dotted_form name [name ...] names are -# whitespace-separated. Lines beginning with an hash (#) -# character are comments. -# -# The file is checked at startup and upon configuration. -# If set to 'none', it won't be checked. -# If append_domain is used, that domain will be added to -# domain-local (i.e. not containing any dot character) host -# definitions. -# -#Default: -# hosts_file /etc/hosts - -# TAG: diskd_program -# Specify the location of the diskd executable. -# Note that this is only useful if you have compiled in -# diskd as one of the store io modules. -# -#Default: -# diskd_program /usr/lib64/squid/diskd-daemon - -# TAG: unlinkd_program -# Specify the location of the executable for file deletion process. -# -#Default: -# unlinkd_program /usr/lib64/squid/unlinkd - -# TAG: pinger_program -# Note: This option is only available if Squid is rebuilt with the -# --enable-icmp option -# -# Specify the location of the executable for the pinger process. -# -#Default: -# pinger_program /usr/lib64/squid/pinger - -# TAG: url_rewrite_program -# Specify the location of the executable for the URL rewriter. -# Since they can perform almost any function there isn't one included. -# -# For each requested URL rewriter will receive on line with the format -# -# URL client_ip "/" fqdn user method urlgroup -# -# And the rewriter may return a rewritten URL. The other components of -# the request line does not need to be returned (ignored if they are). -# -# The rewriter can also indicate that a client-side redirect should -# be performed to the new URL. This is done by prefixing the returned -# URL with "301:" (moved permanently) or 302: (moved temporarily). -# -# It can also return a "urlgroup" that can subsequently be matched -# in cache_peer_access and similar ACL driven rules. An urlgroup is -# returned by prefixing the returned url with "!urlgroup!" -# -# By default, a URL rewriter is not used. -# -#Default: -# none - -# TAG: url_rewrite_children -# The number of redirector processes to spawn. If you start -# too few Squid will have to wait for them to process a backlog of -# URLs, slowing it down. If you start too many they will use RAM -# and other system resources. -# -#Default: -# url_rewrite_children 5 - -# TAG: url_rewrite_concurrency -# The number of requests each redirector helper can handle in -# parallel. Defaults to 0 which indicates that the redirector -# is a old-style singlethreaded redirector. -# -#Default: -# url_rewrite_concurrency 0 - -# TAG: url_rewrite_host_header -# By default Squid rewrites any Host: header in redirected -# requests. If you are running an accelerator this may -# not be a wanted effect of a redirector. -# -# WARNING: Entries are cached on the result of the URL rewriting -# process, so be careful if you have domain-virtual hosts. -# -#Default: -# url_rewrite_host_header on - -# TAG: url_rewrite_access -# If defined, this access list specifies which requests are -# sent to the redirector processes. By default all requests -# are sent. -# -#Default: -# none - -# TAG: location_rewrite_program -# Specify the location of the executable for the Location rewriter, -# used to rewrite server generated redirects. Usually used in -# conjunction with a url_rewrite_program -# -# For each Location header received the location rewriter will receive -# one line with the format: -# -# location URL requested URL urlgroup -# -# And the rewriter may return a rewritten Location URL or a blank line. -# The other components of the request line does not need to be returned -# (ignored if they are). -# -# By default, a Location rewriter is not used. -# -#Default: -# none - -# TAG: location_rewrite_children -# The number of location rewriting processes to spawn. If you start -# too few Squid will have to wait for them to process a backlog of -# URLs, slowing it down. If you start too many they will use RAM -# and other system resources. -# -#Default: -# location_rewrite_children 5 - -# TAG: location_rewrite_concurrency -# The number of requests each Location rewriter helper can handle in -# parallel. Defaults to 0 which indicates that the helper -# is a old-style singlethreaded helper. -# -#Default: -# location_rewrite_concurrency 0 - -# TAG: location_rewrite_access -# If defined, this access list specifies which requests are -# sent to the location rewriting processes. By default all Location -# headers are sent. -# -#Default: -# none - -# TAG: auth_param -# This is used to define parameters for the various authentication -# schemes supported by Squid. -# -# format: auth_param scheme parameter [setting] -# -# The order in which authentication schemes are presented to the client is -# dependent on the order the scheme first appears in config file. IE -# has a bug (it's not RFC 2617 compliant) in that it will use the basic -# scheme if basic is the first entry presented, even if more secure -# schemes are presented. For now use the order in the recommended -# settings section below. If other browsers have difficulties (don't -# recognize the schemes offered even if you are using basic) either -# put basic first, or disable the other schemes (by commenting out their -# program entry). -# -# Once an authentication scheme is fully configured, it can only be -# shutdown by shutting squid down and restarting. Changes can be made on -# the fly and activated with a reconfigure. I.E. You can change to a -# different helper, but not unconfigure the helper completely. -# -# Please note that while this directive defines how Squid processes -# authentication it does not automatically activate authentication. -# To use authentication you must in addition make use of ACLs based -# on login name in http_access (proxy_auth, proxy_auth_regex or -# external with %LOGIN used in the format tag). The browser will be -# challenged for authentication on the first such acl encountered -# in http_access processing and will also be re-challenged for new -# login credentials if the request is being denied by a proxy_auth -# type acl. -# -# WARNING: authentication can't be used in a transparently intercepting -# proxy as the client then thinks it is talking to an origin server and -# not the proxy. This is a limitation of bending the TCP/IP protocol to -# transparently intercepting port 80, not a limitation in Squid. -# -# === Parameters for the basic scheme follow. === -# -# "program" cmdline -# Specify the command for the external authenticator. Such a program -# reads a line containing "username password" and replies "OK" or -# "ERR" in an endless loop. "ERR" responses may optionally be followed -# by a error description available as %m in the returned error page. -# -# By default, the basic authentication scheme is not used unless a -# program is specified. -# -# If you want to use the traditional proxy authentication, jump over to -# the helpers/basic_auth/NCSA directory and type: -# % make -# % make install -# -# Then, set this line to something like -# -# auth_param basic program /usr/libexec/ncsa_auth /usr/etc/passwd -# -# "children" numberofchildren -# The number of authenticator processes to spawn. If you start too few -# squid will have to wait for them to process a backlog of credential -# verifications, slowing it down. When credential verifications are -# done via a (slow) network you are likely to need lots of -# authenticator processes. -# auth_param basic children 5 -# -# "concurrency" numberofconcurrentrequests -# The number of concurrent requests/channels the helper supports. -# Changes the protocol used to include a channel number first on -# the request/response line, allowing multiple requests to be sent -# to the same helper in parallell without wating for the response. -# Must not be set unless it's known the helper supports this. -# -# "realm" realmstring -# Specifies the realm name which is to be reported to the client for -# the basic proxy authentication scheme (part of the text the user -# will see when prompted their username and password). -# auth_param basic realm Squid proxy-caching web server -# -# "credentialsttl" timetolive -# Specifies how long squid assumes an externally validated -# username:password pair is valid for - in other words how often the -# helper program is called for that user. Set this low to force -# revalidation with short lived passwords. Note that setting this high -# does not impact your susceptibility to replay attacks unless you are -# using an one-time password system (such as SecureID). If you are using -# such a system, you will be vulnerable to replay attacks unless you -# also use the max_user_ip ACL in an http_access rule. -# auth_param basic credentialsttl 2 hours -# -# "casesensitive" on|off -# Specifies if usernames are case sensitive. Most user databases are -# case insensitive allowing the same username to be spelled using both -# lower and upper case letters, but some are case sensitive. This -# makes a big difference for user_max_ip ACL processing and similar. -# auth_param basic casesensitive off -# -# "blankpassword" on|off -# Specifies if blank passwords should be supported. Defaults to off -# as there is multiple authentication backends which handles blank -# passwords as "guest" access. -# -# === Parameters for the digest scheme follow === -# -# "program" cmdline -# Specify the command for the external authenticator. Such a program -# reads a line containing "username":"realm" and replies with the -# appropriate H(A1) value hex encoded or ERR if the user (or his H(A1) -# hash) does not exists. See RFC 2616 for the definition of H(A1). -# "ERR" responses may optionally be followed by a error description -# available as %m in the returned error page. -# -# By default, the digest authentication scheme is not used unless a -# program is specified. -# -# If you want to use a digest authenticator, jump over to the -# helpers/digest_auth/ directory and choose the authenticator to use. -# It it's directory type -# % make -# % make install -# -# Then, set this line to something like -# -# auth_param digest program /usr/libexec/digest_auth_pw /usr/etc/digpass -# -# -# "children" numberofchildren -# The number of authenticator processes to spawn. If you start too few -# squid will have to wait for them to process a backlog of credential -# verifications, slowing it down. When credential verifications are -# done via a (slow) network you are likely to need lots of -# authenticator processes. -# auth_param digest children 5 -# -# "concurrency" numberofconcurrentrequests -# The number of concurrent requests/channels the helper supports. -# Changes the protocol used to include a channel number first on -# the request/response line, allowing multiple requests to be sent -# to the same helper in parallell without wating for the response. -# Must not be set unless it's known the helper supports this. -# -# "realm" realmstring -# Specifies the realm name which is to be reported to the client for the -# digest proxy authentication scheme (part of the text the user will see -# when prompted their username and password). -# auth_param digest realm Squid proxy-caching web server -# -# "nonce_garbage_interval" timeinterval -# Specifies the interval that nonces that have been issued to clients are -# checked for validity. -# auth_param digest nonce_garbage_interval 5 minutes -# -# "nonce_max_duration" timeinterval -# Specifies the maximum length of time a given nonce will be valid for. -# auth_param digest nonce_max_duration 30 minutes -# -# "nonce_max_count" number -# Specifies the maximum number of times a given nonce can be used. -# auth_param digest nonce_max_count 50 -# -# "nonce_strictness" on|off -# Determines if squid requires strict increment-by-1 behavior for nonce -# counts, or just incrementing (off - for use when useragents generate -# nonce counts that occasionally miss 1 (ie, 1,2,4,6)). -# auth_param digest nonce_strictness off -# -# "check_nonce_count" on|off -# This directive if set to off can disable the nonce count check -# completely to work around buggy digest qop implementations in certain -# mainstream browser versions. Default on to check the nonce count to -# protect from authentication replay attacks. -# auth_param digest check_nonce_count on -# -# "post_workaround" on|off -# This is a workaround to certain buggy browsers who sends an incorrect -# request digest in POST requests when reusing the same nonce as acquired -# earlier in response to a GET request. -# auth_param digest post_workaround off -# -# === NTLM scheme options follow === -# -# "program" cmdline -# Specify the command for the external NTLM authenticator. Such a -# program participates in the NTLMSSP exchanges between Squid and the -# client and reads commands according to the Squid NTLMSSP helper -# protocol. See helpers/ntlm_auth/ for details. Recommended ntlm -# authenticator is ntlm_auth from Samba-3.X, but a number of other -# ntlm authenticators is available. -# -# By default, the ntlm authentication scheme is not used unless a -# program is specified. -# -# auth_param ntlm program /path/to/samba/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp -# -# "children" numberofchildren -# The number of authenticator processes to spawn. If you start too few -# squid will have to wait for them to process a backlog of credential -# verifications, slowing it down. When credential verifications are -# done via a (slow) network you are likely to need lots of -# authenticator processes. -# auth_param ntlm children 5 -# -# "keep_alive" on|off -# This option enables the use of keep-alive on the initial -# authentication request. It has been reported some versions of MSIE -# have problems if this is enabled, but performance will be increased -# if enabled. -# -# auth_param ntlm keep_alive on -# -# === Negotiate scheme options follow === -# -# "program" cmdline -# Specify the command for the external Negotiate authenticator. Such a -# program participates in the SPNEGO exchanges between Squid and the -# client and reads commands according to the Squid ntlmssp helper -# protocol. See helpers/ntlm_auth/ for details. Recommended SPNEGO -# authenticator is ntlm_auth from Samba-4.X. -# -# By default, the Negotiate authentication scheme is not used unless a -# program is specified. -# -# auth_param negotiate program /path/to/samba/bin/ntlm_auth --helper-protocol=gss-spnego -# -# "children" numberofchildren -# The number of authenticator processes to spawn. If you start too few -# squid will have to wait for them to process a backlog of credential -# verifications, slowing it down. When credential verifications are -# done via a (slow) network you are likely to need lots of -# authenticator processes. -# auth_param negotiate children 5 -# -# "keep_alive" on|off -# If you experience problems with PUT/POST requests when using the -# Negotiate authentication scheme then you can try setting this to -# off. This will cause Squid to forcibly close the connection on -# the initial requests where the browser asks which schemes are -# supported by the proxy. -# -# auth_param negotiate keep_alive on -# -#Recommended minimum configuration per scheme: -#auth_param negotiate program -#auth_param negotiate children 5 -#auth_param negotiate keep_alive on -#auth_param ntlm program -#auth_param ntlm children 5 -#auth_param ntlm keep_alive on -#auth_param digest program -#auth_param digest children 5 -#auth_param digest realm Squid proxy-caching web server -#auth_param digest nonce_garbage_interval 5 minutes -#auth_param digest nonce_max_duration 30 minutes -#auth_param digest nonce_max_count 50 -#auth_param basic program -#auth_param basic children 5 -#auth_param basic realm Squid proxy-caching web server -#auth_param basic credentialsttl 2 hours -#auth_param basic casesensitive off - -# TAG: authenticate_cache_garbage_interval -# The time period between garbage collection across the username cache. -# This is a tradeoff between memory utilization (long intervals - say -# 2 days) and CPU (short intervals - say 1 minute). Only change if you -# have good reason to. -# -#Default: -# authenticate_cache_garbage_interval 1 hour - -# TAG: authenticate_ttl -# The time a user & their credentials stay in the logged in user cache -# since their last request. When the garbage interval passes, all user -# credentials that have passed their TTL are removed from memory. -# -#Default: -# authenticate_ttl 1 hour - -# TAG: authenticate_ip_ttl -# If you use proxy authentication and the 'max_user_ip' ACL, this -# directive controls how long Squid remembers the IP addresses -# associated with each user. Use a small value (e.g., 60 seconds) if -# your users might change addresses quickly, as is the case with -# dialups. You might be safe using a larger value (e.g., 2 hours) in a -# corporate LAN environment with relatively static address assignments. -# -#Default: -# authenticate_ip_ttl 0 seconds - -# TAG: external_acl_type -# This option defines external acl classes using a helper program to -# look up the status -# -# external_acl_type name [options] FORMAT.. /path/to/helper [helper arguments..] -# -# Options: -# -# ttl=n TTL in seconds for cached results (defaults to 3600 -# for 1 hour) -# negative_ttl=n -# TTL for cached negative lookups (default same -# as ttl) -# children=n number of processes spawn to service external acl -# lookups of this type. (default 5). -# concurrency=n concurrency level per process. Only used with helpers -# capable of processing more than one query at a time. -# Note: see compatibility note below -# cache=n result cache size, 0 is unbounded (default) -# grace= Percentage remaining of TTL where a refresh of a -# cached entry should be initiated without needing to -# wait for a new reply. (default 0 for no grace period) -# protocol=2.5 Compatibility mode for Squid-2.5 external acl helpers -# -# FORMAT specifications -# -# %LOGIN Authenticated user login name -# %IDENT Ident user name -# %SRC Client IP -# %SRCPORT Client source port -# %DST Requested host -# %PROTO Requested protocol -# %PORT Requested port -# %METHOD Request method -# %MYADDR Squid interface address -# %MYPORT Squid http_port number -# %PATH Requested URL-path (including query-string if any) -# %USER_CERT SSL User certificate in PEM format -# %USER_CERTCHAIN SSL User certificate chain in PEM format -# %USER_CERT_xx SSL User certificate subject attribute xx -# %USER_CA_xx SSL User certificate issuer attribute xx -# %{Header} HTTP request header -# %{Hdr:member} HTTP request header list member -# %{Hdr:;member} -# HTTP request header list member using ; as -# list separator. ; can be any non-alphanumeric -# character. -# %ACL The ACL name -# %DATA The ACL arguments. If not used then any arguments -# is automatically added at the end -# -# The request sent to the helper consists of the data in the format -# specification in the order specified, plus any values specified in -# the referencing acl (see the "acl external" directive). -# -# The helper receives lines per the above format specification, -# and returns lines starting with OK or ERR indicating the validity -# of the request and optionally followed by additional keywords with -# more details. -# -# General result syntax: -# -# OK/ERR keyword=value ... -# -# Defined keywords: -# -# user= The users name (login also understood) -# password= The users password (for PROXYPASS login= cache_peer) -# message= Error message or similar used as %o in error messages -# (error also understood) -# log= String to be logged in access.log. Available as -# %ea in logformat specifications -# -# If protocol=3.0 (the default) then URL escaping is used to protect -# each value in both requests and responses. -# -# If using protocol=2.5 then all values need to be enclosed in quotes -# if they may contain whitespace, or the whitespace escaped using \. -# And quotes or \ characters within the keyword value must be \ escaped. -# -# When using the concurrency= option the protocol is changed by -# introducing a query channel tag infront of the request/response. -# The query channel tag is a number between 0 and concurrency-1. -# -# Compatibility Note: The children= option was named concurrency= in -# Squid-2.5.STABLE3 and earlier, and was accepted as an alias for the -# duration of the Squid-2.5 releases to keep compatibility. However, -# the meaning of concurrency= option has changed in Squid-2.6 to match -# that of Squid-3 and the old syntax no longer works. -# -#Default: -# none - - -# OPTIONS FOR TUNING THE CACHE -# ----------------------------------------------------------------------------- - -# TAG: wais_relay_host -# TAG: wais_relay_port -# Relay WAIS request to host (1st arg) at port (2 arg). -# -#Default: -# wais_relay_port 0 - -# TAG: request_header_max_size (KB) -# This specifies the maximum size for HTTP headers in a request. -# Request headers are usually relatively small (about 512 bytes). -# Placing a limit on the request header size will catch certain -# bugs (for example with persistent connections) and possibly -# buffer-overflow or denial-of-service attacks. -# -#Default: -# request_header_max_size 20 KB - -# TAG: request_body_max_size (KB) -# This specifies the maximum size for an HTTP request body. -# In other words, the maximum size of a PUT/POST request. -# A user who attempts to send a request with a body larger -# than this limit receives an "Invalid Request" error message. -# If you set this parameter to a zero (the default), there will -# be no limit imposed. -# -#Default: -# request_body_max_size 0 KB - -# TAG: refresh_pattern -# usage: refresh_pattern [-i] regex min percent max [options] -# -# By default, regular expressions are CASE-SENSITIVE. To make -# them case-insensitive, use the -i option. -# -# 'Min' is the time (in minutes) an object without an explicit -# expiry time should be considered fresh. The recommended -# value is 0, any higher values may cause dynamic applications -# to be erroneously cached unless the application designer -# has taken the appropriate actions. -# -# 'Percent' is a percentage of the objects age (time since last -# modification age) an object without explicit expiry time -# will be considered fresh. -# -# 'Max' is an upper limit on how long objects without an explicit -# expiry time will be considered fresh. -# -# options: override-expire -# override-lastmod -# reload-into-ims -# ignore-reload -# ignore-no-cache -# ignore-private -# ignore-auth -# -# override-expire enforces min age even if the server -# sent a Expires: header. Doing this VIOLATES the HTTP -# standard. Enabling this feature could make you liable -# for problems which it causes. -# -# override-lastmod enforces min age even on objects -# that were modified recently. -# -# reload-into-ims changes client no-cache or ``reload'' -# to If-Modified-Since requests. Doing this VIOLATES the -# HTTP standard. Enabling this feature could make you -# liable for problems which it causes. -# -# ignore-reload ignores a client no-cache or ``reload'' -# header. Doing this VIOLATES the HTTP standard. Enabling -# this feature could make you liable for problems which -# it causes. -# -# ignore-no-cache ignores any ``Pragma: no-cache'' and -# ``Cache-control: no-cache'' headers received from a server. -# The HTTP RFC never allows the use of this (Pragma) header -# from a server, only a client, though plenty of servers -# send it anyway. -# -# ignore-private ignores any ``Cache-control: private'' -# headers received from a server. Doing this VIOLATES -# the HTTP standard. Enabling this feature could make you -# liable for problems which it causes. -# -# ignore-auth caches responses to requests with authorization, -# irrespective of ``Cache-control'' headers received from -# a server. Doing this VIOLATES the HTTP standard. Enabling -# this feature could make you liable for problems which -# it causes. -# -# Basically a cached object is: -# -# FRESH if expires < now, else STALE -# STALE if age > max -# FRESH if lm-factor < percent, else STALE -# FRESH if age < min -# else STALE -# -# The refresh_pattern lines are checked in the order listed here. -# The first entry which matches is used. If none of the entries -# match the default will be used. -# -# Note, you must uncomment all the default lines if you want -# to change one. The default setting is only active if none is -# used. -# -#Suggested default: -refresh_pattern ^ftp: 1440 20% 10080 -refresh_pattern ^gopher: 1440 0% 1440 -refresh_pattern . 0 20% 4320 - -# TAG: quick_abort_min (KB) -# TAG: quick_abort_max (KB) -# TAG: quick_abort_pct (percent) -# The cache by default continues downloading aborted requests -# which are almost completed (less than 16 KB remaining). This -# may be undesirable on slow (e.g. SLIP) links and/or very busy -# caches. Impatient users may tie up file descriptors and -# bandwidth by repeatedly requesting and immediately aborting -# downloads. -# -# When the user aborts a request, Squid will check the -# quick_abort values to the amount of data transfered until -# then. -# -# If the transfer has less than 'quick_abort_min' KB remaining, -# it will finish the retrieval. -# -# If the transfer has more than 'quick_abort_max' KB remaining, -# it will abort the retrieval. -# -# If more than 'quick_abort_pct' of the transfer has completed, -# it will finish the retrieval. -# -# If you do not want any retrieval to continue after the client -# has aborted, set both 'quick_abort_min' and 'quick_abort_max' -# to '0 KB'. -# -# If you want retrievals to always continue if they are being -# cached set 'quick_abort_min' to '-1 KB'. -# -#Default: -# quick_abort_min 16 KB -# quick_abort_max 16 KB -# quick_abort_pct 95 - -# TAG: read_ahead_gap buffer-size -# The amount of data the cache will buffer ahead of what has been -# sent to the client when retrieving an object from another server. -# -#Default: -# read_ahead_gap 16 KB - -# TAG: negative_ttl time-units -# Time-to-Live (TTL) for failed requests. Certain types of -# failures (such as "connection refused" and "404 Not Found") are -# negatively-cached for a configurable amount of time. The -# default is 5 minutes. Note that this is different from -# negative caching of DNS lookups. -# -#Default: -# negative_ttl 5 minutes - -# TAG: positive_dns_ttl time-units -# Upper limit on how long Squid will cache positive DNS responses. -# Default is 6 hours (360 minutes). This directive must be set -# larger than negative_dns_ttl. -# -#Default: -# positive_dns_ttl 6 hours - -# TAG: negative_dns_ttl time-units -# Time-to-Live (TTL) for negative caching of failed DNS lookups. -# This also makes sets the lower cache limit on positive lookups. -# Minimum value is 1 second, and it is not recommendable to go -# much below 10 seconds. -# -#Default: -# negative_dns_ttl 1 minute - -# TAG: range_offset_limit (bytes) -# Sets a upper limit on how far into the the file a Range request -# may be to cause Squid to prefetch the whole file. If beyond this -# limit Squid forwards the Range request as it is and the result -# is NOT cached. -# -# This is to stop a far ahead range request (lets say start at 17MB) -# from making Squid fetch the whole object up to that point before -# sending anything to the client. -# -# A value of -1 causes Squid to always fetch the object from the -# beginning so it may cache the result. (2.0 style) -# -# A value of 0 causes Squid to never fetch more than the -# client requested. (default) -# -#Default: -# range_offset_limit 0 KB - -# TAG: collapsed_forwarding (on|off) -# This option enables multiple requests for the same URI to be -# processed as one request. Normally disabled to avoid increased -# latency on dynamic content, but there can be benefit from enabling -# this in accelerator setups where the web servers are the bottleneck -# and reliable and returns mostly cacheable information. -# -#Default: -# collapsed_forwarding off - -# TAG: refresh_stale_hit (time) -# This option changes the refresh algorithm to allow concurrent -# requests while an object is being refreshed to be processed as -# cache hits if the object expired less than X seconds ago. Default -# is 0 to disable this feature. This option is mostly interesting -# in accelerator setups where a few objects is accessed very -# frequently. -# -#Default: -# refresh_stale_hit 0 seconds - - -# TIMEOUTS -# ----------------------------------------------------------------------------- - -# TAG: forward_timeout time-units -# This parameter specifies how long Squid should at most attempt in -# finding a forwarding path for the request before giving up. -# -#Default: -# forward_timeout 4 minutes - -# TAG: connect_timeout time-units -# This parameter specifies how long to wait for the TCP connect to -# the requested server or peer to complete before Squid should -# attempt to find another path where to forward the request. -# -#Default: -# connect_timeout 1 minute - -# TAG: peer_connect_timeout time-units -# This parameter specifies how long to wait for a pending TCP -# connection to a peer cache. The default is 30 seconds. You -# may also set different timeout values for individual neighbors -# with the 'connect-timeout' option on a 'cache_peer' line. -# -#Default: -# peer_connect_timeout 30 seconds - -# TAG: read_timeout time-units -# The read_timeout is applied on server-side connections. After -# each successful read(), the timeout will be extended by this -# amount. If no data is read again after this amount of time, -# the request is aborted and logged with ERR_READ_TIMEOUT. The -# default is 15 minutes. -# -#Default: -# read_timeout 15 minutes - -# TAG: request_timeout -# How long to wait for an HTTP request after initial -# connection establishment. -# -#Default: -# request_timeout 5 minutes - -# TAG: persistent_request_timeout -# How long to wait for the next HTTP request on a persistent -# connection after the previous request completes. -# -#Default: -# persistent_request_timeout 1 minute - -# TAG: client_lifetime time-units -# The maximum amount of time a client (browser) is allowed to -# remain connected to the cache process. This protects the Cache -# from having a lot of sockets (and hence file descriptors) tied up -# in a CLOSE_WAIT state from remote clients that go away without -# properly shutting down (either because of a network failure or -# because of a poor client implementation). The default is one -# day, 1440 minutes. -# -# NOTE: The default value is intended to be much larger than any -# client would ever need to be connected to your cache. You -# should probably change client_lifetime only as a last resort. -# If you seem to have many client connections tying up -# filedescriptors, we recommend first tuning the read_timeout, -# request_timeout, persistent_request_timeout and quick_abort values. -# -#Default: -# client_lifetime 1 day - -# TAG: half_closed_clients -# Some clients may shutdown the sending side of their TCP -# connections, while leaving their receiving sides open. Sometimes, -# Squid can not tell the difference between a half-closed and a -# fully-closed TCP connection. By default, half-closed client -# connections are kept open until a read(2) or write(2) on the -# socket returns an error. Change this option to 'off' and Squid -# will immediately close client connections when read(2) returns -# "no more data to read." -# -#Default: -# half_closed_clients on - -# TAG: pconn_timeout -# Timeout for idle persistent connections to servers and other -# proxies. -# -#Default: -# pconn_timeout 120 seconds - -# TAG: ident_timeout -# Maximum time to wait for IDENT lookups to complete. -# -# If this is too high, and you enabled IDENT lookups from untrusted -# users, you might be susceptible to denial-of-service by having -# many ident requests going at once. -# -#Default: -# ident_timeout 10 seconds - -# TAG: shutdown_lifetime time-units -# When SIGTERM or SIGHUP is received, the cache is put into -# "shutdown pending" mode until all active sockets are closed. -# This value is the lifetime to set for all open descriptors -# during shutdown mode. Any active clients after this many -# seconds will receive a 'timeout' message. -# -#Default: -# shutdown_lifetime 30 seconds - - -# ACCESS CONTROLS -# ----------------------------------------------------------------------------- - -# TAG: acl -# Defining an Access List -# -# acl aclname acltype string1 ... -# acl aclname acltype "file" ... -# -# when using "file", the file should contain one item per line -# -# acltype is one of the types described below -# -# By default, regular expressions are CASE-SENSITIVE. To make -# them case-insensitive, use the -i option. -# -# acl aclname src ip-address/netmask ... (clients IP address) -# acl aclname src addr1-addr2/netmask ... (range of addresses) -# acl aclname dst ip-address/netmask ... (URL host's IP address) -# acl aclname myip ip-address/netmask ... (local socket IP address) -# -# acl aclname arp mac-address ... (xx:xx:xx:xx:xx:xx notation) -# # The arp ACL requires the special configure option --enable-arp-acl. -# # Furthermore, the arp ACL code is not portable to all operating systems. -# # It works on Linux, Solaris, FreeBSD and some other *BSD variants. -# # -# # NOTE: Squid can only determine the MAC address for clients that are on -# # the same subnet. If the client is on a different subnet, then Squid cannot -# # find out its MAC address. -# -# acl aclname srcdomain .foo.com ... # reverse lookup, client IP -# acl aclname dstdomain .foo.com ... # Destination server from URL -# acl aclname srcdom_regex [-i] xxx ... # regex matching client name -# acl aclname dstdom_regex [-i] xxx ... # regex matching server -# # For dstdomain and dstdom_regex a reverse lookup is tried if a IP -# # based URL is used and no match is found. The name "none" is used -# # if the reverse lookup fails. -# -# acl aclname time [day-abbrevs] [h1:m1-h2:m2] -# day-abbrevs: -# S - Sunday -# M - Monday -# T - Tuesday -# W - Wednesday -# H - Thursday -# F - Friday -# A - Saturday -# h1:m1 must be less than h2:m2 -# acl aclname url_regex [-i] ^http:// ... # regex matching on whole URL -# acl aclname urlpath_regex [-i] \.gif$ ... # regex matching on URL path -# acl aclname urllogin [-i] [^a-zA-Z0-9] ... # regex matching on URL login field -# acl aclname port 80 70 21 ... -# acl aclname port 0-1024 ... # ranges allowed -# acl aclname myport 3128 ... # (local socket TCP port) -# acl aclname proto HTTP FTP ... -# acl aclname method GET POST ... -# acl aclname browser [-i] regexp ... -# # pattern match on User-Agent header (see also req_header below) -# acl aclname referer_regex [-i] regexp ... -# # pattern match on Referer header -# # Referer is highly unreliable, so use with care -# acl aclname ident username ... -# acl aclname ident_regex [-i] pattern ... -# # string match on ident output. -# # use REQUIRED to accept any non-null ident. -# acl aclname src_as number ... -# acl aclname dst_as number ... -# # Except for access control, AS numbers can be used for -# # routing of requests to specific caches. Here's an -# # example for routing all requests for AS#1241 and only -# # those to mycache.mydomain.net: -# # acl asexample dst_as 1241 -# # cache_peer_access mycache.mydomain.net allow asexample -# # cache_peer_access mycache_mydomain.net deny all -# -# acl aclname proxy_auth [-i] username ... -# acl aclname proxy_auth_regex [-i] pattern ... -# # list of valid usernames -# # use REQUIRED to accept any valid username. -# # -# # NOTE: when a Proxy-Authentication header is sent but it is not -# # needed during ACL checking the username is NOT logged -# # in access.log. -# # -# # NOTE: proxy_auth requires a EXTERNAL authentication program -# # to check username/password combinations (see -# # auth_param directive). -# # -# # WARNING: proxy_auth can't be used in a transparent proxy. It -# # collides with any authentication done by origin servers. It may -# # seem like it works at first, but it doesn't. -# -# acl aclname snmp_community string ... -# # A community string to limit access to your SNMP Agent -# # Example: -# # -# # acl snmppublic snmp_community public -# -# acl aclname maxconn number -# # This will be matched when the client's IP address has -# # more than HTTP connections established. -# -# acl aclname max_user_ip [-s] number -# # This will be matched when the user attempts to log in from more -# # than different ip addresses. The authenticate_ip_ttl -# # parameter controls the timeout on the ip entries. -# # If -s is specified the limit is strict, denying browsing -# # from any further IP addresses until the ttl has expired. Without -# # -s Squid will just annoy the user by "randomly" denying requests. -# # (the counter is reset each time the limit is reached and a -# # request is denied) -# # NOTE: in acceleration mode or where there is mesh of child proxies, -# # clients may appear to come from multiple addresses if they are -# # going through proxy farms, so a limit of 1 may cause user problems. -# -# acl aclname req_mime_type mime-type1 ... -# # regex match against the mime type of the request generated -# # by the client. Can be used to detect file upload or some -# # types HTTP tunneling requests. -# # NOTE: This does NOT match the reply. You cannot use this -# # to match the returned file type. -# -# acl aclname req_header header-name [-i] any\.regex\.here -# # regex match against any of the known request headers. May be -# # thought of as a superset of "browser", "referer" and "mime-type" -# # ACLs. -# -# acl aclname rep_mime_type mime-type1 ... -# # regex match against the mime type of the reply received by -# # squid. Can be used to detect file download or some -# # types HTTP tunneling requests. -# # NOTE: This has no effect in http_access rules. It only has -# # effect in rules that affect the reply data stream such as -# # http_reply_access. -# -# acl aclname rep_header header-name [-i] any\.regex\.here -# # regex match against any of the known response headers. -# # Example: -# # -# # acl many_spaces rep_header Content-Disposition -i [[:space:]]{3,} -# -# acl acl_name external class_name [arguments...] -# # external ACL lookup via a helper class defined by the -# # external_acl_type directive. -# -# acl urlgroup group1 ... -# # match against the urlgroup as indicated by redirectors -# -# acl aclname user_cert attribute values... -# # match against attributes in a user SSL certificate -# # attribute is one of DN/C/O/CN/L/ST -# -# acl aclname ca_cert attribute values... -# # match against attributes a users issuing CA SSL certificate -# # attribute is one of DN/C/O/CN/L/ST -# -# acl aclname ext_user username ... -# acl aclname ext_user_regex [-i] pattern ... -# # string match on username returned by external acl -# # use REQUIRED to accept any user name. -#Examples: -#acl macaddress arp 09:00:2b:23:45:67 -#acl myexample dst_as 1241 -#acl password proxy_auth REQUIRED -#acl fileupload req_mime_type -i ^multipart/form-data$ -#acl javascript rep_mime_type -i ^application/x-javascript$ -# -#Recommended minimum configuration: -acl all src 0.0.0.0/0.0.0.0 -acl manager proto cache_object -acl localhost src 127.0.0.1/255.255.255.255 -acl to_localhost dst 127.0.0.0/8 -acl SSL_ports port 443 -acl Safe_ports port 80 # http -acl Safe_ports port 21 # ftp -acl Safe_ports port 443 # https -acl Safe_ports port 70 # gopher -acl Safe_ports port 210 # wais -acl Safe_ports port 1025-65535 # unregistered ports -acl Safe_ports port 280 # http-mgmt -acl Safe_ports port 488 # gss-http -acl Safe_ports port 591 # filemaker -acl Safe_ports port 777 # multiling http -acl CONNECT method CONNECT - -# TAG: follow_x_forwarded_for -# Allowing or Denying the X-Forwarded-For header to be followed to -# find the original source of a request. -# -# Requests may pass through a chain of several other proxies -# before reaching us. The X-Forwarded-For header will contain a -# comma-separated list of the IP addresses in the chain, with the -# rightmost address being the most recent. -# -# If a request reaches us from a source that is allowed by this -# configuration item, then we consult the X-Forwarded-For header -# to see where that host received the request from. If the -# X-Forwarded-For header contains multiple addresses, and if -# acl_uses_indirect_client is on, then we continue backtracking -# until we reach an address for which we are not allowed to -# follow the X-Forwarded-For header, or until we reach the first -# address in the list. (If acl_uses_indirect_client is off, then -# it's impossible to backtrack through more than one level of -# X-Forwarded-For addresses.) -# -# The end result of this process is an IP address that we will -# refer to as the indirect client address. This address may -# be treated as the client address for access control, delay -# pools and logging, depending on the acl_uses_indirect_client, -# delay_pool_uses_indirect_client and log_uses_indirect_client -# options. -# -# SECURITY CONSIDERATIONS: -# -# Any host for which we follow the X-Forwarded-For header -# can place incorrect information in the header, and Squid -# will use the incorrect information as if it were the -# source address of the request. This may enable remote -# hosts to bypass any access control restrictions that are -# based on the client's source addresses. -# -# For example: -# -# acl localhost src 127.0.0.1 -# acl my_other_proxy srcdomain .proxy.example.com -# follow_x_forwarded_for allow localhost -# follow_x_forwarded_for allow my_other_proxy -# -#Default: -# follow_x_forwarded_for deny all - -# TAG: acl_uses_indirect_client on|off -# Controls whether the indirect client address -# (see follow_x_forwarded_for) is used instead of the -# direct client address in acl matching. -# -#Default: -# acl_uses_indirect_client on - -# TAG: delay_pool_uses_indirect_client on|off -# Controls whether the indirect client address -# (see follow_x_forwarded_for) is used instead of the -# direct client address in delay pools. -# -#Default: -# delay_pool_uses_indirect_client on - -# TAG: log_uses_indirect_client on|off -# Controls whether the indirect client address -# (see follow_x_forwarded_for) is used instead of the -# direct client address in the access log. -# -#Default: -# log_uses_indirect_client on - -# TAG: http_access -# Allowing or Denying access based on defined access lists -# -# Access to the HTTP port: -# http_access allow|deny [!]aclname ... -# -# NOTE on default values: -# -# If there are no "access" lines present, the default is to deny -# the request. -# -# If none of the "access" lines cause a match, the default is the -# opposite of the last line in the list. If the last line was -# deny, the default is allow. Conversely, if the last line -# is allow, the default will be deny. For these reasons, it is a -# good idea to have an "deny all" or "allow all" entry at the end -# of your access lists to avoid potential confusion. -# -#Default: -# http_access deny all -# -#Recommended minimum configuration: -# -# Only allow cachemgr access from localhost -http_access allow manager localhost -http_access deny manager -# Deny requests to unknown ports -http_access deny !Safe_ports -# Deny CONNECT to other than SSL ports -http_access deny CONNECT !SSL_ports -# -# We strongly recommend the following be uncommented to protect innocent -# web applications running on the proxy server who think the only -# one who can access services on "localhost" is a local user -#http_access deny to_localhost -# -# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS -http_access allow all - -# Example rule allowing access from your local networks. Adapt -# to list your (internal) IP networks from where browsing should -# be allowed -#acl our_networks src 192.168.1.0/24 192.168.2.0/24 -#http_access allow our_networks - -# And finally deny all other access to this proxy -http_access allow localhost -http_access deny all - -# TAG: http_access2 -# Allowing or Denying access based on defined access lists -# -# Identical to http_access, but runs after redirectors. If not set -# then only http_access is used. -# -#Default: -# none - -# TAG: http_reply_access -# Allow replies to client requests. This is complementary to http_access. -# -# http_reply_access allow|deny [!] aclname ... -# -# NOTE: if there are no access lines present, the default is to allow -# all replies -# -# If none of the access lines cause a match the opposite of the -# last line will apply. Thus it is good practice to end the rules -# with an "allow all" or "deny all" entry. -# -#Default: -# http_reply_access allow all -# -#Recommended minimum configuration: -# -# Insert your own rules here. -# -# -# and finally allow by default -http_reply_access allow all - -# TAG: icp_access -# Allowing or Denying access to the ICP port based on defined -# access lists -# -# icp_access allow|deny [!]aclname ... -# -# See http_access for details -# -#Default: -# icp_access deny all -# -#Allow ICP queries from everyone -icp_access allow all - -# TAG: htcp_access -# Note: This option is only available if Squid is rebuilt with the -# --enable-htcp option -# -# Allowing or Denying access to the HTCP port based on defined -# access lists -# -# htcp_access allow|deny [!]aclname ... -# -# See http_access for details -# -##Allow HTCP queries from everyone -#htcp_access allow all -# -#Default: -# htcp_access deny all - -# TAG: htcp_clr_access -# Note: This option is only available if Squid is rebuilt with the -# --enable-htcp option -# -# Allowing or Denying access to purge content using HTCP based -# on defined access lists -# -# htcp_clr_access allow|deny [!]aclname ... -# -# See http_access for details -# -##Allow HTCP CLR requests from trusted peers -#acl htcp_clr_peer src 172.16.1.2 -#htcp_clr_access allow htcp_clr_peer -# -#Default: -# htcp_clr_access deny all - -# TAG: miss_access -# Use to force your neighbors to use you as a sibling instead of -# a parent. For example: -# -# acl localclients src 172.16.0.0/16 -# miss_access allow localclients -# miss_access deny !localclients -# -# This means only your local clients are allowed to fetch -# MISSES and all other clients can only fetch HITS. -# -# By default, allow all clients who passed the http_access rules -# to fetch MISSES from us. -# -#Default setting: -# miss_access allow all - -# TAG: cache_peer_access -# Similar to 'cache_peer_domain' but provides more flexibility by -# using ACL elements. -# -# cache_peer_access cache-host allow|deny [!]aclname ... -# -# The syntax is identical to 'http_access' and the other lists of -# ACL elements. See the comments for 'http_access' below, or -# the Squid FAQ (http://www.squid-cache.org/FAQ/FAQ-10.html). -# -#Default: -# none - -# TAG: ident_lookup_access -# A list of ACL elements which, if matched, cause an ident -# (RFC931) lookup to be performed for this request. For -# example, you might choose to always perform ident lookups -# for your main multi-user Unix boxes, but not for your Macs -# and PCs. By default, ident lookups are not performed for -# any requests. -# -# To enable ident lookups for specific client addresses, you -# can follow this example: -# -# acl ident_aware_hosts src 198.168.1.0/255.255.255.0 -# ident_lookup_access allow ident_aware_hosts -# ident_lookup_access deny all -# -# Only src type ACL checks are fully supported. A src_domain -# ACL might work at times, but it will not always provide -# the correct result. -# -#Default: -# ident_lookup_access deny all - -# TAG: tcp_outgoing_tos -# Allows you to select a TOS/Diffserv value to mark outgoing -# connections with, based on the username or source address -# making the request. -# -# tcp_outgoing_tos ds-field [!]aclname ... -# -# Example where normal_service_net uses the TOS value 0x00 -# and normal_service_net uses 0x20 -# -# acl normal_service_net src 10.0.0.0/255.255.255.0 -# acl good_service_net src 10.0.1.0/255.255.255.0 -# tcp_outgoing_tos 0x00 normal_service_net 0x00 -# tcp_outgoing_tos 0x20 good_service_net -# -# TOS/DSCP values really only have local significance - so you should -# know what you're specifying. For more information, see RFC2474 and -# RFC3260. -# -# The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or -# "default" to use whatever default your host has. Note that in -# practice often only values 0 - 63 is usable as the two highest bits -# have been redefined for use by ECN (RFC3168). -# -# Processing proceeds in the order specified, and stops at first fully -# matching line. -# -# Note: The use of this directive using client dependent ACLs is -# incompatible with the use of server side persistent connections. To -# ensure correct results it is best to set server_persisten_connections -# to off when using this directive in such configurations. -# -#Default: -# none - -# TAG: tcp_outgoing_address -# Allows you to map requests to different outgoing IP addresses -# based on the username or source address of the user making -# the request. -# -# tcp_outgoing_address ipaddr [[!]aclname] ... -# -# Example where requests from 10.0.0.0/24 will be forwarded -# with source address 10.1.0.1, 10.0.2.0/24 forwarded with -# source address 10.1.0.2 and the rest will be forwarded with -# source address 10.1.0.3. -# -# acl normal_service_net src 10.0.0.0/255.255.255.0 -# acl good_service_net src 10.0.1.0/255.255.255.0 -# tcp_outgoing_address 10.0.0.1 normal_service_net -# tcp_outgoing_address 10.0.0.2 good_service_net -# tcp_outgoing_address 10.0.0.3 -# -# Processing proceeds in the order specified, and stops at first fully -# matching line. -# -# Note: The use of this directive using client dependent ACLs is -# incompatible with the use of server side persistent connections. To -# ensure correct results it is best to set server_persistent_connections -# to off when using this directive in such configurations. -# -#Default: -# none - -# TAG: reply_header_max_size (KB) -# This specifies the maximum size for HTTP headers in a reply. -# Reply headers are usually relatively small (about 512 bytes). -# Placing a limit on the reply header size will catch certain -# bugs (for example with persistent connections) and possibly -# buffer-overflow or denial-of-service attacks. -# -#Default: -# reply_header_max_size 20 KB - -# TAG: reply_body_max_size bytes allow|deny acl acl... -# This option specifies the maximum size of a reply body in bytes. -# It can be used to prevent users from downloading very large files, -# such as MP3's and movies. When the reply headers are received, -# the reply_body_max_size lines are processed, and the first line with -# a result of "allow" is used as the maximum body size for this reply. -# This size is checked twice. First when we get the reply headers, -# we check the content-length value. If the content length value exists -# and is larger than the allowed size, the request is denied and the -# user receives an error message that says "the request or reply -# is too large." If there is no content-length, and the reply -# size exceeds this limit, the client's connection is just closed -# and they will receive a partial reply. -# -# WARNING: downstream caches probably can not detect a partial reply -# if there is no content-length header, so they will cache -# partial responses and give them out as hits. You should NOT -# use this option if you have downstream caches. -# -# If you set this parameter to zero (the default), there will be -# no limit imposed. -# -#Default: -# reply_body_max_size 0 allow all - -# TAG: log_access allow|deny acl acl... -# This options allows you to control which requests gets logged -# to access.log (see access_log directive). Requests denied for -# logging will also not be accounted for in performance counters. -# -#Default: -# none - - -# ADMINISTRATIVE PARAMETERS -# ----------------------------------------------------------------------------- - -# TAG: cache_mgr -# Email-address of local cache manager who will receive -# mail if the cache dies. The default is "root". -# -#Default: -# cache_mgr root - -# TAG: mail_from -# From: email-address for mail sent when the cache dies. -# The default is to use 'appname@unique_hostname'. -# Default appname value is "squid", can be changed into -# src/globals.h before building squid. -# -#Default: -# none - -# TAG: mail_program -# Email program used to send mail if the cache dies. -# The default is "mail". The specified program must complain -# with the standard Unix mail syntax: -# mail_program recipient < mailfile -# Optional command line options can be specified. -# -#Default: -# mail_program mail - -# TAG: cache_effective_user -# If you start Squid as root, it will change its effective/real -# UID/GID to the user specified below. The default is to change -# to UID to "squid". If you define cache_effective_user, but not -# cache_effective_group, Squid sets the GID to the effective -# user's default group ID (taken from the password file) and -# supplementary group list from the from groups membership of -# cache_effective_user. -#cache_effective_user squid -# -#Default: -# cache_effective_user squid - -# TAG: cache_effective_group -# If you want Squid to run with a specific GID regardless of -# the group memberships of the effective user then set this -# to the group (or GID) you want Squid to run as. When set -# all other group privileges of the effective user is ignored -# and only this GID is effective. If Squid is not started as -# root the user starting Squid must be member of the specified -# group. -#cache_effective_group squid -# -#Default: -# cache_effective_group squid - -# TAG: httpd_suppress_version_string on|off -# Suppress Squid version string info in HTTP headers and HTML error pages. -# -#Default: -# httpd_suppress_version_string off - -# TAG: visible_hostname -# If you want to present a special hostname in error messages, etc, -# define this. Otherwise, the return value of gethostname() -# will be used. If you have multiple caches in a cluster and -# get errors about IP-forwarding you must set them to have individual -# names with this setting. -# -#Default: -# none - -# TAG: unique_hostname -# If you want to have multiple machines with the same -# 'visible_hostname' you must give each machine a different -# 'unique_hostname' so forwarding loops can be detected. -# -#Default: -# none - -# TAG: hostname_aliases -# A list of other DNS names your cache has. -# -#Default: -# none - -# TAG: umask -# Minimum umask which should be enforced while the proxy -# is running, in addition to the umask set at startup. -# -# Note: Should start with a 0 to indicate the normal octal -# representation of umasks -# -#Default: -# umask 027 - - -# OPTIONS FOR THE CACHE REGISTRATION SERVICE -# ----------------------------------------------------------------------------- -# -# This section contains parameters for the (optional) cache -# announcement service. This service is provided to help -# cache administrators locate one another in order to join or -# create cache hierarchies. -# -# An 'announcement' message is sent (via UDP) to the registration -# service by Squid. By default, the announcement message is NOT -# SENT unless you enable it with 'announce_period' below. -# -# The announcement message includes your hostname, plus the -# following information from this configuration file: -# -# http_port -# icp_port -# cache_mgr -# -# All current information is processed regularly and made -# available on the Web at http://www.ircache.net/Cache/Tracker/. - -# TAG: announce_period -# This is how frequently to send cache announcements. The -# default is `0' which disables sending the announcement -# messages. -# -# To enable announcing your cache, just uncomment the line -# below. -# -#Default: -# announce_period 0 -# -#To enable announcing your cache, just uncomment the line below. -#announce_period 1 day - -# TAG: announce_host -# TAG: announce_file -# TAG: announce_port -# announce_host and announce_port set the hostname and port -# number where the registration message will be sent. -# -# Hostname will default to 'tracker.ircache.net' and port will -# default default to 3131. If the 'filename' argument is given, -# the contents of that file will be included in the announce -# message. -# -#Default: -# announce_host tracker.ircache.net -# announce_port 3131 - - -# HTTPD-ACCELERATOR OPTIONS -# ----------------------------------------------------------------------------- - -# TAG: httpd_accel_no_pmtu_disc on|off -# In many setups of transparently intercepting proxies Path-MTU -# discovery can not work on traffic towards the clients. This is -# the case when the intercepting device does not fully track -# connections and fails to forward ICMP must fragment messages -# to the cache server. -# -# If you have such setup and experience that certain clients -# sporadically hang or never complete requests set this to on. -# -#Default: -# httpd_accel_no_pmtu_disc off - - -# MISCELLANEOUS -# ----------------------------------------------------------------------------- - -# TAG: dns_testnames -# The DNS tests exit as soon as the first site is successfully looked up -# -# This test can be disabled with the -D command line option. -# -#Default: -# dns_testnames netscape.com internic.net nlanr.net microsoft.com - -# TAG: logfile_rotate -# Specifies the number of logfile rotations to make when you -# type 'squid -k rotate'. The default is 10, which will rotate -# with extensions 0 through 9. Setting logfile_rotate to 0 will -# disable the rotation, but the logfiles are still closed and -# re-opened. This will enable you to rename the logfiles -# yourself just before sending the rotate signal. -# -# Note, the 'squid -k rotate' command normally sends a USR1 -# signal to the running squid process. In certain situations -# (e.g. on Linux with Async I/O), USR1 is used for other -# purposes, so -k rotate uses another signal. It is best to get -# in the habit of using 'squid -k rotate' instead of 'kill -USR1 -# '. -# -#logfile_rotate 0 -# -#Default: -# logfile_rotate 0 - -# TAG: append_domain -# Appends local domain name to hostnames without any dots in -# them. append_domain must begin with a period. -# -# Be warned there are now Internet names with no dots in -# them using only top-domain names, so setting this may -# cause some Internet sites to become unavailable. -# -#Example: -# append_domain .yourdomain.com -# -#Default: -# none - -# TAG: tcp_recv_bufsize (bytes) -# Size of receive buffer to set for TCP sockets. Probably just -# as easy to change your kernel's default. Set to zero to use -# the default buffer size. -# -#Default: -# tcp_recv_bufsize 0 bytes - -# TAG: error_map -# Map errors to custom messages -# -# error_map message_url http_status ... -# -# http_status ... is a list of HTTP status codes or Squid error -# messages. -# -# Use in accelerators to substitute the error messages returned -# by servers with other custom errors. -# -# error_map http://your.server/error/404.shtml 404 -# -# Requests for error messages is a GET request for the configured -# URL with the following special headers -# -# X-Error-Status: The received HTTP status code (i.e. 404) -# X-Request-URI: The requested URI where the error occurred -# -# In Addition the following headers are forwarded from the client -# request: -# -# User-Agent, Cookie, X-Forwarded-For, Via, Authorization, -# Accept, Referer -# -# And the following headers from the server reply: -# -# Server, Via, Location, Content-Location -# -# The reply returned to the client will carry the original HTTP -# headers from the real error message, but with the reply body -# of the configured error message. -# -# -#Default: -# none - -# TAG: err_html_text -# HTML text to include in error messages. Make this a "mailto" -# URL to your admin address, or maybe just a link to your -# organizations Web page. -# -# To include this in your error messages, you must rewrite -# the error template files (found in the "errors" directory). -# Wherever you want the 'err_html_text' line to appear, -# insert a %L tag in the error template file. -# -#Default: -# none - -# TAG: deny_info -# Usage: deny_info err_page_name acl -# or deny_info http://... acl -# Example: deny_info ERR_CUSTOM_ACCESS_DENIED bad_guys -# -# This can be used to return a ERR_ page for requests which -# do not pass the 'http_access' rules. A single ACL will cause -# the http_access check to fail. If a 'deny_info' line exists -# for that ACL Squid returns a corresponding error page. -# -# You may use ERR_ pages that come with Squid or create your own pages -# and put them into the configured errors/ directory. -# -# Alternatively you can specify an error URL. The browsers will -# get redirected (302) to the specified URL. %s in the redirection -# URL will be replaced by the requested URL. -# -# Alternatively you can tell Squid to reset the TCP connection -# by specifying TCP_RESET. -# -#Default: -# none - -# TAG: memory_pools on|off -# If set, Squid will keep pools of allocated (but unused) memory -# available for future use. If memory is a premium on your -# system and you believe your malloc library outperforms Squid -# routines, disable this. -# -#Default: -# memory_pools on - -# TAG: memory_pools_limit (bytes) -# Used only with memory_pools on: -# memory_pools_limit 50 MB -# -# If set to a non-zero value, Squid will keep at most the specified -# limit of allocated (but unused) memory in memory pools. All free() -# requests that exceed this limit will be handled by your malloc -# library. Squid does not pre-allocate any memory, just safe-keeps -# objects that otherwise would be free()d. Thus, it is safe to set -# memory_pools_limit to a reasonably high value even if your -# configuration will use less memory. -# -# If set to zero, Squid will keep all memory it can. That is, there -# will be no limit on the total amount of memory used for safe-keeping. -# -# To disable memory allocation optimization, do not set -# memory_pools_limit to 0. Set memory_pools to "off" instead. -# -# An overhead for maintaining memory pools is not taken into account -# when the limit is checked. This overhead is close to four bytes per -# object kept. However, pools may actually _save_ memory because of -# reduced memory thrashing in your malloc library. -# -#Default: -# memory_pools_limit 5 MB - -# TAG: via on|off -# If set (default), Squid will include a Via header in requests and -# replies. -# -#Default: -# via on - -# TAG: forwarded_for on|off -# If set, Squid will include your system's IP address or name -# in the HTTP requests it forwards. By default it looks like -# this: -# -# X-Forwarded-For: 192.1.2.3 -# -# If you disable this, it will appear as -# -# X-Forwarded-For: unknown -# -#Default: -# forwarded_for on - -# TAG: log_icp_queries on|off -# If set, ICP queries are logged to access.log. You may wish -# do disable this if your ICP load is VERY high to speed things -# up or to simplify log analysis. -# -#Default: -# log_icp_queries on - -# TAG: icp_hit_stale on|off -# If you want to return ICP_HIT for stale cache objects, set this -# option to 'on'. If you have sibling relationships with caches -# in other administrative domains, this should be 'off'. If you only -# have sibling relationships with caches under your control, -# it is probably okay to set this to 'on'. -# If set to 'on', your siblings should use the option "allow-miss" -# on their cache_peer lines for connecting to you. -# -#Default: -# icp_hit_stale off - -# TAG: minimum_direct_hops -# If using the ICMP pinging stuff, do direct fetches for sites -# which are no more than this many hops away. -# -#Default: -# minimum_direct_hops 4 - -# TAG: minimum_direct_rtt -# If using the ICMP pinging stuff, do direct fetches for sites -# which are no more than this many rtt milliseconds away. -# -#Default: -# minimum_direct_rtt 400 - -# TAG: cachemgr_passwd -# Specify passwords for cachemgr operations. -# -# Usage: cachemgr_passwd password action action ... -# -# Some valid actions are (see cache manager menu for a full list): -# 5min -# 60min -# asndb -# authenticator -# cbdata -# client_list -# comm_incoming -# config * -# counters -# delay -# digest_stats -# dns -# events -# filedescriptors -# fqdncache -# histograms -# http_headers -# info -# io -# ipcache -# mem -# menu -# netdb -# non_peers -# objects -# offline_toggle * -# pconn -# peer_select -# redirector -# refresh -# server_list -# shutdown * -# store_digest -# storedir -# utilization -# via_headers -# vm_objects -# -# * Indicates actions which will not be performed without a -# valid password, others can be performed if not listed here. -# -# To disable an action, set the password to "disable". -# To allow performing an action without a password, set the -# password to "none". -# -# Use the keyword "all" to set the same password for all actions. -# -#Example: -# cachemgr_passwd secret shutdown -# cachemgr_passwd lesssssssecret info stats/objects -# cachemgr_passwd disable all -# -#Default: -# none - -# TAG: store_avg_object_size (kbytes) -# Average object size, used to estimate number of objects your -# cache can hold. The default is 13 KB. -# -#Default: -# store_avg_object_size 13 KB - -# TAG: store_objects_per_bucket -# Target number of objects per bucket in the store hash table. -# Lowering this value increases the total number of buckets and -# also the storage maintenance rate. The default is 50. -# -#Default: -# store_objects_per_bucket 20 - -# TAG: client_db on|off -# If you want to disable collecting per-client statistics, -# turn off client_db here. -# -#Default: -# client_db on - -# TAG: netdb_low -# TAG: netdb_high -# The low and high water marks for the ICMP measurement -# database. These are counts, not percents. The defaults are -# 900 and 1000. When the high water mark is reached, database -# entries will be deleted until the low mark is reached. -# -#Default: -# netdb_low 900 -# netdb_high 1000 - -# TAG: netdb_ping_period -# The minimum period for measuring a site. There will be at -# least this much delay between successive pings to the same -# network. The default is five minutes. -# -#Default: -# netdb_ping_period 5 minutes - -# TAG: query_icmp on|off -# If you want to ask your peers to include ICMP data in their ICP -# replies, enable this option. -# -# If your peer has configured Squid (during compilation) with -# '--enable-icmp' that peer will send ICMP pings to origin server -# sites of the URLs it receives. If you enable this option the -# ICP replies from that peer will include the ICMP data (if available). -# Then, when choosing a parent cache, Squid will choose the parent with -# the minimal RTT to the origin server. When this happens, the -# hierarchy field of the access.log will be -# "CLOSEST_PARENT_MISS". This option is off by default. -# -#Default: -# query_icmp off - -# TAG: test_reachability on|off -# When this is 'on', ICP MISS replies will be ICP_MISS_NOFETCH -# instead of ICP_MISS if the target host is NOT in the ICMP -# database, or has a zero RTT. -# -#Default: -# test_reachability off - -# TAG: buffered_logs on|off -# cache.log log file is written with stdio functions, and as such -# it can be buffered or unbuffered. By default it will be unbuffered. -# Buffering it can speed up the writing slightly (though you are -# unlikely to need to worry unless you run with tons of debugging -# enabled in which case performance will suffer badly anyway..). -# -#Default: -# buffered_logs off - -# TAG: reload_into_ims on|off -# When you enable this option, client no-cache or ``reload'' -# requests will be changed to If-Modified-Since requests. -# Doing this VIOLATES the HTTP standard. Enabling this -# feature could make you liable for problems which it -# causes. -# -# see also refresh_pattern for a more selective approach. -# -#Default: -# reload_into_ims off - -# TAG: always_direct -# Usage: always_direct allow|deny [!]aclname ... -# -# Here you can use ACL elements to specify requests which should -# ALWAYS be forwarded by Squid to the origin servers without using -# any peers. For example, to always directly forward requests for -# local servers ignoring any parents or siblings you may have use -# something like: -# -# acl local-servers dstdomain my.domain.net -# always_direct allow local-servers -# -# To always forward FTP requests directly, use -# -# acl FTP proto FTP -# always_direct allow FTP -# -# NOTE: There is a similar, but opposite option named -# 'never_direct'. You need to be aware that "always_direct deny -# foo" is NOT the same thing as "never_direct allow foo". You -# may need to use a deny rule to exclude a more-specific case of -# some other rule. Example: -# -# acl local-external dstdomain external.foo.net -# acl local-servers dstdomain .foo.net -# always_direct deny local-external -# always_direct allow local-servers -# -# NOTE: If your goal is to make the client forward the request -# directly to the origin server bypassing Squid then this needs -# to be done in the client configuration. Squid configuration -# can only tell Squid how Squid should fetch the object. -# -# NOTE: This directive is not related to caching. The replies -# is cached as usual even if you use always_direct. To not cache -# the replies see no_cache. -# -# This option replaces some v1.1 options such as local_domain -# and local_ip. -# -#Default: -# none - -# TAG: never_direct -# Usage: never_direct allow|deny [!]aclname ... -# -# never_direct is the opposite of always_direct. Please read -# the description for always_direct if you have not already. -# -# With 'never_direct' you can use ACL elements to specify -# requests which should NEVER be forwarded directly to origin -# servers. For example, to force the use of a proxy for all -# requests, except those in your local domain use something like: -# -# acl local-servers dstdomain .foo.net -# acl all src 0.0.0.0/0.0.0.0 -# never_direct deny local-servers -# never_direct allow all -# -# or if Squid is inside a firewall and there are local intranet -# servers inside the firewall use something like: -# -# acl local-intranet dstdomain .foo.net -# acl local-external dstdomain external.foo.net -# always_direct deny local-external -# always_direct allow local-intranet -# never_direct allow all -# -# This option replaces some v1.1 options such as inside_firewall -# and firewall_ip. -# -#Default: -# none - -# TAG: header_access -# Usage: header_access header_name allow|deny [!]aclname ... -# -# WARNING: Doing this VIOLATES the HTTP standard. Enabling -# this feature could make you liable for problems which it -# causes. -# -# This option replaces the old 'anonymize_headers' and the -# older 'http_anonymizer' option with something that is much -# more configurable. This new method creates a list of ACLs -# for each header, allowing you very fine-tuned header -# mangling. -# -# You can only specify known headers for the header name. -# Other headers are reclassified as 'Other'. You can also -# refer to all the headers with 'All'. -# -# For example, to achieve the same behavior as the old -# 'http_anonymizer standard' option, you should use: -# -# header_access From deny all -# header_access Referer deny all -# header_access Server deny all -# header_access User-Agent deny all -# header_access WWW-Authenticate deny all -# header_access Link deny all -# -# Or, to reproduce the old 'http_anonymizer paranoid' feature -# you should use: -# -# header_access Allow allow all -# header_access Authorization allow all -# header_access WWW-Authenticate allow all -# header_access Proxy-Authorization allow all -# header_access Proxy-Authenticate allow all -# header_access Cache-Control allow all -# header_access Content-Encoding allow all -# header_access Content-Length allow all -# header_access Content-Type allow all -# header_access Date allow all -# header_access Expires allow all -# header_access Host allow all -# header_access If-Modified-Since allow all -# header_access Last-Modified allow all -# header_access Location allow all -# header_access Pragma allow all -# header_access Accept allow all -# header_access Accept-Charset allow all -# header_access Accept-Encoding allow all -# header_access Accept-Language allow all -# header_access Content-Language allow all -# header_access Mime-Version allow all -# header_access Retry-After allow all -# header_access Title allow all -# header_access Connection allow all -# header_access Proxy-Connection allow all -# header_access All deny all -# -# By default, all headers are allowed (no anonymizing is -# performed). -# -#Default: -# none - -# TAG: header_replace -# Usage: header_replace header_name message -# Example: header_replace User-Agent Nutscrape/1.0 (CP/M; 8-bit) -# -# This option allows you to change the contents of headers -# denied with header_access above, by replacing them with -# some fixed string. This replaces the old fake_user_agent -# option. -# -# By default, headers are removed if denied. -# -#Default: -# none - -# TAG: icon_directory -# Where the icons are stored. These are normally kept in -# /usr/share/squid/icons -# -#Default: -# icon_directory /usr/share/squid/icons - -# TAG: global_internal_static -# This directive controls is Squid should intercept all requests for -# /squid-internal-static/ no matter which host the URL is requesting -# (default on setting), or if nothing special should be done for -# such URLs (off setting). The purpose of this directive is to make -# icons etc work better in complex cache hierarchies where it may -# not always be possible for all corners in the cache mesh to reach -# the server generating a directory listing. -# -#Default: -# global_internal_static on - -# TAG: short_icon_urls -# If this is enabled Squid will use short URLs for icons. -# -# If off the URLs for icons will always be absolute URLs -# including the proxy name and port. -# -#Default: -# short_icon_urls off - -# TAG: error_directory -# Directory where the error files are read from. -# /usr/lib/squid/errors contains sets of error files -# in different languages. The default error directory -# is /etc/squid/errors, which is a link to one of these -# error sets. -# -# If you wish to create your own versions of the error files, -# either to customize them to suit your language or company, -# copy the template English files to another -# directory and point this tag at them. -# -#error_directory /usr/share/squid/errors/English -# -#Default: -# error_directory /usr/share/squid/errors/English - -# TAG: maximum_single_addr_tries -# This sets the maximum number of connection attempts for a -# host that only has one address (for multiple-address hosts, -# each address is tried once). -# -# The default value is one attempt, the (not recommended) -# maximum is 255 tries. A warning message will be generated -# if it is set to a value greater than ten. -# -# Note: This is in addition to the request re-forwarding which -# takes place if Squid fails to get a satisfying response. -# -#Default: -# maximum_single_addr_tries 1 - -# TAG: retry_on_error -# If set to on Squid will automatically retry requests when -# receiving an error response. This is mainly useful if you -# are in a complex cache hierarchy to work around access -# control errors. -# -#Default: -# retry_on_error off - -# TAG: snmp_port -# Squid can now serve statistics and status information via SNMP. -# A value of "0" disables SNMP support. If you wish to use SNMP, -# set this to "3401" to use the normal SNMP support. -# -#Default: -# snmp_port 0 - -# TAG: snmp_access -# Allowing or denying access to the SNMP port. -# -# All access to the agent is denied by default. -# usage: -# -# snmp_access allow|deny [!]aclname ... -# -#Example: -# snmp_access allow snmppublic localhost -# snmp_access deny all -# -#Default: -# snmp_access deny all - -# TAG: snmp_incoming_address -# TAG: snmp_outgoing_address -# Just like 'udp_incoming_address' above, but for the SNMP port. -# -# snmp_incoming_address is used for the SNMP socket receiving -# messages from SNMP agents. -# snmp_outgoing_address is used for SNMP packets returned to SNMP -# agents. -# -# The default snmp_incoming_address (0.0.0.0) is to listen on all -# available network interfaces. -# -# If snmp_outgoing_address is set to 255.255.255.255 (the default) -# it will use the same socket as snmp_incoming_address. Only -# change this if you want to have SNMP replies sent using another -# address than where this Squid listens for SNMP queries. -# -# NOTE, snmp_incoming_address and snmp_outgoing_address can not have -# the same value since they both use port 3401. -# -#Default: -# snmp_incoming_address 0.0.0.0 -# snmp_outgoing_address 255.255.255.255 - -# TAG: as_whois_server -# WHOIS server to query for AS numbers. NOTE: AS numbers are -# queried only when Squid starts up, not for every request. -# -#Default: -# as_whois_server whois.ra.net -# as_whois_server whois.ra.net - -# TAG: wccp_router -# TAG: wccp2_router -# Use this option to define your WCCP ``home'' router for -# Squid. -# -# wccp_router supports a single WCCP(v1) router -# -# wccp2_router supports multiple WCCPv2 routers -# -# only one of the two may be used at the same time and defines -# which version of WCCP to use. -# -#Default: -# wccp_router 0.0.0.0 - -# TAG: wccp_version -# This directive is only relevant if you need to set up WCCP(v1) -# to some very old and end-of-life Cisco routers. In all other -# setups it must be left unset or at the default setting. -# It defines an internal version in the WCCP(v1) protocol, -# with version 4 being the officially documented protocol. -# -# According to some users, Cisco IOS 11.2 and earlier only -# support WCCP version 3. If you're using that or an earlier -# version of IOS, you may need to change this value to 3, otherwise -# do not specify this parameter. -# -#Default: -# wccp_version 4 - -# TAG: wccp2_rebuild_wait -# If this is enabled Squid will wait for the cache dir rebuild to finish -# before sending the first wccp2 HereIAm packet -# -#Default: -# wccp2_rebuild_wait on - -# TAG: wccp2_forwarding_method -# WCCP2 allows the setting of forwarding methods between the -# router/switch and the cache. Valid values are as follows: -# -# 1 - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) -# 2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) -# -# Currently (as of IOS 12.4) cisco routers only support GRE. -# Cisco switches only support the L2 redirect assignment method. -# -#Default: -# wccp2_forwarding_method 1 - -# TAG: wccp2_return_method -# WCCP2 allows the setting of return methods between the -# router/switch and the cache for packets that the cache -# decides not to handle. Valid values are as follows: -# -# 1 - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) -# 2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) -# -# Currently (as of IOS 12.4) cisco routers only support GRE. -# Cisco switches only support the L2 redirect assignment. -# -# If the "ip wccp redirect exclude in" command has been -# enabled on the cache interface, then it is still safe for -# the proxy server to use a l2 redirect method even if this -# option is set to GRE. -# -#Default: -# wccp2_return_method 1 - -# TAG: wccp2_assignment_method -# WCCP2 allows the setting of methods to assign the WCCP hash -# Valid values are as follows: -# -# 1 - Hash assignment -# 2 - Mask assignment -# -# As a general rule, cisco routers support the hash assignment method -# and cisco switches support the mask assignment method. -# -#Default: -# wccp2_assignment_method 1 - -# TAG: wccp2_service -# WCCP2 allows for multiple traffic services. There are two -# types: "standard" and "dynamic". The standard type defines -# one service id - http (id 0). The dynamic service ids can be from -# 51 to 255 inclusive. In order to use a dynamic service id -# one must define the type of traffic to be redirected; this is done -# using the wccp2_service_info option. -# -# The "standard" type does not require a wccp2_service_info option, -# just specifying the service id will suffice. -# -# MD5 service authentication can be enabled by adding -# "password=" to the end of this service declaration. -# -# Examples: -# -# wccp2_service standard 0 # for the 'web-cache' standard service -# wccp2_service dynamic 80 # a dynamic service type which will be -# # fleshed out with subsequent options. -# wccp2_service standard 0 password=foo -# -# -#Default: -# wccp2_service standard 0 - -# TAG: wccp2_service_info -# Dynamic WCCPv2 services require further information to define the -# traffic you wish to have diverted. -# -# The format is: -# -# wccp2_service_info protocol= flags=,.. -# priority= ports=,.. -# -# The relevant WCCPv2 flags: -# + src_ip_hash, dst_ip_hash -# + source_port_hash, dest_port_hash -# + src_ip_alt_hash, dst_ip_alt_hash -# + src_port_alt_hash, dst_port_alt_hash -# + ports_source -# -# The port list can be one to eight entries. -# -# Example: -# -# wccp2_service_info 80 protocol=tcp flags=src_ip_hash,ports_source -# priority=240 ports=80 -# -# Note: the service id must have been defined by a previous -# 'wccp2_service dynamic ' entry. -# -#Default: -# none - -# TAG: wccp2_weight -# Each cache server gets assigned a set of the destination -# hash proportional to their weight. -# -#Default: -# wccp2_weight 10000 - -# TAG: wccp_address -# TAG: wccp2_address -# Use this option if you require WCCP to use a specific -# interface address. -# -# The default behavior is to not bind to any specific address. -# -#Default: -# wccp_address 0.0.0.0 -# wccp2_address 0.0.0.0 - - -# DELAY POOL PARAMETERS (all require DELAY_POOLS compilation option) -# ----------------------------------------------------------------------------- - -# TAG: delay_pools -# This represents the number of delay pools to be used. For example, -# if you have one class 2 delay pool and one class 3 delays pool, you -# have a total of 2 delay pools. -# -#Default: -# delay_pools 0 - -# TAG: delay_class -# This defines the class of each delay pool. There must be exactly one -# delay_class line for each delay pool. For example, to define two -# delay pools, one of class 2 and one of class 3, the settings above -# and here would be: -# -#Example: -# delay_pools 2 # 2 delay pools -# delay_class 1 2 # pool 1 is a class 2 pool -# delay_class 2 3 # pool 2 is a class 3 pool -# -# The delay pool classes are: -# -# class 1 Everything is limited by a single aggregate -# bucket. -# -# class 2 Everything is limited by a single aggregate -# bucket as well as an "individual" bucket chosen -# from bits 25 through 32 of the IP address. -# -# class 3 Everything is limited by a single aggregate -# bucket as well as a "network" bucket chosen -# from bits 17 through 24 of the IP address and a -# "individual" bucket chosen from bits 17 through -# 32 of the IP address. -# -# NOTE: If an IP address is a.b.c.d -# -> bits 25 through 32 are "d" -# -> bits 17 through 24 are "c" -# -> bits 17 through 32 are "c * 256 + d" -# -#Default: -# none - -# TAG: delay_access -# This is used to determine which delay pool a request falls into. -# -# delay_access is sorted per pool and the matching starts with pool 1, -# then pool 2, ..., and finally pool N. The first delay pool where the -# request is allowed is selected for the request. If it does not allow -# the request to any pool then the request is not delayed (default). -# -# For example, if you want some_big_clients in delay -# pool 1 and lotsa_little_clients in delay pool 2: -# -#Example: -# delay_access 1 allow some_big_clients -# delay_access 1 deny all -# delay_access 2 allow lotsa_little_clients -# delay_access 2 deny all -# -#Default: -# none - -# TAG: delay_parameters -# This defines the parameters for a delay pool. Each delay pool has -# a number of "buckets" associated with it, as explained in the -# description of delay_class. For a class 1 delay pool, the syntax is: -# -#delay_parameters pool aggregate -# -# For a class 2 delay pool: -# -#delay_parameters pool aggregate individual -# -# For a class 3 delay pool: -# -#delay_parameters pool aggregate network individual -# -# The variables here are: -# -# pool a pool number - ie, a number between 1 and the -# number specified in delay_pools as used in -# delay_class lines. -# -# aggregate the "delay parameters" for the aggregate bucket -# (class 1, 2, 3). -# -# individual the "delay parameters" for the individual -# buckets (class 2, 3). -# -# network the "delay parameters" for the network buckets -# (class 3). -# -# A pair of delay parameters is written restore/maximum, where restore is -# the number of bytes (not bits - modem and network speeds are usually -# quoted in bits) per second placed into the bucket, and maximum is the -# maximum number of bytes which can be in the bucket at any time. -# -# For example, if delay pool number 1 is a class 2 delay pool as in the -# above example, and is being used to strictly limit each host to 64kbps -# (plus overheads), with no overall limit, the line is: -# -#delay_parameters 1 -1/-1 8000/8000 -# -# Note that the figure -1 is used to represent "unlimited". -# -# And, if delay pool number 2 is a class 3 delay pool as in the above -# example, and you want to limit it to a total of 256kbps (strict limit) -# with each 8-bit network permitted 64kbps (strict limit) and each -# individual host permitted 4800bps with a bucket maximum size of 64kb -# to permit a decent web page to be downloaded at a decent speed -# (if the network is not being limited due to overuse) but slow down -# large downloads more significantly: -# -#delay_parameters 2 32000/32000 8000/8000 600/8000 -# -# There must be one delay_parameters line for each delay pool. -# -#Default: -# none - -# TAG: delay_initial_bucket_level (percent, 0-100) -# The initial bucket percentage is used to determine how much is put -# in each bucket when squid starts, is reconfigured, or first notices -# a host accessing it (in class 2 and class 3, individual hosts and -# networks only have buckets associated with them once they have been -# "seen" by squid). -# -#Default: -# delay_initial_bucket_level 50 - -# TAG: incoming_icp_average -# TAG: incoming_http_average -# TAG: incoming_dns_average -# TAG: min_icp_poll_cnt -# TAG: min_dns_poll_cnt -# TAG: min_http_poll_cnt -# Heavy voodoo here. I can't even believe you are reading this. -# Are you crazy? Don't even think about adjusting these unless -# you understand the algorithms in comm_select.c first! -# -#Default: -# incoming_icp_average 6 -# incoming_http_average 4 -# incoming_dns_average 4 -# min_icp_poll_cnt 8 -# min_dns_poll_cnt 8 -# min_http_poll_cnt 8 - -# TAG: max_open_disk_fds -# To avoid having disk as the I/O bottleneck Squid can optionally -# bypass the on-disk cache if more than this amount of disk file -# descriptors are open. -# -# A value of 0 indicates no limit. -# -#Default: -# max_open_disk_fds 0 - -# TAG: offline_mode -# Enable this option and Squid will never try to validate cached -# objects. -# -#Default: -# offline_mode off - -# TAG: uri_whitespace -# What to do with requests that have whitespace characters in the -# URI. Options: -# -# strip: The whitespace characters are stripped out of the URL. -# This is the behavior recommended by RFC2396. -# deny: The request is denied. The user receives an "Invalid -# Request" message. -# allow: The request is allowed and the URI is not changed. The -# whitespace characters remain in the URI. Note the -# whitespace is passed to redirector processes if they -# are in use. -# encode: The request is allowed and the whitespace characters are -# encoded according to RFC1738. This could be considered -# a violation of the HTTP/1.1 -# RFC because proxies are not allowed to rewrite URI's. -# chop: The request is allowed and the URI is chopped at the -# first whitespace. This might also be considered a -# violation. -# -#Default: -# uri_whitespace strip - -# TAG: broken_posts -# A list of ACL elements which, if matched, causes Squid to send -# an extra CRLF pair after the body of a PUT/POST request. -# -# Some HTTP servers has broken implementations of PUT/POST, -# and rely on an extra CRLF pair sent by some WWW clients. -# -# Quote from RFC2068 section 4.1 on this matter: -# -# Note: certain buggy HTTP/1.0 client implementations generate an -# extra CRLF's after a POST request. To restate what is explicitly -# forbidden by the BNF, an HTTP/1.1 client must not preface or follow -# a request with an extra CRLF. -# -#Example: -# acl buggy_server url_regex ^http://.... -# broken_posts allow buggy_server -# -#Default: -# none - -# TAG: mcast_miss_addr -# Note: This option is only available if Squid is rebuilt with the -# --enable-multicast-miss option -# -# If you enable this option, every "cache miss" URL will -# be sent out on the specified multicast address. -# -# Do not enable this option unless you are are absolutely -# certain you understand what you are doing. -# -#Default: -# mcast_miss_addr 255.255.255.255 - -# TAG: mcast_miss_ttl -# Note: This option is only available if Squid is rebuilt with the -# --enable-multicast-miss option -# -# This is the time-to-live value for packets multicasted -# when multicasting off cache miss URLs is enabled. By -# default this is set to 'site scope', i.e. 16. -# -#Default: -# mcast_miss_ttl 16 - -# TAG: mcast_miss_port -# Note: This option is only available if Squid is rebuilt with the -# --enable-multicast-miss option -# -# This is the port number to be used in conjunction with -# 'mcast_miss_addr'. -# -#Default: -# mcast_miss_port 3135 - -# TAG: mcast_miss_encode_key -# Note: This option is only available if Squid is rebuilt with the -# --enable-multicast-miss option -# -# The URLs that are sent in the multicast miss stream are -# encrypted. This is the encryption key. -# -#Default: -# mcast_miss_encode_key XXXXXXXXXXXXXXXX - -# TAG: nonhierarchical_direct -# By default, Squid will send any non-hierarchical requests -# (matching hierarchy_stoplist or not cacheable request type) direct -# to origin servers. -# -# If you set this to off, Squid will prefer to send these -# requests to parents. -# -# Note that in most configurations, by turning this off you will only -# add latency to these request without any improvement in global hit -# ratio. -# -# If you are inside an firewall see never_direct instead of -# this directive. -# -#Default: -# nonhierarchical_direct on - -# TAG: prefer_direct -# Normally Squid tries to use parents for most requests. If you for some -# reason like it to first try going direct and only use a parent if -# going direct fails set this to on. -# -# By combining nonhierarchical_direct off and prefer_direct on you -# can set up Squid to use a parent as a backup path if going direct -# fails. -# -# Note: If you want Squid to use parents for all requests see -# the never_direct directive. prefer_direct only modifies how Squid -# acts on cacheable requests. -# -#Default: -# prefer_direct off - -# TAG: strip_query_terms -# By default, Squid strips query terms from requested URLs before -# logging. This protects your user's privacy. -# -#Default: -# strip_query_terms on - -# TAG: coredump_dir -# By default Squid leaves core files in the directory from where -# it was started. If you set 'coredump_dir' to a directory -# that exists, Squid will chdir() to that directory at startup -# and coredump files will be left there. -# -#Default: -# coredump_dir none -# -# Leave coredumps in the first cache dir -coredump_dir /var/spool/squid - -# TAG: redirector_bypass -# When this is 'on', a request will not go through the -# redirector if all redirectors are busy. If this is 'off' -# and the redirector queue grows too large, Squid will exit -# with a FATAL error and ask you to increase the number of -# redirectors. You should only enable this if the redirectors -# are not critical to your caching system. If you use -# redirectors for access control, and you enable this option, -# users may have access to pages they should not -# be allowed to request. -# -#Default: -# redirector_bypass off - -# TAG: ignore_unknown_nameservers -# By default Squid checks that DNS responses are received -# from the same IP addresses they are sent to. If they -# don't match, Squid ignores the response and writes a warning -# message to cache.log. You can allow responses from unknown -# nameservers by setting this option to 'off'. -# -#Default: -# ignore_unknown_nameservers on - -# TAG: digest_generation -# This controls whether the server will generate a Cache Digest -# of its contents. By default, Cache Digest generation is -# enabled if Squid is compiled with USE_CACHE_DIGESTS defined. -# -#Default: -# digest_generation on - -# TAG: digest_bits_per_entry -# This is the number of bits of the server's Cache Digest which -# will be associated with the Digest entry for a given HTTP -# Method and URL (public key) combination. The default is 5. -# -#Default: -# digest_bits_per_entry 5 - -# TAG: digest_rebuild_period (seconds) -# This is the number of seconds between Cache Digest rebuilds. -# -#Default: -# digest_rebuild_period 1 hour - -# TAG: digest_rewrite_period (seconds) -# This is the number of seconds between Cache Digest writes to -# disk. -# -#Default: -# digest_rewrite_period 1 hour - -# TAG: digest_swapout_chunk_size (bytes) -# This is the number of bytes of the Cache Digest to write to -# disk at a time. It defaults to 4096 bytes (4KB), the Squid -# default swap page. -# -#Default: -# digest_swapout_chunk_size 4096 bytes - -# TAG: digest_rebuild_chunk_percentage (percent, 0-100) -# This is the percentage of the Cache Digest to be scanned at a -# time. By default it is set to 10% of the Cache Digest. -# -#Default: -# digest_rebuild_chunk_percentage 10 - -# TAG: chroot -# Use this to have Squid do a chroot() while initializing. This -# also causes Squid to fully drop root privileges after -# initializing. This means, for example, that if you use a HTTP -# port less than 1024 and try to reconfigure, you will get an -# error. -# -#Default: -# none - -# TAG: client_persistent_connections -# TAG: server_persistent_connections -# Persistent connection support for clients and servers. By -# default, Squid uses persistent connections (when allowed) -# with its clients and servers. You can use these options to -# disable persistent connections with clients and/or servers. -# -#Default: -# client_persistent_connections on -# server_persistent_connections on - -# TAG: persistent_connection_after_error -# With this directive the use of persistent connections after -# HTTP errors can be disabled. Useful if you have clients -# who fail to handle errors on persistent connections proper. -# -#Default: -# persistent_connection_after_error off - -# TAG: detect_broken_pconn -# Some servers have been found to incorrectly signal the use -# of HTTP/1.0 persistent connections even on replies not -# compatible, causing significant delays. This server problem -# has mostly been seen on redirects. -# -# By enabling this directive Squid attempts to detect such -# broken replies and automatically assume the reply is finished -# after 10 seconds timeout. -# -#Default: -# detect_broken_pconn off - -# TAG: balance_on_multiple_ip -# Some load balancing servers based on round robin DNS have been -# found not to preserve user session state across requests -# to different IP addresses. -# -# By default Squid rotates IP's per request. By disabling -# this directive only connection failure triggers rotation. -# -#Default: -# balance_on_multiple_ip on - -# TAG: pipeline_prefetch -# To boost the performance of pipelined requests to closer -# match that of a non-proxied environment Squid can try to fetch -# up to two requests in parallel from a pipeline. -# -# Defaults to off for bandwidth management and access logging -# reasons. -# -#Default: -# pipeline_prefetch off - -# TAG: extension_methods -# Squid only knows about standardized HTTP request methods. -# You can add up to 20 additional "extension" methods here. -# -#Default: -# none - -# TAG: request_entities -# Squid defaults to deny GET and HEAD requests with request entities, -# as the meaning of such requests are undefined in the HTTP standard -# even if not explicitly forbidden. -# -# Set this directive to on if you have clients which insists -# on sending request entities in GET or HEAD requests. But be warned -# that there is server software (both proxies and web servers) which -# can fail to properly process this kind of request which may make you -# vulnerable to cache pollution attacks if enabled. -# -#Default: -# request_entities off - -# TAG: high_response_time_warning (msec) -# If the one-minute median response time exceeds this value, -# Squid prints a WARNING with debug level 0 to get the -# administrators attention. The value is in milliseconds. -# -#Default: -# high_response_time_warning 0 - -# TAG: high_page_fault_warning -# If the one-minute average page fault rate exceeds this -# value, Squid prints a WARNING with debug level 0 to get -# the administrators attention. The value is in page faults -# per second. -# -#Default: -# high_page_fault_warning 0 - -# TAG: high_memory_warning -# If the memory usage (as determined by mallinfo) exceeds -# value, Squid prints a WARNING with debug level 0 to get -# the administrators attention. -# -#Default: -# high_memory_warning 0 - -# TAG: store_dir_select_algorithm -# Set this to 'round-robin' as an alternative. -# -#Default: -# store_dir_select_algorithm least-load - -# TAG: forward_log -# Note: This option is only available if Squid is rebuilt with the -# --enable-forward-log option -# -# Logs the server-side requests. -# -# This is currently work in progress. -# -#Default: -# none - -# TAG: ie_refresh on|off -# Microsoft Internet Explorer up until version 5.5 Service -# Pack 1 has an issue with transparent proxies, wherein it -# is impossible to force a refresh. Turning this on provides -# a partial fix to the problem, by causing all IMS-REFRESH -# requests from older IE versions to check the origin server -# for fresh content. This reduces hit ratio by some amount -# (~10% in my experience), but allows users to actually get -# fresh content when they want it. Note that because Squid -# cannot tell if the user is using 5.5 or 5.5SP1, the behavior -# of 5.5 is unchanged from old versions of Squid (i.e. a -# forced refresh is impossible). Newer versions of IE will, -# hopefully, continue to have the new behavior and will be -# handled based on that assumption. This option defaults to -# the old Squid behavior, which is better for hit ratios but -# worse for clients using IE, if they need to be able to -# force fresh content. -# -#Default: -# ie_refresh off - -# TAG: vary_ignore_expire on|off -# Many HTTP servers supporting Vary gives such objects -# immediate expiry time with no cache-control header -# when requested by a HTTP/1.0 client. This option -# enables Squid to ignore such expiry times until -# HTTP/1.1 is fully implemented. -# WARNING: This may eventually cause some varying -# objects not intended for caching to get cached. -# -#Default: -# vary_ignore_expire off - -# TAG: sleep_after_fork (microseconds) -# When this is set to a non-zero value, the main Squid process -# sleeps the specified number of microseconds after a fork() -# system call. This sleep may help the situation where your -# system reports fork() failures due to lack of (virtual) -# memory. Note, however, that if you have a lot of child -# processes, these sleep delays will add up and your -# Squid will not service requests for some amount of time -# until all the child processes have been started. -# On Windows value less then 1000 (1 milliseconds) are -# rounded to 1000. -# -#Default: -# sleep_after_fork 0 - -# TAG: minimum_expiry_time (seconds) -# The minimum caching time according to (Expires - Date) -# Headers Squid honors if the object can't be revalidated -# defaults to 60 seconds. In reverse proxy enorinments it -# might be desirable to honor shorter object lifetimes. It -# is most likely better to make your server return a -# meaningful Last-Modified header however. -# -#Default: -# minimum_expiry_time 60 seconds - -# TAG: relaxed_header_parser on|off|warn -# In the default "on" setting Squid accepts certain forms -# of non-compliant HTTP messages where it is unambiguous -# what the sending application intended even if the message -# is not correctly formatted. The messages is then normalized -# to the correct form when forwarded by Squid. -# -# If set to "warn" then a warning will be emitted in cache.log -# each time such HTTP error is encountered. -# -# If set to "off" then such HTTP errors will cause the request -# or response to be rejected. -# -#Default: -# relaxed_header_parser on - -# TAG: max_filedesc -# The maximum number of open file descriptors. -# -# WARNING: Changes of this value isn't respected by reconfigure -# command. This value should be changed only if there isn't -# any active squid process. -# -# NOTE: This option is only supported by system with poll() -# or epoll(). You can set this value by --with-maxfd during -# compilation on system whith uses select(). -# -# The maximum value for max_filedesc is set by --with-maxfd during -# compilation. -# -#Default: -# max_filedesc 1024 diff --git a/scripts/proxy-mirror/example-squid-config/squid.conf.diff b/scripts/proxy-mirror/example-squid-config/squid.conf.diff deleted file mode 100644 index 49e5458..0000000 --- a/scripts/proxy-mirror/example-squid-config/squid.conf.diff +++ /dev/null @@ -1,47 +0,0 @@ ---- /tmp/squid.conf 2007-07-09 14:00:14.000000000 -0400 -+++ squid.conf 2007-07-08 16:22:49.000000000 -0400 -@@ -86,7 +86,8 @@ - # visible on the internal address. - # - # Squid normally listens to port 3128 --http_port 3128 -+http_port 80 accel defaultsite=download.fedora.redhat.com -+cache_peer 209.132.176.220 parent 80 0 no-query originserver - - # TAG: https_port - # Usage: [ip:]port cert=certificate.pem [key=key.pem] [options...] -@@ -759,7 +760,7 @@ - # objects. - # - #Default: --# cache_mem 8 MB -+ cache_mem 384 MB - - # TAG: cache_swap_low (percent, 0-100) - # TAG: cache_swap_high (percent, 0-100) -@@ -792,7 +793,7 @@ - # See replacement_policy below for a discussion of this policy. - # - #Default: --# maximum_object_size 4096 KB -+ maximum_object_size 2000000 KB - - # TAG: minimum_object_size (bytes) - # Objects smaller than this size will NOT be saved on disk. The -@@ -1014,7 +1015,7 @@ - # (hard coded at 1 MB). - # - #Default: --# cache_dir ufs /var/spool/squid 100 16 256 -+ cache_dir ufs /var/spool/squid 53000 16 256 - - # TAG: logformat - # Usage: -@@ -2541,6 +2542,7 @@ - #http_access deny to_localhost - # - # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS -+http_access allow all - - # Example rule allowing access from your local networks. Adapt - # to list your (internal) IP networks from where browsing should diff --git a/scripts/proxy-mirror/proxy-syncd/README b/scripts/proxy-mirror/proxy-syncd/README deleted file mode 100644 index 15dae07..0000000 --- a/scripts/proxy-mirror/proxy-syncd/README +++ /dev/null @@ -1,2 +0,0 @@ - proxy-syncd.py -This script monitors repomd.xml of all configured yum repositories on the originating HTTP server. If it changes, then it forces a "Pragma: no-cache" refresh of all repodata files on the proxy mirror. This ensures that all repodata pulled from the proxy mirror is self-consistent (i.e. filelists.sqlite.bz2 matches the repomd.xml) and guards against failure conditions of yum clients. diff --git a/scripts/proxy-mirror/proxy-syncd/proxy-syncd.py b/scripts/proxy-mirror/proxy-syncd/proxy-syncd.py deleted file mode 100644 index c64f7b4..0000000 --- a/scripts/proxy-mirror/proxy-syncd/proxy-syncd.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/python -import sys -import time -import sha -from urlgrabber.grabber import URLGrabber -from urlgrabber.grabber import URLGrabError - -# original address -BASE1='http://gromit.redhat.com/pub/fedora/linux' -# proxy address -BASE2='http://download.boston.redhat.com/pub/fedora/linux' -# individual repos -DIRS=""" -/updates/7/i386 -/updates/testing/7/i386 -/updates/7/x86_64 -/updates/testing/7/x86_64 -/updates/7/ppc -/updates/testing/7/x86_64 -/development/i386/os -/development/x86_64/os -/development/ppc/os -/core/updates/6/i386 -/core/updates/6/x86_64 -/core/updates/6/ppc -""" -# All repodata files -REPOFILES=['repomd.xml','filelists.sqlite.bz2','filelists.xml.gz','other.sqlite.bz2','other.xml.gz','primary.sqlite.bz2','primary.xml.gz','updateinfo.xml.gz','comps.xml'] -# Log File -LOGFILE='~/repodata-syncd.log' - -DEBUG=False - -# Hash URL, return hex sha1sum -# http_headers = (('Pragma', 'no-cache'),) -def hash_url(url): - retval = '' - try: - f = g.urlopen(url) - so = sha.new() - so.update(f.read()) - f.close() - retval = so.hexdigest() - except URLGrabError: - retval = 'ERROR: Try again later.' - return retval - -# Print Debug Messages -def debug(msg): - if DEBUG == True: - print " DEBUG: %s" % msg - -# Get Hashes of All repomd.xml -def hash_all_urls(): - for path in DIRDICT.keys(): - url = BASE1 + path + '/repodata/repomd.xml' - hash = hash_url(url) - DIRDICT[path] = hash - print("%s %s" % (url, hash)) - -# Refresh Repodata -def refresh_repodata(path): - url = BASE2 + path + '/repodata/' - for file in REPOFILES: - debug("Grabbing %s" % url + file) - try: - r.urlread(url + file) - except URLGrabError: - pass - -### Main() -# Setup Variables -DIRLIST = DIRS.split() -tuples = [] -for x in DIRLIST: - if x.startswith('#') == False: - tuples.append((x,0)) -DIRDICT = dict(tuples) -g = URLGrabber(keepalive=0) -r = URLGrabber(keepalive=0,http_headers = (('Pragma', 'no-cache'),)) - -# Get Initial Hashes -hash_all_urls() -serial = 0 - -# Loop Forever -while True: - print "serial=%d" % serial - # Check each repodata directory - for path in DIRDICT.keys(): - url = BASE1 + path + '/repodata/repomd.xml' - hash = hash_url(url) - if hash != DIRDICT[path]: - debug("CHANGE %s" % url) - debug(" %s" % DIRDICT[path]) - debug(" %s" % hash) - print 'REFRESHING ' + BASE2 + path - # if hash changes, refresh repodata on proxy server - refresh_repodata(path) - # update dictionary entry to new hash value - DIRDICT[path]=hash - time.sleep(120) - serial += 1 diff --git a/scripts/puppetsearch/puppetsearch.rb b/scripts/puppetsearch/puppetsearch.rb deleted file mode 100755 index 612e7df..0000000 --- a/scripts/puppetsearch/puppetsearch.rb +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/ruby -require "puppet" -require "optparse" - -# Note: This script requires puppet >= 0.25.5. - -Puppet.settings.parse - -options = { - :node => Puppet[:certname], - :types => [], - :source => :yaml, -} - -OptionParser.new do |opts| - opts.banner = "Usage: puppetsearch [options] title1 title2 ..." - - opts.on("-n", - "--node NODENAME", - "Search on node NODENAME") do |node| - options[:node] = node - end - - opts.on("-t", - "--types TYPES", - "Comma-separated list of resource types to search for") do |types| - options[:types] = types.split(",") - end - - opts.on("-s", - "--source SOURCE", - "Catalog source (yaml, compiler, rest, etc.)") do |source| - options[:source] = source - end -end.parse! - -# Search for files by default. -if options[:types].empty? - options[:types] << "File" -end - -Puppet[:catalog_terminus] = options[:source] - -catalog = Puppet::Resource::Catalog.find(options[:node]) - -if catalog.nil? - abort "Could not load catalog." -end - -ARGV.each do |search_title| - options[:types].each do |type| - resource = catalog.resource(type, search_title) - unless resource.nil? - puts "#{resource} defined in #{resource.file}" - end - end -end - diff --git a/scripts/review-stats/.gitignore b/scripts/review-stats/.gitignore deleted file mode 100644 index d0f7a09..0000000 --- a/scripts/review-stats/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -bzcookie -local.cfg diff --git a/scripts/review-stats/ANSIBLE-IS-NOT-UPSTREAM b/scripts/review-stats/ANSIBLE-IS-NOT-UPSTREAM deleted file mode 100644 index d49c150..0000000 --- a/scripts/review-stats/ANSIBLE-IS-NOT-UPSTREAM +++ /dev/null @@ -1,5 +0,0 @@ -If you commit changes to the code or templates in ansible, they will not be -reflected in the upstream code and may be overwritten when upstream is copied -into ansible. Upstream is at -ssh://git.fedorahosted.org/git/fedora-infrastructure.git in -scripts/review-stats. diff --git a/scripts/review-stats/review-stats.cfg b/scripts/review-stats/review-stats.cfg deleted file mode 100644 index 3d2fc7a..0000000 --- a/scripts/review-stats/review-stats.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[global] -{% if env == "staging" %} -url = "https://partner-bugzilla.redhat.com/xmlrpc.cgi" -{% else %} -url = "https://bugzilla.redhat.com/xmlrpc.cgi" -{% endif %} -username = "package-review@lists.fedoraproject.org" -password = "{{ packagereviewbugzilla }}" -maxpackages = 5 diff --git a/scripts/review-stats/review-stats.py b/scripts/review-stats/review-stats.py deleted file mode 100755 index ab28062..0000000 --- a/scripts/review-stats/review-stats.py +++ /dev/null @@ -1,674 +0,0 @@ -#!/usr/bin/python -t -import bugzilla -import datetime -import glob -import logging -import operator -import os -import string -import sys -import tempfile -import time -from configobj import ConfigObj, flatten_errors -from copy import deepcopy -from genshi.template import TemplateLoader -from optparse import OptionParser -from validate import Validator - -VERSION = "4.1" - -# Red Hat's bugzilla -url = 'https://bugzilla.redhat.com/xmlrpc.cgi' - -# Some magic bug numbers -ACCEPT = 163779 -BUNDLED = 658489 -FEATURE = 654686 -GUIDELINES = 197974 -LEGAL = 182235 -NEEDSPONSOR = 177841 -SCITECH = 505154 -SECLAB = 563471 - -# These will show up in a query but aren't actual review tickets -trackers = set([ACCEPT, BUNDLED, FEATURE, NEEDSPONSOR, GUIDELINES, SCITECH, SECLAB]) - -# How many packages per submitter are allowed in the main queue -maxpackages = 5 - -# So the bugzilla module has some way to complain -logging.basicConfig() - - -def parse_commandline(): - usage = "usage: %prog [options] -c -d -t " - parser = OptionParser(usage) - parser.add_option("-c", "--config", dest="configfile", - help="configuration file name") - parser.add_option("-d", "--destination", dest="dirname", - help="destination directory") - parser.add_option("-f", "--frequency", dest="frequency", - help="update frequency", default="60") - parser.add_option("-t", "--templatedir", dest="templdir", - help="template directory") - parser.add_option("-v", "--verbose", action="store_true", dest="verbose", - help="run verbosely") - - (options, args) = parser.parse_args() - if str(options.dirname) == 'None': - parser.error("Please specify destination directory") - if not os.path.isdir(options.dirname): - parser.error("Please specify an existing destination directory") - - if str(options.templdir) == 'None': - parser.error("Please specify templates directory") - if not os.path.isdir(options.templdir): - parser.error("Please specify an existing template directory") - - return options - - -def parse_config(file): - v = Validator() - - spec = ''' - [global] - url = string(default='https://bugzilla.redhat.com/xmlrpc.cgi') - username = string() - password = string() - '''.splitlines() - - cfg = ConfigObj(file, configspec=spec) - res = cfg.validate(v, preserve_errors=True) - - for entry in flatten_errors(cfg, res): - section_list, key, error = entry - section_list.append(key) - if not error: - error = 'Missing value or section.' - print(','.join(section_list), '=', error) - sys.exit(1) - - return cfg['global'] - - -def nobody(str): - '''Shorten the long "nobody's working on it" string.''' - if (str == "Nobody's working on this, feel free to take it" - or str == "nobody@fedoraproject.org"): - return "(Nobody)" - return str - - -def nosec(str): - '''Remove the seconds from an hh:mm:ss format string.''' - return str[0:str.rfind(':')] - - -def human_date(t): - '''Turn an ISO date into something more human-friendly.''' - t = str(t) - return t[0:4] + '-' + t[4:6] + '-' + t[6:8] - - -def human_time(t): - '''Turn an ISO date into something more human-friendly, with time.''' - t = str(t) - return t[0:4] + '-' + t[4:6] + '-' + t[6:8] + ' ' + t[9:] - - -def to_unicode(object, encoding='utf8', errors='replace'): - if isinstance(object, basestring): - if isinstance(object, str): - return unicode(object, encoding, errors) - else: - return object - return u'' - - -def reporter(bug): - '''Extract the reporter from a bug, replacing an empty value with "(none)". - Yes, bugzilla will return a blank reporter for some reason.''' - if (bug.reporter) == '': - return "(none)" - return bug.reporter - - -def yrmonth(d): - '''Turn a bugzilla date into Month YYYY string.''' - m = ['January', 'February', 'March', 'April', 'May', 'June', 'July', - 'August', 'September', 'October', 'November', 'December'] - - str = d.value - year = str[0:4] - month = int(str[4:6]) - 1 - return m[month] + ' ' + year - - -def dbprint(str): - '''Print string if verbosity is turned on.''' - if verbose: - print(str) - - -def seq_max_split(seq, max_entries): - """ Given a seq, split into a list of lists of length max_entries each. """ - ret = [] - num = len(seq) - seq = list(seq) # Trying to use a set/etc. here is bad - beg = 0 - while num > max_entries: - end = beg + max_entries - ret.append(seq[beg:end]) - beg += max_entries - num -= max_entries - ret.append(seq[beg:]) - return ret - - -def run_query(bz): - querydata = {} - bugdata = {} - alldeps = set([]) - closeddeps = set([]) - usermap = {} - - querydata['include_fields'] = ['id', 'creation_time', 'last_change_time', 'bug_severity', - 'alias', 'assigned_to', 'product', 'creator', 'creator_id', 'status', 'resolution', - 'component', 'blocks', 'depends_on', 'summary', - 'whiteboard', 'flags'] - querydata['bug_status'] = ['NEW', 'ASSIGNED', 'MODIFIED'] - querydata['product'] = ['Fedora', 'Fedora EPEL'] - querydata['component'] = ['Package Review'] - querydata['query_format'] = 'advanced' - - # Look up tickets with no fedora-review flag set - querydata['f1'] = 'flagtypes.name' - querydata['o1'] = 'notregexp' - querydata['v1'] = 'fedora-review[-+?]' - - dbprint("Running main query.") - t = time.time() - bugs = filter(lambda b: b.id not in trackers, bz.query(querydata)) - dbprint("Done, took {0:.2f}.".format(time.time() - t)) - - for bug in bugs: - bugdata[bug.id] = {} - bugdata[bug.id]['hidden'] = [] - bugdata[bug.id]['blocks'] = bug.blocks - bugdata[bug.id]['depends'] = bug.depends_on - bugdata[bug.id]['reviewflag'] = ' ' - - if bug.depends_on: - alldeps.update(bug.depends_on) - - # Now have complete flag info; don't need to query it separately - for flag in bug.flags: - if (flag['name'] == 'needinfo' - and flag['status'] == '?' - and 'requestee' in flag - and flag['requestee'] == bug.creator): - bugdata[bug.id]['hidden'].append('needinfo') - - # Find which of the dependencies are closed - dbprint("Looking up {0} bug deps.".format(len(alldeps))) - t = time.time() - for bug in filter(None, bz.query(bz.build_query(bug_id=list(alldeps), status=["CLOSED"]))): - closeddeps.add(bug.id) - dbprint("Done; took {0:.2f}.".format(time.time() - t)) - - # Hide tickets blocked by other bugs or those with various blockers and - # statuses. - def opendep(id): - return id not in closeddeps - for bug in bugs: - wb = string.lower(bug.whiteboard) - if bug.bug_status != 'CLOSED': - if wb.find('notready') >= 0: - bugdata[bug.id]['hidden'].append('notready') - if wb.find('buildfails') >= 0: - bugdata[bug.id]['hidden'].append('buildfails') - if wb.find('stalledsubmitter') >= 0: - bugdata[bug.id]['hidden'].append('stalled') - if wb.find('awaitingsubmitter') >= 0: - bugdata[bug.id]['hidden'].append('stalled') - if BUNDLED in bugdata[bug.id]['blocks']: - bugdata[bug.id]['hidden'].append('bundled') - if LEGAL in bugdata[bug.id]['blocks']: - bugdata[bug.id]['hidden'].append('legal') - if filter(opendep, bugdata[bug.id]['depends']): - bugdata[bug.id]['hidden'].append('blocked') - - # Count up each submitter's tickets and hide excessive submissions. Want - # to make sure one submitter only has 'maxpackages' tickets in the NEW - # queue at one time. Already-hidden packages don't count. - submitters = {} - for i in bugs: - if i.reporter not in submitters: - submitters[i.reporter] = 0 - - # Don't count tickets which are already hidden - if len(bugdata[i.id]['hidden']): - continue - - submitters[i.reporter] += 1 - if (submitters[i.reporter] > maxpackages and - 'nobody@fedoraproject.org' not in i.reporter): - bugdata[i.id]['hidden'].append('excessive') - - # Now we need to look up the names of the users - for i in bugs: - if select_needsponsor(i, bugdata[i.id]): - usermap[i.reporter] = '' - - dbprint("Looking up {0} user names.".format(len(usermap))) - t = time.time() - for i in bz._proxy.User.get({'names': usermap.keys()})['users']: - usermap[i['name']] = i['real_name'] - dbprint("Done; took {0:.2f}.".format(time.time() - t)) - - # Now process the other three flags; not much special processing for them - querydata['o1'] = 'equals' -# for i in ['-', '+', '?']: - for i in ['-', '?']: - querydata['v1'] = 'fedora-review' + i - - dbprint("Looking up tickets with flag {0}.".format(i)) - t = time.time() - b1 = bz.query(querydata) - dbprint("Done; took {0:.2f}.".format(time.time() - t)) - - for bug in b1: - bugdata[bug.id] = {} - bugdata[bug.id]['hidden'] = [] - bugdata[bug.id]['blocks'] = [] - bugdata[bug.id]['depends'] = [] - bugdata[bug.id]['reviewflag'] = i - bugs += b1 - - bugs.sort(key=operator.attrgetter('id')) - - return [bugs, bugdata, usermap] - - # Need to generate reports: - # "Accepted" and closed - # "Accepted" but still open - # "Accepted" means either fedora-review+ or blocking FE-ACCEPT - # fedora-review- and closed - # fedora-review- but still open - # fedora-review? and still optn - # fedora-review? but closed - # Tickets awaiting review but which were hidden for some reason - # That should be all tickets in the Package Review component - - -def write_html(loader, template, data, dir, fname): - '''Load and render the given template with the given data to the given - filename in the specified directory.''' - tmpl = loader.load(template) - output = tmpl.generate(**data) - - path = os.path.join(dir, fname) - try: - f = open(path, "w") - except: - print("Error opening %s" % (path)) - sys.exit(1) - - for line in output.render().splitlines(): - try: - f.write(line.encode('utf8')) - except UnicodeError as e: - print(e.encoding, e.reason, e.object) - f.close() - - -# Selection functions (should all be predicates) -def select_hidden(bug, bugd): - if len(bugd['hidden']) > 0: - return 1 - return 0 - - -def select_merge(bug, bugd): - if (bugd['reviewflag'] == ' ' - and bug.bug_status != 'CLOSED' - and bug.short_desc.find('Merge Review') >= 0): - return 1 - return 0 - - -def select_needsponsor(bug, bugd): - wb = string.lower(bug.whiteboard) - if (bugd['reviewflag'] == ' ' - and 'needinfo' not in bugd['hidden'] - and NEEDSPONSOR in bugd['blocks'] - and LEGAL not in bugd['blocks'] - and bug.bug_status != 'CLOSED' - and nobody(bug.assigned_to) == '(Nobody)' - and wb.find('buildfails') < 0 - and wb.find('notready') < 0 - and wb.find('stalledsubmitter') < 0 - and wb.find('awaitingsubmitter') < 0): - return 1 - return 0 - - -def select_review(bug, bugd): - if bugd['reviewflag'] == '?': - return 1 - return 0 - - -def select_trivial(bug, bugd): - if (bugd['reviewflag'] == ' ' - and bug.bug_status != 'CLOSED' - and string.lower(bug.status_whiteboard).find('trivial') >= 0): - return 1 - return 0 - - -def select_epel(bug, bugd): - '''If someone assigns themself to a ticket, it's theirs regardless of - whether they set the flag properly or not.''' - if (bugd['reviewflag'] == ' ' - and bug.product == 'Fedora EPEL' - and bug.bug_status != 'CLOSED' - and len(bugd['hidden']) == 0 - and nobody(bug.assigned_to) == '(Nobody)' - and bug.short_desc.find('Merge Review') < 0): - return 1 - return 0 - - -def select_new(bug, bugd): - '''If someone assigns themself to a ticket, it's theirs regardless of - whether they set the flag properly or not.''' - if (bugd['reviewflag'] == ' ' - and bug.product == 'Fedora' - and bug.bug_status != 'CLOSED' - and len(bugd['hidden']) == 0 - and nobody(bug.assigned_to) == '(Nobody)' - and bug.short_desc.find('Merge Review') < 0): - return 1 - return 0 - - -def rowclass_plain(count): - if count % 2 == 1: - return 'bz_row_odd' - return 'bz_row_even' - - -# Yes, the even/odd classes look backwards, but it looks better this way -def rowclass_with_sponsor(bug, count): - rowclass = 'bz_row_odd' - if NEEDSPONSOR in bug['blocks']: - rowclass = 'bz_state_NEEDSPONSOR' - elif FEATURE in bug['blocks']: - rowclass = 'bz_state_FEATURE' - elif count % 2 == 1: - rowclass = 'bz_row_even' - return rowclass - - -# The data from a standard row in a bug list -def std_row(bug, rowclass): - alias = '' - if bug.alias: - alias = to_unicode(bug.alias[0]) - - return {'id': bug.id, - 'alias': alias, - 'assignee': nobody(to_unicode(bug.assigned_to)), - 'class': rowclass, - 'lastchange': human_time(bug.last_change_time), - 'status': bug.bug_status, - 'summary': to_unicode(bug.short_desc), - } - - -def hidden_reason(reasons): - r = '' - if 'buildfails' in reasons: - r += 'B ' - if 'blocked' in reasons: - r += 'D ' - if 'excessive' in reasons: - r += 'E ' - if 'legal' in reasons: - r += 'L ' - if 'needinfo' in reasons: - r += 'Ni ' - if 'notready' in reasons: - r += 'Nr ' - if 'stalled' in reasons: - r += 'S ' - - return r - - -# Report generators -def report_hidden(bugs, bugdata, loader, tmpdir, subs): - data = deepcopy(subs) - data['description'] = 'This page lists all review tickets are hidden from the main review queues' - data['title'] = 'Hidden reviews' - - for i in bugs: - if select_hidden(i, bugdata[i.id]): - rowclass = rowclass_with_sponsor(bugdata[i.id], data['count']) - data['bugs'].append(std_row(i, rowclass)) - data['bugs'][-1]['reason'] = hidden_reason(bugdata[i.id]['hidden']) - data['count'] += 1 - - write_html(loader, 'hidden.html', data, tmpdir, 'HIDDEN.html') - - return data['count'] - - -def report_review(bugs, bugdata, loader, tmpdir, subs): - data = deepcopy(subs) - data['description'] = 'This page lists tickets currently under review' - data['title'] = 'Tickets under review' - - for i in bugs: - if select_review(i, bugdata[i.id]): - rowclass = rowclass_plain(data['count']) - data['bugs'].append(std_row(i, rowclass)) - data['count'] += 1 - - write_html(loader, 'plain.html', data, tmpdir, 'REVIEW.html') - - return data['count'] - - -def report_trivial(bugs, bugdata, loader, tmpdir, subs): - data = deepcopy(subs) - data['description'] = 'This page lists review tickets marked as trivial' - data['title'] = 'Trivial reviews' - - for i in bugs: - if select_trivial(i, bugdata[i.id]): - rowclass = rowclass_plain(data['count']) - data['bugs'].append(std_row(i, rowclass)) - data['count'] += 1 - - write_html(loader, 'plain.html', data, tmpdir, 'TRIVIAL.html') - - return data['count'] - - -def report_merge(bugs, bugdata, loader, tmpdir, subs): - data = deepcopy(subs) - data['description'] = 'This page lists all merge review tickets which need reviewers' - data['title'] = 'Merge reviews' - - for i in bugs: - if select_merge(i, bugdata[i.id]): - rowclass = rowclass_plain(data['count']) - data['bugs'].append(std_row(i, rowclass)) - data['count'] += 1 - - write_html(loader, 'plain.html', data, tmpdir, 'MERGE.html') - - return data['count'] - - -def report_needsponsor(bugs, bugdata, loader, usermap, tmpdir, subs): - data = deepcopy(subs) - data['description'] = 'This page lists all new NEEDSPONSOR tickets (those without the fedora-review flag set).' - data['title'] = 'NEEDSPONSOR tickets' - curreporter = '' - curcount = 0 - oldest = {} - selected = [] - - for i in bugs: - if select_needsponsor(i, bugdata[i.id]): - selected.append(i) - - # Determine the oldest reported bug - for i in selected: - if i.reporter not in oldest: - oldest[i.reporter] = i.creation_time - elif i.creation_time < oldest[i.reporter]: - oldest[i.reporter] = i.creation_time - - selected.sort(key=reporter) - selected.sort(key=lambda a: oldest[a.reporter]) - - for i in selected: - rowclass = rowclass_plain(data['count']) - r = i.reporter - - if curreporter != r: - if (r in usermap and len(usermap[r])): - name = usermap[r] - else: - name = r - data['packagers'].append({'email': r, 'name': name, 'oldest': human_date(oldest[r]), 'bugs': []}) - curreporter = r - curcount = 0 - - data['packagers'][-1]['bugs'].append(std_row(i, rowclass)) - data['count'] += 1 - curcount += 1 - - write_html(loader, 'needsponsor.html', data, tmpdir, 'NEEDSPONSOR.html') - - return data['count'] - - -def report_epel(bugs, bugdata, loader, tmpdir, subs): - data = deepcopy(subs) - data['description'] = ('This page lists new, reviewable EPEL package review tickets.' - ' Tickets colored green require a sponsor.') - data['title'] = 'New EPEL package review tickets' - - curmonth = '' - curcount = 0 - - for i in bugs: - if select_epel(i, bugdata[i.id]): - if curmonth != yrmonth(i.creation_time): - if curcount > 0: - data['months'][-1]['month'] += (" (%d)" % curcount) - data['months'].append({'month': yrmonth(i.creation_time), 'bugs': []}) - curmonth = yrmonth(i.creation_time) - curcount = 0 - - rowclass = rowclass_with_sponsor(bugdata[i.id], curcount) - data['months'][-1]['bugs'].append(std_row(i, rowclass)) - data['count'] += 1 - curcount += 1 - - if curcount > 0: - data['months'][-1]['month'] += (" (%d)" % curcount) - - write_html(loader, 'bymonth.html', data, tmpdir, 'EPEL.html') - - return data['count'] - - -def report_new(bugs, bugdata, loader, tmpdir, subs): - data = deepcopy(subs) - data['description'] = ('This page lists new, reviewable Fedora package review tickets (excluding merge reviews).' - ' Tickets colored green require a sponsor.') - data['title'] = 'New package review tickets' - - curmonth = '' - curcount = 0 - - for i in bugs: - if select_new(i, bugdata[i.id]): - if curmonth != yrmonth(i.creation_time): - if curcount > 0: - data['months'][-1]['month'] += (" (%d)" % curcount) - data['months'].append({'month': yrmonth(i.creation_time), 'bugs': []}) - curmonth = yrmonth(i.creation_time) - curcount = 0 - - rowclass = rowclass_with_sponsor(bugdata[i.id], curcount) - data['months'][-1]['bugs'].append(std_row(i, rowclass)) - data['count'] += 1 - curcount += 1 - - if curcount > 0: - data['months'][-1]['month'] += (" (%d)" % curcount) - - write_html(loader, 'bymonth.html', data, tmpdir, 'NEW.html') - - return data['count'] - -if __name__ == '__main__': - options = parse_commandline() - verbose = options.verbose - config = parse_config(options.configfile) - if config['maxpackages']: - maxpackages = int(config['maxpackages']) - dbprint("Limiting to {0} packages".format(maxpackages)) - bz = bugzilla.RHBugzilla(url=config['url'], cookiefile=None, user=config['username'], password=config['password']) - t = time.time() - (bugs, bugdata, usermap) = run_query(bz) - querytime = time.time() - t - - # Don't bother running this stuff until the query completes, since it fails - # so often. - loader = TemplateLoader(options.templdir) - tmpdir = tempfile.mkdtemp(dir=options.dirname) - - # The initial set of substitutions that's shared between the report functions - subs = { - 'update': datetime.datetime.now().strftime('%Y-%m-%d %H:%M'), - 'querytime': querytime, - 'version': VERSION, - 'count': 0, - 'months': [], - 'packagers': [], - 'bugs': []} - args = {'bugs': bugs, 'bugdata': bugdata, 'loader': loader, 'tmpdir': tmpdir, 'subs': subs} - - t = time.time() - - subs['new'] = report_new(**args) - subs['epel'] = report_epel(**args) - subs['hidden'] = report_hidden(**args) - subs['needsponsor'] = report_needsponsor(usermap=usermap, **args) - subs['review'] = report_review(**args) - subs['trivial'] = report_trivial(**args) -# data['accepted_closed'] = report_accepted_closed(bugs, bugdata, loader, tmpdir) -# data['accepted_open'] = report_accepted_open(bugs, bugdata, loader, tmpdir) -# data['rejected_closed'] = report_rejected_closed(bugs, bugdata, loader, tmpdir) -# data['rejected_open'] = report_rejected_open(bugs, bugdata, loader, tmpdir) -# data['review_closed'] = report_review_closed(bugs, bugdata, loader, tmpdir) -# data['review_open'] = report_review_open(bugs, bugdata, loader, tmpdir) - subs['outputtime'] = time.time() - t - write_html(loader, 'index.html', subs, tmpdir, 'index.html') - - for filename in glob.glob(os.path.join(tmpdir, '*')): - newFilename = os.path.basename(filename) - os.rename(filename, os.path.join(options.dirname, newFilename)) - - os.rmdir(tmpdir) - - sys.exit(0) diff --git a/scripts/review-stats/templates/bottom.html b/scripts/review-stats/templates/bottom.html deleted file mode 100644 index ce42a0f..0000000 --- a/scripts/review-stats/templates/bottom.html +++ /dev/null @@ -1,28 +0,0 @@ -
- - - - - -
diff --git a/scripts/review-stats/templates/bymonth.html b/scripts/review-stats/templates/bymonth.html deleted file mode 100644 index c3386c5..0000000 --- a/scripts/review-stats/templates/bymonth.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - $title - - - - - - -
- -
-

$description
-Last Update: $update (v$version)
-There are $count tickets in this category

- - - - - - - - - - - - - - - - - - - - - - -
IDAliasLast ChangeSummary
${month['month']}
- ${bug['id']} - ${bug['alias']} ${bug['lastchange']}${bug['summary']}
-
-
- - - - diff --git a/scripts/review-stats/templates/hidden.html b/scripts/review-stats/templates/hidden.html deleted file mode 100644 index 6c3ca6c..0000000 --- a/scripts/review-stats/templates/hidden.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - $title - - - - - - -
- -
-

$description
-Last Update: $update (v$version)
-There are $count tickets in this category.

-

Key: B - build fails, D - open dependencies, E - too many packages submitted, L - Legal issues, Ni - NEEDINFO, Nr - ticket marked NotReady, S - ticket marked stalled

- - - - - - - - - - - - - - - - - - - - - -
IDAliasWhyLast ChangeSummary
- ${bug['id']} - ${bug['alias']} ${bug['reason']}${bug['lastchange']}${bug['summary']}
-
-
- - - diff --git a/scripts/review-stats/templates/index.html b/scripts/review-stats/templates/index.html deleted file mode 100644 index 66c240c..0000000 --- a/scripts/review-stats/templates/index.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - Cached Package Review Tracker - - -
- -
-

Cached Package Review Tracker

-These pages contain periodically generated reports with information on the -current state of all Fedora package review tickets. The following reports are -available: - - - - - - - - - - - - - - -
Trivial tickets ($trivial)All review tickets marked as trivial. New reviewers should look here for simple packages to review.
New tickets ($new)All review tickets without an assigned reviewer, sorted by submission date. Tickets colored green require a sponsor.
New EPEL tickets ($epel)All EPEL review tickets without an assigned reviewer, sorted by submission date. Tickets colored green require a sponsor.
Needsponsor tickets ($needsponsor)All review tickets where a sponsor is required, sorted by reporter. Please see this page for more information on sponsorship.
Hidden tickets ($hidden)Tickets which have been hidden for some reason. These tickets either depend on other review tickets which have not yet been closed, or are unreviewable for some reason. See this page for more information on the various states a review ticket can have.
Tickets under review ($review)All tickets currently under review.
-Last updated: ${update}, query time: ${'{0:0.3f}'.format(querytime)}s, output time: ${'{0:0.3f}'.format(outputtime)}s, version: ${version}. -
-

Quick Review Search

-
-
-

Enter a source package name to search for any relevant review tickets

- - - - - -
-
- -
-
-

Enter an email address to search for reviews they submitted

- - - - - - -
-
- -
-
-

Enter an email address to search for packages they reviewed

- - - - - - -
-
- -
-
-

Enter an email address to search for reviews on which they commented

- - - - - - -
-
-
-
- - - diff --git a/scripts/review-stats/templates/needsponsor.html b/scripts/review-stats/templates/needsponsor.html deleted file mode 100644 index 1b3593b..0000000 --- a/scripts/review-stats/templates/needsponsor.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - $title - - - - - - -
- -
-

$description

-Click the name to find all comments made in any review tickets.
-In parentheses is the date their oldest submission was made.
-Last Update: $update (v$version)
-There are $count tickets in this category
- - - - - - - - - - - - - - - - - - - - - - -
IDAliasLast ChangeSummary
- ${packager['name']} (${packager['oldest']}) -
- ${bug['id']} - ${bug['alias']} ${bug['lastchange']}${bug['summary']}
-
-
- - - diff --git a/scripts/review-stats/templates/plain.html b/scripts/review-stats/templates/plain.html deleted file mode 100644 index 65a49b6..0000000 --- a/scripts/review-stats/templates/plain.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - $title - - - - - - -
- -
-

$description
-Last Update: $update (v$version)
-There are $count tickets in this category.

- - - - - - - - - - - - - - - - - - - - - - - -
IDAliasAssigneeStatusLast ChangeSummary
- ${bug['id']} - ${bug['alias']} ${bug['assignee']}${bug['status']}${bug['lastchange']}${bug['summary']}
-
-
- - - diff --git a/scripts/run-scm/run-bzr b/scripts/run-scm/run-bzr deleted file mode 100755 index 1c89976..0000000 --- a/scripts/run-scm/run-bzr +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -umask 0002 -exec /usr/bin/bzr "$@" - diff --git a/scripts/run-scm/run-git b/scripts/run-scm/run-git deleted file mode 100755 index b71cc7e..0000000 --- a/scripts/run-scm/run-git +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/python -tt - -import sys, os - -commands = { - "git-receive-pack": "/usr/bin/git-receive-pack", - "git-upload-pack": "/usr/bin/git-upload-pack", - "bzr": "/usr/bin/run-bzr", - "hg": "/usr/bin/run-hg", - "mtn": "/usr/bin/run-mtn", - "svnserve": "/usr/bin/run-svnserve", - "scp": "/usr/bin/scp", -} - -if __name__ == '__main__': - orig_cmd = os.environ.get('SSH_ORIGINAL_COMMAND') - if not orig_cmd: - print "Need a command" - sys.exit(1) - allargs = orig_cmd.split() - try: - basecmd = os.path.basename(allargs[0]) - cmd = commands[basecmd] - except: - sys.stderr.write("Invalid command %s\n" % orig_cmd) - sys.exit(2) - - if basecmd in ('git-receive-pack', 'git-upload-pack'): - # git repositories need to be parsed specially - thearg = ' '.join(allargs[1:]) - if thearg[0] == "'" and thearg[-1] == "'": - thearg = thearg.replace("'","") - thearg = thearg.replace("\\'", "") - if thearg[:len('/git/')] != '/git/' or not os.path.isdir(thearg): - print "Invalid repository %s" % thearg - sys.exit(3) - allargs = [thearg] - elif basecmd in ('scp'): - numargs = len(allargs) - srcarg = numargs - 2 - destarg = numargs - 1 - thearg = ' '.join(allargs[srcarg:]) - firstLetter = allargs[destarg][0] - secondLetter = allargs[destarg][1] - uploadTarget = "/srv/web/releases/%s/%s/%s/" % (firstLetter, secondLetter, allargs[destarg]) - if thearg.find('/') != -1: - print "scp yourfile-1.2.tar.gz scm.fedorahosted.org:$YOURPROJECT # No trailing /" - sys.exit(4) - elif not os.path.isdir(uploadTarget): - print "http://fedorahosted.org/releases/%s/%s/%s does not exist!" % (firstLetter, secondLetter, allargs[destarg]) - sys.exit(5) - else: - newargs = [] - newargs.append(allargs[0]) - for arg in allargs[1:numargs - 1]: - newargs.append(arg) - newargs.append(uploadTarget) - os.execv(cmd, [cmd] + newargs[1:]) - sys.exit(1) - else: - allargs = allargs[1:] - os.execv(cmd, [cmd] + allargs) - sys.exit(1) - - diff --git a/scripts/run-scm/run-hg b/scripts/run-scm/run-hg deleted file mode 100755 index 0c5c6f1..0000000 --- a/scripts/run-scm/run-hg +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -umask 0002 -exec /usr/bin/hg "$@" - diff --git a/scripts/run-scm/run-mtn b/scripts/run-scm/run-mtn deleted file mode 100755 index 66902a0..0000000 --- a/scripts/run-scm/run-mtn +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -umask 0002 -exec /usr/bin/mtn "$@" - diff --git a/scripts/run-scm/run-svnserve b/scripts/run-scm/run-svnserve deleted file mode 100755 index e4f5b27..0000000 --- a/scripts/run-scm/run-svnserve +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -umask 0002 -exec /usr/bin/svnserve -t - diff --git a/scripts/selinux/selinux-overlord.py b/scripts/selinux/selinux-overlord.py deleted file mode 100644 index 40e0443..0000000 --- a/scripts/selinux/selinux-overlord.py +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/python -tt -# A tool to help monitor & manage SELinux using func -# -# Copyright (C) 2009 Red Hat, Inc. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# Authors: Luke Macken - -import time - -from pprint import pprint -from optparse import OptionParser -from func import jobthing -from func.overlord.client import Overlord - -status, stdout, stderr = range(3) - -class SELinuxOverlord(Overlord): - selinux_status = {'Enforcing': [], 'Permissive': [], 'Disabled': []} - selinux_minions = {} - - def __init__(self, minions): - super(SELinuxOverlord, self).__init__(minions) - self.minion_glob = minions - - def get_selinux_status(self): - results = self.command.run('/usr/sbin/getenforce') - - for minion, result in results.iteritems(): - if result[status]: - print "[%s] Error: %s" % (minion, result) - else: - self.selinux_status[result[stdout].strip()].append(minion) - self.selinux_minions[minion] = {} - - for key in self.selinux_status: - self.selinux_status[key].sort() - - return self.selinux_status - - def get_selinux_denials(self, minion): - overlord = Overlord(minion) - return overlord.command.run('ausearch -m AVC -ts this-week --input-logs')[minion] - - def dump_selinux_denials(self): - """ Write out all SELinux denials for all minions """ - for minion in self.selinux_minions: - result = self.get_selinux_denials(minion) - if not result[status]: - out = file(minion, 'w') - out.write(result[stdout]) - out.close() - print "[%s] Successfully collected this weeks AVCs" % minion - else: - if '\n' in result: - print "[%s] No AVCs Found" % minion - out = file(minion, 'w') - out.close() - else: - print "[%s] Problem running ausearch: %r" % (minion, result) - - def get_enforced_denials(self): - """ Get a quick list of SELinux denials on enforced hosts """ - for minion in self.selinux_status['Enforcing']: - overlord = Overlord(minion) - audit2allow = overlord.command.run('audit2allow -la') - for m, r in audit2allow.iteritems(): - if r[stdout].strip(): - print "[%s]\n%s\n" % (m, r[stdout]) - audit2allow = overlord.command.run('audit2allow -l -i /var/log/messages') - for m, r in audit2allow.iteritems(): - if r[stdout].strip(): - print "[%s]\n%s\n" % (m, r[stdout]) - - def upgrade_policy(self): - """ Update the SELinux policy across the given minions """ - print "Cleaning yum metadata..." - results = self.command.run('yum clean metadata') - for minion, result in results.items(): - if result[0]: - print "[%s] Problem cleaning yum cache: %s" % (minion, result[1]) - - async_client = Overlord(self.minion_glob, nforks=10, async=True) - - print "Upgrading SELinux policy..." - job_id = async_client.command.run('yum -y update selinux\*') - - running = True - - while running: - time.sleep(20) - return_code, results = async_client.job_status(job_id) - if return_code in (jobthing.JOB_ID_RUNNING, jobthing.JOB_ID_PARTIAL): - continue - elif return_code == jobthing.JOB_ID_FINISHED: - for minion, result in results.items(): - if result[0]: - print '[%s] Problem upgrading policy: %s' % (minion, result[1]) - if 'Updated: selinux-policy' in result[1]: - ver = result[1].split('Updated: ')[-1].split()[1].split(':')[1] - print "[%s] selinux-policy successfully upgraded to %s" % (minion, ver) - else: - print "selinux-policy *not* upgraded on %s: %s" % (minion, result[1]) - running = False - elif return_code == jobthing.JOB_ID_LOST_IN_SPACE: - print "Job %s lost in space: %s" % (job_id, results) - else: - print "Unknown return code %s: %s" % (return_code, results) - - print "SELinux policy upgrade complete!" - - -if __name__ == '__main__': - parser = OptionParser('usage: %prog [options] [minion1[;minion2]]') - parser.add_option('-s', '--status', action='store_true', dest='status', - help='Display the SELinux status of all minions') - parser.add_option('-e', '--enforced-denials', action='store_true', - dest='enforced_denials', help='Display enforced denials') - parser.add_option('-d', '--dump-avcs', action='store_true', - dest='dump_avcs', help='Dump AVCs to disk') - parser.add_option('-u', '--upgrade-policy', action='store_true', - dest='upgrade', help='Upgrade SELinux policy') - opts, args = parser.parse_args() - - minions = len(args) > 0 and ';'.join(args) or '*' - overlord = SELinuxOverlord(minions) - - print "Determining SELinux status on minions: %s" % minions - pprint(overlord.get_selinux_status()) - - if opts.enforced_denials: - print "Finding enforced SELinux denials..." - overlord.get_enforced_denials() - if opts.dump_avcs: - print "Dumping SELinux denials to disk..." - overlord.dump_selinux_denials() - if opts.upgrade: - overlord.upgrade_policy() - -# vim: ts=4 sw=4 expandtab ai diff --git a/scripts/site-tests/fas.py b/scripts/site-tests/fas.py deleted file mode 100644 index dea4020..0000000 --- a/scripts/site-tests/fas.py +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import getpass -import mechanize -import sys - -from optparse import OptionParser -from mechanize import Browser, LinkNotFoundError -from urllib import urlencode -from urllib2 import HTTPError -from tests import * - -parser = OptionParser() - -parser.add_option('-u', '--username', - dest = 'username', - default = getpass.getuser(), - metavar = 'username', - help = 'Username to connect with (default: %default)') -parser.add_option('-p', '--password', - dest = 'password', - default = None, - metavar = 'password', - help = 'Password to connect with (Will prompt if not specified') -parser.add_option('-b', '--baseurl', - dest = 'baseurl', - default = 'https://admin.fedoraproject.org/accounts/login', - metavar = 'baseurl', - help = 'Url to fas (default: %default)') -parser.add_option('-d', '--debug', - dest = 'debug', - default = False, - action = 'store_true', - help = 'Url (default: False)') -(opts, args) = parser.parse_args() - -username = opts.username -headers = Headers(debug=opts.debug) - -if not opts.password: - password = getpass.getpass('FAS password for %s: ' % username) -else: - password = opts.password -del getpass - -print -print -print "Starting tests on FAS" -print " Note: Results shown in terms of test success. Anything not OK should be looked at" -print - -b = Browser() -b.set_handle_robots(False) -data = urlencode({'user_name': username, - 'password': password, - 'login': 'Login'}) -data_bad = urlencode({'user_name': username, - 'password': 'badpass', - 'login': 'Login'}) - - -print 'Logging in bad password:', -try: - r = b.open(opts.baseurl, data=data_bad) -except HTTPError, e: - print OK -else: - print FAILED - -print 'Logging in good password:', -try: - r = b.open(opts.baseurl, data=data) -except HTTPError, e: - print '%s - %s' % (FAILED, e) -else: - print OK -headers.check(r._headers, 3000000) - -print 'Testing Links:' -link_list = ['Home', 'My Account', 'New Group', 'Group List', 'Join a Group', 'About'] -for link in link_list: - print '\t %s:' % link, - try: - r = b.follow_link(text_regex=r'^%s$' % link) - except LinkNotFoundError: - print FAILED - print OK - headers.check(r._headers, 3000000) - -csrf=b.geturl().split('?')[1] - -print 'Editing Account:' -r = b.follow_link(text_regex=r'^My Account$') -r = b.follow_link(text_regex=r'edit') -headers.check(r._headers, 3000000) -b.select_form(nr=1) -print '\tHuman Name: %s' % b['human_name'] -print '\temail: %s' % b['email'] -print '\tTelephone: %s' % b['telephone'] -print '\tComments: %s' % b['comments'] -old_comments = b['comments'] -print '\tChanging Comments Field:', -b['comments'] = 'Changing for FAS test by %s' % username -r = b.submit() -print OK -headers.check(r._headers, 4000000) -r = b.follow_link(text_regex=r'edit') -headers.check(r._headers, 3000000) -print '\tVerifying comments field:', -b.select_form(nr=1) -if b['comments'] == 'Changing for FAS test by %s' % username: - print OK -else: - print '%s - Old comment was: %s' % (FAILED - old_comments) -r = b.submit() -headers.check(r._headers, 3000000) -print '\tResetting comments field to old value:', -r = b.follow_link(text_regex=r'edit') -b.select_form(nr=1) -b['comments'] = old_comments -r = b.submit() -print OK -headers.check(r._headers, 4000000) -print "\t**This should have generated an email to you. Please verify that" - -print 'CSRF:', -try: - b.open('https://admin.fedoraproject.org/accounts/json/fas_client/user_data') -except HTTPError, e: - r = b.open('https://admin.fedoraproject.org/accounts/json/fas_client/user_data?%s' % csrf) - print OK -headers.check(r._headers, 4000000) - -print 'User Data (no memcached):', -r = b.open('https://admin.fedoraproject.org/accounts/json/fas_client/user_data?%s&force_refresh=1' % csrf) -print OK -headers.check(r._headers, 4000000) -print '%s - %s' % is_normal(r.readlines()[0].count('username'), 23000) - -print 'User Data (with memcached):', -r = b.open('https://admin.fedoraproject.org/accounts/json/fas_client/user_data?%s' % csrf) -print '%s - %s' % is_normal(r.readlines()[0].count('username'), 23000) -headers.check(r._headers, 4000000) diff --git a/scripts/site-tests/mirrormanager.py b/scripts/site-tests/mirrormanager.py deleted file mode 100644 index 9c59e70..0000000 --- a/scripts/site-tests/mirrormanager.py +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import getpass -import mechanize -import sys - -from optparse import OptionParser -from mechanize import Browser, LinkNotFoundError -from urllib import urlencode -from urllib2 import HTTPError -from tests import * - -parser = OptionParser() - -parser.add_option('-u', '--username', - dest = 'username', - default = getpass.getuser(), - metavar = 'username', - help = 'Username to connect with (default: %default)') -parser.add_option('-p', '--password', - dest = 'password', - default = None, - metavar = 'password', - help = 'Password to connect with (Will prompt if not specified') -parser.add_option('-b', '--baseurl', - dest = 'baseurl', - default = 'https://admin.fedoraproject.org/mirrormanager/', - metavar = 'baseurl', - help = 'Url to mirrormanager (default: %default)') -parser.add_option('-d', '--debug', - dest = 'debug', - default = False, - action = 'store_true', - help = 'Url (default: False)') -(opts, args) = parser.parse_args() - -username = opts.username -headers = Headers(debug=opts.debug) - -if not opts.password: - password = getpass.getpass('FAS password for %s: ' % username) -else: - password = opts.password -del getpass - -print -print -print "Starting tests on MirrorManager" -print " Note: Results shown in terms of test success. Anything not OK should be looked at" -print - -b = Browser() -b.set_handle_robots(False) -data = urlencode({'user_name': username, - 'password': password, - 'login': 'Login'}) -data_bad = urlencode({'user_name': username, - 'password': 'badpass', - 'login': 'Login'}) - - -print 'Logging in bad password:', -try: - r = b.open(opts.baseurl, data=data_bad) -except HTTPError, e: - print OK -else: - print FAILED - -print 'Logging in good password:', -try: - r = b.open(opts.baseurl, data=data) -except HTTPError, e: - print '%s - %s' % (FAILED, e) -else: - print OK -headers.check(r._headers, 3000000) - -print 'Getting Link Count:', -hosts = sites = 0 -l = b.links() -try: - while 1: - link = l.next() - if link.url.startswith('/mirrormanager/site/'): - sites += 1 - if link.url.startswith('/mirrormanager/host/'): - hosts += 1 -except StopIteration: - pass -print OK -print '\tHosts %s - %s' % is_normal(hosts, 580) -print '\tSites %s - %s' % is_normal(sites, 555) - - -print 'Creating Site:', -r = b.follow_link(text_regex=r'Add Site') -b.select_form(name='form') -b['name'] = 'Fedora Admin Test Site - %s' % username -b['password'] = 'Test' -b['orgUrl'] = 'http://fedoraproject.org/' -b['downstreamComments'] = 'This is a test site, it should not exist. Please let admin@fedoraproject.org know it is here' -r = b.submit() -print OK - -headers.check(r._headers, 3000000) - -print 'Verifying Site:', -b.follow_link(text_regex=r'Main') -b.follow_link(text_regex=r'Fedora Admin Test Site - %s' % username) -b.select_form(name='form') -if b['name'] == 'Fedora Admin Test Site - %s' % username: - print '%s - %s' % (OK, b['name']) -else: - print '%s - %s' % (FAILED, b['name']) - sys.exit(1) - -print 'Deleting Site:', -r = b.follow_link(text_regex=r'Delete Site') -print OK -headers.check(r._headers, 3000000) - -print 'Verifying Deletion:', -r = b.follow_link(text_regex=r'Main') -try: - b.follow_link(text_regex=r'Fedora Admin Test Site - %s' % username) -except LinkNotFoundError: - print OK -else: - print '%s - Site still exists! Please examine' % FAILED -headers.check(r._headers, 3000000) - - -print 'Verifying Public List:' -r = b.open('http://mirrors.fedoraproject.org/publiclist/') -for version in [10, 11, 'rawhide']: - print 'Looking for %s' % version, - print '%s - %s' % (OK, b.find_link(text_regex=r'^%s$' % version).url) -headers.check(r._headers, 3000) - - -print 'Verifying mirrorlist:' -print '\tgeneric test:', -r = b.open('http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-11&arch=i386') -generic_count = len(r.readlines()) - 1 -print '\t %s - %s' % is_normal(generic_count, 50) -headers.check(r._headers, 300000) - -print '\tglobal test:', -r = b.open('http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-11&arch=i386&country=global') -generic_count = len(r.readlines()) - 1 -print '\t %s - %s' % is_normal(generic_count, 170) -headers.check(r._headers, 300000) - -print '\tgeoipv4 test:', -r = b.open('http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-11&arch=i386&ip=64.34.163.94') -if r.readline().count('country = US'): - print OK -else: - print FAILED -headers.check(r._headers, 300000) - -print '\tgeoipv6 test:', -r = b.open('http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-11&arch=i386&ip=2610:28:200:1:216:3eff:fe62:9fdd') -if r.readline().count('country = US'): - print OK -else: - print FAILED -headers.check(r._headers, 300000) - -print '\tASN test:', -r = b.open('http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-11&arch=i386&ip=64.34.163.94') -tmp = r.readline() -#if r.readline().count('Using ASN 30099') and r.readline().count('serverbeach1'): -if tmp.count('Using ASN 30099') and tmp.count('serverbeach1'): - print OK -else: - print FAILED - print tmp -headers.check(r._headers, 300000) diff --git a/scripts/site-tests/tests.py b/scripts/site-tests/tests.py deleted file mode 100644 index 96dd578..0000000 --- a/scripts/site-tests/tests.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -color = { 'red' : '\x1b[0;31m', - 'green' : '\x1b[0;32m', - 'yellow' : '\x1b[1;33m', - 'white' : '\x1b[1;37m', - 'bold' : '\x1b[1m', - 'nobold' : '\x1b[22m', - 'default' : '\x1b[39m', - 'reset' : '\x1b[0m' } -OK = "%sOK%s" % (color['green'], color['reset']) -FAILED = "%sFAILED%s" % (color['red'], color['reset']) -WARNING = "%sWARNING%s" % (color['yellow'], color['reset']) - -def is_normal(count, baseline, percent='10'): - ''' Pass count and baseline and compare. Throws warning if not in acceptable range''' - baseline = float(baseline) - diff = ((count / baseline) * 100) - 100 - if diff < 0: - diff = diff * -1 - if diff > 10: - return (WARNING, '%s is greater then %%%.4s of baseline. (Maybe baseline needs an update?)', (count, diff)) - else: - return (OK, '%s is within %%%.4s of baseline' % (count, diff)) - - -class Headers(): - debug=None - def __init__(self, debug=None): - self.debug=debug - return - - def check(self, headers, baseline): - ''' Check the headers of a page for slowness or other errors ''' - if self.debug: - print "\tProxy time: %s" % headers['proxytime'].split('=')[1] - print "\tProxy server: %s" % headers['proxyserver'] - print "\tApp time: %s" % headers['apptime'].split('=')[1] - print "\tApp server: %s" % headers['appserver'] - - if int(headers['proxytime'].split('=')[1]) > baseline: - print "\t%s Proxy Time longer than baseline %s > %s" % (WARNING, headers['proxytime'].split('=')[1], baseline) - return (WARNING, headers['proxytime'].split('=')[1]) \ No newline at end of file diff --git a/scripts/spam-o-epel/README b/scripts/spam-o-epel/README deleted file mode 100644 index 661d91d..0000000 --- a/scripts/spam-o-epel/README +++ /dev/null @@ -1,3 +0,0 @@ -Runs dep checking against epel. Must edit scripts to specify the location of -RHEL4/5 or CentOS4/5 - diff --git a/scripts/spam-o-epel/spam-o-epel b/scripts/spam-o-epel/spam-o-epel deleted file mode 100755 index 7cc4759..0000000 --- a/scripts/spam-o-epel/spam-o-epel +++ /dev/null @@ -1,300 +0,0 @@ -#!/usr/bin/python - -import os -import shutil -from stat import * -import string -import sys -import tempfile -import re -from optparse import OptionParser -from yum.constants import * -from yum.misc import getCacheDir -import urllib -import koji - -# HAAACK -import imp -sys.modules['repoclosure'] = imp.load_source("repoclosure","/usr/bin/repoclosure") -import repoclosure - -owners = {} -deps = {} - -kojihost = "http://koji.fedoraproject.org/kojihub" - -myPackages = {} -url = urllib.urlopen('http://cvs.fedoraproject.org/viewcvs/*checkout*/owners/owners.epel.list') -for p in url: - if p.startswith('#'): - continue - myPackages[p.split('|')[1]] = p.split('|')[3] - -def generateConfig(distdir, arch): - if not os.path.exists(os.path.join(distdir, arch)): - return None - if arch == 'source' or arch == 'SRPMS': - return None - if os.path.exists(os.path.join(distdir, arch, "os")): - subdir = "os" - else: - subdir = "" - if not os.path.exists(os.path.join(distdir, arch, subdir, "repodata", "repomd.xml")): - return None - - (fd, conffile) = tempfile.mkstemp() - if distdir.find('5') != -1: - confheader = """ -[main] -debuglevel=2 -logfile=/var/log/yum.log -pkgpolicy=newest -distroverpkg=fedora-release -reposdir=/dev/null -keepcache=0 - -[RHEL5-Server] -name=RHEL - 5 (Server) -baseurl=file:///epel/RHEL5/%s/Server/ -enabled=1 - -[RHEL5-Client] -name=RHEL - 5 (Client) -baseurl=file:///epel/RHEL5/%s/Client/ -enabled=1 - -[epel-%s] -name=EPEL - %s -baseurl=file://%s/%s/%s -enabled=1 - -""" % (arch, arch, arch, arch, distdir, arch, subdir) - elif distdir.find('4') != -1: - confheader = """ -[main] -debuglevel=2 -logfile=/var/log/yum.log -pkgpolicy=newest -distroverpkg=fedora-release -reposdir=/dev/null -keepcache=0 - -[RHEL4] -name=RHEL - 4 -baseurl=file:///epel/RHEL4/en/os/RPMS/%s/ -enabled=1 - -#[RHEL5-Client] -#name=RHEL - 5 (Client) -#baseurl=file:///epel/RHEL5/%s/Client/ -#enabled=1 - -[epel-%s] -name=EPEL - %s -baseurl=file://%s/%s/%s -enabled=1 - -""" % (arch, arch, arch, arch, distdir, arch, subdir) - os.write(fd,confheader) - os.close(fd) - return conffile - - -def libmunge(match): - if match.groups()[1].isdigit(): - return "%s%d" % (match.groups()[0],int(match.groups()[1])+1) - else: - return "%s%s" % (match.groups()[0],match.groups()[1]) - -def getOwner(pkg): - if pkg == None: - return None -# session = koji.ClientSession(kojihost, {}) - try: -# p = session.listPackages(tagID = "dist-rawhide", pkgID = pkg, inherited = True) - p = myPackages[pkg] - except: - return None - if p: - #return "%s@fedoraproject.org" % (p[0]['owner_name'],) - return p - else: - return None - -def addOwner(list, pkg): - if list.get(pkg): - return True - - if list.has_key(pkg): - return False - - f = getOwner(pkg) - list[pkg] = f - if f: - return True - return False - -def getSrcPkg(pkg): - if pkg.arch == 'src': - return pkg.name - srpm = pkg.returnSimple('sourcerpm') - if not srpm: - return None - srcpkg = string.join(srpm.split('-')[:-2],'-') - return srcpkg - -def printableReq(pkg, dep): - (n, f, v) = dep - req = '%s' % n - if f: - flag = LETTERFLAGS[f] - req = '%s %s' % (req, flag) - if v: - req = '%s %s' % (req, v) - return "%s requires %s" % (pkg, req,) - -def assignBlame(resolver, dep, guilty): - def __addpackages(sack): - for package in sack.returnPackages(): - p = getSrcPkg(package) - if addOwner(guilty, p): - list.append(p) - - # Given a dep, find potential responsible parties - - list = [] - - # The dep itself - if addOwner(guilty, dep): - list.append(dep) - - # Something that provides the dep - __addpackages(resolver.whatProvides(dep, None, None)) - - # Libraries: check for variant in soname - if re.match("lib.*\.so\.[0-9]+",dep): - new = re.sub("(lib.*\.so\.)([0-9])+",libmunge,dep) - __addpackages(resolver.whatProvides(new, None, None)) - libname = dep.split('.')[0] - __addpackages(resolver.whatProvides(libname, None, None)) - - return list - -def generateSpam(pkgname, sendmail = True): - - package = deps[pkgname] - guilty = owners[pkgname] - conspirators = [] - - for s in package.keys(): - subpackage = package[s] - for arch in subpackage.keys(): - brokendeps = subpackage[arch] - for dep in brokendeps: - for blame in dep[2]: - party = owners[blame] - if party != guilty and party not in conspirators: - conspirators.append(party) - - foo = """ - -%s has broken dependencies in the EPEL: -""" % (pkgname,) - - for s in package.keys(): - subpackage = package[s] - for arch in subpackage.keys(): - foo = foo + "On %s:\n" % (arch) - brokendeps = subpackage[arch] - for dep in brokendeps: - foo = foo + "\t%s\n" % printableReq(dep[0],dep[1]) - - foo = foo + "Please resolve this as soon as possible.\n\n" - - command = '/bin/mail -s "Broken dependencies: %s" %s' % (pkgname, guilty) - if conspirators: - command = command + " -c %s" % (string.join(conspirators,","),) - - if sendmail: - mailer = os.popen(command, 'w') - mailer.write(foo) - mailer.close() - else: - print """ -To: %s -Cc: %s -Subject: Broken dependencies: %s - -""" % (guilty, string.join(conspirators,','), pkgname) - - print foo - -def doit(dir, mail=True): - for arch in os.listdir(dir): - conffile = generateConfig(dir, arch) - if not conffile: - continue - if arch == 'i386': - carch = 'i686' - elif arch == 'ppc': - carch = 'ppc64' - elif arch == 'sparc': - carch = 'sparc64v' - else: - carch = arch - my = repoclosure.RepoClosure(config = conffile, arch = [carch]) - cachedir = getCacheDir() - my.repos.setCacheDir(cachedir) - my.readMetadata() - baddeps = my.getBrokenDeps(newest = False) - pkgs = baddeps.keys() - tmplist = [(x.returnSimple('name'), x) for x in pkgs] - tmplist.sort() - pkgs = [x for (key, x) in tmplist] - if len(pkgs) > 0: - print "Broken deps for %s" % (arch,) - print "----------------------------------------------------------" - for pkg in pkgs: - srcpkg = getSrcPkg(pkg) - - addOwner(owners, srcpkg) - - if not deps.has_key(srcpkg): - deps[srcpkg] = {} - - pkgid = "%s-%s" % (pkg.name, pkg.printVer()) - - if not deps[srcpkg].has_key(pkgid): - deps[srcpkg][pkgid] = {} - - broken = [] - for (n, f, v) in baddeps[pkg]: - print "\t%s" % printableReq(pkg, (n, f, v)) - - blamelist = assignBlame(my, n, owners) - - broken.append( (pkg, (n, f, v), blamelist) ) - - deps[srcpkg][pkgid][arch] = broken - - print "\n\n" - os.unlink(conffile) - shutil.rmtree(cachedir, ignore_errors = True) - - pkglist = deps.keys() - for pkg in pkglist: - generateSpam(pkg, mail) - -if __name__ == '__main__': - - parser = OptionParser("usage: %prog [options] ") - parser.add_option("--nomail", action="store_true") - (options, args) = parser.parse_args(sys.argv[1:]) - if len(args) != 1: - parser.error("incorrect number of arguments") - sys.exit(1) - if options.nomail: - mail = False - else: - mail = True - doit(args[0], mail) diff --git a/scripts/spam-o-epel/spam-o-epel-testing b/scripts/spam-o-epel/spam-o-epel-testing deleted file mode 100755 index 9408475..0000000 --- a/scripts/spam-o-epel/spam-o-epel-testing +++ /dev/null @@ -1,310 +0,0 @@ -#!/usr/bin/python - -import os -import shutil -from stat import * -import string -import sys -import tempfile -import re -from optparse import OptionParser -from yum.constants import * -from yum.misc import getCacheDir -import urllib -import koji - -# HAAACK -import imp -sys.modules['repoclosure'] = imp.load_source("repoclosure","/usr/bin/repoclosure") -import repoclosure - -owners = {} -deps = {} - -kojihost = "http://koji.fedoraproject.org/kojihub" - -myPackages = {} -url = urllib.urlopen('http://cvs-int/viewcvs/*checkout*/owners/owners.epel.list') -for p in url: - if p.startswith('#'): - continue - myPackages[p.split('|')[1]] = p.split('|')[3] - -def generateConfig(distdir, arch): - if not os.path.exists(os.path.join(distdir, arch)): - return None - if arch == 'source' or arch == 'SRPMS': - return None - if os.path.exists(os.path.join(distdir, arch, "os")): - subdir = "os" - else: - subdir = "" - if not os.path.exists(os.path.join(distdir, arch, subdir, "repodata", "repomd.xml")): - return None - - (fd, conffile) = tempfile.mkstemp() - if distdir.find('5') != -1: - confheader = """ -[main] -debuglevel=2 -logfile=/var/log/yum.log -pkgpolicy=newest -distroverpkg=fedora-release -reposdir=/dev/null -keepcache=0 - -[EPEL-5] -name=EPEL - 5 -baseurl=file:///pub/epel/testing/5/%s/ -enabled=1 - -[RHEL5-Server] -name=RHEL - 5 (Server) -baseurl=file:///epel/RHEL5/%s/Server/ -enabled=1 - -[RHEL5-Client] -name=RHEL - 5 (Client) -baseurl=file:///epel/RHEL5/%s/Client/ -enabled=1 - -[epel-%s] -name=EPEL - %s -baseurl=file://%s/%s/%s -enabled=1 - -""" % (arch, arch, arch, arch, arch, distdir, arch, subdir) - elif distdir.find('4') != -1: - confheader = """ -[main] -debuglevel=2 -logfile=/var/log/yum.log -pkgpolicy=newest -distroverpkg=fedora-release -reposdir=/dev/null -keepcache=0 - -[EPEL-4] -name=EPEL - 4 -baseurl=file:///pub/epel/testing/4/%s/ -enabled=1 - -[RHEL4] -name=RHEL - 4 -baseurl=file:///epel/RHEL4/en/os/RPMS/%s/ -enabled=1 - -#[RHEL5-Client] -#name=RHEL - 5 (Client) -#baseurl=file:///epel/RHEL5/%s/Client/ -#enabled=1 - -[epel-%s] -name=EPEL - %s -baseurl=file://%s/%s/%s -enabled=1 - -""" % (arch, arch, arch, arch, distdir, arch, subdir) - os.write(fd,confheader) - os.close(fd) - return conffile - - -def libmunge(match): - if match.groups()[1].isdigit(): - return "%s%d" % (match.groups()[0],int(match.groups()[1])+1) - else: - return "%s%s" % (match.groups()[0],match.groups()[1]) - -def getOwner(pkg): - if pkg == None: - return None -# session = koji.ClientSession(kojihost, {}) - try: -# p = session.listPackages(tagID = "dist-rawhide", pkgID = pkg, inherited = True) - p = myPackages[pkg] - except: - return None - if p: - #return "%s@fedoraproject.org" % (p[0]['owner_name'],) - return p - else: - return None - -def addOwner(list, pkg): - if list.get(pkg): - return True - - if list.has_key(pkg): - return False - - f = getOwner(pkg) - list[pkg] = f - if f: - return True - return False - -def getSrcPkg(pkg): - if pkg.arch == 'src': - return pkg.name - srpm = pkg.returnSimple('sourcerpm') - if not srpm: - return None - srcpkg = string.join(srpm.split('-')[:-2],'-') - return srcpkg - -def printableReq(pkg, dep): - (n, f, v) = dep - req = '%s' % n - if f: - flag = LETTERFLAGS[f] - req = '%s %s' % (req, flag) - if v: - req = '%s %s' % (req, v) - return "%s requires %s" % (pkg, req,) - -def assignBlame(resolver, dep, guilty): - def __addpackages(sack): - for package in sack.returnPackages(): - p = getSrcPkg(package) - if addOwner(guilty, p): - list.append(p) - - # Given a dep, find potential responsible parties - - list = [] - - # The dep itself - if addOwner(guilty, dep): - list.append(dep) - - # Something that provides the dep - __addpackages(resolver.whatProvides(dep, None, None)) - - # Libraries: check for variant in soname - if re.match("lib.*\.so\.[0-9]+",dep): - new = re.sub("(lib.*\.so\.)([0-9])+",libmunge,dep) - __addpackages(resolver.whatProvides(new, None, None)) - libname = dep.split('.')[0] - __addpackages(resolver.whatProvides(libname, None, None)) - - return list - -def generateSpam(pkgname, sendmail = True): - - package = deps[pkgname] - guilty = owners[pkgname] - conspirators = [] - - for s in package.keys(): - subpackage = package[s] - for arch in subpackage.keys(): - brokendeps = subpackage[arch] - for dep in brokendeps: - for blame in dep[2]: - party = owners[blame] - if party != guilty and party not in conspirators: - conspirators.append(party) - - foo = """ - -%s has broken dependencies in the EPEL: -""" % (pkgname,) - - for s in package.keys(): - subpackage = package[s] - for arch in subpackage.keys(): - foo = foo + "On %s:\n" % (arch) - brokendeps = subpackage[arch] - for dep in brokendeps: - foo = foo + "\t%s\n" % printableReq(dep[0],dep[1]) - - foo = foo + "Please resolve this as soon as possible.\n\n" - - command = '/bin/mail -s "Broken dependencies: %s" %s' % (pkgname, guilty) - if conspirators: - command = command + " -c %s" % (string.join(conspirators,","),) - - if sendmail: - mailer = os.popen(command, 'w') - mailer.write(foo) - mailer.close() - else: - print """ -To: %s -Cc: %s -Subject: Broken dependencies: %s - -""" % (guilty, string.join(conspirators,','), pkgname) - - print foo - -def doit(dir, mail=True): - for arch in os.listdir(dir): - conffile = generateConfig(dir, arch) - if not conffile: - continue - if arch == 'i386': - carch = 'i686' - elif arch == 'ppc': - carch = 'ppc64' - elif arch == 'sparc': - carch = 'sparc64v' - else: - carch = arch - my = repoclosure.RepoClosure(config = conffile, arch = [carch]) - cachedir = getCacheDir() - my.repos.setCacheDir(cachedir) - my.readMetadata() - baddeps = my.getBrokenDeps(newest = False) - pkgs = baddeps.keys() - tmplist = [(x.returnSimple('name'), x) for x in pkgs] - tmplist.sort() - pkgs = [x for (key, x) in tmplist] - if len(pkgs) > 0: - print "Broken deps for %s" % (arch,) - print "----------------------------------------------------------" - for pkg in pkgs: - srcpkg = getSrcPkg(pkg) - - addOwner(owners, srcpkg) - - if not deps.has_key(srcpkg): - deps[srcpkg] = {} - - pkgid = "%s-%s" % (pkg.name, pkg.printVer()) - - if not deps[srcpkg].has_key(pkgid): - deps[srcpkg][pkgid] = {} - - broken = [] - for (n, f, v) in baddeps[pkg]: - print "\t%s" % printableReq(pkg, (n, f, v)) - - blamelist = assignBlame(my, n, owners) - - broken.append( (pkg, (n, f, v), blamelist) ) - - deps[srcpkg][pkgid][arch] = broken - - print "\n\n" - os.unlink(conffile) - shutil.rmtree(cachedir, ignore_errors = True) - - pkglist = deps.keys() - for pkg in pkglist: - generateSpam(pkg, mail) - -if __name__ == '__main__': - - parser = OptionParser("usage: %prog [options] ") - parser.add_option("--nomail", action="store_true") - (options, args) = parser.parse_args(sys.argv[1:]) - if len(args) != 1: - parser.error("incorrect number of arguments") - sys.exit(1) - if options.nomail: - mail = False - else: - mail = True - doit(args[0], mail) diff --git a/scripts/tg-support/restart-memhogs.sh b/scripts/tg-support/restart-memhogs.sh deleted file mode 100644 index 3f72e15..0000000 --- a/scripts/tg-support/restart-memhogs.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# Author: Toshio Kuratomi -# Script to restart supervisor controlled applications if their memory usage -# goes over a preset limit. -# -# This script is run on alternate app servers, checking the memory usage of -# each app. If they exceed the maximum memory we've alloted to them, the -# script tells supervisor to restart the app. - -# APPS and MEMLIMIT map a supervisor appname to a maximal memory usage. -# Note: Only put load balanced apps managed by TG in this var. -APPS=('mirrorlist_server' 'mirrormanager' 'packagedb' 'smolt' 'fas') -MEMLIMIT=(250000 800000 500000 200000 1000000) -# These aren't load balanced yet -#APPS=("${APPS[@]}" 'transifex' 'bodhi') -#MEMLIMIT=(${MEMLIMIT[@]} 250000 500000) - -for ((i = 0 ; i < ${#APPS[@]} ;i++ )) ; do - # Supervisor knows the PID of the processes - PID=`supervisorctl status ${APPS[$i]} | sed -e 's/.*pid \([0-9]\+\),.*/\1/'` - # Ignore crashed apps or apps not present on this server - if test `echo "$PID" | egrep '^[0-9]+$'` ; then - # We use Resident Set Size to determine if the app is using too much memory - RSS=`ps -eo pid,rss|egrep -w "^[[:space:]]*$PID"| awk '// { print $2 }'` - if test "$RSS" -gt ${MEMLIMIT[$i]} ; then - # Use supervisor to restart the app - echo "Restarting ${APPS[$i]} $PID RSS: $RSS" - supervisorctl restart ${APPS[$i]} - fi - fi -done diff --git a/scripts/tg-support/startTurboGearsApp.sh b/scripts/tg-support/startTurboGearsApp.sh deleted file mode 100644 index ceeb89a..0000000 --- a/scripts/tg-support/startTurboGearsApp.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# Starts a turbogears application - -if [ ! $1 ] -then - echo "Please provide a path to the turbogears startup file and an optional environment" - exit 1 -fi - -DIR=$(/usr/bin/dirname $1) -cd $DIR -pkill -f "python $1 $2" - -exec /usr/bin/python $1 $2 - diff --git a/scripts/upload.cgi/README b/scripts/upload.cgi/README deleted file mode 100644 index 4678a82..0000000 --- a/scripts/upload.cgi/README +++ /dev/null @@ -1,27 +0,0 @@ -Tell us if you have a better installation or one that is proven to work. -Also please let us know if there is a better or more efficient way to do -what we're trying to do here. Technologies change over time, keep us up -to date ;) - -Alias /repo/pkgs/ /repo/pkgs/ - - - SSLVerifyClient optional - SSLVerifyDepth 1 - SSLOptions +StrictRequire +StdEnvVars +OptRenegotiate - # require that the access comes from internal or that - # the client auth cert was created by us and signed by us - SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \ - and %{SSL_CLIENT_S_DN_O} eq "Fedora Project" \ - and %{SSL_CLIENT_I_DN_O} eq "Fedora Project" \ - and %{SSL_CLIENT_I_DN_OU} eq "Upload Files" ) - - - - SetHandler cgi-script - Options ExecCGI - Order Allow,Deny - Allow from all - SSLRequireSSL - - diff --git a/scripts/upload.cgi/upload.cgi b/scripts/upload.cgi/upload.cgi deleted file mode 100644 index 70320f9..0000000 --- a/scripts/upload.cgi/upload.cgi +++ /dev/null @@ -1,203 +0,0 @@ -#!/usr/bin/python -# -# CGI script to handle file updates for the rpms CVS repository. There -# is nothing really complex here other than tedious checking of our -# every step along the way... -# -# License: GPL - -import os -import sys -import cgi -import tempfile -import grp -import pwd -import syslog -import smtplib - -from email import Header, Utils -try: - from email.mime.text import MIMEText -except ImportError: - from email.MIMEText import MIMEText - -try: - import hashlib - md5_constructor = hashlib.md5 -except ImportError: - import md5 - md5_constructor = md5.new - -# Reading buffer size -BUFFER_SIZE = 4096 - -# We check modules exist from this dircetory -CVSREPO = '/cvs/pkgs/rpms' - -# Lookaside cache directory -CACHE_DIR = '/srv/cache/lookaside/pkgs' - -# Fedora Packager Group -PACKAGER_GROUP = 'packager' - -def send_error(text): - print text - sys.exit(1) - -def check_form(form, var): - ret = form.getvalue(var, None) - if ret is None: - send_error('Required field "%s" is not present.' % var) - if isinstance(ret, list): - send_error('Multiple values given for "%s". Aborting.' % var) - return ret - -def check_auth(username): - authenticated = False - try: - if username in grp.getgrnam(PACKAGER_GROUP)[3]: - authenticated = True - except KeyError: - pass - return authenticated - -def send_email(pkg, md5, filename, username): - text = """A file has been added to the lookaside cache for %(pkg)s: - -%(md5)s %(filename)s""" % locals() - msg = MIMEText(text) - try: - sender_name = pwd.getpwnam(username)[4] - sender_email = '%s@fedoraproject.org' % username - except KeyError: - sender_name = '' - sender_email = 'nobody@fedoraproject.org' - syslog.syslog('Unable to find account info for %s (uploading %s)' % - (username, filename)) - if sender_name: - try: - sender_name = unicode(sender_name, 'ascii') - except UnicodeDecodeError: - sender_name = Header.Header(sender_name, 'utf-8').encode() - msg.set_charset('utf-8') - sender = Utils.formataddr((sender_name, sender_email)) - recipients = ['%s-owner@fedoraproject.org' % pkg, - 'fedora-extras-commits@redhat.com'] - msg['Subject'] = 'File %s uploaded to lookaside cache by %s' % ( - filename, username) - msg['From'] = sender - msg['To'] = ', '.join(recipients) - msg['X-Fedora-Upload'] = '%s, %s' % (pkg, filename) - try: - s = smtplib.SMTP('bastion') - s.sendmail(sender, recipients, msg.as_string()) - except: - syslog.syslog('sending mail for upload of %s failed!' % filename) - -def main(): - os.umask(002) - - username = os.environ.get('SSL_CLIENT_S_DN_CN', None) - if not check_auth(username): - print 'Status: 403 Forbidden' - print 'Content-type: text/plain' - print - print 'You must connect with a valid certificate and be in the %s group to upload.' % PACKAGER_GROUP - sys.exit(0) - - print 'Content-Type: text/plain' - print - - assert os.environ['REQUEST_URI'].split('/')[1] == 'repo' - - form = cgi.FieldStorage() - name = check_form(form, 'name') - md5sum = check_form(form, 'md5sum') - - action = None - upload_file = None - filename = None - - # Is this a submission or a test? - # in a test, we don't get a file, just a filename. - # In a submission, we don;t get a filename, just the file. - if form.has_key('filename'): - action = 'check' - filename = check_form(form, 'filename') - filename = os.path.basename(filename) - print >> sys.stderr, '[username=%s] Checking file status: NAME=%s FILENAME=%s MD5SUM=%s' % (username, name, filename, md5sum) - else: - action = 'upload' - if form.has_key('file'): - upload_file = form['file'] - if not upload_file.file: - send_error('No file given for upload. Aborting.') - filename = os.path.basename(upload_file.filename) - else: - send_error('Required field "file" is not present.') - print >> sys.stderr, '[username=%s] Processing upload request: NAME=%s FILENAME=%s MD5SUM=%s' % (username, name, filename, md5sum) - - module_dir = os.path.join(CACHE_DIR, name) - md5_dir = os.path.join(module_dir, filename, md5sum) - - # first test if the module really exists - cvs_dir = os.path.join(CVSREPO, name) - if not os.path.isdir(cvs_dir): - print >> sys.stderr, '[username=%s] Unknown module: %s' % (username, name) - send_error('Module "%s" does not exist!' % name) - - # try to see if we already have this file... - dest_file = os.path.join(md5_dir, filename) - if os.path.exists(dest_file): - if action == 'check': - print 'Available' - else: - upload_file.file.close() - dest_file_stat = os.stat(dest_file) - print 'File %s already exists' % filename - print 'File: %s Size: %d' % (dest_file, dest_file_stat.st_size) - sys.exit(0) - elif action == 'check': - print 'Missing' - sys.exit(0) - - # check that all directories are in place - if not os.path.isdir(module_dir): - os.makedirs(module_dir, 02775) - - # grab a temporary filename and dump our file in there - tempfile.tempdir = module_dir - tmpfile = tempfile.mkstemp(md5sum)[1] - tmpfd = open(tmpfile, 'w') - - # now read the whole file in - m = md5_constructor() - filesize = 0 - while True: - data = upload_file.file.read(BUFFER_SIZE) - if not data: - break - tmpfd.write(data) - m.update(data) - filesize += len(data) - - # now we're done reading, check the MD5 sum of what we got - tmpfd.close() - check_md5sum = m.hexdigest() - if md5sum != check_md5sum: - send_error("MD5 check failed. Received %s instead of %s." % (check_md5sum, md5sum)) - - # wow, even the MD5SUM matches. make sure full path is valid now - if not os.path.isdir(md5_dir): - os.makedirs(md5_dir, 02775) - print >> sys.stderr, '[username=%s] mkdir %s' % (username, md5_dir) - - os.rename(tmpfile, dest_file) - os.chmod(dest_file, 0644) - - print >> sys.stderr, '[username=%s] Stored %s (%d bytes)' % (username, dest_file, filesize) - print 'File %s size %d MD5 %s stored OK' % (filename, filesize, md5sum) - send_email(name, md5sum, filename, username) - -if __name__ == '__main__': - main() diff --git a/scripts/upload.cgi/upload.test.cgi b/scripts/upload.cgi/upload.test.cgi deleted file mode 100644 index 7e1e00c..0000000 --- a/scripts/upload.cgi/upload.test.cgi +++ /dev/null @@ -1,165 +0,0 @@ -#!/usr/bin/python -# -# CGI script to handle file updates for the rpms CVS repository. There -# is nothing really complex here other than tedious checking of our -# every step along the way... -# -# License: GPL - -import os -import sys -import cgi -import tempfile -import grp -import urllib2 -try: - import hashlib - md5_constructor = hashlib.md5 -except ImportError: - import md5 - md5_constructor = md5.new - -# Reading buffer size -BUFFER_SIZE = 4096 - -# We check modules exist from this dircetory -CVSREPO = '/cvs/pkgs/rpms' - -# Lookaside cache directory -CACHE_DIR = '/srv/cache/lookaside/pkgs' - -# Fedora Packager Group -PACKAGER_GROUP = 'packager' - -def send_error(text): - print text - sys.exit(1) - -def check_form(form, var): - ret = form.getvalue(var, None) - if ret is None: - send_error('Required field "%s" is not present.' % var) - if isinstance(ret, list): - send_error('Multiple values given for "%s". Aborting.' % var) - return ret - -def check_auth(username): - authenticated = False - try: - if username in grp.getgrnam(PACKAGER_GROUP)[3]: - authenticated = True - except KeyError: - pass - return authenticated - -def main(): - os.umask(002) - - username = os.environ.get('SSL_CLIENT_S_DN_CN', None) - if not check_auth(username): - print 'Status: 403 Forbidden' - print 'Content-type: text/plain' - print - print 'You must connect with a valid certificate and be in the %s group to upload.' % PACKAGER_GROUP - sys.exit(0) - - print 'Content-Type: text/plain' - print - - assert os.environ['REQUEST_URI'].split('/')[1] == 'repo' - - form = cgi.FieldStorage() - name = check_form(form, 'name') - md5sum = check_form(form, 'md5sum') - - action = None - upload_file = None - filename = None - - # Is this a submission or a test? - # in a test, we don't get a file, just a filename. - # In a submission, we don;t get a filename, just the file. - if form.has_key('filename'): - action = 'check' - filename = check_form(form, 'filename') - filename = os.path.basename(filename) - print >> sys.stderr, '[username=%s] Checking file status: NAME=%s FILENAME=%s MD5SUM=%s' % (username, name, filename, md5sum) - else: - action = 'upload' - if form.has_key('file'): - upload_file = form['file'] - if not upload_file.file: - send_error('No file given for upload. Aborting.') - filename = os.path.basename(upload_file.filename) - elif form.has_key('url'): - url = form['url'] - try: - upload_file = urllib2.urlopen(url) - except urllib2.HTTPError, e: - send_error('Could not download %s: %s' % (url, e)) - filename = os.path.basename(upload_file.geturl()) - else: - send_error('No "file" or "url" value given.') - print >> sys.stderr, '[username=%s] Processing upload request: NAME=%s FILENAME=%s MD5SUM=%s' % (username, name, filename, md5sum) - - module_dir = os.path.join(CACHE_DIR, name) - md5_dir = os.path.join(module_dir, filename, md5sum) - - # first test if the module really exists - cvs_dir = os.path.join(CVSREPO, name) - if not os.path.isdir(cvs_dir): - print >> sys.stderr, '[username=%s] Unknown module: %s' % (username, name) - send_error('Module "%s" does not exist!' % name) - - # try to see if we already have this file... - dest_file = os.path.join(md5_dir, filename) - if os.path.exists(dest_file): - if action == 'check': - print 'Available' - else: - upload_file.file.close() - dest_file_stat = os.stat(dest_file) - print 'File %s already exists' % filename - print 'File: %s Size: %d' % (dest_file, dest_file_stat.st_size) - sys.exit(0) - elif action == 'check': - print 'Missing' - sys.exit(0) - - # check that all directories are in place - if not os.path.isdir(module_dir): - os.makedirs(module_dir, 02775) - - # grab a temporary filename and dump our file in there - tempfile.tempdir = module_dir - tmpfile = tempfile.mkstemp(md5sum) - tmpfd = open(tmpfile, 'w') - - # now read the whole file in - m = md5_constructor() - filesize = 0 - while True: - data = upload_file.file.read(BUFFER_SIZE) - if not data: - break - tmpfd.write(data) - m.update(data) - filesize += len(data) - - # now we're done reading, check the MD5 sum of what we got - tmpfd.close() - check_md5sum = m.hexdigest() - if md5sum != check_md5sum: - send_error("MD5 check failed. Received %s instead of %s." % (check_md5sum, md5sum)) - - # wow, even the MD5SUM matches. make sure full path is valid now - if not os.path.isdir(md5_dir): - os.makedirs(md5_dir, 02775) - print >> sys.stderr, '[username=%s] mkdir %s' % (username, md5_dir) - - os.rename(tmpfile, dest_file) - print >> sys.stderr, '[username=%s] Stored %s (%d bytes)' % (username, dest_file, filesize) - print 'File %s size %d MD5 %s stored OK' % (filename, filesize, md5sum) - -if __name__ == '__main__': - main() diff --git a/scripts/vacstats/vacstat.py b/scripts/vacstats/vacstat.py deleted file mode 100755 index 12c98e9..0000000 --- a/scripts/vacstats/vacstat.py +++ /dev/null @@ -1,652 +0,0 @@ -#!/usr/bin/python -tt -''' -Licensed under the GNU GPL v2. - -Some pretty awful python code to give details about our postgres databases -I would have written this in bad perl but my perl was too rusty. - -This script detects when a new database is added to the system. - -Note: -If this is run on a database that hasn't had the pgstattuple function added -into template1, pgstattuple will have to be added to template1 and each -existing database. Future databases will inherit pgstattuple from template1. - -yum install -y postgresql-contrib -sudo -u postgres psql = 0: - value = float(value) - else: - value = int(value) - stats[db][table][interval][key.strip()] = value - -def stattuple(opts): - '''Start a stattuple run. - - This gathers initial statistics on how much updating is being seen on a - database's tables. - ''' - # Ah, what I wouldn't give for functools.partial() - interval = 'day' - if opts.optionList: - if opts.optionList[0].endswith('-hour'): - interval = 'initial' - elif opts.optionList[0].endswith('-quarter'): - interval = 'hour' - elif opts.optionList[0].endswith('-day'): - interval = 'quarter' - - - # Read in the DBs we are already aware of - if not os.access(os.path.join(opts.statedir, 'knowndbs.pkl'), os.F_OK): - try: - test_schema(opts) - except InitialRunWarning, e: - # This is expected to be the initial run - print e - - knownFile = file(os.path.join(opts.statedir, 'knowndbs.pkl'), 'r') - knownDBs = cPickle.load(knownFile) - knownFile.close() - - if opts.databases: - dbList = opts.databases - else: - # If no database is selected, we'll collect statistics on all of them - dbList = knownDBs.keys() - - # Make sure we have a schema for all requested dbs - for db in dbList: - if db not in knownDBs: - raise ArgumentsError, 'Cannot process unknown DB, %s. Perhaps you need to run "vacstat.py schema" first' % db - - if opts.tables: - # Make sure we have a schema for all requested tables - if len(dbList) != 1: - raise ArgumentsError, '--tables can only be used if --databases is specified exactly once.' - for table in opts.tables: - if table not in knownDBs[dbList[0]]: - raise ArgumentsError, 'Cannot process unknown Table %s which is not in db %s. Perhaps you need to run "vacstat.py schema" first' % (table, db) - tableList = opts.tables - else: - tableList = None - - # Intialize the data struct we'll be saving all our information in - stats = {} - for db in dbList: - stats[db] = {} - for table in knownDBs[db]: - stats[db][table] = {'initial':{}, - 'hour':{}, 'quarter':{}, 'day':{}} - # If this is our first time, initialize a new outputDir - if not opts.sessionID: - sessionDir = tempfile.mkdtemp(prefix=datetime.datetime.today().strftime('stattuple-%Y%m%d%H%M%S.'), dir=opts.statedir) - opts.sessionID = os.path.basename(sessionDir) - statsFile = file(os.path.join(sessionDir, 'stats.pkl'), 'w') - cPickle.dump(stats, statsFile) - statsFile.close() - else: - sessionDir = os.path.join(opts.statedir, opts.sessionID -) - if tableList: - db = dbList[0] - for table in tableList: - _st_run(interval, stats, db, table, sessionDir) - else: - for db in dbList: - for table in knownDBs[db]: - _st_run(interval, stats, db, table, sessionDir) - - # Load the current pickled data - statsFile = file(os.path.join(sessionDir, 'stats.pkl'), 'rb+') - fcntl.lockf(statsFile, fcntl.LOCK_EX) - persistentStats = cPickle.load(statsFile) - # Merge old and new information - for db in stats: - for table in stats[db]: - for period in stats[db][table]: - if stats[db][table][period]: - persistentStats[db][table][period] = stats[db][table][period] - # save merged information back to the statsFile - statsFile.truncate(0) - statsFile.seek(0) - cPickle.dump(persistentStats, statsFile) - statsFile.flush() - fcntl.lockf(statsFile, fcntl.LOCK_UN) - statsFile.close() - - if interval == 'day': - # add the db:table to a file to show we're done gathering stats - done = file(os.path.join(sessionDir, 'DONE'), 'a') - fcntl.lockf(done, fcntl.LOCK_EX) - done.write('%s:%s\n' % (opts.databases[0], opts.tables[0])) - fcntl.lockf(done, fcntl.LOCK_UN) - done.close() - -def merge_history(statedir): - statDirList = sorted(glob.glob(os.path.join(statedir, 'stattuple-*'))) - for statDir in statDirList: - finishedTables = {} - timestamp = 0 # When the stat collection finished - # Read data from each session directory. - if not os.path.isdir(statDir): - # Sanity check that this is an output dir - continue - if glob.glob(os.path.join(statDir, 'DONE')): - # Read in the tables - finishFile = file(os.path.join(statDir, 'DONE'), 'r') - fcntl.lockf(finishFile, fcntl.LOCK_SH) - # Get the timestamp from the finish file for later - timestamp = os.stat(os.path.join(statDir, 'DONE'))[ST_MTIME] - for line in finishFile: - (db, table) = line.strip().split(':') - if db not in finishedTables: - finishedTables[db] = {} - if table not in finishedTables[db]: - finishedTables[db][table] = {} - fcntl.lockf(finishFile, fcntl.LOCK_UN) - finishFile.close() - else: - # This one is not done yet - continue - - # Read the tables from the stat file - statsFile = file(os.path.join(statDir, 'stats.pkl'), 'r') - fcntl.lockf(statsFile, fcntl.LOCK_SH) - stats = cPickle.load(statsFile) - - fcntl.lockf(statsFile, fcntl.LOCK_UN) - statsFile.close() - - # Check that all tables are done - finished = True - for db in stats: - if db not in finishedTables: - finished = False - break - for table in stats[db]: - if table not in finishedTables[db]: - finished = False - break - if not finished: - break - del finishedTables - if not finished: - continue - - # - # Add a new record to our history file - # - historyFilename = os.path.join(statedir, 'history.pkl') - # If the file doesn't exist yet, create it - if not os.access(historyFilename, os.F_OK): - history = {} - historyFile = file(historyFilename, 'w') - fcntl.lockf(historyFile, fcntl.LOCK_EX) - cPickle.dump(history, historyFile) - fcntl.lockf(historyFile, fcntl.LOCK_UN) - historyFile.close() - - historyFile = file(os.path.join(statedir, 'history.pkl'), 'rb+') - fcntl.lockf(historyFile, fcntl.LOCK_EX) - history = cPickle.load(historyFile) - - # Merge the data we've read in with the historical data - for db in stats: - if db not in history: - history[db] = {} - for table in stats[db]: - if table not in history[db]: - history[db][table] = {} - history[db][table][timestamp] = {} - for interval in stats[db][table]: - history[db][table][timestamp][interval] = {} - for key, value in stats[db][table][interval].items(): - if isinstance(value, str): - if value.find('.') >= -1: - history[db][table][timestamp][interval][key] = float(value) - else: - history[db][table][timestamp][interval][key] = int(value) - else: - history[db][table][timestamp][interval][key] = value - - historyFile.truncate(0) - historyFile.seek(0) - cPickle.dump(history, historyFile) - fcntl.lockf(historyFile, fcntl.LOCK_UN) - historyFile.close() - - # Delete the processed stattuple directory - -def analyze_data(opts): - merge_history(opts.statedir) - - # Read in the history - historyFile = file(os.path.join(opts.statedir, 'history.pkl'), 'r') - fcntl.lockf(historyFile, fcntl.LOCK_SH) - history = cPickle.load(historyFile) - fcntl.lockf(historyFile, fcntl.LOCK_UN) - historyFile.close() - - hourly = [] - daily = [] - suggestions = [] - for db in history: - for table in history[db]: - # find latest timestamp for this table - last = sorted(history[db][table].keys())[-1] - tableData = [] - run = history[db][table][last] - - # - # Battery of tests - # - - infrequent = False - frequent = False - vacuumFull = False - - if run['day']['free_space'] == 0 and \ - run['day']['dead_tuple_len'] == 0 \ - and run['day']['table_len'] == 0: - # This table is empty - infrequent = True - - # Check how much dead tuples grew absolutely in 24 hours - if run['day']['dead_tuple_len'] <= 10000: - infrequent = True - elif run['day']['dead_tuple_len'] >= 1000000: - frequent = True - - # Check how many dead vs live tuples there are - if run['day']['dead_tuple_len'] + run['day']['tuple_len'] == 0: - deadTuplePercent = 0 - else: - deadTuplePercent = run['day']['dead_tuple_len'] * 100.0 \ - / (run['day']['dead_tuple_len'] \ - + run['day']['tuple_len']) - if deadTuplePercent > 20: - frequent = True - elif deadTuplePercent < 10: - infrequent = True - - # Check how much free space exists - if run['day']['free_space'] + run['day']['tuple_len'] \ - + run['day']['dead_tuple_len'] == 0: - freeSpacePercent = 0 - else: - freeSpacePercent = (run['day']['free_space'] \ - + run['day']['dead_tuple_len']) * 100.0 \ - / (run['day']['free_space'] + run['day']['tuple_len'] \ - + run['day']['dead_tuple_len']) - # If free space is larger than 15%, see whether we can use that - # much space between vacuums (Build in a small margin for tables - # that are so small that the free space from the table being - # allocated is > 15%.) - if freeSpacePercent > 15 and run['day']['table_len'] > 524288: - if frequent: - # Calculate roughly how much is used per hour. Take the - # maximum of our samples - usage = (run['initial']['free_space'] - run['day']['free_space'])/24.0 - if usage < run['initial']['free_space'] - run['hour']['free_space']: - usage = run['hour']['free_space'] - run['hour']['free_space'] - if usage < (run['initial']['free_space'] - run['quarter']['free_space']) / 6: - usage = (run['initial']['free_space'] - run['quarter']['free_space']) / 6 - else: - # Calculate how much is used per day - usage = run['initial']['free_space'] - run['day']['free_space'] - # If the projected usage between vacuums is < the amount of - # free space we have, recommend a vacuum full. - if usage < run['day']['free_space']: - suggestions.append('Vacuum full %(db)s %(table)s: Freespace Percent %(freeP)s%%, %(freeB)s Bytes\n vacuumdb -zfd %(db)s -t %(table)s' % {'db': db, 'table': table, 'freeP': freeSpacePercent, 'freeB': run['day']['free_space']}) - - # if a table is large in absolute terms, flag them as - # potentially problematic - # 5GB (For reference, mirrormanager::host_category_dir==1.2GB - # koji::rpmfiles == 20GB) - if run['day']['table_len'] >= 5000000000: - suggestions.append('%s %s is quite large and may cause problems' % (db, table)) - - # Output suggestions - # Currently we only suggest hourly and daily - if frequent: - hourly.append((db, table)) - else: - daily.append((db, table)) - - print 'hourly cron script:' - print '#!/bin/sh' - print - print "PGOPTIONS='-c maintenance_work_mem=1048576'" - print - for table in hourly: - print '/usr/bin/vacuumdb -z --quiet -d %s -t %s' % (table[0], table[1]) - - print '\n\ndaily cron script:' - print '#!/bin/sh' - print - print "PGOPTIONS='-c maintenance_work_mem=1048576'" - print - for table in daily: - print '/usr/bin/vacuumdb -z --quiet -d %s -t %s' % (table[0], table[1]) - - print 'Things to look into further:' - for line in suggestions: - print line - -Commands = {'schema': test_schema, - 'transactions': test_transactions, - 'check': test_all, - 'list': list_dbs, - 'stattuple-start': stattuple, - 'stattuple-hour': stattuple, - 'stattuple-quarter': stattuple, - 'stattuple-day': stattuple, - 'analyze': analyze_data} - -def parse_args(): - '''Take information from the user about what actions to perform. - ''' - parser = optparse.OptionParser(version = __version__, usage=''' -vacstat.py COMMAND [options] - -COMMAND can be:: - transactions: check that we aren't in danger of running out of - transaction ids. - schema: check that the database schema hasn't changed since the - last run. This helps you keep the vacuum policy up to - date by showing you what tables/databases have changed - since the last run. - check: run schema and transactions checks. - list: List dbs and tables that are known. - stattuple-start: Start a stattuple run. This command should be used with - the --database option to prevent overloading the database - server with too many queries at the same time. - stattuple-start will run a vacuum of the database/tables - followed by a stattuple of the tables in the db. It will - save the stattuple output to directories under --statedir - and then set an at job to reinvoke itself in an hour - with the stattuple-hour command. - analyze: *** Unimplemented *** This command should take information - in --statedir and produce a graph of tuple growth over - time and recomendation for how frequently to vacuum. - - ** The following commands are used internally and won't produce meaningful - ** statistics by themselves. Run stattuple-start instead. - - stattuple-hour: Used internally by stattuple-start to run stattuple on - certain databases/tables an hour after vacuuming. The - stattuple output will be saved to --statedir and then it - will set an at job to reinvoke itself in five more hours - with the stattuple-quarter command. - stattuple-quarter:Used internally by stattuple-hour to run stattuple on - certain databases/tables 6 hours after vacuuming. The - stattuple output will be saved to --statedir and then it - will set an at job to reinvoke itself in 18 hours. - stattuple-day: Used internally by stattuple-quarter to run stattuple on - certain databases/tables 6 hours after vacuuming. The - stattuple output will be saved to --statedir and then - exit. -''') - parser.add_option('-s', '--state-dir', - dest='statedir', - action='store', - default=STATEDIR, - help='Directory to get and store information about databases/tables') - parser.add_option('-d', '--database', - dest='databases', - action='append', - default=[], - help='Database to process. You can specify this option multiple times. Defaults to all') - parser.add_option('-t', '--table', - dest='tables', - action='append', - default=[], - help='Tables to process. This option can only be used if --databases is used to specify exactly one database. You can specify this option multiple times. Defaults to all') - parser.add_option('--session', - dest='sessionID', - action='store', - default='', - help='Internal command line option to pass data between invocations of the program.') - - (opts, args) = parser.parse_args() - - # Check that we were given a proper command - if len(args) < 1: - raise ArgumentError, 'No command specified' - elif len(args) > 1: - raise ArgumentError, 'Can only specify one command' - if args[0] not in Commands: - raise ArgumentError, 'Unknown Command' - - if opts.tables and len(opts.databases) != 1: - raise ArgumentError, '--tables can only be used if --databases is specified exactly once.' - - if args[0] in ('schema', 'list', 'check', 'transactions'): - if opts.databases: - raise ArgumentError, 'schema, list, transactions, and check commands cannot be used with --database' - - # optionList is used to reinvoke the new stattuple - opts.optionList = [] - if args[0].startswith('stattuple') and not args[0].endswith('-day'): - if args[0].endswith('-start'): - opts.optionList.append('stattuple-hour') - elif args[0].endswith('-hour'): - opts.optionList.append('stattuple-quarter') - elif args[0].endswith('-quarter'): - opts.optionList.append('stattuple-day') - opts.optionList.extend(('-s', opts.statedir)) - - return args[0], opts - -def init_statedir(statedir): - # Make sure the statedir is ready - if not os.path.isdir(statedir): - try: - os.makedirs(statedir) - except: - raise IOError, 'You do not have permission to create the statedir %s' % statedir - - if not os.access(statedir, os.R_OK | os.X_OK | os.W_OK): - raise IOError, 'You do not have permission to use %s as the statedir' % statedir - -if __name__ == '__main__': - command, opts = parse_args() - - init_statedir(opts.statedir) - Commands[command](opts) - - sys.exit(0) diff --git a/scripts/xenAgent/xenAgent.py b/scripts/xenAgent/xenAgent.py deleted file mode 100755 index 02cd750..0000000 --- a/scripts/xenAgent/xenAgent.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright © 2008 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing to use, modify, -# copy, or redistribute it subject to the terms and conditions of the GNU -# General Public License v.2. This program is distributed in the hope that it -# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the -# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the GNU General Public License for more details. You should have -# received a copy of the GNU General Public License along with this program; -# if not, write to the Free Software Foundation, Inc., 51 Franklin Street, -# Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat trademarks that are -# incorporated in the source code or documentation are not subject to the GNU -# General Public License and may only be used or replicated with the express -# permission of Red Hat, Inc. -# -# Author: Mike McGrath -# - -# Sample Use: -# See what guests are running: -# -# snmpwalk -v2c -c public localhost .1.3.6.1.4.1.2021.1.1 -# -# Reboot a guest (requres rw access and rw password): -# -# snmpset -v2c -c private localhost .1.3.6.1.4.1.2021.1.1.1 s reboot -# -# Sample use (add to /etc/snmp/snmpd.conf) -# -# pass .1.3.6.1.4.1.2021.1 /usr/bin/python /path/to/xenAgent.py - -import sys -import commands -from optparse import OptionParser - -BASE='.1.3.6.1.4.1.2021.1' - -# BASE.1.1 == First running xen guest -# BASE.1.2 == Second running xen guest, etc -# BASE.2 == Free memory on dom0 - -parser = OptionParser(version = '1.0') - -parser.add_option('-s', '--set', - dest = 'set', - default = False, - metavar = 'set', - help = 'Set a value') -parser.add_option('-g', '--get', - dest = 'get', - default = False, - metavar = 'get', - help = 'Get a value') -parser.add_option('-n', '--next', - dest = 'get_next', - default = False, - metavar = 'get_next', - help = 'Get next oid in the tree') - -def getRunning(): - ''' Return a list of running hosts''' - # This is in place because the libvirt and xen apis are not working right - # on our xen hosts. - running_raw=commands.getoutput('/usr/sbin/xm list').split('\n')[2:] - running = [] - for line in running_raw: - if line.strip(): - running.append(line.split(' ')[0].strip()) - return running - -(opts, args) = parser.parse_args() - - -# Set a value -if opts.set: - set = opts.set - if set.startswith('%s.1.' % BASE): - running = getRunning() - command = ' '.join(sys.argv[4:]) - cur_host = int(set.replace('%s.1.' % BASE, '')) - if command == 'reboot': - # So the question here is, do we do a reboot (similar to ctl + alt + del) - # or do we a destroy followed by a create? The first one is much safer but - # might not work all the time. We'll start there though - commands.getoutput('/usr/sbin/xm reboot %s' % running[cur_host]).split('\n')[2:] - sys.exit(0) - - -# Take an OID, print the next OID in the sequence -# Used for snmpwalks -if opts.get_next: - get_next = opts.get_next - next = '' - if get_next == BASE: - running = getRunning() - if running >= 1: - next = "%s.1.0" % BASE - else: - next = "%s.2" % BASE - elif get_next == '%s.1' % BASE: - next = '%s.1.0' % BASE - elif get_next.startswith('%s.1.' % BASE): - cur_host = get_next.replace('%s.1.' % BASE, '') - running = getRunning() - if len(running) > int(cur_host) + 1: - next = "%s.1.%s" % (BASE, int(cur_host) + 1) - else: - next = "%s.2" % BASE - else: - sys.exit(0) -else: - next = opts.get - -print next - -# Get the value of an OID -if opts.get or opts.get_next: - get = next - if get == '%s' % BASE: - print "string" - print "This is a xen host" - sys.exit(0) - if get.startswith('%s.1.' % BASE): - running = getRunning() - host = int(get.replace('%s.1.' % BASE, '')) - print "string" - print running[host] - sys.exit(0) - if get == '%s.2' % BASE: - print "string" - print "not implemented" - sys.exit(0) - print "string" - print "ack... %s %s" % (next, get) diff --git a/scripts/zabbix/pathchecker.py b/scripts/zabbix/pathchecker.py deleted file mode 100644 index 925ffd7..0000000 --- a/scripts/zabbix/pathchecker.py +++ /dev/null @@ -1,11 +0,0 @@ -import os,sys - -files = sys.argv[1:] -if not files: - print "you must specify a file" - sys.exit(1) -for file in files: - if os.access(file, os.R_OK): - print 1 - else: - print 0 diff --git a/scripts/zabbix/zabbixhelper.cfg b/scripts/zabbix/zabbixhelper.cfg deleted file mode 100644 index 5660095..0000000 --- a/scripts/zabbix/zabbixhelper.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[commands] -restarthttpd = /sbin/service httpd restart -gracefulhttpd = /sbin/service httpd graceful \ No newline at end of file diff --git a/scripts/zabbix/zabbixhelper.py b/scripts/zabbix/zabbixhelper.py deleted file mode 100755 index fa95836..0000000 --- a/scripts/zabbix/zabbixhelper.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/python -tt -# -*- coding: utf-8 -*- -# -# Copyright © 2008 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing to use, modify, -# copy, or redistribute it subject to the terms and conditions of the GNU -# General Public License v.2. This program is distributed in the hope that it -# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the -# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the GNU General Public License for more details. You should have -# received a copy of the GNU General Public License along with this program; -# if not, write to the Free Software Foundation, Inc., 51 Franklin Street, -# Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat trademarks that are -# incorporated in the source code or documentation are not subject to the GNU -# General Public License and may only be used or replicated with the express -# permission of Red Hat, Inc. -# -# Red Hat Author(s): Nigel Jones -# - - -from configobj import ConfigObj -import os -import sys -import subprocess - -config = ConfigObj("/etc/zabbixhelper.cfg") - -try: - command = config['commands'][sys.argv[1]] -except KeyError: - print "Invalid command passed to script, check input" - sys.exit(1) -except IndexError: - print "No parameters passed to script" - sys.exit(1) - -devnull = open("/dev/null", "w") -ret = subprocess.Popen(command.split(), stderr=devnull, stdout=devnull).wait() - -if ret != 0: - print "Execution Failed" - -sys.exit(ret) diff --git a/themes/wordpress-theme-fedora/comments-popup.php b/themes/wordpress-theme-fedora/comments-popup.php deleted file mode 100644 index 4e0a605..0000000 --- a/themes/wordpress-theme-fedora/comments-popup.php +++ /dev/null @@ -1,116 +0,0 @@ - - - - - <?php echo get_option('blogname'); ?> - <?php echo sprintf(__("Comments on %s"), the_title('','',false)); ?> - - - - - - - -

- -

- -

RSS feed for comments on this post."); ?>

- -ping_status) { ?> -

URL to TrackBack this entry is:"); ?>

- - -post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) { // and it doesn't match the cookie - echo(get_the_password_form()); -} else { ?> - - -
    - -
  1. - -

    @

    -
  2. - - -
- -

- - -comment_status) { ?> -

-

HTML allowed:"); ?>

- -
- -

'.$user_identity.''); ?>

- -

- - - - " /> -

- -

- - -

- -

- - -

- - -

- -
- -

- -

- " /> -

- ID); ?> -
- -

- - -
- - - - - -

Powered by WordPress"),__("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?>

- - - - diff --git a/themes/wordpress-theme-fedora/comments.php b/themes/wordpress-theme-fedora/comments.php deleted file mode 100644 index 0ad2295..0000000 --- a/themes/wordpress-theme-fedora/comments.php +++ /dev/null @@ -1,76 +0,0 @@ -post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?> -

- - -

- - ">» - -

- - -
    - - -
  1. - - -

    @

    -
  2. - - - -
- - -

- - -

RSS feed for comments on this post.')); ?> - - URL'); ?> - -

- - -

- - -

logged in to post a comment.'), get_option('siteurl')."/wp-login.php?redirect_to=".urlencode(get_permalink()));?>

- - -
- - - -

'.$user_identity.''); ?>

- - - -

-

- -

-

- -

-

- - - - - -

- -

- -

-ID); ?> - -
- - - - -

- diff --git a/themes/wordpress-theme-fedora/foo.css b/themes/wordpress-theme-fedora/foo.css deleted file mode 100644 index b4eb4ef..0000000 --- a/themes/wordpress-theme-fedora/foo.css +++ /dev/null @@ -1,363 +0,0 @@ -/* -Theme Name: WordPress Classic -Theme URI: http://wordpress.org/ -Description: The original WordPress theme that graced versions 1.2.x and prior. -Version: 1.5 -Author: Dave Shea -Tags: mantle color, variable width, two columns, widgets - -Default WordPress by Dave Shea || http://mezzoblue.com -Modifications by Matthew Mullenweg || http://photomatt.net -This is just a basic layout, with only the bare minimum defined. -Please tweak this and make it your own. :) -*/ - -a { - color: #675; -} - -a img { - border: none; -} - -a:visited { - color: #342; -} - -a:hover { - color: #9a8; -} - -acronym, abbr { - border-bottom: 1px dashed #333; -} - -acronym, abbr, span.caps { - font-size: 90%; - letter-spacing: .07em; -} - -acronym, abbr { - cursor: help; -} - -blockquote { - border-left: 5px solid #ccc; - margin-left: 1.5em; - padding-left: 5px; -} - -body { - background: #fff; - border: 2px solid #565; - border-bottom: 1px solid #565; - border-top: 3px solid #565; - color: #000; - font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - margin: 0; - padding: 0; -} - -cite { - font-size: 90%; - font-style: normal; -} - -h2 { - border-bottom: 1px dotted #ccc; - font: 95% "Times New Roman", Times, serif; - letter-spacing: 0.2em; - margin: 15px 0 2px 0; - padding-bottom: 2px; -} - -h3 { - border-bottom: 1px dotted #eee; - font-family: "Times New Roman", Times, serif; - margin-top: 0; -} - -ol#comments li p { - font-size: 100%; -} - -p, li, .feedback { - font: 90%/175% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - letter-spacing: -1px; -} - -/* classes used by the_meta() */ -ul.post-meta { - list-style: none; -} - -ul.post-meta span.post-meta-key { - font-weight: bold; -} - -.credit { - background: #90a090; - border-top: 3px double #aba; - color: #fff; - font-size: 11px; - margin: 10px 0 0 0; - padding: 3px; - text-align: center; -} - -.credit a:link, .credit a:hover { - color: #fff; -} - -.feedback { - color: #ccc; - text-align: right; - clear: both; -} - -.meta { - font-size: .75em; -} - -.meta li, ul.post-meta li { - display: inline; -} - -.meta ul { - display: inline; - list-style: none; - margin: 0; - padding: 0; -} - -.meta, .meta a { - color: #808080; - font-weight: normal; - letter-spacing: 0; -} - -.storytitle { - margin: 0; -} - -.storytitle a { - text-decoration: none; -} - -#commentform #author, #commentform #email, #commentform #url, #commentform textarea { - background: #fff; - border: 1px solid #333; - padding: .2em; -} - -#commentform textarea { - width: 100%; -} - -#commentlist li ul { - border-left: 1px solid #ddd; - font-size: 110%; - list-style-type: none; -} - -#commentlist li .avatar { - float: right; - margin-right: 25px; - border: 1px dotted #ccc; - padding: 2px; -} - -#content { - margin: 30px 13em 0 3em; - padding-right: 60px; -} - -#header { - background: #90a090; - border-bottom: 3px double #aba; - border-left: 1px solid #9a9; - border-right: 1px solid #565; - border-top: 1px solid #9a9; - font: italic normal 230% 'Times New Roman', Times, serif; - letter-spacing: 0.2em; - margin: 0; - padding: 15px 10px 15px 60px; -} - -#header a { - color: #fff; - text-decoration: none; -} - -#header a:hover { - text-decoration: underline; -} - -#menu { - background: #fff; - border-left: 1px dotted #ccc; - border-top: 3px solid #e0e6e0; - padding: 20px 0 10px 30px; - position: absolute; - right: 2px; - top: 0; - width: 11em; -} - -#menu form { - margin: 0 0 0 13px; -} - -#menu input#s { - width: 80%; - background: #eee; - border: 1px solid #999; - color: #000; -} - -#menu ul { - color: #ccc; - font-weight: bold; - list-style-type: none; - margin: 0; - padding-left: 3px; - text-transform: lowercase; -} - -#menu ul li { - font: italic normal 110% 'Times New Roman', Times, serif; - letter-spacing: 0.1em; - margin-top: 10px; - padding-bottom: 2px; /*border-bottom: dotted 1px #ccc;*/ -} - -#menu ul ul { - font-variant: normal; - font-weight: normal; - line-height: 100%; - list-style-type: none; - margin: 0; - padding: 0; - text-align: left; -} - -#menu ul ul li { - border: 0; - font: normal normal 12px/115% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - letter-spacing: 0; - margin-top: 0; - padding: 0; - padding-left: 12px; -} - -#menu ul ul li a { - color: #000; - text-decoration: none; -} - -#menu ul ul li a:hover { - border-bottom: 1px solid #809080; -} - -#menu ul ul ul.children { - font-size: 142%; - padding-left: 4px; -} - -#wp-calendar { - border: 1px solid #ddd; - empty-cells: show; - font-size: 14px; - margin: 0; - width: 90%; -} - -#wp-calendar #next a { - padding-right: 10px; - text-align: right; -} - -#wp-calendar #prev a { - padding-left: 10px; - text-align: left; -} - -#wp-calendar a { - display: block; - text-decoration: none; -} - -#wp-calendar a:hover { - background: #e0e6e0; - color: #333; -} - -#wp-calendar caption { - color: #999; - font-size: 16px; - text-align: left; -} - -#wp-calendar td { - color: #ccc; - font: normal 12px 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - letter-spacing: normal; - padding: 2px 0; - text-align: center; -} - -#wp-calendar td.pad:hover { - background: #fff; -} - -#wp-calendar td:hover, #wp-calendar #today { - background: #eee; - color: #bbb; -} - -#wp-calendar th { - font-style: normal; - text-transform: capitalize; -} - -/* Captions & alignment */ -.aligncenter, -div.aligncenter { - display: block; - margin-left: auto; - margin-right: auto; -} - -.alignleft { - float: left; -} - -.alignright { - float: right; -} - -.wp-caption { - border: 1px solid #ddd; - text-align: center; - background-color: #f3f3f3; - padding-top: 4px; - margin: 10px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.wp-caption img { - margin: 0; - padding: 0; - border: 0 none; -} - -.wp-caption p.wp-caption-text { - font-size: 11px; - line-height: 17px; - padding: 0 4px 5px; - margin: 0; -} -/* End captions & alignment */ diff --git a/themes/wordpress-theme-fedora/footer.php b/themes/wordpress-theme-fedora/footer.php deleted file mode 100644 index 8c00bdc..0000000 --- a/themes/wordpress-theme-fedora/footer.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - -
- - -
- - - diff --git a/themes/wordpress-theme-fedora/functions.php b/themes/wordpress-theme-fedora/functions.php deleted file mode 100644 index a63850c..0000000 --- a/themes/wordpress-theme-fedora/functions.php +++ /dev/null @@ -1,10 +0,0 @@ - '
  • ', - 'after_widget' => '
  • ', - 'before_title' => '', - 'after_title' => '', - )); - -?> diff --git a/themes/wordpress-theme-fedora/header.php b/themes/wordpress-theme-fedora/header.php deleted file mode 100644 index f755530..0000000 --- a/themes/wordpress-theme-fedora/header.php +++ /dev/null @@ -1,33 +0,0 @@ - -> - - - - - <?php bloginfo('name'); ?><?php wp_title(); ?> - - - - - - - - - - - - - - -
    - - - - -
    - diff --git a/themes/wordpress-theme-fedora/index.php b/themes/wordpress-theme-fedora/index.php deleted file mode 100644 index 9d1f9eb..0000000 --- a/themes/wordpress-theme-fedora/index.php +++ /dev/null @@ -1,33 +0,0 @@ - - - - - -
    -

    -',''); ?> -
    - -
    - -
    @
    - - - - -
    - - - - -

    - - - - - diff --git a/themes/wordpress-theme-fedora/rtl.css b/themes/wordpress-theme-fedora/rtl.css deleted file mode 100644 index a038b64..0000000 --- a/themes/wordpress-theme-fedora/rtl.css +++ /dev/null @@ -1,82 +0,0 @@ -/* Based on Arabic (RTL) version of WordPress Classic theme, converted by Serdal (Serdal.com) */ - -#menu ul ul, #wp-calendar caption, #wp-calendar #prev a { text-align: right; } -#wp-calendar #next a, .feedback { text-align: left; } - -blockquote { - border-left: 0; - border-right: 5px solid #ccc; - margin-left: auto; - margin-right: 1.5em; - padding-left: 0; - padding-right: 5px; -} - -body { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; } - -h2 { font: 95% 'Al Bayan', 'Traditional Arabic', "Times New Roman", Times, serif; } - -p, li, .feedback { - font: 90%/175% 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - text-align: justify; -} - -acronym, abbr, span.caps, h2, p, li, #header, #menu ul li, #menu ul ul li, #wp-calendar td, .feedback, .meta, .meta a { letter-spacing: normal; } - -#commentlist li ul { - border-left: 0; - border-right: 1px solid #ddd; -} - -#content { - margin: 30px 3em 0 13em; - padding-right: 0; - padding-left: 60px; -} - -#header { - border-left: solid 1px #9a9; - border-right: solid 1px #565; - font: normal normal 230% 'Al Bayan', 'Traditional Arabic', 'Times New Roman', Times, serif; - padding: 15px 60px 15px 10px; -} - -#menu { - border-left: 0; - border-right: 1px dotted #ccc; - padding: 20px 30px 10px 0; - right: auto; - left: 2px; -} - -#menu form { margin: 0 13px 0 0; } - -#menu ul { - padding-left: 0; - padding-right: 3px; -} - -#menu ul li { font: normal normal 110% 'Geeza Pro', Tahoma, 'Times New Roman', Times, serif; } - -#menu ul ul li { - font: normal normal 12px/115% 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - padding-left: 0; - padding-right: 12px; -} - -#menu ul ul ul.children { - padding-left: 0; - padding-right: 4px; -} - -#wp-calendar #next a { - padding-right: 0; - padding-left: 10px; -} - -#wp-calendar #prev a { - padding-left: 0; - padding-right: 10px; -} - -#wp-calendar td { font: normal normal 12px 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; } diff --git a/themes/wordpress-theme-fedora/screenshot.png b/themes/wordpress-theme-fedora/screenshot.png deleted file mode 100644 index 6692130..0000000 Binary files a/themes/wordpress-theme-fedora/screenshot.png and /dev/null differ diff --git a/themes/wordpress-theme-fedora/sidebar.php b/themes/wordpress-theme-fedora/sidebar.php deleted file mode 100644 index ce58134..0000000 --- a/themes/wordpress-theme-fedora/sidebar.php +++ /dev/null @@ -1,46 +0,0 @@ - - - diff --git a/themes/wordpress-theme-fedora/style.css b/themes/wordpress-theme-fedora/style.css deleted file mode 100644 index 2a5a55b..0000000 --- a/themes/wordpress-theme-fedora/style.css +++ /dev/null @@ -1,154 +0,0 @@ -#footer -{ - position: relative; - font: normal 0.8em/1.5 sans-serif; - text-align: center; - background: #FFFFFF url(http://fedoraproject.org/static/images/line-bottom.png) 0 0 repeat-x; - margin: -90px 0 0; - border-bottom: 10px solid #337ACC; - height: 50px; - padding-bottom: 30px; - color: #888888; -} - -#content -{ - padding: 4ex 2ex 120px; -} - -#content a -{ - color: #337ACC; -} - -.download-sidebar a:link, -.download-sidebar a:active, -.download-sidebar a:visited { - color: #FFFFFF!important; - font-size: medium; - text-decoration: none; - font-weight: bold; - line-height: 1.5; -} - -h1 { - float: left; - width: 113px; -} - -h1#blogname { - float: none; - width: 400px; - background-image: none !important; - margin-left: 150px; -} - -#head h1 a { - background: transparent url(wp-admin_images_wordpress-logo.png) no-repeat scroll 20px 50% !important; - margin-left: -8px; -} - - -h1#blogname a { - text-indent: 0px !important; - background-image: none !important; - width: 100%; - margin-top: 44px; - margin-bottom: -40px; -} - -h1#blogname a:link, -h1#blogname a:visited, -h1#blogname a:active { - color: #bbb; -} - - -ul#wp-sidebar-list { - margin-left: -10px; - list-style-image: none; - list-style-type: none; - list-style-position: side !important; -} - - -ul#wp-sidebar-list li { - margin-left: 8px !important; - text-transform: uppercase; - font-size: 0.9em; - font-weight: normal; - margin: 2ex 0 1ex; -} - -ul#wp-sidebar-list li:first-line { - background-color: yellow; - -} - -ul#wp-sidebar-list > li > ul li { - text-transform: none; - border: none; - margin: auto; -} - -div#nav { - margin-left: 20px !important; -} - -h3.date { - color: #aaa !important; - font-size: 8pt !important; - padding-top: none !important; - margin-top: none !important; -} - -div.post .meta { - color: #aaa; - padding-bottom: 5px; - border-bottom: 1px dotted #ddd; - margin-bottom: 10px; - font-size: 6pt; -} - -div.post { - width: 90%; -} - -div.post h2 { - text-transform: uppercase; -} - -/* Captions */ -.aligncenter, -div.aligncenter { - display: block; - margin-left: auto; - margin-right: auto; -} - -.wp-caption { - border: 1px solid #ddd; - text-align: center; - background-color: #f3f3f3; - padding-top: 4px; - margin: 10px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.wp-caption img { - margin: 0; - padding: 0; - border: 0 none; -} - -.wp-caption p.wp-caption-text { - font-size: 11px; - line-height: 17px; - padding: 0 4px 5px; - margin: 0; -} -/* End captions */ - diff --git a/themes/wordpress-theme-fedora/wordpress-mu-theme-fedora.spec b/themes/wordpress-theme-fedora/wordpress-mu-theme-fedora.spec deleted file mode 100644 index c89607f..0000000 --- a/themes/wordpress-theme-fedora/wordpress-mu-theme-fedora.spec +++ /dev/null @@ -1,56 +0,0 @@ -Summary: Wordpress Theme for Fedora -URL: http://mu.wordpress.org/latest.tar.gz -Name: wordpress-theme-fedora -Version: 1.0.2 -Release: 1%{?dist} -Group: Applications/Publishing -License: GPLv2 -Source0: %{name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: php >= 4.1.0, httpd, php-mysql, wordpress -BuildArch: noarch - -%description -This is a theme developed for the Fedora Project for -blogs.fedoraproject.org - -%prep -%setup -q -n wordpress-theme-fedora - -%build - -%install -rm -rf %{buildroot} - -mkdir -p %{buildroot}%{_datadir}/wordpress-mu/wp-content/themes/fedora - -cp -pr * %{buildroot}%{_datadir}/wordpress-mu/wp-content/themes/fedora - -# Remove empty files to make rpmlint happy -find %{buildroot} -empty -exec rm -f {} \; - -%clean -rm -rf %{buildroot} - -%files -%defattr(-,root,root,-) -%dir %{_datadir}/wordpress-mu/wp-content/themes/fedora -%{_datadir}/wordpress-mu/wp-content/themes/fedora/comments.php -%{_datadir}/wordpress-mu/wp-content/themes/fedora/comments-popup.php -%{_datadir}/wordpress-mu/wp-content/themes/fedora/foo.css -%{_datadir}/wordpress-mu/wp-content/themes/fedora/footer.php -%{_datadir}/wordpress-mu/wp-content/themes/fedora/functions.php -%{_datadir}/wordpress-mu/wp-content/themes/fedora/header.php -%{_datadir}/wordpress-mu/wp-content/themes/fedora/index.php -%{_datadir}/wordpress-mu/wp-content/themes/fedora/rtl.css -%{_datadir}/wordpress-mu/wp-content/themes/fedora/screenshot.png -%{_datadir}/wordpress-mu/wp-content/themes/fedora/sidebar.php -%{_datadir}/wordpress-mu/wp-content/themes/fedora/style.css -%{_datadir}/wordpress-mu/wp-content/themes/fedora/wp-admin_images_logo-ghost.png -%{_datadir}/wordpress-mu/wp-content/themes/fedora/wp-admin_images_logo.gif -%{_datadir}/wordpress-mu/wp-content/themes/fedora/wp-admin_images_wordpress-logo.png -%{_datadir}/wordpress-mu/wp-content/themes/fedora/wp-includes_images_wlw_wp-icon.png - -%changelog -* Wed Jun 24 2009 Nick Bebout - 1.0-1 -- initial version of wordpress-mu-theme-fedora diff --git a/themes/wordpress-theme-fedora/wordpress-theme-fedora.spec b/themes/wordpress-theme-fedora/wordpress-theme-fedora.spec deleted file mode 100644 index 38b918f..0000000 --- a/themes/wordpress-theme-fedora/wordpress-theme-fedora.spec +++ /dev/null @@ -1,56 +0,0 @@ -Summary: Wordpress-MU Theme for Fedora -URL: http://mu.wordpress.org/latest.tar.gz -Name: wordpress-theme-fedora -Version: 1.0.2 -Release: 1%{?dist} -Group: Applications/Publishing -License: GPLv2 -Source0: %{name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: php >= 4.1.0, httpd, php-mysql, wordpress -BuildArch: noarch - -%description -This is a theme developed for the Fedora Project for -blogs.fedoraproject.org - -%prep -%setup -q -n wordpress-theme-fedora - -%build - -%install -rm -rf %{buildroot} - -mkdir -p %{buildroot}%{_datadir}/wordpress/wp-content/themes/fedora - -cp -pr * %{buildroot}%{_datadir}/wordpress/wp-content/themes/fedora - -# Remove empty files to make rpmlint happy -find %{buildroot} -empty -exec rm -f {} \; - -%clean -rm -rf %{buildroot} - -%files -%defattr(-,root,root,-) -%dir %{_datadir}/wordpress/wp-content/themes/fedora -%{_datadir}/wordpress/wp-content/themes/fedora/comments.php -%{_datadir}/wordpress/wp-content/themes/fedora/comments-popup.php -%{_datadir}/wordpress/wp-content/themes/fedora/foo.css -%{_datadir}/wordpress/wp-content/themes/fedora/footer.php -%{_datadir}/wordpress/wp-content/themes/fedora/functions.php -%{_datadir}/wordpress/wp-content/themes/fedora/header.php -%{_datadir}/wordpress/wp-content/themes/fedora/index.php -%{_datadir}/wordpress/wp-content/themes/fedora/rtl.css -%{_datadir}/wordpress/wp-content/themes/fedora/screenshot.png -%{_datadir}/wordpress/wp-content/themes/fedora/sidebar.php -%{_datadir}/wordpress/wp-content/themes/fedora/style.css -%{_datadir}/wordpress/wp-content/themes/fedora/wp-admin_images_logo-ghost.png -%{_datadir}/wordpress/wp-content/themes/fedora/wp-admin_images_logo.gif -%{_datadir}/wordpress/wp-content/themes/fedora/wp-admin_images_wordpress-logo.png -%{_datadir}/wordpress/wp-content/themes/fedora/wp-includes_images_wlw_wp-icon.png - -%changelog -* Wed Jun 24 2009 Nick Bebout - 1.0.2-1 -- initial version of wordpress-theme-fedora diff --git a/themes/wordpress-theme-fedora/wp-admin_images_logo-ghost.png b/themes/wordpress-theme-fedora/wp-admin_images_logo-ghost.png deleted file mode 100644 index e14d81b..0000000 Binary files a/themes/wordpress-theme-fedora/wp-admin_images_logo-ghost.png and /dev/null differ diff --git a/themes/wordpress-theme-fedora/wp-admin_images_logo.gif b/themes/wordpress-theme-fedora/wp-admin_images_logo.gif deleted file mode 100644 index f354ba9..0000000 Binary files a/themes/wordpress-theme-fedora/wp-admin_images_logo.gif and /dev/null differ diff --git a/themes/wordpress-theme-fedora/wp-admin_images_wordpress-logo.png b/themes/wordpress-theme-fedora/wp-admin_images_wordpress-logo.png deleted file mode 100644 index 9dd1e77..0000000 Binary files a/themes/wordpress-theme-fedora/wp-admin_images_wordpress-logo.png and /dev/null differ diff --git a/themes/wordpress-theme-fedora/wp-includes_images_wlw_wp-icon.png b/themes/wordpress-theme-fedora/wp-includes_images_wlw_wp-icon.png deleted file mode 100644 index 645ff68..0000000 Binary files a/themes/wordpress-theme-fedora/wp-includes_images_wlw_wp-icon.png and /dev/null differ