File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
web/src/main/java/dev/booky/stackdeobf/web Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 3636
3737public final class ApiRoutes {
3838
39- private static final String HASTEBIN_API_TOKEN = System .getProperty ("web.hastebin-api-token" );
39+ private static final String HASTEBIN_API_TOKEN ;
40+
41+ static {
42+ // try to resolve via system property; if there is no system property to be found,
43+ // try to resolve via environment variable
44+ String tokenProp = System .getProperty ("web.hastebin-api-token" );
45+ if (tokenProp == null || tokenProp .isBlank ()) {
46+ String tokenEnv = System .getenv ("HASTEBIN_API_TOKEN" );
47+ HASTEBIN_API_TOKEN = tokenEnv == null || tokenEnv .isBlank () ? null : tokenEnv ;
48+ } else {
49+ HASTEBIN_API_TOKEN = tokenProp ;
50+ }
51+ }
4052
4153 private static final Path CACHE_DIR = Path .of (System .getProperty ("mappings.cachedir" , "mappings" ));
4254 private static final String DEFAULT_MAPPINGS_PROVIDER = "yarn" ;
You can’t perform that action at this time.
0 commit comments