Skip to content

Commit

Permalink
✨ make mastodon instance name configurable closes #11
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Fihlon <[email protected]>
  • Loading branch information
McPringle committed Mar 29, 2024
1 parent a80247c commit a94acdc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
*/
package swiss.fihlon.apus.configuration;

public record Mastodon(String hashtag) { }
public record Mastodon(String instance, String hashtag) { }
2 changes: 1 addition & 1 deletion src/main/java/swiss/fihlon/apus/service/SocialService.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class SocialService {
public SocialService(@NotNull final TaskScheduler taskScheduler,
@NotNull final Configuration configuration) {
hashtag = configuration.getMastodon().hashtag();
mastodonAPI = new MastodonAPI("ijug.social");
mastodonAPI = new MastodonAPI(configuration.getMastodon().instance());
updateMessages();
updateScheduler = taskScheduler.scheduleAtFixedRate(this::updateMessages, UPDATE_FREQUENCY);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"properties": [
"properties" : [
{
"name": "apus.mastodon.hashtag",
"type": "java.lang.String",
"description": "The hashtag for the mastodon wall."
}
] }
"name" : "apus.mastodon.instance",
"type" : "java.lang.String",
"description" : "The Mastodon instance used to read the posts from."
},
{
"name" : "apus.mastodon.hashtag",
"type" : "java.lang.String",
"description" : "The hashtag for the Mastodon wall."
}
] }
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ vaadin.launch-browser=false
vaadin.frontend.hotdeploy=true

apus.version=@project.version@
apus.mastodon.instance=${MASTODON_INSTANCE:mastodon.social}
apus.mastodon.hashtag=${MASTODON_HASHTAG:java}

0 comments on commit a94acdc

Please sign in to comment.