зеркало из https://github.com/nextcloud/passman.git
Fix MC
This commit is contained in:
Коммит
02d783f39b
|
@ -1,5 +1,18 @@
|
||||||
|
|
||||||
|
filter:
|
||||||
|
excluded_paths:
|
||||||
|
- 'js/vendor*'
|
||||||
|
- 'l10n/*'
|
||||||
|
- 'tests/*'
|
||||||
|
|
||||||
|
imports:
|
||||||
|
- javascript
|
||||||
|
- php
|
||||||
|
|
||||||
tools:
|
tools:
|
||||||
external_code_coverage: true
|
external_code_coverage: true
|
||||||
|
external_code_coverage:
|
||||||
|
timeout: 7200 # Timeout in seconds: 2 hours
|
||||||
php_mess_detector: true
|
php_mess_detector: true
|
||||||
php_code_sniffer: true
|
php_code_sniffer: true
|
||||||
sensiolabs_security_checker: true
|
sensiolabs_security_checker: true
|
||||||
|
|
38
.travis.yml
38
.travis.yml
|
@ -6,35 +6,33 @@ env:
|
||||||
global:
|
global:
|
||||||
- CORE_BRANCH=master
|
- CORE_BRANCH=master
|
||||||
- APP_NAME=passman
|
- APP_NAME=passman
|
||||||
|
- SERVER_FOLDER=server
|
||||||
|
- CLOUD=nextcloud
|
||||||
matrix:
|
matrix:
|
||||||
- DB=mysql
|
- DB=mysql
|
||||||
|
- DB=sqlite
|
||||||
|
- DB=pgsql
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
#matrix:
|
|
||||||
# allow_failures:
|
|
||||||
# - env: DB=pgsql CORE_BRANCH=master
|
|
||||||
# include:
|
|
||||||
# - php: 5.6
|
|
||||||
# env: DB=sqlite
|
|
||||||
# - php: 5.6
|
|
||||||
# env: DB=mysql
|
|
||||||
# - php: 5.6
|
|
||||||
# env: DB=pgsql CORE_BRANCH=master
|
|
||||||
# fast_finish: true
|
|
||||||
#
|
|
||||||
before_install:
|
before_install:
|
||||||
# enable a display for running JavaScript tests
|
# enable a display for running JavaScript tests
|
||||||
- export DISPLAY=:99.0
|
- export DISPLAY=:99.0
|
||||||
- sh -e /etc/init.d/xvfb start
|
- sh -e /etc/init.d/xvfb start
|
||||||
# <- if [[ "$DB" == 'mysql' ]]; then sudo apt-get -y install mariadb-server; fi
|
# <- if [[ "$DB" == 'mysql' ]]; then sudo apt-get -y install mariadb-server; fi
|
||||||
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
|
# - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
|
||||||
|
- sh -c "if [ '$CLOUD' = 'nextcloud' ]; then wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh; fi;"
|
||||||
|
- sh -c "if [ '$CLOUD' = 'owncloud' ]; then wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh; fi;"
|
||||||
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
|
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
|
||||||
# Add some output debugging information
|
# Add some output debugging information
|
||||||
- cd ../server
|
- cd ../${SERVER_FOLDER}
|
||||||
- ./occ check
|
- ./occ check
|
||||||
- ./occ status
|
- ./occ status
|
||||||
- ./occ app:list
|
- ./occ app:list
|
||||||
|
- ./occ app:enable $APP_NAME
|
||||||
- nvm install 5.9
|
- nvm install 5.9
|
||||||
- npm install -g npm@latest
|
- npm install -g npm@latest
|
||||||
- sh -c "if [ '$JSTESTS' = '1' ]; then npm install grunt-cli -g; fi"
|
- sh -c "if [ '$JSTESTS' = '1' ]; then npm install grunt-cli -g; fi"
|
||||||
|
@ -46,7 +44,7 @@ before_script:
|
||||||
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e 'create database oc_autotest;'; fi
|
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e 'create database oc_autotest;'; fi
|
||||||
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"; fi
|
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"; fi
|
||||||
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"; fi
|
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"; fi
|
||||||
- ./occ app:enable passman
|
|
||||||
- php -S localhost:8080 &
|
- php -S localhost:8080 &
|
||||||
- cd apps/$APP_NAME/
|
- cd apps/$APP_NAME/
|
||||||
- mkdir -p build
|
- mkdir -p build
|
||||||
|
@ -80,10 +78,12 @@ addons:
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- php: 5.6
|
|
||||||
env: DB=mysql
|
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=pgsql
|
env: DB=pgsql
|
||||||
|
- php: 5.6
|
||||||
|
env: DB=sqlite;CLOUD=owncloud;SERVER_FOLDER=core
|
||||||
|
- php: 5.6
|
||||||
|
env: DB=mysql;CLOUD=owncloud;SERVER_FOLDER=core
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=mysql;CODECHECK=1
|
env: DB=mysql;CODECHECK=1
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
|
@ -94,5 +94,9 @@ matrix:
|
||||||
env: DB=mysql;CODECHECK=2
|
env: DB=mysql;CODECHECK=2
|
||||||
- php: 7.0
|
- php: 7.0
|
||||||
env: DB=mysql;CODECHECK=2
|
env: DB=mysql;CODECHECK=2
|
||||||
|
- php: 7.0
|
||||||
|
env: DB=sqlite;CLOUD=owncloud;SERVER_FOLDER=core
|
||||||
|
- php: 7.0
|
||||||
|
env: DB=mysql;CLOUD=owncloud;SERVER_FOLDER=core
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- env: DB=mysql;CODECHECK=2
|
- env: DB=mysql;CODECHECK=2
|
|
@ -17,6 +17,11 @@ Features:
|
||||||
- Password analyzer
|
- Password analyzer
|
||||||
- Share passwords
|
- Share passwords
|
||||||
|
|
||||||
|
## Tested on
|
||||||
|
- NextCloud 10+
|
||||||
|
- ownCloud 9.1+
|
||||||
|
|
||||||
|
|
||||||
##Screenshots
|
##Screenshots
|
||||||
![Logged in to vault](http://i.imgur.com/ciShQZg.png)
|
![Logged in to vault](http://i.imgur.com/ciShQZg.png)
|
||||||
|
|
||||||
|
|
|
@ -305,8 +305,8 @@
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.fileLoadError = function (error, file) {
|
$scope.fileLoadError = function (error) {
|
||||||
console.log(error, file);
|
console.log('Error loading file', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.selected_file = '';
|
$scope.selected_file = '';
|
||||||
|
|
|
@ -64,7 +64,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
ShareService.getCredendialsSharedWithUs(vault.guid).then(function (shared_credentials) {
|
ShareService.getCredendialsSharedWithUs(vault.guid).then(function (shared_credentials) {
|
||||||
console.log('Shared credentials', shared_credentials);
|
|
||||||
for (var c = 0; c < shared_credentials.length; c++) {
|
for (var c = 0; c < shared_credentials.length; c++) {
|
||||||
var _shared_credential = shared_credentials[c];
|
var _shared_credential = shared_credentials[c];
|
||||||
var decrypted_key = EncryptService.decryptString(_shared_credential.shared_key);
|
var decrypted_key = EncryptService.decryptString(_shared_credential.shared_key);
|
||||||
|
@ -132,7 +131,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.acceptShareRequest = function (share_request) {
|
$scope.acceptShareRequest = function (share_request) {
|
||||||
console.log('Accepted share request', share_request);
|
|
||||||
var crypted_shared_key = share_request.shared_key;
|
var crypted_shared_key = share_request.shared_key;
|
||||||
var private_key = EncryptService.decryptString(VaultService.getActiveVault().private_sharing_key);
|
var private_key = EncryptService.decryptString(VaultService.getActiveVault().private_sharing_key);
|
||||||
|
|
||||||
|
@ -356,7 +354,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.$on('logout', function () {
|
$rootScope.$on('logout', function () {
|
||||||
console.log('Logout received, clean up');
|
|
||||||
$scope.active_vault = null;
|
$scope.active_vault = null;
|
||||||
$scope.credentials = [];
|
$scope.credentials = [];
|
||||||
// $scope.$parent.selectedVault = false;
|
// $scope.$parent.selectedVault = false;
|
||||||
|
@ -365,7 +362,6 @@
|
||||||
|
|
||||||
|
|
||||||
$scope.downloadFile = function (credential, file) {
|
$scope.downloadFile = function (credential, file) {
|
||||||
console.log(credential, file);
|
|
||||||
var callback = function (result) {
|
var callback = function (result) {
|
||||||
var key = null;
|
var key = null;
|
||||||
if (!result.hasOwnProperty('file_data')) {
|
if (!result.hasOwnProperty('file_data')) {
|
||||||
|
|
|
@ -178,8 +178,8 @@
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.fileLoadError = function (error, file) {
|
$scope.fileLoadError = function (error) {
|
||||||
console.log(error, file);
|
console.log('Error loading file', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.selected_file = '';
|
$scope.selected_file = '';
|
||||||
|
@ -228,7 +228,7 @@
|
||||||
//@TODO validation
|
//@TODO validation
|
||||||
//@TODO When credential is expired and has renew interval set, calc new expire time.
|
//@TODO When credential is expired and has renew interval set, calc new expire time.
|
||||||
delete $scope.storedCredential.password_repeat;
|
delete $scope.storedCredential.password_repeat;
|
||||||
console.log($scope.storedCredential);
|
|
||||||
if (!$scope.storedCredential.credential_id) {
|
if (!$scope.storedCredential.credential_id) {
|
||||||
$scope.storedCredential.vault_id = $scope.active_vault.vault_id;
|
$scope.storedCredential.vault_id = $scope.active_vault.vault_id;
|
||||||
CredentialService.createCredential($scope.storedCredential).then(function (result) {
|
CredentialService.createCredential($scope.storedCredential).then(function (result) {
|
||||||
|
|
|
@ -30,10 +30,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
VaultService.getVault($scope.active_vault).then(function (vault) {
|
VaultService.getVault($scope.active_vault).then(function (vault) {
|
||||||
vault.vaultKey = SettingsService.getSetting('defaultVaultPass');
|
vault.vaultKey = VaultService.getActiveVault().vaultKey;
|
||||||
delete vault.credentials;
|
delete vault.credentials;
|
||||||
VaultService.setActiveVault(vault);
|
VaultService.setActiveVault(vault);
|
||||||
console.log(vault);
|
|
||||||
$scope.vault_settings = vault.vault_settings;
|
$scope.vault_settings = vault.vault_settings;
|
||||||
if(!$scope.vault_settings.hasOwnProperty('pwSettings')){
|
if(!$scope.vault_settings.hasOwnProperty('pwSettings')){
|
||||||
$scope.vault_settings.pwSettings = {
|
$scope.vault_settings.pwSettings = {
|
||||||
|
@ -125,10 +124,6 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($scope.active_vault) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$rootScope.$on('logout', function () {
|
$rootScope.$on('logout', function () {
|
||||||
$scope.selectedVault = false;
|
$scope.selectedVault = false;
|
||||||
});
|
});
|
||||||
|
@ -189,7 +184,7 @@
|
||||||
var changeCredential = function (index, oldVaultPass, newVaultPass) {
|
var changeCredential = function (index, oldVaultPass, newVaultPass) {
|
||||||
CredentialService.reencryptCredential(_selected_credentials[index].guid, oldVaultPass, newVaultPass).progress(function (data) {
|
CredentialService.reencryptCredential(_selected_credentials[index].guid, oldVaultPass, newVaultPass).progress(function (data) {
|
||||||
$scope.cur_state = data;
|
$scope.cur_state = data;
|
||||||
}).then(function (data) {
|
}).then(function () {
|
||||||
var percent = index / _selected_credentials.length * 100;
|
var percent = index / _selected_credentials.length * 100;
|
||||||
$scope.change_pw = {
|
$scope.change_pw = {
|
||||||
percent: percent,
|
percent: percent,
|
||||||
|
@ -199,11 +194,9 @@
|
||||||
if (index < _selected_credentials.length - 1) {
|
if (index < _selected_credentials.length - 1) {
|
||||||
changeCredential(index + 1, oldVaultPass, newVaultPass);
|
changeCredential(index + 1, oldVaultPass, newVaultPass);
|
||||||
} else {
|
} else {
|
||||||
console.log('Update complete!');
|
|
||||||
|
|
||||||
vault.private_sharing_key = EncryptService.decryptString(angular.copy(vault.private_sharing_key), oldVaultPass);
|
vault.private_sharing_key = EncryptService.decryptString(angular.copy(vault.private_sharing_key), oldVaultPass);
|
||||||
vault.private_sharing_key = EncryptService.encryptString(vault.private_sharing_key, newVaultPass);
|
vault.private_sharing_key = EncryptService.encryptString(vault.private_sharing_key, newVaultPass);
|
||||||
VaultService.updateSharingKeys(vault).then(function (result) {
|
VaultService.updateSharingKeys(vault).then(function () {
|
||||||
$rootScope.$broadcast('logout');
|
$rootScope.$broadcast('logout');
|
||||||
NotificationService.showNotification('Please login with your new vault password', 5000);
|
NotificationService.showNotification('Please login with your new vault password', 5000);
|
||||||
});
|
});
|
||||||
|
|
|
@ -138,7 +138,6 @@
|
||||||
|
|
||||||
|
|
||||||
$scope.$watch('share_settings.upload_progress.done', function () {
|
$scope.$watch('share_settings.upload_progress.done', function () {
|
||||||
console.log();
|
|
||||||
if ($scope.share_settings.upload_progress.done === $scope.share_settings.upload_progress.total && $scope.share_settings.upload_progress.total > 0) {
|
if ($scope.share_settings.upload_progress.done === $scope.share_settings.upload_progress.total && $scope.share_settings.upload_progress.total > 0) {
|
||||||
getAcl();
|
getAcl();
|
||||||
}
|
}
|
||||||
|
@ -204,9 +203,7 @@
|
||||||
_credential = CredentialService.encryptCredential(_credential, old_key);
|
_credential = CredentialService.encryptCredential(_credential, old_key);
|
||||||
CredentialService.updateCredential(_credential, true).then(function () {
|
CredentialService.updateCredential(_credential, true).then(function () {
|
||||||
NotificationService.showNotification('Credential unshared', 4000);
|
NotificationService.showNotification('Credential unshared', 4000);
|
||||||
CredentialService.reencryptCredential(_credential.guid, old_key, new_key).progress(function (data) {
|
CredentialService.reencryptCredential(_credential.guid, old_key, new_key).then(function (data) {
|
||||||
console.log(data);
|
|
||||||
}).then(function (data) {
|
|
||||||
getAcl();
|
getAcl();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -224,13 +221,12 @@
|
||||||
user.vaults = data;
|
user.vaults = data;
|
||||||
var start = new Date().getTime() / 1000;
|
var start = new Date().getTime() / 1000;
|
||||||
ShareService.cypherRSAStringWithPublicKeyBulkAsync(user.vaults, enc_key)
|
ShareService.cypherRSAStringWithPublicKeyBulkAsync(user.vaults, enc_key)
|
||||||
.progress(function (data) {
|
.progress(function () {
|
||||||
$scope.share_settings.cypher_progress.done++;
|
$scope.share_settings.cypher_progress.done++;
|
||||||
$scope.share_settings.cypher_progress.percent = $scope.share_settings.cypher_progress.done / $scope.share_settings.cypher_progress.total * 100;
|
$scope.share_settings.cypher_progress.percent = $scope.share_settings.cypher_progress.done / $scope.share_settings.cypher_progress.total * 100;
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
})
|
})
|
||||||
.then(function (result) {
|
.then(function (result) {
|
||||||
console.log("Took: " + ((new Date().getTime() / 1000) - start) + "s to cypher the string for user [" + data[0].user_id + "]");
|
|
||||||
$scope.share_settings.cypher_progress.times.push({
|
$scope.share_settings.cypher_progress.times.push({
|
||||||
time: ((new Date().getTime() / 1000) - start),
|
time: ((new Date().getTime() / 1000) - start),
|
||||||
user: data[0].user_id
|
user: data[0].user_id
|
||||||
|
@ -257,7 +253,6 @@
|
||||||
$scope.share_settings.upload_progress.total = 0;
|
$scope.share_settings.upload_progress.total = 0;
|
||||||
//Credential is already shared
|
//Credential is already shared
|
||||||
if ($scope.storedCredential.shared_key && $scope.storedCredential.shared_key !== '' && $scope.storedCredential.shared_key !== null) {
|
if ($scope.storedCredential.shared_key && $scope.storedCredential.shared_key !== '' && $scope.storedCredential.shared_key !== null) {
|
||||||
console.log('Shared key found');
|
|
||||||
var enc_key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key));
|
var enc_key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key));
|
||||||
if ($scope.share_settings.linkSharing.enabled) {
|
if ($scope.share_settings.linkSharing.enabled) {
|
||||||
var expire_time = new Date(angular.copy($scope.share_settings.linkSharing.settings.expire_time)).getTime() / 1000;
|
var expire_time = new Date(angular.copy($scope.share_settings.linkSharing.settings.expire_time)).getTime() / 1000;
|
||||||
|
@ -298,10 +293,7 @@
|
||||||
var old_key = VaultService.getActiveVault().vaultKey;
|
var old_key = VaultService.getActiveVault().vaultKey;
|
||||||
|
|
||||||
CredentialService.reencryptCredential(encryptedSharedCredential.guid, old_key, key).progress(function (data) {
|
CredentialService.reencryptCredential(encryptedSharedCredential.guid, old_key, key).progress(function (data) {
|
||||||
console.log(data);
|
|
||||||
}).then(function (data) {
|
}).then(function (data) {
|
||||||
console.log(data);
|
|
||||||
//This is here is not called
|
|
||||||
var _credential = data.cryptogram;
|
var _credential = data.cryptogram;
|
||||||
_credential.set_share_key = true;
|
_credential.set_share_key = true;
|
||||||
_credential.skip_revision = true;
|
_credential.skip_revision = true;
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
$scope.progress = progress > 0 ? 2 : 1;
|
$scope.progress = progress > 0 ? 2 : 1;
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
}).then(function (kp) {
|
}).then(function (kp) {
|
||||||
console.log('stuff done');
|
|
||||||
$scope.generating = false;
|
$scope.generating = false;
|
||||||
|
|
||||||
var pem = ShareService.rsaKeyPairToPEM(kp);
|
var pem = ShareService.rsaKeyPairToPEM(kp);
|
||||||
|
|
|
@ -116,13 +116,12 @@
|
||||||
try {
|
try {
|
||||||
field_decrypted_value = EncryptService.decryptString(fieldValue, key);
|
field_decrypted_value = EncryptService.decryptString(fieldValue, key);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
credential[field] = JSON.parse(field_decrypted_value);
|
credential[field] = JSON.parse(field_decrypted_value);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('Field' + field + ' in ' + credential.label + ' could not be parsed! Value:' + fieldValue);
|
console.warn('Field' + field + ' in ' + credential.label + ' could not be parsed! Value:' + fieldValue);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,13 +165,12 @@
|
||||||
try {
|
try {
|
||||||
field_decrypted_value = EncryptService.decryptString(fieldValue, sharedKey);
|
field_decrypted_value = EncryptService.decryptString(fieldValue, sharedKey);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
_credential[field] = JSON.parse(field_decrypted_value);
|
_credential[field] = JSON.parse(field_decrypted_value);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('Field' + field + ' in ' + _credential.label + ' could not be parsed! Value:' + fieldValue);
|
console.warn('Field' + field + ' in ' + _credential.label + ' could not be parsed! Value:' + fieldValue);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,7 +184,6 @@
|
||||||
var step = function () {
|
var step = function () {
|
||||||
// run for 100 ms
|
// run for 100 ms
|
||||||
if (!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) {
|
if (!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) {
|
||||||
// console.log(state);
|
|
||||||
if (state.p !== null) {
|
if (state.p !== null) {
|
||||||
// progress(50);
|
// progress(50);
|
||||||
this.call_progress(50);
|
this.call_progress(50);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче