Skip to content

Commit

Permalink
Closes #1028
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickklaeren committed Nov 11, 2024
1 parent 5bbde45 commit 2964139
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 251 deletions.
14 changes: 6 additions & 8 deletions docker-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:
image: ghcr.io/discord-csharp/csharprepl:latest
read_only: true
user: www-data
environment:
environment:
- ASPNETCORE_URLS=http://+:31337
- Logging__LogLevel__Microsoft=Warning
- Logging__LogLevel__CSDiscordService=Trace
Expand Down Expand Up @@ -90,8 +90,6 @@ services:
target: DiscordToken
- source: discord-client-secret
target: DiscordClientSecret
- source: stackoverflow-token
target: StackoverflowToken
- source: db-connection-string
target: DbConnection
- source: log-webhook-token
Expand All @@ -103,7 +101,7 @@ services:
- proxy
- repl
- modix

# the translation feature of the modix bot
modix-translator:
image: ghcr.io/discord-csharp/modix-translator:latest
Expand Down Expand Up @@ -144,7 +142,7 @@ services:
- pgadmin-data:/var/lib/pgadmin
networks:
- proxy

# grafana instance with access to the modix database
stats:
image: grafana/grafana:latest
Expand All @@ -169,15 +167,15 @@ services:
- grafana-data:/gfdata:rw
networks:
- proxy

# monitors the health check (specifically of REPL) and restarts the container
autoheal:
image: willfarrell/autoheal
deploy:
mode: global
volumes:
- /var/run/docker.sock:/var/run/docker.sock

networks:
proxy:
repl:
Expand Down Expand Up @@ -218,7 +216,7 @@ volumes:
modix-keys:
modix-logs:
modix-20-keys:

#workaround for swarm not supporting tmpfs mounts
repl-tmp:
driver_opts:
Expand Down
95 changes: 0 additions & 95 deletions src/Modix.Bot/Modules/StackExchangeModule.cs

This file was deleted.

2 changes: 0 additions & 2 deletions src/Modix.Data/Models/Core/ModixConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ public class ModixConfig
{
public string? DiscordToken { get; set; } = null;

public string? StackoverflowToken { get; set; } = null;

public string? DbConnection { get; set; } = null;

public string? LogWebhookToken { get; set; } = null;
Expand Down
92 changes: 0 additions & 92 deletions src/Modix.Services/StackExchange/StackExchangeResponse.cs

This file was deleted.

47 changes: 0 additions & 47 deletions src/Modix.Services/StackExchange/StackExchangeService.cs

This file was deleted.

4 changes: 1 addition & 3 deletions src/Modix/Extensions/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
using Modix.Services.Moderation;
using Modix.Services.Promotions;
using Modix.Services.Quote;
using Modix.Services.StackExchange;
using Modix.Services.Starboard;
using Modix.Services.Tags;
using Modix.Services.Utilities;
Expand All @@ -51,7 +50,7 @@ public static IServiceCollection AddModixHttpClients(this IServiceCollection ser

services.AddHttpClient(HttpClientNames.RetryOnTransientErrorPolicy)
.AddPolicyHandler(HttpPolicyExtensions.HandleTransientHttpError()
.WaitAndRetryAsync(2, retryAttempt => TimeSpan.FromSeconds(5)));
.WaitAndRetryAsync(2, retryAttempt => TimeSpan.FromSeconds(5)));

services.AddHttpClient(HttpClientNames.TimeoutFiveSeconds)
.ConfigureHttpClient(client =>
Expand Down Expand Up @@ -172,7 +171,6 @@ public static IServiceCollection AddModix(
services.AddMemoryCache();

services.AddScoped<WikipediaService>();
services.AddScoped<StackExchangeService>();
services.AddScoped<DocumentationService>();

services.AddScoped<IModerationActionEventHandler, ModerationLoggingBehavior>();
Expand Down
1 change: 0 additions & 1 deletion src/Modix/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"LogWebhookId": "",
"LogWebhookToken": "",
"DiscordToken": "",
"StackoverflowToken": "",
"MessageCacheSize": 0,
"ReplUrl": "",
"IlUrl": "",
Expand Down
5 changes: 2 additions & 3 deletions wiki/Developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To work on Modix, you need a few things:
- [PostgreSQL database server](https://www.postgresql.org/download/). A docker container also works.
- **Optional**: [Docker](https://www.docker.com/get-docker). You **do not** need Docker if you're just developing locally - it's mostly just to test if your changes are significant enough that they might break CI, or if you prefer to keep your dev environment clean. If you're on Windows, make sure you switch to Linux containers.

If you're working on a feature that involves Modix's core services, and only needs to work with the Discord bot frontend, then you can proceed to opening `Modix.sln`.
If you're working on a feature that involves Modix's core services, and only needs to work with the Discord bot frontend, then you can proceed to opening `Modix.sln`.

# Setting Configuration
### Config file
Expand All @@ -28,11 +28,10 @@ If you prefer to use environment variables for configuration, they must all be p
- `DiscordClientSecret` - same as above.
- **Optional**
- `MessageCacheSize` - An integer value defining the internal Discord.Net message cache size - used for logging deleted messages. Should be around 10 or more, and will default to that if unset, but you don't need it unless you're testing message deletion.
- `LogWebhookId` - The ID of the Discord webhook to log to. Only necessary if you want log messages to appear in a channel on the server.
- `LogWebhookId` - The ID of the Discord webhook to log to. Only necessary if you want log messages to appear in a channel on the server.
- `https://discord.com/api/webhooks/[this part]/asda2ed2klkm5lkn42n34jk`
- `LogWebhookToken` - Same as above, but the token of the webhook.
- `https://discord.com/api/webhooks/000000000000000000/[this part]`
- `StackoverflowToken` - A token for the StackOverflow API, if you need to use the StackOverflow module.
- `ReplUrl` - The URL of the endpoint that will be receiving REPL (`!eval`/`!exec`) requests - required if you want to test the REPL, and requires you to host the [repl](https://github.com/discord-csharp/CSDiscord).
- `IlUrl` - The URL of the endpoint that will be receiving IL (`!il`) requests. Same as above, and will likely be the same URL.

Expand Down

0 comments on commit 2964139

Please sign in to comment.