Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

CIRCLE / cloud

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 94
  • Merge Requests 10
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Merged
Merge request !109 opened Jun 30, 2014 by Guba Sándor@gubasandor 
  • Report abuse
Report abuse

Feature Store

✅ Add SMB and Quota parameter ✅ Handle private_keys for sshfs and pair it with django_sshkey (Is the hook ready?) ✅ Web interface 🚧 Show user scp/sftp info ✅ Fix tests and it's complete.

  • Discussion 23
  • Commits 72
  • Changes
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Guba Sándor @gubasandor

    mentioned in issue #175 (closed)

    Jul 02, 2014

    mentioned in issue #175 (closed)

    mentioned in issue #175
    Toggle commit list
  • Őry Máté
    @orymate started a discussion on commit 522799dc Jul 09, 2014
    circle/dashboard/models.py
    100 102 verbose_name=_('Samba password'),
    101 103 help_text=_(
    102 104 'Generated password for accessing store from '
    103 'Windows.'))
    105 'Windows.'),
    • Őry Máté @orymate commented Jul 09, 2014
      Owner

      s/Windows/virtual machines/

      Edited Jul 23, 2014
      ~~s/Windows/virtual machines/~~
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on the diff Jul 14, 2014
    Last updated by Bach Dániel Jul 15, 2014
    circle/dashboard/migrations/0010_auto__add_field_profile_smb_password__add_field_profile_disk_quota.py
    1 # -*- coding: utf-8 -*-
    2 from south.utils import datetime_utils as datetime
    3 from south.db import db
    4 from south.v2 import SchemaMigration
    5 from django.db import models
    6
    7
    8 class Migration(SchemaMigration):
    9
    10 def forwards(self, orm):
    11 # Adding field 'Profile.smb_password'
    12 db.add_column(u'dashboard_profile', 'smb_password',
    13 self.gf('django.db.models.fields.CharField')(default='asdasd', max_length=20),
    • Őry Máté @orymate commented Jul 14, 2014
      Owner

      huh?

      huh?
    • Bach Dániel @bachdaniel commented Jul 15, 2014
      Owner

      asdasd

      asdasd
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jul 14, 2014
    Last updated by Őry Máté Jul 21, 2014
    circle/dashboard/models.py
    179 195 if not user.pk:
    180 196 return False
    181 197 profile, created = Profile.objects.get_or_create(user=user)
    198
    199 if created:
    200 user_home = "u-%d" % user.pk
    201 if not store_api.userexist(user_home):
    202 store_api.createuser(user_home, profile.smb_password, None,
    • Őry Máté @orymate commented Jul 14, 2014
      Owner

      does this fail if user already exists (i.e. is there a race condition here)? shouldn't we recreate user if she surely gets a new random smb password?

      does this fail if user already exists (i.e. is there a race condition here)? shouldn't we recreate user if she surely gets a new random smb password?
    • Őry Máté @orymate commented Jul 21, 2014
      Owner

      https://git.ik.bme.hu/circle/storeserver/issues/1 (pinged)

      Edited Jul 28, 2014
      https://git.ik.bme.hu/circle/storeserver/issues/1 (pinged)
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jul 14, 2014
    circle/dashboard/static/dashboard/store.js
    41 $("#store-list-container").on("fileselect", "#store-upload-file", function(event, numFiles, label) {
    42 var input = $("#store-upload-filename");
    43 var log = numFiles > 1 ? numFiles + ' files selected' : label;
    44 if(input.length) {
    45 input.val(log);
    46 }
    47 if(log) {
    48 $('#store-upload-form button[type="submit"]').prop("disabled", false);
    49
    50 } else {
    51 $('#store-upload-form button[type="submit"]').prop("disabled", true);
    52 }
    53 });
    54
    55
    56 /* this does not work
    • Őry Máté @orymate commented Jul 14, 2014
      Owner

      why commit it then?

      why commit it then?
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on the diff Jul 14, 2014
    circle/dashboard/store_api.py
    22 def get_request_arguments(ssl_auth, basic_auth):
    23 args = {
    24 'verify': settings.STORE_VERIFY_SSL,
    25 'cert': (settings.STORE_CLIENT_CERT, settings.STORE_CLIENT_KEY),
    26 'auth': (settings.STORE_CLIENT_USER, settings.STORE_CLIENT_PASSWORD),
    27 }
    28 if ssl_auth and basic_auth:
    29 pass
    30 elif ssl_auth:
    31 del args['auth']
    32 elif basic_auth:
    33 del args['cert']
    34 else:
    35 del args['cert']
    36 del args['auth']
    37
    • Őry Máté @orymate commented Jul 14, 2014
      Owner

      what? fixed

      Edited Jul 21, 2014
      ~~what?~~ fixed
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jul 14, 2014
    circle/dashboard/store_api.py
    35 del args['cert']
    36 del args['auth']
    37
    38 return args
    39
    40
    41 def post_request(url, payload, timeout=None):
    42 try:
    43 headers = {'content-type': 'application/json'}
    44 r = requests.post(url, data=payload, headers=headers, timeout=timeout,
    45 **get_request_arguments(settings.STORE_SSL_AUTH,
    46 settings.STORE_BASIC_AUTH))
    47 return r
    48 except Exception as e:
    49 logger.error("Error in store POST: %s" % e)
    50 dummy = Mock()
    • Őry Máté @orymate commented Jul 14, 2014
      Owner

      at least mark with # FIXME workaround fixed with rewrite

      Edited Jul 21, 2014
      ~~at least mark with ```# FIXME workaround```~~ fixed with rewrite
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jul 14, 2014
    circle/dashboard/store_api.py
    41 def post_request(url, payload, timeout=None):
    42 try:
    43 headers = {'content-type': 'application/json'}
    44 r = requests.post(url, data=payload, headers=headers, timeout=timeout,
    45 **get_request_arguments(settings.STORE_SSL_AUTH,
    46 settings.STORE_BASIC_AUTH))
    47 return r
    48 except Exception as e:
    49 logger.error("Error in store POST: %s" % e)
    50 dummy = Mock()
    51 setattr(dummy, "status_code", 200)
    52 setattr(dummy, "content", "[]")
    53 return dummy
    54
    55
    56 def get_request(url, timeout=None):
    • Őry Máté @orymate commented Jul 14, 2014
      Owner

      still a hardly modified dup of the previous function fixed with rewrite

      Edited Jul 21, 2014
      ~~still a hardly modified dup of the previous function~~ fixed with rewrite
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jul 14, 2014
    circle/dashboard/store_api.py
    56 def get_request(url, timeout=None):
    57 try:
    58 headers = {'content-type': 'application/json'}
    59 r = requests.get(url, headers=headers, timeout=timeout,
    60 **get_request_arguments(settings.STORE_SSL_AUTH,
    61 settings.STORE_BASIC_AUTH))
    62 return r
    63 except Exception as e:
    64 logger.error("Error in store GET: %s" % e)
    65 dummy = Mock()
    66 setattr(dummy, "status_code", 200)
    67 setattr(dummy, "content", "[]")
    68 return dummy
    69
    70
    71 def listfolder(neptun, path):
    • Őry Máté @orymate commented Jul 14, 2014
      Owner

      forget neptun, please fixed with rewrite

      Edited Jul 21, 2014
      ~~forget neptun, please~~ fixed with rewrite
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jul 14, 2014
    circle/dashboard/store_api.py
    61 settings.STORE_BASIC_AUTH))
    62 return r
    63 except Exception as e:
    64 logger.error("Error in store GET: %s" % e)
    65 dummy = Mock()
    66 setattr(dummy, "status_code", 200)
    67 setattr(dummy, "content", "[]")
    68 return dummy
    69
    70
    71 def listfolder(neptun, path):
    72 url = settings.STORE_URL + '/' + neptun
    73 payload = json.dumps({'CMD': 'LIST', 'PATH': path})
    74 r = post_request(url, payload, timeout=5)
    75 if r.status_code == requests.codes.ok:
    76 tupplelist = json.loads(r.content)
    • Őry Máté @orymate commented Jul 14, 2014
      Owner

      ppp fixed with rewrite

      Edited Jul 21, 2014
      ~~ppp~~ fixed with rewrite
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on the diff Jul 14, 2014
    circle/dashboard/views.py
    3168 reverse("dashboard.views.store-list"),
    3169 os.path.dirname(os.path.dirname(path)),
    3170 ))
    3171 else:
    3172 return redirect("%s?directory=%s" % (
    3173 reverse("dashboard.views.store-list"),
    3174 os.path.dirname(path),
    3175 ))
    3176
    3177
    3178 @require_POST
    3179 @login_required
    3180 def store_new_directory(request):
    3181 user_home = "u-%d" % request.user.pk
    3182 path = request.POST.get("path")
    3183 name = request.POST.get("name")
    • Őry Máté @orymate commented Jul 14, 2014
      Owner

      is this validated?

      is this validated?
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jul 20, 2014
    circle/dashboard/models.py
    95 99 email_notifications = BooleanField(
    96 100 verbose_name=_("Email notifications"), default=True,
    97 101 help_text=_('Whether user wants to get digested email notifications.'))
    102 smb_password = CharField(
    103 max_length=20,
    104 verbose_name=_('Samba password'),
    105 help_text=_(
    106 'Generated password for accessing store from '
    107 'virtual machines.'),
    108 default=pwgen,
    109 )
    110 disk_quota = IntegerField(
    • Őry Máté @orymate commented Jul 20, 2014
      Owner

      we have sizefield

      Edited Jul 23, 2014
      ~~we have sizefield~~
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jul 20, 2014
    circle/circle/settings/base.py
    446 446 else:
    447 447 GRAPHITE_URL = None
    448 448  
    449 STORE_BASIC_AUTH = get_env_variable("STORE_BASIC_AUTH") == "True"
    • Őry Máté @orymate commented Jul 20, 2014
      Owner

      store is a mandatory circle component?

      Edited Jul 23, 2014
      ~~store is a mandatory circle component?~~
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on the diff Jul 20, 2014
    circle/dashboard/templates/dashboard/store/_list-box.html
    1 {% load i18n %}
    2
    3 <div class="list-group" id="store-list-list">
    4 <a href="{% url "dashboard.views.store-list" %}?directory={{ up_url }}"
    • Őry Máté @orymate commented Jul 20, 2014
      Owner

      could hide this in top level dir

      Edited Jul 28, 2014
      ~~could hide this in top level dir~~
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on the diff Jul 20, 2014
    circle/dashboard/static/dashboard/dashboard.js
    558 559 }
    559 560 return cookieValue;
    560 561 }
    562
    563
    564 /* no js compatibility */
    • Őry Máté @orymate commented Jul 20, 2014
      Owner
      body.nojs .js-only, body.js .js-hidden {
        display: none;
      }
      <body class="nojs">
      $("body").toggleClass("nojs").toggleClass("js")
      Edited Jul 20, 2014
      ```css body.nojs .js-only, body.js .js-hidden { display: none; } ``` ```html <body class="nojs"> ``` ```javascript $("body").toggleClass("nojs").toggleClass("js") ```
    Please register or sign in to reply
  • Bach Dániel
    @bachdaniel started a discussion on commit e98b628f Jul 20, 2014
    • Bach Dániel @bachdaniel commented Jul 20, 2014
      Owner

      :trollface:

      :trollface:
    Please register or sign in to reply
  • Guba Sándor @gubasandor commented Jul 21, 2014
    Owner
    • Download folder button missing
    • Review file browser layout
    • Shorten long file names in the toplist
    - Download folder button missing - Review file browser layout - Shorten long file names in the toplist
  • Bach Dániel
    @bachdaniel started a discussion on commit 4816e34a Jul 21, 2014
    Last updated by Kálmán Viktor Jul 21, 2014
    circle/dashboard/store_api.py
    58 return response
    32 59  
    33 def post_request(url, payload, timeout=None):
    34 try:
    35 headers = {'content-type': 'application/json'}
    36 r = requests.post(url, data=payload, headers=headers, timeout=timeout,
    37 **get_request_arguments())
    38 return r
    39 except Exception as e:
    40 logger.error("Error in store POST: %s" % e)
    41 dummy = Mock()
    42 setattr(dummy, "status_code", 200)
    43 setattr(dummy, "content", "[]")
    44 return dummy
    60 def _request_cmd(self, cmd, **kwargs):
    61 return self._request(self.username, post, CMD=cmd)
    • Bach Dániel @bachdaniel commented Jul 21, 2014
      Owner

      kwargs?

      Edited Jul 23, 2014
      ~~kwargs?~~
    • Kálmán Viktor @kviktor commented Jul 21, 2014
      Owner

      a846fe3c

      a846fe3cd
    Please register or sign in to reply
  • Kálmán Viktor
    @kviktor started a discussion on commit a846fe3c Jul 21, 2014
    Please register or sign in to reply
  • Bach Dániel
    @bachdaniel started a discussion on commit 4816e34a Jul 21, 2014
    circle/dashboard/store_api.py
    81 92  
    93 def rename(self, old_path, new_name):
    94 self._request_cmd("RENAME", PATH=old_path, NEW_NAME=new_name)
    82 95  
    83 def requestdownload(neptun, path):
    84 url = settings.STORE_URL + '/' + neptun
    85 payload = json.dumps({'CMD': 'DOWNLOAD', 'PATH': path})
    86 r = post_request(url, payload)
    87 response = json.loads(r.content)
    88 return response['LINK']
    96 def get_quota(self): # no CMD? :o
    97 r = self._request(self.username)
    98 return r.json()
    89 99  
    100 def set_quota(self, quota):
    101 self._request(self.username + "/quota/", post, QUOTA=quota)
    • Bach Dániel @bachdaniel commented Jul 21, 2014
      Owner
      -       self._request(self.username + "/quota/", post, QUOTA=quota)
      +       self._request("/quota/" + self.username, post, QUOTA=quota)
      Edited Jul 21, 2014
      ```diff - self._request(self.username + "/quota/", post, QUOTA=quota) + self._request("/quota/" + self.username, post, QUOTA=quota) ```
    Please register or sign in to reply
  • Bach Dániel
    @bachdaniel started a discussion on an old version of the diff Jul 23, 2014
    circle/dashboard/store_api.py
    72 result = r.json()
    73 if process:
    74 return self._process_list(result)
    75 else:
    76 return result
    77
    78 def toplist(self, process=True):
    79 r = self._request_cmd("TOPLIST")
    80 result = r.json()
    81 if process:
    82 return self._process_list(result)
    83 else:
    84 return result
    85
    86 def request_download(self, path):
    87 r = self._request_cmd("DOWNLOAD", PATH=path, timeout=10)
    • Bach Dániel @bachdaniel commented Jul 23, 2014
      Owner

      :trollface:

      :trollface:
    Please register or sign in to reply
  • Bach Dániel
    @bachdaniel started a discussion on an old version of the diff Jul 23, 2014
    circle/dashboard/views.py
    20 21 from collections import OrderedDict
    21 22 from itertools import chain
    22 23 from os import getenv
    24 from os.path import join, normpath, dirname
    25 import os
    • Bach Dániel @bachdaniel commented Jul 23, 2014
      Owner

      🐕 💻 (fixed)

      Edited Jul 28, 2014
      ~~:dog2: :computer:~~ (fixed)
    Please register or sign in to reply
  • Kálmán Viktor
    @kviktor started a discussion on commit 28fc85f7 Jul 26, 2014
    • Kálmán Viktor @kviktor

      mentioned in issue #219 (closed)

      Jul 26, 2014

      mentioned in issue #219 (closed)

      mentioned in issue #219
      Toggle commit list
    Please register or sign in to reply
  • Write
  • Preview
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 sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
3
3 participants
Reference: circle/cloud!109