- .NET 9 SDK
- make sure you can run
dotnet --infoand it shows9.x.xunder .NET SDKs installed
- make sure you can run
- bun
- make sure you can run
bun
- make sure you can run
Go to https://auth.sch.bme.hu/console/create, set ĂtirĂĄnyĂtĂĄsi cĂm to
http://localhost:5264/signin-oidc,
then use the created credentials in the following commands:
git clone https://github.com/kir-dev/StartSCH
cd StartSCH/StartSch
dotnet user-secrets set AuthSch:ClientId $YOUR_AUTHSCH_CLIENTID
dotnet user-secrets set AuthSch:ClientSecret $YOUR_AUTHSCH_CLIENTSECRET
dotnet runWhen sending push notifications, most push services, for example Apple, require a VAPID key pair. You can use Push Companion to generate these.
dotnet user-secrets set Push:PublicKey "..."
dotnet user-secrets set Push:PrivateKey "..."
dotnet user-secrets set Push:Subject "mailto:..."After modifying the Db, you have to create new migrations:
# Go to the server project directory (e.g. ~/src/StartSCH/StartSch)
cd StartSch
# Make sure you can run `dotnet ef`.
# One of these commands, ideally the first one, should install it.
dotnet tool restore
dotnet tool install dotnet-ef
dotnet tool install dotnet-ef --global
# Describe the migration
export MIGRATION_MESSAGE=AddSomethingToSomeOtherThing
# Add migration
dotnet ef migrations add --context SqliteDb $MIGRATION_MESSAGE
dotnet ef migrations add --context PostgresDb $MIGRATION_MESSAGE
# Remove latest migration
dotnet ef migrations remove --context SqliteDb
dotnet ef migrations remove --context PostgresDb
# Reset migrations
rm -r Data/Migrations/Postgres Data/Migrations/Sqlite
dotnet ef migrations add --context SqliteDb --output-dir Data/Migrations/Sqlite $MIGRATION_MESSAGE
dotnet ef migrations add --context PostgresDb --output-dir Data/Migrations/Postgres $MIGRATION_MESSAGEMigrations are applied automatically on server startup.
- Docs: DbContext Lifetime, Configuration, and Initialization
- Docs: ASP.NET Core Blazor with Entity Framework Core
Depending on where you want to access the database, you have to decide between injecting Db or IDbContextFactory<Db>.
For example, static forms or API controllers that run in a scope should use Db, while methods in an interactive Blazor component should request a new Db instance every time they run.
- Run StartSCH using the
SSLKEYLOGFILEenvironment variable set to a path to a non-existent file (e.g./home/USER/keylog.txt)- This is easiest using
StartSch/Properties/launchSettings.json: add"SSLKEYLOGFILE": "/home/USER/keylog.txt"to theenvironmentVariablessection under the launch profile you are using (httpby default)
- This is easiest using
- Add a
AppContext.SetSwitch("System.Net.EnableSslKeyLogging", true);line to the top ofProgram.cs - Set Wireshark/Edit/Preferences/Protocols/TLS/(Pre)-Master-Secret log filename to the path in the above environment variable
- Run StartSCH
SSLKEYLOGFILE also works in Firefox and Chrome:
SSLKEYLOGFILE=~/keylog.txt firefoxMake sure the browser is not already running (in the background), otherwise it won't pick up the env var.
