[mirrormanager] master: handle disappearing HostCategoryDirs during report_mirror checkin (61cf0a4)
by Matt Domsch
Repository : http://git.fedorahosted.org/cgit/
On branch : master
>---------------------------------------------------------------
commit 61cf0a47c0f00bbd4419174441763ec46a8a1566
Author: Matt Domsch <matt(a)domsch.com>
Date: Tue Jan 28 18:31:39 2014 -0600
handle disappearing HostCategoryDirs during report_mirror checkin
The crawler could run in parallel and delete these while we're
looking at them, leading to a traceback. This at least limits the
use-after-free induced failures.
https://fedorahosted.org/mirrormanager/ticket/48
>---------------------------------------------------------------
server/mirrormanager/model.py | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/server/mirrormanager/model.py b/server/mirrormanager/model.py
index 8ea815e..2484a8a 100644
--- a/server/mirrormanager/model.py
+++ b/server/mirrormanager/model.py
@@ -291,15 +291,22 @@ class Host(SQLObject):
dname = hc.category.topdir.name
# Don't create an entry for a directory the database doesn't know about
+ # and if a crawler created it so we hit a unique violation, then we don't have to
try:
- dir = Directory.byName(dname)
- hcdir = HostCategoryDir(host_category=hc, path=d, directory=dir)
+ directory = Directory.byName(dname)
+ hcdir = HostCategoryDir(host_category=hc, path=d, directory=directory)
added += 1
except:
pass
- for d in HostCategoryDir.selectBy(host_category=hc):
- if d.path not in config[c]['dirtree'].keys():
- d.destroySelf()
+ for hcdir in hc.dirs:
+ # handle disappearing hcdirs, deleted by other processes
+ try:
+ hcdirpath = hcdir.path
+ except: continue
+ if hcdirpath not in config[c]['dirtree'].keys():
+ try:
+ hcdir.destroySelf()
+ except: pass
deleted += 1
message += "Category %s directories updated: %s added: %s deleted %s\n" % (category.name, marked_up2date, added, deleted)
10 years, 3 months
[mirrormanager] master: handle tg_errors that are unicode strings (0f1b4c4)
by Matt Domsch
Repository : http://git.fedorahosted.org/cgit/
On branch : master
>---------------------------------------------------------------
commit 0f1b4c4cb51bfd6f7fed80983e956db3ba77b8ac
Author: Matt Domsch <matt(a)domsch.com>
Date: Tue Jan 28 17:09:52 2014 -0600
handle tg_errors that are unicode strings
Fixes https://fedorahosted.org/mirrormanager/ticket/50
>---------------------------------------------------------------
server/mirrormanager/lib.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/server/mirrormanager/lib.py b/server/mirrormanager/lib.py
index b78884a..a88fbd8 100644
--- a/server/mirrormanager/lib.py
+++ b/server/mirrormanager/lib.py
@@ -15,7 +15,7 @@ def createErrorString(tg_errors):
if type(tg_errors) == types.DictType:
for param, inv in tg_errors.items():
- if type(inv) == types.StringType:
+ if type(inv) == types.StringType or type(inv) == types.UnicodeType:
errors.append("%s: %s"%(param, inv))
else:
errors.append("%s(%s): %s"%(param, inv.value, inv.msg))
10 years, 3 months
[mirrormanager] master: fix /rsyncFilters endpoint (b223dd4)
by Matt Domsch
Repository : http://git.fedorahosted.org/cgit/
On branch : master
>---------------------------------------------------------------
commit b223dd4daff836b8cb64e3ea1e0049b728af5569
Author: Matt Domsch <matt(a)domsch.com>
Date: Tue Jan 28 16:02:41 2014 -0600
fix /rsyncFilters endpoint
We were calling the wrong template, due to a cut-and-paste error
moving to the new template abstraction routines.
>---------------------------------------------------------------
server/mirrormanager/controllers.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/mirrormanager/controllers.py b/server/mirrormanager/controllers.py
index 756ce69..aae01b8 100644
--- a/server/mirrormanager/controllers.py
+++ b/server/mirrormanager/controllers.py
@@ -914,13 +914,13 @@ class Root(controllers.RootController):
num_prefix = num_prefix_components(stripprefix)
except KeyError:
message=u'Missing categories, since, or stripprefix arguments'
- return project_dict('rsync_acl', includes=[], excludes=excludes, message=message)
+ return project_dict('rsyncFilter', includes=[], excludes=excludes, message=message)
try:
since = int(since)
except:
message=u'value of argument since is not an integer'
- return project_dict('rsync_acl', includes=[], excludes=excludes, message=message)
+ return project_dict('rsyncFilter', includes=[], excludes=excludes, message=message)
includes = set()
categories_requested = c.split(',')
@@ -935,7 +935,7 @@ class Root(controllers.RootController):
# add trailing slash as rsync wants it
for i in xrange(len(includes)):
includes[i] += u'/'
- return project_dict('rsync_acl', includes=includes, excludes=excludes, message=message)
+ return project_dict('rsyncFilter', includes=includes, excludes=excludes, message=message)
def fedora_login(self, forward_url=None, previous_url=None, *args, **kw):
login_dict = fc_login(forward_url, previous_url, args, kw)
10 years, 3 months
[mirrormanager] master: bump version to 1.4.4 (5acff27)
by Matt Domsch
Repository : http://git.fedorahosted.org/cgit/
On branch : master
>---------------------------------------------------------------
commit 5acff2700fd064d9cdc96fb58e29341a7bd8116e
Author: Matt Domsch <matt(a)domsch.com>
Date: Tue Jan 21 23:35:09 2014 -0600
bump version to 1.4.4
>---------------------------------------------------------------
Makefile | 4 ++--
mirrormanager.spec.in | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 2fd533b..2a5e4fa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
-RELEASE_DATE := "18-Dec-2013"
+RELEASE_DATE := "21-Jan-2014"
RELEASE_MAJOR := 1
RELEASE_MINOR := 4
-RELEASE_EXTRALEVEL := .3
+RELEASE_EXTRALEVEL := .4
RELEASE_NAME := mirrormanager
RELEASE_VERSION := $(RELEASE_MAJOR).$(RELEASE_MINOR)$(RELEASE_EXTRALEVEL)
RELEASE_STRING := $(RELEASE_NAME)-$(RELEASE_VERSION)
diff --git a/mirrormanager.spec.in b/mirrormanager.spec.in
index de84f4c..b6cc80f 100644
--- a/mirrormanager.spec.in
+++ b/mirrormanager.spec.in
@@ -98,6 +98,9 @@ exit 0
%doc LICENSES LICENSE-GPLv2
%changelog
+* Tue Jan 21 2014 Matt Domsch <mdomsch(a)fedoraproject.org> - 1.4.4-1
+- upstream bugfix release
+
* Wed Dec 18 2013 Matt Domsch <mdomsch(a)fedoraproject.org> - 1.4.3-1
- upstream bugfix release
- Reduce Fedora-isms to make it more usable for other distributions
10 years, 3 months
[mirrormanager] master: move setsebool into a comment in the config files (8afa736)
by Matt Domsch
Repository : http://git.fedorahosted.org/cgit/
On branch : master
>---------------------------------------------------------------
commit 8afa7366d1332c94c1d2729c195f558bfb9395e6
Author: Matt Domsch <matt(a)domsch.com>
Date: Tue Jan 21 09:00:43 2014 -0600
move setsebool into a comment in the config files
If the database is local, there's no need to run setsebool in %post.
We can't know that, it's a config file setting, so, just tell the
admin to do it.
>---------------------------------------------------------------
mirrormanager.spec.in | 4 ----
server/dev.cfg | 4 ++++
server/prod.cfg.example | 3 +++
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/mirrormanager.spec.in b/mirrormanager.spec.in
index 2c7538c..de84f4c 100644
--- a/mirrormanager.spec.in
+++ b/mirrormanager.spec.in
@@ -62,10 +62,6 @@ getent passwd mirrormanager >/dev/null || \
-c "MirrorManager" mirrormanager
exit 0
-%post
-setsebool -P httpd_can_network_connect_db 1
-exit 0
-
%files
%defattr(-,root,root,-)
diff --git a/server/dev.cfg b/server/dev.cfg
index 6391da1..262a478 100644
--- a/server/dev.cfg
+++ b/server/dev.cfg
@@ -108,6 +108,10 @@ sqlobject.dburi="notrans_postgres://postgres@127.0.0.1/mirrormanager"
# for Windows users, sqlite URIs look like:
# sqlobject.dburi="sqlite:///drive_letter:/path/to/file"
+# Note: If you are using a database on another server, over a network socket,
+# and selinux is enabled, you will need to run:
+# sudo setsebool -P httpd_can_network_connect_db 1
+
# SERVER
# Some server parameters that you may want to tweak
diff --git a/server/prod.cfg.example b/server/prod.cfg.example
index e4a2fea..c8ff204 100644
--- a/server/prod.cfg.example
+++ b/server/prod.cfg.example
@@ -57,6 +57,9 @@ mrr.repos = ''' {
# sqlobject.dburi="notrans_postgres://mirrormanager@127.0.0.1/mirrormanager"
# sqlobject.dburi="notrans_mysql://username:password@hostname:port/databasename"
# Note: MirrorManager doesn't use Transactions, so preceed with 'notrans_' as shown.
+# Note: If you are using a database on another server, over a network socket,
+# and selinux is enabled, you will need to run:
+# sudo setsebool -P httpd_can_network_connect_db 1
sqlobject.dburi="notrans_sqlite:///var/lib/mirrormanager/sqlite.db"
10 years, 3 months
[mirrormanager] master: apache conf: explicitly allow /publiclist URLs (0df65d1)
by Matt Domsch
Repository : http://git.fedorahosted.org/cgit/
On branch : master
>---------------------------------------------------------------
commit 0df65d18ba69c7992f06b67f1037884e0fd8a098
Author: Matt Domsch <matt(a)domsch.com>
Date: Wed Jan 8 11:32:52 2014 -0600
apache conf: explicitly allow /publiclist URLs
>---------------------------------------------------------------
mirrorlist-server/apache/mirrorlist-server.conf | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/mirrorlist-server/apache/mirrorlist-server.conf b/mirrorlist-server/apache/mirrorlist-server.conf
index 2858c63..9295787 100644
--- a/mirrorlist-server/apache/mirrorlist-server.conf
+++ b/mirrorlist-server/apache/mirrorlist-server.conf
@@ -40,3 +40,15 @@ WSGIScriptAlias /mirrorlist /usr/share/mirrormanager/mirrorlist-server/mirrorlis
Allow from all
</IfModule>
</Location>
+
+<Location /publiclist>
+ <IfModule mod_authz_core.c>
+ # Apache 2.4
+ Require all granted
+ </IfModule>
+ <IfModule !mod_authz_core.c>
+ # Apache 2.2
+ Order deny,allow
+ Allow from all
+ </IfModule>
+</Location>
10 years, 3 months
[mirrormanager] master: spec: add setsebool httpd_can_network_connect_db 1 (4f51dae)
by Matt Domsch
Repository : http://git.fedorahosted.org/cgit/
On branch : master
>---------------------------------------------------------------
commit 4f51daee4de35b1cfc502190656dbbcd196d7264
Author: Matt Domsch <matt(a)domsch.com>
Date: Wed Jan 8 11:16:24 2014 -0600
spec: add setsebool httpd_can_network_connect_db 1
so that the mirrormanager WSGI, running under httpd, can talk to its database.
>---------------------------------------------------------------
mirrormanager.spec.in | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/mirrormanager.spec.in b/mirrormanager.spec.in
index 6c70c11..2c7538c 100644
--- a/mirrormanager.spec.in
+++ b/mirrormanager.spec.in
@@ -62,6 +62,11 @@ getent passwd mirrormanager >/dev/null || \
-c "MirrorManager" mirrormanager
exit 0
+%post
+setsebool -P httpd_can_network_connect_db 1
+exit 0
+
+
%files
%defattr(-,root,root,-)
%{_datadir}/%{name}
10 years, 3 months