Commit 2fc732bb authored by Nik Khlestov's avatar Nik Khlestov

Update for imperfect ssl at teonite.com.

parent 04cb572a
Pipeline #17569 passed with stage
in 1 minute and 18 seconds
......@@ -79,6 +79,11 @@ If you don't want to remember distribution site url for pypi or dockerhub (as it
uptr package dockerhub -d postgres -p 9.6.8
uptr package pypi -d Django -p 1.11
```
For github, so that you don't have to invent package name, you can run:
```
utrp package github -m http://github.com/docker/docker -p 16.01.0
```
This way you'll have `/docker/docker` name created automatically.
To see packages list, run:
```
......
......@@ -8,7 +8,7 @@ def readme():
setup(
name='uptr',
version='0.0.6',
version='0.0.7',
description='Command line interface for update tracker.',
long_description=readme(),
long_description_content_type="text/markdown",
......
......@@ -14,10 +14,13 @@ class ClientConfiguration(Configuration):
CONF_PATHS = [GLOBAL_CONFIG_FILE, USER_CONFIG_FILE, PROJECT_CONFIG_FILE]
token = None
address = 'http://10.11.0.211/'
# address = 'https://uptr.teonite.net/'
# address = 'http://10.11.0.211/'
address = 'https://uptr.teonite.net'
project_id = 0
# TODO: turn this off when we have correct https credentials
import urllib3
urllib3.disable_warnings()
settings = ClientConfiguration.load()
session = requests.Session()
......
......@@ -41,7 +41,7 @@ def upsert(ctx, distname, master_site, package_version):
to omit writing a site.
"""
url = settings.address + '/api/projects/%s/packages/' % ctx.obj['project_id']
resp = session.post(url, data={
resp = session.post(url, verify=False, data={
'distname': distname,
'master_site': master_site,
'version': package_version
......@@ -103,7 +103,7 @@ def list(ctx):
Format (tab-delimited): name, current version, latest version, master site, id.
"""
url = settings.address + '/api/projects/%s/packages/' % ctx.obj['project_id']
resp = session.get(url)
resp = session.get(url, verify=False)
data = resp.json()
echo_data = []
for item in data:
......@@ -127,7 +127,7 @@ def list(ctx):
def delete(ctx, package_id):
"""Stop tracking a package."""
url = settings.address + '/api/projects/%s/packages/%s' % (ctx.obj['project_id'], package_id)
resp = session.delete(url)
resp = session.delete(url, verify=False)
if resp.status_code == 404:
click.echo('NO PACKAGE')
sys.exit(1)
......
......@@ -18,7 +18,7 @@ def project():
def start(name):
"""Track new project."""
url = settings.address + '/api/projects/'
resp = session.post(url, data={'name': name})
resp = session.post(url, data={'name': name}, verify=False)
if resp.status_code != 201:
click.get_current_context().fail(message='Failed to create new project')
sys.exit(1)
......@@ -39,7 +39,7 @@ def list():
List all tracked projects.\n
Format (tab-delimited): name, id, is_pinned. """
url = settings.address + '/api/projects/'
resp = session.get(url).json()
resp = session.get(url, verify=False).json()
notification_message = []
for p in resp:
is_pinned_mark = 'PINNED' if int(p['id']) == settings.project_id else ''
......
......@@ -16,7 +16,7 @@ def user():
@click.option('--password', '-p', envvar='PASSWORD', required=True)
def register(email, password):
url = settings.address + '/api/auth/register/'
resp = session.post(url, data={
resp = session.post(url, verify=False, data={
'email': email,
'password': password,
'password_confirm': password,
......@@ -35,7 +35,7 @@ def register(email, password):
@click.option('--signature', '-s', required=True)
def verify(user_uuid, timestamp, signature):
url = settings.address + '/api/auth/verify-registration/'
resp = session.post(url, data={
resp = session.post(url, verify=False, data={
'user_id': user_uuid,
'timestamp': timestamp,
'signature': signature,
......@@ -52,7 +52,7 @@ def verify(user_uuid, timestamp, signature):
@click.option('--password', '-p', envvar='PASSWORD', required=True)
def login(email, password):
url = settings.address + '/api/auth/login/'
resp = session.post(url, data={
resp = session.post(url, verify=False, data={
'login': email,
'password': password
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment