1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 10:58:33 +00:00

[v2] improvements ('random_key' --> 'file_key', and etc)

* 'KEEP_ENC_REPO_PASSWD' --> 'SERVER_CRYPTO'
* random_key --> file_key. added client_crypto.js
* file upload/update: don't encrypt when file size is 0
* combine 'sjcl.min.js' and 'codecBytes.js' into 'sjcl.js'
* added 'repo_create_js_fils.html', 'included' it
This commit is contained in:
llj
2013-10-17 10:57:05 +08:00
parent 2e270ca45e
commit df16f6f312
17 changed files with 177 additions and 143 deletions

View File

@@ -25,7 +25,7 @@ from seahub.signals import repo_created
from seahub.utils import check_filename_with_rename
from seahub.utils import check_filename_with_rename, EMPTY_SHA1, gen_block_get_url
from seahub.utils.star import star_file, unstar_file
from seahub.settings import KEEP_ENC_REPO_PASSWD
from seahub.settings import SERVER_CRYPTO
# Get an instance of a logger
logger = logging.getLogger(__name__)
@@ -184,7 +184,7 @@ def list_dir(request, repo_id):
status=403, content_type=content_type)
if repo.encrypted and \
(repo.enc_version == 1 or (repo.enc_version == 2 and KEEP_ENC_REPO_PASSWD)) \
(repo.enc_version == 1 or (repo.enc_version == 2 and SERVER_CRYPTO)) \
and not seafile_api.is_password_set(repo.id, username):
err_msg = _(u'Library is encrypted.')
return HttpResponse(json.dumps({'error': err_msg}),
@@ -250,7 +250,7 @@ def list_dir_more(request, repo_id):
status=403, content_type=content_type)
if repo.encrypted and \
(repo.enc_version == 1 or (repo.enc_version == 2 and KEEP_ENC_REPO_PASSWD)) \
(repo.enc_version == 1 or (repo.enc_version == 2 and SERVER_CRYPTO)) \
and not seafile_api.is_password_set(repo.id, username):
err_msg = _(u'Library is encrypted.')
return HttpResponse(json.dumps({'error': err_msg}),
@@ -865,7 +865,7 @@ def get_current_commit(request, repo_id):
status=403, content_type=content_type)
if repo.encrypted and \
(repo.enc_version == 1 or (repo.enc_version == 2 and KEEP_ENC_REPO_PASSWD)) \
(repo.enc_version == 1 or (repo.enc_version == 2 and SERVER_CRYPTO)) \
and not seafile_api.is_password_set(repo.id, username):
err_msg = _(u'Library is encrypted.')
return HttpResponse(json.dumps({'error': err_msg}),