Skip to content

Commit

Permalink
Remove --insecure-webui option
Browse files Browse the repository at this point in the history
  • Loading branch information
picoHz committed Mar 27, 2024
1 parent 5a5fd71 commit 1960199
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
3 changes: 1 addition & 2 deletions taxy/src/admin/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub async fn login(
}
}

let insecure = request.insecure || state.data.lock().await.insecure;
let secure_cookie = if request.insecure { "" } else { "Secure" };
let result = state.call(VerifyAccount { request }).await;
match result {
Err(err) => Err(warp::reject::custom(err)),
Expand All @@ -75,7 +75,6 @@ pub async fn login(
LoginResponse::Success => SessionKind::Admin,
_ => SessionKind::Login,
};
let secure_cookie = if insecure { "" } else { "Secure" };
Ok(warp::reply::with_header(
warp::reply::json(&res),
"Set-Cookie",
Expand Down
7 changes: 2 additions & 5 deletions taxy/src/admin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ mod swagger;
pub async fn start_admin(
app_info: AppInfo,
addr: SocketAddr,
insecure: bool,
command: mpsc::Sender<ServerCommand>,
mut callback: mpsc::Receiver<RpcCallback>,
event: broadcast::Sender<ServerEvent>,
) -> anyhow::Result<()> {
let data = Data::new(app_info, insecure).await?;
let data = Data::new(app_info).await?;
let data = Arc::new(Mutex::new(data));
let app_state = AppState {
sender: command,
Expand Down Expand Up @@ -222,7 +221,6 @@ struct Data {
config: AppConfig,
sessions: SessionStore,
log: Arc<LogReader>,
insecure: bool,

rpc_counter: usize,
rpc_callbacks: HashMap<usize, oneshot::Sender<CallbackData>>,
Expand Down Expand Up @@ -260,11 +258,10 @@ impl AppState {
}

impl Data {
async fn new(app_info: AppInfo, insecure: bool) -> anyhow::Result<Self> {
async fn new(app_info: AppInfo) -> anyhow::Result<Self> {
let log = app_info.log_path.join("log.db");
Ok(Self {
app_info,
insecure,
config: AppConfig::default(),
sessions: Default::default(),
log: Arc::new(LogReader::new(&log).await?),
Expand Down
3 changes: 0 additions & 3 deletions taxy/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ pub struct StartArgs {
#[clap(long, short, env = "TAXY_NO_WEBUI", conflicts_with = "webui")]
pub no_webui: bool,

#[clap(long, env = "TAXY_INSECURE_WEBUI", conflicts_with = "no_webui")]
pub insecure_webui: bool,

#[clap(long, short, value_name = "DIR", env = "TAXY_CONFIG_DIR")]
pub config_dir: Option<PathBuf>,

Expand Down
2 changes: 1 addition & 1 deletion taxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async fn start(args: StartArgs) -> anyhow::Result<()> {

let webui_enabled = !args.no_webui;
tokio::select! {
r = taxy::admin::start_admin(app_info, args.webui, args.insecure_webui, channels.command, channels.callback, channels.event), if webui_enabled => {
r = taxy::admin::start_admin(app_info, args.webui, channels.command, channels.callback, channels.event), if webui_enabled => {
if let Err(err) = r {
error!("admin error: {}", err);
}
Expand Down

0 comments on commit 1960199

Please sign in to comment.