File tree 2 files changed +16
-5
lines changed
services/web/server/src/simcore_service_webserver
2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 8
8
9
9
version = Version (__version__ )
10
10
11
- api_version_prefix : str = f"v{ version .major } "
11
+ app_name : str = __name__ .split ("." )[0 ]
12
+ api_version : str = __version__
13
+ api_vtag : str = f"v{ version .major } "
14
+
15
+ # legacy
16
+ api_version_prefix : str = api_vtag
Original file line number Diff line number Diff line change 8
8
from aiohttp import web
9
9
from pydantic import BaseSettings
10
10
11
- APP_SETTINGS_KEY = f"{ __name__ } .build_time_settings"
11
+ from .__version__ import app_name , api_version
12
+
13
+ APP_SETTINGS_KEY = f"{ __name__ } .app_settings"
12
14
13
15
log = logging .getLogger (__name__ )
14
16
15
17
16
- class BuildTimeSettings (BaseSettings ):
17
- # All these settings are defined in the Dockerfile at build-image time
18
+ class ApplicationSettings (BaseSettings ):
19
+ # settings defined by the code
20
+ app_name : str = app_name
21
+ api_version : str = api_version
22
+
23
+ # settings defined when docker image is built
18
24
vcs_url : Optional [str ] = None
19
25
vcs_ref : Optional [str ] = None
20
26
build_date : Optional [str ] = None
@@ -43,5 +49,5 @@ def public_dict(self) -> Dict:
43
49
44
50
45
51
def setup_settings (app : web .Application ):
46
- app [APP_SETTINGS_KEY ] = BuildTimeSettings ()
52
+ app [APP_SETTINGS_KEY ] = ApplicationSettings ()
47
53
log .info ("Captured app settings:\n %s" , app [APP_SETTINGS_KEY ].json (indent = 2 ))
You can’t perform that action at this time.
0 commit comments