mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-12-05 06:41:46 +00:00
chore: No Auth Media, No UnAuth Profiles
This commit is contained in:
1 parent
c1d48c6f46
commit
ff7d67ad70
3 files changed
+3
-27
No files matched your search
@@ -813,18 +813,6 @@
|
|||||||
# env: CONTINUWUITY_FORGET_FORCED_UPON_LEAVE
|
# env: CONTINUWUITY_FORGET_FORCED_UPON_LEAVE
|
||||||
#forget_forced_upon_leave = false
|
#forget_forced_upon_leave = false
|
||||||
|
|
||||||
# Set this to true to require authentication when looking up user profiles
|
|
||||||
# through this server.
|
|
||||||
#
|
|
||||||
# By default this is false, allowing tools such as matrix.to to access
|
|
||||||
# profiles of users on this server and on other servers.
|
|
||||||
# Setting this to true will block those tools, and may block automated
|
|
||||||
# crawlers from scraping users' profiles, although it will not block
|
|
||||||
# other homeservers from accessing users' profiles.
|
|
||||||
#
|
|
||||||
# env: CONTINUWUITY_REQUIRE_AUTH_FOR_PROFILE_REQUESTS
|
|
||||||
#require_auth_for_profile_requests = false
|
|
||||||
|
|
||||||
# Set this to true to require authentication to create a rendezvous
|
# Set this to true to require authentication to create a rendezvous
|
||||||
# session. Rendezvous sessions are used for QR code login.
|
# session. Rendezvous sessions are used for QR code login.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ pub(crate) async fn get_profile_route(
|
|||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
body: Ruma<get_profile::v3::Request>,
|
body: Ruma<get_profile::v3::Request>,
|
||||||
) -> Result<get_profile::v3::Response> {
|
) -> Result<get_profile::v3::Response> {
|
||||||
if services.config.require_auth_for_profile_requests && body.identity.is_none() {
|
if body.identity.is_none() {
|
||||||
return Err!(Request(Unauthorized(
|
return Err!(Request(Unauthorized(
|
||||||
"This server requires authentication to access user profiles."
|
"This server requires authentication to access user profiles."
|
||||||
)));
|
)));
|
||||||
@@ -46,7 +46,7 @@ pub(crate) async fn get_profile_field_route(
|
|||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
body: Ruma<get_profile_field::v3::Request>,
|
body: Ruma<get_profile_field::v3::Request>,
|
||||||
) -> Result<get_profile_field::v3::Response> {
|
) -> Result<get_profile_field::v3::Response> {
|
||||||
if services.config.require_auth_for_profile_requests && body.identity.is_none() {
|
if body.identity.is_none() {
|
||||||
return Err!(Request(Unauthorized(
|
return Err!(Request(Unauthorized(
|
||||||
"This server requires authentication to access user profiles."
|
"This server requires authentication to access user profiles."
|
||||||
)));
|
)));
|
||||||
|
|||||||
+1
-13
@@ -920,19 +920,6 @@ pub struct Config {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub forget_forced_upon_leave: bool,
|
pub forget_forced_upon_leave: bool,
|
||||||
|
|
||||||
/// Set this to true to require authentication when looking up user profiles
|
|
||||||
/// through this server.
|
|
||||||
///
|
|
||||||
/// By default this is false, allowing tools such as matrix.to to access
|
|
||||||
/// profiles of users on this server and on other servers.
|
|
||||||
/// Setting this to true will block those tools, and may block automated
|
|
||||||
/// crawlers from scraping users' profiles, although it will not block
|
|
||||||
/// other homeservers from accessing users' profiles.
|
|
||||||
///
|
|
||||||
/// default: false
|
|
||||||
#[serde(default)]
|
|
||||||
pub require_auth_for_profile_requests: bool,
|
|
||||||
|
|
||||||
/// Set this to true to require authentication to create a rendezvous
|
/// Set this to true to require authentication to create a rendezvous
|
||||||
/// session. Rendezvous sessions are used for QR code login.
|
/// session. Rendezvous sessions are used for QR code login.
|
||||||
///
|
///
|
||||||
@@ -3001,6 +2988,7 @@ const DEPRECATED_KEYS: &[&str] = &[
|
|||||||
"max_concurrent_requests",
|
"max_concurrent_requests",
|
||||||
"otlp_protocol",
|
"otlp_protocol",
|
||||||
"request_ip_source",
|
"request_ip_source",
|
||||||
|
"require_auth_for_profile_requests",
|
||||||
"roomid_spacehierarchy_cache_capacity",
|
"roomid_spacehierarchy_cache_capacity",
|
||||||
"unredacted_content_max_age_secs",
|
"unredacted_content_max_age_secs",
|
||||||
"well_known_client",
|
"well_known_client",
|
||||||
|
|||||||
Reference in new issue
Block a user