mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' of https://github.com/gradido/gradido into 8-user_area_balance_of_the_GDD_GTT_stands
This commit is contained in:
commit
054a6f9d0a
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -4,7 +4,7 @@
|
||||
branch = master
|
||||
[submodule "login_server"]
|
||||
path = login_server
|
||||
url = git@github.com:gradido/gradido_login_server.git
|
||||
url = https://github.com/gradido/gradido_login_server.git
|
||||
[submodule "community_server"]
|
||||
path = community_server
|
||||
url = git@github.com:gradido/gradido_community_server.git
|
||||
url = https://github.com/gradido/gradido_community_server.git
|
||||
|
||||
18
README.md
18
README.md
@ -15,11 +15,27 @@ Currently we only support `docker` as environment to run all services, since man
|
||||
- [docker](https://www.docker.com/)
|
||||
|
||||
## How to run?
|
||||
|
||||
1. Clone the repo and pull all submodules
|
||||
|
||||
```bash
|
||||
git clone git@github.com:gradido/gradido.git
|
||||
git submodule update --recursive --init
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
2. Run docker compose
|
||||
1. Run docker compose for the debug build
|
||||
|
||||
```bash
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
2. Or run docker compose in production build
|
||||
|
||||
```bash
|
||||
docker-compose -f docker-compose.yml up
|
||||
```
|
||||
|
||||
## Useful Links
|
||||
|
||||
- [Gradido.net](https://gradido.net/)
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 7ebc7909eaf9e74ca81f561b0aac64797c3d0112
|
||||
Subproject commit 36ddbba5815435575b2d3c1270d738ccabc9eb54
|
||||
@ -397,6 +397,12 @@ return [
|
||||
'host' => 'http://login-server',
|
||||
'port' => 1201
|
||||
],
|
||||
'API' => [
|
||||
'allowedCaller' => ['login-server']
|
||||
],
|
||||
'ServerAdminEmail' => 'info@gradido.net',
|
||||
'noReplyEmail' => 'no-reply@gradido.net',
|
||||
'disableEmail' => true,
|
||||
|
||||
'GroupNode' => false
|
||||
];
|
||||
|
||||
@ -12,8 +12,7 @@ crypto.app_secret = 21ffbbc616fe
|
||||
#
|
||||
|
||||
phpServer.url = http://localhost/
|
||||
phpServer.host = community-server
|
||||
phpServer.port = 80
|
||||
phpServer.host = nginx
|
||||
|
||||
loginServer.path = http://localhost/account
|
||||
loginServer.default_locale = de
|
||||
|
||||
0
configs/node_server/.gradido/sibling_nodes.txt
Normal file
0
configs/node_server/.gradido/sibling_nodes.txt
Normal file
20
configs/node_server/gradido.conf
Normal file
20
configs/node_server/gradido.conf
Normal file
@ -0,0 +1,20 @@
|
||||
worker_count = 2
|
||||
io_worker_count = 1
|
||||
data_root_folder = /opt/instance/.gradido
|
||||
hedera_mirror_endpoint = hcs.testnet.mirrornode.hedera.com:5600
|
||||
sibling_node_file = /opt/instance/.gradido/sibling_nodes.txt
|
||||
#group_requests_endpoint = 0.0.0.0:13701
|
||||
#record_requests_endpoint = 0.0.0.0:13702
|
||||
#manage_network_requests_endpoint = 0.0.0.0:13703
|
||||
grpc_endpoint = 0.0.0.0:13701
|
||||
json_rpc_port = 13702
|
||||
|
||||
|
||||
# larger value, larger batch, less concurrency
|
||||
blockchain_append_batch_size = 1000
|
||||
#blochchain_init_batch_size = 1000
|
||||
#block_record_outbound_batch_size = 100
|
||||
general_batch_size = 1000
|
||||
group_register_topic_id = 0.0.79574
|
||||
|
||||
topic_reset_allowed = 1
|
||||
@ -18,54 +18,32 @@ services:
|
||||
- frontend_node_modules:/app/node_modules
|
||||
# bind the local folder to the docker to allow live reload
|
||||
- ./frontend:/app
|
||||
|
||||
|
||||
|
||||
########################################################
|
||||
# BACKEND ##############################################
|
||||
########################################################
|
||||
## login server
|
||||
#########################################################
|
||||
## LOGIN SERVER #########################################
|
||||
#########################################################
|
||||
login-server:
|
||||
build:
|
||||
context: ./login_server/
|
||||
build:
|
||||
target: login_server_debug
|
||||
dockerfile: Dockerfile.debug
|
||||
container_name: login-server
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
cap_add:
|
||||
- SYS_PTRACE
|
||||
depends_on:
|
||||
- mariadb
|
||||
networks:
|
||||
- internal-net
|
||||
- external-net
|
||||
ports:
|
||||
- 1200:1200
|
||||
- 1201:1201
|
||||
volumes:
|
||||
- ./configs/login_server:/etc/grd_login
|
||||
- ./logs:/var/log/grd_login
|
||||
- conan:/root/.conan
|
||||
|
||||
## community server (cakephp with php-fpm and nginx)
|
||||
#########################################################
|
||||
## NGINX ################################################
|
||||
#########################################################
|
||||
nginx:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./nginx/Dockerfile
|
||||
container_name: nginx
|
||||
networks:
|
||||
- external-net
|
||||
- internal-net
|
||||
depends_on:
|
||||
- community-server
|
||||
- login-server
|
||||
ports:
|
||||
- 80:80
|
||||
volumes:
|
||||
- ./logs:/var/log/nginx
|
||||
|
||||
## for debugging mariadb
|
||||
#########################################################
|
||||
## PHPMYADMIN ###########################################
|
||||
#########################################################
|
||||
phpmyadmin:
|
||||
image: phpmyadmin
|
||||
container_name: phpmyadmin
|
||||
@ -79,22 +57,7 @@ services:
|
||||
- external-net
|
||||
volumes:
|
||||
- /sessions
|
||||
|
||||
# image: ocelotsocialnetwork/backend:development
|
||||
# build:
|
||||
# target: development
|
||||
# environment:
|
||||
# - NODE_ENV="development"
|
||||
# - DEBUG=true
|
||||
# volumes:
|
||||
# # This makes sure the docker container has its own node modules.
|
||||
# # Therefore it is possible to have a different node version on the host machine
|
||||
# - backend_node_modules:/app/node_modules
|
||||
# # bind the local folder to the docker to allow live reload
|
||||
# - ./backend:/app
|
||||
|
||||
|
||||
volumes:
|
||||
frontend_node_modules:
|
||||
conan:
|
||||
# backend_node_modules:
|
||||
conan:
|
||||
@ -16,8 +16,8 @@ services:
|
||||
target: production
|
||||
networks:
|
||||
- external-net
|
||||
#depends_on:
|
||||
# - backend
|
||||
depends_on:
|
||||
- nginx
|
||||
ports:
|
||||
- 8080:8080
|
||||
environment:
|
||||
@ -34,9 +34,8 @@ services:
|
||||
# - ./frontend/.env
|
||||
|
||||
#########################################################
|
||||
## BACKEND ##############################################
|
||||
## MARIADB ##############################################
|
||||
#########################################################
|
||||
## mariadb
|
||||
mariadb:
|
||||
build:
|
||||
context: .
|
||||
@ -53,20 +52,28 @@ services:
|
||||
volumes:
|
||||
- db_vol:/var/lib/mysql
|
||||
|
||||
## login server
|
||||
#########################################################
|
||||
## LOGIN SERVER #########################################
|
||||
#########################################################
|
||||
login-server:
|
||||
build:
|
||||
context: ./login_server/
|
||||
target: login_server
|
||||
container_name: login-server
|
||||
depends_on:
|
||||
depends_on:
|
||||
- mariadb
|
||||
networks:
|
||||
- internal-net
|
||||
ports:
|
||||
- 1200:1200
|
||||
- 1201:1201
|
||||
volumes:
|
||||
- ./configs/login_server:/etc/grd_login
|
||||
|
||||
## nginx, connect login-server and community-server together (and php-fpm to community-server)
|
||||
#########################################################
|
||||
## NGINX ################################################
|
||||
#########################################################
|
||||
## nginx, connect login-server and community-server together (and php-fpm to community-server)
|
||||
nginx:
|
||||
build:
|
||||
context: .
|
||||
@ -81,7 +88,9 @@ services:
|
||||
ports:
|
||||
- 80:80
|
||||
|
||||
## community server (cakephp with php-fpm)
|
||||
#########################################################
|
||||
## COMMUNITY SERVER (cakephp with php-fpm) ##############
|
||||
#########################################################
|
||||
community-server:
|
||||
build:
|
||||
context: .
|
||||
@ -98,10 +107,21 @@ services:
|
||||
volumes:
|
||||
- ./community_server/config/php-fpm/php-ini-overrides.ini:/etc/php/7.4/fpm/conf.d/99-overrides.ini
|
||||
|
||||
#########################################################
|
||||
## GRADIDO NODE v1 ######################################
|
||||
#########################################################
|
||||
gradido-node:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./gn/docker/deprecated-hedera-node/Dockerfile
|
||||
volumes:
|
||||
- ${GN_INSTANCE_FOLDER}:/opt/instance
|
||||
container_name: ${GN_CONTAINER_NAME}
|
||||
|
||||
networks:
|
||||
external-net:
|
||||
internal-net:
|
||||
internal: true
|
||||
|
||||
volumes:
|
||||
db_vol:
|
||||
db_vol:
|
||||
|
||||
@ -62,6 +62,32 @@ Wenn alles okay:
|
||||
- gdtSum: sum of gdt of user in cent with 2 places (Nachkommastellen)
|
||||
- timeUsed: time used for getting data from db in seconds, only for analyse backend performance
|
||||
|
||||
## Creation Transaction
|
||||
Make a creation transaction
|
||||
With new Option set in Login-Server:
|
||||
```ini
|
||||
unsecure.allow_auto_sign_transactions = 1
|
||||
```
|
||||
transactions can be auto-signed directly with handing in transaction.
|
||||
Normally a forwarding to login-server check transactions side is neccessary to minimize security risks.
|
||||
|
||||
POST http://localhost/transaction-creations/ajaxCreate
|
||||
```json
|
||||
{
|
||||
"session_id" : -127182,
|
||||
"email": "max.musterman@gmail.de",
|
||||
"amount": 10000000,
|
||||
"target_date":"2021-02-19T13:25:36+00:00",
|
||||
"memo":"AGE",
|
||||
"auto_sign": true
|
||||
}
|
||||
```
|
||||
return if everything is ok:
|
||||
```json
|
||||
{"state":"success", "timeUsed": 0.0122}
|
||||
```
|
||||
- timeUsed: time used for getting data from db in seconds, only for analyse backend performance
|
||||
|
||||
## Send Coins Transaction
|
||||
Make a simple GDD Transaction, send Coins from one user to other.
|
||||
With new Option set in Login-Server:
|
||||
@ -73,7 +99,13 @@ Normally a forwarding to login-server check transactions side is neccessary to m
|
||||
|
||||
POST http://localhost/transaction-send-coins/ajaxCreate
|
||||
```json
|
||||
{"session_id" : -127182, "amount": 2000000, "email": "maxim.mustermann@gmail.com", "memo":"Thank you :)", "auto_sign": true}
|
||||
{
|
||||
"session_id" : -127182,
|
||||
"amount": 2000000,
|
||||
"email": "max.musterman@gmail.de",
|
||||
"memo":"Thank you :)",
|
||||
"auto_sign": true
|
||||
}
|
||||
```
|
||||
- amout: amount to transfer, 2000000 = 200,00 GDD
|
||||
- email: receiver email address, must be differ from user email
|
||||
|
||||
BIN
docu/cookie.png
Normal file
BIN
docu/cookie.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
@ -33,37 +33,11 @@ data: {"email": "max.musterman@gmail.de", "password": "123abcDE&"}
|
||||
|
||||
Wenn alles okay ist erhältst du zum Beispiel:
|
||||
```json
|
||||
{"state":"success", "session_id": -127182, "clientIP":"52.68.96.58",
|
||||
"user": {
|
||||
"created": 1293872400,
|
||||
"disabled": false,
|
||||
"email": "max.musterman@gmail.de",
|
||||
"email_checked": true,
|
||||
"first_name": "Max",
|
||||
"group_alias": "gdd1",
|
||||
"ident_hash": 1829912,
|
||||
"public_hex": "c6e7d6a697fa74d6c247580edf1546989d43487575e21e398abe3cc2094bd63e",
|
||||
"last_name": "Musterman",
|
||||
"role": "none",
|
||||
"username": "",
|
||||
"balance": 174500,
|
||||
"id": 1,
|
||||
"errorCount": 0
|
||||
}}
|
||||
{"state":"success", "session_id": -127182, "clientIP":"52.68.96.58"}
|
||||
```
|
||||
- clientIP: should be the same as where the js-client is running, else maybe a man-in-the-middle attacks is happening or
|
||||
nginx was wrong configured.
|
||||
- session_id: can be also negative
|
||||
- created: unix timestamp in seconds
|
||||
- disabled: if set to true, login and every transaction must fail. Currently used if use would like to have there account deleted.
|
||||
- email_checked: true if user has already clicked on email verification code link in his emails, needed for tranactions
|
||||
- ident_hash: string hash from email, used for speed up creation validation
|
||||
- public_hex: hexadecimal representation of 32 Byte public key of user [0-9a-f]
|
||||
- role: not intended for future use, just ignore, login-server admin will be independently from community-server admin
|
||||
- username: for later use
|
||||
- balance: Gradido Cent, 4 Nachkommastellen (2 Reserve), 174500 = 17,45 GDD
|
||||
- id: login-server user id, only needed for debugging
|
||||
- errorCount: errors occured in this session, should be normally 0
|
||||
|
||||
Anmelden
|
||||
Registrieren kannst du einen neuen Benutzer mit:
|
||||
|
||||
@ -53,7 +53,7 @@ FROM base as development
|
||||
# Run command
|
||||
# (for development we need to execute npm install since the
|
||||
# node_modules are on another volume and need updating)
|
||||
CMD /bin/sh -c "npm install && npm run dev"
|
||||
CMD /bin/sh -c "yarn install && yarn run dev"
|
||||
|
||||
##################################################################################
|
||||
# BUILD (Does contain all files and is therefore bloated) ########################
|
||||
@ -63,9 +63,9 @@ FROM base as build
|
||||
# Copy everything
|
||||
COPY . .
|
||||
# npm install
|
||||
RUN npm install --production=false --frozen-lockfile --non-interactive
|
||||
RUN yarn install --production=false --frozen-lockfile --non-interactive
|
||||
# npm build
|
||||
RUN npm run build
|
||||
RUN yarn run build
|
||||
|
||||
##################################################################################
|
||||
# TEST ###########################################################################
|
||||
@ -73,7 +73,7 @@ RUN npm run build
|
||||
FROM build as test
|
||||
|
||||
# Run command
|
||||
CMD /bin/sh -c "npm run dev"
|
||||
CMD /bin/sh -c "yarn run dev"
|
||||
|
||||
##################################################################################
|
||||
# PRODUCTION (Does contain only "binary"- and static-files to reduce image size) #
|
||||
@ -93,7 +93,7 @@ COPY --from=build ${DOCKER_WORKDIR}/nuxt.config.js ./nuxt.config.js
|
||||
COPY --from=build ${DOCKER_WORKDIR}/package.json ./package.json
|
||||
|
||||
# Run command
|
||||
CMD /bin/sh -c "npm run start"
|
||||
CMD /bin/sh -c "yarn run start"
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,28 +1,25 @@
|
||||
# Vue Gradido Wallet
|
||||
|
||||
|
||||
# install mit npm
|
||||
```
|
||||
$ git clone https://github.com/gradido/gradido_vue_wallet.git [project-name]
|
||||
$ cd [project-name]
|
||||
$ npm install
|
||||
$ npm run serve
|
||||
## install mit npm
|
||||
```bash
|
||||
cd frontend
|
||||
npm install
|
||||
npm run serve
|
||||
|
||||
### Build
|
||||
$ npm run build
|
||||
# build
|
||||
npm run build
|
||||
```
|
||||
|
||||
# install mit docker
|
||||
## install mit docker
|
||||
|
||||
```bash
|
||||
# build
|
||||
docker build -t gradido-frontend .
|
||||
|
||||
# run
|
||||
docker run -it -p 80:80 --rm gradido-frontend
|
||||
```
|
||||
### build
|
||||
$ docker build -t [project-name] .
|
||||
|
||||
### run
|
||||
$ docker run -it -p 80:80 --rm [project-name]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
**Fully Coded Components**
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
"serve": "vue-cli-service serve --open",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint",
|
||||
"dev": "npm run serve",
|
||||
"dev": "yarn run serve",
|
||||
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
19
frontend/src/mixins/loginAPI.js
Normal file
19
frontend/src/mixins/loginAPI.js
Normal file
@ -0,0 +1,19 @@
|
||||
// TODO move this
|
||||
const LOGIN_API_URL = 'http://localhost/login_api/'
|
||||
|
||||
// define a mixin object
|
||||
const loginAPI = {
|
||||
mutations: {
|
||||
login: async () => {
|
||||
return axios.post(LOGIN_API_URL + 'unsecureLogin', data);
|
||||
},
|
||||
creatUser : async () => {
|
||||
return axios.post(LOGIN_API_URL + 'createUser', data);
|
||||
},
|
||||
logout: async () => {
|
||||
return axios.post(LOGIN_API_URL + 'logout', data);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default loginAPI
|
||||
9932
frontend/yarn.lock
Normal file
9932
frontend/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
||||
Subproject commit 9b9115290c8d2ead756d64b70ae63a6571aa4693
|
||||
Subproject commit 2a033c34e4657e84a4387ecfda1cd6102032e95e
|
||||
Loading…
x
Reference in New Issue
Block a user