mirror of
https://github.com/Polaris-Entertainment/bytefy.git
synced 2026-04-09 09:29:39 +00:00
Prepare beta release
This commit is contained in:
6
services/bytefy.image/bytefy.image/CorsSettings.cs
Normal file
6
services/bytefy.image/bytefy.image/CorsSettings.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace bytefy.image;
|
||||
|
||||
public class CorsSettings
|
||||
{
|
||||
public string[] AllowedOrigins { get; set; }
|
||||
}
|
||||
@@ -3,13 +3,17 @@ using ImageMagick;
|
||||
using Microsoft.AspNetCore.Antiforgery;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddAntiforgery(options => options.HeaderName = "2311d8d8-607d-4747-8939-1bde65643254");
|
||||
builder.Services.AddSingleton<ConversionQueueService>();
|
||||
builder.Services.AddHostedService(provider => provider.GetRequiredService<ConversionQueueService>());
|
||||
|
||||
var corsSettings = builder.Configuration.GetSection("Cors").Get<CorsSettings>();
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("AllowSpecificOrigin",
|
||||
builder => builder.WithOrigins("http://localhost:4200")
|
||||
builder => builder.WithOrigins(corsSettings.AllowedOrigins)
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyHeader()
|
||||
.AllowCredentials());
|
||||
|
||||
@@ -2,8 +2,14 @@
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"Cors": {
|
||||
"AllowedOrigins": [
|
||||
"http://localhost:4200",
|
||||
"https://localhost:4200"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,5 +5,10 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"Cors": {
|
||||
"AllowedOrigins": [
|
||||
"http://bytefy.net",
|
||||
"https://bytefy.net"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
"src/assets",
|
||||
"src/web.config"
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.scss"
|
||||
@@ -54,7 +55,13 @@
|
||||
"development": {
|
||||
"optimization": false,
|
||||
"extractLicenses": false,
|
||||
"sourceMap": true
|
||||
"sourceMap": true,
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.development.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
@@ -88,7 +95,8 @@
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
"src/assets",
|
||||
"src/web.config"
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.scss"
|
||||
|
||||
4
tools/src/environments/environment.development.ts
Normal file
4
tools/src/environments/environment.development.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
uploadServiceBaseUrl: 'http://localhost:1337'
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
uploadServiceBaseUrl: 'http://localhost:1337'
|
||||
production: true,
|
||||
uploadServiceBaseUrl: 'http://image.bytefy.net'
|
||||
};
|
||||
19
tools/src/web.config
Normal file
19
tools/src/web.config
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
|
||||
<system.webServer>
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="Angular Routes" stopProcessing="true">
|
||||
<match url=".*" />
|
||||
<conditions logicalGrouping="MatchAll">
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
||||
</conditions>
|
||||
<action type="Rewrite" url="./index.html" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
</system.webServer>
|
||||
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user