diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index 2e5bf99ab..000000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: on-push -on: push -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build the stack - run: | - git submodule update --init --recursive - docker-compose up -d - - name: Test - env: - GN_INSTANCE_FOLDER: /tmp/gradio-node-instance - GN_CONTAINER_NAME: gradido-node-build - run: docker run gradido-node-test - timeout-minutes: 2 - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e8dfbab4e..56dc42be7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,34 +4,13 @@ name: gradido test CI on: [push] jobs: - ############################################################################## - # JOB: PREPARE ##################################################### - ############################################################################## - #prepare: - # name: Prepare - # runs-on: ubuntu-latest - # # needs: [nothing] - # steps: - # ########################################################################## - # # CHECKOUT CODE ########################################################## - # ########################################################################## - # - name: Checkout code - # uses: actions/checkout@v2 - # ########################################################################## - # # TODO: DO STUFF ??? ##################################################### - # ########################################################################## - # - name: Check translation files - # run: | - # scripts/translations/sort.sh - # scripts/translations/missing-keys.sh - ############################################################################## # JOB: DOCKER BUILD TEST FRONTEND ############################################ ############################################################################## build_test_frontend: name: Docker Build Test - Frontend runs-on: ubuntu-latest - #needs: [nothing] # [prepare] + #needs: [nothing] steps: ########################################################################## # CHECKOUT CODE ########################################################## @@ -39,7 +18,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 ########################################################################## - # NEO4J ################################################################## + # FRONTEND ############################################################### ########################################################################## - name: Frontend | Build `test` image run: | @@ -78,30 +57,58 @@ jobs: # path: /tmp/backend.tar ############################################################################## - # JOB: DOCKER BUILD TEST WEBAPP ############################################## + # JOB: DOCKER BUILD TEST LOGIN SERVER ######################################## ############################################################################## - #build_test_webapp: - # name: Docker Build Test - WebApp - # runs-on: ubuntu-latest - # needs: [prepare] - # steps: - # ########################################################################## - # # CHECKOUT CODE ########################################################## - # ########################################################################## - # - name: Checkout code - # uses: actions/checkout@v2 - # ########################################################################## - # # BUILD WEBAPP DOCKER IMAGE (build) ###################################### - # ########################################################################## - # - name: webapp | Build `test` image - # run: | - # docker build --target test -t "ocelotsocialnetwork/webapp:test" webapp/ - # docker save "ocelotsocialnetwork/webapp:test" > /tmp/webapp.tar - # - name: Upload Artifact - # uses: actions/upload-artifact@v2 - # with: - # name: docker-webapp-test - # path: /tmp/webapp.tar + build_test_login_server: + name: Docker Build Test - Login Server + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + ########################################################################## + # BUILD LOGIN SERVER DOCKER IMAGE (build) ################################ + ########################################################################## + - name: login server | Build `test` image + run: | + docker build --target login_server_debug -t "gradido/loginserver:test" -f ./login_server/Dockerfile.debug login_server/ + docker save "gradido/loginserver:test" > /tmp/loginserver.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-loginserver-test + path: /tmp/loginserver.tar + + ############################################################################## + # JOB: DOCKER BUILD TEST COMMUNITY SERVER #################################### + ############################################################################## + build_test_community_server: + name: Docker Build Test - Community Server + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # BUILD COMMUNITY SERVER DOCKER IMAGE (build) ############################ + ########################################################################## + - name: community server | Build `test` image + run: | + docker build -t "gradido/communityserver:test" -f ./community_server/Dockerfile ./ + docker save "gradido/communityserver:test" > /tmp/communityserver.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-communityserver-test + path: /tmp/communityserver.tar ############################################################################## # JOB: LINT FRONTEND ######################################################### @@ -207,38 +214,46 @@ jobs: # run: docker-compose exec -T backend yarn test ############################################################################## - # JOB: UNIT TEST WEBAPP ###################################################### + # JOB: UNIT TEST FRONTEND ################################################### ############################################################################## - #unit_test_webapp: - # name: Unit tests - webapp + unit_test_frontend: + name: Unit tests - Frontend + runs-on: ubuntu-latest + needs: [build_test_frontend] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # DOWNLOAD DOCKER IMAGES ################################################# + ########################################################################## + - name: Download Docker Image (Webapp) + uses: actions/download-artifact@v2 + with: + name: docker-frontend-test + path: /tmp + - name: Load Docker Image + run: docker load < /tmp/frontend.tar + ########################################################################## + # UNIT TESTS FRONTEND #################################################### + ########################################################################## + - name: frontend | Unit tests + run: docker run --rm gradido/frontend:test yarn run test + + + #test: # runs-on: ubuntu-latest - # needs: [build_test_webapp] # steps: - # ########################################################################## - # # CHECKOUT CODE ########################################################## - # ########################################################################## - # - name: Checkout code - # uses: actions/checkout@v2 - # ########################################################################## - # # DOWNLOAD DOCKER IMAGES ################################################# - # ########################################################################## - # - name: Download Docker Image (Webapp) - # uses: actions/download-artifact@v2 - # with: - # name: docker-webapp-test - # path: /tmp - # - name: Load Docker Image - # run: docker load < /tmp/webapp.tar - # ########################################################################## - # # UNIT TESTS WEBAPP ##################################################### - # ########################################################################## - # # TODO: Why do we need those .envs? - # - name: backend | copy env files webapp - # run: cp webapp/.env.template webapp/.env - # - name: backend | copy env files backend - # run: cp backend/.env.template backend/.env - # - name: backend | docker-compose - # run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp - # - name: webapp | Unit tests - # #run: docker run --rm ocelotsocialnetwork/webapp:build yarn run test - # run: docker-compose exec -T webapp yarn test \ No newline at end of file + # - uses: actions/checkout@v2 + # - name: Build the stack + # run: | + # git submodule update --init --recursive + # docker-compose up -d + # - name: Test + # env: + # GN_INSTANCE_FOLDER: /tmp/gradio-node-instance + # GN_CONTAINER_NAME: gradido-node-build + # run: docker run gradido-node-test + # timeout-minutes: 2 \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 04f340efb..246626547 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,12 +2,12 @@ path = gn url = https://github.com/gradido/gn.git branch = master -[submodule "mithril_client"] - path = community_server/mithril_client - url = git@github.com:gradido/gradido_mithrilJS_client.git +#[submodule "mithril_client"] +# path = community_server/mithril_client +# url = https://github.com/gradido/gradido_mithrilJS_client.git [submodule "src/protobuf"] path = community_server/src/protobuf - url = git@github.com:gradido/gradido_protocol.git + url = https://github.com/gradido/gradido_protocol.git [submodule "dependencies/tinf"] path = login_server/dependencies/tinf url = https://github.com/jibsen/tinf.git @@ -22,5 +22,4 @@ url = https://github.com/gradido/iroha-ed25519.git [submodule "dependencies/spirit-po"] path = login_server/dependencies/spirit-po - url = https://github.com/cbeck88/spirit-po.git - + url = https://github.com/cbeck88/spirit-po.git \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ac578be89..7821e6c89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,4 +4,25 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [0.9.2](https://github.com/gradido/gradido/compare/0.9.1...0.9.2) + +- Reload after login fixed [`#50`](https://github.com/gradido/gradido/pull/50) +- Monorepo login server [`#48`](https://github.com/gradido/gradido/pull/48) +- Stage0 [`#3`](https://github.com/gradido/gradido/pull/3) +- Add auto-sign Transaction functionality [`5592275`](https://github.com/gradido/gradido/commit/55922753a7ffd9552be132501d744da491c409b5) +- read in login the real client ip X-Real-IP from nginx forwarded not from community server [`512d307`](https://github.com/gradido/gradido/commit/512d307a19b955bb6e26ae8b274def354829b50f) +- move check if all passwords allow direct into pwdValidation so it will work with every code which ask for password [`e2c38c1`](https://github.com/gradido/gradido/commit/e2c38c1a0fc25a4a2bc922c4bbc44d86b6d00d8b) + #### 0.9.1 + +> 13 March 2021 + +- Login gbb [`#12`](https://github.com/gradido/gradido/pull/12) +- Admin prework axios json [`#10`](https://github.com/gradido/gradido/pull/10) +- Merge pull request #1 from gradido/master [`#8`](https://github.com/gradido/gradido/pull/8) +- [WIP] 2 create a dockerfile for the frontend application [`#6`](https://github.com/gradido/gradido/pull/6) +- Master - first step [`#1`](https://github.com/gradido/gradido/pull/1) +- Add docker compose [`#7`](https://github.com/gradido/gradido/pull/7) +- style 404 side :) [`c7bdf89`](https://github.com/gradido/gradido/commit/c7bdf8978594b932615e48f9bb1c19d3c3bf3fcf) +- publish workflow test [`df6f66f`](https://github.com/gradido/gradido/commit/df6f66ffe70baa9ed3f70b460a6c0c14011bb944) +- many translations. translation structure [`bf68547`](https://github.com/gradido/gradido/commit/bf685479767d19c246c4d6abe3577dc3cb666346) diff --git a/community_server/mithril_client b/community_server/mithril_client deleted file mode 160000 index f0b1d113c..000000000 --- a/community_server/mithril_client +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f0b1d113cee2a76e9dbb098b315f4acaf38410d0 diff --git a/community_server/src/Controller/Component/JsonRequestClientComponent.php b/community_server/src/Controller/Component/JsonRequestClientComponent.php index 8a071b70b..66e65e3bb 100644 --- a/community_server/src/Controller/Component/JsonRequestClientComponent.php +++ b/community_server/src/Controller/Component/JsonRequestClientComponent.php @@ -55,7 +55,7 @@ class JsonRequestClientComponent extends Component ]), '/getRunningUserTasks'); } - public function getUsers($session_id, $searchString) + public function getUsers($session_id, $searchString, $accountState) { if($searchString == "") { return ['state' => 'error', 'type' => 'parameter error', 'msg' => 'search string is empty']; @@ -66,7 +66,8 @@ class JsonRequestClientComponent extends Component return $this->sendRequest(json_encode([ 'session_id' => $session_id, - 'search' => $searchString + 'search' => $searchString, + 'account_state' => $accountState, ]), '/getUsers'); } diff --git a/community_server/src/Controller/StateBalancesController.php b/community_server/src/Controller/StateBalancesController.php index bddf35125..4afeabd8b 100644 --- a/community_server/src/Controller/StateBalancesController.php +++ b/community_server/src/Controller/StateBalancesController.php @@ -197,7 +197,7 @@ class StateBalancesController extends AppController } uasort($transactions, array($this, 'sortTransactions')); $this->set('transactions', $transactions); - $this->set('transactionExecutingCount', $session->read('Transaction.executing')); + $this->set('transactionExecutingCount', $session->read('Transactions.executing')); $this->set('balance', $session->read('StateUser.balance')); $this->set('timeUsed', microtime(true) - $startTime); $this->set('gdtSum', $gdtSum); @@ -370,7 +370,7 @@ class StateBalancesController extends AppController return $this->returnJson([ 'state' => 'success', 'transactions' => $transactions, - 'transactionExecutingCount' => $session->read('Transaction.executing'), + 'transactionExecutingCount' => $session->read('Transactions.executing'), 'count' => count($transactions), 'gdtSum' => $gdtSum, 'timeUsed' => microtime(true) - $startTime diff --git a/community_server/src/Controller/StateUserTransactionsController.php b/community_server/src/Controller/StateUserTransactionsController.php index 8c252218c..b51dd350f 100644 --- a/community_server/src/Controller/StateUserTransactionsController.php +++ b/community_server/src/Controller/StateUserTransactionsController.php @@ -196,7 +196,7 @@ class StateUserTransactionsController extends AppController return $this->returnJson([ 'state' => 'success', 'transactions' => $transactions, - 'transactionExecutingCount' => $session->read('Transaction.executing'), + 'transactionExecutingCount' => $session->read('Transactions.executing'), 'count' => $all_user_transactions_count, 'timeUsed' => microtime(true) - $startTime ]); diff --git a/community_server/src/Controller/StateUsersController.php b/community_server/src/Controller/StateUsersController.php index d85f8b449..9f07fffdb 100644 --- a/community_server/src/Controller/StateUsersController.php +++ b/community_server/src/Controller/StateUsersController.php @@ -99,9 +99,14 @@ class StateUsersController extends AppController //$this->set('timeUsed', $timeUsed); $csfr_token = $this->request->getParam('_csrfToken'); $this->set(compact('timeUsed', 'searchForm', 'csfr_token')); - + $empty_string = '... empty ...'; if ($this->request->is('post')) { + $finalUserEntrys = []; $requestData = $this->request->getData(); + $account_state = $requestData['account_state']; + if($requestData['search'] == '' && $account_state != 'all') { + $requestData['search'] = $empty_string; + } if ($searchForm->validate($requestData)) { //var_dump($requestData); @@ -111,7 +116,7 @@ class StateUsersController extends AppController $searchType = 'email'; } // find users on login server - $resultJson = $this->JsonRequestClient->getUsers($session->read('session_id'), $searchString); + $resultJson = $this->JsonRequestClient->getUsers($session->read('session_id'), $searchString, $account_state); $loginServerUser = []; if ($resultJson['state'] == 'success') { $dataJson = $resultJson['data']; @@ -139,28 +144,42 @@ class StateUsersController extends AppController } } // find user on community server db - $globalSearch = '%' . $searchString . '%'; + + + $communityUsers = $this->StateUsers ->find('all') ->contain(['StateBalances' => ['fields' => ['amount', 'state_user_id']]]); - - $communityUsers->where(['OR' => [ - 'first_name LIKE' => $globalSearch, - 'last_name LIKE' => $globalSearch, - //'username LIKE' => $globalSearch, - 'email LIKE' => $globalSearch - ]]); - - //var_dump($communityUsers->toArray()); - foreach ($communityUsers as $u) { - $pubkey_hex = bin2hex(stream_get_contents($u->public_key)); - $u->public_hex = $pubkey_hex; - if (!isset($pubkeySorted[$pubkey_hex])) { - $pubkeySorted[$pubkey_hex] = ['login' => [], 'community' => []]; + + if($account_state == 'email not activated') { + if(count($pubkeySorted) > 0) { + $communityUsers->where(['hex(public_key) IN' => array_keys($pubkeySorted)]); + } else { + $communityUsers = null; } - array_push($pubkeySorted[$pubkey_hex]['community'], $u); + } else { + $globalSearch = '%' . $searchString . '%'; + $communityUsers->where(['OR' => [ + 'first_name LIKE' => $globalSearch, + 'last_name LIKE' => $globalSearch, + //'username LIKE' => $globalSearch, + 'email LIKE' => $globalSearch + ]]); } - $finalUserEntrys = []; + + + //var_dump($communityUsers->toArray()); + if($communityUsers) { + foreach ($communityUsers as $u) { + $pubkey_hex = bin2hex(stream_get_contents($u->public_key)); + $u->public_hex = $pubkey_hex; + if (!isset($pubkeySorted[$pubkey_hex])) { + $pubkeySorted[$pubkey_hex] = ['login' => [], 'community' => []]; + } + array_push($pubkeySorted[$pubkey_hex]['community'], $u); + } + } + // detect states foreach ($pubkeySorted as $pubhex => $user) { $finalUser = []; diff --git a/community_server/src/Controller/TransactionCreationsController.php b/community_server/src/Controller/TransactionCreationsController.php index 5e29a7997..af7b9a018 100644 --- a/community_server/src/Controller/TransactionCreationsController.php +++ b/community_server/src/Controller/TransactionCreationsController.php @@ -323,7 +323,7 @@ class TransactionCreationsController extends AppController $this->set('firstDayLastMonth', $firstDayLastMonth); $this->set('activeUser', $user); $this->set('creationForm', $creationForm); - $this->set('transactionExecutingCount', $session->read('Transaction.executing')); + $this->set('transactionExecutingCount', $session->read('Transactions.executing')); $this->set('timeUsed', microtime(true) - $startTime); $this->set('countUsers', $countUsers); $this->set('limit', $limit); diff --git a/community_server/src/Form/UserSearchForm.php b/community_server/src/Form/UserSearchForm.php index e2955e244..c68269920 100644 --- a/community_server/src/Form/UserSearchForm.php +++ b/community_server/src/Form/UserSearchForm.php @@ -11,7 +11,9 @@ class UserSearchForm extends Form protected function _buildSchema(Schema $schema) { - return $schema->addField('search', ['type' => 'string']); + return $schema + ->addField('search', ['type' => 'string']) + ->addField('account_state', ['type' => 'select']); } function validationDefault(Validator $validator) diff --git a/community_server/src/Template/StateUsers/search.ctp b/community_server/src/Template/StateUsers/search.ctp index e6775729b..626cb7313 100644 --- a/community_server/src/Template/StateUsers/search.ctp +++ b/community_server/src/Template/StateUsers/search.ctp @@ -11,6 +11,19 @@ $this->assign('title', __('Benutzer suchen')); $this->loadHelper('Form', [ 'templates' => 'horizontal_form', ]); + +$stateOptions = [ + 'all' => __('Alle'), + //'account created'=>__('Konto angelegt'), + //'account not on login-server' => __('Konto nicht auf Login-Server'), + //'email activated' => __('Konto aktiviert'), + //'account copied to community' => __('Konto auf Gemeinschafts-Server'), + 'email not activated' => __('Konto nicht aktiviert'), + //'account multiple times on login-server' => __('Konto mehrfach vorhanden'), + //'account not on community server' => __('Konto nicht auf Gemeinschafts-Server'), + //'no keys' => __('Keine Schlüssel generiert') +]; + ?> = $this->Html->css([ 'loginServer/style.css', @@ -41,7 +54,8 @@ $this->loadHelper('Form', [
Benutzer suchen
-