Add persistent sessions using redis

This commit is contained in:
Laura Hausmann 2021-01-28 00:15:16 +01:00
parent 62581af152
commit 4467f1f022
Signed by: zotan
GPG Key ID: 5EC1D38FFC321311
3 changed files with 11 additions and 0 deletions

View File

@ -9,6 +9,7 @@
- Create yourself a user using `sqlite3`
- Install [nginx-mod-rtmp](https://git.zotan.services/zotan/nginx-mod-rtmp) (arch package: `aur/nginx-mod-rtmp-lhaus-git`)
- Configure nginx-mod-rtmp, example config below
- Install and start `redis` for persistent sessions
- Start RTMPDash, example systemd unit below
## Further setup

View File

@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="linq2db" Version="3.2.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.113.7" />
</ItemGroup>

View File

@ -22,8 +22,17 @@ namespace RTMPDash {
#if (DEBUG)
services.AddControllers().AddRazorRuntimeCompilation();
services.AddStackExchangeRedisCache(options => {
options.Configuration = "localhost";
options.InstanceName = "RTMPdash_development";
});
#else
services.AddControllers();
services.AddStackExchangeRedisCache(options =>
{
options.Configuration = "localhost";
options.InstanceName = "RTMPdash_production";
});
#endif
}