1
0

fix: Some error on setup server.

This commit is contained in:
Ca2didi 2025-05-08 23:27:14 +08:00
parent 87745c1d61
commit a11aeeea8c
7 changed files with 34 additions and 20 deletions

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="postgres@localhost" uuid="fcb3a985-405e-4a4d-9f94-39584f3e89bb">
<data-source source="LOCAL" name="postgres@192.168.10.172" uuid="29452365-bc84-49b7-b6ba-0747cd083906">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<configured-by-url>true</configured-by-url>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://localhost:5432/postgres</jdbc-url>
<jdbc-url>jdbc:postgresql://192.168.10.172:5432/postgres</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.host.port" />
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
<property name="com.intellij.clouds.kubernetes.db.resource.type" value="Deployment" />
<property name="com.intellij.clouds.kubernetes.db.container.port" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>

View File

@ -59,13 +59,13 @@
&lt;Assembly Path="C:\Users\Cardi\.nuget\packages\irihi.ursa.themes.semi\1.10.0\lib\netstandard2.0\Ursa.Themes.Semi.dll" /&gt;&#xD;
&lt;Assembly Path="C:\Users\Cardi\.nuget\packages\reactiveui\20.1.1\lib\net8.0\ReactiveUI.dll" /&gt;&#xD;
&lt;/AssemblyExplorer&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=b5573ef9_002Db554_002D4a56_002D82c4_002D2531c8feef65/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" IsLocked="True" Name="PathValidationTest" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;MSTest::5B1CB26D-99F5-491A-B368-7E3552FE67E9::net9.0::Flawless.Abstract.Test.WorkPathTestUnit&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=b5573ef9_002Db554_002D4a56_002D82c4_002D2531c8feef65/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" IsLocked="True" Name="PathValidationTest" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;
&lt;TestAncestor&gt;
&lt;TestId&gt;MSTest::5B1CB26D-99F5-491A-B368-7E3552FE67E9::net9.0::Flawless.Abstract.Test.WorkPathTestUnit&lt;/TestId&gt;
&lt;/TestAncestor&gt;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=f3f8a684_002Dc08e_002D489f_002D949c_002D6c38a1ed63b0/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="PathValidationTest #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;MSTest::5B1CB26D-99F5-491A-B368-7E3552FE67E9::net9.0::Flawless.Abstract.Test.WorkPathTestUnit.PathValidationTest&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=f3f8a684_002Dc08e_002D489f_002D949c_002D6c38a1ed63b0/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="PathValidationTest #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;
&lt;TestAncestor&gt;
&lt;TestId&gt;MSTest::5B1CB26D-99F5-491A-B368-7E3552FE67E9::net9.0::Flawless.Abstract.Test.WorkPathTestUnit.PathValidationTest&lt;/TestId&gt;
&lt;/TestAncestor&gt;
&lt;/SessionState&gt;</s:String></wpf:ResourceDictionary>

View File

@ -1274,7 +1274,7 @@ public class RepositoryService : BaseService<RepositoryService>
}
}
// Point to newest state.
// Point to latest state.
localDb.RepoAccessor = accessor;
localDb.CurrentCommit = rsp.CommitId;
localDb.LocalAccessor.SetBaseline(accessor);

View File

@ -48,6 +48,7 @@ public class AuthenticationController(
Email = r.AdminEmail,
EmailConfirmed = true,
CreatedOn = DateTime.UtcNow,
Admin = true
};
user.RenewSecurityStamp();

View File

@ -34,7 +34,7 @@ public class RepositoryInnieController(
{
var u = (await userManager.GetUserAsync(HttpContext.User))!;
var grantIssue = await ValidateRepositoryAsync(userName, repositoryName, u, RepositoryRole.Guest);
if (grantIssue is not Repository) return (ActionResult) grantIssue;
if (grantIssue is not Repository rp) return (ActionResult) grantIssue;
await using (var t = await dbContext.Database.BeginTransactionAsync())
{
@ -43,10 +43,22 @@ public class RepositoryInnieController(
.Include(x => x.Depots)
.Include(x => x.Members)
.Include(x => x.Locked)
.FirstAsync(x => x.Name == repositoryName && x.Owner.UserName == userName);
.FirstAsync(x => x == rp);
try
{
await dbContext.Webhooks
.Where(x => x.Repository == rp)
.ExecuteDeleteAsync();
await dbContext.RepositoryIssues
.Where(x => x.Repository == rp)
.SelectMany(x => x.Contents).ExecuteDeleteAsync();
await dbContext.RepositoryIssues
.Where(x => x.Repository == rp)
.ExecuteDeleteAsync();
set.Commits.Clear();
set.Depots.Clear();
set.Members.Clear();

View File

@ -7,7 +7,7 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"CoreDb": "Server=localhost;Port=5432;User Id=postgres;Password=postgres;Database=flawless"
"CoreDb": "Server=192.168.10.172;Port=5432;User Id=postgres;Password=postgres;Database=flawless"
},
"LocalStoragePath": "./data/development",
"User": {

View File

@ -5,17 +5,18 @@
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"AllowedHosts": "*",
"ConnectionStrings": {
"CoreDb": "Server=localhost;Port=5432;User Id=postgres;Password=postgres;Database=flawless"
"CoreDb": "Server=192.168.10.172;Port=5432;User Id=postgres;Password=postgres;Database=flawless"
},
"LocalStoragePath": "./data/production",
"LocalStoragePath": "./data/development",
"User": {
"PublicRegister": false
"PublicRegister": true
},
"Jwt": {
"SecretKey": "your_256bit_security_key_at_here_otherwise_not_bootable",
"Issuer": "test",
"ExpiresIn": 30
"ExpiresIn": 30,
"RefreshTokenLifeTime": 7
}
}