Commit a4733888 by Mac Stephens

Move agency websites and logs into WCSO and BFD deployment folders and update client build paths.

parent c2c17c32
...@@ -41,6 +41,10 @@ Server/Win32/ ...@@ -41,6 +41,10 @@ Server/Win32/
Server/Win64/ Server/Win64/
Server/bin/logs/ Server/bin/logs/
Server/bin/static/ Server/bin/static/
Server/bin/WCSO/logs/
Server/bin/WCSO/static/
Server/bin/BFD/logs/
Server/bin/BFD/static/
Server/Source/Common/__history/ Server/Source/Common/__history/
Server/Source/Common/__recovery/ Server/Source/Common/__recovery/
Client/CommonSource/__history/ Client/CommonSource/__history/
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<SanitizedProjectName>bfdEmiMobile</SanitizedProjectName> <SanitizedProjectName>bfdEmiMobile</SanitizedProjectName>
<VerInfo_Locale>1046</VerInfo_Locale> <VerInfo_Locale>1046</VerInfo_Locale>
<TMSWebProject>2</TMSWebProject> <TMSWebProject>2</TMSWebProject>
<TMSWebOutputPath>..\..\Server\bin\static\BFD</TMSWebOutputPath> <TMSWebOutputPath>..\..\Server\bin\BFD\static</TMSWebOutputPath>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.802;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;LastCompiledTime=2018/07/25 12:57:53</VerInfo_Keys> <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.802;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;LastCompiledTime=2018/07/25 12:57:53</VerInfo_Keys>
<DCC_Define>SKIA;$(DCC_Define)</DCC_Define> <DCC_Define>SKIA;$(DCC_Define)</DCC_Define>
<TMSWebHTMLFile>Source\index.html</TMSWebHTMLFile> <TMSWebHTMLFile>Source\index.html</TMSWebHTMLFile>
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<SanitizedProjectName>lemsEmiMobile</SanitizedProjectName> <SanitizedProjectName>lemsEmiMobile</SanitizedProjectName>
<VerInfo_Locale>1046</VerInfo_Locale> <VerInfo_Locale>1046</VerInfo_Locale>
<TMSWebProject>2</TMSWebProject> <TMSWebProject>2</TMSWebProject>
<TMSWebOutputPath>..\..\Server\bin\static\Lems</TMSWebOutputPath> <TMSWebOutputPath>..\..\Server\bin\WCSO\static</TMSWebOutputPath>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.802;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;LastCompiledTime=2018/07/25 12:57:53</VerInfo_Keys> <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.802;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;LastCompiledTime=2018/07/25 12:57:53</VerInfo_Keys>
<DCC_Define>SKIA;$(DCC_Define)</DCC_Define> <DCC_Define>SKIA;$(DCC_Define)</DCC_Define>
<TMSWebHTMLFile>Source\index.html</TMSWebHTMLFile> <TMSWebHTMLFile>Source\index.html</TMSWebHTMLFile>
......
# emiMobile # emiMobile
## Deployment folders
The shared server runs one agency per instance. Keep `emiMobileServer.ini` and
`emiMobileServer.json` beside `emiMobileServer.exe`.
```text
Server/bin/
emiMobileServer.exe
emiMobileServer.ini
emiMobileServer.json
WCSO/
logs/
static/
BFD/
logs/
static/
```
`[Application] Agency=WC` selects `WCSO/static` and `WCSO/logs`.
`Agency=BFD` selects `BFD/static` and `BFD/logs`.
Paths are relative to the executable, not the working directory. Log folders
are created automatically. Missing or invalid agency settings retain the root
`logs` folder for startup diagnostics; server startup still rejects that setting.
Build `Client/Lems/lemsEmiMobile.dproj` into `Server/bin/WCSO/static` and
`Client/BFD/bfdEmiMobile.dproj` into `Server/bin/BFD/static`; both project files
already specify these output paths. Include the complete website, including
`assets`, `css`, and `config`, when deploying. Public `/app/`, `/auth/`, `/api/`,
and WebSocket URLs are unchanged by this folder layout.
When upgrading an existing deployment, move `static/Lems` to `WCSO/static`
or `static/BFD` to `BFD/static`. Existing root `logs` can remain as historical
logs; new application logs go into the selected agency's `logs` folder.
...@@ -69,9 +69,9 @@ begin ...@@ -69,9 +69,9 @@ begin
IniEntries.ValidateDatabaseSettings; IniEntries.ValidateDatabaseSettings;
if IniEntries.Agency = 'WC' then if IniEntries.Agency = 'WC' then
serverConfig.FWebAppFolder := TPath.Combine(ExtractFilePath(ParamStr(0)), 'static\Lems') serverConfig.FWebAppFolder := TPath.Combine(ExtractFilePath(ParamStr(0)), 'WCSO\static')
else else
serverConfig.FWebAppFolder := TPath.Combine(TPath.Combine(ExtractFilePath(ParamStr(0)), 'static'), IniEntries.Agency); serverConfig.FWebAppFolder := TPath.Combine(ExtractFilePath(ParamStr(0)), 'BFD\static');
Logger.Log(1, '-- Agency: ' + IniEntries.Agency + ' [from ini]'); Logger.Log(1, '-- Agency: ' + IniEntries.Agency + ' [from ini]');
Logger.Log(1, '-- webAppFolder: ' + serverConfig.webAppFolder + ' [derived from Agency]'); Logger.Log(1, '-- webAppFolder: ' + serverConfig.webAppFolder + ' [derived from Agency]');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Agency=BFD Agency=BFD
[Settings] [Settings]
LogFileNum=208 LogFileNum=209
webClientVersion=0.9.4.9 webClientVersion=0.9.4.9
MemoLogLevel=3 MemoLogLevel=3
FileLogLevel=4 FileLogLevel=4
......
...@@ -116,16 +116,20 @@ constructor TFileLogAppender.Create(ALogLevel: integer; AFilename: string); ...@@ -116,16 +116,20 @@ constructor TFileLogAppender.Create(ALogLevel: integer; AFilename: string);
var var
iniFile: TIniFile; iniFile: TIniFile;
fileNum: integer; fileNum: integer;
logsDir: string; agency: string;
begin begin
FLogLevel := ALogLevel; FLogLevel := ALogLevel;
FCriticalSection := TCriticalSection.Create; FCriticalSection := TCriticalSection.Create;
FLogDirectory := ExtractFilePath(Application.ExeName) + 'logs\';
if not DirectoryExists(FLogDirectory) then
CreateDir(FLogDirectory);
iniFile := TIniFile.Create( ChangeFileExt(Application.ExeName, '.ini') ); iniFile := TIniFile.Create( ChangeFileExt(Application.ExeName, '.ini') );
try try
agency := UpperCase(Trim(iniFile.ReadString('Application', 'Agency', '')));
FLogDirectory := ExtractFilePath(Application.ExeName) + 'logs\';
if agency = 'WC' then
FLogDirectory := ExtractFilePath(Application.ExeName) + 'WCSO\logs\'
else if agency = 'BFD' then
FLogDirectory := ExtractFilePath(Application.ExeName) + 'BFD\logs\';
ForceDirectories(FLogDirectory);
fileNum := iniFile.ReadInteger( 'Settings', 'LogFileNum', 0 ) + 1; fileNum := iniFile.ReadInteger( 'Settings', 'LogFileNum', 0 ) + 1;
FFilename := AFilename + Format( '%.4d', [fileNum] ); FFilename := AFilename + Format( '%.4d', [fileNum] );
iniFile.WriteInteger( 'Settings', 'LogFileNum', fileNum ); iniFile.WriteInteger( 'Settings', 'LogFileNum', fileNum );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment