diff options
Diffstat (limited to 'src/main/java/com/juick/config')
-rw-r--r-- | src/main/java/com/juick/config/ActivityPubConfig.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/com/juick/config/ActivityPubConfig.java b/src/main/java/com/juick/config/ActivityPubConfig.java index 786e19c4..3570b97d 100644 --- a/src/main/java/com/juick/config/ActivityPubConfig.java +++ b/src/main/java/com/juick/config/ActivityPubConfig.java @@ -24,7 +24,9 @@ import com.juick.util.ActivityPubRequestInterceptor; import com.juick.www.WebApp; import com.juick.www.api.activity.converters.UserToActorConverter; +import com.juick.www.api.activity.helpers.ProfileUriBuilder; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; @@ -45,6 +47,8 @@ public class ActivityPubConfig { KeystoreManager keystoreManager; @Inject WebApp webApp; + @Value("${ap_base_uri:http://localhost:8080/}") + private String baseUri; @Bean MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter() { @@ -80,6 +84,10 @@ public class ActivityPubConfig { @Bean UserToActorConverter userToActorConverter() { - return new UserToActorConverter(activityPubManager(), keystoreManager, webApp); + return new UserToActorConverter(profileUriBuilder(), keystoreManager, webApp); + } + @Bean + ProfileUriBuilder profileUriBuilder() { + return new ProfileUriBuilder(baseUri); } } |