Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set defaults for legacy IO to match osu web development environment #270

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osu.Server.Spectator/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static AppSettings()
DatabaseUser = Environment.GetEnvironmentVariable("DB_USER") ?? "osuweb";
DatabasePort = Environment.GetEnvironmentVariable("DB_PORT") ?? "3306";

LegacyIODomain = Environment.GetEnvironmentVariable("LEGACY_IO_DOMAIN") ?? string.Empty;
LegacyIODomain = Environment.GetEnvironmentVariable("LEGACY_IO_DOMAIN") ?? "http://localhost:8080";
SharedInteropSecret = Environment.GetEnvironmentVariable("SHARED_INTEROP_SECRET") ?? string.Empty;

SentryDsn = Environment.GetEnvironmentVariable("SENTRY_DSN");
Expand Down
8 changes: 2 additions & 6 deletions osu.Server.Spectator/Services/LegacyIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ public LegacyIO(HttpClient httpClient, ILoggerFactory loggerFactory)
this.httpClient = httpClient;
logger = loggerFactory.CreateLogger("LIO");

interopDomain = AppSettings.LegacyIODomain
?? throw new InvalidOperationException("LEGACY_IO_DOMAIN environment variable not set. "
+ "Please set the value of this variable to the root URL of the osu-web instance to which legacy IO call should be submitted.");
interopSecret = AppSettings.SharedInteropSecret
?? throw new InvalidOperationException("SHARED_INTEROP_SECRET environment variable not set. "
+ "Please set the value of this variable to the value of the same environment variable that the target osu-web instance specifies in `.env`.");
interopDomain = AppSettings.LegacyIODomain;
interopSecret = AppSettings.SharedInteropSecret;
}

private async Task<string> runLegacyIO(HttpMethod method, string command, dynamic? postObject = null)
Expand Down