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..ed55ced01 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 ######################################################### @@ -241,4 +248,19 @@ jobs: # 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 + # run: docker-compose exec -T webapp yarn test + + #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 \ 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/Model/Entity/StateBalance.php b/community_server/src/Model/Entity/StateBalance.php index 174e785b4..871c55bd8 100644 --- a/community_server/src/Model/Entity/StateBalance.php +++ b/community_server/src/Model/Entity/StateBalance.php @@ -35,6 +35,15 @@ class StateBalance extends Entity protected $_virtual = ['decay']; + private function convertToTimestamp($dateOrTime) + { + if(method_exists($dateOrTime, 'getTimestamp')) { + return $dateOrTime->getTimestamp(); + } else { + return $dateOrTime->i18nFormat(Time::UNIX_TIMESTAMP_FORMAT); + } + } + protected function _getDecay() { // decay factor in seconds per year @@ -44,7 +53,7 @@ class StateBalance extends Entity // SELECT TIMESTAMPDIFF(SECOND, modified, CURDATE()) AS age_in_seconds from state_balances // decay_for_duration = decay_factor^seconds // decay = gradido_cent * decay_for_duration - $decay_duration = intval(Time::now()->getTimestamp() - $this->record_date->getTimestamp()); + $decay_duration = $this->decayDuration(Time::now()); if($decay_duration === 0) { return $this->amount; } @@ -53,7 +62,8 @@ class StateBalance extends Entity } public function partDecay($target_date) { - $decay_duration = intval($target_date->getTimestamp() - $this->record_date->getTimestamp()); + if($target_date == null) return 0; + $decay_duration = $this->decayDuration($target_date); if($decay_duration <= 0) { return $this->amount; } @@ -61,7 +71,8 @@ class StateBalance extends Entity } public function decayDuration($target_date) - { - return intval($target_date->getTimestamp() - $this->record_date->getTimestamp()); + { + if($this->record_date == null) return 0; + return intval($this->convertToTimestamp($target_date) - $this->record_date->getTimestamp()); } } diff --git a/community_server/src/Model/Transactions/TransactionBody.php b/community_server/src/Model/Transactions/TransactionBody.php index 8164f33f7..ef785705c 100644 --- a/community_server/src/Model/Transactions/TransactionBody.php +++ b/community_server/src/Model/Transactions/TransactionBody.php @@ -3,6 +3,7 @@ namespace Model\Transactions; use Cake\ORM\TableRegistry; +use Cake\I18n\Date; class TransactionBody extends TransactionBase { private $mProtoTransactionBody = null; @@ -75,6 +76,7 @@ class TransactionBody extends TransactionBase { $transactionEntity->transaction_type_id = $this->transactionTypeId; $transactionEntity->memo = $this->getMemo(); + $transactionEntity->received = new Date(); if ($transactionsTable->save($transactionEntity)) { // success diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index fe2660bd9..638b2d891 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -5,7 +5,8 @@ module.exports = { }, extends: ['plugin:vue/essential'], rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', + // TODO no console! + 'no-console': 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' }, parserOptions: { diff --git a/frontend/package.json b/frontend/package.json index 420d5ebce..5100e736a 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-vue-gradido-wallet", - "version": "0.9.1", + "version": "0.9.2", "private": true, "scripts": { "start": "node server.js", diff --git a/frontend/src/App.vue b/frontend/src/App.vue index da80c328f..925cb52f6 100755 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -4,8 +4,7 @@
- - +
@@ -19,17 +18,17 @@ export default { components: { ParticlesBg }, - created () { - //console.log("this.$cookies.get('gdd_session_id') ", this.$cookies.get('gdd_session_id') ) - console.log(" $cookies.isKey('gdd_session_id') ", this.$cookies.isKey("gdd_session_id") ) - if ( this.$cookies.isKey('gdd_session_id') ) { - //this.$store.state.email = this.$cookies.get('gdd_u') - console.log("login to kontooverview") - this.$router.push('/KontoOverview') - }else { - console.log("login to LOGIN") - this.$router.push("/Login") - } + created () { + console.log('%cWillkommen bei Gradido %cgreen text', 'font-weight:bold', 'color: green') + if ( $cookies.isKey("gdd_session_id") == true) { + console.log('%cHey %c'+$cookies.get("gdd_u")+'', 'font-weight:bold', 'color: orange') + this.$store.commit('session_id', $cookies.get("gdd_session_id")) + this.$store.commit('email', $cookies.get("gdd_u")) + this.$router.push("overview") + }else { + console.log("app.vue to Logout") + this.$store.dispatch('logout') + } }, data() { return { @@ -52,7 +51,7 @@ export default { } diff --git a/frontend/src/views/Layout/DashboardLayout.vue b/frontend/src/views/Layout/DashboardLayout.vue index 1bba74762..a7bd82e8b 100755 --- a/frontend/src/views/Layout/DashboardLayout.vue +++ b/frontend/src/views/Layout/DashboardLayout.vue @@ -4,7 +4,7 @@