mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
update scripts and doc for setup without docker
This commit is contained in:
parent
32205dc798
commit
df5a910368
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -31,3 +31,6 @@
|
|||||||
[submodule "login_server/src/proto"]
|
[submodule "login_server/src/proto"]
|
||||||
path = login_server/src/proto
|
path = login_server/src/proto
|
||||||
url = https://github.com/gradido/gradido_protocol.git
|
url = https://github.com/gradido/gradido_protocol.git
|
||||||
|
[submodule "login_server/dependencies/protobuf"]
|
||||||
|
path = login_server/dependencies/protobuf
|
||||||
|
url = https://github.com/protocolbuffers/protobuf.git
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
sudo apt install libsodium-dev
|
|
||||||
|
|
||||||
# get dependencies
|
|
||||||
git submodule update --init --recursive
|
|
||||||
|
|
||||||
|
|
||||||
cd dependencies/mariadb-connector-c
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake -DWITH_SSL=OFF ..
|
|
||||||
cd ../../../
|
|
||||||
|
|
||||||
|
|
||||||
# get more dependencies with conan (need conan from https://conan.io/)
|
|
||||||
mkdir build && cd build
|
|
||||||
# // not used anymore
|
|
||||||
# conan remote add inexor https://api.bintray.com/conan/inexorgame/inexor-conan
|
|
||||||
# not needed, but bincrafter
|
|
||||||
# conan install .. -s build_type=Debug
|
|
||||||
conan install ..
|
|
||||||
|
|
||||||
# build Makefile with cmake
|
|
||||||
cmake ..
|
|
||||||
|
|
||||||
make grpc
|
|
||||||
# under windows build at least release for protoc.exe and grpc c++ plugin
|
|
||||||
cd ../
|
|
||||||
./unix_parse_proto.sh
|
|
||||||
cd build
|
|
||||||
make
|
|
||||||
|
|
||||||
147
login_server/README.md
Normal file
147
login_server/README.md
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
# Build Login-Server yourself
|
||||||
|
## Linux (Ubuntu) Packets
|
||||||
|
install build essentials
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install -y gcovr build-essential gettext libcurl4-openssl-dev libssl-dev libsodium-dev libboost-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## CMake
|
||||||
|
I use CMake for build file generation and the Login-Server needs at least version v3.18.2
|
||||||
|
You can build and install it from source.
|
||||||
|
The Version in apt is sadly to old.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/Kitware/CMake.git --branch v3.18.2
|
||||||
|
cd CMake
|
||||||
|
./bootstrap --parallel=$(nproc) && make -j$(nproc) && sudo make install
|
||||||
|
```
|
||||||
|
|
||||||
|
## dependencies
|
||||||
|
load git submodules if you haven't done it yet
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
|
## build tools
|
||||||
|
build protoc and page compiler needed for generating some additional code
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd scripts
|
||||||
|
./prepare_build.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## build
|
||||||
|
build login-server in debug mode
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd scripts
|
||||||
|
./build_debug.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## multilanguage text
|
||||||
|
Login-Server uses gettext translations found after build in src/LOCALE
|
||||||
|
On Linux Login-Server expect the *.po files in folder /etc/grd_login/LOCALE
|
||||||
|
on windows next to Binary in Folder LOCALE.
|
||||||
|
So please copy them over by yourself on first run or after change.
|
||||||
|
|
||||||
|
If you like to update some translations your find a messages.pot in src/LOCALE.
|
||||||
|
Use it together with poedit and don't forget to copy over *.po files after change to /etc/grd_login/LOCALE
|
||||||
|
To update messages.pot run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/compile_pot.sh
|
||||||
|
```
|
||||||
|
This will be also called by ./scripts/build_debug.sh
|
||||||
|
|
||||||
|
## database
|
||||||
|
Login-Server needs a db to run, it is tested with mariadb
|
||||||
|
table definitions are found in folder ./skeema/gradido_login
|
||||||
|
Currently at least one group must be present in table groups.
|
||||||
|
For example:
|
||||||
|
```sql
|
||||||
|
INSERT INTO `groups` (`id`, `alias`, `name`, `url`, `host`, `home`, `description`) VALUES
|
||||||
|
(1, 'docker', 'docker gradido group', 'localhost', 'localhost', '/', 'gradido test group for docker with blockchain db');
|
||||||
|
```
|
||||||
|
|
||||||
|
## configuration
|
||||||
|
Login-Server needs a configuration file to able to run.
|
||||||
|
On Linux it expect it to find the file /etc/grd_login/grd_login.properties
|
||||||
|
and /etc/grd_login/grd_login_test.properties for unittest
|
||||||
|
|
||||||
|
Example configuration (ini-format)
|
||||||
|
```ini
|
||||||
|
# Port for Web-Interface
|
||||||
|
HTTPServer.port = 1200
|
||||||
|
# Port for json-Interface (used by new backend)
|
||||||
|
JSONServer.port = 1201
|
||||||
|
# default group id for new users, if no group was choosen
|
||||||
|
Gradido.group_id = 1
|
||||||
|
|
||||||
|
# currently not used
|
||||||
|
crypto.server_admin_public = f909a866baec97c5460b8d7a93b72d3d4d20cc45d9f15d78bd83944eb9286b7f
|
||||||
|
# Server admin Passphrase
|
||||||
|
# nerve execute merit pool talk hockey basic win cargo spin disagree ethics swear price purchase say clutch decrease slow half forest reform cheese able
|
||||||
|
#
|
||||||
|
|
||||||
|
# TODO: auto-generate in docker build step
|
||||||
|
# expect valid hex 32 character long (16 Byte)
|
||||||
|
# salt for hashing user password, should be moved into db generated and saved per user, used for hardening against hash-tables
|
||||||
|
crypto.server_key = a51ef8ac7ef1abf162fb7a65261acd7a
|
||||||
|
|
||||||
|
# TODO: auto-generate in docker build step
|
||||||
|
# salt for hashing user encryption key, expect valid hex, as long as you like, used in sha512
|
||||||
|
crypto.app_secret = 21ffbbc616fe
|
||||||
|
|
||||||
|
# for url forwarding to old frontend, path of community server
|
||||||
|
phpServer.url = http://localhost/
|
||||||
|
# host for community server api calls
|
||||||
|
phpServer.host = localhost
|
||||||
|
# port for community server api calls
|
||||||
|
phpServer.port = 80
|
||||||
|
|
||||||
|
# Path for Login-Server Web-Interface used for link-generation
|
||||||
|
loginServer.path = http://localhost/account
|
||||||
|
# default language for new users and if no one is logged in
|
||||||
|
loginServer.default_locale = de
|
||||||
|
|
||||||
|
# db setup tested with mariadb, should also work with mysql
|
||||||
|
loginServer.db.host = localhost
|
||||||
|
loginServer.db.name = gradido_login
|
||||||
|
loginServer.db.user = root
|
||||||
|
loginServer.db.password =
|
||||||
|
loginServer.db.port = 3306
|
||||||
|
|
||||||
|
# check email path for new frontend for link generation in emails
|
||||||
|
frontend.checkEmailPath = http://localhost/vue/reset
|
||||||
|
|
||||||
|
# disable email all together
|
||||||
|
email.disable = true
|
||||||
|
|
||||||
|
# setup email smtp server for sending emails
|
||||||
|
#email.username =
|
||||||
|
#email.sender =
|
||||||
|
#email.admin_receiver =
|
||||||
|
#email.password =
|
||||||
|
#email.smtp.url =
|
||||||
|
#email.smtp.port =
|
||||||
|
|
||||||
|
# server setup types: test, staging or production
|
||||||
|
# used mainly to decide if using http or https for links
|
||||||
|
# test use http and staging and production uses https
|
||||||
|
ServerSetupType=test
|
||||||
|
dev.default_group = docker
|
||||||
|
|
||||||
|
# Session timeout in minutes
|
||||||
|
session.timeout = 15
|
||||||
|
|
||||||
|
# Disabling security features for faster develop and testing
|
||||||
|
unsecure.allow_passwort_via_json_request = 1
|
||||||
|
unsecure.allow_auto_sign_transactions = 1
|
||||||
|
unsecure.allow_cors_all = 1
|
||||||
|
|
||||||
|
# default disable, passwords must contain a number, a lower character, a high character, special character, and be at least 8 characters long
|
||||||
|
unsecure.allow_all_passwords = 1
|
||||||
|
|
||||||
|
```
|
||||||
1
login_server/dependencies/protobuf
Submodule
1
login_server/dependencies/protobuf
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 0b8d13a1d4cd9be16ed8a2230577aa9c296aa1ca
|
||||||
@ -1,12 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cd ../scripts
|
|
||||||
|
|
||||||
chmod +x compile_pot.sh
|
chmod +x compile_pot.sh
|
||||||
|
./compile_pot.sh
|
||||||
|
|
||||||
cd ../build
|
cd ../build
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
./compile_pot.sh
|
|
||||||
make -j$(nproc) Gradido_LoginServer
|
make -j$(nproc) Gradido_LoginServer
|
||||||
|
|
||||||
chmod +x ./bin/Gradido_LoginServer
|
chmod +x ./bin/Gradido_LoginServer
|
||||||
|
|||||||
@ -9,9 +9,9 @@ fi
|
|||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DWITH_SSL=OFF ..
|
cmake -DWITH_SSL=OFF ..
|
||||||
cd ../../
|
cd ../../../
|
||||||
|
|
||||||
if [! -d "./build" ] ; then
|
if [ ! -d "./build" ] ; then
|
||||||
mkdir build
|
mkdir build
|
||||||
fi
|
fi
|
||||||
cd build
|
cd build
|
||||||
|
|||||||
8
login_server/scripts/unittest_coverage.sh
Normal file
8
login_server/scripts/unittest_coverage.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd ../build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Debug -DCOLLECT_COVERAGE_DATA=ON -DCOVERAGE_TOOL=gcovr .. && \
|
||||||
|
make -j$(nproc) Gradido_LoginServer_Test
|
||||||
|
make coverage
|
||||||
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user