Skip to content

Commit

Permalink
230724
Browse files Browse the repository at this point in the history
  • Loading branch information
Tynab committed Jul 23, 2023
1 parent a3000c9 commit 299d442
Show file tree
Hide file tree
Showing 78 changed files with 1,658 additions and 338 deletions.
26 changes: 13 additions & 13 deletions console/YANLib.Benchmarks/YANLib.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\lib\YANLib\YANLib.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\lib\YANLib\YANLib.csproj" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions docker-compose.dcproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<None Include="elasticsearch\.dockerignore" />
<None Include="elasticsearch\config\elasticsearch.yml" />
<None Include="elasticsearch\Dockerfile" />
<None Include="es-ingest\.dockerignore" />
<None Include="es-ingest\config\elasticsearch.yml" />
<None Include="es-ingest\Dockerfile" />
<None Include="extensions\curator\.dockerignore" />
<None Include="extensions\curator\config\curator.yml" />
<None Include="extensions\curator\config\delete_log_files_curator.yml" />
Expand Down
7 changes: 2 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ services:
depends_on:
- elasticsearch
restart: unless-stopped

rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
Expand All @@ -119,8 +119,6 @@ services:
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS:-}
networks:
- yan
depends_on:
- logstash
restart: unless-stopped

zookeeper:
Expand All @@ -132,8 +130,6 @@ services:
- ALLOW_ANONYMOUS_LOGIN=yes
networks:
- yan
depends_on:
- logstash
restart: unless-stopped

kafka:
Expand Down Expand Up @@ -183,6 +179,7 @@ networks:
volumes:
setup:
elasticsearch:
es-ingest:

# Run with
# docker-compose \
Expand Down
6 changes: 6 additions & 0 deletions es-ingest/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore Docker build files
Dockerfile
.dockerignore

# Ignore OS artifacts
**/.DS_Store
7 changes: 7 additions & 0 deletions es-ingest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ARG ELASTIC_VERSION

# https://www.docker.elastic.co/
FROM docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}

# Add your elasticsearch plugins setup here
# Example: RUN elasticsearch-plugin install analysis-icu
18 changes: 18 additions & 0 deletions es-ingest/config/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
## Default Elasticsearch configuration from Elasticsearch base image.
## https://github.com/elastic/elasticsearch/blob/main/distribution/docker/src/docker/config/elasticsearch.yml
#
cluster.name: docker-cluster-neo
network.host: 0.0.0.0

## X-Pack settings
## see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html
#
xpack.license.self_generated.type: trial
xpack.security.enabled: true

# server.publicBaseUrl: https://my-elasticsearch-cluster.example.com

## Set the built-in users' passwords.
# Run the following command from the Elasticsearch directory:
# ./bin/elasticsearch-setup-passwords interactive
5 changes: 3 additions & 2 deletions extensions/curator/curator-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ services:
curator:
build:
context: extensions/curator/
container_name: curator
init: true
volumes:
- ./config/curator.yml:/.curator/curator.yml:ro,Z
- ./config/delete_log_files_curator.yml:/.curator/delete_log_files_curator.yml:ro,Z
- ./extensions/curator/config/curator.yml:/.curator/curator.yml:ro,Z
- ./extensions/curator/config/delete_log_files_curator.yml:/.curator/delete_log_files_curator.yml:ro,Z
environment:
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD:-}
networks:
Expand Down
2 changes: 1 addition & 1 deletion extensions/enterprise-search/config/enterprise-search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
## --------------------- REQUIRED ---------------------

# Encryption keys to protect application secrets.
secret_management.encryption_keys:
secret_management.encryption_keys: [680f94e568c90364bedf927b2f0f49609702d3eab9098688585a375b14274546]
# example:
#- 680f94e568c90364bedf927b2f0f49609702d3eab9098688585a375b14274546

