mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
37 lines
837 B
C#
37 lines
837 B
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace Bit.Setup
|
|
{
|
|
public class AppIdBuilder
|
|
{
|
|
private readonly Context _context;
|
|
|
|
public AppIdBuilder(Context context)
|
|
{
|
|
_context = context;
|
|
}
|
|
|
|
public void Build()
|
|
{
|
|
var model = new TemplateModel
|
|
{
|
|
Url = _context.Config.Url
|
|
};
|
|
|
|
Helpers.WriteLine(_context, "Building FIDO U2F app id.");
|
|
Directory.CreateDirectory("/bitwarden/web/");
|
|
var template = Helpers.ReadTemplate("AppId");
|
|
using (var sw = File.CreateText("/bitwarden/web/app-id.json"))
|
|
{
|
|
sw.Write(template(model));
|
|
}
|
|
}
|
|
|
|
public class TemplateModel
|
|
{
|
|
public string Url { get; set; }
|
|
}
|
|
}
|
|
}
|