Cleanup
This commit is contained in:
2
.env
2
.env
@@ -3,7 +3,7 @@ RUST_LOG=warn,siren=info
|
|||||||
DISCORD_TOKEN=
|
DISCORD_TOKEN=
|
||||||
DISCORD_SECRET=
|
DISCORD_SECRET=
|
||||||
|
|
||||||
JWT_SECRET=CHANGEME
|
JWT_SECRET=CHANGEME # Change this to a secure secret
|
||||||
|
|
||||||
DATABASE_USER=siren
|
DATABASE_USER=siren
|
||||||
DATABASE_PASSWORD=CHANGEME # Change this to a secure password
|
DATABASE_PASSWORD=CHANGEME # Change this to a secure password
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use axum::extract::{Path, State};
|
use axum::extract::State;
|
||||||
use axum::middleware::from_extractor;
|
use axum::middleware::from_extractor;
|
||||||
use axum::{Extension, Json, Router};
|
use axum::{Extension, Json, Router};
|
||||||
use axum::routing::post;
|
use axum::routing::post;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use axum::{middleware, Extension, Router};
|
use axum::{Extension, Router};
|
||||||
use axum::middleware::from_extractor;
|
use axum::middleware::from_extractor;
|
||||||
use axum::routing::post;
|
use axum::routing::post;
|
||||||
use crate::api::auth::csprng;
|
use crate::api::auth::csprng;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ use axum::async_trait;
|
|||||||
use axum::extract::FromRequestParts;
|
use axum::extract::FromRequestParts;
|
||||||
use axum::http::request::Parts;
|
use axum::http::request::Parts;
|
||||||
use axum::http::{Method, StatusCode};
|
use axum::http::{Method, StatusCode};
|
||||||
use axum::middleware::{from_extractor, FromExtractorLayer};
|
|
||||||
use axum_extra::{
|
use axum_extra::{
|
||||||
TypedHeader,
|
TypedHeader,
|
||||||
headers::{Authorization, authorization::Bearer},
|
headers::{Authorization, authorization::Bearer},
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use axum::extract::{Query, State};
|
use axum::extract::{Query, State};
|
||||||
use axum::http::{HeaderMap, HeaderValue, StatusCode};
|
use axum::http::StatusCode;
|
||||||
use axum::{Json, Router};
|
use axum::{Json, Router};
|
||||||
use axum::http::header::SET_COOKIE;
|
|
||||||
use axum::response::Redirect;
|
use axum::response::Redirect;
|
||||||
use axum::routing::get;
|
use axum::routing::get;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use crate::api::auth::bearer_token::BearerTokenClaims;
|
use crate::api::auth::bearer_token::BearerTokenClaims;
|
||||||
use crate::AppState;
|
use crate::AppState;
|
||||||
use crate::api::auth::csprng;
|
|
||||||
use crate::api::auth::session::Session;
|
use crate::api::auth::session::Session;
|
||||||
use crate::error::SirenResult;
|
use crate::error::SirenResult;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
use std::sync::{Arc, OnceLock};
|
use std::sync::Arc;
|
||||||
|
|
||||||
use reqwest::Url;
|
use reqwest::Url;
|
||||||
use serenity::all::UserId;
|
use serenity::all::UserId;
|
||||||
use serenity::client::Cache;
|
use serenity::client::Cache;
|
||||||
use serenity::model::prelude::{GuildId, ChannelId};
|
use serenity::model::prelude::{GuildId, ChannelId};
|
||||||
use serenity::model::user::User;
|
|
||||||
use serenity::prelude::*;
|
|
||||||
use songbird::Songbird;
|
use songbird::Songbird;
|
||||||
|
|
||||||
use crate::error::{SirenResult, Error as SirenError};
|
use crate::error::{SirenResult, Error as SirenError};
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use serenity::all::{
|
use serenity::all::{CommandInteraction, CommandOptionType, CreateCommand, CreateCommandOption};
|
||||||
Cache, CommandInteraction, CommandOptionType, CreateCommand, CreateCommandOption, Http,
|
|
||||||
};
|
|
||||||
use serenity::model::prelude::GuildId;
|
use serenity::model::prelude::GuildId;
|
||||||
use serenity::{prelude::*, async_trait};
|
use serenity::{prelude::*, async_trait};
|
||||||
use songbird::input::{Input, YoutubeDl};
|
use songbird::input::{Input, YoutubeDl};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
use dotenv::{dotenv, from_filename};
|
||||||
use serenity::http::Http;
|
use serenity::http::Http;
|
||||||
use serenity::prelude::*;
|
use serenity::prelude::*;
|
||||||
use songbird::{SerenityInit, Songbird};
|
use songbird::{SerenityInit, Songbird};
|
||||||
@@ -7,7 +8,6 @@ use reqwest::Client as HttpClient;
|
|||||||
use serenity::all::{Cache, ShardManager, UserId};
|
use serenity::all::{Cache, ShardManager, UserId};
|
||||||
use crate::api::App;
|
use crate::api::App;
|
||||||
use crate::bot::handler::BotHandler;
|
use crate::bot::handler::BotHandler;
|
||||||
use crate::bot::oai::OAI;
|
|
||||||
|
|
||||||
mod api;
|
mod api;
|
||||||
mod bot;
|
mod bot;
|
||||||
@@ -33,7 +33,11 @@ struct AppState {
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
dotenv::dotenv().ok();
|
if let Err(err) = from_filename(".env.local") {
|
||||||
|
eprintln!("Failed to load .env.local: {}", err);
|
||||||
|
}
|
||||||
|
dotenv().ok();
|
||||||
|
|
||||||
env_logger::init_from_env(env_logger::Env::default().filter_or("RUST_LOG", "warn,siren=info"));
|
env_logger::init_from_env(env_logger::Env::default().filter_or("RUST_LOG", "warn,siren=info"));
|
||||||
|
|
||||||
data::initialize().await?;
|
data::initialize().await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user