diff --git a/.gemini b/.gemini
deleted file mode 120000
index 9b617313..00000000
--- a/.gemini
+++ /dev/null
@@ -1 +0,0 @@
-.agent
\ No newline at end of file
diff --git a/cmd/agent/main.go b/cmd/agent/main.go
index dec1cb3a..6070a3bd 100644
--- a/cmd/agent/main.go
+++ b/cmd/agent/main.go
@@ -1,3 +1,4 @@
+// Command agent runs the OpenFlare edge agent daemon.
package main
import (
@@ -95,8 +96,8 @@ func main() {
heartbeatService := heartbeat.New(client)
updateService := updater.New()
runner := &agent.Runner{
- Config: cfg,
- StateStore: stateStore,
+ Config: cfg,
+ StateStore: stateStore,
HeartbeatCycle: &heartbeat.Cycle{
Config: cfg,
StateStore: stateStore,
@@ -112,7 +113,6 @@ func main() {
}
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
- defer stop()
geoIPUpdater := &geoipupdate.Updater{
MMDBPath: cfg.MMDBPath,
DownloadURL: cfg.MMDBDownloadURL,
@@ -123,7 +123,9 @@ func main() {
if err = runner.Run(ctx); err != nil && err != context.Canceled {
slog.Error("agent process exited with error", "error", err)
+ stop()
os.Exit(1)
}
+ stop()
slog.Info("agent process stopped")
}
diff --git a/cmd/flared/main.go b/cmd/flared/main.go
index bfc4d9df..679d1132 100644
--- a/cmd/flared/main.go
+++ b/cmd/flared/main.go
@@ -1,3 +1,4 @@
+// Command flared runs the OpenFlare tunnel client daemon.
package main
import (
@@ -41,7 +42,7 @@ func main() {
frpcManager := frpc.NewManager(cfg)
_ = frpcManager.LoadState()
- slog.Info("detected frpc version", "version", frpcManager.GetVersion())
+ slog.Info("detected frpc version", "version", frpcManager.GetVersion(context.Background()))
httpClient := httpclient.New(cfg.ServerURL, cfg.InitialAuthToken(), cfg.RequestTimeout.Duration())
wsClient := wsclient.New(cfg.ServerURL, cfg.InitialAuthToken(), cfg.RequestTimeout.Duration())
@@ -52,20 +53,21 @@ func main() {
runner := &flared.Runner{
Config: cfg,
FrpcManager: frpcManager,
- HttpClient: httpClient,
+ HTTPClient: httpClient,
WebSocketService: wsClient,
HeartbeatService: heartbeatService,
SyncService: syncService,
}
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
- defer stop()
slog.Info("flared process started")
if err := runner.Run(ctx); err != nil && err != context.Canceled {
slog.Error("flared process exited with error", "error", err)
+ stop()
os.Exit(1)
}
+ stop()
slog.Info("flared process stopped")
}
diff --git a/cmd/relay/main.go b/cmd/relay/main.go
index 1bc24321..083aba2a 100644
--- a/cmd/relay/main.go
+++ b/cmd/relay/main.go
@@ -1,3 +1,4 @@
+// Command relay runs the OpenFlare relay node daemon.
package main
import (
@@ -44,7 +45,7 @@ func main() {
frpsManager := frps.NewManager(cfg.FrpsPath, cfg.DataDir, cfg.InitialAuthToken())
- slog.Info("detected frps version", "version", frpsManager.GetVersion())
+ slog.Info("detected frps version", "version", frpsManager.GetVersion(context.Background()))
httpClient := httpclient.New(cfg.ServerURL, cfg.InitialAuthToken(), cfg.RequestTimeout.Duration())
wsClient := wsclient.New(cfg.ServerURL, cfg.InitialAuthToken(), cfg.RequestTimeout.Duration())
@@ -53,19 +54,20 @@ func main() {
Config: cfg,
StateStore: stateStore,
FrpsManager: frpsManager,
- HttpClient: httpClient,
+ HTTPClient: httpClient,
WebSocketService: wsClient,
HeartbeatService: heartbeat.New(httpClient, frpsManager, cfg, stateStore),
}
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
- defer stop()
slog.Info("relay process started")
if err := runner.Run(ctx); err != nil && err != context.Canceled {
slog.Error("relay process exited with error", "error", err)
+ stop()
os.Exit(1)
}
+ stop()
slog.Info("relay process stopped")
}
diff --git a/data/agent/etc/nginx/conf.d/openflare_routes.conf b/data/agent/etc/nginx/conf.d/openflare_routes.conf
deleted file mode 100644
index 7f9a5cda..00000000
--- a/data/agent/etc/nginx/conf.d/openflare_routes.conf
+++ /dev/null
@@ -1,25 +0,0 @@
-# This file is generated by OpenFlare. Do not edit manually.
-upstream backend_local_1 {
- server flare.arctel.net:443 max_fails=3 fail_timeout=10s;
- keepalive 128;
-}
-
-server {
- listen 80;
- server_name a.com;
- set $openflare_waf_site "local";
- access_by_lua_file /data/etc/nginx/lua/waf/check.lua;
- location / {
- proxy_set_header Host $host;
- proxy_ssl_server_name on;
- proxy_ssl_name "flare.arctel.net";
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_http_version 1.1;
- proxy_set_header Connection $connection_upgrade;
- proxy_set_header Upgrade $http_upgrade;
- proxy_pass https://backend_local_1;
- }
-}
-
diff --git a/data/agent/etc/nginx/lua/init.lua b/data/agent/etc/nginx/lua/init.lua
deleted file mode 100644
index cdb98000..00000000
--- a/data/agent/etc/nginx/lua/init.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-local dict = ngx.shared.openflare_observability
-if not dict then
- return
-end
-
-return
diff --git a/data/agent/etc/nginx/lua/log.lua b/data/agent/etc/nginx/lua/log.lua
deleted file mode 100644
index 20daf1a1..00000000
--- a/data/agent/etc/nginx/lua/log.lua
+++ /dev/null
@@ -1,82 +0,0 @@
-local dict = ngx.shared.openflare_observability
-if not dict then
- return
-end
-
-local request_uri = tostring(ngx.var.uri or "")
-if request_uri == "/openflare/observability" or request_uri == "/openflare/stub_status" then
- return
-end
-
-local ttl = 7200
-local now = ngx.time()
-local window_size = 60
-local window_start = now - (now % window_size)
-
-local function ensure_counter(key)
- dict:add(key, 0, ttl)
-end
-
-local function incr(key, delta)
- ensure_counter(key)
- local value, err = dict:incr(key, delta)
- if not value and err == "not found" then
- dict:set(key, delta, ttl)
- end
-end
-
-local function remember_value(list_key, marker_key, value)
- if value == "" then
- return
- end
- if not dict:add(marker_key, 1, ttl) then
- return
- end
- local existing = dict:get(list_key)
- if not existing or existing == "" then
- dict:set(list_key, value, ttl)
- return
- end
- dict:set(list_key, existing .. "\n" .. value, ttl)
-end
-
-local window_prefix = tostring(window_start)
-incr("request_count:" .. window_prefix, 1)
-
-local status = tostring(ngx.status or 0)
-if status ~= "0" then
- incr("status:" .. window_prefix .. ":" .. status, 1)
- remember_value(
- "status_keys:" .. window_prefix,
- "status_marker:" .. window_prefix .. ":" .. status,
- status
- )
- if tonumber(status) and tonumber(status) >= 500 then
- incr("error_count:" .. window_prefix, 1)
- end
-end
-
-local host = tostring(ngx.var.host or "")
-if host ~= "" then
- incr("domain:" .. window_prefix .. ":" .. host, 1)
- remember_value(
- "domain_keys:" .. window_prefix,
- "domain_marker:" .. window_prefix .. ":" .. host,
- host
- )
-end
-
-local remote_addr = tostring(ngx.var.binary_remote_addr or ngx.var.remote_addr or "")
-if remote_addr ~= "" and dict:add("visitor:" .. window_prefix .. ":" .. remote_addr, 1, ttl) then
- incr("unique_visitor_count:" .. window_prefix, 1)
-end
-
-local request_length = tonumber(ngx.var.request_length) or 0
-if request_length > 0 then
- incr("openresty_rx_bytes:" .. window_prefix, request_length)
-end
-
-local bytes_sent = tonumber(ngx.var.bytes_sent) or tonumber(ngx.var.body_bytes_sent) or 0
-if bytes_sent > 0 then
- incr("openresty_tx_bytes:" .. window_prefix, bytes_sent)
-end
diff --git a/data/agent/etc/nginx/lua/observability/init.lua b/data/agent/etc/nginx/lua/observability/init.lua
deleted file mode 100644
index cdb98000..00000000
--- a/data/agent/etc/nginx/lua/observability/init.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-local dict = ngx.shared.openflare_observability
-if not dict then
- return
-end
-
-return
diff --git a/data/agent/etc/nginx/lua/observability/log.lua b/data/agent/etc/nginx/lua/observability/log.lua
deleted file mode 100644
index 20daf1a1..00000000
--- a/data/agent/etc/nginx/lua/observability/log.lua
+++ /dev/null
@@ -1,82 +0,0 @@
-local dict = ngx.shared.openflare_observability
-if not dict then
- return
-end
-
-local request_uri = tostring(ngx.var.uri or "")
-if request_uri == "/openflare/observability" or request_uri == "/openflare/stub_status" then
- return
-end
-
-local ttl = 7200
-local now = ngx.time()
-local window_size = 60
-local window_start = now - (now % window_size)
-
-local function ensure_counter(key)
- dict:add(key, 0, ttl)
-end
-
-local function incr(key, delta)
- ensure_counter(key)
- local value, err = dict:incr(key, delta)
- if not value and err == "not found" then
- dict:set(key, delta, ttl)
- end
-end
-
-local function remember_value(list_key, marker_key, value)
- if value == "" then
- return
- end
- if not dict:add(marker_key, 1, ttl) then
- return
- end
- local existing = dict:get(list_key)
- if not existing or existing == "" then
- dict:set(list_key, value, ttl)
- return
- end
- dict:set(list_key, existing .. "\n" .. value, ttl)
-end
-
-local window_prefix = tostring(window_start)
-incr("request_count:" .. window_prefix, 1)
-
-local status = tostring(ngx.status or 0)
-if status ~= "0" then
- incr("status:" .. window_prefix .. ":" .. status, 1)
- remember_value(
- "status_keys:" .. window_prefix,
- "status_marker:" .. window_prefix .. ":" .. status,
- status
- )
- if tonumber(status) and tonumber(status) >= 500 then
- incr("error_count:" .. window_prefix, 1)
- end
-end
-
-local host = tostring(ngx.var.host or "")
-if host ~= "" then
- incr("domain:" .. window_prefix .. ":" .. host, 1)
- remember_value(
- "domain_keys:" .. window_prefix,
- "domain_marker:" .. window_prefix .. ":" .. host,
- host
- )
-end
-
-local remote_addr = tostring(ngx.var.binary_remote_addr or ngx.var.remote_addr or "")
-if remote_addr ~= "" and dict:add("visitor:" .. window_prefix .. ":" .. remote_addr, 1, ttl) then
- incr("unique_visitor_count:" .. window_prefix, 1)
-end
-
-local request_length = tonumber(ngx.var.request_length) or 0
-if request_length > 0 then
- incr("openresty_rx_bytes:" .. window_prefix, request_length)
-end
-
-local bytes_sent = tonumber(ngx.var.bytes_sent) or tonumber(ngx.var.body_bytes_sent) or 0
-if bytes_sent > 0 then
- incr("openresty_tx_bytes:" .. window_prefix, bytes_sent)
-end
diff --git a/data/agent/etc/nginx/lua/observability/read.lua b/data/agent/etc/nginx/lua/observability/read.lua
deleted file mode 100644
index fe15ecc4..00000000
--- a/data/agent/etc/nginx/lua/observability/read.lua
+++ /dev/null
@@ -1,45 +0,0 @@
-local cjson = require "cjson.safe"
-
-local dict = ngx.shared.openflare_observability
-if not dict then
- ngx.status = ngx.HTTP_SERVICE_UNAVAILABLE
- ngx.say(cjson.encode({ message = "shared dict unavailable" }))
- return
-end
-
-local now = ngx.time()
-local window_size = 60
-local window_start = now - (now % window_size)
-local current_window = tostring(window_start)
-
-local function read_counter(key)
- return tonumber(dict:get(key) or 0) or 0
-end
-
-local function read_map(window_id, prefix, list_key)
- local result = {}
- local raw = dict:get(list_key .. ":" .. window_id)
- if not raw or raw == "" then
- return result
- end
- for value in string.gmatch(raw, "[^\n]+") do
- result[value] = read_counter(prefix .. ":" .. window_id .. ":" .. value)
- end
- return result
-end
-
-local payload = {
- window_started_at_unix = window_start,
- window_ended_at_unix = now,
- request_count = read_counter("request_count:" .. current_window),
- error_count = read_counter("error_count:" .. current_window),
- unique_visitor_count = read_counter("unique_visitor_count:" .. current_window),
- status_codes = read_map(current_window, "status", "status_keys"),
- top_domains = read_map(current_window, "domain", "domain_keys"),
- source_countries = {},
- openresty_rx_bytes = read_counter("openresty_rx_bytes:" .. current_window),
- openresty_tx_bytes = read_counter("openresty_tx_bytes:" .. current_window)
-}
-
-ngx.header.content_type = "application/json"
-ngx.say(cjson.encode(payload))
diff --git a/data/agent/etc/nginx/lua/pow/challenge.lua b/data/agent/etc/nginx/lua/pow/challenge.lua
deleted file mode 100644
index c793c6f1..00000000
--- a/data/agent/etc/nginx/lua/pow/challenge.lua
+++ /dev/null
@@ -1,134 +0,0 @@
-local cjson = require "cjson.safe"
-
-local pow_config_dict = ngx.shared.openflare_pow_config
-local pow_challenges = ngx.shared.openflare_pow_challenges
-
-local function generate_entropy()
- local pieces = {
- tostring(ngx.now()),
- tostring(ngx.worker.pid()),
- tostring(math.random()),
- ngx.var.remote_addr or "",
- ngx.var.http_user_agent or "",
- ngx.var.request_id or "",
- }
- return table.concat(pieces, ":")
-end
-
-local args = ngx.req.get_uri_args()
-local host = args["host"] or ngx.var.host or ""
-local redir = args["redir"] or ""
-
-local site = ngx.var.openflare_waf_site or ""
-if site == "" then
- site = host
-end
-
-local config_raw = pow_config_dict:get(site)
-if not config_raw then
- ngx.status = 403
- ngx.say("PoW not configured for this site")
- return
-end
-
-local ok, route_config = pcall(cjson.decode, config_raw)
-if not ok or not route_config or not route_config.enabled then
- ngx.status = 403
- ngx.say("PoW not enabled for this site")
- return
-end
-
-local config = route_config.config or {}
-local difficulty = config.difficulty or 4
-local algorithm = config.algorithm or "fast"
-local challenge_ttl = config.challenge_ttl or 300
-local session_ttl = config.session_ttl or 600
-
--- Generate challenge data without depending on ngx.random_bytes, which is not
--- available in every OpenResty runtime build.
-local entropy = generate_entropy()
-local challenge_id = ngx.md5(entropy .. ":id")
-local challenge_data = ngx.md5(entropy .. ":data-a") .. ngx.md5(entropy .. ":data-b")
-
--- Store challenge
-local challenge_info = cjson.encode({
- data = challenge_data,
- difficulty = difficulty,
- host = host,
- redir = redir,
- session_ttl = session_ttl
-})
-pow_challenges:set(challenge_id, challenge_info, challenge_ttl)
-
-local static_prefix = "/.within.website/x/cmd/anubis/static/"
-local accept_lang = ngx.var.http_accept_language or ""
-local lang = "en"
-if string.find(accept_lang, "zh") then
- lang = "zh-CN"
-end
-
-local t_title = "Making sure you're not a bot!"
-local t_status = "Loading..."
-local t_protected = "This site is protected by a Proof-of-Work challenge. Your browser will solve a small puzzle before the upstream response is shown."
-local t_why = "Why am I seeing this?"
-local t_why_desc = "OpenFlare is asking your browser to complete a lightweight computation to distinguish normal browser traffic from automated abuse. This should finish automatically."
-local t_noscript = "JavaScript is required to pass this verification. Please enable JavaScript and reload."
-
-if lang == "zh-CN" then
- t_title = "正在确认你是不是机器人!"
- t_status = "加载中..."
- t_protected = "本网站受工作量证明(Proof-of-Work)挑战保护。在显示源站响应之前,您的浏览器将解决一个微型谜题。"
- t_why = "为什么我会看到这个?"
- t_why_desc = "OpenFlare 正在要求您的浏览器完成一项轻量级计算,以区分正常的浏览器流量和自动化的恶意请求。这应该会自动完成。"
- t_noscript = "很遗憾,您必须启用 JavaScript 才能通过这项验证。请开启 JavaScript 并刷新页面。"
-end
-
-ngx.header.content_type = "text/html; charset=utf-8"
-ngx.say([[
-
-
-
-
-
-]] .. t_title .. [[
-
-
-
-
-
-
-
-
-
-
]] .. t_title .. [[
-
-
-
]] .. t_status .. [[
-
]] .. t_protected .. [[
-
-
-]] .. t_why .. [[
-
]] .. t_why_desc .. [[
-
-
-
-
-
-
-]])
diff --git a/data/agent/etc/nginx/lua/pow/check.lua b/data/agent/etc/nginx/lua/pow/check.lua
deleted file mode 100644
index 02c45284..00000000
--- a/data/agent/etc/nginx/lua/pow/check.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-local source = debug.getinfo(1, "S").source or ""
-if string.sub(source, 1, 1) == "@" then
- local script_path = string.sub(source, 2)
- local base_dir = string.match(script_path, "^(.*)/pow/[^/]+%.lua$")
- if base_dir and base_dir ~= "" and not string.find(package.path, base_dir, 1, true) then
- package.path = base_dir .. "/?.lua;" .. base_dir .. "/?/init.lua;" .. package.path
- end
-end
-
-return require("pow.runtime").check()
diff --git a/data/agent/etc/nginx/lua/pow/policy.lua b/data/agent/etc/nginx/lua/pow/policy.lua
deleted file mode 100644
index 9da25854..00000000
--- a/data/agent/etc/nginx/lua/pow/policy.lua
+++ /dev/null
@@ -1,94 +0,0 @@
-local M = {}
-
-local function match_ip(remote_ip, ips)
- if not ips or #ips == 0 then return false end
- for _, ip in ipairs(ips) do
- if ip == remote_ip then
- return true
- end
- end
- return false
-end
-
-local function match_cidr(remote_ip, cidrs)
- if not cidrs or #cidrs == 0 then return false end
- for _, cidr in ipairs(cidrs) do
- local m, err = ngx.re.match(cidr, "^(\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3})/(\\\\d{1,2})$")
- if m then
- local mask_bits = tonumber(m[2])
- if mask_bits and mask_bits >= 0 and mask_bits <= 32 then
- local function ip_to_num(ip_str)
- local parts = {}
- for part in string.gmatch(ip_str, "%d+") do
- parts[#parts+1] = tonumber(part) or 0
- end
- if #parts ~= 4 then return 0 end
- return parts[1]*16777216 + parts[2]*65536 + parts[3]*256 + parts[4]
- end
- local remote_num = ip_to_num(remote_ip)
- local net_num = ip_to_num(m[1])
- if mask_bits == 0 then
- return true
- end
- local mask = math.floor(2^(32 - mask_bits))
- mask = 4294967296 - mask
- if bit.band(remote_num, mask) == bit.band(net_num, mask) then
- return true
- end
- end
- end
- end
- return false
-end
-
-local function match_path(uri, patterns)
- if not patterns or #patterns == 0 then return false end
- for _, pattern in ipairs(patterns) do
- local ok, match = pcall(ngx.re.match, uri, "^" .. ngx.re.gsub(pattern, "([%^%$%(%)%%%.%[%]%+%-%?])", function(c)
- if c == "*" then return ".*" end
- return "%" .. c
- end) .. "$", "i")
- if ok and match then
- return true
- end
- end
- return false
-end
-
-local function match_path_regex(uri, patterns)
- if not patterns or #patterns == 0 then return false end
- for _, pattern in ipairs(patterns) do
- local ok, match = pcall(ngx.re.match, uri, pattern)
- if ok and match then
- return true
- end
- end
- return false
-end
-
-local function match_ua(ua, patterns)
- if not patterns or #patterns == 0 then return false end
- for _, pattern in ipairs(patterns) do
- if ua and string.find(ua, pattern, 1, true) then
- return true
- end
- end
- return false
-end
-
-function M.match_any(remote_ip, ua, uri, list)
- if not list then return false end
- if match_ip(remote_ip, list.ips) then return true end
- if match_cidr(remote_ip, list.ip_cidrs) then return true end
- if match_path(uri, list.paths) then return true end
- if match_path_regex(uri, list.path_regexes) then return true end
- if match_ua(ua, list.user_agents) then return true end
- return false
-end
-
-function M.has_entries(list)
- if not list then return false end
- return (#(list.ips or {}) + #(list.ip_cidrs or {}) + #(list.paths or {}) + #(list.path_regexes or {}) + #(list.user_agents or {})) > 0
-end
-
-return M
diff --git a/data/agent/etc/nginx/lua/pow/runtime.lua b/data/agent/etc/nginx/lua/pow/runtime.lua
deleted file mode 100644
index 20817c7e..00000000
--- a/data/agent/etc/nginx/lua/pow/runtime.lua
+++ /dev/null
@@ -1,182 +0,0 @@
-local _M = {}
-
-function _M.check()
-local source = debug.getinfo(1, "S").source or ""
-if string.sub(source, 1, 1) == "@" then
- local script_path = string.sub(source, 2)
- local base_dir = string.match(script_path, "^(.*)/pow/[^/]+%.lua$")
- if base_dir and base_dir ~= "" and not string.find(package.path, base_dir, 1, true) then
- package.path = base_dir .. "/?.lua;" .. base_dir .. "/?/init.lua;" .. package.path
- end
-end
-
-local cjson = require "cjson.safe"
-local policy = require "pow.policy"
-
-local pow_config_dict = ngx.shared.openflare_pow_config
-local pow_sessions = ngx.shared.openflare_pow_sessions
-
-local function session_cookie(value, ttl)
- local cookie = "__openflare_pow=" .. value .. "; Path=/; HttpOnly; SameSite=Lax; Max-Age=" .. tostring(ttl)
- if ngx.var.scheme == "https" then
- cookie = cookie .. "; Secure"
- end
- return cookie
-end
-
--- Lazy-load pow_config from file; reload when content changes
-local function load_pow_config()
- local config_paths = {
- "/data/etc/openflare/waf_config.json",
- "/etc/nginx/openflare-lua/waf_config.json",
- "/usr/local/openresty/nginx/conf/waf_config.json"
- }
- for _, config_path in ipairs(config_paths) do
- local f = io.open(config_path, "r")
- if f then
- local content = f:read("*a")
- f:close()
- local current_hash = ngx.md5(content or "")
-
- if current_hash == pow_config_dict:get("_config_hash") then
- return
- end
-
- -- Clear old domain/site entries
- local old_keys = pow_config_dict:get("_domain_keys")
- if old_keys then
- for domain in string.gmatch(old_keys, "[^\n]+") do
- pow_config_dict:delete(domain)
- end
- end
-
- local domain_keys = {}
- if content and content ~= "" and content ~= "{}" then
- local ok, decoded = pcall(cjson.decode, content)
- if ok and decoded and decoded.rule_groups and decoded.site_rule_groups then
- -- Build rule groups map (group ID -> PoWConfig)
- local groups = {}
- for _, group in ipairs(decoded.rule_groups) do
- if group.pow_enabled then
- groups[tostring(group.id)] = group.pow_config
- end
- end
- -- Build site name to pow_config map
- for site, group_ids in pairs(decoded.site_rule_groups) do
- local pow_config = nil
- -- Check custom group IDs first
- for _, id in ipairs(group_ids) do
- pow_config = groups[tostring(id)]
- if pow_config then
- break
- end
- end
- -- If not found, check global group IDs
- if not pow_config then
- for _, group in ipairs(decoded.rule_groups) do
- if group.is_global and group.pow_enabled then
- pow_config = group.pow_config
- break
- end
- end
- end
- if pow_config then
- pow_config_dict:set(site, cjson.encode({enabled = true, config = pow_config}), 0)
- domain_keys[#domain_keys+1] = site
- end
- end
- end
- end
-
- pow_config_dict:set("_domain_keys", table.concat(domain_keys, "\n"), 0)
- pow_config_dict:set("_config_hash", current_hash, 0)
- return
- end
- end
-end
-
-load_pow_config()
-
-local host = ngx.var.host
-if not host or host == "" then
- return
-end
-
-local site = ngx.var.openflare_waf_site or ""
-if site == "" then
- site = host
-end
-
-local config_raw = pow_config_dict:get(site)
-if not config_raw then
- return
-end
-
-local ok, route_config = pcall(cjson.decode, config_raw)
-if not ok or not route_config then
- return
-end
-
-if not route_config.enabled then
- return
-end
-
-local config = route_config.config or {}
-local session_ttl = config.session_ttl or 600
-local uri = ngx.var.uri or ""
-local ua = ngx.var.http_user_agent or ""
-local remote_ip = ngx.var.remote_addr or ""
-
--- Check whitelist: if matched, skip PoW
-local whitelist = config.whitelist or {}
-if policy.match_any(remote_ip, ua, uri, whitelist) then
- return
-end
-
--- Check blacklist: if matched, require PoW
-local blacklist = config.blacklist or {}
-local has_blacklist = policy.has_entries(blacklist)
-local need_pow = false
-if has_blacklist then
- need_pow = policy.match_any(remote_ip, ua, uri, blacklist)
-else
- -- No blacklist means all non-whitelisted need PoW
- need_pow = true
-end
-
-if not need_pow then
- return
-end
-
--- Check valid session cookie
-local cookie_val = ngx.var["cookie___openflare_pow"]
-if cookie_val and cookie_val ~= "" then
- local session_key = host .. ":" .. cookie_val
- local session_data = pow_sessions:get(session_key)
- if session_data then
- pow_sessions:set(session_key, "1", session_ttl)
- ngx.header["Set-Cookie"] = session_cookie(cookie_val, session_ttl)
- return
- end
-end
-
--- If requesting the challenge API endpoints, let them through (handled by content_by_lua)
-local anubis_api_prefix = "/.within.website/x/cmd/anubis/api/"
-local anubis_static_prefix = "/.within.website/x/cmd/anubis/static/"
-if string.sub(uri, 1, #anubis_api_prefix) == anubis_api_prefix then
- return
-end
-if string.sub(uri, 1, #anubis_static_prefix) == anubis_static_prefix then
- return
-end
-
--- Render the challenge page through an internal redirect so the browser stays
--- on the originally requested URL instead of seeing a 302 hop.
-ngx.req.set_uri_args({
- redir = ngx.var.scheme .. "://" .. host .. uri .. (ngx.var.args and ("?" .. ngx.var.args) or ""),
- host = host
-})
-return ngx.exec("/.within.website/x/cmd/anubis/api/make-challenge")
-end
-
-return _M
diff --git a/data/agent/etc/nginx/lua/pow/static/css/static/geist.woff2 b/data/agent/etc/nginx/lua/pow/static/css/static/geist.woff2
deleted file mode 100644
index 6fd61c44..00000000
Binary files a/data/agent/etc/nginx/lua/pow/static/css/static/geist.woff2 and /dev/null differ
diff --git a/data/agent/etc/nginx/lua/pow/static/css/static/iosevka-curly.woff2 b/data/agent/etc/nginx/lua/pow/static/css/static/iosevka-curly.woff2
deleted file mode 100644
index df9df40c..00000000
Binary files a/data/agent/etc/nginx/lua/pow/static/css/static/iosevka-curly.woff2 and /dev/null differ
diff --git a/data/agent/etc/nginx/lua/pow/static/css/static/podkova.css b/data/agent/etc/nginx/lua/pow/static/css/static/podkova.css
deleted file mode 100644
index efa1fd7a..00000000
--- a/data/agent/etc/nginx/lua/pow/static/css/static/podkova.css
+++ /dev/null
@@ -1,7 +0,0 @@
-@font-face {
- font-family: "Podkova";
- font-style: normal;
- font-weight: 400 800;
- font-display: swap;
- src: url("podkova.woff2") format("woff2");
-}
diff --git a/data/agent/etc/nginx/lua/pow/static/css/static/podkova.woff2 b/data/agent/etc/nginx/lua/pow/static/css/static/podkova.woff2
deleted file mode 100644
index 508f97d3..00000000
Binary files a/data/agent/etc/nginx/lua/pow/static/css/static/podkova.woff2 and /dev/null differ
diff --git a/data/agent/etc/nginx/lua/pow/static/css/xess.css b/data/agent/etc/nginx/lua/pow/static/css/xess.css
deleted file mode 100644
index 67a0c4ba..00000000
--- a/data/agent/etc/nginx/lua/pow/static/css/xess.css
+++ /dev/null
@@ -1,149 +0,0 @@
-:root {
- --body-sans-font: Geist, sans-serif;
- --body-preformatted-font: Iosevka Curly Iaso, monospace;
- --body-title-font: Podkova, serif;
-
- --background: #1d2021;
- --text: #f9f5d7;
- --text-selection: #d3869b;
- --preformatted-background: #3c3836;
- --link-foreground: #b16286;
- --link-background: #282828;
- --blockquote-border-left: 1px solid #bdae93;
-
- --progress-bar-outline: #b16286 solid 4px;
- --progress-bar-fill: #b16286;
-}
-@media (prefers-color-scheme: light) {
- :root {
- --background: #f9f5d7;
- --text: #1d2021;
- --text-selection: #d3869b;
- --preformatted-background: #ebdbb2;
- --link-foreground: #b16286;
- --link-background: #fbf1c7;
- --blockquote-border-left: 1px solid #655c54;
- }
-}
-
-@font-face {
- font-family: "Geist";
- font-style: normal;
- font-weight: 100 900;
- font-display: swap;
- src: url("./static/geist.woff2") format("woff2");
-}
-
-@font-face {
- font-family: "Podkova";
- font-style: normal;
- font-weight: 400 800;
- font-display: swap;
- src: url("./static/podkova.woff2") format("woff2");
-}
-
-@font-face {
- font-family: "Iosevka Curly";
- font-style: monospace;
- font-display: swap;
- src: url("./static/iosevka-curly.woff2") format("woff2");
-}
-
-main {
- font-family: var(--body-sans-font);
- max-width: 50rem;
- padding: 2rem;
- margin: auto;
-}
-
-::selection {
- background: var(--text-selection);
-}
-
-body {
- background: var(--background);
- color: var(--text);
-}
-
-body,
-html {
- height: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-left: auto;
- margin-right: auto;
-}
-
-.centered-div {
- text-align: center;
-}
-
-#status {
- font-variant-numeric: tabular-nums;
-}
-
-.centered-div {
- text-align: center;
-}
-
-#status {
- font-variant-numeric: tabular-nums;
-}
-
-#progress {
- display: none;
- width: min(20rem, 90%);
- height: 2rem;
- border-radius: 1rem;
- overflow: hidden;
- margin: 1rem 0 2rem;
- outline-offset: 2px;
- outline: var(--progress-bar-outline);
-}
-
-.bar-inner {
- background-color: var(--progress-bar-fill);
- height: 100%;
- width: 0;
- transition: width 0.25s ease-in;
-}
-
-@media (prefers-reduced-motion: no-preference) {
- .bar-inner {
- transition: width 0.25s ease-in;
- }
-}
-
-pre {
- background-color: var(--preformatted-background);
- padding: 1em;
- border: 0;
- font-family: var(--body-preformatted-font);
-}
-
-a,
-a:active,
-a:visited {
- color: var(--link-foreground);
- background-color: var(--link-background);
-}
-
-h1,
-h2,
-h3,
-h4,
-h5 {
- margin-bottom: 0.1rem;
- font-family: var(--body-title-font);
-}
-
-blockquote {
- border-left: var(--blockquote-border-left);
- margin: 0.5em 10px;
- padding: 0.5em 10px;
-}
-
-footer {
- text-align: center;
-}
diff --git a/data/agent/etc/nginx/lua/pow/static/img/happy.webp b/data/agent/etc/nginx/lua/pow/static/img/happy.webp
deleted file mode 100644
index 40b979da..00000000
Binary files a/data/agent/etc/nginx/lua/pow/static/img/happy.webp and /dev/null differ
diff --git a/data/agent/etc/nginx/lua/pow/static/img/pensive.webp b/data/agent/etc/nginx/lua/pow/static/img/pensive.webp
deleted file mode 100644
index e26faefe..00000000
Binary files a/data/agent/etc/nginx/lua/pow/static/img/pensive.webp and /dev/null differ
diff --git a/data/agent/etc/nginx/lua/pow/static/img/reject.webp b/data/agent/etc/nginx/lua/pow/static/img/reject.webp
deleted file mode 100644
index 17bc9398..00000000
Binary files a/data/agent/etc/nginx/lua/pow/static/img/reject.webp and /dev/null differ
diff --git a/data/agent/etc/nginx/lua/pow/static/js/algorithms/index.mjs b/data/agent/etc/nginx/lua/pow/static/js/algorithms/index.mjs
deleted file mode 100644
index 24a47324..00000000
--- a/data/agent/etc/nginx/lua/pow/static/js/algorithms/index.mjs
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-@licstart The following is the entire license notice for the
-JavaScript code in this page.
-
-Copyright (c) 2025 Xe Iaso
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-Includes code from https://github.com/aws/aws-sdk-js-crypto-helpers which is
-used under the terms of the Apache 2 license.
-
-@licend The above is the entire license notice
-for the JavaScript code in this page.
-*/
-(()=>{var k=()=>navigator.hardwareConcurrency!==void 0?navigator.hardwareConcurrency:1;function n(c,b,w=5,e=null,g,u=Math.trunc(Math.max(k()/2,1))){console.debug("fast algo");let s="purejs";return window.isSecureContext&&(s="webcrypto"),(navigator.userAgent.includes("Firefox")||navigator.userAgent.includes("Goanna"))&&(console.log("Firefox detected, using pure-JS fallback"),s="purejs"),new Promise((p,l)=>{let m=`${c.basePrefix}/.within.website/x/cmd/anubis/static/js/worker/sha256-${s}.mjs?cacheBuster=${c.version}`,f=[],d=!1,a=()=>{console.log("PoW aborted"),i(),l(new DOMException("Aborted","AbortError"))},i=()=>{d||(d=!0,f.forEach(r=>r.terminate()),e?.removeEventListener("abort",a))};if(e!=null){if(e.aborted)return a();e.addEventListener("abort",a,{once:!0})}for(let r=0;r{typeof o.data=="number"?g?.(o.data):(i(),p(o.data))},t.onerror=o=>{i(),l(o)},t.postMessage({data:b,difficulty:w,nonce:r,threads:u}),f.push(t)}})}var P={fast:n,slow:n};})();
-//# sourceMappingURL=index.mjs.map
diff --git a/data/agent/etc/nginx/lua/pow/static/js/main.mjs b/data/agent/etc/nginx/lua/pow/static/js/main.mjs
deleted file mode 100644
index 7f496602..00000000
--- a/data/agent/etc/nginx/lua/pow/static/js/main.mjs
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-@licstart The following is the entire license notice for the
-JavaScript code in this page.
-
-Copyright (c) 2025 Xe Iaso
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-Includes code from https://github.com/aws/aws-sdk-js-crypto-helpers which is
-used under the terms of the Apache 2 license.
-
-@licend The above is the entire license notice
-for the JavaScript code in this page.
-*/
-(()=>{var I=()=>navigator.hardwareConcurrency!==void 0?navigator.hardwareConcurrency:1;function _(e,n,s=5,o=null,i,u=Math.trunc(Math.max(I()/2,1))){console.debug("fast algo");let a="purejs";return window.isSecureContext&&(a="webcrypto"),(navigator.userAgent.includes("Firefox")||navigator.userAgent.includes("Goanna"))&&(console.log("Firefox detected, using pure-JS fallback"),a="purejs"),new Promise((E,x)=>{let M=`${e.basePrefix}/.within.website/x/cmd/anubis/static/js/worker/sha256-${a}.mjs?cacheBuster=${e.version}`,p=[],d=!1,b=()=>{console.log("PoW aborted"),h(),x(new DOMException("Aborted","AbortError"))},h=()=>{d||(d=!0,p.forEach(c=>c.terminate()),o?.removeEventListener("abort",b))};if(o!=null){if(o.aborted)return b();o.addEventListener("abort",b,{once:!0})}for(let c=0;c{typeof m.data=="number"?i?.(m.data):(h(),E(m.data))},g.onerror=m=>{h(),x(m)},g.postMessage({data:n,difficulty:s,nonce:c,threads:u}),p.push(g)}})}var j={fast:_,slow:_};var v=(e="",n={})=>{let s=new URL(e,window.location.href);return Object.entries(n).forEach(([o,i])=>s.searchParams.set(o,i)),s.toString()},L=e=>{let n=document.getElementById(e);return n===null?null:JSON.parse(n.textContent)},k=(e,n,s)=>v(`${s}/.within.website/x/cmd/anubis/static/img/${e}.webp`,{cacheBuster:n});var W=async()=>document.documentElement.lang,S=async e=>{let n=L("anubis_base_prefix");if(n!==null)try{return await(await fetch(`${n}/.within.website/x/cmd/anubis/static/locales/${e}.json`)).json()}catch(s){if(console.warn(`Failed to load translations for ${e}, falling back to English`),e!=="en")return await S("en");throw s}},C=()=>{let e=L("anubis_public_url");if(e!==null)return e&&window.location.href.startsWith(e)?new URLSearchParams(window.location.search).get("redir"):window.location.href},$={},D,A=async()=>{D=await W(),$=await S(D)},r=e=>$[`js_${e}`]||$[e]||e;(async()=>{await A();let e=[{name:"Web Workers",msg:r("web_workers_error"),value:window.Worker},{name:"Cookies",msg:r("cookies_error"),value:navigator.cookieEnabled}],n=document.getElementById("status"),s=document.getElementById("image"),o=document.getElementById("title"),i=document.getElementById("progress"),u=L("anubis_version"),a=L("anubis_base_prefix"),E=document.querySelector("details"),x=!1;E&&E.addEventListener("toggle",()=>{E.open&&(x=!0)});let M=({titleMsg:l,statusMsg:f,imageSrc:w})=>{o.innerHTML=l,n.innerHTML=f,s.src=w,i.style.display="none"};n.innerHTML=r("calculating");for(let{value:l,name:f,msg:w}of e)if(!l){M({titleMsg:`${r("missing_feature")} ${f}`,statusMsg:w,imageSrc:k("reject",u,a)});return}let{challenge:p,rules:d}=L("anubis_challenge"),b=j[d.algorithm];if(!b){M({titleMsg:r("challenge_error"),statusMsg:r("challenge_error_msg"),imageSrc:k("reject",u,a)});return}n.innerHTML=`${r("calculating_difficulty")} ${d.difficulty}, `,i.style.display="inline-block";let h=document.createTextNode(`${r("speed")} 0kH/s`);n.appendChild(h);let c=0,g=!1,m=Math.pow(16,-d.difficulty);try{let l=Date.now(),{hash:f,nonce:w}=await b({basePrefix:a,version:u},p.randomData,d.difficulty,null,t=>{let y=Date.now()-l;y-c>1e3&&(c=y,h.data=`${r("speed")} ${(t/y).toFixed(3)}kH/s`);let T=Math.pow(1-m,t),P=(1-Math.pow(T,2))*100;i["aria-valuenow"]=P,i.firstElementChild!==null&&(i.firstElementChild.style.width=`${P}%`),T<.1&&!g&&(n.append(document.createElement("br"),document.createTextNode(r("verification_longer"))),g=!0)}),H=Date.now();if(console.log({hash:f,nonce:w}),x){let y=function(){let T=C();window.location.replace(v(`${a}/.within.website/x/cmd/anubis/api/pass-challenge`,{id:p.id,response:f,nonce:w,redir:T,elapsedTime:H-l}))},t=document.getElementById("progress");t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.height="2rem",t.style.borderRadius="1rem",t.style.cursor="pointer",t.style.background="#b16286",t.style.color="white",t.style.fontWeight="bold",t.style.outline="4px solid #b16286",t.style.outlineOffset="2px",t.style.width="min(20rem, 90%)",t.style.margin="1rem auto 2rem",t.innerHTML=r("finished_reading"),t.onclick=y,setTimeout(y,3e4)}else{let t=C();window.location.replace(v(`${a}/.within.website/x/cmd/anubis/api/pass-challenge`,{id:p.id,response:f,nonce:w,redir:t,elapsedTime:H-l}))}}catch(l){M({titleMsg:r("calculation_error"),statusMsg:`${r("calculation_error_msg")} ${l.message}`,imageSrc:k("reject",u,a)})}})();})();
-//# sourceMappingURL=main.mjs.map
diff --git a/data/agent/etc/nginx/lua/pow/static/js/worker/sha256-purejs.mjs b/data/agent/etc/nginx/lua/pow/static/js/worker/sha256-purejs.mjs
deleted file mode 100644
index e2c2d196..00000000
--- a/data/agent/etc/nginx/lua/pow/static/js/worker/sha256-purejs.mjs
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-@licstart The following is the entire license notice for the
-JavaScript code in this page.
-
-Copyright (c) 2025 Xe Iaso
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-Includes code from https://github.com/aws/aws-sdk-js-crypto-helpers which is
-used under the terms of the Apache 2 license.
-
-@licend The above is the entire license notice
-for the JavaScript code in this page.
-*/
-(()=>{function _(o,i,e,n){function t(r){return r instanceof e?r:new e(function(a){a(r)})}return new(e||(e=Promise))(function(r,a){function p(c){try{f(n.next(c))}catch(l){a(l)}}function u(c){try{f(n.throw(c))}catch(l){a(l)}}function f(c){c.done?r(c.value):t(c.value).then(p,u)}f((n=n.apply(o,i||[])).next())})}function v(o,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,t,r,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=p(0),a.throw=p(1),a.return=p(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function p(f){return function(c){return u([f,c])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(e=0)),e;)try{if(n=1,t&&(r=f[0]&2?t.return:f[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,f[1])).done)return r;switch(t=0,r&&(f=[f[0]&2,r.value]),f[0]){case 0:case 1:r=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,t=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!r||f[1]>r[0]&&f[1]S)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=i[e++],n--,this.bufferLength===h&&(this.hashBuffer(),this.bufferLength=0)},o.prototype.digest=function(){if(!this.finished){var i=this.bytesHashed*8,e=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(e.setUint8(this.bufferLength++,128),n%h>=h-8){for(var t=this.bufferLength;t>>24&255,r[t*4+1]=this.state[t]>>>16&255,r[t*4+2]=this.state[t]>>>8&255,r[t*4+3]=this.state[t]>>>0&255;return r},o.prototype.hashBuffer=function(){for(var i=this,e=i.buffer,n=i.state,t=n[0],r=n[1],a=n[2],p=n[3],u=n[4],f=n[5],c=n[6],l=n[7],s=0;s>>17|y<<15)^(y>>>19|y<<13)^y>>>10;y=this.temp[s-15];var T=(y>>>7|y<<25)^(y>>>18|y<<14)^y>>>3;this.temp[s]=(A+this.temp[s-7]|0)+(T+this.temp[s-16]|0)}var m=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&f^~u&c)|0)+(l+(E[s]+this.temp[s]|0)|0)|0,P=((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+(t&r^t&a^r&a)|0;l=c,c=f,f=u,u=p+m|0,p=a,a=r,r=t,t=m+P|0}n[0]+=t,n[1]+=r,n[2]+=a,n[3]+=p,n[4]+=u,n[5]+=f,n[6]+=c,n[7]+=l},o})();var d=o=>new TextEncoder().encode(o);var L=typeof Buffer<"u"&&Buffer.from?function(o){return Buffer.from(o,"utf8")}:d;function x(o){return o instanceof Uint8Array?o:typeof o=="string"?L(o):ArrayBuffer.isView(o)?new Uint8Array(o.buffer,o.byteOffset,o.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(o)}function w(o){return typeof o=="string"?o.length===0:o.byteLength===0}var j=(function(){function o(i){this.secret=i,this.hash=new b,this.reset()}return o.prototype.update=function(i){if(!(w(i)||this.error))try{this.hash.update(x(i))}catch(e){this.error=e}},o.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},o.prototype.digest=function(){return _(this,void 0,void 0,function(){return v(this,function(i){return[2,this.digestSync()]})})},o.prototype.reset=function(){if(this.hash=new b,this.secret){this.outer=new b;var i=U(this.secret),e=new Uint8Array(h);e.set(i);for(var n=0;nh){var e=new b;e.update(i),i=e.digest()}var n=new Uint8Array(h);return n.set(i),n}var B=o=>{let i=new j;return i.update(o),i.digest()};function I(o){return Array.from(o).map(i=>i.toString(16).padStart(2,"0")).join("")}addEventListener("message",async({data:o})=>{let{data:i,difficulty:e,threads:n}=o,t=o.nonce,r=t===0,a=0,p=Math.floor(e/2),u=e%2!==0;for(;;){let f=await B(i+t),c=new Uint8Array(f),l=!0;for(let s=0;s
>4!==0&&(l=!1),l){let s=I(c);postMessage({hash:s,data:i,difficulty:e,nonce:t});return}t+=n,a++,t%1!==0&&(t=Math.trunc(t)),r&&(a&1023)===0&&postMessage(t)}});})();
-//# sourceMappingURL=sha256-purejs.mjs.map
diff --git a/data/agent/etc/nginx/lua/pow/static/js/worker/sha256-webcrypto.mjs b/data/agent/etc/nginx/lua/pow/static/js/worker/sha256-webcrypto.mjs
deleted file mode 100644
index 7d32193b..00000000
--- a/data/agent/etc/nginx/lua/pow/static/js/worker/sha256-webcrypto.mjs
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-@licstart The following is the entire license notice for the
-JavaScript code in this page.
-
-Copyright (c) 2025 Xe Iaso
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-Includes code from https://github.com/aws/aws-sdk-js-crypto-helpers which is
-used under the terms of the Apache 2 license.
-
-@licend The above is the entire license notice
-for the JavaScript code in this page.
-*/
-(()=>{var h=new TextEncoder,y=async e=>{let s=h.encode(e);return await crypto.subtle.digest("SHA-256",s)},g=e=>e.reduce((s,a)=>s+a.toString(16).padStart(2,"0"),"");addEventListener("message",async({data:e})=>{let{data:s,difficulty:a,threads:d}=e,t=e.nonce,f=t===0,o=0,c=Math.floor(a/2),l=a%2!==0;for(;;){let u=await y(s+t),i=new Uint8Array(u),r=!0;for(let n=0;n>4!==0&&(r=!1),r){let n=g(i);postMessage({hash:n,data:s,difficulty:a,nonce:t});return}t+=d,o++,t%1!==0&&(t=Math.trunc(t)),f&&(o&1023)===0&&postMessage(t)}});})();
-//# sourceMappingURL=sha256-webcrypto.mjs.map
diff --git a/data/agent/etc/nginx/lua/pow/static/locales/en.json b/data/agent/etc/nginx/lua/pow/static/locales/en.json
deleted file mode 100644
index 4dffb969..00000000
--- a/data/agent/etc/nginx/lua/pow/static/locales/en.json
+++ /dev/null
@@ -1,66 +0,0 @@
-{
- "loading": "Loading...",
- "why_am_i_seeing": "Why am I seeing this?",
- "protected_by": "Protected by",
- "protected_from": "From",
- "made_with": "Made with ❤️ in 🇨🇦",
- "mascot_design": "Mascot design by",
- "ai_companies_explanation": "You are seeing this because the administrator of this website has set up Anubis to protect the server against the scourge of AI companies aggressively scraping websites. This can and does cause downtime for the websites, which makes their resources inaccessible for everyone.",
- "anubis_compromise": "Anubis is a compromise. Anubis uses a Proof-of-Work scheme in the vein of Hashcash, a proposed proof-of-work scheme for reducing email spam. The idea is that at individual scales the additional load is ignorable, but at mass scraper levels it adds up and makes scraping much more expensive.",
- "hack_purpose": "Ultimately, this is a placeholder solution so that more time can be spent on fingerprinting and identifying headless browsers (EG: via how they do font rendering) so that the challenge proof of work page doesn't need to be presented to users that are much more likely to be legitimate.",
- "simplified_explanation": "This is a measure against bots and malicious requests similar to a CAPTCHA. However, instead of having to do work yourself, your browser is given a calculation task that it has to solve to ensure that it is a valid client. This concept is called Proof of Work. The task is calculated in a few seconds and you are granted access to the website. Thank you for your understanding and patience.",
- "jshelter_note": "Please note that Anubis requires the use of modern JavaScript features that plugins like JShelter will disable. Please disable JShelter or other such plugins for this domain.",
- "version_info": "This website is running Anubis version",
- "try_again": "Try again",
- "go_home": "Go home",
- "contact_webmaster": "or if you believe you should not be blocked, please contact the webmaster at",
- "connection_security": "Please wait a moment while we ensure the security of your connection.",
- "javascript_required": "Sadly, you must enable JavaScript to get past this challenge. This is required because AI companies have changed the social contract around how website hosting works. A no-JS solution is a work-in-progress.",
- "benchmark_requires_js": "Running the benchmark tool requires JavaScript to be enabled.",
- "difficulty": "Difficulty:",
- "algorithm": "Algorithm:",
- "compare": "Compare:",
- "time": "Time",
- "iters": "Iters",
- "time_a": "Time A",
- "iters_a": "Iters A",
- "time_b": "Time B",
- "iters_b": "Iters B",
- "static_check_endpoint": "This is just a check endpoint for your reverse proxy to use.",
- "authorization_required": "Authorization required",
- "cookies_disabled": "Your browser is configured to disable cookies. Anubis requires cookies for the legitimate interest of making sure you are a valid client. Please enable cookies for this domain",
- "access_denied": "Access Denied: error code",
- "dronebl_entry": "DroneBL reported an entry",
- "see_dronebl_lookup": "see",
- "internal_server_error": "Internal Server Error: administrator has misconfigured Anubis. Please contact the administrator and ask them to look for the logs around",
- "invalid_redirect": "Invalid redirect",
- "redirect_not_parseable": "Redirect URL not parseable",
- "redirect_domain_not_allowed": "Redirect domain not allowed",
- "missing_required_forwarded_headers": "Missing required X-Forwarded-* headers",
- "failed_to_sign_jwt": "failed to sign JWT",
- "invalid_invocation": "Invalid invocation of MakeChallenge",
- "client_error_browser": "Client Error: Please ensure your browser is up to date and try again later.",
- "oh_noes": "Oh noes!",
- "benchmarking_anubis": "Benchmarking Anubis!",
- "you_are_not_a_bot": "You are not a bot!",
- "making_sure_not_bot": "Making sure you're not a bot!",
- "celphase": "CELPHASE",
- "js_web_crypto_error": "Your browser doesn't have a functioning web.crypto element. Are you viewing this over a secure context?",
- "js_web_workers_error": "Your browser doesn't support web workers (Anubis uses this to avoid freezing your browser). Do you have a plugin like JShelter installed?",
- "js_cookies_error": "Your browser doesn't store cookies. Anubis uses cookies to determine which clients have passed challenges by storing a signed token in a cookie. Please enable storing cookies for this domain. The names of the cookies Anubis stores may vary without notice. Cookie names and values are not part of the public API.",
- "js_context_not_secure": "Your context is not secure!",
- "js_context_not_secure_msg": "Try connecting over HTTPS or let the admin know to set up HTTPS. For more information, see MDN.",
- "js_calculating": "Calculating...",
- "js_missing_feature": "Missing feature",
- "js_challenge_error": "Challenge error!",
- "js_challenge_error_msg": "Failed to resolve check algorithm. You may want to reload the page.",
- "js_calculating_difficulty": "Calculating... Difficulty:",
- "js_speed": "Speed:",
- "js_verification_longer": "Verification is taking longer than expected. Please do not refresh the page.",
- "js_success": "Success!",
- "js_done_took": "Done! Took",
- "js_iterations": "iterations",
- "js_finished_reading": "I've finished reading, continue →",
- "js_calculation_error": "Calculation error!",
- "js_calculation_error_msg": "Failed to calculate challenge:"
-}
diff --git a/data/agent/etc/nginx/lua/pow/static/locales/zh-CN.json b/data/agent/etc/nginx/lua/pow/static/locales/zh-CN.json
deleted file mode 100644
index 19529607..00000000
--- a/data/agent/etc/nginx/lua/pow/static/locales/zh-CN.json
+++ /dev/null
@@ -1,66 +0,0 @@
-{
- "loading": "加载中...",
- "why_am_i_seeing": "为什么我会看到这个?",
- "protected_by": "本网站由",
- "protected_from": "保护,来自",
- "made_with": "在 🇨🇦 用 ❤️ 制作",
- "mascot_design": "吉祥物由",
- "ai_companies_explanation": "您会看到这个画面,是因为网站管理员启用了 Anubis 来保护服务器,避免 AI 公司大量爬取网站内容。这类行为会导致网站崩溃,让所有用户都无法正常访问资源。",
- "anubis_compromise": "Anubis 是一种折中做法。它采用了类似 Hashcash 的工作量证明机制(Proof-of-Work),该机制最初是为了减少垃圾邮件而提出。其核心概念是:对个别用户而言,额外的计算负担可以忽略,但对大规模爬虫来说,累积起来的成本将大幅增加,从而让爬取行为变得更困难。",
- "hack_purpose": "最终,这是一个占位符解决方案,以便将更多时间用于指纹识别和识别无头浏览器(例如:通过它们如何进行字体渲染),从而无需向更可能是合法用户的用户呈现挑战工作量证明页面。",
- "jshelter_note": "请注意,Anubis 需要使用现代 JavaScript 功能,而像 JShelter 这类插件可能会阻挡这些功能。请为此域名停用 JShelter 或类似的插件。",
- "version_info": "这个网站正在运行的 Anubis 版本为",
- "try_again": "再试一次",
- "go_home": "返回首页",
- "contact_webmaster": "或者您觉得您不应该被封锁,请联系网站管理员于",
- "connection_security": "请稍等,我们需要在继续之前检查您的连接安全性。",
- "javascript_required": "很遗憾,您必须启用 JavaScript 才能通过这项验证。这是因为 AI 公司已经改变了网站托管的社会契约,因此我们必须采取这样的保护机制。无需 JavaScript 的解决方案仍在开发中。",
- "benchmark_requires_js": "运行基准测试工具需要启用 JavaScript。",
- "difficulty": "难度:",
- "algorithm": "算法:",
- "compare": "比较:",
- "time": "时间",
- "iters": "迭代",
- "time_a": "时间 A",
- "iters_a": "迭代 A",
- "time_b": "时间 B",
- "iters_b": "迭代 B",
- "static_check_endpoint": "这是提供给您的反向代理服务器使用的检查端点。",
- "authorization_required": "需要认证",
- "cookies_disabled": "您的浏览器目前已禁用 Cookie,为了确认您是合法用户,Anubis 需要启用 Cookie。 请您为此域名启用 Cookie",
- "access_denied": "拒绝访问:错误代码",
- "dronebl_entry": "DroneBL 报告了一条记录",
- "see_dronebl_lookup": "见",
- "internal_server_error": "内部服务器错误:管理员错误地配置了 Anubis。 请联系管理员要求他们检查日志",
- "invalid_redirect": "无效的重定向",
- "redirect_not_parseable": "重定向 URL 无法解析",
- "redirect_domain_not_allowed": "重定向的域名并不允许",
- "failed_to_sign_jwt": "签署 JWT 失败",
- "invalid_invocation": "无效的 MakeChallenge 调用",
- "client_error_browser": "客户端错误:请确保您的浏览器是最新版本并稍候再试。",
- "oh_noes": "哎呀糟糕了!",
- "benchmarking_anubis": "正在进行 Anubis 性能测试!",
- "you_are_not_a_bot": "你不是机器人!",
- "making_sure_not_bot": "正在确认你是不是机器人!",
- "celphase": "CELPHASE 设计",
- "js_web_crypto_error": "您的浏览器无法正常使用 web.crypto 组件。您是否通过安全连接(HTTPS)查看此网站?",
- "js_web_workers_error": "您的浏览器并不支持 Web workers (Anubis 使用这个来避免冻结您的浏览器 )您有安装像是 JShelter 之类的插件吗?",
- "js_cookies_error": "您的浏览器无法存储 Cookie。 Anubis 会使用 Cookie 存储签署的凭证,以判断用户是否已通过验证。请为此域名启用 Cookie 存储功能。 请注意,Anubis 存储的 Cookie 名称可能会变动,且其名称与内容不属于公开 API 的一部分。",
- "js_context_not_secure": "您的内容并不安全",
- "js_context_not_secure_msg": "请尝试使用 HTTPS 连接,或联系网站管理员设置 HTTPS。更多信息请参见 MDN。",
- "js_calculating": "计算中...",
- "js_missing_feature": "缺少功能",
- "js_challenge_error": "挑战错误!",
- "js_challenge_error_msg": "解决检查算法失败。 您可能会想要刷新页面。",
- "js_calculating_difficulty": "计算中... 难度:",
- "js_speed": "速度:",
- "js_verification_longer": "验证所花的时间高于预期。 请不要刷新页面。",
- "js_success": "成功!",
- "js_done_took": "完成! 花费",
- "js_iterations": "迭代",
- "js_finished_reading": "我读完了,继续 →",
- "js_calculation_error": "计算错误!",
- "js_calculation_error_msg": "计算挑战失败:",
- "missing_required_forwarded_headers": "缺少必要的 X-Forwarded-* 头",
- "simplified_explanation": "这是一种类似于验证码的措施,用于防止机器人和恶意请求。但是,您无需自己动手,您的浏览器会收到一个计算任务,必须解决该任务以确保它是有效的客户端。这个概念称为工作量证明。该任务在几秒钟内计算完毕,您将被授予访问网站的权限。感谢您的理解和耐心。"
-}
diff --git a/data/agent/etc/nginx/lua/pow/verify.lua b/data/agent/etc/nginx/lua/pow/verify.lua
deleted file mode 100644
index 0f824b57..00000000
--- a/data/agent/etc/nginx/lua/pow/verify.lua
+++ /dev/null
@@ -1,101 +0,0 @@
-local cjson = require "cjson.safe"
-
-local pow_challenges = ngx.shared.openflare_pow_challenges
-local pow_sessions = ngx.shared.openflare_pow_sessions
-
-local args = ngx.req.get_uri_args()
-local challenge_id = args["id"] or ""
-local response = args["response"] or ""
-local nonce_str = args["nonce"] or ""
-local redir = args["redir"] or ""
-local elapsed = args["elapsedTime"] or ""
-
-if challenge_id == "" or response == "" or nonce_str == "" then
- ngx.status = 400
- ngx.header.content_type = "application/json"
- ngx.say(cjson.encode({error = "missing parameters"}))
- return
-end
-
-local nonce = tonumber(nonce_str)
-if not nonce then
- ngx.status = 400
- ngx.header.content_type = "application/json"
- ngx.say(cjson.encode({error = "invalid nonce"}))
- return
-end
-
--- Get stored challenge
-local challenge_raw = pow_challenges:get(challenge_id)
-if not challenge_raw then
- ngx.status = 410
- ngx.header.content_type = "application/json"
- ngx.say(cjson.encode({error = "challenge expired or not found"}))
- return
-end
-
-local ok, challenge_info = pcall(cjson.decode, challenge_raw)
-if not ok or not challenge_info then
- ngx.status = 500
- ngx.header.content_type = "application/json"
- ngx.say(cjson.encode({error = "invalid challenge data"}))
- return
-end
-
-local challenge_data = challenge_info.data or ""
-local difficulty = challenge_info.difficulty or 4
-local host = challenge_info.host or ngx.var.host or ""
-local session_ttl = challenge_info.session_ttl or 600
-
--- Compute SHA-256(challenge_data + nonce)
-local calc_string = challenge_data .. tostring(math.floor(nonce))
-local calculated = ngx.sha1_bin ~= nil and "" or ""
-
--- Use resty.sha256 for proper SHA-256
-local sha256 = require "resty.sha256"
-local str = require "resty.string"
-local hasher = sha256:new()
-hasher:update(calc_string)
-local hash_bytes = hasher:final()
-local hash_hex = str.to_hex(hash_bytes)
-
--- Verify hash matches response
-if hash_hex ~= string.lower(response) then
- ngx.status = 403
- ngx.header.content_type = "application/json"
- ngx.say(cjson.encode({error = "hash mismatch"}))
- return
-end
-
--- Verify difficulty (leading zeros in hex)
-local prefix = string.rep("0", difficulty)
-if string.sub(hash_hex, 1, difficulty) ~= prefix then
- ngx.status = 403
- ngx.header.content_type = "application/json"
- ngx.say(cjson.encode({error = "insufficient difficulty"}))
- return
-end
-
--- Invalidate challenge (prevent replay)
-pow_challenges:delete(challenge_id)
-
--- Generate session token
-local session_token = str.to_hex(ngx.sha1_bin(challenge_id .. ngx.now() .. tostring(ngx.worker.pid())))
-
--- Store session
-pow_sessions:set(host .. ":" .. session_token, "1", session_ttl)
-
--- Set cookie. Secure cookies are not sent over HTTP, so only add Secure when
--- the current request itself is HTTPS.
-local cookie = "__openflare_pow=" .. session_token .. "; Path=/; HttpOnly; SameSite=Lax; Max-Age=" .. tostring(session_ttl)
-if ngx.var.scheme == "https" then
- cookie = cookie .. "; Secure"
-end
-ngx.header["Set-Cookie"] = cookie
-
-if redir ~= "" then
- return ngx.redirect(redir)
-end
-
-ngx.header.content_type = "application/json"
-ngx.say(cjson.encode({ok = true}))
diff --git a/data/agent/etc/nginx/lua/read.lua b/data/agent/etc/nginx/lua/read.lua
deleted file mode 100644
index fe15ecc4..00000000
--- a/data/agent/etc/nginx/lua/read.lua
+++ /dev/null
@@ -1,45 +0,0 @@
-local cjson = require "cjson.safe"
-
-local dict = ngx.shared.openflare_observability
-if not dict then
- ngx.status = ngx.HTTP_SERVICE_UNAVAILABLE
- ngx.say(cjson.encode({ message = "shared dict unavailable" }))
- return
-end
-
-local now = ngx.time()
-local window_size = 60
-local window_start = now - (now % window_size)
-local current_window = tostring(window_start)
-
-local function read_counter(key)
- return tonumber(dict:get(key) or 0) or 0
-end
-
-local function read_map(window_id, prefix, list_key)
- local result = {}
- local raw = dict:get(list_key .. ":" .. window_id)
- if not raw or raw == "" then
- return result
- end
- for value in string.gmatch(raw, "[^\n]+") do
- result[value] = read_counter(prefix .. ":" .. window_id .. ":" .. value)
- end
- return result
-end
-
-local payload = {
- window_started_at_unix = window_start,
- window_ended_at_unix = now,
- request_count = read_counter("request_count:" .. current_window),
- error_count = read_counter("error_count:" .. current_window),
- unique_visitor_count = read_counter("unique_visitor_count:" .. current_window),
- status_codes = read_map(current_window, "status", "status_keys"),
- top_domains = read_map(current_window, "domain", "domain_keys"),
- source_countries = {},
- openresty_rx_bytes = read_counter("openresty_rx_bytes:" .. current_window),
- openresty_tx_bytes = read_counter("openresty_tx_bytes:" .. current_window)
-}
-
-ngx.header.content_type = "application/json"
-ngx.say(cjson.encode(payload))
diff --git a/data/agent/etc/nginx/lua/waf/check.lua b/data/agent/etc/nginx/lua/waf/check.lua
deleted file mode 100644
index 5f694592..00000000
--- a/data/agent/etc/nginx/lua/waf/check.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-local source = debug.getinfo(1, "S").source or ""
-if string.sub(source, 1, 1) == "@" then
- local script_path = string.sub(source, 2)
- local base_dir = string.match(script_path, "^(.*)/waf/[^/]+%.lua$")
- if base_dir and base_dir ~= "" and not string.find(package.path, base_dir, 1, true) then
- package.path = base_dir .. "/?.lua;" .. base_dir .. "/?/init.lua;" .. package.path
- end
-end
-
-return require("waf.runtime").check()
diff --git a/data/agent/etc/nginx/lua/waf/runtime.lua b/data/agent/etc/nginx/lua/waf/runtime.lua
deleted file mode 100644
index fd7c411e..00000000
--- a/data/agent/etc/nginx/lua/waf/runtime.lua
+++ /dev/null
@@ -1,286 +0,0 @@
-local _M = {}
-
-function _M.check()
-local cjson = require "cjson.safe"
-
-local config_dict = ngx.shared.openflare_waf_config
-
-local function read_file(path)
- local f = io.open(path, "r")
- if not f then
- return nil
- end
- local content = f:read("*a")
- f:close()
- return content
-end
-
-local function load_config()
- local paths = {
- "/data/etc/openflare/waf_config.json",
- "/etc/nginx/openflare-lua/waf_config.json",
- "/usr/local/openresty/nginx/conf/waf_config.json"
- }
- for _, path in ipairs(paths) do
- local content = read_file(path)
- if content and content ~= "" then
- local hash = ngx.md5(content)
- if config_dict:get("_config_hash") == hash then
- local cached = config_dict:get("_config_json")
- if cached then
- local decoded = cjson.decode(cached)
- if decoded then
- return decoded
- end
- end
- end
- local decoded = cjson.decode(content)
- if decoded then
- config_dict:set("_config_hash", hash, 0)
- config_dict:set("_config_json", content, 0)
- return decoded
- end
- end
- end
- return nil
-end
-
-local function load_ip_groups()
- local paths = {
- "/data/etc/openflare/waf_ip_groups.json",
- "/etc/nginx/openflare-lua/waf_ip_groups.json",
- "/usr/local/openresty/nginx/conf/waf_ip_groups.json"
- }
- for _, path in ipairs(paths) do
- local content = read_file(path)
- if content and content ~= "" then
- local hash = ngx.md5(content)
- if config_dict:get("_ip_groups_hash") == hash then
- local cached = config_dict:get("_ip_groups_json")
- if cached then
- local decoded = cjson.decode(cached)
- if decoded then
- return decoded
- end
- end
- end
- local decoded = cjson.decode(content)
- if decoded then
- config_dict:set("_ip_groups_hash", hash, 0)
- config_dict:set("_ip_groups_json", content, 0)
- return decoded
- end
- end
- end
- return { groups = {} }
-end
-
-local function list_contains(items, value)
- if not items or type(items) ~= "table" or not value or value == "" then
- return false
- end
- for _, item in ipairs(items) do
- if item == value then
- return true
- end
- end
- return false
-end
-
-local function table_has_items(items)
- return type(items) == "table" and #items > 0
-end
-
-local function parse_ipv4(value)
- local a, b, c, d = string.match(value or "", "^(%d+)%.(%d+)%.(%d+)%.(%d+)$")
- if not a then
- return nil
- end
- a, b, c, d = tonumber(a), tonumber(b), tonumber(c), tonumber(d)
- if a > 255 or b > 255 or c > 255 or d > 255 then
- return nil
- end
- return ((a * 256 + b) * 256 + c) * 256 + d
-end
-
-local function ipv4_in_cidr(ip, cidr)
- local base, bits = string.match(cidr or "", "^([^/]+)/(%d+)$")
- if not base then
- return false
- end
- bits = tonumber(bits)
- if not bits or bits < 0 or bits > 32 then
- return false
- end
- local ip_num = parse_ipv4(ip)
- local base_num = parse_ipv4(base)
- if not ip_num or not base_num then
- return false
- end
- if bits == 0 then
- return true
- end
- local mask = 4294967295 - (2 ^ (32 - bits) - 1)
- return (ip_num - (ip_num % (2 ^ (32 - bits)))) == (base_num - (base_num % (2 ^ (32 - bits))))
-end
-
-local function ip_matches(items, ip)
- if not items or type(items) ~= "table" or not ip or ip == "" then
- return false
- end
- for _, item in ipairs(items) do
- if item == ip then
- return true
- end
- if string.find(item, "/", 1, true) and ipv4_in_cidr(ip, item) then
- return true
- end
- end
- return false
-end
-
-local function ip_matches_group_ids(group_ids, ip, ip_groups_config)
- if not group_ids or type(group_ids) ~= "table" or not ip or ip == "" then
- return false
- end
- local groups = (ip_groups_config or {}).groups or {}
- for _, id in ipairs(group_ids) do
- local group = groups[tostring(id)]
- if group and group.enabled and ip_matches(group.ip_list, ip) then
- return true
- end
- end
- return false
-end
-
-local function lookup_country(ip)
- local ok, maxminddb = pcall(require, "resty.maxminddb")
- if not ok or not maxminddb then
- return nil
- end
- local paths = {
- "/data/etc/openflare/GeoLite2-Country.mmdb",
- "/etc/openflare/GeoLite2-Country.mmdb",
- "/usr/local/share/openflare/GeoLite2-Country.mmdb"
- }
- for _, path in ipairs(paths) do
- local opened = pcall(maxminddb.init, path)
- if opened then
- local res, err = maxminddb.lookup(ip)
- if res and res.country and res.country.iso_code then
- return string.upper(res.country.iso_code)
- end
- end
- end
- return nil
-end
-
-local function group_by_id(config)
- local result = {}
- for _, group in ipairs(config.rule_groups or {}) do
- result[tostring(group.id)] = group
- end
- return result
-end
-
-local function active_groups(config, groups)
- local site = ngx.var.openflare_waf_site or ""
- local ids = (config.site_rule_groups or {})[site]
- local result = {}
- for _, group in ipairs(config.rule_groups or {}) do
- if group.is_global then
- result[#result + 1] = group
- end
- end
- if ids then
- local by_id = group_by_id(config)
- for _, id in ipairs(ids) do
- local group = by_id[tostring(id)]
- if group and not group.is_global then
- result[#result + 1] = group
- end
- end
- end
- return result
-end
-
-local function exit_with_group(group)
- ngx.ctx.openflare_waf_blocked = true
- ngx.status = tonumber(group.block_status_code) or 418
- local body = group.block_response_body or ""
- if body ~= "" then
- ngx.header["Content-Type"] = "text/html; charset=utf-8"
- ngx.say(body)
- end
- return ngx.exit(ngx.status)
-end
-
-local function first_allowlist_group(groups)
- for _, group in ipairs(groups) do
- if table_has_items(group.ip_whitelist)
- or table_has_items(group.ip_whitelist_group_ids)
- or table_has_items(group.country_whitelist) then
- return group
- end
- end
- return nil
-end
-
-local config = load_config()
-if not config then
- if config_dict:add("_missing_config_logged", true, 60) then
- ngx.log(ngx.WARN, "openflare waf config is missing or invalid; requests will be allowed")
- end
- return
-end
-
-local ip = ngx.var.remote_addr or ""
-local groups = active_groups(config)
-local ip_groups_config = load_ip_groups()
-if #groups == 0 then
- if config_dict:add("_empty_groups_logged", true, 60) then
- ngx.log(ngx.WARN, "openflare waf has no active rule group for site: ", ngx.var.openflare_waf_site or "")
- end
- return
-end
-
-for _, group in ipairs(groups) do
- if ip_matches(group.ip_whitelist, ip) or ip_matches_group_ids(group.ip_whitelist_group_ids, ip, ip_groups_config) then
- return
- end
-end
-
-local country = nil
-for _, group in ipairs(groups) do
- if type(group.country_whitelist) == "table" and #group.country_whitelist > 0 then
- country = country or lookup_country(ip)
- if list_contains(group.country_whitelist, country) then
- return
- end
- end
-end
-
-local allowlist_group = first_allowlist_group(groups)
-if allowlist_group then
- return exit_with_group(allowlist_group)
-end
-
-for _, group in ipairs(groups) do
- if ip_matches(group.ip_blacklist, ip) or ip_matches_group_ids(group.ip_blacklist_group_ids, ip, ip_groups_config) then
- return exit_with_group(group)
- end
-end
-
-for _, group in ipairs(groups) do
- if type(group.country_blacklist) == "table" and #group.country_blacklist > 0 then
- country = country or lookup_country(ip)
- if list_contains(group.country_blacklist, country) then
- return exit_with_group(group)
- end
- end
-end
-
-return "ok"
-end
-
-return _M
diff --git a/data/agent/etc/nginx/mime.types b/data/agent/etc/nginx/mime.types
deleted file mode 100644
index 8a2348ab..00000000
--- a/data/agent/etc/nginx/mime.types
+++ /dev/null
@@ -1,95 +0,0 @@
-
-types {
- text/html html htm shtml;
- text/css css;
- text/xml xml;
- image/gif gif;
- image/jpeg jpeg jpg;
- application/javascript js;
- application/atom+xml atom;
- application/rss+xml rss;
-
- text/mathml mml;
- text/plain txt;
- text/vnd.sun.j2me.app-descriptor jad;
- text/vnd.wap.wml wml;
- text/x-component htc;
-
- image/png png;
- image/svg+xml svg svgz;
- image/tiff tif tiff;
- image/vnd.wap.wbmp wbmp;
- image/webp webp;
- image/x-icon ico;
- image/x-jng jng;
- image/x-ms-bmp bmp;
-
- application/font-woff woff;
- application/java-archive jar war ear;
- application/json json;
- application/mac-binhex40 hqx;
- application/msword doc;
- application/pdf pdf;
- application/postscript ps eps ai;
- application/rtf rtf;
- application/vnd.apple.mpegurl m3u8;
- application/vnd.google-earth.kml+xml kml;
- application/vnd.google-earth.kmz kmz;
- application/vnd.ms-excel xls;
- application/vnd.ms-fontobject eot;
- application/vnd.ms-powerpoint ppt;
- application/vnd.oasis.opendocument.graphics odg;
- application/vnd.oasis.opendocument.presentation odp;
- application/vnd.oasis.opendocument.spreadsheet ods;
- application/vnd.oasis.opendocument.text odt;
- application/vnd.openxmlformats-officedocument.presentationml.presentation
- pptx;
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- xlsx;
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
- docx;
- application/vnd.wap.wmlc wmlc;
- application/x-7z-compressed 7z;
- application/x-cocoa cco;
- application/x-java-archive-diff jardiff;
- application/x-java-jnlp-file jnlp;
- application/x-makeself run;
- application/x-perl pl pm;
- application/x-pilot prc pdb;
- application/x-rar-compressed rar;
- application/x-redhat-package-manager rpm;
- application/x-sea sea;
- application/x-shockwave-flash swf;
- application/x-stuffit sit;
- application/x-tcl tcl tk;
- application/x-x509-ca-cert der pem crt;
- application/x-xpinstall xpi;
- application/xhtml+xml xhtml;
- application/xspf+xml xspf;
- application/zip zip;
-
- application/octet-stream bin exe dll;
- application/octet-stream deb;
- application/octet-stream dmg;
- application/octet-stream iso img;
- application/octet-stream msi msp msm;
-
- audio/midi mid midi kar;
- audio/mpeg mp3;
- audio/ogg ogg;
- audio/x-m4a m4a;
- audio/x-realaudio ra;
-
- video/3gpp 3gpp 3gp;
- video/mp2t ts;
- video/mp4 mp4;
- video/mpeg mpeg mpg;
- video/quicktime mov;
- video/webm webm;
- video/x-flv flv;
- video/x-m4v m4v;
- video/x-mng mng;
- video/x-ms-asf asx asf;
- video/x-ms-wmv wmv;
- video/x-msvideo avi;
-}
diff --git a/data/agent/etc/nginx/nginx.conf b/data/agent/etc/nginx/nginx.conf
deleted file mode 100644
index 8012468f..00000000
--- a/data/agent/etc/nginx/nginx.conf
+++ /dev/null
@@ -1,84 +0,0 @@
-# This file is generated by OpenFlare. Do not edit manually.
-worker_processes auto;
-worker_rlimit_nofile 65535;
-pid logs/nginx.pid;
-error_log /data/var/log/openflare/error.log warn;
-
-events {
- worker_connections 4096;
- use epoll;
- multi_accept on;
-}
-
-http {
- include mime.types;
- default_type application/octet-stream;
- map $http_upgrade $connection_upgrade {
- default upgrade;
- '' "";
- }
-
- server {
- listen 80 default_server;
- server_name _;
-
- return 421;
- }
-
- server {
- listen 443 ssl default_server;
- listen 443 quic reuseport default_server;
- server_name _;
-
- ssl_reject_handshake on;
- }
- log_format openflare_json escape=json '{"ts":"$time_iso8601","host":"$host","path":"$request_uri","remote_addr":"$remote_addr","status":$status,"request_time":$request_time,"bytes_sent":$body_bytes_sent,"request_length":$request_length}';
- access_log /data/var/log/openflare/access.log openflare_json;
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- keepalive_timeout 20;
- keepalive_requests 1000;
- client_header_timeout 15;
- client_body_timeout 15;
- client_max_body_size 64m;
- large_client_header_buffers 4 16k;
- send_timeout 30;
- proxy_connect_timeout 3;
- proxy_send_timeout 60;
- proxy_read_timeout 60;
- proxy_request_buffering off;
- proxy_buffering on;
- proxy_buffers 16 16k;
- proxy_buffer_size 8k;
- proxy_busy_buffers_size 64k;
- gzip on;
- gzip_min_length 1024;
- gzip_comp_level 5;
- limit_conn_zone $server_name zone=openflare_conn_per_server:10m;
- limit_conn_zone $binary_remote_addr zone=openflare_conn_per_ip:10m;
- lua_shared_dict openflare_observability 10m;
- lua_shared_dict openflare_pow_challenges 10m;
- lua_shared_dict openflare_pow_sessions 10m;
- lua_shared_dict openflare_pow_config 1m;
- lua_shared_dict openflare_waf_config 1m;
- init_worker_by_lua_file /data/etc/nginx/lua/observability/init.lua;
- log_by_lua_file /data/etc/nginx/lua/observability/log.lua;
-
- server {
- listen 127.0.0.1:18081;
- server_name openflare-observability;
- access_log off;
-
- location = /openflare/stub_status {
- stub_status;
- }
-
- location = /openflare/observability {
- default_type application/json;
- content_by_lua_file /data/etc/nginx/lua/observability/read.lua;
- }
- }
-
- include /data/etc/nginx/conf.d/openflare_routes.conf;
-}
diff --git a/data/agent/etc/openflare/openresty_config.json b/data/agent/etc/openflare/openresty_config.json
deleted file mode 100644
index 8a4cf72a..00000000
--- a/data/agent/etc/openflare/openresty_config.json
+++ /dev/null
@@ -1 +0,0 @@
-{"routes":[{"id":1,"site_name":"local","domain":"a.com","domains":["a.com"],"origin_url":"https://flare.arctel.net:443","upstreams":["https://flare.arctel.net:443"],"enabled":true,"enable_https":false,"redirect_http":false,"cache_enabled":false,"upstream_type":"direct"}],"openresty_config":{"default_server_return_status":421,"worker_processes":"auto","worker_connections":4096,"worker_rlimit_nofile":65535,"events_use":"epoll","events_multi_accept_enabled":true,"keepalive_timeout":20,"keepalive_requests":1000,"client_header_timeout":15,"client_body_timeout":15,"client_max_body_size":"64m","large_client_header_buffers":"4 16k","send_timeout":30,"proxy_connect_timeout":3,"proxy_send_timeout":60,"proxy_read_timeout":60,"websocket_enabled":true,"http3_enabled":true,"proxy_request_buffering":false,"proxy_buffering_enabled":true,"proxy_buffers":"16 16k","proxy_buffer_size":"8k","proxy_busy_buffers_size":"64k","gzip_enabled":true,"gzip_min_length":1024,"gzip_comp_level":5,"cache_enabled":false,"cache_levels":"1:2","cache_inactive":"30m","cache_max_size":"1g","cache_key_template":"$scheme$host$request_uri","cache_lock_enabled":true,"cache_lock_timeout":"5s","cache_use_stale":"error timeout updating http_500 http_502 http_503 http_504","main_config_template":"# This file is generated by OpenFlare. Do not edit manually.\nworker_processes {{OpenRestyWorkerProcesses}};\nworker_rlimit_nofile {{OpenRestyWorkerRlimitNofile}};\npid logs/nginx.pid;\nerror_log {{OpenRestyErrorLogPath}} warn;\n\nevents {\n worker_connections {{OpenRestyWorkerConnections}};\n{{OpenRestyEventsUseDirective}}{{OpenRestyEventsMultiAcceptDirective}}}\n\nhttp {\n include mime.types;\n default_type application/octet-stream;\n{{OpenRestyConnectionUpgradeMap}}{{OpenRestyDefaultServerBlock}} log_format openflare_json escape=json '{\"ts\":\"$time_iso8601\",\"host\":\"$host\",\"path\":\"$request_uri\",\"remote_addr\":\"$remote_addr\",\"status\":$status,\"request_time\":$request_time,\"bytes_sent\":$body_bytes_sent,\"request_length\":$request_length}';\n access_log {{OpenRestyAccessLogPath}} openflare_json;\n sendfile on;\n tcp_nopush on;\n tcp_nodelay on;\n keepalive_timeout {{OpenRestyKeepaliveTimeout}};\n keepalive_requests {{OpenRestyKeepaliveRequests}};\n client_header_timeout {{OpenRestyClientHeaderTimeout}};\n client_body_timeout {{OpenRestyClientBodyTimeout}};\n client_max_body_size {{OpenRestyClientMaxBodySize}};\n large_client_header_buffers {{OpenRestyLargeClientHeaderBuffers}};\n send_timeout {{OpenRestySendTimeout}};\n proxy_connect_timeout {{OpenRestyProxyConnectTimeout}};\n proxy_send_timeout {{OpenRestyProxySendTimeout}};\n proxy_read_timeout {{OpenRestyProxyReadTimeout}};\n proxy_request_buffering {{OpenRestyProxyRequestBuffering}};\n proxy_buffering {{OpenRestyProxyBuffering}};\n proxy_buffers {{OpenRestyProxyBuffers}};\n proxy_buffer_size {{OpenRestyProxyBufferSize}};\n proxy_busy_buffers_size {{OpenRestyProxyBusyBuffersSize}};\n gzip {{OpenRestyGzip}};\n gzip_min_length {{OpenRestyGzipMinLength}};\n gzip_comp_level {{OpenRestyGzipCompLevel}};\n{{OpenRestyResolverDirective}}{{OpenRestyCacheBlock}} include {{OpenRestyRouteConfigInclude}};\n}\n"},"waf":{"rule_groups":[{"id":1,"name":"全局规则组","enabled":true,"is_global":true,"block_status_code":418,"pow_config":{"difficulty":4,"algorithm":"fast","session_ttl":600,"challenge_ttl":300,"whitelist":{"ips":[],"ip_cidrs":[],"paths":[],"path_regexes":[],"user_agents":[]},"blacklist":{"ips":[],"ip_cidrs":[],"paths":[],"path_regexes":[],"user_agents":[]}}}],"bindings":[]}}
\ No newline at end of file
diff --git a/data/agent/etc/openflare/waf_config.json b/data/agent/etc/openflare/waf_config.json
deleted file mode 100644
index b2aa4559..00000000
--- a/data/agent/etc/openflare/waf_config.json
+++ /dev/null
@@ -1 +0,0 @@
-{"default_block_status_code":418,"rule_groups":[{"id":1,"name":"全局规则组","is_global":true,"block_status_code":418,"block_response_body":"","ip_whitelist":[],"ip_blacklist":[],"country_whitelist":null,"country_blacklist":null,"region_whitelist":null,"region_blacklist":null,"pow_enabled":false}],"site_rule_groups":{}}
\ No newline at end of file
diff --git a/data/agent/etc/openflare/waf_ip_groups.json b/data/agent/etc/openflare/waf_ip_groups.json
deleted file mode 100644
index 6b18fc04..00000000
--- a/data/agent/etc/openflare/waf_ip_groups.json
+++ /dev/null
@@ -1 +0,0 @@
-{"groups":{"1":{"id":1,"name":"firehol","type":"subscription","enabled":false,"ip_list":[],"checksum":"af25d137052579a74485ec670bb3b85bece83acda3ad89975f6346f181369427"},"2":{"id":2,"name":"自定义 IP 组","type":"automatic","enabled":true,"ip_list":[],"checksum":"7ade1acdb67895a13d1c36797f879d4dcf424f0e420f6b2b2750e446aaa1523d"},"3":{"id":3,"name":"手动组","type":"manual","enabled":true,"ip_list":["172.18.8.20","192.168.0.1"],"checksum":"e1c484f8facfcda5630abfad3fa1340491a07647ba73901a21cc9949387ba799"}}}
\ No newline at end of file
diff --git a/data/agent/var/lib/openflare/agent-state.json b/data/agent/var/lib/openflare/agent-state.json
deleted file mode 100644
index 4456f040..00000000
--- a/data/agent/var/lib/openflare/agent-state.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "node_id": "node-4a2bfffe5a8c8dad",
- "current_version": "20260618-004",
- "current_checksum": "cfdda2c756f0e3263b5bb67aea898ff28586682547fb41c78cde82bf3ffb68d6",
- "blocked_version": "",
- "blocked_checksum": "",
- "blocked_reason": "",
- "last_error": "",
- "openresty_status": "healthy",
- "openresty_message": "",
- "last_profile_fingerprint": "848303a6e044aec69efa18333711c484d711fbff229c72a3c2bc93fd742bc340",
- "last_cpu_stat_total": 91359492,
- "last_cpu_stat_idle": 91057341,
- "last_metric_at_unix": 1781849048,
- "access_log_offset": 9522
-}
\ No newline at end of file
diff --git a/data/agent/var/lib/openflare/observability-buffer.json b/data/agent/var/lib/openflare/observability-buffer.json
deleted file mode 100644
index de8b6a4a..00000000
--- a/data/agent/var/lib/openflare/observability-buffer.json
+++ /dev/null
@@ -1,482 +0,0 @@
-[
- {
- "window_started_at_unix": 1781848200,
- "snapshot": {
- "captured_at_unix": 1781848258,
- "cpu_usage_percent": 0.3127736769673464,
- "memory_used_bytes": 683499520,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113875708018688,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 178618413568,
- "disk_write_bytes": 8236818432,
- "network_rx_bytes": 992072,
- "network_tx_bytes": 3133491
- },
- "openresty_observation": {
- "captured_at_unix": 1781848258,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848200,
- "window_ended_at_unix": 1781848258,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848258
- },
- {
- "window_started_at_unix": 1781848260,
- "snapshot": {
- "captured_at_unix": 1781848318,
- "cpu_usage_percent": 0.36268134067033514,
- "memory_used_bytes": 683479040,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113878183706624,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 178736337408,
- "disk_write_bytes": 8237965312,
- "network_rx_bytes": 992522,
- "network_tx_bytes": 3134061
- },
- "openresty_observation": {
- "captured_at_unix": 1781848318,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848260,
- "window_ended_at_unix": 1781848318,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848318
- },
- {
- "window_started_at_unix": 1781848320,
- "snapshot": {
- "captured_at_unix": 1781848378,
- "cpu_usage_percent": 0.38808212318477714,
- "memory_used_bytes": 689451008,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113856253788160,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 178832536064,
- "disk_write_bytes": 8238546944,
- "network_rx_bytes": 993014,
- "network_tx_bytes": 3134673
- },
- "openresty_observation": {
- "captured_at_unix": 1781848378,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848320,
- "window_ended_at_unix": 1781848378,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848378
- },
- {
- "window_started_at_unix": 1781848380,
- "snapshot": {
- "captured_at_unix": 1781848438,
- "cpu_usage_percent": 0.36263598849568585,
- "memory_used_bytes": 681353216,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113861555388416,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 178939171328,
- "disk_write_bytes": 8239661056,
- "network_rx_bytes": 993464,
- "network_tx_bytes": 3135243
- },
- "openresty_observation": {
- "captured_at_unix": 1781848438,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848380,
- "window_ended_at_unix": 1781848438,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848438
- },
- {
- "window_started_at_unix": 1781848440,
- "snapshot": {
- "captured_at_unix": 1781848498,
- "cpu_usage_percent": 0.23752969121140144,
- "memory_used_bytes": 694992896,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113869457457152,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 178986156544,
- "disk_write_bytes": 8240242688,
- "network_rx_bytes": 993956,
- "network_tx_bytes": 3135855
- },
- "openresty_observation": {
- "captured_at_unix": 1781848498,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848440,
- "window_ended_at_unix": 1781848498,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848498
- },
- {
- "window_started_at_unix": 1781848500,
- "snapshot": {
- "captured_at_unix": 1781848558,
- "cpu_usage_percent": 0.37537537537537535,
- "memory_used_bytes": 678383616,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113875264471040,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 179164385792,
- "disk_write_bytes": 8241356800,
- "network_rx_bytes": 994406,
- "network_tx_bytes": 3136425
- },
- "openresty_observation": {
- "captured_at_unix": 1781848558,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848500,
- "window_ended_at_unix": 1781848558,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848558
- },
- {
- "window_started_at_unix": 1781848560,
- "snapshot": {
- "captured_at_unix": 1781848618,
- "cpu_usage_percent": 0.2625328166020752,
- "memory_used_bytes": 680759296,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113879888691200,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 179171258880,
- "disk_write_bytes": 8242077696,
- "network_rx_bytes": 994898,
- "network_tx_bytes": 3137037
- },
- "openresty_observation": {
- "captured_at_unix": 1781848618,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848560,
- "window_ended_at_unix": 1781848618,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848618
- },
- {
- "window_started_at_unix": 1781848620,
- "snapshot": {
- "captured_at_unix": 1781848678,
- "cpu_usage_percent": 0.42537220067559117,
- "memory_used_bytes": 682201088,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113884578971648,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 179309863424,
- "disk_write_bytes": 8243191808,
- "network_rx_bytes": 995348,
- "network_tx_bytes": 3137607
- },
- "openresty_observation": {
- "captured_at_unix": 1781848678,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848620,
- "window_ended_at_unix": 1781848678,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848678
- },
- {
- "window_started_at_unix": 1781848680,
- "snapshot": {
- "captured_at_unix": 1781848738,
- "cpu_usage_percent": 0.3254882323485228,
- "memory_used_bytes": 683511808,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113863895810048,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 179363787264,
- "disk_write_bytes": 8243838976,
- "network_rx_bytes": 995798,
- "network_tx_bytes": 3138177
- },
- "openresty_observation": {
- "captured_at_unix": 1781848738,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848680,
- "window_ended_at_unix": 1781848738,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848738
- },
- {
- "window_started_at_unix": 1781848740,
- "snapshot": {
- "captured_at_unix": 1781848798,
- "cpu_usage_percent": 0.3253253253253253,
- "memory_used_bytes": 683442176,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113874683559936,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 179498406400,
- "disk_write_bytes": 8244953088,
- "network_rx_bytes": 996248,
- "network_tx_bytes": 3138747
- },
- "openresty_observation": {
- "captured_at_unix": 1781848798,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848740,
- "window_ended_at_unix": 1781848798,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848798
- },
- {
- "window_started_at_unix": 1781848800,
- "snapshot": {
- "captured_at_unix": 1781848858,
- "cpu_usage_percent": 0.2251688766574931,
- "memory_used_bytes": 683982848,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113881640861696,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 179556286976,
- "disk_write_bytes": 8245567488,
- "network_rx_bytes": 996698,
- "network_tx_bytes": 3139317
- },
- "openresty_observation": {
- "captured_at_unix": 1781848858,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848800,
- "window_ended_at_unix": 1781848858,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848858
- },
- {
- "window_started_at_unix": 1781848860,
- "snapshot": {
- "captured_at_unix": 1781848918,
- "cpu_usage_percent": 0.44999999999999996,
- "memory_used_bytes": 675201024,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113889617379328,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 179728159232,
- "disk_write_bytes": 8246779904,
- "network_rx_bytes": 997148,
- "network_tx_bytes": 3139887
- },
- "openresty_observation": {
- "captured_at_unix": 1781848918,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848860,
- "window_ended_at_unix": 1781848918,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848918
- },
- {
- "window_started_at_unix": 1781848920,
- "snapshot": {
- "captured_at_unix": 1781848978,
- "cpu_usage_percent": 0.287464066991626,
- "memory_used_bytes": 681017344,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113892144447488,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 179760898560,
- "disk_write_bytes": 8247394304,
- "network_rx_bytes": 997598,
- "network_tx_bytes": 3140457
- },
- "openresty_observation": {
- "captured_at_unix": 1781848978,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848920,
- "window_ended_at_unix": 1781848978,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781848978
- },
- {
- "window_started_at_unix": 1781848980,
- "snapshot": {
- "captured_at_unix": 1781849038,
- "cpu_usage_percent": 0.37537537537537535,
- "memory_used_bytes": 685330432,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113921559101440,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 179892072960,
- "disk_write_bytes": 8248508416,
- "network_rx_bytes": 998090,
- "network_tx_bytes": 3141069
- },
- "openresty_observation": {
- "captured_at_unix": 1781849038,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781848980,
- "window_ended_at_unix": 1781849038,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781849038
- },
- {
- "window_started_at_unix": 1781849040,
- "snapshot": {
- "captured_at_unix": 1781849048,
- "cpu_usage_percent": 0.2875718929732433,
- "memory_used_bytes": 711155712,
- "memory_total_bytes": 12601327616,
- "storage_used_bytes": 113921939734528,
- "storage_total_bytes": 126562507685888,
- "disk_read_bytes": 179897475584,
- "disk_write_bytes": 8248524800,
- "network_rx_bytes": 998144,
- "network_tx_bytes": 3141143
- },
- "openresty_observation": {
- "captured_at_unix": 1781849048,
- "openresty_rx_bytes": 0,
- "openresty_tx_bytes": 0,
- "openresty_connections": 1
- },
- "traffic_report": {
- "window_started_at_unix": 1781849040,
- "window_ended_at_unix": 1781849048,
- "request_count": 0,
- "error_count": 0,
- "unique_visitor_count": 0,
- "status_codes": {},
- "top_domains": {},
- "source_countries": {}
- },
- "queued_at_unix": 1781849048
- }
-]
\ No newline at end of file
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/.gitignore b/data/agent/var/lib/openflare/pages/deployments/1/current/.gitignore
deleted file mode 100644
index e43b0f98..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-.DS_Store
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/.openflare-pages.json b/data/agent/var/lib/openflare/pages/deployments/1/current/.openflare-pages.json
deleted file mode 100644
index 660e9c7f..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/.openflare-pages.json
+++ /dev/null
@@ -1 +0,0 @@
-{"deployment_id":1,"checksum":"4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6"}
\ No newline at end of file
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/License.md b/data/agent/var/lib/openflare/pages/deployments/1/current/License.md
deleted file mode 100644
index b93a9207..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/License.md
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2022 OpenSpeedTest™
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/README.md b/data/agent/var/lib/openflare/pages/deployments/1/current/README.md
deleted file mode 100644
index 17d89eeb..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/README.md
+++ /dev/null
@@ -1,506 +0,0 @@
-# **[SpeedTest by OpenSpeedTest™](https://openspeedtest.com?Run&ref=Github)** - Free & Open-Source HTML5 Network Performance Estimation Tool.
-
-
-
-SpeedTest by OpenSpeedTest™ is a Free and Open-Source HTML5 Network Performance Estimation Tool Written in Vanilla Javascript and only uses built-in Web APIs like `XMLHttpRequest` `(XHR)`, `HTML`, `CSS`, `JS`, & `SVG`. No Third-Party frameworks or libraries are Required. All we need is a static web server like `NGINX`. I started this project in 2011 and moved to OpenSpeedTest.com dedicated Project/Domain Name in 2013.
-
----
-Just launched: OpenPacketLoss. Check it out!
-
-While OpenSpeedTest measures bandwidth, this tool helps you detect packet loss directly from your browser.
-
-**Try it:** https://openpacketloss.com
-**Source:** https://github.com/openpacketloss
-
----
-
-
-[](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1")
-
-
-**No client-side software or plugin is required. You can run a network speed test from any device with a [Web Browser that is IE10 or newer.](https://www.youtube.com/watch?v=9f-OM_WQ7Bw&list=PLt-deStxFJOMEAs2O1lJhscMNzcg9E3Po&index=1)**
-
-
-
-
-## Why OpenSpeedTest
-
-
-
-### Secure by Design.
-
-
-
-OpenSpeedTest contains Only `STATIC` Files like `HTML`,`CSS` & `JS`.
-
-So you don't need to worry about Security Updates or Hidden Exploits that may compromise your secure environments.
-
-
-
-### Lightweight, High Performance.
-
-
-
-OpenSpeedTest is written in Vanilla JavaScript. No Third-Party frameworks or libraries were used. SpeedTest script file size is under 8kB gzip. The unexpected side effect of using Vanilla JavaScript is High Performance.
-
-
-
-### Run a speed test from Any Device.
-
-
-
-OpenSpeedTest will run on Any Web Browser that is IE10 or newer.
-
-
-
-### Ready for Any Display Size and Resolution.
-
-
-
-OpenSpeedTest User interface is written in SVG.
-
-
-
-# Create Your Own SpeedTest Server.
-
-### Server Requirements :
-
-`Nginx`, `Apache`, `IIS`, `Express`, or Any Web server that supports `HTTP/1.1` or newer.
-
-- Accept, `GET`, `POST`, `HEAD` & `OPTIONS`, Response `200 OK`.
-
-- Accept, `POST` to Static Files, Response `200 OK`.
-
-- `client_max_body_size`, 35 Megabytes or more.
-
-- Timeout greater than `60 seconds`.
-
-- Disable `Access logs` for Increasing server performance.
-
-- Improve `Time to First Byte` (TTFB)
-
-- Warning! If you run it behind a **[Reverse Proxy](https://github.com/openspeedtest/Speed-Test/issues/4#issuecomment-1229157193)**, you should increase the `post-body content length` to 35 megabytes.
-- Supports `HTTP2` & `HTTP3`.
-- `HTTP1.1` is recommended for achieving maximum performance.
-- **[You Should Follow our Nginx Config.](https://github.com/openspeedtest/Nginx-Configuration)**
-
-
-
-# Or, You can use OpenSpeedTest-Server.
-
-OpenSpeedTest-Server is available for Windows, Mac, Linux, Android, iOS & Docker.
-[](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1")
-#### Fully Optimized and ready to use applications.
-
-
-
-### New features:
-
-
-
-1. Stress Test. (Continuous Speed Test)
-
-
-
-To enable the stress test. Pass `Stress` or `S` keyword as a URL parameter.
-
-
-
-````
-
-http://192.168.1.5?Stress=Low
-
-````
-
-After the `STRESS` or `S` keyword, you can specify the number of seconds you need to run the StressTest in seconds, or preset values such as `Low`, `Medium`, `High`, `VeryHigh`, `Extreme`, `Day`, and `Year`. Will run a speed test for `300`,`600`,`900`,`1800`,`3600`,`86400`,`31557600` seconds, respectively. Also, you can feed the first letter of each parameter and its values.
-
-
-````
-
-http://192.168.1.5?S=L
-
-````
-
-`S=L` is the same as passing `Stress=low`
-
-Or you can specify the number of seconds eg:`5000` directly without any preset keywords.
-
-
-
-````
-
-http://192.168.1.5?Stress=5000
-
-````
-
-
-
-2. Run a speed test automatically
-
-
-
-Run a speed test automatically on page load.
-
-````
-
-http://192.168.1.5?Run
-
-````
-
-Run a speed test automatically after a few seconds.
-
-````
-
-http://192.168.1.5?Run=10 or http://192.168.1.5?R=10
-
-````
-
-
-
-You can pass multiple keywords, and it's not `Case-Sensitive`.
-
-
-
-````
-
-http://192.168.1.5?Run&Stress=300 OR http://192.168.1.5?R&S=300
-
-````
-
-This will start a speed test immediately and run for `300 seconds` in each direction. That is 300 seconds for download and `300 seconds` for upload.
-
-
-
-3. Save results to a Database
-
-
-
-Edit `Index.html`
-
-````
-
-var saveData = true;
-
-var saveDataURL = "//yourDatabase.Server.com:4500/save?data=";
-
-````
-
-4. Add multiple servers. The app will choose one with the least latency automatically.
-
-
-
-Edit `Index.html`
-
-````
-
-var openSpeedTestServerList = [
-
-{"ServerName":"Home-Earth", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"},
-
-{"ServerName":"Home-Mars", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"},
-
-{"ServerName":"Home-Moon", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"}
-
-];
-
-````
-
-5. Disable or change Overhead Compensation factor.
-
-
-
-````
-
-http://192.168.1.5?clean
-
-````
-
-Overhead Compensation factor, This is browser based test, Many Unknowns. Currently 4%. That is within the margin of error.
-
-You can pass `Clean` or `C` as a URL Parameter and reset Overhead Compensation factor to Zero or set any value between 0 and 4. 1 = 1% to 4 = 4%.
-
-`Clean` will not accept values above 4, so Compensation is limited to maximum 4%.
-
-
-
-6. Change the default limit of 6 parallel HTTP connections to the Server.
-
-
-
-````
-
-http://192.168.1.5?XHR=3 OR http://192.168.1.5?X=3
-
-````
-
-Allow the user to Change the default limit of 6 parallel HTTP connections to the Server. `XHR` will Accept values above 1 and max 32
-
-pass `XHR` or `X` as a URL Parameter.
-
-
-
-7. Select a different server to run a speed test.
-
-
-
-````
-
-http://192.168.1.5?Host=http://192.168.55.1:90 OR http://192.168.1.5?h=http://192.168.55.1:90
-
-````
-
-Pass `Host` or `H` as a URL Parameter.
-
-`HOST` will Accept only valid HTTP URLs like `http://192.168.1.10:3000` or `https://yourHost.com`.
-
-
-
-8. Select and run one test at a time, `DOWNLOAD`, `UPLOAD`, or `PING`.
-
-
-
-````
-
-http://192.168.1.5?Test=Upload OR http://192.168.1.5?T=U
-
-````
-
-`TEST` Allow the user to select and run one test at a time, Download, Upload, or Ping.
-
-Pass `Test` or `T` as a URL Parameter.
-
-
-
-9. Set a PingTimeout dynamically by passing `Out` or `O` as a URL Parameter
-
-
-
-````
-
-http://192.168.1.5?Out=7000 OR http://192.168.1.5?O=7000
-
-````
-
-If Server not responded within 5 Seconds for any requests we send ('pingSamples' times)
-
-We will show `Network Error`, You can change the limit here.
-
-In milliseconds, if you need to set `6 seconds`. Change the value to `6000`.
-
-
-
-10. Set the Number of ping samples by adding `Ping` or `P` as a URL Parameter
-
-
-
-````
-
-http://192.168.1.5?Ping=500 OR http://192.168.1.5?P=500
-
-````
-
-More samples = more accurate representation. `Ping = 500` will send `501` requests to server to find the accurate ping value.
-Take a look at index.html, you can set a custom ping sample size, threads, upload data size etc.
-
-## Self-hosted (On-Premise) / (Docker Image/Source Code)
-### For Headless large-scale deployments.
-You have two options here. If you need a custom deployment, use our source code along with a web server of your choice. I prefer Nginx, and you can find my [Nginx Configuration](https://github.com/openspeedtest/Nginx-Configuration) here. Or you can use our docker image. You can deploy it on your LAN/WAN with or without an active internet connection.
-
-**This is docker implementation using nginxinc/nginx-unprivileged:stable-alpine. uses significantly fewer resources.**
-
-- NGINX Docker image that runs NGINX as a non root, unprivileged user.
-
- ### Docker install instructions:
-
- Install Docker and run the following command!
-
-````bash
-
-sudo docker run --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest
-
-````
-#### Or use docker-compose.yml
-````
-version: '3.3'
-services:
- speedtest:
- restart: unless-stopped
- container_name: openspeedtest
- ports:
- - '3000:3000'
- - '3001:3001'
- image: openspeedtest/latest
-````
-- Warning! If you run it behind a **[Reverse Proxy](https://github.com/openspeedtest/Speed-Test/issues/4#issuecomment-1229157193)**, you should increase the `post-body content length` to 35 megabytes.
-
-- **[Follow our Nginx Config.](https://github.com/openspeedtest/Nginx-Configuration)**
-
-Now open your browser and direct it to:
-
-A: For **HTTP** use: `http://YOUR-SERVER-IP:3000`
-
-B: For **HTTPS** use: `https://YOUR-SERVER-IP:3001`
-
-#### Container-Port for http is 3000
-If you need to run this image on a different port for `HTTP`, Eg: change to `80` = `-p 80:3000`
-#### Container-Port for https is 3001
-If you need to run this image on a different port for `HTTPS`, Eg: change to `443` = `-p 443:3001`
-
-### Setup Free LetsEncrypt SSL with Automatic Certificate Renewal
-***Requirements***
-- PUBLIC IPV4 and/or IPV6 address.
-- A domain name that resolves to speed test server's IP address.
-- Email ID
-
-The following command will generate a Let's Encrypt certificate for your domain name and configure a cron job to automatically renew the certificate.
-
-````
-docker run -e ENABLE_LETSENCRYPT=True -e DOMAIN_NAME=speedtest.yourdomain.com -e USER_EMAIL=you@yourdomain.pro --restart=unless-stopped --name openspeedtest -d -p 80:3000 -p 443:3001 openspeedtest/latest
-````
-#### Or use docker-compose.yml
-````
-version: '3.3'
-services:
- speedtest:
- environment:
- - ENABLE_LETSENCRYPT=True
- - DOMAIN_NAME=speedtest.yourdomain.com
- - USER_EMAIL=you@yourdomain.pro
- restart: unless-stopped
- container_name: openspeedtest
- ports:
- - '80:3000'
- - '443:3001'
- image: openspeedtest/latest
-````
-
-### How to Use Your Own Secure Sockets Layer (SSL) Certificate, Self-Signed or Paid?
-***Requirements***
-- Folder with your Certificate, Self-Signed or Paid.
-- Rename .cet file and .key file to `nginx.crt` & `nginx.key`
-
- The folder needs to contain:
-
-- `nginx.crt`
-
-- `nginx.key`
-
-
-````
-sudo docker run --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest
-````
-
-To mount a folder with your own SSL certificate to this Docker container, append the following line to the above command:
-
-
-````bash
-
--v /${PATH-TO-YOUR-OWN-SSL-CERTIFICATE}:/etc/ssl/
-
-````
-
-I am adding a folder with nginx.crt and nginx.key from my desktop by using the following command.
-
-````bash
-
-sudo docker run -v /Users/vishnu/Desktop/docker/:/etc/ssl/ --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest
-
-````
-#### Or use docker-compose.yml
-````
-version: '3.3'
-services:
- speedtest:
- volumes:
- - '/Users/vishnu/Desktop/docker/:/etc/ssl/'
- restart: unless-stopped
- container_name: openspeedtest
- ports:
- - '3000:3000'
- - '3001:3001'
- image: openspeedtest/latest
-````
-## Advanced Configuration Options
-
-- Container Port Configuration
-
-To enable port changes, set the `CHANGE_CONTAINER_PORTS` environment variable to `"True"` and provide appropriate values for the following variables.
-
-`CHANGE_CONTAINER_PORTS=True`
-
-`HTTP_PORT=3000`
-
-`HTTPS_PORT=3001`
-
-- Set User
-
-`SET_USER=101`
-
-- Only Allow `CORS Request` from listed domains.
-
-`ALLOW_ONLY=domain1.com;domain2.com;domain3.com`
-
-- `SET_SERVER_NAME` Display the server name on the UI.
-
-`SET_SERVER_NAME=HOME-NAS`
-
-
-Docker images run better on Linux Platforms, including your NAS. But if you install docker on macOS or Windows, you may see poor performance. I asked this on Docker forums, and they told me macOS and Windows support is for Development purposes only. For Production, you need to use any Linux Platform.
-
-The same Story goes for Windows NGINX. Nginx uses only one worker even if you specify n number of worker processes. They will show in Task Manager, but the system will only use one. I got this information directly from the Nginx website.
-
-
-
-
-
-## Why do you need to Create Your Own SpeedTest Server?
-
-You can run OpenSpeedTest Server in your Home Lab, Office Server or Cloud Server. So that you or employees who work from home can run a speed test to your office and make sure they can run everything smoothly.
-
-
-
-**Choosing between ISP1 & ISP2.**
-
-
-
-Sometimes your ISP2 is Faster than ISP1 when you test your speed on popular speed test sites. But when you connect to your Home/Office/Cloud, that slower connection may perform better. The only way to find out is to run a speed test against your infrastructure.
-
-
-
-**Troubleshooting network issues.**
-
-
-
-It is common even when your Internet connection is working fine, but some of the devices in your network may experience trouble getting decent connectivity to the internet. The issue might be the wrong VLAN ID or Faulty Switch. If you run a Local network speed test, you can find and fix these issues easily.
-
-
-
-**Before you add a repeater.**
-
-
-
-Most repeaters will reduce your network speed by 50%, so if you put it far away, it will perform worst, and if you put it too close, you will not get enough coverage if you run a Local Network speed test. Depending on the application requirements, you can decide exactly where you need to put your repeater.
-
-
-
-**Browsing experience.**
-
-
-
-Many useful browser extensions are out there that we all know and love. But some of them are really slowing you down for **few seconds per page you visit**. You may see good performance when you test your network performance via File Transfer or Command-line utilities, but you may experience poor performance when browsing the internet. This is due to a bad browser configuration that including unwanted extensions installed. From my experience, only keep the one you are going to use every single day. Extension that you may use once in a while should be removed or disabled for maximum performance. If you see poor performance, try OpenSpeedTest from Private Window or Incognito Window. **This tool can be used to check the browser performance and impact of Extensions on your browsing experience.**
-
-
-
-**No client-side software or plugin is required. You can run a network speed test from any device with a [Web Browser that is IE10 or newer.](https://www.youtube.com/watch?v=9f-OM_WQ7Bw&list=PLt-deStxFJOMEAs2O1lJhscMNzcg9E3Po&index=1)**
-
-- Like this Project? Please **Donate NOW & Keep us Alive** -> https://go.openspeedtest.com/Donate
-
-MIT License
-
-Copyright (c) 2013 - 2023 OpenSpeedTest™
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/css/app.css b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/css/app.css
deleted file mode 100644
index 39fa9393..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/css/app.css
+++ /dev/null
@@ -1,382 +0,0 @@
-/* roboto-regular - latin */
-@font-face {
- font-family: "Roboto";
- font-style: normal;
- font-weight: 400;
- font-display: swap;
- src: url("..fonts/roboto-v30-latin-regular.eot"); /* IE9 Compat Modes */
- src: local(""),
- url("../fonts/roboto-v30-latin-regular.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/roboto-v30-latin-regular.woff2")
- format("woff2"),
- /* Super Modern Browsers */
- url("../fonts/roboto-v30-latin-regular.woff") format("woff"),
- /* Modern Browsers */ url("../fonts/roboto-v30-latin-regular.ttf")
- format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/roboto-v30-latin-regular.svg#Roboto") format("svg"); /* Legacy iOS */
-}
-/* roboto-500 - latin */
-@font-face {
- font-family: "Roboto";
- font-style: normal;
- font-weight: 500;
- font-display: swap;
- src: url("assets/fonts/roboto-v30-latin-500.eot"); /* IE9 Compat Modes */
- src: local(""),
- url("assets/fonts/roboto-v30-latin-500.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/roboto-v30-latin-500.woff2")
- format("woff2"),
- /* Super Modern Browsers */ url("../fonts/roboto-v30-latin-500.woff")
- format("woff"),
- /* Modern Browsers */ url("../fonts/roboto-v30-latin-500.ttf")
- format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/roboto-v30-latin-500.svg#Roboto") format("svg"); /* Legacy iOS */
-}
-
-body {
- margin: 0px;
- padding: 0px;
- display: block;
-}
-
-::-webkit-scrollbar {
- display: none;
-}
-html {
- -ms-overflow-style: none;
- scrollbar-width: none;
-}
-
-.Credits {
-color: rgb(125 119 119);
-text-align: center;
-font-size:14px;
-font-family: Roboto-Medium, Roboto;
-font-weight: 500;
-}
-.Credits a {
- text-decoration: none;
- color: rgb(113, 113, 113);
-}
-.Credits a:hover {
-color: #14b0fe;
-}
-
-.ConnectError {
- display: none;
-
-}
-
-.openSpeedtestApp {
-
- height: 100vh;
- width: 100vw;
- display: none;
- overflow: hidden;
-}
-.main-Gaugebg {
- fill: none;
- stroke: rgb(231, 231, 232);
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 22px;
- stroke-dasharray: 681;
-}
-.main-GaugeBlue {
- fill: none;
- stroke: url(#gradient);
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 22px;
- stroke-dasharray: 681;
- stroke-opacity: 0;
-}
-.main-GaugeWhite {
- fill: none;
- stroke: rgb(255, 255, 255);
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 15px;
- stroke-dasharray: 0, 681;
- stroke-dashoffset: 1;
- stroke-opacity: 0;
-}
-.oDo-Meter {
- font-size: 16.633283615112305px;
- fill: gray;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
-}
-.oDoLive-Speed {
- font-size: 28px;
- fill: #201e1e;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
- text-anchor: middle;
-}
-
-.oDoLive-Status {
- font-size: 10px;
- fill: #d2d1d2;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
- text-anchor: middle;
-}
-.uiBg {
- fill: #d2d1d2;
-}
-.progressbg {
- stroke: rgb(231, 231, 232);
- stroke-width: 8px;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-dasharray: 400;
- stroke-dashoffset: 0;
-}
-.Cards {
- fill: #f2f2f2;
-}
-.Symbol {
- fill: url(#gradient);
-}
-.rtext {
- font-size: 12px;
- fill: #333;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
-}
-.rtextnum {
- font-size: 23px;
- fill: #201e1e;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
- text-anchor: middle;
-}
-.rtextmbms {
- font-size: 12px;
- fill: #5f5f5f;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
- text-anchor: middle;
-}
-.jitter-Mob {
- font-size: 9px;
- fill: #5f5f5f;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
- text-anchor: middle;
-}
-.startButton {
- fill: url(#RadialGradient1);
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- -webkit-tap-highlight-color: transparent;
- cursor: pointer;
- pointer-events: visible;
-}
-.buttonTxt {
- font-size: 40px;
- fill: #ffffff;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
- text-anchor: middle;
-}
-
-.intro-Progress {
- stroke: #56c4fb;
- stroke-width: 8px;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-dasharray: 400;
- stroke-dashoffset: 0;
-}
-.progressElmstart {
- stroke: #56c4fb;
- stroke-width: 8px;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-dasharray: 400;
- stroke-dashoffset: 0;
- display: block;
-}
-.Startsettings {
- fill: url(#RadialGradient1);
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- -webkit-tap-highlight-color: transparent;
- cursor: pointer;
- pointer-events: visible;
- opacity: 0.1;
- transition: opacity 1s ease-in-out;
-}
-.Startsettings:hover {
- opacity: 1;
-}
-
-.progressbg {
- stroke: rgb(231, 231, 232);
- stroke-width: 8px;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-dasharray: 400;
- stroke-dashoffset: 0;
-}
-.deskStart {
- fill: none;
- stroke: rgb(231, 231, 232);
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 22px;
- stroke-dasharray: 681;
- stroke: url(#gradient);
-}
-#UI-Desk {
- display: none;
-}
-#UI-Mob {
- display: none;
-}
-.oDoTop-Speed {
- font-size: 16.96px;
- fill: gray;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
- text-anchor: end;
-}
-#upSymbolDesk {
- fill: #14b0fe;
- display: none;
-}
-#downSymbolDesk {
- fill: #14b0fe;
- display: none;
-}
-#upSymbolMob {
- fill: #14b0fe;
- display: none;
-}
-#downSymbolMob {
- fill: #14b0fe;
- display: none;
-}
-
-#ipMob {
- font-size: 15px;
- fill: #201e1e;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
- text-anchor: middle;
- display: none;
-}
-#ipDesk {
- font-size: 15px;
- fill: #201e1e;
- font-family: Roboto-Medium, Roboto;
- font-weight: 500;
- text-anchor: middle;
- display: none;
-}
-
-.spinner {
- position: absolute;
- z-index: 999;
- top: 50vh;
- left: 50vw;
- text-align: center;
-}
-
-.spinner > div {
- width: 20px;
- height: 20px;
- background-color: #2196f3;
-
- border-radius: 100%;
- display: inline-block;
- -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
- animation: sk-bouncedelay 1.4s infinite ease-in-out both;
-}
-
-.spinner .bounce1 {
- -webkit-animation-delay: -0.32s;
- animation-delay: -0.32s;
-}
-
-.spinner .bounce2 {
- -webkit-animation-delay: -0.16s;
- animation-delay: -0.16s;
-}
-
-@-webkit-keyframes sk-bouncedelay {
- 0%,
- 80%,
- 100% {
- -webkit-transform: scale(0);
- }
- 40% {
- -webkit-transform: scale(1);
- }
-}
-
-@keyframes sk-bouncedelay {
- 0%,
- 80%,
- 100% {
- -webkit-transform: scale(0);
- transform: scale(0);
- }
- 40% {
- -webkit-transform: scale(1);
- transform: scale(1);
- }
-}
-
-.darkmode {
- margin-bottom: -15px;
- fill: #75757a99;
- padding-top: 16px;
- display: none;
- cursor: pointer;
- margin-right: 30px;
-}
-#daymode {
- margin-right: 40px;
-}
-.darkmode:hover {
- fill: #000000;
-}
-
-.Mobile,
-.Desktop {
- visibility: hidden;
- width: 100vw;
- height: 100vh;
-}
-
-@media only screen and (orientation: landscape) {
- .Mobile {
- visibility: hidden;
- }
- .Desktop {
- visibility: visible;
- }
-}
-
-@media only screen and (orientation: portrait) {
- .spinner {
- top: 42vh;
- left: 42vw;
- }
- .Mobile {
- visibility: visible;
- }
- .Desktop {
- visibility: hidden;
- }
-}
-@media only screen and (max-width: 300px) {
- .Credits{
- display: none;
- }
-}
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/css/darkmode.css b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/css/darkmode.css
deleted file mode 100644
index 14fef300..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/css/darkmode.css
+++ /dev/null
@@ -1,45 +0,0 @@
-body {
- background-color: #181818;
-}
-#ipDesk {
- fill: aliceblue;
-}
-
-.oDoLive-Speed {
- fill: #ffffff;
-}
-.oDoLive-Status {
- fill: aliceblue;
-}
-#ipMob {
- fill: aliceblue;
-}
-.rtextnum {
- fill: #ffffff;
-}
-.rtextmbms {
- fill: #ffffff;
-}
-.rtext {
- fill: #ffffff;
-}
-.Cards {
- fill: #000000;
-}
-
-.main-Gaugebg {
- stroke: #000000;
-}
-.uiBg {
- fill: #000000;
-}
-.progressbg {
- stroke: #202020;
-}
-.jitter-Mob {
- fill: #ffffff;
-}
-
-.ConnectError {
- fill: #ffffff;
-}
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.eot b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.eot
deleted file mode 100644
index fec03612..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.eot and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.svg b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.svg
deleted file mode 100644
index 67eecf44..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.svg
+++ /dev/null
@@ -1,305 +0,0 @@
-
-
-
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.ttf b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.ttf
deleted file mode 100644
index 4f515e2a..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.ttf and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.woff b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.woff
deleted file mode 100644
index d39bb52a..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.woff and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.woff2 b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.woff2
deleted file mode 100644
index 29342a8d..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.woff2 and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.eot b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.eot
deleted file mode 100644
index c244b089..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.eot and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.svg b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.svg
deleted file mode 100644
index 627f5a36..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.svg
+++ /dev/null
@@ -1,308 +0,0 @@
-
-
-
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.ttf b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.ttf
deleted file mode 100644
index d0e63254..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.ttf and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.woff b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.woff
deleted file mode 100644
index 9eaa94f9..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.woff and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.woff2 b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.woff2
deleted file mode 100644
index 020729ef..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.woff2 and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/app.svg b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/app.svg
deleted file mode 100644
index 01441ac0..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/app.svg
+++ /dev/null
@@ -1,459 +0,0 @@
-
\ No newline at end of file
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/android-chrome-192x192.png b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/android-chrome-192x192.png
deleted file mode 100644
index df78b83c..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/android-chrome-192x192.png and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/android-chrome-512x512.png b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/android-chrome-512x512.png
deleted file mode 100644
index 559d3eaf..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/android-chrome-512x512.png and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/apple-touch-icon.png b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/apple-touch-icon.png
deleted file mode 100644
index 14aec788..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/apple-touch-icon.png and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/browserconfig.xml b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/browserconfig.xml
deleted file mode 100644
index ef1658c6..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/browserconfig.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
- #ffc40d
-
-
-
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon-16x16.png b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon-16x16.png
deleted file mode 100644
index 0dd76a80..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon-16x16.png and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon-32x32.png b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon-32x32.png
deleted file mode 100644
index e3ad7510..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon-32x32.png and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon.ico b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon.ico
deleted file mode 100644
index bebc1524..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon.ico and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-1x.png b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-1x.png
deleted file mode 100644
index 50bdeae8..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-1x.png and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-2x.png b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-2x.png
deleted file mode 100644
index 98687998..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-2x.png and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-3x.png b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-3x.png
deleted file mode 100644
index b612922b..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-3x.png and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-4x.png b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-4x.png
deleted file mode 100644
index 5936c147..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-4x.png and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/mstile-150x150.png b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/mstile-150x150.png
deleted file mode 100644
index eb66ae2b..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/mstile-150x150.png and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/safari-pinned-tab.svg b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/safari-pinned-tab.svg
deleted file mode 100644
index e525e9b4..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/safari-pinned-tab.svg
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
-
-Created by potrace 1.11, written by Peter Selinger 2001-2013
-
-
-
-
-
-
-
-
-
-
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/site.webmanifest b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/site.webmanifest
deleted file mode 100644
index 058491fb..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/site.webmanifest
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "OpenSpeedTest",
- "short_name": "Speed Test",
- "icons": [
- {
- "src": "/assets/images/icons/android-chrome-192x192.png",
- "sizes": "192x192",
- "type": "image/png"
- },
- {
- "src": "/assets/images/icons/android-chrome-512x512.png",
- "sizes": "512x512",
- "type": "image/png"
- }
- ],
- "theme_color": "#ffffff",
- "background_color": "#ffffff",
- "display": "standalone",
- "start_url": "/"
-
-
-}
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/js/app-2.5.4.js b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/js/app-2.5.4.js
deleted file mode 100644
index f5b5b6e4..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/js/app-2.5.4.js
+++ /dev/null
@@ -1,1427 +0,0 @@
-/*
- Official Website : https://OpenSpeedTest.COM | Email: support@openspeedtest.com
- Developed by : Vishnu | https://Vishnu.Pro | Email : me@vishnu.pro
- Like this Project? Please Donate NOW & Keep us Alive -> https://go.openspeedtest.com/Donate
- Speed Test by OpenSpeedTest™️ is Free and Open-Source Software (FOSS) with MIT License.
- Read full license terms @ http://go.openspeedtest.com/License
- If you have any Questions, ideas or Comments Please Send it via -> https://go.openspeedtest.com/SendMessage
-*/
-window.onload = function() {
- var appSVG = document.getElementById("OpenSpeedTest-UI");
- appSVG.parentNode.replaceChild(appSVG.contentDocument.documentElement, appSVG);
- ostOnload();
- OpenSpeedTest.Start();
-};
-(function(OpenSpeedTest) {
- var Status;
- var ProG;
- var Callback = function(callback) {
- if (callback && typeof callback === "function") {
- callback();
- }
- };
- function _(el) {
- if (!(this instanceof _)) {
- return new _(el);
- }
- this.el = document.getElementById(el);
- }
- _.prototype.fade = function fade(type, ms, callback00) {
- var isIn = type === "in", opacity = isIn ? 0 : 1, interval = 14, duration = ms, gap = interval / duration, self = this;
- if (isIn) {
- self.el.style.display = "block";
- self.el.style.opacity = opacity;
- }
- function func() {
- opacity = isIn ? opacity + gap : opacity - gap;
- self.el.style.opacity = opacity;
- if (opacity <= 0) {
- self.el.style.display = "none";
- }
- if (opacity <= 0 || opacity >= 1) {
- window.clearInterval(fading, Callback(callback00));
- }
- }
- var fading = window.setInterval(func, interval);
- };
- var easeOutQuint = function(t, b, c, d) {
- t /= d;
- t--;
- return c * (t * t * t * t * t + 1) + b;
- };
- var easeOutCubic = function(t, b, c, d) {
- t /= d;
- t--;
- return c * (t * t * t + 1) + b;
- };
- var openSpeedtestShow = function() {
- this.YourIP = _("YourIP");
- this.ipDesk = _("ipDesk");
- this.ipMob = _("ipMob");
- this.downSymbolDesk = _("downSymbolDesk");
- this.upSymbolDesk = _("upSymbolDesk");
- this.upSymbolMob = _("upSymbolMob");
- this.downSymbolMob = _("downSymbolMob");
- this.settingsMob = _("settingsMob");
- this.settingsDesk = _("settingsDesk");
- this.oDoLiveStatus = _("oDoLiveStatus");
- this.ConnectErrorMob = _("ConnectErrorMob");
- this.ConnectErrorDesk = _("ConnectErrorDesk");
- this.downResult = _("downResult");
- this.upRestxt = _("upRestxt");
- this.pingResult = _("pingResult");
- this.jitterDesk = _("jitterDesk");
- this.pingMobres = _("pingMobres");
- this.JitterResultMon = _("JitterResultMon");
- this.JitterResultms = _("JitterResultms");
- this.UI_Desk = _("UI-Desk");
- this.UI_Mob = _("UI-Mob");
- this.oDoTopSpeed = _("oDoTopSpeed");
- this.startButtonMob = _("startButtonMob");
- this.startButtonDesk = _("startButtonDesk");
- this.intro_Desk = _("intro-Desk");
- this.intro_Mob = _("intro-Mob");
- this.loader = _("loading_app");
- this.OpenSpeedtest = _("OpenSpeedtest");
- this.mainGaugebg_Desk = _("mainGaugebg-Desk");
- this.mainGaugeBlue_Desk = _("mainGaugeBlue-Desk");
- this.mainGaugeWhite_Desk = _("mainGaugeWhite-Desk");
- this.mainGaugebg_Mob = _("mainGaugebg-Mob");
- this.mainGaugeBlue_Mob = _("mainGaugeBlue-Mob");
- this.mainGaugeWhite_Mob = _("mainGaugeWhite-Mob");
- this.oDoLiveSpeed = _("oDoLiveSpeed");
- this.progressStatus_Mob = _("progressStatus-Mob");
- this.progressStatus_Desk = _("progressStatus-Desk");
- this.graphc1 = _("graphc1");
- this.graphc2 = _("graphc2");
- this.graphMob2 = _("graphMob2");
- this.graphMob1 = _("graphMob1");
- this.text = _("text");
- this.scale = [{degree:680, value:0}, {degree:570, value:0.5}, {degree:460, value:1}, {degree:337, value:10}, {degree:220, value:100}, {degree:115, value:500}, {degree:0, value:1000},];
- this.element = "";
- this.chart = "";
- this.polygon = "";
- this.width = 200;
- this.height = 50;
- this.maxValue = 0;
- this.values = [];
- this.points = [];
- this.vSteps = 5;
- this.measurements = [];
- this.points = [];
- };
- openSpeedtestShow.prototype.reset = function() {
- this.element = "";
- this.chart = "";
- this.polygon = "";
- this.width = 200;
- this.height = 50;
- this.maxValue = 0;
- this.values = [];
- this.points = [];
- this.vSteps = 5;
- this.measurements = [];
- this.points = [];
- };
- openSpeedtestShow.prototype.ip = function() {
- var Self = this;
- if (Self.ipDesk.el.style.display === "block") {
- Self.ipDesk.el.style.display = "none";
- Self.ipMob.el.style.display = "none";
- } else {
- Self.ipDesk.el.style.display = "block";
- Self.ipMob.el.style.display = "block";
- }
- };
- openSpeedtestShow.prototype.prePing = function() {
- this.loader.fade("out", 500);
- this.OpenSpeedtest.fade("in", 1000);
- };
- openSpeedtestShow.prototype.app = function() {
- this.loader.fade("out", 500, this.ShowAppIntro());
- };
- openSpeedtestShow.prototype.ShowAppIntro = function() {
- this.OpenSpeedtest.fade("in", 1000);
- };
- openSpeedtestShow.prototype.userInterface = function() {
- var Self = this;
- this.intro_Desk.fade("out", 1000);
- this.intro_Mob.fade("out", 1000, this.ShowUI());
- };
- openSpeedtestShow.prototype.ShowUI = function() {
- this.UI_Desk.fade("in", 1000);
- this.UI_Mob.fade("in", 1000, uiLoaded);
- function uiLoaded(argument) {
- Status = "Loaded";
- console.log("Developed by Vishnu. Email --\x3e me@vishnu.pro");
- }
- };
- openSpeedtestShow.prototype.Symbol = function(dir) {
- if (dir == 0) {
- this.downSymbolMob.el.style.display = "block";
- this.downSymbolDesk.el.style.display = "block";
- this.upSymbolMob.el.style.display = "none";
- this.upSymbolDesk.el.style.display = "none";
- }
- if (dir == 1) {
- this.downSymbolMob.el.style.display = "none";
- this.downSymbolDesk.el.style.display = "none";
- this.upSymbolMob.el.style.display = "block";
- this.upSymbolDesk.el.style.display = "block";
- }
- if (dir == 2) {
- this.downSymbolMob.el.style.display = "none";
- this.downSymbolDesk.el.style.display = "none";
- this.upSymbolMob.el.style.display = "none";
- this.upSymbolDesk.el.style.display = "none";
- }
- };
- openSpeedtestShow.prototype.Graph = function(speed, select) {
- if (!("remove" in Element.prototype)) {
- Element.prototype.remove = function() {
- if (this.parentNode) {
- this.parentNode.removeChild(this);
- }
- };
- }
- var Self = this;
- var Remove;
- if (select === 0) {
- var Graphelement = this.graphc1.el;
- Remove = "line";
- this.graphMob2.el.style.display = "none";
- this.graphMob1.el.style.display = "block";
- } else {
- Graphelement = this.graphc2.el;
- Remove = "line2";
- this.graphMob1.el.style.display = "none";
- this.graphMob2.el.style.display = "block";
- }
- if (!isNaN(speed)) {
- this.values.push(speed);
- } else {
- this.values.push("");
- }
- function calcMeasure() {
- for (x = 0; x < Self.vSteps; x++) {
- var measurement = Math.ceil(Self.maxValue / Self.vSteps * (x + 1));
- Self.measurements.push(measurement);
- }
- Self.measurements.reverse();
- }
- function createChart(element, values) {
- calcMaxValue();
- calcPoints();
- calcMeasure();
- var removeLine = document.getElementsByClassName(Remove);
- while (removeLine.length > 0) {
- removeLine[0].remove();
- }
- Self.polygon = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
- Self.polygon.setAttribute("points", Self.points);
- Self.polygon.setAttribute("class", Remove);
- if (Self.values.length > 1) {
- Graphelement.appendChild(Self.polygon);
- }
- }
- function calcPoints() {
- if (Self.values.length > 1) {
- var points = "0," + Self.height + " ";
- for (x = 0; x < Self.values.length; x++) {
- var perc = Self.values[x] / Self.maxValue;
- var steps = 130 / (Self.values.length - 1);
- var point = (steps * x).toFixed(2) + "," + (Self.height - Self.height * perc).toFixed(2) + " ";
- points += point;
- }
- points += "130," + Self.height;
- Self.points = points;
- }
- }
- var x;
- function calcMaxValue() {
- Self.maxValue = 0;
- for (x = 0; x < Self.values.length; x++) {
- if (Self.values[x] > Self.maxValue) {
- Self.maxValue = Self.values[x];
- }
- }
- Self.maxValue = Math.ceil(Self.maxValue);
- }
- if (speed > 0) {
- createChart(Graphelement, speed);
- }
- };
- openSpeedtestShow.prototype.progress = function(Switch, duration) {
- var Self = this;
- var Stop = duration;
- var Stage = Switch;
- var currTime = Date.now();
- var chan2 = 0 - 400;
- var interval = setInterval(function() {
- var timeNow = (Date.now() - currTime) / 1000;
- var toLeft = easeOutCubic(timeNow, 400, 400, Stop);
- var toRight = easeOutCubic(timeNow, 400, chan2, Stop);
- if (Stage) {
- Self.progressStatus_Desk.el.style.strokeDashoffset = toLeft;
- Self.progressStatus_Mob.el.style.strokeDashoffset = toLeft;
- } else {
- Self.progressStatus_Desk.el.style.strokeDashoffset = toRight;
- Self.progressStatus_Mob.el.style.strokeDashoffset = toRight;
- }
- if (timeNow >= Stop) {
- clearInterval(interval);
- ProG = "done";
- Self.progressStatus_Desk.el.style.strokeDashoffset = 800;
- Self.progressStatus_Mob.el.style.strokeDashoffset = 800;
- }
- }, 14);
- };
- openSpeedtestShow.prototype.mainGaugeProgress = function(currentSpeed) {
- var Self = this;
- var speed = currentSpeed;
- if (speed < 0) {
- speed = 0;
- }
- var mainGaugeOffset = Self.getNonlinearDegree(speed);
- if (currentSpeed > 0) {
- this.mainGaugeBlue_Desk.el.style.strokeOpacity = 1;
- this.mainGaugeWhite_Desk.el.style.strokeOpacity = 1;
- this.mainGaugeBlue_Mob.el.style.strokeOpacity = 1;
- this.mainGaugeWhite_Mob.el.style.strokeOpacity = 1;
- this.mainGaugeBlue_Desk.el.style.strokeDashoffset = mainGaugeOffset;
- this.mainGaugeWhite_Desk.el.style.strokeDashoffset = mainGaugeOffset == 0 ? 1 : mainGaugeOffset + 1;
- this.mainGaugeBlue_Mob.el.style.strokeDashoffset = mainGaugeOffset;
- this.mainGaugeWhite_Mob.el.style.strokeDashoffset = mainGaugeOffset == 0 ? 1 : mainGaugeOffset + 1;
- }
- if (mainGaugeOffset == 0 && speed > 1000) {
- this.mainGaugeBlue_Mob.el.style.strokeDashoffset = mainGaugeOffset >= 681 ? 681 : mainGaugeOffset;
- this.mainGaugeWhite_Mob.el.style.strokeDashoffset = mainGaugeOffset == 0 ? 1 : mainGaugeOffset + 1;
- this.mainGaugeWhite_Desk.el.style.strokeDashoffset = mainGaugeOffset == 0 ? 1 : mainGaugeOffset + 1;
- this.mainGaugeBlue_Desk.el.style.strokeDashoffset = mainGaugeOffset >= 681 ? 681 : mainGaugeOffset;
- } else if (mainGaugeOffset == 0 && speed <= 0) {
- this.mainGaugeBlue_Mob.el.style.strokeDashoffset = 681.1;
- this.mainGaugeWhite_Mob.el.style.strokeDashoffset = 0.1;
- this.mainGaugeWhite_Desk.el.style.strokeDashoffset = 0.1;
- this.mainGaugeBlue_Desk.el.style.strokeDashoffset = 681.1;
- }
- };
- openSpeedtestShow.prototype.showStatus = function(e) {
- this.oDoLiveStatus.el.textContent = e;
- };
- openSpeedtestShow.prototype.ConnectionError = function() {
- this.ConnectErrorMob.el.style.display = "block";
- this.ConnectErrorDesk.el.style.display = "block";
- };
- openSpeedtestShow.prototype.uploadResult = function(upload) {
- if (upload < 1) {
- this.upRestxt.el.textContent = upload.toFixed(3);
- }
- if (upload >= 1 && upload < 9999) {
- this.upRestxt.el.textContent = upload.toFixed(1);
- }
- if (upload >= 10000 && upload < 99999) {
- this.upRestxt.el.textContent = upload.toFixed(1);
- this.upRestxt.el.style.fontSize = "20px";
- }
- if (upload >= 100000) {
- this.upRestxt.el.textContent = upload.toFixed(1);
- this.upRestxt.el.style.fontSize = "18px";
- }
- };
- openSpeedtestShow.prototype.pingResults = function(data, Display) {
- var ShowData = data;
- if (Display === "Ping") {
- if (ShowData >= 1 && ShowData < 10000) {
- this.pingResult.el.textContent = Math.floor(ShowData);
- this.pingMobres.el.textContent = Math.floor(ShowData);
- } else if (ShowData >= 0 && ShowData < 1) {
- if (ShowData == 0) {
- ShowData = 0;
- }
- this.pingResult.el.textContent = ShowData;
- this.pingMobres.el.textContent = ShowData;
- }
- }
- if (Display === "Error") {
- this.oDoLiveSpeed.el.textContent = ShowData;
- }
- };
- openSpeedtestShow.prototype.downloadResult = function(download) {
- if (download < 1) {
- this.downResult.el.textContent = download.toFixed(3);
- }
- if (download >= 1 && download < 9999) {
- this.downResult.el.textContent = download.toFixed(1);
- }
- if (download >= 10000 && download < 99999) {
- this.downResult.el.textContent = download.toFixed(1);
- this.downResult.el.style.fontSize = "20px";
- }
- if (download >= 100000) {
- this.downResult.el.textContent = download.toFixed(1);
- this.downResult.el.style.fontSize = "18px";
- }
- };
- openSpeedtestShow.prototype.jitterResult = function(data, Display) {
- var ShowData = data;
- if (Display === "Jitter") {
- if (ShowData >= 1 && ShowData < 10000) {
- this.jitterDesk.el.textContent = Math.floor(ShowData);
- if (ShowData >= 1 && ShowData < 100) {
- this.JitterResultMon.el.textContent = Math.floor(ShowData);
- }
- if (ShowData >= 100) {
- var kData = (ShowData / 1000).toFixed(1);
- this.JitterResultMon.el.textContent = kData + "k";
- }
- } else if (ShowData >= 0 && ShowData < 1) {
- if (ShowData == 0) {
- ShowData = 0;
- }
- this.jitterDesk.el.textContent = ShowData;
- this.JitterResultMon.el.textContent = ShowData;
- }
- }
- };
- openSpeedtestShow.prototype.LiveSpeed = function(data, Display) {
- var ShowData = data;
- if (Display === "countDown") {
- var speed = ShowData.toFixed(0);
- this.oDoLiveSpeed.el.textContent = speed;
- return;
- }
- if (Display === "speedToZero") {
- if (typeof ShowData == "number") {
- ShowData = ShowData.toFixed(1);
- }
- if (ShowData <= 0) {
- ShowData = 0;
- }
- this.oDoLiveSpeed.el.textContent = ShowData;
- this.oDoTopSpeed.el.textContent = "1000+";
- this.oDoTopSpeed.el.style.fontSize = "16.9px";
- this.oDoTopSpeed.el.style.fill = "gray";
- return;
- }
- if (Display === "Ping") {
- if (ShowData >= 1 && ShowData < 10000) {
- this.oDoLiveSpeed.el.textContent = Math.floor(ShowData);
- } else if (ShowData >= 0 && ShowData < 1) {
- if (ShowData == 0) {
- ShowData = 0;
- }
- this.oDoLiveSpeed.el.textContent = ShowData;
- }
- } else {
- if (ShowData == 0) {
- var speed = ShowData.toFixed(0);
- this.oDoLiveSpeed.el.textContent = speed;
- }
- if (ShowData <= 1 && ShowData > 0) {
- var speed = ShowData.toFixed(3);
- this.oDoLiveSpeed.el.textContent = speed;
- }
- if (ShowData > 1) {
- var speed = ShowData.toFixed(1);
- this.oDoLiveSpeed.el.textContent = speed;
- }
- if (ShowData <= 1000) {
- this.oDoTopSpeed.el.textContent = "1000+";
- this.oDoTopSpeed.el.style.fontSize = "16.9px";
- this.oDoTopSpeed.el.style.fill = "gray";
- }
- if (ShowData >= 1010) {
- this.oDoTopSpeed.el.textContent = Math.floor(ShowData / 1010) * 1000 + "+";
- this.oDoTopSpeed.el.style.fill = "gray";
- this.oDoTopSpeed.el.style.fontSize = "17.2px";
- }
- }
- };
- openSpeedtestShow.prototype.GaugeProgresstoZero = function(currentSpeed, status) {
- var speed = currentSpeed;
- var Self = this;
- var duration = 3;
- if (speed >= 0) {
- var time = Date.now();
- var SpeedtoZero = 0 - speed;
- var interval = setInterval(function() {
- var timeNow = (Date.now() - time) / 1000;
- var speedToZero = easeOutQuint(timeNow, speed, SpeedtoZero, duration);
- Self.LiveSpeed(speedToZero, "speedToZero");
- Self.mainGaugeProgress(speedToZero);
- if (timeNow >= duration || speedToZero <= 0) {
- clearInterval(interval);
- Self.LiveSpeed(0, "speedToZero");
- Self.mainGaugeProgress(0);
- Status = status;
- }
- }, 16);
- }
- };
- openSpeedtestShow.prototype.getNonlinearDegree = function(mega_bps) {
- var i = 0;
- if (0 == mega_bps || mega_bps <= 0 || isNaN(mega_bps)) {
- return 0;
- }
- while (i < this.scale.length) {
- if (mega_bps > this.scale[i].value) {
- i++;
- } else {
- return this.scale[i - 1].degree + (mega_bps - this.scale[i - 1].value) * (this.scale[i].degree - this.scale[i - 1].degree) / (this.scale[i].value - this.scale[i - 1].value);
- }
- }
- return this.scale[this.scale.length - 1].degree;
- };
- var openSpeedtestGet = function() {
- this.OverAllTimeAvg = window.performance.now();
- this.SpeedSamples = [];
- this.FinalSpeed;
- };
- openSpeedtestGet.prototype.reset = function() {
- this.OverAllTimeAvg = window.performance.now();
- this.SpeedSamples = [];
- this.FinalSpeed = 0;
- };
- openSpeedtestGet.prototype.ArraySum = function(Arr) {
- var array = Arr;
- if (array) {
- var sum = array.reduce(function(A, B) {
- if (typeof A === "number" && typeof B === "number") {
- return A + B;
- }
- }, 0);
- return sum;
- } else {
- return 0;
- }
- };
- openSpeedtestGet.prototype.AvgSpeed = function(Livespeed, Start, duration) {
- var Self = this;
- this.timeNow = (window.performance.now() - this.OverAllTimeAvg) / 1000;
- this.FinalSpeed;
- var StartRecoding = Start;
- StartRecoding = duration - StartRecoding;
- if (this.timeNow >= StartRecoding) {
- if (Livespeed > 0) {
- this.SpeedSamples.push(Livespeed);
- }
- Self.FinalSpeed = Self.ArraySum(Self.SpeedSamples) / Self.SpeedSamples.length;
- }
- return Self.FinalSpeed;
- };
- openSpeedtestGet.prototype.uRandom = function(size, callback) {
- var size = size;
- var randomValue = new Uint32Array(262144);
- function getRandom() {
- var n = randomValue.length;
- for (var i = 0; i < n; i++) {
- randomValue[i] = Math.random() * 4294967296;
- }
- return randomValue;
- }
- var randomData = [];
- var genData = function(dataSize) {
- var dataSize = dataSize;
- for (var i = 0; i < dataSize; i++) {
- randomData[i] = getRandom();
- }
- return randomData;
- };
- return new Blob(genData(size), {type:"application/octet-stream"}, Callback(callback));
- };
- openSpeedtestGet.prototype.addEvt = function(o, e, f) {
- o.addEventListener(e, f);
- };
- openSpeedtestGet.prototype.remEvt = function(o, e, f) {
- o.removeEventListener(e, f);
- };
- var openSpeedtestEngine = function() {
- var Get = new openSpeedtestGet();
- var Show = new openSpeedtestShow();
- Show.app();
- var SendData;
- var myhostName = location.hostname;
- var key;
- var TestServerip;
- var downloadSpeed;
- var uploadSpeed;
- var dataUsedfordl;
- var dataUsedforul;
- var pingEstimate;
- var jitterEstimate;
- var logData;
- var return_data;
- var ReQ = [];
- var StartTime = [];
- var CurrentTime = [];
- var LiveSpeedArr;
- var dLoaded = 0;
- var uLoaded = 0;
- var currentSpeed = 0;
- var uploadTimeing;
- var downloadTimeing;
- var downloadTime;
- var uploadTime;
- var saveTestData;
- var stop = 0;
- function reSett() {
- StartTime = 0;
- CurrentTime = 0;
- LiveSpeedArr = 0;
- currentSpeed = 0;
- }
- var userAgentString;
- if (window.navigator.userAgent) {
- userAgentString = window.navigator.userAgent;
- } else {
- userAgentString = "Not Found";
- }
- var ulFinal = ulDuration * 0.6;
- var dlFinal = dlDuration * 0.6;
- function setFinal() {
- if (ulDuration * 0.6 >= 7) {
- ulFinal = 7;
- }
- if (dlDuration * 0.6 >= 7) {
- dlFinal = 7;
- }
- }
- setFinal();
- var launch = true;
- var init = true;
- Get.addEvt(Show.settingsMob.el, "click", ShowIP);
- Get.addEvt(Show.settingsDesk.el, "click", ShowIP);
- Get.addEvt(Show.startButtonDesk.el, "click", runTasks);
- Get.addEvt(Show.startButtonMob.el, "click", runTasks);
- Get.addEvt(document, "keypress", hiEnter);
- var addEvent = true;
- var getParams = function(url) {
- var params = {};
- var parser = document.createElement("a");
- parser.href = url;
- var query = parser.search.substring(1);
- var vars = query.split("&");
- for (var i = 0; i < vars.length; i++) {
- var pair = vars[i].split("=");
- params[pair[0]] = decodeURIComponent(pair[1]);
- }
- return params;
- };
- var getCommand = getParams(window.location.href.toLowerCase());
- if (setPingSamples) {
- if (typeof getCommand.ping === "string" || typeof getCommand.p === "string") {
- var setPing;
- if (typeof getCommand.ping !== "undefined") {
- setPing = getCommand.ping;
- } else if (typeof getCommand.p !== "undefined") {
- setPing = getCommand.p;
- }
- if (setPing > 0) {
- pingSamples = setPing;
- pingSamples = setPing;
- }
- }
- }
- if (setPingTimeout) {
- if (typeof getCommand.out === "string" || typeof getCommand.o === "string") {
- var setOut;
- if (typeof getCommand.out !== "undefined") {
- setOut = getCommand.out;
- } else if (typeof getCommand.o !== "undefined") {
- setOut = getCommand.o;
- }
- if (setOut > 1) {
- pingTimeOut = setOut;
- pingTimeOut = setOut;
- }
- }
- }
- if (setHTTPReq) {
- if (typeof getCommand.xhr === "string" || typeof getCommand.x === "string") {
- var setThreads;
- if (typeof getCommand.xhr !== "undefined") {
- setThreads = getCommand.xhr;
- } else if (typeof getCommand.x !== "undefined") {
- setThreads = getCommand.x;
- }
- if (setThreads > 0 && setThreads <= 32) {
- dlThreads = setThreads;
- ulThreads = setThreads;
- }
- }
- }
- function isValidHttpUrl(str) {
- var regex = /(?:https?):\/\/(\w+:?\w*)?(\S+)(:\d+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/;
- if (!regex.test(str)) {
- return false;
- } else {
- return true;
- }
- }
- if (selectServer) {
- if (typeof getCommand.host === "string" || typeof getCommand.h === "string") {
- var severAddress;
- if (typeof getCommand.host !== "undefined") {
- severAddress = getCommand.host;
- } else if (typeof getCommand.h !== "undefined") {
- severAddress = getCommand.h;
- }
- if (isValidHttpUrl(severAddress)) {
- openSpeedTestServerList = [{ServerName:"Home", Download:severAddress + "/downloading", Upload:severAddress + "/upload", ServerIcon:"DefaultIcon",},];
- }
- }
- }
- var custom = parseInt(getCommand.stress);
- var customS = parseInt(getCommand.s);
- var runStress;
- var runStressCustom;
- if (typeof getCommand.stress === "string") {
- runStress = getCommand.stress;
- runStressCustom = custom;
- } else if (typeof getCommand.s === "string") {
- runStress = getCommand.s;
- runStressCustom = customS;
- }
- if (runStress && stressTest) {
- if (runStress === "low" || runStress === "l") {
- dlDuration = 300;
- ulDuration = 300;
- }
- if (runStress === "medium" || runStress === "m") {
- dlDuration = 600;
- ulDuration = 600;
- }
- if (runStress === "high" || runStress === "h") {
- dlDuration = 900;
- ulDuration = 900;
- }
- if (runStress === "veryhigh" || runStress === "v") {
- dlDuration = 1800;
- ulDuration = 1800;
- }
- if (runStress === "extreme" || runStress === "e") {
- dlDuration = 3600;
- ulDuration = 3600;
- }
- if (runStress === "day" || runStress === "d") {
- dlDuration = 86400;
- ulDuration = 86400;
- }
- if (runStress === "year" || runStress === "y") {
- dlDuration = 31557600;
- ulDuration = 31557600;
- }
- if (custom > 12 || customS > 12) {
- dlDuration = runStressCustom;
- ulDuration = runStressCustom;
- }
- }
- var overheadClean = parseInt(getCommand.clean);
- var overheadCleanC = parseInt(getCommand.c);
- var customOverHeadValue = 1;
- if (overheadClean) {
- customOverHeadValue = overheadClean;
- } else if (overheadCleanC) {
- customOverHeadValue = overheadCleanC;
- }
- if (enableClean) {
- if (typeof getCommand.clean === "string" || typeof getCommand.c === "string") {
- if (overheadClean >= 1 || overheadCleanC >= 1) {
- if (overheadClean < 5 || overheadCleanC < 5) {
- upAdjust = 1 + customOverHeadValue / 100;
- dlAdjust = 1 + customOverHeadValue / 100;
- }
- } else {
- upAdjust = 1;
- dlAdjust = 1;
- }
- }
- }
- var OpenSpeedTestRun = parseInt(getCommand.run);
- var OpenSpeedTestRunR = parseInt(getCommand.r);
- var OpenSpeedTestStart;
- if (enableRun) {
- if (typeof getCommand.run === "string" || typeof getCommand.r === "string") {
- if (OpenSpeedTestRun > 0) {
- OpenSpeedTestStart = OpenSpeedTestRun;
- } else if (OpenSpeedTestRunR > 0) {
- OpenSpeedTestStart = OpenSpeedTestRunR;
- } else {
- OpenSpeedTestStart = 0;
- }
- }
- }
- if (OpenSpeedTestStart >= 0) {
- if (launch) {
- runTasks();
- }
- }
- var runTest = getCommand.test;
- var runTestT = getCommand.t;
- var SelectTest = false;
- if (selectTest) {
- if (typeof runTest === "string" || typeof runTestT === "string") {
- var runTestC;
- if (runTest) {
- runTestC = runTest;
- SelectTest = runTest;
- } else if (runTestT) {
- runTestC = runTestT;
- SelectTest = runTestT;
- }
- if (runTestC === "download" || runTestC === "d") {
- uploadSpeed = 0;
- dataUsedforul = 0;
- SelectTest = "Download";
- if (launch) {
- runTasks();
- }
- } else if (runTestC === "upload" || runTestC === "u") {
- downloadSpeed = 0;
- dataUsedfordl = 0;
- SelectTest = "Upload";
- stop = 1;
- if (launch) {
- runTasks();
- }
- } else if (runTestC === "ping" || runTestC === "p") {
- uploadSpeed = 0;
- dataUsedforul = 0;
- downloadSpeed = 0;
- dataUsedfordl = 0;
- SelectTest = "Ping";
- if (launch) {
- runTasks();
- }
- } else {
- SelectTest = false;
- }
- }
- }
- var Startit = 0;
- function removeEvts() {
- Get.remEvt(Show.settingsMob.el, "click", ShowIP);
- Get.remEvt(Show.settingsDesk.el, "click", ShowIP);
- Get.remEvt(Show.startButtonDesk.el, "click", runTasks);
- Get.remEvt(Show.startButtonMob.el, "click", runTasks);
- Get.remEvt(document, "keypress", hiEnter);
- }
- var requestIP = false;
- function ShowIP() {
- if (requestIP) {
- Show.YourIP.el.textContent = "Please wait..";
- ServerConnect(7);
- requestIP = false;
- }
- Show.ip();
- }
- function runTasks() {
- if (addEvent) {
- removeEvts();
- addEvent = false;
- }
- if (OpenSpeedTestStart >= 0) {
- launch = false;
- Show.userInterface();
- init = false;
- var AutoTme = Math.ceil(Math.abs(OpenSpeedTestStart));
- Show.showStatus("Automatic Test Starts in ...");
- var autoTest = setInterval(countDownF, 1000);
- }
- function countDownF() {
- if (AutoTme >= 1) {
- AutoTme = AutoTme - 1;
- Show.LiveSpeed(AutoTme, "countDown");
- } else {
- if (AutoTme <= 0) {
- clearInterval(autoTest);
- launch = true;
- OpenSpeedTestStart = undefined;
- runTasks();
- }
- }
- }
- if (openSpeedTestServerList === "fetch" && launch === true) {
- launch = false;
- Show.showStatus("Fetching Server Info..");
- ServerConnect(6);
- }
- if (launch === true) {
- if (SelectTest === "Ping") {
- testRun();
- } else if (SelectTest === "Download") {
- testRun();
- } else if (SelectTest === "Upload") {
- testRun();
- } else if (SelectTest === false) {
- testRun();
- }
- }
- }
- var osttm = "\u2122";
- var myname = "OpenSpeedTest";
- var com = ".com";
- var ost = myname + osttm;
- function hiEnter(e) {
- if (e.key === "Enter") {
- runTasks();
- }
- }
- var showResult = 0;
- if (openChannel === "web") {
- showResult = webRe;
- requestIP = true;
- }
- if (openChannel === "widget") {
- showResult = widgetRe;
- requestIP = true;
- }
- if (openChannel === "selfwidget") {
- showResult = widgetRe;
- TestServerip = domainx;
- myhostName = TestServerip;
- }
- if (openChannel === "dev") {
- }
- function testRun() {
- if (init) {
- Show.userInterface();
- init = false;
- }
- OpenSpeedtest();
- }
- function OpenSpeedtest() {
- if (openChannel === "widget" || openChannel === "web") {
- ServerConnect(1);
- }
- function readyToUP() {
- uploadTime = window.performance.now();
- upReq();
- }
- var Engine = setInterval(function() {
- if (Status === "Loaded") {
- Status = "busy";
- sendPing(0);
- }
- if (Status === "Ping") {
- Status = "busy";
- Show.showStatus("Milliseconds");
- }
- if (Status === "Download") {
- Show.showStatus("Initializing..");
- Get.reset();
- reSett();
- Show.reset();
- downloadTime = window.performance.now();
- downReq();
- Status = "initDown";
- }
- if (Status === "Downloading") {
- Show.Symbol(0);
- if (Startit == 0) {
- Startit = 1;
- Show.showStatus("Testing download speed..");
- var extraTime = (window.performance.now() - downloadTime) / 1000;
- dReset = extraTime;
- Show.progress(1, dlDuration + 2.5);
- dlDuration += extraTime;
- }
- downloadTimeing = (window.performance.now() - downloadTime) / 1000;
- reportCurrentSpeed("dl");
- Show.showStatus("Mbps download");
- Show.mainGaugeProgress(currentSpeed);
- Show.LiveSpeed(currentSpeed);
- Show.Graph(currentSpeed, 0);
- downloadSpeed = Get.AvgSpeed(currentSpeed, dlFinal, dlDuration);
- if (downloadTimeing >= dlDuration && ProG == "done") {
- if (SelectTest) {
- Show.GaugeProgresstoZero(currentSpeed, "SendR");
- Show.showStatus("All done");
- Show.Symbol(2);
- } else {
- Show.GaugeProgresstoZero(currentSpeed, "Upload");
- }
- Show.downloadResult(downloadSpeed);
- dataUsedfordl = dLoaded;
- stop = 1;
- Status = "busy";
- reSett();
- Get.reset();
- }
- }
- if (Status == "Upload") {
- if (stop === 1) {
- Show.Symbol(1);
- Status = "initup";
- Show.showStatus("Initializing..");
- Show.LiveSpeed("...", "speedToZero");
- SendData = Get.uRandom(ulDataSize, readyToUP);
- if (SelectTest) {
- Startit = 1;
- }
- }
- }
- if (Status === "Uploading") {
- if (Startit == 1) {
- Startit = 2;
- Show.showStatus("Testing upload speed..");
- currentSpeed = 0;
- Get.reset();
- Show.reset();
- var extraUTime = (window.performance.now() - uploadTime) / 1000;
- uReset = extraUTime;
- Show.progress(false, ulDuration + 2.5);
- ulDuration += extraUTime;
- }
- Show.showStatus("Mbps upload");
- uploadTimeing = (window.performance.now() - uploadTime) / 1000;
- reportCurrentSpeed("up");
- Show.mainGaugeProgress(currentSpeed);
- Show.LiveSpeed(currentSpeed);
- Show.Graph(currentSpeed, 1);
- uploadSpeed = Get.AvgSpeed(currentSpeed, ulFinal, ulDuration);
- if (uploadTimeing >= ulDuration && stop == 1) {
- dataUsedforul = uLoaded;
- Show.uploadResult(uploadSpeed);
- Show.GaugeProgresstoZero(currentSpeed, "SendR");
- SendData = undefined;
- Show.showStatus("All done");
- Show.Symbol(2);
- Status = "busy";
- stop = 0;
- }
- }
- if (Status === "Error") {
- Show.showStatus("Check your network connection status.");
- Show.ConnectionError();
- Status = "busy";
- clearInterval(Engine);
- var dummyElement = document.createElement("div");
- dummyElement.innerHTML = '';
- var htmlAnchorElement = dummyElement.querySelector("a");
- Show.oDoLiveSpeed.el.textContent = "Network Error";
- var circleSVG = document.getElementById("oDoLiveSpeed");
- htmlAnchorElement.innerHTML = circleSVG.innerHTML;
- circleSVG.innerHTML = dummyElement.innerHTML;
- }
- if (Status === "SendR") {
- Show.showStatus("All done");
- var dummyElement = document.createElement("div");
- dummyElement.innerHTML = '';
- var htmlAnchorElement = dummyElement.querySelector("a");
- Show.oDoLiveSpeed.el.textContent = ost;
- var circleSVG = document.getElementById("oDoLiveSpeed");
- htmlAnchorElement.innerHTML = circleSVG.innerHTML;
- circleSVG.innerHTML = dummyElement.innerHTML;
- if (location.hostname != myname.toLowerCase() + com) {
- saveTestData = "https://" + myname.toLowerCase() + com + "/results/show.php?" + "&d=" + downloadSpeed.toFixed(3) + "&u=" + uploadSpeed.toFixed(3) + "&p=" + pingEstimate + "&j=" + jitterEstimate + "&dd=" + (dataUsedfordl / 1048576).toFixed(3) + "&ud=" + (dataUsedforul / 1048576).toFixed(3) + "&ua=" + userAgentString;
- saveTestData = encodeURI(saveTestData);
- var circleSVG2 = document.getElementById("resultsData");
- circleSVG2.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", saveTestData);
- circleSVG2.setAttribute("target", "_blank");
- if (saveData) {
- ServerConnect(5);
- }
- } else {
- ServerConnect(3);
- }
- Status = "busy";
- clearInterval(Engine);
- }
- }, 100);
- }
- function downReq() {
- for (var i = 0; i < dlThreads; i++) {
- setTimeout(function(i) {
- SendReQ(i);
- }, dlDelay * i, i);
- }
- }
- function upReq() {
- for (var i = 0; i < ulThreads; i++) {
- setTimeout(function(i) {
- SendUpReq(i);
- }, ulDelay * i, i);
- }
- }
- var dLoad = 0;
- var dDiff = 0;
- var dTotal = 0;
- var dtLoad = 0;
- var dtDiff = 0;
- var dtTotal = 0;
- var dRest = 0;
- var dReset;
- var uReset;
- var uLoad = 0;
- var uDiff = 0;
- var uTotal = 0;
- var utLoad = 0;
- var utDiff = 0;
- var utTotal = 0;
- var uRest = 0;
- var dualReset;
- var neXT = dlDuration * 1000 - 6000;
- var dualupReset;
- var neXTUp = ulDuration * 1000 - 6000;
- function reportCurrentSpeed(now) {
- if (now === "dl") {
- var dTime = downloadTimeing * 1000;
- if (dTime > dReset * 1000 + dlFinal / 2 * 1000 && dRest === 0) {
- dRest = 1;
- dtTotal = dtTotal * 0.01;
- dTotal = dTotal * 0.01;
- dualReset = dTime + 10000;
- }
- if (dTime >= dualReset && dualReset < neXT) {
- dualReset += 10000;
- dtTotal = dtTotal * 0.01;
- dTotal = dTotal * 0.01;
- }
- dLoad = dLoaded <= 0 ? 0 : dLoaded - dDiff;
- dDiff = dLoaded;
- dTotal += dLoad;
- dtLoad = dtDiff = 0 ? 0 : dTime - dtDiff;
- dtDiff = dTime;
- dtTotal += dtLoad;
- if (dTotal > 0) {
- LiveSpeedArr = dTotal / dtTotal / 125 * upAdjust;
- currentSpeed = LiveSpeedArr;
- }
- }
- if (now === "up") {
- var Tym = uploadTimeing * 1000;
- if (Tym > uReset * 1000 + ulFinal / 2 * 1000 && uRest === 0) {
- uRest = 1;
- utTotal = utTotal * 0.1;
- uTotal = uTotal * 0.1;
- dualupReset = Tym + 10000;
- }
- if (Tym >= dualupReset && dualupReset < neXTUp) {
- dualupReset += 10000;
- utTotal = utTotal * 0.1;
- uTotal = uTotal * 0.1;
- }
- uLoad = uLoaded <= 0 ? 0 : uLoaded - uDiff;
- uDiff = uLoaded;
- uTotal += uLoad;
- utLoad = utDiff = 0 ? 0 : Tym - utDiff;
- utDiff = Tym;
- utTotal += utLoad;
- if (uTotal > 0) {
- LiveSpeedArr = uTotal / utTotal / 125 * upAdjust;
- currentSpeed = LiveSpeedArr;
- }
- }
- }
- function SendReQ(i) {
- var lastLoaded = 0;
- var OST = new XMLHttpRequest();
- ReQ[i] = OST;
- ReQ[i].open("GET", fianlPingServer.Download + "?n=" + Math.random(), true);
- ReQ[i].onprogress = function(e) {
- if (stop === 1) {
- ReQ[i].abort();
- ReQ[i] = null;
- ReQ[i] = undefined;
- delete ReQ[i];
- return false;
- }
- if (Status == "initDown") {
- Status = "Downloading";
- }
- var eLoaded = e.loaded <= 0 ? 0 : e.loaded - lastLoaded;
- if (isNaN(eLoaded) || !isFinite(eLoaded) || eLoaded < 0) {
- return false;
- }
- dLoaded += eLoaded;
- lastLoaded = e.loaded;
- };
- ReQ[i].onload = function(e) {
- if (lastLoaded === 0) {
- dLoaded += e.total;
- }
- if (Status == "initDown") {
- Status = "Downloading";
- }
- if (ReQ[i]) {
- ReQ[i].abort();
- ReQ[i] = null;
- ReQ[i] = undefined;
- delete ReQ[i];
- }
- if (stop === 0) {
- SendReQ(i);
- }
- };
- ReQ[i].onerror = function(e) {
- if (stop === 0) {
- SendReQ(i);
- }
- };
- ReQ[i].responseType = "arraybuffer";
- ReQ[i].send();
- }
- var uReQ = [];
- function SendUpReq(i) {
- var lastULoaded = 0;
- var OST = new XMLHttpRequest();
- uReQ[i] = OST;
- uReQ[i].open("POST", fianlPingServer.Upload + "?n=" + Math.random(), true);
- uReQ[i].upload.onprogress = function(e) {
- if (Status == "initup" && some === undefined) {
- var some;
- Status = "Uploading";
- }
- if (uploadTimeing >= ulDuration) {
- uReQ[i].abort();
- uReQ[i] = null;
- uReQ[i] = undefined;
- delete uReQ[i];
- return false;
- }
- var eLoaded = e.loaded <= 0 ? 0 : e.loaded - lastULoaded;
- if (isNaN(eLoaded) || !isFinite(eLoaded) || eLoaded < 0) {
- return false;
- }
- uLoaded += eLoaded;
- lastULoaded = e.loaded;
- };
- uReQ[i].onload = function() {
- if (lastULoaded === 0) {
- uLoaded += ulDataSize * 1048576;
- if (uploadTimeing >= ulDuration) {
- uReQ[i].abort();
- uReQ[i] = null;
- uReQ[i] = undefined;
- delete uReQ[i];
- return false;
- }
- }
- if (Status == "initup" && some === undefined) {
- var some;
- Status = "Uploading";
- }
- if (uReQ[i]) {
- uReQ[i].abort();
- uReQ[i] = null;
- uReQ[i] = undefined;
- delete uReQ[i];
- }
- if (stop === 1) {
- SendUpReq(i);
- }
- };
- uReQ[i].onerror = function(e) {
- if (uploadTimeing <= ulDuration) {
- SendUpReq(i);
- }
- };
- uReQ[i].setRequestHeader("Content-Type", "application/octet-stream");
- if (i > 0 && uLoaded <= 17000) {
- } else {
- uReQ[i].send(SendData);
- }
- }
- function sendPing() {
- readServerList();
- }
- var fianlPingServer;
- var statusPing;
- var statusPingFinal;
- var statusJitter;
- var statusJitterFinal;
- var statusPingTest;
- var pingSendStatus = -1;
- var finalPing = [];
- var pingServer = [];
- var finalJitter = [];
- var pingSendLength = openSpeedTestServerList.length;
- function readServerList() {
- pingSendLength = openSpeedTestServerList.length;
- Status = "Ping";
- performance.clearResourceTimings();
- if (pingSendStatus < pingSendLength - 1) {
- pingSendStatus++;
- if (statusPingTest != "Stop") {
- sendPingRequest(openSpeedTestServerList[pingSendStatus], readServerList);
- }
- } else {
- if (pingServer.length >= 1) {
- var finalLeastPingResult = Math.min.apply(Math, finalPing);
- var finalLeastPingResultIndex = finalPing.indexOf(finalLeastPingResult);
- fianlPingServer = pingServer[finalLeastPingResultIndex];
- statusPingFinal = finalLeastPingResult;
- statusJitterFinal = finalJitter[finalLeastPingResultIndex];
- statusPingTest = "Busy";
- Show.LiveSpeed(statusPingFinal, "Ping");
- Show.pingResults(statusPingFinal, "Ping");
- Show.jitterResult(statusJitterFinal, "Jitter");
- pingEstimate = statusPingFinal;
- jitterEstimate = statusJitterFinal;
- if (SelectTest) {
- if (SelectTest == "Ping") {
- Status = "SendR";
- } else {
- Status = SelectTest;
- }
- } else {
- Status = "Download";
- }
- } else {
- if (pingServer.Download) {
- } else {
- Status = "Error";
- }
- }
- }
- }
- function sendPingRequest(serverListElm, callback) {
- var pingSamplesSend = 0;
- var pingResult = [];
- var jitterResult = [];
- function sendNewPingReq() {
- if (pingSamplesSend < pingSamples) {
- pingSamplesSend++;
- if (statusPingTest != "Stop") {
- PingRequest();
- }
- } else {
- if (pingResult.length > 1) {
- jitterResult.sort(function(a, b) {
- return a - b;
- });
- jitterResult = jitterResult.slice(0, jitterResult.length * jitterFinalSample);
- jitterResult = jitterResult.reduce(function(acc, val) {
- return acc + val;
- }, 0) / jitterResult.length;
- var leastJitter = jitterResult.toFixed(1);
- var leastPing = Math.min.apply(Math, pingResult);
- finalPing.push(leastPing);
- pingServer.push(serverListElm);
- finalJitter.push(leastJitter);
- if (typeof callback === "function") {
- callback();
- }
- } else {
- if (typeof callback === "function") {
- callback();
- }
- }
- }
- }
- function PingRequest() {
- var OST = new XMLHttpRequest();
- var ReQ = OST;
- if (statusPingTest != "Stop") {
- ReQ.abort();
- }
- ReQ.open(pingMethod, serverListElm[pingFile] + "?n=" + Math.random(), true);
- ReQ.timeout = pingTimeOut;
- var startTime = window.performance.now();
- ReQ.send();
- ReQ.onload = function() {
- if (this.status === 200 && this.readyState === 4) {
- var endTime = Math.floor(window.performance.now() - startTime);
- var perfNum = performance.getEntries();
- perfNum = perfNum[perfNum.length - 1];
- var perfPing;
- if (perfNum.initiatorType === "xmlhttprequest") {
- perfPing = parseFloat(perfNum.duration.toFixed(1));
- } else {
- perfPing = endTime;
- }
- if (pingSamplesSend > 250) {
- perfPing = endTime;
- }
- if (perfPing <= 0) {
- statusPing = 0.1;
- pingResult.push(0.1);
- } else {
- statusPing = perfPing;
- pingResult.push(perfPing);
- }
- if (pingResult.length > 1) {
- var jitterCalc = Math.abs(pingResult[pingResult.length - 1] - pingResult[pingResult.length - 2]).toFixed(1);
- jitterResult.push(parseFloat(jitterCalc));
- statusJitter = jitterCalc;
- Show.LiveSpeed(perfPing, "Ping");
- Show.pingResults(perfPing, "Ping");
- Show.jitterResult(jitterCalc, "Jitter");
- }
- sendNewPingReq();
- }
- if (this.status === 404 && this.readyState === 4) {
- pingSamplesSend++;
- sendNewPingReq();
- }
- };
- ReQ.onerror = function(e) {
- pingSamplesSend++;
- sendNewPingReq();
- };
- ReQ.ontimeout = function(e) {
- pingSamplesSend++;
- sendNewPingReq();
- };
- }
- PingRequest();
- }
- var ServerConnect = function(auth) {
- var Self = this;
- var xhr = new XMLHttpRequest();
- var url = OpenSpeedTestdb;
- if (auth == 1) {
- url = webIP;
- }
- if (auth == 5) {
- url = saveDataURL;
- }
- if (auth == 7) {
- url = get_IP;
- }
- xhr.open("POST", url, true);
- xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4 && xhr.status == 200) {
- return_data = xhr.responseText.trim();
- if (auth == 2) {
- key = return_data;
- }
- if (auth == 1) {
- TestServerip = return_data;
- }
- if (auth == 3) {
- setTimeout(function() {
- location.href = showResult + return_data;
- }, 1500);
- }
- if (auth == 6) {
- openSpeedTestServerList = JSON.parse(return_data);
- launch = true;
- runTasks();
- }
- if (auth == 7) {
- Show.YourIP.el.textContent = return_data;
- }
- }
- };
- if (auth == 2) {
- logData = "r=n";
- }
- if (auth == 3) {
- logData = "r=l" + "&d=" + downloadSpeed + "&u=" + uploadSpeed + "&dd=" + dataUsedfordl / 1048576 + "&ud=" + dataUsedforul / 1048576 + "&p=" + pingEstimate + "&do=" + myhostName + "&S=" + key + "&sip=" + TestServerip + "&jit=" + jitterEstimate + "&ua=" + userAgentString;
- }
- if (auth == 5) {
- logData = saveTestData;
- }
- if (auth == 6) {
- logData = "r=s";
- }
- xhr.send(logData);
- };
- };
- OpenSpeedTest.Start = function() {
- new openSpeedtestEngine();
- };
-})(window.OpenSpeedTest = window.OpenSpeedTest || {});
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/js/app-2.5.4.min.js b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/js/app-2.5.4.min.js
deleted file mode 100644
index 0df99a1f..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/assets/js/app-2.5.4.min.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Official Website : https://OpenSpeedTest.COM | Email: support@openspeedtest.com
- Developed by : Vishnu | https://Vishnu.Pro | Email : me@vishnu.pro
- Like this Project? Please Donate NOW & Keep us Alive -> https://go.openspeedtest.com/Donate
- Speed Test by OpenSpeedTest™️ is Free and Open-Source Software (FOSS) with MIT License.
- Read full license terms @ http://go.openspeedtest.com/License
- If you have any Questions, ideas or Comments Please Send it via -> https://go.openspeedtest.com/SendMessage
-*/
-window.onload=function(){var X=document.getElementById("OpenSpeedTest-UI");X.parentNode.replaceChild(X.contentDocument.documentElement,X);ostOnload();OpenSpeedTest.Start()};
-(function(X){function h(c){if(!(this instanceof h))return new h(c);this.el=document.getElementById(c)}var m,Ma,Na=function(c){c&&"function"===typeof c&&c()};h.prototype.fade=function(c,d,a){var f="in"===c,t=f?0:1,w=14/d,n=this;f&&(n.el.style.display="block",n.el.style.opacity=t);var q=window.setInterval(function(){t=f?t+w:t-w;n.el.style.opacity=t;0>=t&&(n.el.style.display="none");(0>=t||1<=t)&&window.clearInterval(q,Na(a))},14)};var Oa=function(c,d,a,f){c/=f;c--;return a*(c*c*c+1)+d},r=function(){this.YourIP=
-h("YourIP");this.ipDesk=h("ipDesk");this.ipMob=h("ipMob");this.downSymbolDesk=h("downSymbolDesk");this.upSymbolDesk=h("upSymbolDesk");this.upSymbolMob=h("upSymbolMob");this.downSymbolMob=h("downSymbolMob");this.settingsMob=h("settingsMob");this.settingsDesk=h("settingsDesk");this.oDoLiveStatus=h("oDoLiveStatus");this.ConnectErrorMob=h("ConnectErrorMob");this.ConnectErrorDesk=h("ConnectErrorDesk");this.downResult=h("downResult");this.upRestxt=h("upRestxt");this.pingResult=h("pingResult");this.jitterDesk=
-h("jitterDesk");this.pingMobres=h("pingMobres");this.JitterResultMon=h("JitterResultMon");this.JitterResultms=h("JitterResultms");this.UI_Desk=h("UI-Desk");this.UI_Mob=h("UI-Mob");this.oDoTopSpeed=h("oDoTopSpeed");this.startButtonMob=h("startButtonMob");this.startButtonDesk=h("startButtonDesk");this.intro_Desk=h("intro-Desk");this.intro_Mob=h("intro-Mob");this.loader=h("loading_app");this.OpenSpeedtest=h("OpenSpeedtest");this.mainGaugebg_Desk=h("mainGaugebg-Desk");this.mainGaugeBlue_Desk=h("mainGaugeBlue-Desk");
-this.mainGaugeWhite_Desk=h("mainGaugeWhite-Desk");this.mainGaugebg_Mob=h("mainGaugebg-Mob");this.mainGaugeBlue_Mob=h("mainGaugeBlue-Mob");this.mainGaugeWhite_Mob=h("mainGaugeWhite-Mob");this.oDoLiveSpeed=h("oDoLiveSpeed");this.progressStatus_Mob=h("progressStatus-Mob");this.progressStatus_Desk=h("progressStatus-Desk");this.graphc1=h("graphc1");this.graphc2=h("graphc2");this.graphMob2=h("graphMob2");this.graphMob1=h("graphMob1");this.text=h("text");this.scale=[{degree:680,value:0},{degree:570,value:.5},
-{degree:460,value:1},{degree:337,value:10},{degree:220,value:100},{degree:115,value:500},{degree:0,value:1E3}];this.polygon=this.chart=this.element="";this.width=200;this.height=50;this.maxValue=0;this.values=[];this.points=[];this.vSteps=5;this.measurements=[];this.points=[]};r.prototype.reset=function(){this.polygon=this.chart=this.element="";this.width=200;this.height=50;this.maxValue=0;this.values=[];this.points=[];this.vSteps=5;this.measurements=[];this.points=[]};r.prototype.ip=function(){"block"===
-this.ipDesk.el.style.display?(this.ipDesk.el.style.display="none",this.ipMob.el.style.display="none"):(this.ipDesk.el.style.display="block",this.ipMob.el.style.display="block")};r.prototype.prePing=function(){this.loader.fade("out",500);this.OpenSpeedtest.fade("in",1E3)};r.prototype.app=function(){this.loader.fade("out",500,this.ShowAppIntro())};r.prototype.ShowAppIntro=function(){this.OpenSpeedtest.fade("in",1E3)};r.prototype.userInterface=function(){this.intro_Desk.fade("out",1E3);this.intro_Mob.fade("out",
-1E3,this.ShowUI())};r.prototype.ShowUI=function(){this.UI_Desk.fade("in",1E3);this.UI_Mob.fade("in",1E3,function(c){m="Loaded";console.log("Developed by Vishnu. Email --\x3e me@vishnu.pro")})};r.prototype.Symbol=function(c){0==c&&(this.downSymbolMob.el.style.display="block",this.downSymbolDesk.el.style.display="block",this.upSymbolMob.el.style.display="none",this.upSymbolDesk.el.style.display="none");1==c&&(this.downSymbolMob.el.style.display="none",this.downSymbolDesk.el.style.display="none",this.upSymbolMob.el.style.display=
-"block",this.upSymbolDesk.el.style.display="block");2==c&&(this.downSymbolMob.el.style.display="none",this.downSymbolDesk.el.style.display="none",this.upSymbolMob.el.style.display="none",this.upSymbolDesk.el.style.display="none")};r.prototype.Graph=function(c,d){function a(q,M){for(n=f.maxValue=0;nf.maxValue&&(f.maxValue=f.values[n]);f.maxValue=Math.ceil(f.maxValue);if(1=d&&(clearInterval(t),Ma="done",a.progressStatus_Desk.el.style.strokeDashoffset=800,a.progressStatus_Mob.el.style.strokeDashoffset=800)},14)};r.prototype.mainGaugeProgress=function(c){var d=c;0>d&&(d=0);var a=this.getNonlinearDegree(d);0=d&&(this.mainGaugeBlue_Mob.el.style.strokeDashoffset=681.1,this.mainGaugeWhite_Mob.el.style.strokeDashoffset=.1,this.mainGaugeWhite_Desk.el.style.strokeDashoffset=.1,this.mainGaugeBlue_Desk.el.style.strokeDashoffset=681.1)};r.prototype.showStatus=function(c){this.oDoLiveStatus.el.textContent=c};r.prototype.ConnectionError=function(){this.ConnectErrorMob.el.style.display=
-"block";this.ConnectErrorDesk.el.style.display="block"};r.prototype.uploadResult=function(c){1>c&&(this.upRestxt.el.textContent=c.toFixed(3));1<=c&&9999>c&&(this.upRestxt.el.textContent=c.toFixed(1));1E4<=c&&99999>c&&(this.upRestxt.el.textContent=c.toFixed(1),this.upRestxt.el.style.fontSize="20px");1E5<=c&&(this.upRestxt.el.textContent=c.toFixed(1),this.upRestxt.el.style.fontSize="18px")};r.prototype.pingResults=function(c,d){var a=c;"Ping"===d&&(1<=a&&1E4>a?(this.pingResult.el.textContent=Math.floor(a),
-this.pingMobres.el.textContent=Math.floor(a)):0<=a&&1>a&&(0==a&&(a=0),this.pingResult.el.textContent=a,this.pingMobres.el.textContent=a));"Error"===d&&(this.oDoLiveSpeed.el.textContent=a)};r.prototype.downloadResult=function(c){1>c&&(this.downResult.el.textContent=c.toFixed(3));1<=c&&9999>c&&(this.downResult.el.textContent=c.toFixed(1));1E4<=c&&99999>c&&(this.downResult.el.textContent=c.toFixed(1),this.downResult.el.style.fontSize="20px");1E5<=c&&(this.downResult.el.textContent=c.toFixed(1),this.downResult.el.style.fontSize=
-"18px")};r.prototype.jitterResult=function(c,d){var a=c;"Jitter"===d&&(1<=a&&1E4>a?(this.jitterDesk.el.textContent=Math.floor(a),1<=a&&100>a&&(this.JitterResultMon.el.textContent=Math.floor(a)),100<=a&&(a=(a/1E3).toFixed(1),this.JitterResultMon.el.textContent=a+"k")):0<=a&&1>a&&(0==a&&(a=0),this.jitterDesk.el.textContent=a,this.JitterResultMon.el.textContent=a))};r.prototype.LiveSpeed=function(c,d){var a=c;if("countDown"===d){var f=a.toFixed(0);this.oDoLiveSpeed.el.textContent=f}else"speedToZero"===
-d?("number"==typeof a&&(a=a.toFixed(1)),0>=a&&(a=0),this.oDoLiveSpeed.el.textContent=a,this.oDoTopSpeed.el.textContent="1000+",this.oDoTopSpeed.el.style.fontSize="16.9px",this.oDoTopSpeed.el.style.fill="gray"):"Ping"===d?1<=a&&1E4>a?this.oDoLiveSpeed.el.textContent=Math.floor(a):0<=a&&1>a&&(0==a&&(a=0),this.oDoLiveSpeed.el.textContent=a):(0==a&&(f=a.toFixed(0),this.oDoLiveSpeed.el.textContent=f),1>=a&&0=a&&(this.oDoTopSpeed.el.textContent="1000+",this.oDoTopSpeed.el.style.fontSize="16.9px",this.oDoTopSpeed.el.style.fill="gray"),1010<=a&&(this.oDoTopSpeed.el.textContent=1E3*Math.floor(a/1010)+"+",this.oDoTopSpeed.el.style.fill="gray",this.oDoTopSpeed.el.style.fontSize="17.2px"))};r.prototype.GaugeProgresstoZero=function(c,d){var a=this;if(0<=c)var f=Date.now(),t=0-c,w=setInterval(function(){var n=(Date.now()-f)/1E3;var q=n/3;q--;q=t*(q*q*q*q*q+1)+c;a.LiveSpeed(q,"speedToZero");a.mainGaugeProgress(q);
-if(3<=n||0>=q)clearInterval(w),a.LiveSpeed(0,"speedToZero"),a.mainGaugeProgress(0),m=d},16)};r.prototype.getNonlinearDegree=function(c){var d=0;if(0==c||0>=c||isNaN(c))return 0;for(;dthis.scale[d].value)d++;else return this.scale[d-1].degree+(c-this.scale[d-1].value)*(this.scale[d].degree-this.scale[d-1].degree)/(this.scale[d].value-this.scale[d-1].value);return this.scale[this.scale.length-1].degree};var O=function(){this.OverAllTimeAvg=window.performance.now();this.SpeedSamples=
-[];this.FinalSpeed};O.prototype.reset=function(){this.OverAllTimeAvg=window.performance.now();this.SpeedSamples=[];this.FinalSpeed=0};O.prototype.ArraySum=function(c){return c?c.reduce(function(d,a){if("number"===typeof d&&"number"===typeof a)return d+a},0):0};O.prototype.AvgSpeed=function(c,d,a){this.timeNow=(window.performance.now()-this.OverAllTimeAvg)/1E3;this.FinalSpeed;this.timeNow>=a-d&&(0=l&&(clearInterval(g),G=!0,Z=void 0,d())}Pa&&(x.remEvt(e.settingsMob.el,"click",c),x.remEvt(e.settingsDesk.el,"click",c),x.remEvt(e.startButtonDesk.el,"click",d),x.remEvt(e.startButtonMob.el,"click",d),x.remEvt(document,"keypress",a),Pa=!1);if(0<=Z){G=!1;e.userInterface();ua=!1;var l=Math.ceil(Math.abs(Z));e.showStatus("Automatic Test Starts in ...");var g=setInterval(b,1E3)}"fetch"===openSpeedTestServerList&&!0===G&&(G=!1,e.showStatus("Fetching Server Info.."),Y(6));!0===G&&("Ping"===
-A?f():"Download"===A?f():"Upload"===A?f():!1===A&&f())}function a(b){"Enter"===b.key&&d()}function f(){ua&&(e.userInterface(),ua=!1);t()}function t(){function b(){va=window.performance.now();n()}"widget"!==openChannel&&"web"!==openChannel||Y(1);var l=setInterval(function(){"Loaded"===m&&(m="busy",Q());"Ping"===m&&(m="busy",e.showStatus("Milliseconds"));"Download"===m&&(e.showStatus("Initializing.."),x.reset(),y=ha=0,e.reset(),wa=window.performance.now(),w(),m="initDown");if("Downloading"===m){e.Symbol(0);
-if(0==aa){aa=1;e.showStatus("Testing download speed..");var g=(window.performance.now()-wa)/1E3;Qa=g;e.progress(1,dlDuration+2.5);dlDuration+=g}xa=(window.performance.now()-wa)/1E3;q("dl");e.showStatus("Mbps download");e.mainGaugeProgress(y);e.LiveSpeed(y);e.Graph(y,0);R=x.AvgSpeed(y,ya,dlDuration);xa>=dlDuration&&"done"==Ma&&(A?(e.GaugeProgresstoZero(y,"SendR"),e.showStatus("All done"),e.Symbol(2)):e.GaugeProgresstoZero(y,"Upload"),e.downloadResult(R),ia=S,I=1,m="busy",y=ha=0,x.reset())}"Upload"==
-m&&1===I&&(e.Symbol(1),m="initup",e.showStatus("Initializing.."),e.LiveSpeed("...","speedToZero"),za=x.uRandom(ulDataSize,b),A&&(aa=1));"Uploading"===m&&(1==aa&&(aa=2,e.showStatus("Testing upload speed.."),y=0,x.reset(),e.reset(),Ra=g=(window.performance.now()-va)/1E3,e.progress(!1,ulDuration+2.5),ulDuration+=g),e.showStatus("Mbps upload"),T=(window.performance.now()-va)/1E3,q("up"),e.mainGaugeProgress(y),e.LiveSpeed(y),e.Graph(y,1),U=x.AvgSpeed(y,Aa,ulDuration),T>=ulDuration&&1==I&&(ja=P,e.uploadResult(U),
-e.GaugeProgresstoZero(y,"SendR"),za=void 0,e.showStatus("All done"),e.Symbol(2),m="busy",I=0));if("Error"===m){e.showStatus("Check your network connection status.");e.ConnectionError();m="busy";clearInterval(l);g=document.createElement("div");g.innerHTML='';var u=g.querySelector("a");e.oDoLiveSpeed.el.textContent="Network Error";var C=document.getElementById("oDoLiveSpeed");u.innerHTML=C.innerHTML;
-C.innerHTML=g.innerHTML}"SendR"===m&&(e.showStatus("All done"),g=document.createElement("div"),g.innerHTML='',u=g.querySelector("a"),e.oDoLiveSpeed.el.textContent=fb,C=document.getElementById("oDoLiveSpeed"),u.innerHTML=C.innerHTML,C.innerHTML=g.innerHTML,location.hostname!=Ba.toLowerCase()+Sa?(ba="https://"+Ba.toLowerCase()+Sa+"/results/show.php?&d="+R.toFixed(3)+"&u="+U.toFixed(3)+"&p="+
-Ca+"&j="+Da+"&dd="+(ia/1048576).toFixed(3)+"&ud="+(ja/1048576).toFixed(3)+"&ua="+Ta,ba=encodeURI(ba),g=document.getElementById("resultsData"),g.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ba),g.setAttribute("target","_blank"),saveData&&Y(5)):Y(3),m="busy",clearInterval(l))},100)}function w(){for(var b=0;b1E3*Qa+ya/2*1E3&&0===Ua&&(Ua=1,ka*=.01,ca*=.01,la=l+1E4);l>=la&&la=S?0:S-Wa;Wa=S;ca+=Va;Xa=Ea=l-Ea;Ea=l;ka+=Xa;01E3*Ra+Aa/2*1E3&&0===Ya&&(Ya=1,ma*=.1,da*=.1,na=b+1E4),b>=na&&na=P?0:P-$a,$a=P,da+=Za,ab=Fa=b-Fa,Fa=b,ma+=ab,0=g.loaded?0:g.loaded-l;if(isNaN(u)||!isFinite(u)||0>u)return!1;S+=u;l=g.loaded};z[b].onload=function(g){0===l&&(S+=g.total);"initDown"==m&&(m="Downloading");z[b]&&(z[b].abort(),z[b]=null,z[b]=void 0,delete z[b]);0===I&&M(b)};z[b].onerror=function(g){0===I&&M(b)};z[b].responseType="arraybuffer";z[b].send()}function F(b){var l=0;v[b]=new XMLHttpRequest;v[b].open("POST",Ga.Upload+"?n="+Math.random(),!0);
-v[b].upload.onprogress=function(g){"initup"==m&&void 0===u&&(m="Uploading");if(T>=ulDuration)return v[b].abort(),v[b]=null,v[b]=void 0,delete v[b],!1;var u=0>=g.loaded?0:g.loaded-l;if(isNaN(u)||!isFinite(u)||0>u)return!1;P+=u;l=g.loaded};v[b].onload=function(){if(0===l&&(P+=1048576*ulDataSize,T>=ulDuration))return v[b].abort(),v[b]=null,v[b]=void 0,delete v[b],!1;if("initup"==m&&void 0===g){var g;m="Uploading"}v[b]&&(v[b].abort(),v[b]=null,v[b]=void 0,delete v[b]);1===I&&F(b)};v[b].onerror=function(g){T<=
-ulDuration&&F(b)};v[b].setRequestHeader("Content-Type","application/octet-stream");0=P||v[b].send(za)}function Q(){bb=openSpeedTestServerList.length;m="Ping";performance.clearResourceTimings();if(Ha=B?J.push(.1):J.push(B);1=ra&&(ulThreads=dlThreads=ra)}if(selectServer&&("string"===typeof k.host||"string"===typeof k.h)){if("undefined"!==typeof k.host)var sa=k.host;else"undefined"!==typeof k.h&&(sa=k.h);/(?:https?):\/\/(\w+:?\w*)?(\S+)(:\d+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/.test(sa)&&
-(openSpeedTestServerList=[{ServerName:"Home",Download:sa+"/downloading",Upload:sa+"/upload",ServerIcon:"DefaultIcon"}])}E=parseInt(k.stress);W=parseInt(k.s);if("string"===typeof k.stress){var p=k.stress;var H=E}else"string"===typeof k.s&&(p=k.s,H=W);if(p&&stressTest){if("low"===p||"l"===p)ulDuration=dlDuration=300;if("medium"===p||"m"===p)ulDuration=dlDuration=600;if("high"===p||"h"===p)ulDuration=dlDuration=900;if("veryhigh"===p||"v"===p)ulDuration=dlDuration=1800;if("extreme"===p||"e"===p)ulDuration=
-dlDuration=3600;if("day"===p||"d"===p)ulDuration=dlDuration=86400;if("year"===p||"y"===p)ulDuration=dlDuration=31557600;if(12p||5>H)upAdjust=1+E/100,dlAdjust=1+E/100}else dlAdjust=upAdjust=1;p=parseInt(k.run);H=parseInt(k.r);var Z;!enableRun||"string"!==typeof k.run&&"string"!==typeof k.r||(Z=0',createCookie("mode","dark")));"light"===a&&(nightModeMob.style.display="none",dayModeMob.style.display="inline-block",nightMode.style.display="none",
-dayMode.style.display="inline-block",(darkStyle=document.getElementById("darkmode"))&&darkStyle.parentNode.removeChild(darkStyle),createCookie("mode","light"))}function toggleSkin(){(darkStyle=document.getElementById("darkmode"))?setSkin("light"):setSkin("dark")}function createCookie(a,c,b){if(b){var d=new Date;d.setTime(d.getTime()+864E5*b);b="; expires="+d.toGMTString()}else b="";document.cookie=a+"="+c+b+"; path=/"}
-function getCookieValue(a,c){return(c=document.cookie.match("(^|;)\\s*"+a+"\\s*=\\s*([^;]+)"))?c.pop():""};
\ No newline at end of file
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/downloading b/data/agent/var/lib/openflare/pages/deployments/1/current/downloading
deleted file mode 100644
index b78c32fa..00000000
Binary files a/data/agent/var/lib/openflare/pages/deployments/1/current/downloading and /dev/null differ
diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/hosted.html b/data/agent/var/lib/openflare/pages/deployments/1/current/hosted.html
deleted file mode 100644
index ea51ac3b..00000000
--- a/data/agent/var/lib/openflare/pages/deployments/1/current/hosted.html
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
- Speedtest by OpenSpeedtest.com
-
-
-
-
-