On first startup (non-docker), rename appsettings-init -> appsettings.
Fixed accidently packing cached files with the build.
This commit is contained in:
parent
0e3705479a
commit
9128e41bcb
3 changed files with 19 additions and 7 deletions
|
|
@ -111,17 +111,16 @@
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Hangfire-log.db" />
|
|
||||||
<None Remove="obj\**" />
|
<None Remove="obj\**" />
|
||||||
<None Remove="cache\**" />
|
<None Remove="cache\**" />
|
||||||
<None Remove="cache-long\**" />
|
|
||||||
<None Remove="backups\**" />
|
<None Remove="backups\**" />
|
||||||
<None Remove="logs\**" />
|
<None Remove="logs\**" />
|
||||||
<None Remove="temp\**" />
|
<None Remove="temp\**" />
|
||||||
<None Remove="kavita.log" />
|
<None Remove="config\kavita.log" />
|
||||||
<None Remove="kavita.db" />
|
<None Remove="config\kavita.db" />
|
||||||
<None Remove="covers\**" />
|
<None Remove="config\covers\**" />
|
||||||
<None Remove="wwwroot\**" />
|
<None Remove="wwwroot\**" />
|
||||||
|
<None Remove="cache\cache-long\**" />
|
||||||
<None Remove="config\cache\**" />
|
<None Remove="config\cache\**" />
|
||||||
<None Remove="config\logs\**" />
|
<None Remove="config\logs\**" />
|
||||||
<None Remove="config\covers\**" />
|
<None Remove="config\covers\**" />
|
||||||
|
|
@ -139,6 +138,7 @@
|
||||||
<Compile Remove="covers\**" />
|
<Compile Remove="covers\**" />
|
||||||
<Compile Remove="wwwroot\**" />
|
<Compile Remove="wwwroot\**" />
|
||||||
<Compile Remove="config\cache\**" />
|
<Compile Remove="config\cache\**" />
|
||||||
|
<Compile Remove="cache\cache-long\**" />
|
||||||
<Compile Remove="config\logs\**" />
|
<Compile Remove="config\logs\**" />
|
||||||
<Compile Remove="config\covers\**" />
|
<Compile Remove="config\covers\**" />
|
||||||
<Compile Remove="config\bookmarks\**" />
|
<Compile Remove="config\bookmarks\**" />
|
||||||
|
|
@ -188,7 +188,6 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="config\cache-long\" />
|
|
||||||
<Folder Include="config\themes" />
|
<Folder Include="config\themes" />
|
||||||
<Content Include="EmailTemplates\**">
|
<Content Include="EmailTemplates\**">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.IO.Abstractions;
|
using System.IO.Abstractions;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
|
@ -48,6 +49,16 @@ public class Program
|
||||||
|
|
||||||
var directoryService = new DirectoryService(null!, new FileSystem());
|
var directoryService = new DirectoryService(null!, new FileSystem());
|
||||||
|
|
||||||
|
|
||||||
|
// Check if this is the first time running and if so, rename appsettings-init.json to appsettings.json
|
||||||
|
var firstRunConfigFilePath = Path.Join(Directory.GetCurrentDirectory(), "config/appsettings-init.json");
|
||||||
|
if (File.Exists(firstRunConfigFilePath) &&
|
||||||
|
!File.Exists(Path.Join(Directory.GetCurrentDirectory(), "config/appsettings.json")))
|
||||||
|
{
|
||||||
|
File.Move(firstRunConfigFilePath, Path.Join(Directory.GetCurrentDirectory(), "config/appsettings.json"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Before anything, check if JWT has been generated properly or if user still has default
|
// Before anything, check if JWT has been generated properly or if user still has default
|
||||||
if (!Configuration.CheckIfJwtTokenSet() &&
|
if (!Configuration.CheckIfJwtTokenSet() &&
|
||||||
Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") != Environments.Development)
|
Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") != Environments.Development)
|
||||||
|
|
|
||||||
4
build.sh
4
build.sh
|
|
@ -94,9 +94,11 @@ Package()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Copying appsettings.json"
|
echo "Copying appsettings.json"
|
||||||
cp config/appsettings.json $lOutputFolder/config/appsettings.json
|
cp config/appsettings.json $lOutputFolder/config/appsettings-init.json
|
||||||
echo "Removing appsettings.Development.json"
|
echo "Removing appsettings.Development.json"
|
||||||
rm $lOutputFolder/config/appsettings.Development.json
|
rm $lOutputFolder/config/appsettings.Development.json
|
||||||
|
echo "Removing appsettings.json"
|
||||||
|
rm $lOutputFolder/config/appsettings.json
|
||||||
|
|
||||||
echo "Creating tar"
|
echo "Creating tar"
|
||||||
cd ../$outputFolder/"$runtime"/
|
cd ../$outputFolder/"$runtime"/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue