From c6bc69cee51066ae2f153208bd995d43637223c9 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 26 Feb 2018 11:25:44 +0300 Subject: cleanup hardcoded juick paths --- juick-server/src/main/java/com/juick/server/TelegramBotManager.java | 2 +- juick-server/src/main/java/com/juick/server/XMPPConnection.java | 2 +- juick-server/src/main/java/com/juick/server/api/Post.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'juick-server/src/main/java/com/juick') diff --git a/juick-server/src/main/java/com/juick/server/TelegramBotManager.java b/juick-server/src/main/java/com/juick/server/TelegramBotManager.java index b264d080..697f6dd1 100644 --- a/juick-server/src/main/java/com/juick/server/TelegramBotManager.java +++ b/juick-server/src/main/java/com/juick/server/TelegramBotManager.java @@ -82,7 +82,7 @@ public class TelegramBotManager implements ApplicationListener { private UserService userService; @Inject private ServerManager serverManager; - @Value("${upload_tmp_dir:/var/www/juick.com/i/tmp/}") + @Value("${upload_tmp_dir:#{systemEnvironment['TEMP'] ?: '/tmp'}}") private String tmpDir; private static final String MSG_LINK = "🔗"; diff --git a/juick-server/src/main/java/com/juick/server/XMPPConnection.java b/juick-server/src/main/java/com/juick/server/XMPPConnection.java index 967f5c47..ae7ba252 100644 --- a/juick-server/src/main/java/com/juick/server/XMPPConnection.java +++ b/juick-server/src/main/java/com/juick/server/XMPPConnection.java @@ -88,7 +88,7 @@ public class XMPPConnection implements AutoCloseable { private int componentPort; @Value("${xmpp_password:secret}") private String password; - @Value("${upload_tmp_dir:/tmp}") + @Value("${upload_tmp_dir:#{systemEnvironment['TEMP'] ?: '/tmp'}}") private String tmpDir; @Inject diff --git a/juick-server/src/main/java/com/juick/server/api/Post.java b/juick-server/src/main/java/com/juick/server/api/Post.java index 8e11089b..cb2476c7 100644 --- a/juick-server/src/main/java/com/juick/server/api/Post.java +++ b/juick-server/src/main/java/com/juick/server/api/Post.java @@ -71,9 +71,9 @@ public class Post { private MessagesService messagesService; @Inject private SubscriptionService subscriptionService; - @Value("${upload_tmp_dir:/var/www/juick.com/i/tmp/}") + @Value("${upload_tmp_dir:#{systemEnvironment['TEMP'] ?: '/tmp'}}") private String tmpDir; - @Value("${img_path:/var/www/juick.com/i/}") + @Value("${img_path:#{systemEnvironment['TEMP'] ?: '/tmp'}}") private String imgDir; @RequestMapping(value = "/post", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) -- cgit v1.2.3