do not override appsettings-*.*.json

This commit is contained in:
Paul Schneider 2026-06-19 16:18:39 +01:00
commit 148f333b36
8 changed files with 229 additions and 21 deletions

View file

@ -1,5 +1,10 @@
# Yavsc parameters # Yavsc parameters
BASEAPPDIR=/srv/www/yavsc
USER_AND_GROUP=yavsc:yavsc
CONFIGURATION=Release
DOTNET_FRAMEWORK=net10.0
MODERATION_AUTO_REJECT_THRESHOLD=0.9 MODERATION_AUTO_REJECT_THRESHOLD=0.9
MODERATION_AUTO_APPROVE_THRESHOLD=0.7 MODERATION_AUTO_APPROVE_THRESHOLD=0.7

2
.gitignore vendored
View file

@ -22,7 +22,7 @@ package-lock.json
*.csproj.lscache *.csproj.lscache
data/ data/
appsettings.*.json appsettings.*.json
appsettings-*.json appsettings-*.*.json
generated/ generated/
*.tmp *.tmp

View file

@ -1,10 +1,5 @@
APP_PROJECT_NAMES=Api Org Blogs APP_PROJECT_NAMES=Api Org Blogs
APP_PROJECTS=src/Yavsc.Org/Yavsc.Org.csproj src/Yavsc.Api/Yavsc.Api.csproj
SLNDIR=.. SLNDIR=..
DESTDIR=/srv/www/yavsc
USER_AND_GROUP=yavsc:yavsc
CONFIGURATION=Release
DOTNET_FRAMEWORK=net10.0
include $(SLNDIR)/.env include $(SLNDIR)/.env
include .env include .env
@ -20,7 +15,7 @@ generated/yavsc%.service: generated/ template.service $(SLNDIR)/.env
@cat template.service | APP_NAME="$*" \ @cat template.service | APP_NAME="$*" \
HTTP_HOST="$(HTTP_HOST)" \ HTTP_HOST="$(HTTP_HOST)" \
HTTP_PORT="$*_$(HTTP_PORT)" \ HTTP_PORT="$*_$(HTTP_PORT)" \
DESTDIR="$(DESTDIR)" \ BASEAPPDIR="$(BASEAPPDIR)" \
APP_SYSLOG_ID="yavsc$*" \ APP_SYSLOG_ID="yavsc$*" \
POSTGRES_HOST="$(POSTGRES_HOST)" \ POSTGRES_HOST="$(POSTGRES_HOST)" \
POSTGRES_PORT="$(POSTGRES_PORT)" \ POSTGRES_PORT="$(POSTGRES_PORT)" \
@ -39,34 +34,39 @@ copy-service-Api: /etc/systemd/system/yavscApi.service
copy-service-Blogs: /etc/systemd/system/yavscBlogs.service copy-service-Blogs: /etc/systemd/system/yavscBlogs.service
copy-binaries: build_publish_Org build_publish_Api build_publish_Blogs stop-services copy-binaries: build_publish_Org build_publish_Api build_publish_Blogs stop-services
for project in $(APP_PROJECT_NAMES); do LCAPI=$$(echo $${project}|tr [:upper:] [:lower:]) ; \ @for project in $(APP_PROJECT_NAMES); \
mv $(SLNDIR)/src/Yavsc.$${project}/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish/appsettings-$${LCAPI}.json \ do LCAPI=$$(echo $${project}|tr [:upper:] [:lower:]) ; \
$(SLNDIR)/src/Yavsc.$${project}/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish/appsettings-$${LCAPI}-dist.json ;\ echo "$${project} -> $${LCAPI}" ; \
sudo cp -a $(SLNDIR)/src/Yavsc.$${project}/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish/* $(DESTDIR) ; \ BINDIR="$(SLNDIR)/src/Yavsc.$${project}/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish" ; \
echo BINDIR: $${BINDIR} ; \
ls $${BINDIR}/appsettings* 2>&1 ; \
mv $${BINDIR}/appsettings-$${LCAPI}.json \
$${BINDIR}/appsettings-$${LCAPI}-dist.json ; \
sudo cp -a $${BINDIR}/* $(BASEAPPDIR) ; \
done done
sudo chown -R $(USER_AND_GROUP) $(DESTDIR) @sudo chown -R $(USER_AND_GROUP) $(BASEAPPDIR)
/etc/systemd/system/yavsc%.service: generated/yavsc%.service /etc/systemd/system/yavsc%.service: generated/yavsc%.service
sudo cp $^ $@ sudo cp $^ $@
sudo chown root:root $@ sudo chown root:root $@
build_publish_%: build_publish_%:
ASPNETCORE_ENV=$(CONFIGURATION) dotnet publish $(SLNDIR)/src/Yavsc.$*/Yavsc.$*.csproj @ASPNETCORE_ENV=$(CONFIGURATION) dotnet publish $(SLNDIR)/src/Yavsc.$*/Yavsc.$*.csproj
install: build_publish copy-binaries copy-services install: build_publish copy-binaries copy-services
sudo systemctl daemon-reload @sudo systemctl daemon-reload
for project in $(APP_PROJECT_NAMES); \ @for project in $(APP_PROJECT_NAMES); \
do \ do \
sudo systemctl enable yavsc$${project} ; \ sudo systemctl enable yavsc$${project} ; \
sudo systemctl start yavsc$${project} ; \ sudo systemctl start yavsc$${project} ; \
done done
reinstall: copy-binaries reinstall: copy-binaries
for project in $(APP_PROJECT_NAMES); do \ @for project in $(APP_PROJECT_NAMES); do \
sudo systemctl start yavsc$${project} ; done sudo systemctl start yavsc$${project} ; done
stop-services: stop-services:
for project in $(APP_PROJECT_NAMES); \ @for project in $(APP_PROJECT_NAMES); \
do \ do \
sudo systemctl stop yavsc$${project} ; \ sudo systemctl stop yavsc$${project} ; \
done done
@ -75,13 +75,11 @@ $(SLNDIR)/src/Yavsc.Org/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish: build_
$(SLNDIR)/src/Yavsc.Blogs/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish: build_publish $(SLNDIR)/src/Yavsc.Blogs/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish: build_publish
$(SLNDIR)/src/Yavsc.Api/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish: build_publish $(SLNDIR)/src/Yavsc.Api/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish: build_publish
showConfig: showConfig:
@echo CONFIGURATION: $(CONFIGURATION) @echo CONFIGURATION: $(CONFIGURATION)
@echo DESTDIR: $(DESTDIR) @echo BASEAPPDIR: $(BASEAPPDIR)
clean: clean:
rm -rf generated @rm -rf generated
.PHONY: build_publish mep showConfig copy-service-Api copy-service-Org copy-service-Blogs reinstall clean .PHONY: build_publish mep showConfig copy-service-Api copy-service-Org copy-service-Blogs reinstall clean

View file

@ -0,0 +1,23 @@
{
"Site": {
"Authority": "https://localhost:5001",
"CorsAllowedOrigins": [
"https://localhost:5003"
]
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Kestrel": {
"Endpoints": {
"Https":{
"Url": "https://localhost:3004"
}
}
}
}

View file

@ -0,0 +1,26 @@
{
"Site": {
"Title": "Yavsc Blogs",
"Description": "A collection of blogs about software development, technology, and programming.",
"Keywords": "software development, technology, programming, coding, blogs",
"Authority": "https://localhost:5001",
"CorsAllowedOrigins": [
"https://localhost:5005"
]
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://localhost:3003"
}
}
}
}

View file

@ -0,0 +1,96 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.AspNetCore.SignalR": "Debug",
"Microsoft.AspNetCore.Http.Connections": "Debug"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"YavscConnection": "*** via dotnet user-secrets ou variable d'environnement *** Server=[YOURSERVERNAME];Port=5432;Database=[YOURDBNAME];Username=[YOURDBUSERNAME];Password=[YOURDBPASSW];"
},
"Site": {
"Title": "yavsc",
"Slogan": "Yavsc!",
"StyleSheet": "/css/default.css",
"Authority": "https://localhost:5001",
"ExternalUrl": "https://localhost:5001",
"CorsAllowedOrigins": [
"https://localhost:5001",
"http://localhost:5000"
],
"Banner": "/images/banner-dewang.jpg",
"Owner": {
"Name": "[Site owner's name]",
"EMail": "[Site owner's e-mail address]"
},
"Admin": {
"Name": "[a name for a site admin]",
"EMail": "[an e-mail for a site admin]"
},
"Avatars": "avatars",
"Quota": 200000000,
"Bills": "bills",
"Blog": "blog",
"TempDir": "temp",
"DataDir": "data"
},
"Smtp": {
"Host": "[YOURSMTPHOST]",
"Port": 465
},
"DataProtection": {
"Keys": {
"Dir": "DataProtection"
},
"RSAParamFile": "RSA-Params.json",
"ExpiresInHours": 168
},
"Authentication": {
"PayPal": {
"Mode": "[sandbox|production]",
"ClientId": "[Your PayPal REST API ClientId]",
"Secret": "[Your PayPal REST API Secret]"
},
"Google": {
"ApiKey": "[Your ApiKey]",
"ClientId": "[Your ClientId]",
"ClientSecret": "[Your ClientSecret]",
"ServiceAccount": {
"project_id": "[Yours]",
"private_key_id": "[Yours]",
"private_key": "-----[Yours]---\n",
"client_email": "[Yours]@appspot.gserviceaccount.com",
"client_id": "[Yours]",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www41.googleapis.com/robot/v1/[Yours].com"
}
},
"Facebook": {
"ClientId": "[Your ClientId]",
"ClientSecret": "[Your ClientSecret]"
},
"Twitter": {
"ClientId": "[Your ClientId]",
"ClientSecret": "[Your ClientSecret]"
}
},
"Moderation": {
"AutoApproveThreshold": 0.7,
"AutoRejectThreshold": 0.9
},
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://localhost:3003"
},
"Https": {
"Url": "https://localhost:3004"
}
}
}
}

