Password hash on selfhosted sync server

I can’t figure out what the exactly wanted format is.

Doesn’t really help

I used multiple programs to generate a hash but anki (both the python and rust back-end complain)

For example this is a hash with the recommend program in the docs:

SYNC_USER1=USER:$pbkdf2-sha256$i=600000,l=32$s2PJvFTbg7y2Cejid5Pzdg$28+PDC6mVqHFBGfx7LOIlk6YThTpOuui6WC1Y0ZhhTM

When I try to connect to the server, the server spews out this error:

thread 'tokio-runtime-worker' panicked at rslib/src/sync/http_server/mod.rs:199:61:
couldn't parse password hash: PhcStringField
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: anki::sync::http_server::handlers::<impl anki::sync::collection::protocol::SyncProtocol for alloc::sync::Arc<anki::sync::http_server::SimpleServer>>::host_key::{{closure}}
   4: <F as axum::handler::Handler<(M,T1,T2,T3),S,B>>::call::{{closure}}
   5: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
   6: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
   7: <tower::util::map_response::MapResponseFuture<F,N> as core::future::future::Future>::poll
   8: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll
   9: <axum::routing::route::RouteFuture<B,E> as core::future::future::Future>::poll
  10: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  11: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  12: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  13: <tower::util::map_response::MapResponseFuture<F,N> as core::future::future::Future>::poll
  14: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll
  15: <axum::routing::route::RouteFuture<B,E> as core::future::future::Future>::poll
  16: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  17: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  18: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  19: <tower::util::map_response::MapResponseFuture<F,N> as core::future::future::Future>::poll
  20: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll
  21: <axum::routing::route::RouteFuture<B,E> as core::future::future::Future>::poll
  22: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  23: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  24: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  25: <tower::util::map_response::MapResponseFuture<F,N> as core::future::future::Future>::poll
  26: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll
  27: <axum::routing::route::RouteFuture<B,E> as core::future::future::Future>::poll
  28: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  29: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  30: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  31: <tower::util::map_response::MapResponseFuture<F,N> as core::future::future::Future>::poll
  32: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll
  33: <hyper::server::conn::upgrades::UpgradeableConnection<I,S,E> as core::future::future::Future>::poll
  34: <hyper::server::server::new_svc::NewSvcTask<I,N,S,E,W> as core::future::future::Future>::poll
  35: tokio::runtime::task::raw::poll
  36: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  37: tokio::runtime::scheduler::multi_thread::worker::Context::run
  38: tokio::runtime::context::runtime::enter_runtime
  39: tokio::runtime::scheduler::multi_thread::worker::run
  40: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
  41: tokio::runtime::task::core::Core<T,S>::poll
  42: tokio::runtime::task::harness::Harness<T,S>::poll
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


Would really appreciate some advice on this…

2 Likes

You could try asking the person who contributed the feature: sync-server: add option to store hashed passwords by laalsaas · Pull Request #3083 · ankitects/anki · GitHub