Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit 660c350cff581fb0dfe4b845820426f4db404372
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Thu Oct 23 22:18:50 2014 +0200
[backend] new config option to define the public frontend api endpoint
---------------------------------------------------------------
backend/backend/mockremote.py | 8 ++++++--
backend/copr-be.conf.example | 2 +-
backend/copr-be.py | 8 +++++++-
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/backend/backend/mockremote.py b/backend/backend/mockremote.py
index 90ff0e9..0dfb7f1 100755
--- a/backend/backend/mockremote.py
+++ b/backend/backend/mockremote.py
@@ -775,11 +775,15 @@ class MockRemote(object):
built_pkgs.append(pkg)
# createrepo with the new pkgs
+ self.callback.log("Createrepo:: macros: {}; front url: {};
path: {}".format(
+ self.macros, self.front_url, chroot_dir
+ ))
_, _, err = createrepo(
- path=chroot_dir, lock=self.lock,
+ path=chroot_dir,
front_url=self.front_url,
username=self.macros["copr_username"],
- projectname=self.macros["copr_projectname"]
+ projectname=self.macros["copr_projectname"],
+ lock=self.lock,
)
if err.strip():
self.callback.error(
diff --git a/backend/copr-be.conf.example b/backend/copr-be.conf.example
index d355298..0ae59bc 100644
--- a/backend/copr-be.conf.example
+++ b/backend/copr-be.conf.example
@@ -4,9 +4,9 @@
# default is
http://copr
results_baseurl=https://copr-be.cloud.fedoraproject.org/results
-# ??? What is this
# default is
http://coprs/rest/api
frontend_url=https://copr-fe.cloud.fedoraproject.org/backend
+frontend_base_url=http://copr-fe-dev.cloud.fedoraproject.org
# must have same value as BACKEND_PASSWORD from have frontend in /etc/copr/copr.conf
# default is PASSWORDHERE but you really should change it. really.
diff --git a/backend/copr-be.py b/backend/copr-be.py
index 11af0a5..52c95a8 100755
--- a/backend/copr-be.py
+++ b/backend/copr-be.py
@@ -230,7 +230,6 @@ class CoprBackend(object):
if not os.path.exists(self.opts.worker_logdir):
os.makedirs(self.opts.worker_logdir, mode=0o750)
-
def event(self, what):
self.events.put({"when": time.time(), "who":
"main", "what": what})
@@ -242,8 +241,15 @@ class CoprBackend(object):
cp.read(self.config_file)
opts.results_baseurl = _get_conf(
cp, "backend", "results_baseurl",
"http://copr")
+
+ #TODO: this should be built from frontend_base_url + '/backend'
opts.frontend_url = _get_conf(
cp, "backend", "frontend_url",
"http://coprs/rest/api")
+
+ # We need this to access public api
+ opts.frontend_base_url = _get_conf(
+ cp, "backend", "frontend_base_url",
"http://coprs/")
+
opts.frontend_auth = _get_conf(
cp, "backend", "frontend_auth",
"PASSWORDHERE")