View file

@ -0,0 +1,24 @@
{
"Authencication": {
"Issuer": "https://localhost:5001",
"Client": {
"Id": "mvc",
"Secret": "lame-secret"
}
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"Kestrel": {
"Endpoints":
{
"Https": {
"Url": "https://localhost:5003"
}
}
}
}

View file

@ -0,0 +1,36 @@
{
"ConnectionSettings" : {
"Site": {
"Title": "[Site title]",
"Slogan": "[Site Slogan]",
"Banner": "/images/[bannerAsset]",
"HomeViewName": "Home",
"FavIcon": "/favicon.ico",
"Icon": "/images/[Site Icon]"
},
"ServerApi": {
"Authority": "oauth.server-example.com",
"ClientId": "[OAuth2NativeClientId]",
"ClientSecret": "[OAuth2ClientSecret]"
}
},
"Logging": {
"IncludeScopes": true,
"LogLevel": {
"Default": "Debug",
"System": "Warning",
"Microsoft": "Warning"
}
},
"ConnectionStrings": {
"Default":"[your default connection string]"
},
"gen_mvc" : {
"NameSpace": "Yavsc",
"AppBase": "../Yavsc",
"RelativePath": "../Yavsc/Controllers/Generated",
"DbContextFullName": "Yavsc.Models.ApplicationDbContext",
"ControllerName": "LiveFlowController",
"ModelFullName": "Yavsc.Models.Streaming.LiveFlow"
}
}