Expand Down
3 changes: 2 additions & 1 deletion extensions/enterprise-search/enterprise-search-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ services:
context: extensions/enterprise-search/
args:
ELASTIC_VERSION: ${ELASTIC_VERSION}
container_name: enterprise-search
volumes:
- ./config/enterprise-search.yml:/usr/share/enterprise-search/config/enterprise-search.yml:ro,Z
- ./extensions/enterprise-search/config/enterprise-search.yml:/usr/share/enterprise-search/config/enterprise-search.yml:ro,Z
environment:
JAVA_OPTS: -Xms2g -Xmx2g
ENT_SEARCH_DEFAULT_PASSWORD: 'changeme'
Expand Down
3 changes: 2 additions & 1 deletion extensions/filebeat/filebeat-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
ELASTIC_VERSION: ${ELASTIC_VERSION}
# Run as 'root' instead of 'filebeat' (uid 1000) to allow reading
# 'docker.sock' and the host's filesystem.
container_name: filebeat
user: root
command:
# Log to stderr.
Expand All @@ -17,7 +18,7 @@ services:
# see: https://www.elastic.co/guide/en/beats/libbeat/current/config-file-permissions.html
- --strict.perms=false
volumes:
- ./config/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro,Z
- ./extensions/filebeat/config/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro,Z
- type: bind
source: /var/lib/docker/containers
target: /var/lib/docker/containers
Expand Down
1 change: 1 addition & 0 deletions extensions/fleet/agent-apmserver-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
context: extensions/fleet/
args:
ELASTIC_VERSION: ${ELASTIC_VERSION}
container_name: apm-server
volumes:
- apm-server:/usr/share/elastic-agent/state:Z
environment:
Expand Down
1 change: 1 addition & 0 deletions extensions/fleet/fleet-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
context: extensions/fleet/
args:
ELASTIC_VERSION: ${ELASTIC_VERSION}
container_name: fleet-server
volumes:
- fleet-server:/usr/share/elastic-agent/state:Z
environment:
Expand Down
3 changes: 2 additions & 1 deletion extensions/heartbeat/heartbeat-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
context: extensions/heartbeat/
args:
ELASTIC_VERSION: ${ELASTIC_VERSION}
container_name: heartbeat
command:
# Log to stderr.
- -e
Expand All @@ -14,7 +15,7 @@ services:
# see: https://www.elastic.co/guide/en/beats/libbeat/current/config-file-permissions.html
- --strict.perms=false
volumes:
- ./config/heartbeat.yml:/usr/share/heartbeat/heartbeat.yml:ro,Z
- ./extensions/heartbeat/config/heartbeat.yml:/usr/share/heartbeat/heartbeat.yml:ro,Z
environment:
HEARTBEAT_INTERNAL_PASSWORD: ${HEARTBEAT_INTERNAL_PASSWORD:-}
BEATS_SYSTEM_PASSWORD: ${BEATS_SYSTEM_PASSWORD:-}
Expand Down
1 change: 1 addition & 0 deletions extensions/logspout/logspout-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
logspout:
build:
context: extensions/logspout
container_name: logspout
volumes:
- type: bind
source: /var/run/docker.sock
Expand Down
4 changes: 2 additions & 2 deletions extensions/metricbeat/config/metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ metricbeat.autodiscover:
metricbeat.modules:
- module: elasticsearch
hosts: [ http://elasticsearch:9200 ]
username: monitoring_internal
username: elastic
password: ${MONITORING_INTERNAL_PASSWORD}
xpack.enabled: true
period: 10s
Expand All @@ -30,7 +30,7 @@ metricbeat.modules:
enabled: true
- module: kibana
hosts: [ http://kibana:5601 ]
username: monitoring_internal
username: elastic
password: ${MONITORING_INTERNAL_PASSWORD}
xpack.enabled: true
period: 10s
Expand Down
3 changes: 2 additions & 1 deletion extensions/metricbeat/metricbeat-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
ELASTIC_VERSION: ${ELASTIC_VERSION}
# Run as 'root' instead of 'metricbeat' (uid 1000) to allow reading
# 'docker.sock' and the host's filesystem.
container_name: metricbeat
user: root
command:
# Log to stderr.
Expand All @@ -20,7 +21,7 @@ services:
# from within a container.
- --system.hostfs=/hostfs
volumes:
- ./config/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro,Z
- ./extensions/metricbeat/config/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro,Z
- type: bind
source: /
target: /hostfs
Expand Down
85 changes: 42 additions & 43 deletions host/YANLib.HttpApi.Host/YANLib.HttpApi.Host.csproj
Original file line number Diff line number Diff line change
@@ -1,52 +1,51 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<Import Project="..\..\common.props" />
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>YANLib</RootNamespace>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
<UserSecretsId>YANLib-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>YANLib</RootNamespace>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
<UserSecretsId>YANLib-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Elastic.Apm" Version="1.22.0" />
<PackageReference Include="Elastic.Apm.NetCoreAll" Version="1.22.0" />
<PackageReference Include="Elastic.Apm.StackExchange.Redis" Version="1.22.0" />
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Expressions" Version="3.4.1" />
<PackageReference Include="Serilog.Formatting.Compact" Version="1.1.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="9.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="6.0.3" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="6.0.3" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="6.0.3" />
<PackageReference Include="Volo.Abp.Http.Client" Version="6.0.3" />
<PackageReference Include="Volo.Abp.Swashbuckle" Version="6.0.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Elastic.Apm.NetCoreAll" Version="1.22.0" />
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Expressions" Version="3.4.1" />
<PackageReference Include="Serilog.Formatting.Compact" Version="1.1.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="9.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="6.0.3" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="6.0.3" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="6.0.3" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="6.0.3" />
<PackageReference Include="Volo.Abp.Http.Client" Version="6.0.3" />
<PackageReference Include="Volo.Abp.Swashbuckle" Version="6.0.3" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.5" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="1.0.5" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Logs\**" />
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\YANLib.Application\YANLib.Application.csproj" />
<ProjectReference Include="..\..\src\YANLib.EntityFrameworkCore\YANLib.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\src\YANLib.HttpApi\YANLib.HttpApi.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\YANLib.Application\YANLib.Application.csproj" />
<ProjectReference Include="..\..\src\YANLib.EntityFrameworkCore\YANLib.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\src\YANLib.HttpApi\YANLib.HttpApi.csproj" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions host/YANLib.HttpApi.Host/YANLibHttpApiHostModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.Http.Client;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Swashbuckle;
using YANLib.EntityFrameworkCore;
using YANLib.Utilities;
using static Elastic.Apm.Agent;
using static System.StringSplitOptions;

Expand All @@ -37,6 +40,7 @@ namespace YANLib;
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpHttpClientModule)
)]
Expand All @@ -45,6 +49,8 @@ public class YANLibHttpApiHostModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
context.Services.AddElasticsearch(configuration);
Configure<AbpDbContextOptions>(o => o.UseSqlServer());
ConfigureConventionalControllers();
ConfigureLocalization();
ConfigureCors(context, configuration);
Expand Down
Loading

0 comments on commit 299d442

Please sign in to comment.