mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
refactor legacy fy routes
This commit is contained in:
1 parent
2a08051ec4
commit
d2fcbb9438
9 files changed
+28
-15
No files matched your search
+2
-6
@@ -10,11 +10,9 @@ use crate::http_server::routes::application_routes::prompts_routes::add_prompts_
|
||||
use crate::http_server::routes::application_routes::stripe_artcraft_routes::add_stripe_artcraft_routes;
|
||||
use crate::http_server::routes::application_routes::subscription_routes::add_subscription_routes;
|
||||
use crate::http_server::routes::application_routes::tag_routes::add_tag_routes;
|
||||
use crate::http_server::routes::application_routes::tts_routes::add_tts_routes;
|
||||
use crate::http_server::routes::application_routes::user_bookmarks_routes::add_user_bookmarks_routes;
|
||||
use crate::http_server::routes::application_routes::user_rating_routes::add_user_rating_routes;
|
||||
use crate::http_server::routes::application_routes::user_routes::add_user_routes;
|
||||
use crate::http_server::routes::application_routes::voice_conversion_routes::add_voice_conversion_routes;
|
||||
use crate::http_server::routes::application_routes::webhook_routes::add_webhook_routes;
|
||||
use crate::http_server::routes::application_routes::weights_routes::add_weights_routes;
|
||||
use actix_http::body::MessageBody;
|
||||
@@ -41,12 +39,10 @@ where
|
||||
// Artcraft surface area
|
||||
app = add_generate_routes(app); // /v1/generate/...
|
||||
app = add_webhook_routes(app); // /v1/webhooks/... (fal)
|
||||
|
||||
// Remaining FakeYou surface area
|
||||
|
||||
// Legacy FakeYou surface area that might be useful again one day
|
||||
app = add_tag_routes(app); // /v1/tags
|
||||
app = add_tts_routes(app); // /tts
|
||||
app = add_weights_routes(app); // v1/weights
|
||||
app = add_voice_conversion_routes(app); // /v1/voice_conversion
|
||||
|
||||
// Media files routes
|
||||
app = add_media_file_routes(app); // /v1/media_files/...
|
||||
|
||||
@@ -8,11 +8,9 @@ mod moderation_routes;
|
||||
mod stripe_artcraft_routes;
|
||||
mod subscription_routes;
|
||||
mod tag_routes;
|
||||
mod tts_routes;
|
||||
mod user_bookmarks_routes;
|
||||
mod user_rating_routes;
|
||||
mod user_routes;
|
||||
mod voice_conversion_routes;
|
||||
mod webhook_routes;
|
||||
mod weights_routes;
|
||||
pub (super) mod add_application_routes;
|
||||
|
||||
+8
-3
@@ -41,10 +41,12 @@ use crate::http_server::deprecated_endpoints::w2l::get_w2l_template_use_count::g
|
||||
use crate::http_server::deprecated_endpoints::w2l::get_w2l_upload_template_job_status::get_w2l_upload_template_job_status_handler;
|
||||
use crate::http_server::deprecated_endpoints::w2l::list_w2l_templates::list_w2l_templates_handler;
|
||||
use crate::http_server::deprecated_endpoints::w2l::set_w2l_template_mod_approval::set_w2l_template_mod_approval_handler;
|
||||
use crate::http_server::endpoints::app_state::get_app_state_handler::get_app_state_handler;
|
||||
use crate::http_server::endpoints::download_job::enqueue_generic_download::enqueue_generic_download_handler;
|
||||
use crate::http_server::endpoints::download_job::get_generic_upload_job_status::get_generic_download_job_status_handler;
|
||||
use crate::http_server::endpoints::misc::enable_alpha_easy_handler::enable_alpha_easy_handler;
|
||||
use crate::http_server::endpoints::misc::enable_alpha_handler::enable_alpha_handler;
|
||||
use crate::http_server::endpoints::stats::get_unified_queue_stats_handler::get_unified_queue_stats_handler;
|
||||
use crate::http_server::endpoints::trending::list_trending_tts_models::list_trending_tts_models_handler;
|
||||
use crate::http_server::endpoints::voice_clone_requests::check_if_voice_clone_request_submitted::check_if_voice_clone_request_submitted_handler;
|
||||
use crate::http_server::endpoints::voice_clone_requests::create_voice_clone_request::create_voice_clone_request_handler;
|
||||
@@ -72,6 +74,8 @@ use crate::http_server::routes::legacy_routes::desktop_vc_app_routes::add_deskto
|
||||
use crate::http_server::routes::legacy_routes::image_studio_routes::add_image_studio_routes;
|
||||
use crate::http_server::routes::legacy_routes::model_download_routes::add_model_download_routes;
|
||||
use crate::http_server::routes::legacy_routes::studio_gen2_routes::add_studio_gen2_routes;
|
||||
use crate::http_server::routes::legacy_routes::tts_routes::add_tts_routes;
|
||||
use crate::http_server::routes::legacy_routes::voice_conversion_routes::add_voice_conversion_routes;
|
||||
use crate::http_server::routes::legacy_routes::workflow_routes::add_workflow_routes;
|
||||
use actix_helpers::route_builder::RouteBuilder;
|
||||
use actix_http::body::MessageBody;
|
||||
@@ -79,9 +83,6 @@ use actix_service::ServiceFactory;
|
||||
use actix_web::dev::{ServiceRequest, ServiceResponse};
|
||||
use actix_web::error::Error;
|
||||
use actix_web::{web, App, HttpResponse};
|
||||
use crate::http_server::endpoints::app_state::get_app_state_handler::get_app_state_handler;
|
||||
use crate::http_server::endpoints::service::status_alert_handler::status_alert_handler;
|
||||
use crate::http_server::endpoints::stats::get_unified_queue_stats_handler::get_unified_queue_stats_handler;
|
||||
|
||||
pub fn add_legacy_routes<T, B> (app: App<T>) -> App<T>
|
||||
where
|
||||
@@ -114,6 +115,10 @@ where
|
||||
app = add_media_upload_routes(app); // /v1/media_upload/...
|
||||
app = add_trending_routes(app); // /v1/trending/...
|
||||
|
||||
// Remaining FakeYou surface area
|
||||
app = add_tts_routes(app); // /tts
|
||||
app = add_voice_conversion_routes(app); // /v1/voice_conversion
|
||||
|
||||
// ==================== Animations ====================
|
||||
|
||||
let mut app = RouteBuilder::from_app(app)
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
pub (super) mod add_legacy_routes;
|
||||
mod beta_key_routes;
|
||||
mod desktop_vc_app_routes;
|
||||
mod image_studio_routes;
|
||||
mod model_download_routes;
|
||||
mod studio_gen2_routes;
|
||||
mod workflow_routes;
|
||||
mod desktop_vc_app_routes;
|
||||
mod tts_routes;
|
||||
mod voice_conversion_routes;
|
||||
mod workflow_routes;
|
||||
File renamed without changes.
File renamed without changes.
@@ -367,6 +367,10 @@ async fn main() -> AnyhowResult<()> {
|
||||
switch_tts_to_model_weights: easyenv::get_env_bool_or_default("FF_SWITCH_TTS_TO_MODEL_WEIGHTS", false),
|
||||
force_session_studio_flags: easyenv::get_env_bool_or_default("FF_FORCE_SESSION_STUDIO_FLAG", false),
|
||||
force_session_video_style_transfer_flags: easyenv::get_env_bool_or_default("FF_FORCE_SESSION_VST_FLAG", false),
|
||||
|
||||
// Disable voice features
|
||||
disable_tts: easyenv::get_env_bool_or_default("DISABLE_TTS", false),
|
||||
disable_voice_conversion: easyenv::get_env_bool_or_default("DISABLE_VOICE_CONVERSION", false),
|
||||
};
|
||||
|
||||
let third_party_url_redirector = ThirdPartyUrlRedirector::new(server_environment);
|
||||
|
||||
@@ -285,6 +285,14 @@ pub struct StaticFeatureFlags {
|
||||
/// TEMPORARY: Require users to have a flag on their `users` table record to use video style transfer.
|
||||
/// This will also prevent anonymous users from using the service APIs marked as VST-only.
|
||||
pub force_session_video_style_transfer_flags: bool,
|
||||
|
||||
/// Disable TTS endpoints
|
||||
/// If true, respond with 429.
|
||||
pub disable_tts: bool,
|
||||
|
||||
/// Disable voice conversion endpoints
|
||||
/// If true, respond with 429.
|
||||
pub disable_voice_conversion: bool,
|
||||
}
|
||||
|
||||
/// Instead of top level service denial, these are bans against entities that instead return
|
||||
|
||||
@@ -343,10 +343,10 @@
|
||||
"markdownDescription": "Denies the fetch_send command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "This permission set configures what kind of\r\nfetch operations are available from the http plugin.\r\n\r\nThis enables all fetch operations but does not\r\nallow explicitly any origins to be fetched. This needs to\r\nbe manually configured before usage.\r\n\r\n#### Granted Permissions\r\n\r\nAll fetch operations are enabled.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-fetch`\n- `allow-fetch-cancel`\n- `allow-fetch-read-body`\n- `allow-fetch-send`",
|
||||
"description": "This permission set configures what kind of\nfetch operations are available from the http plugin.\n\nThis enables all fetch operations but does not\nallow explicitly any origins to be fetched. This needs to\nbe manually configured before usage.\n\n#### Granted Permissions\n\nAll fetch operations are enabled.\n\n\n#### This default permission set includes:\n\n- `allow-fetch`\n- `allow-fetch-cancel`\n- `allow-fetch-read-body`\n- `allow-fetch-send`",
|
||||
"type": "string",
|
||||
"const": "default",
|
||||
"markdownDescription": "This permission set configures what kind of\r\nfetch operations are available from the http plugin.\r\n\r\nThis enables all fetch operations but does not\r\nallow explicitly any origins to be fetched. This needs to\r\nbe manually configured before usage.\r\n\r\n#### Granted Permissions\r\n\r\nAll fetch operations are enabled.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-fetch`\n- `allow-fetch-cancel`\n- `allow-fetch-read-body`\n- `allow-fetch-send`"
|
||||
"markdownDescription": "This permission set configures what kind of\nfetch operations are available from the http plugin.\n\nThis enables all fetch operations but does not\nallow explicitly any origins to be fetched. This needs to\nbe manually configured before usage.\n\n#### Granted Permissions\n\nAll fetch operations are enabled.\n\n\n#### This default permission set includes:\n\n- `allow-fetch`\n- `allow-fetch-cancel`\n- `allow-fetch-read-body`\n- `allow-fetch-send`"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user