Families.Web 1.0.0.0
사진, 동영상, 글, 댓글과 반응을 가족끼리만 공유하는 비공개 앨범·타임라인 서비스입니다.
로딩중...
검색중...
일치하는것 없음
FamiliesApp.Program 클래스 참조

더 자세히 ...

정적 Public 멤버 함수

static void Main ()

정적 Private 멤버 함수

static int GetInt (IConfiguration cfg, string key, int fallback)
static bool GetBool (IConfiguration cfg, string key, bool fallback)
static string ResolvePath (string? configuredPath, string fallback)

상세한 설명

Program 기능과 관련 상태를 캡슐화합니다.

Program.cs 파일의 23 번째 라인에서 정의되었습니다.

멤버 함수 문서화

◆ GetBool()

bool FamiliesApp.Program.GetBool ( IConfiguration cfg,
string key,
bool fallback )
inlinestaticprivate

Bool 값을 가져옵니다.

매개변수
cfgcfg에 사용할 IConfiguration 값입니다.
keykey에 사용할 string 값입니다.
fallbackfallback에 사용할 bool 값입니다.
반환값
Get Bool 조건이 충족되면 true이고, 그렇지 않으면 false입니다.

Program.cs 파일의 199 번째 라인에서 정의되었습니다.

199 =>
200 bool.TryParse(cfg[key], out bool v) ? v : fallback;

다음에 의해서 참조됨 : Main().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ GetInt()

int FamiliesApp.Program.GetInt ( IConfiguration cfg,
string key,
int fallback )
inlinestaticprivate

Int 값을 가져옵니다.

매개변수
cfgcfg에 사용할 IConfiguration 값입니다.
keykey에 사용할 string 값입니다.
fallbackfallback에 사용할 int 값입니다.
반환값
Get Int 작업에서 생성한 int 결과입니다.

Program.cs 파일의 156 번째 라인에서 정의되었습니다.

156 =>
157 int.TryParse(cfg[key], out int v) ? v : fallback;

다음에 의해서 참조됨 : Main().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ Main()

void FamiliesApp.Program.Main ( )
inlinestatic

Main 작업을 수행합니다.

Program.cs 파일의 34 번째 라인에서 정의되었습니다.

35 {
36 HostApplicationBuilder builder = Host.CreateApplicationBuilder();
37 builder.Configuration.AddUserSecrets("codemaru-oauth-2ba4e1b2");
38
39 int serverPort = GetInt(builder.Configuration, "FamilyServer:Port", 5080);
40 bool listenAnyIp = GetBool(builder.Configuration, "FamilyServer:ListenAnyIp", true);
41 AuthOptions authOptions =
42 builder.Configuration.GetSection(AuthOptions.SectionName).Get<AuthOptions>() ?? new AuthOptions();
43 string usersDbPath = ResolvePath(
44 builder.Configuration[$"{AuthOptions.SectionName}:UsersDbPath"],
45 Path.Combine(AppContext.BaseDirectory, "App_Data", "codemaru.db"));
46
47 builder.Services.AddDreamineHybridWpf();
48 builder.Services.AddDreamineIdentityWpfHost();
49
50 var familyOpts = FamilyOptions.From(builder.Configuration);
51 builder.Services.AddSingleton(familyOpts);
52 builder.Services.AddSingleton<IFamilyTenantStore, JsonFamilyTenantStore>();
53 builder.Services.AddSingleton<IPostStore, JsonPostStore>();
54 builder.Services.AddSingleton<IAlbumStore, JsonAlbumStore>();
55 builder.Services.AddSingleton<IGlobalSettingsStore, JsonGlobalSettingsStore>();
56 builder.Services.AddSingleton<IMediaService, LocalMediaService>();
57 builder.Services.AddSingleton<IReactionStore, JsonReactionStore>();
58
59 builder.Services.AddSingleton<Views.MainWindow>();
60 builder.Services.AddHostedService<GhostAccountCleanupService>();
61
62 builder.Services.AddDreamineBlazorServer<AppShell>(options =>
63 {
64 options.Port = serverPort;
65 options.ListenAnyIp = listenAnyIp;
66 options.SharedServiceTypes.Add(typeof(FamilyOptions));
67 options.SharedServiceTypes.Add(typeof(IFamilyTenantStore));
68 options.SharedServiceTypes.Add(typeof(IPostStore));
69 options.SharedServiceTypes.Add(typeof(IAlbumStore));
70 options.SharedServiceTypes.Add(typeof(IGlobalSettingsStore));
71 options.SharedServiceTypes.Add(typeof(IMediaService));
72 options.SharedServiceTypes.Add(typeof(IReactionStore));
73 options.AddPhysicalStaticFiles(familyOpts.ResolvedDataPath, "/family-data");
74
75 // InputFile(사진·동영상 업로드)은 SignalR 회선을 통해 청크 단위로 전송되는데,
76 // 기본 SignalR 메시지 크기 제한(32KB)과 짧은 타임아웃 때문에 큰 파일은 매우 느리거나
77 // 응답 없이 멈춘 것처럼 보입니다. 업로드 용량 검증은 LocalMediaService에서 별도로
78 // 하고 있으므로 전송 한도 자체는 풀어줍니다.
79 options.ConfigureServices = services =>
80 {
81 services.AddServerSideBlazor().AddHubOptions(o =>
82 {
83 o.MaximumReceiveMessageSize = null;
84 o.ClientTimeoutInterval = TimeSpan.FromMinutes(10);
85 o.HandshakeTimeout = TimeSpan.FromMinutes(2);
86 o.KeepAliveInterval = TimeSpan.FromSeconds(10);
87 });
88
89 services.AddAntiforgery(o =>
90 {
91 o.Cookie.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.Lax;
92 o.Cookie.SecurePolicy = Microsoft.AspNetCore.Http.CookieSecurePolicy.SameAsRequest;
93 });
94
95 services.Configure<CircuitOptions>(o =>
96 {
97 o.DisconnectedCircuitMaxRetained = 100;
98 o.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(3);
99 o.JSInteropDefaultCallTimeout = TimeSpan.FromMinutes(1);
100 o.MaxBufferedUnacknowledgedRenderBatches = 10;
101 });
102
103 services.AddScoped<FamilyUserContext>();
104 };
105
106 options.AddDreamineIdentity(authOptions, usersDbPath);
107 });
108
109 // OG 플랫폼 이미지 자동 생성 (없을 때만)
110 var wwwroot = Path.Combine(AppContext.BaseDirectory, "wwwroot");
111 try { OgImageGenerator.EnsureGenerated(wwwroot); } catch { /* 실패해도 앱 계속 실행 */ }
112
113 builder.Build().RunDreamineWpfApp<App>();
114 }

다음을 참조함 : FamiliesApp.Services.OgImageGenerator.EnsureGenerated(), FamiliesApp.Services.FamilyOptions.From(), GetBool(), GetInt(), ResolvePath().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ ResolvePath()

string FamiliesApp.Program.ResolvePath ( string? configuredPath,
string fallback )
inlinestaticprivate

Resolve Path 작업을 수행합니다.

매개변수
configuredPathconfigured Path에 사용할 string? 값입니다.
fallbackfallback에 사용할 string 값입니다.
반환값
Resolve Path 작업에서 생성한 string 결과입니다.

Program.cs 파일의 234 번째 라인에서 정의되었습니다.

235 {
236 if (string.IsNullOrWhiteSpace(configuredPath))
237 {
238 return fallback;
239 }
240
241 return Path.IsPathRooted(configuredPath)
242 ? configuredPath
243 : Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, configuredPath));
244 }

다음에 의해서 참조됨 : Main().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: