mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 13:07:07 +01:00
Endless alpha
This commit is contained in:
@@ -16,5 +16,10 @@
|
||||
/// </summary>
|
||||
[Permissions(DenyWrite = true)]
|
||||
public User CancelledBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional progress between 0 and 100 inclusive
|
||||
/// </summary>
|
||||
public int? Progress { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Tgstation.Server.Api.Models
|
||||
public string Origin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The commit HEAD points to
|
||||
/// The commit HEAD points to. Not populated in responses, use <see cref="RevisionInformation"/> instead
|
||||
/// </summary>
|
||||
[Permissions(WriteRight = RepositoryRights.SetSha)]
|
||||
public string Sha { get; set; }
|
||||
|
||||
@@ -38,7 +38,18 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// <typeparam name="TRight">The <see cref="RightsType"/></typeparam>
|
||||
/// <param name="right">The <typeparamref name="TRight"/></param>
|
||||
/// <returns>A <see cref="string"/> representing the claim role name</returns>
|
||||
public static string RoleName<TRight>(TRight right) => String.Concat(typeof(TRight).Name, '.', right.ToString());
|
||||
public static string RoleNames<TRight>(TRight right) where TRight: Enum
|
||||
{
|
||||
var flags = new List<string>();
|
||||
IEnumerable<string> GetRoleNames()
|
||||
{
|
||||
foreach (Enum J in Enum.GetValues(right.GetType()))
|
||||
if (right.HasFlag(J))
|
||||
yield return String.Concat(typeof(TRight).Name, '.', J.ToString());
|
||||
};
|
||||
var names = GetRoleNames();
|
||||
return String.Join(",", names);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the role claim name used for a given <paramref name="rightsType"/> and <paramref name="right"/>
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Tgstation.Server.Host.Components.Repository
|
||||
/// <param name="accessString">The access string to clone from <paramref name="url"/></param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation</param>
|
||||
/// <returns>The newly cloned <see cref="IRepository"/>, <see langword="null"/> if one already exists</returns>
|
||||
Task<IRepository> CloneRepository(Uri url, string initialBranch, string accessString, CancellationToken cancellationToken);
|
||||
Task<IRepository> CloneRepository(Uri url, string initialBranch, string accessString, Action<int> progressReporter, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Delete the current repository
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Tgstation.Server.Host.Components.Repository
|
||||
public void Dispose() => semaphore.Dispose();
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IRepository> CloneRepository(Uri url, string initialBranch, string accessString, CancellationToken cancellationToken)
|
||||
public async Task<IRepository> CloneRepository(Uri url, string initialBranch, string accessString, Action<int> progressReporter, CancellationToken cancellationToken)
|
||||
{
|
||||
using (await SemaphoreSlimContext.Lock(semaphore, cancellationToken).ConfigureAwait(false))
|
||||
if (!await ioManager.DirectoryExists(".", cancellationToken).ConfigureAwait(false))
|
||||
@@ -63,7 +63,12 @@ namespace Tgstation.Server.Host.Components.Repository
|
||||
path = LibGit2Sharp.Repository.Clone(Repository.GenerateAuthUrl(url.ToString(), accessString), ioManager.ResolvePath("."), new CloneOptions
|
||||
{
|
||||
OnProgress = (a) => !cancellationToken.IsCancellationRequested,
|
||||
OnTransferProgress = (a) => !cancellationToken.IsCancellationRequested,
|
||||
OnTransferProgress = (a) =>
|
||||
{
|
||||
var percentage = 100 * (((float)a.IndexedObjects + a.ReceivedObjects) / (a.TotalObjects * 2));
|
||||
progressReporter((int)percentage);
|
||||
return !cancellationToken.IsCancellationRequested;
|
||||
},
|
||||
RecurseSubmodules = true,
|
||||
OnUpdateTips = (a, b, c) => !cancellationToken.IsCancellationRequested,
|
||||
RepositoryOperationStarting = (a) => !cancellationToken.IsCancellationRequested,
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
CancelRight = (int)ByondRights.CancelInstall,
|
||||
Instance = Instance
|
||||
};
|
||||
await jobManager.RegisterOperation(job, (paramJob, serviceProvicer, ct) => byondManager.ChangeVersion(installingVersion, ct), cancellationToken).ConfigureAwait(false);
|
||||
await jobManager.RegisterOperation(job, (paramJob, serviceProvicer, progressHandler, ct) => byondManager.ChangeVersion(installingVersion, ct), cancellationToken).ConfigureAwait(false);
|
||||
result.InstallJob = job.ToApi();
|
||||
}
|
||||
result.Version = byondManager.ActiveVersion;
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
StartedBy = AuthenticationContext.User
|
||||
};
|
||||
await jobManager.RegisterOperation(job,
|
||||
async (paramJob, serviceProvider, innerCt) =>
|
||||
async (paramJob, serviceProvider, progressHandler, innerCt) =>
|
||||
{
|
||||
var result = await instance.Watchdog.Launch(innerCt).ConfigureAwait(false);
|
||||
if (result == null)
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
CancelRight = (int)DreamMakerRights.CancelCompile,
|
||||
Instance = Instance
|
||||
};
|
||||
await jobManager.RegisterOperation(job, (paramJob, serviceProvider, ct) => RunCompile(paramJob, serviceProvider, Instance, ct), cancellationToken).ConfigureAwait(false);
|
||||
await jobManager.RegisterOperation(job, (paramJob, serviceProvider, progressReporter, ct) => RunCompile(paramJob, serviceProvider, Instance, ct), cancellationToken).ConfigureAwait(false);
|
||||
return Json(job);
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
StartedBy = AuthenticationContext.User
|
||||
};
|
||||
|
||||
await jobManager.RegisterOperation(job, async (paramJob, serviceProvider, ct) => {
|
||||
await jobManager.RegisterOperation(job, async (paramJob, serviceProvider, progressHandler, ct) => {
|
||||
try
|
||||
{
|
||||
await instanceManager.MoveInstance(Instance, rawPath, ct).ConfigureAwait(false);
|
||||
|
||||
@@ -71,7 +71,9 @@ namespace Tgstation.Server.Host.Controllers
|
||||
var job = await DatabaseContext.Jobs.Where(x => x.Id == id).Include(x => x.StartedBy).FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false);
|
||||
if (job == default(Job))
|
||||
return NotFound();
|
||||
return Json(job.ToApi());
|
||||
var api = job.ToApi();
|
||||
api.Progress = jobManager.JobProgress(job);
|
||||
return Json(api);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
{
|
||||
CommitSha = repoSha,
|
||||
CompileJobs = new List<Models.CompileJob>(),
|
||||
ActiveTestMerges = new List<Models.RevInfoTestMerge>() //non null vals for api returns
|
||||
ActiveTestMerges = new List<RevInfoTestMerge>() //non null vals for api returns
|
||||
};
|
||||
|
||||
lock (DatabaseContext) //cleaner this way
|
||||
@@ -95,12 +95,11 @@ namespace Tgstation.Server.Host.Controllers
|
||||
model.IsGitHub = repository.IsGitHubRepository;
|
||||
model.Origin = repository.Origin;
|
||||
model.Reference = repository.Reference;
|
||||
model.Sha = repository.Head;
|
||||
|
||||
//rev info stuff
|
||||
Models.RevisionInformation revisionInfo = null;
|
||||
var needsDbUpdate = await LoadRevisionInformation(repository, x => revisionInfo = x, cancellationToken).ConfigureAwait(false);
|
||||
revisionInfo.OriginCommitSha = lastOriginCommitSha ?? model.Sha;
|
||||
revisionInfo.OriginCommitSha = revisionInfo.OriginCommitSha ?? lastOriginCommitSha ?? model.Sha;
|
||||
revInfoSink?.Invoke(revisionInfo);
|
||||
model.RevisionInformation = revisionInfo.ToApi();
|
||||
return needsDbUpdate;
|
||||
@@ -154,9 +153,9 @@ namespace Tgstation.Server.Host.Controllers
|
||||
Instance = Instance
|
||||
};
|
||||
var api = currentModel.ToApi();
|
||||
await jobManager.RegisterOperation(job, async (paramJob, serviceProvider, ct) =>
|
||||
await jobManager.RegisterOperation(job, async (paramJob, serviceProvider, progressReporter, ct) =>
|
||||
{
|
||||
using (var repos = await repoManager.CloneRepository(new Uri(origin), cloneBranch, GetAccessString(currentModel), cancellationToken).ConfigureAwait(false))
|
||||
using (var repos = await repoManager.CloneRepository(new Uri(origin), cloneBranch, GetAccessString(currentModel), progressReporter, cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
if (repos == null)
|
||||
throw new Exception("Filesystem conflict while cloning repository!");
|
||||
@@ -201,7 +200,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
Instance = Instance
|
||||
};
|
||||
var api = currentModel.ToApi();
|
||||
await jobManager.RegisterOperation(job, (paramJob, serviceProvider, ct) => instanceManager.GetInstance(Instance).RepositoryManager.DeleteRepository(cancellationToken), cancellationToken).ConfigureAwait(false);
|
||||
await jobManager.RegisterOperation(job, (paramJob, serviceProvider, progressReporter, ct) => instanceManager.GetInstance(Instance).RepositoryManager.DeleteRepository(cancellationToken), cancellationToken).ConfigureAwait(false);
|
||||
api.ActiveJob = job.ToApi();
|
||||
return Ok();
|
||||
}
|
||||
@@ -348,12 +347,6 @@ namespace Tgstation.Server.Host.Controllers
|
||||
errorMessage = "P.R.E. NOT FOUND";
|
||||
}
|
||||
|
||||
var attachedContextUser = new Models.User
|
||||
{
|
||||
Id = AuthenticationContext.User.Id
|
||||
};
|
||||
DatabaseContext.Users.Attach(attachedContextUser);
|
||||
|
||||
var tm = new Models.TestMerge
|
||||
{
|
||||
Author = pr?.User.Login ?? errorMessage,
|
||||
@@ -362,7 +355,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
TitleAtMerge = pr?.Title ?? errorMessage,
|
||||
Comment = I.Comment,
|
||||
Number = I.Number,
|
||||
MergedBy = attachedContextUser,
|
||||
MergedBy = AuthenticationContext.User,
|
||||
PullRequestRevision = I.PullRequestRevision,
|
||||
Url = pr?.HtmlUrl ?? errorMessage
|
||||
};
|
||||
@@ -397,7 +390,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
CancelRightsType = RightsType.Repository,
|
||||
CancelRight = (int)RepositoryRights.CancelSynchronize,
|
||||
};
|
||||
await jobManager.RegisterOperation(job, async (paramJob, serviceProvider, ct) =>
|
||||
await jobManager.RegisterOperation(job, async (paramJob, serviceProvider, progressReporter, ct) =>
|
||||
{
|
||||
using (var repos = await instanceManager.GetInstance(Instance).RepositoryManager.LoadRepository(cancellationToken).ConfigureAwait(false))
|
||||
if (repos != null)
|
||||
|
||||
@@ -11,14 +11,19 @@ namespace Tgstation.Server.Host.Core
|
||||
/// </summary>
|
||||
public interface IJobManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the <see cref="Api.Models.Job.Progress"/> for a job
|
||||
/// </summary>
|
||||
int? JobProgress(Job job);
|
||||
|
||||
/// <summary>
|
||||
/// Registers a given <see cref="Job"/> and begins running it
|
||||
/// </summary>
|
||||
/// <param name="job">The <see cref="Job"/></param>
|
||||
/// <param name="operation">The operation to run taking the started <see cref="Job"/>, a <see cref="IServiceProvider"/> and a <see cref="CancellationToken"/></param>
|
||||
/// <param name="operation">The operation to run taking the started <see cref="Job"/>, a <see cref="IServiceProvider"/> progress reporter <see cref="Action{T1}"/> and a <see cref="CancellationToken"/></param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation</param>
|
||||
/// <returns>A <see cref="Task"/> representing a running operation</returns>
|
||||
Task RegisterOperation(Job job, Func<Job, IServiceProvider, CancellationToken, Task> operation, CancellationToken cancellationToken);
|
||||
Task RegisterOperation(Job job, Func<Job, IServiceProvider, Action<int>, CancellationToken, Task> operation, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Cancels a give <paramref name="job"/>
|
||||
|
||||
@@ -32,6 +32,11 @@ namespace Tgstation.Server.Host.Core
|
||||
/// <inehritdoc />
|
||||
public void Dispose() => cancellationTokenSource.Dispose();
|
||||
|
||||
/// <summary>
|
||||
/// The progress of the job
|
||||
/// </summary>
|
||||
public int? Progress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Wait for <see cref="task"/> to complete
|
||||
/// </summary>
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Tgstation.Server.Host.Core
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task RegisterOperation(Job job, Func<Job, IServiceProvider, CancellationToken, Task> operation, CancellationToken cancellationToken)
|
||||
public async Task RegisterOperation(Job job, Func<Job, IServiceProvider, Action<int>, CancellationToken, Task> operation, CancellationToken cancellationToken)
|
||||
{
|
||||
using (var scope = serviceProvider.CreateScope())
|
||||
{
|
||||
@@ -127,7 +127,14 @@ namespace Tgstation.Server.Host.Core
|
||||
}
|
||||
databaseContext.Jobs.Add(job);
|
||||
await databaseContext.Save(cancellationToken).ConfigureAwait(false);
|
||||
var jobHandler = JobHandler.Create(x => RunJob(job, operation, x));
|
||||
var jobHandler = JobHandler.Create(x => RunJob(job, (jobParam, serviceProvider, ct) =>
|
||||
operation(jobParam, serviceProvider, y =>
|
||||
{
|
||||
lock (this)
|
||||
if (jobs.TryGetValue(job.Id, out var handler))
|
||||
handler.Progress = y;
|
||||
}, ct),
|
||||
x));
|
||||
lock (this)
|
||||
jobs.Add(job.Id, jobHandler);
|
||||
}
|
||||
@@ -184,5 +191,16 @@ namespace Tgstation.Server.Host.Core
|
||||
await databaseContext.Save(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public int? JobProgress(Job job)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
if (!jobs.TryGetValue(job.Id, out var handler))
|
||||
return null;
|
||||
return handler.Progress;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,54 +19,54 @@ namespace Tgstation.Server.Host
|
||||
/// Construct a <see cref="TgsAuthorizeAttribute"/> for <see cref="AdministrationRights"/>
|
||||
/// </summary>
|
||||
/// <param name="requiredRights">The rights required</param>
|
||||
public TgsAuthorizeAttribute(AdministrationRights requiredRights) => Roles = RightsHelper.RoleName(requiredRights);
|
||||
public TgsAuthorizeAttribute(AdministrationRights requiredRights) => Roles = RightsHelper.RoleNames(requiredRights);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a <see cref="TgsAuthorizeAttribute"/> for <see cref="InstanceManagerRights"/>
|
||||
/// </summary>
|
||||
/// <param name="requiredRights">The rights required</param>
|
||||
public TgsAuthorizeAttribute(InstanceManagerRights requiredRights) => Roles = RightsHelper.RoleName(requiredRights);
|
||||
public TgsAuthorizeAttribute(InstanceManagerRights requiredRights) => Roles = RightsHelper.RoleNames(requiredRights);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a <see cref="TgsAuthorizeAttribute"/> for <see cref="RepositoryRights"/>
|
||||
/// </summary>
|
||||
/// <param name="requiredRights">The rights required</param>
|
||||
public TgsAuthorizeAttribute(RepositoryRights requiredRights) => Roles = RightsHelper.RoleName(requiredRights);
|
||||
public TgsAuthorizeAttribute(RepositoryRights requiredRights) => Roles = RightsHelper.RoleNames(requiredRights);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a <see cref="TgsAuthorizeAttribute"/> for <see cref="ByondRights"/>
|
||||
/// </summary>
|
||||
/// <param name="requiredRights">The rights required</param>
|
||||
public TgsAuthorizeAttribute(ByondRights requiredRights) => Roles = RightsHelper.RoleName(requiredRights);
|
||||
public TgsAuthorizeAttribute(ByondRights requiredRights) => Roles = RightsHelper.RoleNames(requiredRights);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a <see cref="TgsAuthorizeAttribute"/> for <see cref="DreamMakerRights"/>
|
||||
/// </summary>
|
||||
/// <param name="requiredRights">The rights required</param>
|
||||
public TgsAuthorizeAttribute(DreamMakerRights requiredRights) => Roles = RightsHelper.RoleName(requiredRights);
|
||||
public TgsAuthorizeAttribute(DreamMakerRights requiredRights) => Roles = RightsHelper.RoleNames(requiredRights);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a <see cref="TgsAuthorizeAttribute"/> for <see cref="DreamDaemonRights"/>
|
||||
/// </summary>
|
||||
/// <param name="requiredRights">The rights required</param>
|
||||
public TgsAuthorizeAttribute(DreamDaemonRights requiredRights) => Roles = RightsHelper.RoleName(requiredRights);
|
||||
public TgsAuthorizeAttribute(DreamDaemonRights requiredRights) => Roles = RightsHelper.RoleNames(requiredRights);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a <see cref="TgsAuthorizeAttribute"/> for <see cref="ChatSettingsRights"/>
|
||||
/// </summary>
|
||||
/// <param name="requiredRights">The rights required</param>
|
||||
public TgsAuthorizeAttribute(ChatSettingsRights requiredRights) => Roles = RightsHelper.RoleName(requiredRights);
|
||||
public TgsAuthorizeAttribute(ChatSettingsRights requiredRights) => Roles = RightsHelper.RoleNames(requiredRights);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a <see cref="TgsAuthorizeAttribute"/> for <see cref="ConfigurationRights"/>
|
||||
/// </summary>
|
||||
/// <param name="requiredRights">The rights required</param>
|
||||
public TgsAuthorizeAttribute(ConfigurationRights requiredRights) => Roles = RightsHelper.RoleName(requiredRights);
|
||||
public TgsAuthorizeAttribute(ConfigurationRights requiredRights) => Roles = RightsHelper.RoleNames(requiredRights);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a <see cref="TgsAuthorizeAttribute"/> for <see cref="InstanceUserRights"/>
|
||||
/// </summary>
|
||||
/// <param name="requiredRights">The rights required</param>
|
||||
public TgsAuthorizeAttribute(InstanceUserRights requiredRights) => Roles = RightsHelper.RoleName(requiredRights);
|
||||
public TgsAuthorizeAttribute(InstanceUserRights requiredRights) => Roles = RightsHelper.RoleNames(requiredRights);
|
||||
}
|
||||
}
|
||||
|
||||
+406
-183
@@ -1321,14 +1321,14 @@
|
||||
"raw": "{\n\t\"userId\": 1,\n\t\"byondRights\": -1,\n\t\"dreamDaemonRights\": -1,\n\t\"dreamMakerRights\": -1,\n\t\"repositoryRights\": -1,\n\t\"chatSettingsRights\": -1,\n\t\"configurationRights\": -1\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Job/10",
|
||||
"raw": "localhost:5000/Job/29",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Job",
|
||||
"10"
|
||||
"29"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -1365,14 +1365,14 @@
|
||||
"raw": ""
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Job/11",
|
||||
"raw": "localhost:5000/Job/20",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Job",
|
||||
"11"
|
||||
"20"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -1403,6 +1403,408 @@
|
||||
],
|
||||
"_postman_isSubFolder": true
|
||||
},
|
||||
{
|
||||
"name": "Byond",
|
||||
"description": "",
|
||||
"item": [
|
||||
{
|
||||
"name": "List installed versions",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"id\": 1,\n \"online\": false\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Byond/List",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Byond",
|
||||
"List"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Read active version",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"id\": 1,\n \"online\": false\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Byond",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Byond"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Set 511.1385 active",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"version\": {\n \t\"major\": 511,\n \t\"minor\": 1385\n }\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Byond",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Byond"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Set 512.1441 active",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"version\": {\n \t\"major\": 512,\n \t\"minor\": 1441\n }\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Byond",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Byond"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
],
|
||||
"_postman_isSubFolder": true
|
||||
},
|
||||
{
|
||||
"name": "Repo",
|
||||
"description": "",
|
||||
"item": [
|
||||
{
|
||||
"name": "Read Info",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"id\": 1,\n \"online\": false\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Repository",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Repository"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Just fetch",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n\t\"updateReference\": true\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Repository",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Repository"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Test merge some stuff",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n\t\"updateReference\": true,\n\t\"reference\": \"master\",\n\t\"newTestMerges\": [\n\t\t{\n\t\t\t\"number\": 39476,\n\t\t\t\"pullRequestRevision\": \"11edfe5\"\n\t\t},\n\t\t{\n\t\t\t\"number\": 39469,\n\t\t\t\"pullRequestRevision\": \"ee4f00d\",\n\t\t\t\"comment\": \"babby's first pr\"\n\t\t}\n\t\t]\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Repository",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Repository"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Clone tg",
|
||||
"request": {
|
||||
"method": "PUT",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"origin\": \"https://github.com/tgstation/tgstation\"\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Repository",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Repository"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Delete",
|
||||
"request": {
|
||||
"method": "DELETE",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": ""
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Repository",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Repository"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
],
|
||||
"_postman_isSubFolder": true
|
||||
},
|
||||
{
|
||||
"name": "Online Instance ID 1",
|
||||
"request": {
|
||||
@@ -1601,185 +2003,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Byond",
|
||||
"description": "",
|
||||
"item": [
|
||||
{
|
||||
"name": "List installed versions",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"id\": 1,\n \"online\": false\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Byond/List",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Byond",
|
||||
"List"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Read active version",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"id\": 1,\n \"online\": false\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Byond",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Byond"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Set 511.1385 active",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"version\": {\n \t\"major\": 511,\n \t\"minor\": 1385\n }\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Byond",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Byond"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Set 512.1441 active",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Postman/1.0"
|
||||
},
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "Tgstation.Server.Api/4.0.0.0"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "InstanceId",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"version\": {\n \t\"major\": 512,\n \t\"minor\": 1441\n }\n}"
|
||||
},
|
||||
"url": {
|
||||
"raw": "localhost:5000/Byond",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "5000",
|
||||
"path": [
|
||||
"Byond"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Login Admin Default",
|
||||
"request": {
|
||||
|
||||
@@ -10,13 +10,12 @@ Verify the byond cache folder location on linux
|
||||
Server updates. Use FOLDERS so dependencies can be properly packaged
|
||||
-Fix this
|
||||
|
||||
TgsAuthorize attribute |'ing doesn't work due to role names, change to params[]
|
||||
OR use pow2 to go up and reverse tocode the enums
|
||||
|
||||
Don't throw arg null exceptions with null [FromBody]'s, apparently that's allowed, return bad request instead
|
||||
|
||||
Test repo
|
||||
Test byond
|
||||
Test compile
|
||||
Test watchdog
|
||||
test configuration
|
||||
test configuration
|
||||
|
||||
Think about how to preserve the LastOriginCommit while merging/test merging
|
||||
|
||||
Reference in New Issue
Block a user