Compare commits

..

3 Commits

Author SHA1 Message Date
gamer147
15e1a84f55 [FA-27] Update CICD
All checks were successful
CI / build-backend (pull_request) Successful in 1m6s
CI / build-frontend (pull_request) Successful in 41s
2026-01-19 17:03:44 -05:00
gamer147
70d4ba201a [FA-27] Fix unit test based on changes
All checks were successful
CI / build-backend (pull_request) Successful in 1m10s
CI / build-frontend (pull_request) Successful in 43s
2026-01-19 16:47:55 -05:00
gamer147
b69bcd6bf4 [FA-27] Fix user adding not using correct id
Some checks failed
CI / build-backend (pull_request) Failing after 1m2s
CI / build-frontend (pull_request) Successful in 41s
2026-01-19 16:14:49 -05:00
5 changed files with 58 additions and 8 deletions

View File

@@ -28,6 +28,9 @@ jobs:
- name: user-service
project: FictionArchive.Service.UserService
subgraph: User
- name: usernoveldata-service
project: FictionArchive.Service.UserNovelDataService
subgraph: UserNovelData
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -110,6 +113,12 @@ jobs:
name: user-service-subgraph
path: subgraphs/user
- name: Download UserNovelData Service subgraph
uses: christopherhx/gitea-download-artifact@v4
with:
name: usernoveldata-service-subgraph
path: subgraphs/usernoveldata
- name: Configure subgraph URLs for Docker
run: |
for fsp in subgraphs/*/*.fsp; do

View File

@@ -27,6 +27,8 @@ jobs:
dockerfile: FictionArchive.Service.SchedulerService/Dockerfile
- name: authentication-service
dockerfile: FictionArchive.Service.AuthenticationService/Dockerfile
- name: usernoveldata-service
dockerfile: FictionArchive.Service.UserNovelDataService/Dockerfile
steps:
- name: Checkout
uses: actions/checkout@v4

View File

@@ -213,10 +213,10 @@ public class UserManagementServiceTests
dbContext.Users.Add(inviter);
await dbContext.SaveChangesAsync();
var authentikUid = "authentik-uid-789";
var authentikPk = 456;
var authClient = Substitute.For<IAuthenticationServiceClient>();
authClient.CreateUserAsync(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<string>())
.Returns(new AuthentikUserResponse { Pk = 456, Uid = authentikUid });
.Returns(new AuthentikUserResponse { Pk = authentikPk, Uid = "authentik-uid-789" });
authClient.SendRecoveryEmailAsync(Arg.Any<int>()).Returns(true);
var service = CreateService(dbContext, authClient);
@@ -228,7 +228,7 @@ public class UserManagementServiceTests
result.Should().NotBeNull();
result!.Username.Should().Be("newusername");
result.Email.Should().Be("newuser@test.com");
result.OAuthProviderId.Should().Be(authentikUid);
result.OAuthProviderId.Should().Be(authentikPk.ToString());
result.InviterId.Should().Be(inviter.Id);
result.AvailableInvites.Should().Be(0);
result.Disabled.Should().BeFalse();

View File

@@ -86,7 +86,7 @@ public class UserManagementService
{
Username = username,
Email = email,
OAuthProviderId = authentikUser.Uid,
OAuthProviderId = authentikUser.Pk.ToString(),
Disabled = false,
AvailableInvites = 0,
InviterId = inviter.Id

View File

@@ -5,7 +5,8 @@ services:
postgres:
image: postgres:16-alpine
networks:
- fictionarchive
fictionarchive:
ipv4_address: 172.20.0.10
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
@@ -23,10 +24,12 @@ services:
rabbitmq:
image: rabbitmq:3-management-alpine
networks:
- fictionarchive
fictionarchive:
ipv4_address: 172.20.0.11
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-guest}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-guest}
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: -rabbit max_message_size 536870912
volumes:
- /srv/docker_volumes/fictionarchive/rabbitmq:/var/lib/rabbitmq
healthcheck:
@@ -36,10 +39,14 @@ services:
retries: 5
restart: unless-stopped
# ===========================================
# VPN Container
# ===========================================
vpn:
image: dperson/openvpn-client # or gluetun, wireguard, etc.
image: dperson/openvpn-client
networks:
fictionarchive:
ipv4_address: 172.20.0.20
aliases:
- novel-service
cap_add:
@@ -48,6 +55,19 @@ services:
- /dev/net/tun
volumes:
- /srv/docker_volumes/korean_vpn:/vpn
dns:
- 192.168.3.1
environment:
- DNS=1.1.1.1,8.8.8.8
extra_hosts:
- "postgres:172.20.0.10"
- "rabbitmq:172.20.0.11"
healthcheck:
test: ["CMD", "ping", "-c", "1", "-W", "5", "1.1.1.1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
restart: unless-stopped
# ===========================================
@@ -67,7 +87,7 @@ services:
rabbitmq:
condition: service_healthy
vpn:
condition: service_started
condition: service_healthy
network_mode: "service:vpn"
restart: unless-stopped
@@ -102,6 +122,20 @@ services:
condition: service_healthy
restart: unless-stopped
usernoveldata-service:
image: git.orfl.xyz/conco/fictionarchive-usernoveldata-service:latest
networks:
- fictionarchive
environment:
ConnectionStrings__DefaultConnection: Host=postgres;Database=FictionArchive_UserNovelDataService;Username=${POSTGRES_USER:-postgres};Password=${POSTGRES_PASSWORD:-postgres}
RabbitMQ__ConnectionString: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASSWORD:-guest}@rabbitmq
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
restart: unless-stopped
file-service:
image: git.orfl.xyz/conco/fictionarchive-file-service:latest
networks:
@@ -144,6 +178,7 @@ services:
- scheduler-service
- file-service
- user-service
- usernoveldata-service
restart: unless-stopped
# ===========================================
@@ -165,3 +200,7 @@ networks:
web:
external: yes
fictionarchive:
ipam:
driver: default
config:
- subnet: 172.20.0.0/24