Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 97 additions & 32 deletions Website/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
<configuration>
<!-- configBuilders 區段宣告(Configuration Builders 3.x);必須是 configuration 的第一個子元素。 -->
<configSections>
<section name="configBuilders"
type="System.Configuration.ConfigurationBuildersSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
restartOnExternalChanges="false" requirePermission="false" />
<section name="configBuilders" type="System.Configuration.ConfigurationBuildersSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="false" requirePermission="false" />
</configSections>
<!--
Env:啟動時把 ${名稱} 權杖替換為同名環境變數(Token 模式)。
Expand All @@ -18,8 +16,7 @@
-->
<configBuilders>
<builders>
<add name="Env" mode="Token"
type="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Environment" />
<add name="Env" mode="Token" type="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Environment" />
</builders>
</configBuilders>
<!--
Expand All @@ -29,13 +26,9 @@
-->
<connectionStrings configBuilders="Env">
<!-- 一般請求使用:app 帳號,僅讀寫(db_datareader、db_datawriter)。 -->
<add name="cmpConnectionString"
connectionString="Server=${SQL_SERVER};Initial Catalog=${SQL_DATABASE};User ID=${SQL_USER};Password=${SQL_PASSWORD};Encrypt=${SQL_ENCRYPT};TrustServerCertificate=False;Connection Timeout=30;"
providerName="System.Data.SqlClient" />
<add name="cmpConnectionString" connectionString="Server=${SQL_SERVER};Initial Catalog=${SQL_DATABASE};User ID=${SQL_USER};Password=${SQL_PASSWORD};Encrypt=${SQL_ENCRYPT};TrustServerCertificate=False;Connection Timeout=30;" providerName="System.Data.SqlClient" />
<!-- 僅供啟動時 migration:migrator 帳號,具 DDL 權限(db_ddladmin)。 -->
<add name="migratorConnectionString"
connectionString="Server=${SQL_SERVER};Initial Catalog=${SQL_DATABASE};User ID=${SQL_MIGRATOR_USER};Password=${SQL_MIGRATOR_PASSWORD};Encrypt=${SQL_ENCRYPT};TrustServerCertificate=False;Connection Timeout=60;"
providerName="System.Data.SqlClient" />
<add name="migratorConnectionString" connectionString="Server=${SQL_SERVER};Initial Catalog=${SQL_DATABASE};User ID=${SQL_MIGRATOR_USER};Password=${SQL_MIGRATOR_PASSWORD};Encrypt=${SQL_ENCRYPT};TrustServerCertificate=False;Connection Timeout=60;" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<!-- debug="true" 僅適用於開發環境;發行時由 Web.Release.config 轉換移除 -->
Expand All @@ -46,7 +39,7 @@
</assemblies>
</compilation>
<!-- enableVersionHeader="false":不送出 X-AspNet-Version 標頭,避免洩漏框架版本 -->
<httpRuntime targetFramework="4.7.2" enableVersionHeader="false"/>
<httpRuntime targetFramework="4.7.2" enableVersionHeader="false" />
<!--
錯誤頁:遠端使用者只看到 error.aspx 的一般訊息(不顯示例外與堆疊),本機開發仍顯示詳細錯誤。
ResponseRewrite 保留原網址並回傳正確狀態碼;例外細節由 Global.asax 的 Application_Error 寫入記錄。
Expand All @@ -61,18 +54,14 @@
<!-- 使用 Roslyn(Microsoft.CodeDom.Providers.DotNetCompilerPlatform 4.1.0)編譯頁面與後置程式碼 -->
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701;612;618"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:default /nowarn:41008,40000,40008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701;612;618" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008,40000,40008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
<!-- 應用程式設定:${名稱} 由 Env builder 代入;集中由 Website.Config.AppSettings 讀取(設定說明見 Plan.md §14.1)。 -->
<appSettings configBuilders="Env">
<!-- 關閉 Unobtrusive 驗證,讓 RequiredFieldValidator 等驗證控制項不需 jQuery ScriptResourceMapping -->
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
<!-- 寄信(Azure Communication Services Email 的 SMTP 介面,STARTTLS 587) -->
<add key="SMTP_HOST" value="${SMTP_HOST}" />
<add key="SMTP_PORT" value="${SMTP_PORT}" />
Expand All @@ -88,8 +77,8 @@
<system.webServer>
<defaultDocument enabled="true">
<files>
<clear/>
<add value="index.aspx"/>
<clear />
<add value="index.aspx" />
</files>
</defaultDocument>
<!-- 移除 Server 標頭(IIS 10 以上),避免洩漏伺服器版本 -->
Expand Down Expand Up @@ -117,64 +106,140 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Azure.Core" publicKeyToken="92742159e12e44c8" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.63.0.0" newVersion="1.63.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Hosting.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory.Data" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Apache.Arrow" publicKeyToken="204f54e5a45c07df" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-23.0.0.0" newVersion="23.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.Cryptography" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.SqlClient" publicKeyToken="23ec7fc2d6eaa4a5" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Identity.Client" publicKeyToken="0a613f4dd989e8ae" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.90.1.0" newVersion="4.90.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Identity.Client.Extensions.Msal" publicKeyToken="0a613f4dd989e8ae" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.90.1.0" newVersion="4.90.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.23.0.0" newVersion="8.23.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.JsonWebTokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.23.0.0" newVersion="8.23.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.23.0.0" newVersion="8.23.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Protocols" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.23.0.0" newVersion="8.23.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Protocols.OpenIdConnect" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.23.0.0" newVersion="8.23.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.23.0.0" newVersion="8.23.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.3" newVersion="4.1.1.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.ServerSentEvents" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.12" newVersion="10.0.0.12" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Loading
Loading