diff --git a/src/main/java/dan200/computercraft/shared/Config.java b/src/main/java/dan200/computercraft/shared/Config.java index ffb176c72..cd5840100 100644 --- a/src/main/java/dan200/computercraft/shared/Config.java +++ b/src/main/java/dan200/computercraft/shared/Config.java @@ -54,8 +54,8 @@ public final class Config private static Property httpEnable; private static Property httpWebsocketEnable; - private static Property httpWhitelist; - private static Property httpBlacklist; + private static Property httpAllowedDomains; + private static Property httpBlockedDomains; private static Property httpTimeout; private static Property httpMaxRequests; @@ -163,8 +163,10 @@ public static void load( File configFile ) { // HTTP renameProperty( CATEGORY_GENERAL, "http_enable", CATEGORY_HTTP, "enabled" ); renameProperty( CATEGORY_GENERAL, "http_websocket_enable", CATEGORY_HTTP, "websocket_enabled" ); - renameProperty( CATEGORY_GENERAL, "http_whitelist", CATEGORY_HTTP, "whitelist" ); - renameProperty( CATEGORY_GENERAL, "http_blacklist", CATEGORY_HTTP, "blacklist" ); + renameProperty( CATEGORY_GENERAL, "http_whitelist", CATEGORY_HTTP, "allowed_domains" ); + renameProperty( CATEGORY_GENERAL, "http_blacklist", CATEGORY_HTTP, "blocked_domains" ); + renameProperty( CATEGORY_HTTP, "whitelist", CATEGORY_HTTP, "allowed_domains" ); + renameProperty( CATEGORY_HTTP, "blacklist", CATEGORY_HTTP, "blocked_domains" ); config.getCategory( CATEGORY_HTTP ) .setComment( "Controls the HTTP API" ); @@ -176,15 +178,15 @@ public static void load( File configFile ) httpWebsocketEnable = config.get( CATEGORY_HTTP, "websocket_enabled", ComputerCraft.http_websocket_enable ); httpWebsocketEnable.setComment( "Enable use of http websockets. This requires the \"http_enable\" option to also be true." ); - httpWhitelist = config.get( CATEGORY_HTTP, "whitelist", DEFAULT_HTTP_WHITELIST ); - httpWhitelist.setComment( "A list of wildcards for domains or IP ranges that can be accessed through the " + + httpAllowedDomains = config.get( CATEGORY_HTTP, "allowed_domains", DEFAULT_HTTP_WHITELIST ); + httpAllowedDomains.setComment( "A list of wildcards for domains or IP ranges that can be accessed through the " + "\"http\" API on Computers.\n" + "Set this to \"*\" to access to the entire internet. Example: \"*.pastebin.com\" will restrict access to " + "just subdomains of pastebin.com.\n" + "You can use domain names (\"pastebin.com\"), wilcards (\"*.pastebin.com\") or CIDR notation (\"127.0.0.0/8\")." ); - httpBlacklist = config.get( CATEGORY_HTTP, "blacklist", DEFAULT_HTTP_BLACKLIST ); - httpBlacklist.setComment( "A list of wildcards for domains or IP ranges that cannot be accessed through the " + + httpBlockedDomains = config.get( CATEGORY_HTTP, "blocked_domains", DEFAULT_HTTP_BLACKLIST ); + httpBlockedDomains.setComment( "A list of wildcards for domains or IP ranges that cannot be accessed through the " + "\"http\" API on Computers.\n" + "If this is empty then all whitelisted domains will be accessible. Example: \"*.github.com\" will block " + "access to all subdomains of github.com.\n" + @@ -220,7 +222,7 @@ public static void load( File configFile ) setOrder( CATEGORY_HTTP, - httpEnable, httpWebsocketEnable, httpWhitelist, httpBlacklist, + httpEnable, httpWebsocketEnable, httpAllowedDomains, httpBlockedDomains, httpTimeout, httpMaxRequests, httpMaxDownload, httpMaxUpload, httpMaxWebsockets, httpMaxWebsocketMessage ); } @@ -441,8 +443,8 @@ public static void sync() // HTTP ComputerCraft.http_enable = httpEnable.getBoolean(); ComputerCraft.http_websocket_enable = httpWebsocketEnable.getBoolean(); - ComputerCraft.http_whitelist = new AddressPredicate( httpWhitelist.getStringList() ); - ComputerCraft.http_blacklist = new AddressPredicate( httpBlacklist.getStringList() ); + ComputerCraft.http_whitelist = new AddressPredicate( httpAllowedDomains.getStringList() ); + ComputerCraft.http_blacklist = new AddressPredicate( httpBlockedDomains.getStringList() ); ComputerCraft.httpTimeout = Math.max( 0, httpTimeout.getInt() ); ComputerCraft.httpMaxRequests = Math.max( 1, httpMaxRequests.getInt() ); diff --git a/src/main/resources/assets/computercraft/lang/de_de.lang b/src/main/resources/assets/computercraft/lang/de_de.lang index 7460a071c..6fabe4002 100644 --- a/src/main/resources/assets/computercraft/lang/de_de.lang +++ b/src/main/resources/assets/computercraft/lang/de_de.lang @@ -168,8 +168,8 @@ gui.computercraft:config.execution.max_main_computer_time=Computer Servertick Ze gui.computercraft:config.http=HTTP gui.computercraft:config.http.enabled=HTTP-API aktivieren gui.computercraft:config.http.websocket_enabled=Websockets aktivieren -gui.computercraft:config.http.whitelist=HTTP-Whitelist -gui.computercraft:config.http.blacklist=HTTP-Blacklist +gui.computercraft:config.http.allowed_domains=HTTP-Whitelist +gui.computercraft:config.http.blocked_domains=HTTP-Blacklist gui.computercraft:config.http.timeout=Zeitüberschreitung gui.computercraft:config.http.max_requests=Maximale Anzahl gleichzeitiger Anfragen diff --git a/src/main/resources/assets/computercraft/lang/en_us.lang b/src/main/resources/assets/computercraft/lang/en_us.lang index d00875c37..99cadd868 100644 --- a/src/main/resources/assets/computercraft/lang/en_us.lang +++ b/src/main/resources/assets/computercraft/lang/en_us.lang @@ -168,8 +168,8 @@ gui.computercraft:config.execution.max_main_computer_time=Server tick computer t gui.computercraft:config.http=HTTP gui.computercraft:config.http.enabled=Enable the HTTP API gui.computercraft:config.http.websocket_enabled=Enable websockets -gui.computercraft:config.http.whitelist=HTTP whitelist -gui.computercraft:config.http.blacklist=HTTP blacklist +gui.computercraft:config.http.allowed_domains=Allowed domains +gui.computercraft:config.http.blocked_domains=Blocked domains gui.computercraft:config.http.timeout=Timeout gui.computercraft:config.http.max_requests=Maximum concurrent requests diff --git a/src/main/resources/assets/computercraft/lang/es_es.lang b/src/main/resources/assets/computercraft/lang/es_es.lang index fa2129634..b8c352bb1 100644 --- a/src/main/resources/assets/computercraft/lang/es_es.lang +++ b/src/main/resources/assets/computercraft/lang/es_es.lang @@ -57,8 +57,8 @@ gui.computercraft:config.default_computer_settings=Configuración de Ordenador p gui.computercraft:config.log_computer_errors=Grabar errores periféricos gui.computercraft:config.http.enabled=Habilitar API de HTTP -gui.computercraft:config.http.whitelist=Lista blanca de HTTP -gui.computercraft:config.http.blacklist=Lista negra de HTTP +gui.computercraft:config.http.allowed_domains=Lista blanca de HTTP +gui.computercraft:config.http.blocked_domains=Lista negra de HTTP gui.computercraft:config.peripheral.command_block_enabled=Habilitar bloque de comandos periférico gui.computercraft:config.peripheral.modem_range=Rango del módem (Por defecto) diff --git a/src/main/resources/assets/computercraft/lang/fr_fr.lang b/src/main/resources/assets/computercraft/lang/fr_fr.lang index e1f151235..b21567e47 100644 --- a/src/main/resources/assets/computercraft/lang/fr_fr.lang +++ b/src/main/resources/assets/computercraft/lang/fr_fr.lang @@ -57,8 +57,8 @@ gui.computercraft:config.default_computer_settings=Configuration d'Ordinateur pa gui.computercraft:config.log_computer_errors=Journal d'erreur périphériques gui.computercraft:config.http.enabled=Permettre l'API HTTP -gui.computercraft:config.http.whitelist=HTTP liste blanche -gui.computercraft:config.http.blacklist=HTTP liste noire +gui.computercraft:config.http.allowed_domains=HTTP liste blanche +gui.computercraft:config.http.blocked_domains=HTTP liste noire gui.computercraft:config.peripheral.command_block_enabled=Permettre l'accès d'un Bloc de Commande par périphérique gui.computercraft:config.peripheral.modem_range=Portée d'un Modem (par défaut) diff --git a/src/main/resources/assets/computercraft/lang/it_it.lang b/src/main/resources/assets/computercraft/lang/it_it.lang index 6be7df879..931118f9c 100644 --- a/src/main/resources/assets/computercraft/lang/it_it.lang +++ b/src/main/resources/assets/computercraft/lang/it_it.lang @@ -63,8 +63,8 @@ gui.computercraft:config.execution.computer_threads=Threads computer gui.computercraft:config.http=HTTP gui.computercraft:config.http.enabled=Attiva l'API HTTP gui.computercraft:config.http.websocket_enabled=Attiva websocket -gui.computercraft:config.http.whitelist=Lista bianca HTTP -gui.computercraft:config.http.blacklist=Lista nera HTTP +gui.computercraft:config.http.allowed_domains=Lista bianca HTTP +gui.computercraft:config.http.blocked_domains=Lista nera HTTP gui.computercraft:config.http.timeout=Tempo di scadenza gui.computercraft:config.http.max_requests=Richieste correnti massime diff --git a/src/main/resources/assets/computercraft/lang/pt_br.lang b/src/main/resources/assets/computercraft/lang/pt_br.lang index d9706ffa5..2cf77ebf5 100644 --- a/src/main/resources/assets/computercraft/lang/pt_br.lang +++ b/src/main/resources/assets/computercraft/lang/pt_br.lang @@ -63,8 +63,8 @@ gui.computercraft:config.execution.computer_threads=Threads por computador gui.computercraft:config.http=HTTP gui.computercraft:config.http.enabled=Habilitar a biblioteca de HTTP gui.computercraft:config.http.websocket_enabled=Habilitar websockets -gui.computercraft:config.http.whitelist=Lista de endereços autorizados -gui.computercraft:config.http.blacklist=Lista de endereços proíbidos +gui.computercraft:config.http.allowed_domains=Lista de endereços autorizados +gui.computercraft:config.http.blocked_domains=Lista de endereços proíbidos gui.computercraft:config.http.timeout=Tempo limite para conexões gui.computercraft:config.http.max_requests=Limite de conexões paralelas diff --git a/src/main/resources/assets/computercraft/lang/sv_se.lang b/src/main/resources/assets/computercraft/lang/sv_se.lang index ad4dc0ceb..b90379225 100644 --- a/src/main/resources/assets/computercraft/lang/sv_se.lang +++ b/src/main/resources/assets/computercraft/lang/sv_se.lang @@ -63,8 +63,8 @@ gui.computercraft:config.execution.computer_threads=Dator trådar gui.computercraft:config.http=HTTP gui.computercraft:config.http.enabled=Aktivera HTTP API gui.computercraft:config.http.websocket_enabled=Aktivera websockets -gui.computercraft:config.http.whitelist=HTTP vitlista -gui.computercraft:config.http.blacklist=HTTP svartlista +gui.computercraft:config.http.allowed_domains=HTTP vitlista +gui.computercraft:config.http.blocked_domains=HTTP svartlista gui.computercraft:config.http.timeout=Timeout gui.computercraft:config.http.max_requests=Maximalt antal samgående förfrågningar diff --git a/src/main/resources/assets/computercraft/lang/zh_cn.lang b/src/main/resources/assets/computercraft/lang/zh_cn.lang index 56b9aa106..86c43c33f 100644 --- a/src/main/resources/assets/computercraft/lang/zh_cn.lang +++ b/src/main/resources/assets/computercraft/lang/zh_cn.lang @@ -168,8 +168,8 @@ gui.computercraft:config.execution.max_main_computer_time=服务器计算机tick gui.computercraft:config.http=HTTP gui.computercraft:config.http.enabled=启用HTTP API gui.computercraft:config.http.websocket_enabled=启用websockets -gui.computercraft:config.http.whitelist=HTTP白名单 -gui.computercraft:config.http.blacklist=HTTP黑名单 +gui.computercraft:config.http.allowed_domains=HTTP白名单 +gui.computercraft:config.http.blocked_domains=HTTP黑名单 gui.computercraft:config.http.timeout=Timeout gui.computercraft:config.http.max_requests=最大并发请求数