disable networking in Copr by default
by Pavel Raiskup
Just to be more pedantic and probably bit more secure, what about making
networking in copr opt-in (at least for new projects)?
If build of my package used internet arbitrarily, I would be warned very
early..
Also, in Koji we also do not have networking, so we can faster teach
(future) Fedora packagers.
Thanks for considering,
Pavel
7 years, 11 months
New release of Copr
by Miroslav Suchý
It is my pleasure to announce new version of Copr.
https://copr.fedoraproject.org/
What's new? Group projects!
When you log in. You can see in right column link "My Groups". There you can see list of your FAS groups and you can
activate them. In fact, you actually create alias for them. E.g. FAS group "gitmock" can be named "mock" in Copr.
You can click on Copr group in right column. That navigate you to url in format:
https://copr.fedoraproject.org/groups/g/mock/coprs/
Where are listed all projects of this group. And you can create new group project there too.
Every member of that FAS group can administer it and build there. Due to the OpenID limitations, you have to
log-out/log-in to see your groups (or whenever you join new group in FAS).
Since copr-cli-1.45 (in updates-testing right now) you can submit package to group project like:
copr-cli build @GROUP/PROJECT
e.g
copr-cli build @mock/mock-dev
Creation of group project is not possible from command line right now due OpenID restriction and you have to use WebUI.
This may change in near future.
There is no API method in APIv1. But we provide APIv2
http://copr-rest-api.readthedocs.org/en/latest/
which has methods to manipulate with groups.
To create new group in FAS, just follow:
https://admin.fedoraproject.org/accounts/group/new
If you have some personal project and you want to change it to group project, then please let me know and we change it
manually.
--
Miroslav Suchy, RHCA
Red Hat, Senior Software Engineer, #brno, #devexp, #fedora-buildsys
8 years
Python package for copr-cli and copr
by Sergio Oliveira
Hello,
I've the need of using copr-cli in other distros so I've decided to upload
it to PyPI. In order to do that I had to change the setup.py file in both
copr-cli and copr-python projects.
The problem is that the setup.py was importing the code it was supposed to
install and breaking because the dependencies weren't installed yet. To fix
that I've added a function that parses the content of the file looking for
it's version instead of importing it.
Doing that the installer is able to build the dependencies tree and look
for each dependency on the package index.
Also the Alpha classifier used was wrong so I've changed it from:
"Development Status :: 1 - Alpha"
to
"Development Status :: 3 - Alpha"
Last, I've updated the versions to use the tagged versions. You will find
my commits attached.
Cheers,
Sergio Oliveira
8 years, 1 month
Upload progress bar for copr-cli
by Sergio Oliveira
The attached patch implements a progress bar for uploading SRPMs.
Basically I've added a new "progress_callback" parameters to the
create_new_build (copr/python) function which is called for each chunk of
8192 bytes sent to the server. Then I've implemented the callback on the
copr-cli to update a bar object.
The bar format and library is the same than pip uses (see the screenshot
attached).[image: ss_progressbar.jpg] The lib I've used is available in the
fedora package python-progress but it's not available in EPEL. For that
reason I did not made that a hard dependency: if the python-progress is
installed the bar will show up, if not the lib just work as previously.
Is it possible to add python-progress to EPEL repo? If so I'd change the
spec to make copr-cli depend on it.
Cheers,
Sergio Oliveira
8 years, 1 month
[PATCH] [python][cli] allow insecure connection if configured
by Richard Marko
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
---
frontend/coprs_frontend/coprs/templates/api.html | 1 +
python/copr/README.rst | 3 ++-
python/copr/client/client.py | 14 +++++++++++---
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/templates/api.html b/frontend/coprs_frontend/coprs/templates/api.html
index 9944d0e..9732c08 100644
--- a/frontend/coprs_frontend/coprs/templates/api.html
+++ b/frontend/coprs_frontend/coprs/templates/api.html
@@ -35,6 +35,7 @@ login = {{ g.user.api_login }}
username = {{ g.user.name }}
token = {{ g.user.api_token }}
copr_url = {{ ('https://' + config['PUBLIC_COPR_HOSTNAME'])| fix_url_https_frontend}}
+# insecure = no # set to yes to allow insecure connection
# expiration date: {{ g.user.api_token_expiration }}
</pre>
diff --git a/python/copr/README.rst b/python/copr/README.rst
index 8b3f708..be42f9d 100644
--- a/python/copr/README.rst
+++ b/python/copr/README.rst
@@ -31,6 +31,7 @@ Usage:
token="<token from /api>",
username="<copr username>",
copr_url="<url copr instance ; optional>"
+ insecure="<allow insecure connection; boolean optional>"
)
Alternatively you could use configuration file:
@@ -44,5 +45,5 @@ Alternatively you could use configuration file:
username = <insert here your copr username>
token = <insert here your API token>
copr_url = <insert here copr url>
-
+ insecure = <allow insecure connection; boolean optional>
diff --git a/python/copr/client/client.py b/python/copr/client/client.py
index 63f1395..901c901 100644
--- a/python/copr/client/client.py
+++ b/python/copr/client/client.py
@@ -67,19 +67,22 @@ class CoprClient(UnicodeMixin):
"""
def __init__(self, username=None, login=None, token=None, copr_url=None,
- no_config=False):
+ no_config=False, insecure=False):
"""
:param unicode username: username used by default for all requests
:param unicode login: user login, used for identification
:param unicode token: copr api token
:param unicode copr_url: used as copr projects root
:param bool no_config: helper flag to indicate that no config was provided
+ :param bool insecure: allow insecure connection (no SSL
+ certificate checking)
"""
self.token = token
self.login = login
self.username = username
self.copr_url = copr_url or "http://copr.fedoraproject.org/"
+ self.insecure = insecure
self.no_config = no_config
@@ -111,7 +114,7 @@ class CoprClient(UnicodeMixin):
"""
- raw_config = configparser.ConfigParser()
+ raw_config = configparser.ConfigParser({"insecure": False})
if not filepath:
filepath = os.path.join(os.path.expanduser("~"), ".config", "copr")
config = {}
@@ -124,7 +127,9 @@ class CoprClient(UnicodeMixin):
raise CoprNoConfException()
else:
try:
- for field in ["username", "login", "token", "copr_url"]:
+ for field in ["username", "login", "token", "copr_url",
+ "insecure"]:
+
if six.PY3:
config[field] = raw_config["copr-cli"].get(field, None)
else:
@@ -170,6 +175,9 @@ class CoprClient(UnicodeMixin):
kwargs["data"] = data
if files is not None:
kwargs["files"] = files
+ if self.insecure:
+ log.warn("Using insecure connection")
+ kwargs["verify"] = False
if method not in ["get", "post", "head", "delete", "put"]:
raise Exception("Method {0} not allowed".format(method))
--
2.4.3
8 years, 1 month
New version of Copr (includes dist-git)
by Miroslav Suchý
It is my pleasure to announce that we just upgraded
https://copr.fedoraproject.org
It includes several major improvements:
* UI converted to PatternFly [1]. Most visible change is that tables
(e.g. list of builds) can be sorted using any column and you can filter
visible rows using any value.
* dist-git support -- We store your SRPM in dist-git now. It is not
accessible directly using fedpkg (it is in plan later). Dist-git is
browsable via cgit [2]. This allows us to offer you upload of SRPM
directly from your workstation. Just navigate to:
New Build -> Upload SRPM
or if you upgrade to python-copr-1.58-1 (submitted to updates just
today) then you can do:
copr-cli build name/project ./some.src.rpm
While we assume that uploading SRPM will be most popular method, we
preserved option to pass SRPM url.
You can see new state of your build - "Importing". It is obviously the
moment when we import your SRPM into dist-git.
* In project properties (Edit tab) you can now add you email if you want
to be contacted by users in case of some problems with your project.
* We improved queue handling of various architectures. This should fix
those long waiting time of PPC64LE builds.
[1] https://www.patternfly.org/
[2] http://copr-dist-git.fedorainfracloud.org/cgit/
Mirek Suchý
8 years, 1 month