Skip to content

Commit 5ad2954

Browse files
authored
Create the 'accepted_keys' folder on startup (#493)
Create the 'accepted_keys' folder on startup and use constant for folder name
1 parent 1addf5d commit 5ad2954

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Obsidian/Plugins/PluginManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public PluginManager(IServer server, IServiceProvider serverProvider,
9090

9191
public async Task LoadPluginsAsync()
9292
{
93-
var acceptedKeysPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "accepted_keys");
93+
var acceptedKeysPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ServerConstants.AcceptedKeysPath);
9494
var acceptedKeyFiles = Directory.GetFiles(acceptedKeysPath);
9595

9696
using var rsa = RSA.Create();

Obsidian/Server.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ public async Task RunAsync()
190190

191191
Directory.CreateDirectory(ServerConstants.PermissionPath);
192192
Directory.CreateDirectory(ServerConstants.PersistentDataPath);
193+
Directory.CreateDirectory(ServerConstants.AcceptedKeysPath);
193194
Directory.CreateDirectory("plugins");
194195

195196
StartTime = DateTimeOffset.Now;

Obsidian/ServerConstants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ public static string VERSION
2929

3030
public const string PersistentDataPath = "persistentdata";
3131
public const string PermissionPath = "permissions";
32+
public const string AcceptedKeysPath = "accepted_keys";
3233
}

0 commit comments

Comments
 (0)