Commit d5ec2832 authored by marmous's avatar marmous

Initial commit

parent 08ae8305
\section{}
% \begin{figure}[h!]
% \includegraphics[width=\linewidth]{etatart/images/layercake}
% \caption{Représentation imagée des couches d’un conteneur}
% \label{fig:layercake}
% \end{figure}
% \begin{itemize}
% \item dklmfh
% \item lmskjg
% \end{itemize}
%\textbf{science}
%\emph{science}
%\underline{science}
%la commande \verb|docker swarm init|
%\newpage
%\par or \\ or newline
%\ref{fig:KE5HostingAccesDirect}
%~ espace inséccable
%\begin{tcolorbox}[colback=consolebg,boxsep=1pt,left=2pt,right=2pt,top=0pt,bottom=0pt]
%\begin{lstlisting}[style=DOS]
%C:\>docker stack deploy -c test.kronosefficient.com.yml test
%\end{lstlisting}
%\end{tcolorbox}
% \begin{table}[ht]
% \begin{center}
% \begin{tabular}{ |c|c|c|c|c| }
% \hline
% % header
% \thead{Projets} & \thead{Sous-projets} & \thead{MOA} & \thead{MOE} & \thead{Réalisation} \\
% \hline
% % PRA
% \multirow{2}{4em}{PRA} & Supervision & Y. Calamai & Y. Calamai & Étudiant \\
% & Documentation & Y. Calamai & Y. Calamai & Étudiant \\
% \hline
% % PCA
% \multirow{3}{4em}{PCA} & SQL Server HA & Y. Calamai & Y. Calamai & Étudiant \\
% & Orchestration de conteneurs & Y. Calamai & Y. Calamai & Y. Calamai \\
% & Documentation & Y. Calamai & Y. Calamai & Étudiant \\
% \hline
% % Sécurité
% \multirow{2}{4em}{Sécurité} & Certification ISO 27001 & Sécurité & Sécurité & Y. Calamai \\
% & Audit de sécurité & Sécurité & Sécurité & Externe/Y. Calamai \\
% \hline
% \end{tabular}
% \caption{Résumé des projets}
% \label{table:ResumeProjets}
% \end{center}
% \end{table}
\ No newline at end of file
This diff is collapsed.
\begin{vcenterpage}
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\adjustmtc
\markright{\MakeUppercase{Abstract}}
Insérer ici votre résumé en anglais.\\
Keywords : keyword 1, keyword 2, ... keyword 10 (maximum).
\end{vcenterpage}
\ No newline at end of file
# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019
LABEL vendor="Kronos" `
product="Kronos Efficient" `
version="5.3.5600.1" `
releasedate="2018-01-31" `
patchdate="2019-08-20" `
maintainer="Yoann Calamai <yoann.calamai@kronos.com>"
# Variables
ENV EFFICIENT_URL=_ `
SQLSERVER_NAME=_ `
SQLSERVER_DBNAME=_ `
SQLSERVER_USER=_ `
SQLSERVER_PWD=_ `
PUBLIC_IP=_ `
SSL_THUMPRINT=_
# add files
COPY EntryPoint.ps1 c:/
COPY Efficient5/ c:/Efficient5/
COPY www/ c:/inetpub/wwwroot/
COPY oledlg/oledlg32.dll c:/windows/System32/oledlg.dll
COPY oledlg/oledlg64.dll c:/windows/syswow64/oledlg.dll
# register ASP dlls
RUN c:\Efficient5\App\Bin\effreg.bat
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; "]
# install IIS and Asp.Net
RUN Add-WindowsFeature Web-Server, Web-Http-Redirect, Web-Http-Tracing, Web-Dyn-Compression, Web-Windows-Auth, Web-Asp, NET-Framework-45-ASPNET, NET-WCF-HTTP-Activation45, Web-Asp-Net45;
# config IIS
RUN Import-Module WebAdministration; `
Set-ItemProperty -Path 'IIS:\AppPools\DefaultAppPool' -name 'managedRuntimeVersion' -value 'v4.0' -Force;`
Set-ItemProperty -Path 'IIS:\AppPools\DefaultAppPool' -name 'enable32BitAppOnWin64' -value $false -Force;`
Set-ItemProperty -Path 'IIS:\AppPools\DefaultAppPool' -name 'managedPipelineMode' -value 'Classic' -Force;`
Set-ItemProperty -Path 'IIS:\AppPools\DefaultAppPool' -name 'processModel' -value @{identitytype='ApplicationPoolIdentity'} -Force;`
New-Item -Type Application -Path 'IIS:\Sites\Default Web Site\Efficient5' -physicalPath 'C:\Efficient5\App' -Force;`
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/asp /session.allowSessionState:"False" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/asp /session.timeout:"13:37:00" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/asp /limits.scriptTimeout:"13:37:00" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.traceFailedRequestsLogging.enabled:"True" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.traceFailedRequestsLogging.directory:"%SystemDrive%\inetpub\logs\FailedReqLogFiles" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.traceFailedRequestsLogging.maxLogFiles:"20" /commit:apphost; `
# c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/log /centralLogFileMode:"CentralW3C" /commit:apphost; `
# c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/log /centralW3CLogFile.truncateSize:4294967295 /commit:apphost; `
# c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/log /centralW3CLogFile.period:"MaxSize" /commit:apphost; `
# c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/log /centralW3CLogFile.localTimeRollover:"True" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"true" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/security/authentication/anonymousAuthentication /userName:"" /commit:apphost;
EXPOSE 80 443
HEALTHCHECK --interval=60s `
CMD powershell -command `
try { `
$response = iwr http://localhost/efficient5/client/full/integrateeps.asp -UseBasicParsing; `
if ($response.StatusCode -eq 200) { return 0} `
else {return 1}; `
} catch { return 1 }
ENTRYPOINT C:\EntryPoint.ps1 -Verbose
# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019
LABEL vendor="Kronos" `
product="Kronos Efficient" `
version="5.3.5600.1" `
releasedate="2018-01-31" `
patchdate="2019-08-20" `
maintainer="Yoann Calamai <yoann.calamai@kronos.com>"
# Variables
ENV EFFICIENT_URL=_ `
SQLSERVER_NAME=_ `
SQLSERVER_DBNAME=_ `
SQLSERVER_USER=_ `
SQLSERVER_PWD=_ `
PUBLIC_IP=_
# add files
COPY EntryPoint.ps1 c:/
COPY Efficient5/ c:/Efficient5/
COPY www/ c:/inetpub/wwwroot/
COPY oledlg/oledlg32.dll c:/windows/System32/oledlg.dll
COPY oledlg/oledlg64.dll c:/windows/syswow64/oledlg.dll
# register ASP dlls
RUN c:\Efficient5\App\Bin\effreg.bat
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; "]
# install IIS and Asp.Net
RUN Add-WindowsFeature Web-Server, Web-Http-Redirect, Web-Http-Tracing, Web-Dyn-Compression, Web-Windows-Auth, Web-Asp, NET-Framework-45-ASPNET, NET-WCF-HTTP-Activation45, Web-Asp-Net45;
\ No newline at end of file
# config IIS
RUN Import-Module WebAdministration; `
Set-ItemProperty -Path 'IIS:\AppPools\DefaultAppPool' -name 'managedRuntimeVersion' -value 'v4.0' -Force;`
Set-ItemProperty -Path 'IIS:\AppPools\DefaultAppPool' -name 'enable32BitAppOnWin64' -value $false -Force;`
Set-ItemProperty -Path 'IIS:\AppPools\DefaultAppPool' -name 'managedPipelineMode' -value 'Classic' -Force;`
Set-ItemProperty -Path 'IIS:\AppPools\DefaultAppPool' -name 'processModel' -value @{identitytype='ApplicationPoolIdentity'} -Force;`
New-Item -Type Application -Path 'IIS:\Sites\Default Web Site\Efficient5' -physicalPath 'C:\Efficient5\App' -Force;`
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/asp /session.allowSessionState:"False" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/asp /session.timeout:"13:37:00" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/asp /limits.scriptTimeout:"13:37:00" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.traceFailedRequestsLogging.enabled:"True" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.traceFailedRequestsLogging.directory:"%SystemDrive%\inetpub\logs\FailedReqLogFiles" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.traceFailedRequestsLogging.maxLogFiles:"20" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"true" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/security/authentication/anonymousAuthentication /userName:"" /commit:apphost;
EXPOSE 80 443
HEALTHCHECK --interval=60s `
CMD powershell -command `
try { `
$response = iwr http://localhost/efficient5/client/full/integrateeps.asp -UseBasicParsing; `
if ($response.StatusCode -eq 200) { return 0} `
else {return 1}; `
} catch { return 1 }
ENTRYPOINT C:\EntryPoint.ps1 -Verbose
function Log {
Param($Text)
Write-Output "$(get-date -format "yyyy-MM-dd HH:mm:ss,fff") ## $Text"
}
function RunSQLFile{
Param($ConnStr, [parameter(ValueFromPipeline)]$SQLFilePath)
begin
{
$Conn=New-Object System.Data.SQLClient.SQLConnection $ConnStr;
$Conn.Open();
}
process
{
try{
Log "Updating database with $SQLFilePath ..."
$DataCmd = New-Object System.Data.SqlClient.SqlCommand;
$DataCmd.CommandText = @(get-content $SQLFilePath);
$DataCmd.CommandTimeout = 3600;
$DataCmd.Connection = $Conn;
$DataCmd.ExecuteNonQuery();
}catch{
Write-Host "An error occurs updating db.Please fix this manualy."
Write-Host $_
}
}
end
{
$Conn.Close();
$Conn.Dispose();
}
}
Log "Starting entry point..."
# if $Url contains localhost
# replace localhost by local ip address
$localip = (Get-NetIPAddress | Where-Object {$_.PrefixOrigin -eq "Manual"} | Select-Object IPAddress)[0].IPAddress
if ($Env:EFFICIENT_URL -like "*localhost*") {
$Url = $Env:EFFICIENT_URL.replace("localhost", $localip)
}else {
$Url = $Env:EFFICIENT_URL;
}
# check user input EFFICIENT_URL
if (-not(($Url.StartsWith("http://") -or $Url.StartsWith("https://")) -and ($Url.Split('/').Count -eq 4) -and ($Url.EndsWith("/efficient5"))))
{
Write-Output "ERROR : Efficient5 url not provided"
Write-Output "Set the environment variable EFFICIENT_URL"
Write-Output "EFFICIENT_URL must be like http://yourDNS/efficient5"
exit 1
}
\ No newline at end of file
# update hosts file for dns name into url = local ip address or localhost
Log "Configuring hosts file..."
$hostname = $Url.Split('/')[2].Split(':')[0]
try{
$publicIp = [ipaddress]$Env:PUBLIC_IP
$value = "$Env:PUBLIC_IP $hostname"
}catch{
$value = "$localip $hostname"
}
if(-not(Get-Content "C:\Windows\System32\drivers\etc\hosts").Contains($value)){
Add-Content -Path "C:\Windows\System32\drivers\etc\hosts" -Value $value
}
# check user input SQLSERVER_*
if($Env:SQLSERVER_NAME -eq "_" -or $Env:SQLSERVER_DBNAME -eq "_" -or $Env:SQLSERVER_USER -eq "_" -or $Env:SQLSERVER_PWD -eq "_"){
Write-Output "ERROR : Informations to connect to sql server not provided"
Write-Output "Set the environment variables SQLSERVER_NAME, SQLSERVER_DBNAME, SQLSERVER_USER and SQLSERVER_PWD"
exit 1
}
$ConnectionString = "Data Source=$Env:SQLSERVER_NAME;Initial Catalog=$Env:SQLSERVER_DBNAME;Integrated Security=False;User ID=$Env:SQLSERVER_USER;Password=$Env:SQLSERVER_PWD;Network Library=dbmssocn;Application Name=KronosEfficient";
try
{
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection $ConnectionString;
$sqlConnection.Open();
$sqlConnection.Close();
Log "Connection to SQL server succeeded"
}
catch
{
Log "ERROR : Cannot connect to SQL server"
exit 1
}
# modify "Efficient5\App\Web.config"
Log "Updating Web.config..."
$xml=[xml](Get-Content c:\Efficient5\App\Web.config);
($xml.configuration.appSettings.add | Where-Object key -eq Connection).value = $ConnectionString;
($xml.configuration.appSettings.add | Where-Object key -eq siteRoot).value = $Url;
($xml.configuration.appSettings.add | Where-Object key -eq Efficient4).value = "$Url/client/full";
$xml.Save("c:\Efficient5\App\Web.config");
# modify "Efficient5\Tools\ManConsole.exe.config"
Log "Updating ManConsole.exe.config..."
$xml=[xml](Get-Content c:\Efficient5\Tools\ManConsole.exe.config);
($xml.configuration.appSettings.add | Where-Object key -eq ConnectionString).value = $ConnectionString.Replace("Application Name=KE5ManConsole","");;
($xml.configuration.appSettings.add | Where-Object key -eq Efficient4).value = "$Url/client/full";
$xml.Save("c:\Efficient5\Tools\ManConsole.exe.config");
# modify "Efficient5\App\Bin\Captor.Efficient4.Connector.dll.config"
Log "Updating Captor.Efficient4.Connector.dll.config..."
$xml=([xml](Get-Content c:\Efficient5\App\Bin\Captor.Efficient4.Connector.dll.config));
($xml.configuration.assemblySettings.add | Where-Object key -eq Connection).value = $ConnectionString;
$xml.Save("c:\Efficient5\App\Bin\Captor.Efficient4.Connector.dll.config");
\ No newline at end of file
# modify "Efficient5\App\client\config\effnet.xml"
$EffnetConnectionString= $ConnectionString.Replace("Integrated Security=False;","").Replace("Application Name=KronosEffnet","");
Log "Updating effnet.xml..."
$xml=([xml](Get-Content c:\Efficient5\App\client\config\effnet.xml));
$xml.EfficientNet.AppPath = "$Url/client/full";
$xml.EfficientNet.EPSPath = "$Url";
$xml.EfficientNet.TempDir = "c:\Efficient5\App\temp";
$xml.EfficientNet.GiepDir = "c:\Efficient5\App\giep";
$xml.EfficientNet.ConnectStr = "Provider=SQLOLEDB.1;$EffnetConnectionString";
$xml.EfficientNet.ConnectStrMan = "Provider=SQLOLEDB.1;$EffnetConnectionString";
$xml.Save("c:\Efficient5\App\client\config\effnet.xml");
# configure file rights for application pool
Log "Configuring file rights for default application pool..."
icacls C:\Efficient5\App /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
icacls C:\Efficient5\InTouch /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
icacls C:\Efficient5\Logs /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
icacls C:\inetpub\wwwroot /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
icacls C:\inetpub\temp /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
icacls C:\Windows\Temp /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
Log "Restarting IIS ..."
iisreset
Log "Starting service ASP.net state..."
if ($(Get-Service -Name 'aspnet_state' | Select-Object Status).Status -ne 'Running')
{
Start-Service -Name 'aspnet_state'
};
# empty env variables
$Env:EFFICIENT_URL = "_";
$Env:SQLSERVER_NAME = "_";
$Env:SQLSERVER_DBNAME = "_";
$Env:SQLSERVER_USER = "_";
$Env:SQLSERVER_PWD = "_";
if (Test-Path -path c:\efficient.lic)
{
Log "Integrating license c:\efficient.lic..."
&c:\Efficient5\Tools\ManConsole.exe -integrate c:\efficient.lic
};
Log "Migrating database..."
&c:\Efficient5\Tools\ManConsole.exe -migrate | Out-Null
Log "Update database for last patches"
Get-ChildItem -Path c:\Efficient5\Patch\ -filter "*.sql" | Sort-Object Name | foreach-object -process {$_.fullname} | RunSQLFile $ConnectionString
Log "Database is up-to-date"
Log "Efficient is accessible by $Url"
while (!(Test-Path 'C:\Efficient5\Logs\Efficient5_Web-log.txt'))
{ Start-Sleep 10 }
Get-Content -path 'C:\Efficient5\Logs\Efficient5_Web-log.txt' -Tail 1 -Wait
function Log {
Param($Text)
Write-Output "$(get-date -format "yyyy-MM-dd HH:mm:ss,fff") ## $Text"
}
function RunSQLFile{
Param($ConnStr, [parameter(ValueFromPipeline)]$SQLFilePath)
begin
{
$Conn=New-Object System.Data.SQLClient.SQLConnection $ConnStr;
$Conn.Open();
}
process
{
try{
Log "Updating database with $SQLFilePath ..."
$DataCmd = New-Object System.Data.SqlClient.SqlCommand;
$DataCmd.CommandText = @(get-content $SQLFilePath);
$DataCmd.CommandTimeout = 3600;
$DataCmd.Connection = $Conn;
$DataCmd.ExecuteNonQuery();
}catch{
Write-Host "An error occurs updating db.Please fix this manualy."
Write-Host $_
}
}
end
{
$Conn.Close();
$Conn.Dispose();
}
}
Log "Starting entry point..."
# if $Url contains localhost
# replace localhost by local ip address
$localip = (Get-NetIPAddress | Where-Object {$_.PrefixOrigin -eq "Manual"} | Select-Object IPAddress)[0].IPAddress
if ($Env:EFFICIENT_URL -like "*localhost*") {
$Url = $Env:EFFICIENT_URL.replace("localhost", $localip)
}else {
$Url = $Env:EFFICIENT_URL;
}
# check user input EFFICIENT_URL
if (-not(($Url.StartsWith("http://") -or $Url.StartsWith("https://")) -and ($Url.Split('/').Count -eq 4) -and ($Url.EndsWith("/efficient5"))))
{
Write-Output "ERROR : Efficient5 url not provided"
Write-Output "Set the environment variable EFFICIENT_URL"
Write-Output "EFFICIENT_URL must be like http://yourDNS/efficient5"
exit 1
}
# update hosts file for dns name into url = local ip address or localhost
Log "Configuring hosts file..."
$hostname = $Url.Split('/')[2].Split(':')[0]
try{
$publicIp = [ipaddress]$Env:PUBLIC_IP
$value = "$Env:PUBLIC_IP $hostname"
}catch{
$value = "$localip $hostname"
}
if(-not(Get-Content "C:\Windows\System32\drivers\etc\hosts").Contains($value)){
Add-Content -Path "C:\Windows\System32\drivers\etc\hosts" -Value $value
}
# check user input SQLSERVER_*
if($Env:SQLSERVER_NAME -eq "_" -or $Env:SQLSERVER_DBNAME -eq "_" -or $Env:SQLSERVER_USER -eq "_" -or $Env:SQLSERVER_PWD -eq "_"){
Write-Output "ERROR : Informations to connect to sql server not provided"
Write-Output "Set the environment variables SQLSERVER_NAME, SQLSERVER_DBNAME, SQLSERVER_USER and SQLSERVER_PWD"
exit 1
}
$ConnectionString = "Data Source=$Env:SQLSERVER_NAME;Initial Catalog=$Env:SQLSERVER_DBNAME;Integrated Security=False;User ID=$Env:SQLSERVER_USER;Password=$Env:SQLSERVER_PWD;Network Library=dbmssocn;Application Name=KronosEfficient";
try
{
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection $ConnectionString;
$sqlConnection.Open();
$sqlConnection.Close();
Log "Connection to SQL server succeeded"
}
catch
{
Log "ERROR : Cannot connect to SQL server"
exit 1
}
# TODO configure secret for cert.pfx and cert.password.txt
# see https://github.com/Microsoft/iis-docker/issues/30#issuecomment-353568597
# see https://github.com/PKISharp/win-acme for lets encrypt
# configure SSL
if (($Env:SSL_THUMPRINT -ne "_") -and (Test-Path -path c:\$hostname))
{
$securepfxpass = (Get-Content -Path c:\$hostname\cert.password.txt) |ConvertTo-SecureString -AsPlainText -Force
Import-PfxCertificate -Password $securepfxpass -CertStoreLocation Cert:\LocalMachine\My -FilePath c:\$hostname\cert.pfx
$binding = New-WebBinding -Name $hostname -Protocol https -IPAddress * -Port 443;
$binding = Get-WebBinding -Name $hostname -Protocol https;
$binding.AddSslCertificate(${env:SSL_THUMPRINT}, "my");
}
# modify "Efficient5\App\Web.config"
Log "Updating Web.config..."
$xml=[xml](Get-Content c:\Efficient5\App\Web.config);
($xml.configuration.appSettings.add | Where-Object key -eq Connection).value = $ConnectionString;
($xml.configuration.appSettings.add | Where-Object key -eq siteRoot).value = $Url;
($xml.configuration.appSettings.add | Where-Object key -eq Efficient4).value = "$Url/client/full";
$xml.Save("c:\Efficient5\App\Web.config");
# modify "Efficient5\Tools\ManConsole.exe.config"
Log "Updating ManConsole.exe.config..."
$xml=[xml](Get-Content c:\Efficient5\Tools\ManConsole.exe.config);
($xml.configuration.appSettings.add | Where-Object key -eq ConnectionString).value = $ConnectionString.Replace("Application Name=KE5ManConsole","");;
($xml.configuration.appSettings.add | Where-Object key -eq Efficient4).value = "$Url/client/full";
$xml.Save("c:\Efficient5\Tools\ManConsole.exe.config");
# modify "Efficient5\App\Bin\Captor.Efficient4.Connector.dll.config"
Log "Updating Captor.Efficient4.Connector.dll.config..."
$xml=([xml](Get-Content c:\Efficient5\App\Bin\Captor.Efficient4.Connector.dll.config));
($xml.configuration.assemblySettings.add | Where-Object key -eq Connection).value = $ConnectionString;
$xml.Save("c:\Efficient5\App\Bin\Captor.Efficient4.Connector.dll.config");
# modify "Efficient5\App\client\config\effnet.xml"
$EffnetConnectionString= $ConnectionString.Replace("Integrated Security=False;","").Replace("Application Name=KronosEffnet","");
Log "Updating effnet.xml..."
$xml=([xml](Get-Content c:\Efficient5\App\client\config\effnet.xml));
$xml.EfficientNet.AppPath = "$Url/client/full";
$xml.EfficientNet.EPSPath = "$Url";
$xml.EfficientNet.TempDir = "c:\Efficient5\App\temp\";
$xml.EfficientNet.GiepDir = "c:\Efficient5\App\giep\";
$xml.EfficientNet.ConnectStr = "Provider=SQLOLEDB.1;$EffnetConnectionString";
$xml.EfficientNet.ConnectStrMan = "Provider=SQLOLEDB.1;$EffnetConnectionString";
$xml.Save("c:\Efficient5\App\client\config\effnet.xml");
# configure file rights for application pool
Log "Configuring file rights for default application pool..."
icacls C:\Efficient5\App /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
icacls C:\Efficient5\InTouch /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
icacls C:\Efficient5\Logs /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
icacls C:\inetpub\wwwroot /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
icacls C:\inetpub\temp /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
icacls C:\Windows\Temp /GRANT 'IIS AppPool\DefaultAppPool:F' /t /q;
Log "Restarting IIS ..."
iisreset
Log "Starting service ASP.net state..."
if ($(Get-Service -Name 'aspnet_state' | Select-Object Status).Status -ne 'Running')
{
Start-Service -Name 'aspnet_state'
};
# empty env variables
$Env:EFFICIENT_URL = "_";
$Env:SQLSERVER_NAME = "_";
$Env:SQLSERVER_DBNAME = "_";
$Env:SQLSERVER_USER = "_";
$Env:SQLSERVER_PWD = "_";
$Env:SSL_THUMPRINT = "_";
if (Test-Path -path c:\efficient.lic)
{
Log "Integrating license c:\efficient.lic..."
&c:\Efficient5\Tools\ManConsole.exe -integrate c:\efficient.lic
};
Log "Migrating database..."
&c:\Efficient5\Tools\ManConsole.exe -migrate | Out-Null
#Log "Update database to patch 20180724"
#RunSQLFile($ConnectionString,'c:\Efficient5\Patch\20180724.sql')
Log "Update database for last patches"
Get-ChildItem -Path c:\Efficient5\Patch\ -filter "*.sql" | Sort-Object Name | foreach-object -process {$_.fullname} | RunSQLFile $ConnectionString
Log "Database is up-to-date"
Log "Efficient is accessible by $Url"
while (!(Test-Path 'C:\Efficient5\Logs\Efficient5_Web-log.txt'))
{ Start-Sleep 10 }
Get-Content -path 'C:\Efficient5\Logs\Efficient5_Web-log.txt' -Tail 1 -Wait
# netsh http flush logbuffer | Out-Null
# while (!(Test-Path 'C:\inetpub\logs\LogFiles\W3SVC\u_extend1.log'))
# { Start-Sleep 10 }
# Get-Content -path 'C:\inetpub\logs\LogFiles\W3SVC\u_extend1.log' -Tail 1 -Wait
\section{Fichiers de configuration}
Les fichiers de configuration pouvant contenir plus de 100 lignes, ils sont disponibles en ligne afin d'éviter de surcharger le document.
\url{http://www.sharelatex.com}
% dockerfile
\section{Fichier Dockerfile pour créer l'image Docker Kronos Efficient}
%\markright{\MakeUppercase{Annexe A}}
\begin{tcolorbox}[title=Dockerfile,colback=consolebg,boxsep=1pt,left=2pt,right=2pt,top=0pt,bottom=0pt]
\lstinputlisting[style=dockerfile]{annexes/Dockerfile-ltsc2019-1}
\end{tcolorbox}
\newpage
~
\begin{tcolorbox}[title=Dockerfile (suite),colback=consolebg,boxsep=1pt,left=2pt,right=2pt,top=0pt,bottom=0pt]
\lstinputlisting[style=dockerfile,firstnumber=33]{annexes/Dockerfile-ltsc2019-2}
\end{tcolorbox}