mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 22:46:33 +00:00
fix on recreating resource
add azaion-commands queue add logs for docker run update gitignore
This commit is contained in:
+1
-1
@@ -6,5 +6,5 @@ obj
|
|||||||
*.user
|
*.user
|
||||||
log*
|
log*
|
||||||
*.cmd
|
*.cmd
|
||||||
Content/
|
Content/
|
||||||
.env
|
.env
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Azaion.Common;
|
|
||||||
using Azaion.Common.Configs;
|
using Azaion.Common.Configs;
|
||||||
using Azaion.Common.Database;
|
using Azaion.Common.Database;
|
||||||
using Azaion.Common.Entities;
|
using Azaion.Common.Entities;
|
||||||
@@ -142,7 +141,7 @@ app.MapPost("/resources/{dataFolder?}",
|
|||||||
async ([FromRoute]string? dataFolder, IFormFile data, IResourcesService resourceService, CancellationToken cancellationToken)
|
async ([FromRoute]string? dataFolder, IFormFile data, IResourcesService resourceService, CancellationToken cancellationToken)
|
||||||
=> await resourceService.SaveResource(dataFolder, data, cancellationToken))
|
=> await resourceService.SaveResource(dataFolder, data, cancellationToken))
|
||||||
.Accepts<IFormFile>("multipart/form-data")
|
.Accepts<IFormFile>("multipart/form-data")
|
||||||
.RequireAuthorization(apiUploaderPolicy)
|
.RequireAuthorization()
|
||||||
.DisableAntiforgery();
|
.DisableAntiforgery();
|
||||||
|
|
||||||
app.MapPost("/resources/get/{dataFolder?}", //Need to have POST method for secure password
|
app.MapPost("/resources/get/{dataFolder?}", //Need to have POST method for secure password
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public class ResourcesService(IOptions<ResourcesConfig> resourcesConfig, ILogger
|
|||||||
Directory.CreateDirectory(resourceFolder);
|
Directory.CreateDirectory(resourceFolder);
|
||||||
|
|
||||||
var resourcePath = Path.Combine(resourceFolder, data.FileName);
|
var resourcePath = Path.Combine(resourceFolder, data.FileName);
|
||||||
|
File.Delete(resourcePath);
|
||||||
await using var fileStream = new FileStream(resourcePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
|
await using var fileStream = new FileStream(resourcePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
|
||||||
await data.CopyToAsync(fileStream, cancellationToken);
|
await data.CopyToAsync(fileStream, cancellationToken);
|
||||||
logger.LogInformation($"Resource {data.FileName} Saved Successfully");
|
logger.LogInformation($"Resource {data.FileName} Saved Successfully");
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ rabbitmqctl set_permissions azaion_receiver "" "" ".*"
|
|||||||
# 2.2 declare queues with x-queue-type stream:
|
# 2.2 declare queues with x-queue-type stream:
|
||||||
rabbitmqadmin declare queue name=azaion-annotations arguments='{"x-queue-type": "stream", "max-segment-size-bytes": 5368709118}'
|
rabbitmqadmin declare queue name=azaion-annotations arguments='{"x-queue-type": "stream", "max-segment-size-bytes": 5368709118}'
|
||||||
rabbitmqadmin declare queue name=azaion-annotations-confirm arguments='{"x-queue-type": "stream", "max-segment-size-bytes": 5368709118}'
|
rabbitmqadmin declare queue name=azaion-annotations-confirm arguments='{"x-queue-type": "stream", "max-segment-size-bytes": 5368709118}'
|
||||||
|
rabbitmqadmin declare queue name=azaion-commands
|
||||||
# 2.3 configure rabbitmq
|
# 2.3 configure rabbitmq
|
||||||
# edit /etc/rabbitmq/rabbitmq.conf
|
# edit /etc/rabbitmq/rabbitmq.conf
|
||||||
# put here:
|
# put here:
|
||||||
|
|||||||
@@ -2,4 +2,5 @@
|
|||||||
--env-file .env \
|
--env-file .env \
|
||||||
-p 4000:8080 \
|
-p 4000:8080 \
|
||||||
-v /root/content:/app/Content \
|
-v /root/content:/app/Content \
|
||||||
|
-v /root/logs:/app/logs
|
||||||
--name azaion.api docker.azaion.com/api
|
--name azaion.api docker.azaion.com/api
|
||||||
Reference in New Issue
Block a user