Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
93e5bce1
Commit
93e5bce1
authored
Dec 14, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing config logic: its use in the docker-compose and new inipath for server
parent
6d0b9a48
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
10 deletions
+14
-10
parametres_comex.ini
config/parametres_comex.ini
+4
-4
comex_main_backend.py
services/comex_main_backend.py
+1
-0
tools.py
services/tools.py
+7
-4
Dockerfile
setup/dockers/comex2_services/Dockerfile
+1
-0
docker-compose.yml
setup/dockers/docker-compose.yml
+1
-2
No files found.
config/parametres_comex.ini
View file @
93e5bce1
...
...
@@ -17,12 +17,12 @@ API_ROUTE = /api
################################################################################
[services]
# subservice for the comex_shared database
SQL_HOST
=
172.17.0.2
#
inner address of
subservice for the comex_shared database
SQL_HOST
=
comex_db_backend
SQL_PORT
=
3306
# subservice for authentication credentials
#
outer address of
subservice for authentication credentials
DOORS_HOST
=
0.0.0.0
DOORS_PORT
=
8
989
DOORS_PORT
=
8
0
################################################################################
services/comex_main_backend.py
View file @
93e5bce1
...
...
@@ -140,6 +140,7 @@ MIN_KW = 5
# -----------------------------------------------------------------------
# /services/user/register
print
(
"register route: "
,
config
[
'PREFIX'
]
+
config
[
'USR_ROUTE'
]
+
'/register'
)
@
app
.
route
(
config
[
'PREFIX'
]
+
config
[
'USR_ROUTE'
]
+
'/register'
,
methods
=
[
'GET'
,
'POST'
])
def
register
():
if
request
.
method
==
'GET'
:
...
...
services/tools.py
View file @
93e5bce1
...
...
@@ -13,8 +13,8 @@ CONFIGMENU = [
{
"sec"
:
'main'
,
"var"
:
'COMEX_HOST'
,
"def"
:
'0.0.0.0'
},
{
"sec"
:
'main'
,
"var"
:
'COMEX_PORT'
,
"def"
:
'9090'
},
{
"sec"
:
'routes'
,
"var"
:
'PREFIX'
,
"def"
:
'/services'
},
{
"sec"
:
'routes'
,
"var"
:
'USR_ROUTE'
,
"def"
:
'/user
/'
},
{
"sec"
:
'routes'
,
"var"
:
'API_ROUTE'
,
"def"
:
'/api
/'
},
{
"sec"
:
'routes'
,
"var"
:
'USR_ROUTE'
,
"def"
:
'/user
'
},
{
"sec"
:
'routes'
,
"var"
:
'API_ROUTE'
,
"def"
:
'/api
'
},
{
"sec"
:
'services'
,
"var"
:
'SQL_HOST'
,
"def"
:
'172.17.0.2'
},
{
"sec"
:
'services'
,
"var"
:
'SQL_PORT'
,
"def"
:
'3306'
},
{
"sec"
:
'services'
,
"var"
:
'DOORS_HOST'
,
"def"
:
'0.0.0.0'
},
...
...
@@ -42,10 +42,12 @@ def read_config():
our_home
=
home_path
()
ini
=
ConfigParser
()
ini
.
read
(
path
.
join
(
our_home
,
"parametres_comex.ini"
))
inipath
=
path
.
join
(
our_home
,
"config"
,
"parametres_comex.ini"
)
ini
.
read
(
inipath
)
# debug sections
# print("ini sections:", [sec for sec in ini.keys()])
if
"main"
not
in
ini
:
print
(
"WARNING: the config file at '
%
s' seems empty, I will use env or default values"
)
# read ini file and use 2 fallbacks: env or default
for
citem
in
CONFIGMENU
:
...
...
@@ -53,6 +55,7 @@ def read_config():
varname
=
citem
[
'var'
]
default
=
citem
[
'def'
]
is_bool
=
(
type
(
default
)
==
bool
)
if
section
in
ini
and
varname
in
ini
[
section
]:
if
is_bool
:
out_dict
[
varname
]
=
ini
.
getboolean
(
section
,
varname
)
...
...
setup/dockers/comex2_services/Dockerfile
View file @
93e5bce1
...
...
@@ -21,6 +21,7 @@ RUN pip3 install --upgrade pip
# for comex2 itself ----------------------------------------------------------
# pull the comex server from repository
RUN
echo
"updating git"
RUN
git clone https://github.com/moma/comex2.git
# Install project dependencies
...
...
setup/dockers/docker-compose.yml
View file @
93e5bce1
...
...
@@ -28,11 +28,10 @@
links
:
-
comex_db_test:comex_db_backend
-
doors_test:doors_backend
# links the outside config parametres_comex.ini to the inside
# /!\ this erases the contained config with the outside one /!\
volumes
:
-
../../config:/comex2/config
-
../../config
/
:/comex2/config
# # moved from env vars to new config vars via volume config
# environment:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment