diff --git a/.claude/.agent b/.claude similarity index 100% rename from .claude/.agent rename to .claude diff --git a/.gemini b/.gemini new file mode 120000 index 00000000..9b617313 --- /dev/null +++ b/.gemini @@ -0,0 +1 @@ +.agent \ No newline at end of file diff --git a/.gemini/skills/plan/SKILL.md b/.gemini/skills/plan/SKILL.md deleted file mode 100644 index a330489c..00000000 --- a/.gemini/skills/plan/SKILL.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: plan -description: 项目级技能:规定在开启新方案、新计划或进行任务交接时,必须将计划落库到 docs/plan 文件夹中并使用对应模板。 ---- - -# Plan & Handover Skill - -当你在当前项目中被要求“开启一个新的方案”、“制定开发计划”或者准备“任务交接(Handover)”时,你**必须**遵循本技能的工作流,将计划或方案落库到 `docs/plan/` 目录下。 - -> [!IMPORTANT] -> **什么时候应当创建实现计划?** -> * **必须创建的场景**:新功能开发、涉及多组件的重大架构重构、引入新基础设施依赖,以及存在显著设计决策冲突的**中大型、复杂**需求。 -> * **绝对不要创建的场景**:改个包名、挪个文件、重命名函数、小修小改修复 Bug 等**轻量级、简单的局部重构**。对于此类改动,应当直接完成并运行单元测试通过后交付,禁止制造冗余的计划文档。 - -## 执行工作流 (Workflow) - -### 1. 确定计划类型 -* **新特性/技术实现计划**:如果你要开发新功能或进行重大重构,你需要创建**实现计划**。 -* **AI 任务交接计划**:如果当前任务尚未完成但需要记录进度留作以后或其他 AI 代理接手,你需要创建**交接计划**。 - -### 2. 读取对应模板 -在创建计划文档前,必须读取对应的模板内容,并严格按照模板的骨架进行填充: -* **实现计划模板**:`docs/plan/implementation-plan-template.md` -* **接手计划模板**:`docs/plan/handover-plan-template.md` - -### 3. 落库与命名规范 -在 `docs/plan/` 目录下创建新的 Markdown 文件进行保存: -* **实现计划**命名格式:`docs/plan/YYYYMMDD-[feature-name].md` (例如:`20260605-uptime-kuma-sync.md`) -* **接手计划**命名格式:`docs/plan/handover-[task-name].md` (例如:`handover-waf-ip-group.md`) - -### 4. 隔离约束 (极其重要) -`docs/plan/` 目录下的文档**仅限内部开发和 AI 代理同步使用**。 -* **绝对禁止**将新创建的 plan 文档加入到项目的官方导航配置(如 `docs/config.ts` 的 `nav` 或 `sidebar` 导航条中)。 -* **绝对禁止**通过任何方式将其暴露给文档渲染框架(如 VitePress)对外渲染。 - -## 后续动作 -落库完成后,向用户报告计划已生成在 `docs/plan/` 目录下,并列出文档的核心要点或待决策项(如有),等待用户 Review 或批准后即可推进下一步。 diff --git a/Claude.md b/Claude.md new file mode 120000 index 00000000..96808718 --- /dev/null +++ b/Claude.md @@ -0,0 +1 @@ +Agents.md \ No newline at end of file diff --git a/data/agent/etc/nginx/conf.d/openflare_routes.conf b/data/agent/etc/nginx/conf.d/openflare_routes.conf new file mode 100644 index 00000000..7f9a5cda --- /dev/null +++ b/data/agent/etc/nginx/conf.d/openflare_routes.conf @@ -0,0 +1,25 @@ +# 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 new file mode 100644 index 00000000..cdb98000 --- /dev/null +++ b/data/agent/etc/nginx/lua/init.lua @@ -0,0 +1,6 @@ +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 new file mode 100644 index 00000000..20daf1a1 --- /dev/null +++ b/data/agent/etc/nginx/lua/log.lua @@ -0,0 +1,82 @@ +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 new file mode 100644 index 00000000..cdb98000 --- /dev/null +++ b/data/agent/etc/nginx/lua/observability/init.lua @@ -0,0 +1,6 @@ +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 new file mode 100644 index 00000000..20daf1a1 --- /dev/null +++ b/data/agent/etc/nginx/lua/observability/log.lua @@ -0,0 +1,82 @@ +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 new file mode 100644 index 00000000..fe15ecc4 --- /dev/null +++ b/data/agent/etc/nginx/lua/observability/read.lua @@ -0,0 +1,45 @@ +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 new file mode 100644 index 00000000..c793c6f1 --- /dev/null +++ b/data/agent/etc/nginx/lua/pow/challenge.lua @@ -0,0 +1,134 @@ +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 new file mode 100644 index 00000000..02c45284 --- /dev/null +++ b/data/agent/etc/nginx/lua/pow/check.lua @@ -0,0 +1,10 @@ +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 new file mode 100644 index 00000000..9da25854 --- /dev/null +++ b/data/agent/etc/nginx/lua/pow/policy.lua @@ -0,0 +1,94 @@ +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 new file mode 100644 index 00000000..20817c7e --- /dev/null +++ b/data/agent/etc/nginx/lua/pow/runtime.lua @@ -0,0 +1,182 @@ +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/openflare-agent/internal/nginx/pow_static/css/static/geist.woff2 b/data/agent/etc/nginx/lua/pow/static/css/static/geist.woff2 similarity index 100% rename from openflare-agent/internal/nginx/pow_static/css/static/geist.woff2 rename to data/agent/etc/nginx/lua/pow/static/css/static/geist.woff2 diff --git a/openflare-agent/internal/nginx/pow_static/css/static/iosevka-curly.woff2 b/data/agent/etc/nginx/lua/pow/static/css/static/iosevka-curly.woff2 similarity index 100% rename from openflare-agent/internal/nginx/pow_static/css/static/iosevka-curly.woff2 rename to data/agent/etc/nginx/lua/pow/static/css/static/iosevka-curly.woff2 diff --git a/openflare-agent/internal/nginx/pow_static/css/static/podkova.css b/data/agent/etc/nginx/lua/pow/static/css/static/podkova.css similarity index 100% rename from openflare-agent/internal/nginx/pow_static/css/static/podkova.css rename to data/agent/etc/nginx/lua/pow/static/css/static/podkova.css diff --git a/openflare-agent/internal/nginx/pow_static/css/static/podkova.woff2 b/data/agent/etc/nginx/lua/pow/static/css/static/podkova.woff2 similarity index 100% rename from openflare-agent/internal/nginx/pow_static/css/static/podkova.woff2 rename to data/agent/etc/nginx/lua/pow/static/css/static/podkova.woff2 diff --git a/openflare-agent/internal/nginx/pow_static/css/xess.css b/data/agent/etc/nginx/lua/pow/static/css/xess.css similarity index 100% rename from openflare-agent/internal/nginx/pow_static/css/xess.css rename to data/agent/etc/nginx/lua/pow/static/css/xess.css diff --git a/openflare-agent/internal/nginx/pow_static/img/happy.webp b/data/agent/etc/nginx/lua/pow/static/img/happy.webp similarity index 100% rename from openflare-agent/internal/nginx/pow_static/img/happy.webp rename to data/agent/etc/nginx/lua/pow/static/img/happy.webp diff --git a/openflare-agent/internal/nginx/pow_static/img/pensive.webp b/data/agent/etc/nginx/lua/pow/static/img/pensive.webp similarity index 100% rename from openflare-agent/internal/nginx/pow_static/img/pensive.webp rename to data/agent/etc/nginx/lua/pow/static/img/pensive.webp diff --git a/openflare-agent/internal/nginx/pow_static/img/reject.webp b/data/agent/etc/nginx/lua/pow/static/img/reject.webp similarity index 100% rename from openflare-agent/internal/nginx/pow_static/img/reject.webp rename to data/agent/etc/nginx/lua/pow/static/img/reject.webp diff --git a/openflare-agent/internal/nginx/pow_static/js/algorithms/index.mjs b/data/agent/etc/nginx/lua/pow/static/js/algorithms/index.mjs similarity index 100% rename from openflare-agent/internal/nginx/pow_static/js/algorithms/index.mjs rename to data/agent/etc/nginx/lua/pow/static/js/algorithms/index.mjs diff --git a/openflare-agent/internal/nginx/pow_static/js/main.mjs b/data/agent/etc/nginx/lua/pow/static/js/main.mjs similarity index 100% rename from openflare-agent/internal/nginx/pow_static/js/main.mjs rename to data/agent/etc/nginx/lua/pow/static/js/main.mjs diff --git a/openflare-agent/internal/nginx/pow_static/js/worker/sha256-purejs.mjs b/data/agent/etc/nginx/lua/pow/static/js/worker/sha256-purejs.mjs similarity index 100% rename from openflare-agent/internal/nginx/pow_static/js/worker/sha256-purejs.mjs rename to data/agent/etc/nginx/lua/pow/static/js/worker/sha256-purejs.mjs diff --git a/openflare-agent/internal/nginx/pow_static/js/worker/sha256-webcrypto.mjs b/data/agent/etc/nginx/lua/pow/static/js/worker/sha256-webcrypto.mjs similarity index 100% rename from openflare-agent/internal/nginx/pow_static/js/worker/sha256-webcrypto.mjs rename to data/agent/etc/nginx/lua/pow/static/js/worker/sha256-webcrypto.mjs diff --git a/openflare-agent/internal/nginx/pow_static/locales/en.json b/data/agent/etc/nginx/lua/pow/static/locales/en.json similarity index 100% rename from openflare-agent/internal/nginx/pow_static/locales/en.json rename to data/agent/etc/nginx/lua/pow/static/locales/en.json diff --git a/openflare-agent/internal/nginx/pow_static/locales/zh-CN.json b/data/agent/etc/nginx/lua/pow/static/locales/zh-CN.json similarity index 100% rename from openflare-agent/internal/nginx/pow_static/locales/zh-CN.json rename to data/agent/etc/nginx/lua/pow/static/locales/zh-CN.json diff --git a/data/agent/etc/nginx/lua/pow/verify.lua b/data/agent/etc/nginx/lua/pow/verify.lua new file mode 100644 index 00000000..0f824b57 --- /dev/null +++ b/data/agent/etc/nginx/lua/pow/verify.lua @@ -0,0 +1,101 @@ +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 new file mode 100644 index 00000000..fe15ecc4 --- /dev/null +++ b/data/agent/etc/nginx/lua/read.lua @@ -0,0 +1,45 @@ +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 new file mode 100644 index 00000000..5f694592 --- /dev/null +++ b/data/agent/etc/nginx/lua/waf/check.lua @@ -0,0 +1,10 @@ +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 new file mode 100644 index 00000000..fd7c411e --- /dev/null +++ b/data/agent/etc/nginx/lua/waf/runtime.lua @@ -0,0 +1,286 @@ +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 new file mode 100644 index 00000000..8a2348ab --- /dev/null +++ b/data/agent/etc/nginx/mime.types @@ -0,0 +1,95 @@ + +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 new file mode 100644 index 00000000..8012468f --- /dev/null +++ b/data/agent/etc/nginx/nginx.conf @@ -0,0 +1,84 @@ +# 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 new file mode 100644 index 00000000..8a4cf72a --- /dev/null +++ b/data/agent/etc/openflare/openresty_config.json @@ -0,0 +1 @@ +{"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 new file mode 100644 index 00000000..b2aa4559 --- /dev/null +++ b/data/agent/etc/openflare/waf_config.json @@ -0,0 +1 @@ +{"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 new file mode 100644 index 00000000..6b18fc04 --- /dev/null +++ b/data/agent/etc/openflare/waf_ip_groups.json @@ -0,0 +1 @@ +{"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 new file mode 100644 index 00000000..4456f040 --- /dev/null +++ b/data/agent/var/lib/openflare/agent-state.json @@ -0,0 +1,16 @@ +{ + "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 new file mode 100644 index 00000000..de8b6a4a --- /dev/null +++ b/data/agent/var/lib/openflare/observability-buffer.json @@ -0,0 +1,482 @@ +[ + { + "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 new file mode 100644 index 00000000..e43b0f98 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/.gitignore @@ -0,0 +1 @@ +.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 new file mode 100644 index 00000000..660e9c7f --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/.openflare-pages.json @@ -0,0 +1 @@ +{"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 new file mode 100644 index 00000000..b93a9207 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/License.md @@ -0,0 +1,21 @@ +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 new file mode 100644 index 00000000..17d89eeb --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/README.md @@ -0,0 +1,506 @@ +# **[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 + +--- + + +[![Download OpenSpeedTest-Server V2.1](https://github.com/openspeedtest/v2-Test/raw/main/images/10G-S.gif)](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1") + Download from the Microsoft Store Download from the Mac App Store Download from the App Store Download from the Google Play Store Download from the Snap Store Download from the Docker Hub Download from the Helm Store Download from GitHub + +**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)** + + Video Tutorial by Roberto Jorge Tech + Video Tutorial by LanPad + +## 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. +[![Download OpenSpeedTest-Server V2.1](https://open.cachefly.net/assets/images/OSTV2-SS.png)](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1") +#### Fully Optimized and ready to use applications. + Download from the Microsoft Store Download from the Mac App Store Download from the App Store Download from the Google Play Store Download from the Snap Store Download from the Docker Hub Download from the Helm Store Download from GitHub + + +### 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 new file mode 100644 index 00000000..39fa9393 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/css/app.css @@ -0,0 +1,382 @@ +/* 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 new file mode 100644 index 00000000..14fef300 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/css/darkmode.css @@ -0,0 +1,45 @@ +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 new file mode 100644 index 00000000..fec03612 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.eot 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 new file mode 100644 index 00000000..67eecf44 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.svg @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 00000000..4f515e2a Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.ttf 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 new file mode 100644 index 00000000..d39bb52a Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.woff 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 new file mode 100644 index 00000000..29342a8d Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-500.woff2 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 new file mode 100644 index 00000000..c244b089 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.eot 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 new file mode 100644 index 00000000..627f5a36 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.svg @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 00000000..d0e63254 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.ttf 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 new file mode 100644 index 00000000..9eaa94f9 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.woff 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 new file mode 100644 index 00000000..020729ef Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/fonts/roboto-v30-latin-regular.woff2 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 new file mode 100644 index 00000000..01441ac0 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/app.svg @@ -0,0 +1,459 @@ + + + + + + + + + + + + + 0 + .5 + 1 + 10 + 100 + 500 + 1000+ + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DOWNLOAD + + + + + UPLOAD + + + + + + + + + + PING + + + + JITTER + + + --- + Mbps + + + --- + Mbps + + + -- + ms + + + -- + ms + + + + + + + + + -- + Jitter + -- + ms + + + + + + + + + + + + Start + + + + + + + + + + + + + + + + + + + Network Error + + + + SpeedTest by OpenSpeedTest™️ + + + + + + + + + + + + + + + + + + + + + HTML5 Network Performance Estimation Tool. by OpenSpeedTest™ + + + + + + The download speed is how fast you can pull data from the server to you in the form of images, videos, text and more. Activities such as listening to music on Spotify, downloading large files or streaming videos on Netflix all require you to download data. + + + The upload speed is how fast you send data from you to others in the form of images, videos, text and more. Activities such as uploading to YouTube or Sending email, playing live games like PubG, Voice and Video calling a friend require fast upload speeds for you to send data to someone else’s server. + + + Ping "Round-trip time" is more or less well defined as the network delay from point A to B and back. This is the sum of all encoding, queueing, processing, decoding, and propagation delays in both directions. Essentially, it's the delay when A may be expecting an answer from B for a request that requires very little processing. A fast ping means a more responsive connection, especially in applications where timing is everything (like video games). Ping is measured in Milliseconds (ms). Jitter is simply the difference in Ping "Round-trip time" . In other words, jitter is measuring time difference in packet inter-arrival time. Jitter helps diagnose internet connection stability. The higher the jitter value, the worse the stability of the connection. + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + + + Ping is measured in Milliseconds (ms). + + + Jitter is measured in Milliseconds (ms). + + + + + Shows you real-time network traffic graph for Upload! + + + Shows you real-time network traffic graph for Download! + + + Your download speed! + + + Your upload speed! + + + Your ping! + + + Your jitter! + + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + + + Ping is measured in Milliseconds (ms). + + + Jitter is measured in Milliseconds (ms). + + + + + Shows you real-time network traffic graph for Upload! + + + Shows you real-time network traffic graph for Download! + + + Your download speed! + + + Your upload speed! + + + Your ping! + + + Your jitter! + + + + + Click here to Run a Speed Test! Or Press "Enter" + + + Options + + + + + + HTML5 Network Performance Estimation Tool. by OpenSpeedTest™ + + + + + + The download speed is how fast you can pull data from the server to you in the form of images, videos, text and more. Activities such as listening to music on Spotify, downloading large files or streaming videos on Netflix all require you to download data. + + + The upload speed is how fast you send data from you to others in the form of images, videos, text and more. Activities such as uploading to YouTube or Sending email, playing live games like PubG, Voice and Video calling a friend require fast upload speeds for you to send data to someone else’s server. + + + Ping "Round-trip time" is more or less well defined as the network delay from point A to B and back. This is the sum of all encoding, queueing, processing, decoding, and propagation delays in both directions. Essentially, it's the delay when A may be expecting an answer from B for a request that requires very little processing. A fast ping means a more responsive connection, especially in applications where timing is everything (like video games). Ping is measured in Milliseconds (ms). Jitter is simply the difference in Ping "Round-trip time" . In other words, jitter is measuring time difference in packet inter-arrival time. Jitter helps diagnose internet connection stability. The higher the jitter value, the worse the stability of the connection. + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + Ping is measured in Milliseconds (ms). + + + + + + Shows you real-time network traffic graph for Download! + + + Upload speed is measured in megabits per second (Mbps). + + + Your ping! and Jitter + + + Your upload speed! + + + Your download speed! + + + + + + + + + Click here to run a speed! + + + Options + + + + + + + + + + + + + + \ 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 new file mode 100644 index 00000000..df78b83c Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/android-chrome-192x192.png 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 new file mode 100644 index 00000000..559d3eaf Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/android-chrome-512x512.png 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 new file mode 100644 index 00000000..14aec788 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/apple-touch-icon.png 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 new file mode 100644 index 00000000..ef1658c6 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #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 new file mode 100644 index 00000000..0dd76a80 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon-16x16.png 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 new file mode 100644 index 00000000..e3ad7510 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon-32x32.png 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 new file mode 100644 index 00000000..bebc1524 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/favicon.ico 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 new file mode 100644 index 00000000..50bdeae8 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-1x.png 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 new file mode 100644 index 00000000..98687998 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-2x.png 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 new file mode 100644 index 00000000..b612922b Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-3x.png 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 new file mode 100644 index 00000000..5936c147 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/launcher-icon-4x.png 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 new file mode 100644 index 00000000..eb66ae2b Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/mstile-150x150.png 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 new file mode 100644 index 00000000..e525e9b4 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/safari-pinned-tab.svg @@ -0,0 +1,108 @@ + + + + +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 new file mode 100644 index 00000000..058491fb --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/images/icons/site.webmanifest @@ -0,0 +1,22 @@ +{ + "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 new file mode 100644 index 00000000..f5b5b6e4 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/js/app-2.5.4.js @@ -0,0 +1,1427 @@ +/* + 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 new file mode 100644 index 00000000..0df99a1f --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/assets/js/app-2.5.4.min.js @@ -0,0 +1,51 @@ +/* + 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 new file mode 100644 index 00000000..b78c32fa Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/current/downloading 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 new file mode 100644 index 00000000..ea51ac3b --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/hosted.html @@ -0,0 +1,25 @@ + + + + + + + Speedtest by OpenSpeedtest.com + + + + +
+ Speed Test by OpenSpeedTest™ +
+ + \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/index.html b/data/agent/var/lib/openflare/pages/deployments/1/current/index.html new file mode 100644 index 00000000..2772b6b6 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/current/index.html @@ -0,0 +1,167 @@ + + + + SpeedTest by OpenSpeedTest™ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + +
+ SpeedTest by OpenSpeedTest™ is a Free and Open-Source HTML5 Network Speed Test Software. +

© Copyright 2013-2024 OpenSpeedTest™ All Rights Reserved.

+
+ + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/1/current/upload b/data/agent/var/lib/openflare/pages/deployments/1/current/upload new file mode 100644 index 00000000..e69de29b diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.gitignore b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.gitignore new file mode 100644 index 00000000..e43b0f98 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.openflare-pages.json b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.openflare-pages.json new file mode 100644 index 00000000..660e9c7f --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.openflare-pages.json @@ -0,0 +1 @@ +{"deployment_id":1,"checksum":"4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6"} \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/License.md b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/License.md new file mode 100644 index 00000000..b93a9207 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/License.md @@ -0,0 +1,21 @@ +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/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/README.md b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/README.md new file mode 100644 index 00000000..17d89eeb --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/README.md @@ -0,0 +1,506 @@ +# **[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 + +--- + + +[![Download OpenSpeedTest-Server V2.1](https://github.com/openspeedtest/v2-Test/raw/main/images/10G-S.gif)](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1") + Download from the Microsoft Store Download from the Mac App Store Download from the App Store Download from the Google Play Store Download from the Snap Store Download from the Docker Hub Download from the Helm Store Download from GitHub + +**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)** + + Video Tutorial by Roberto Jorge Tech + Video Tutorial by LanPad + +## 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. +[![Download OpenSpeedTest-Server V2.1](https://open.cachefly.net/assets/images/OSTV2-SS.png)](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1") +#### Fully Optimized and ready to use applications. + Download from the Microsoft Store Download from the Mac App Store Download from the App Store Download from the Google Play Store Download from the Snap Store Download from the Docker Hub Download from the Helm Store Download from GitHub + + +### 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/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/app.css b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/app.css new file mode 100644 index 00000000..39fa9393 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/app.css @@ -0,0 +1,382 @@ +/* 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/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/darkmode.css b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/darkmode.css new file mode 100644 index 00000000..14fef300 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/darkmode.css @@ -0,0 +1,45 @@ +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/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.eot b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.eot new file mode 100644 index 00000000..fec03612 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.eot differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.svg b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.svg new file mode 100644 index 00000000..67eecf44 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.svg @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.ttf b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.ttf new file mode 100644 index 00000000..4f515e2a Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.ttf differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff new file mode 100644 index 00000000..d39bb52a Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff2 b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff2 new file mode 100644 index 00000000..29342a8d Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff2 differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.eot b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.eot new file mode 100644 index 00000000..c244b089 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.eot differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.svg b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.svg new file mode 100644 index 00000000..627f5a36 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.svg @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.ttf b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.ttf new file mode 100644 index 00000000..d0e63254 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.ttf differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff new file mode 100644 index 00000000..9eaa94f9 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff2 b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff2 new file mode 100644 index 00000000..020729ef Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff2 differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/app.svg b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/app.svg new file mode 100644 index 00000000..01441ac0 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/app.svg @@ -0,0 +1,459 @@ + + + + + + + + + + + + + 0 + .5 + 1 + 10 + 100 + 500 + 1000+ + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DOWNLOAD + + + + + UPLOAD + + + + + + + + + + PING + + + + JITTER + + + --- + Mbps + + + --- + Mbps + + + -- + ms + + + -- + ms + + + + + + + + + -- + Jitter + -- + ms + + + + + + + + + + + + Start + + + + + + + + + + + + + + + + + + + Network Error + + + + SpeedTest by OpenSpeedTest™️ + + + + + + + + + + + + + + + + + + + + + HTML5 Network Performance Estimation Tool. by OpenSpeedTest™ + + + + + + The download speed is how fast you can pull data from the server to you in the form of images, videos, text and more. Activities such as listening to music on Spotify, downloading large files or streaming videos on Netflix all require you to download data. + + + The upload speed is how fast you send data from you to others in the form of images, videos, text and more. Activities such as uploading to YouTube or Sending email, playing live games like PubG, Voice and Video calling a friend require fast upload speeds for you to send data to someone else’s server. + + + Ping "Round-trip time" is more or less well defined as the network delay from point A to B and back. This is the sum of all encoding, queueing, processing, decoding, and propagation delays in both directions. Essentially, it's the delay when A may be expecting an answer from B for a request that requires very little processing. A fast ping means a more responsive connection, especially in applications where timing is everything (like video games). Ping is measured in Milliseconds (ms). Jitter is simply the difference in Ping "Round-trip time" . In other words, jitter is measuring time difference in packet inter-arrival time. Jitter helps diagnose internet connection stability. The higher the jitter value, the worse the stability of the connection. + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + + + Ping is measured in Milliseconds (ms). + + + Jitter is measured in Milliseconds (ms). + + + + + Shows you real-time network traffic graph for Upload! + + + Shows you real-time network traffic graph for Download! + + + Your download speed! + + + Your upload speed! + + + Your ping! + + + Your jitter! + + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + + + Ping is measured in Milliseconds (ms). + + + Jitter is measured in Milliseconds (ms). + + + + + Shows you real-time network traffic graph for Upload! + + + Shows you real-time network traffic graph for Download! + + + Your download speed! + + + Your upload speed! + + + Your ping! + + + Your jitter! + + + + + Click here to Run a Speed Test! Or Press "Enter" + + + Options + + + + + + HTML5 Network Performance Estimation Tool. by OpenSpeedTest™ + + + + + + The download speed is how fast you can pull data from the server to you in the form of images, videos, text and more. Activities such as listening to music on Spotify, downloading large files or streaming videos on Netflix all require you to download data. + + + The upload speed is how fast you send data from you to others in the form of images, videos, text and more. Activities such as uploading to YouTube or Sending email, playing live games like PubG, Voice and Video calling a friend require fast upload speeds for you to send data to someone else’s server. + + + Ping "Round-trip time" is more or less well defined as the network delay from point A to B and back. This is the sum of all encoding, queueing, processing, decoding, and propagation delays in both directions. Essentially, it's the delay when A may be expecting an answer from B for a request that requires very little processing. A fast ping means a more responsive connection, especially in applications where timing is everything (like video games). Ping is measured in Milliseconds (ms). Jitter is simply the difference in Ping "Round-trip time" . In other words, jitter is measuring time difference in packet inter-arrival time. Jitter helps diagnose internet connection stability. The higher the jitter value, the worse the stability of the connection. + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + Ping is measured in Milliseconds (ms). + + + + + + Shows you real-time network traffic graph for Download! + + + Upload speed is measured in megabits per second (Mbps). + + + Your ping! and Jitter + + + Your upload speed! + + + Your download speed! + + + + + + + + + Click here to run a speed! + + + Options + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-192x192.png b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-192x192.png new file mode 100644 index 00000000..df78b83c Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-192x192.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-512x512.png b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-512x512.png new file mode 100644 index 00000000..559d3eaf Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-512x512.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/apple-touch-icon.png b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/apple-touch-icon.png new file mode 100644 index 00000000..14aec788 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/apple-touch-icon.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/browserconfig.xml b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/browserconfig.xml new file mode 100644 index 00000000..ef1658c6 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #ffc40d + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-16x16.png b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-16x16.png new file mode 100644 index 00000000..0dd76a80 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-16x16.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-32x32.png b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-32x32.png new file mode 100644 index 00000000..e3ad7510 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-32x32.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon.ico b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon.ico new file mode 100644 index 00000000..bebc1524 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon.ico differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-1x.png b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-1x.png new file mode 100644 index 00000000..50bdeae8 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-1x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-2x.png b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-2x.png new file mode 100644 index 00000000..98687998 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-2x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-3x.png b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-3x.png new file mode 100644 index 00000000..b612922b Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-3x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-4x.png b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-4x.png new file mode 100644 index 00000000..5936c147 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-4x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/mstile-150x150.png b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/mstile-150x150.png new file mode 100644 index 00000000..eb66ae2b Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/mstile-150x150.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/safari-pinned-tab.svg b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/safari-pinned-tab.svg new file mode 100644 index 00000000..e525e9b4 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/safari-pinned-tab.svg @@ -0,0 +1,108 @@ + + + + +Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + + + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/site.webmanifest b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/site.webmanifest new file mode 100644 index 00000000..058491fb --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/site.webmanifest @@ -0,0 +1,22 @@ +{ + "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/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.js b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.js new file mode 100644 index 00000000..f5b5b6e4 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.js @@ -0,0 +1,1427 @@ +/* + 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/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.min.js b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.min.js new file mode 100644 index 00000000..0df99a1f --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.min.js @@ -0,0 +1,51 @@ +/* + 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/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/downloading b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/downloading new file mode 100644 index 00000000..b78c32fa Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/downloading differ diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/hosted.html b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/hosted.html new file mode 100644 index 00000000..ea51ac3b --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/hosted.html @@ -0,0 +1,25 @@ + + + + + + + Speedtest by OpenSpeedtest.com + + + + +
+ Speed Test by OpenSpeedTest™ +
+ + \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/index.html b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/index.html new file mode 100644 index 00000000..2772b6b6 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/index.html @@ -0,0 +1,167 @@ + + + + SpeedTest by OpenSpeedTest™ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + +
+ SpeedTest by OpenSpeedTest™ is a Free and Open-Source HTML5 Network Speed Test Software. +

© Copyright 2013-2024 OpenSpeedTest™ All Rights Reserved.

+
+ + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/upload b/data/agent/var/lib/openflare/pages/deployments/1/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/upload new file mode 100644 index 00000000..e69de29b diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/.gitignore b/data/agent/var/lib/openflare/pages/deployments/3/current/.gitignore new file mode 100644 index 00000000..e43b0f98 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/.openflare-pages.json b/data/agent/var/lib/openflare/pages/deployments/3/current/.openflare-pages.json new file mode 100644 index 00000000..8b73ac2e --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/.openflare-pages.json @@ -0,0 +1 @@ +{"deployment_id":3,"checksum":"4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6"} \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/License.md b/data/agent/var/lib/openflare/pages/deployments/3/current/License.md new file mode 100644 index 00000000..b93a9207 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/License.md @@ -0,0 +1,21 @@ +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/3/current/README.md b/data/agent/var/lib/openflare/pages/deployments/3/current/README.md new file mode 100644 index 00000000..17d89eeb --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/README.md @@ -0,0 +1,506 @@ +# **[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 + +--- + + +[![Download OpenSpeedTest-Server V2.1](https://github.com/openspeedtest/v2-Test/raw/main/images/10G-S.gif)](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1") + Download from the Microsoft Store Download from the Mac App Store Download from the App Store Download from the Google Play Store Download from the Snap Store Download from the Docker Hub Download from the Helm Store Download from GitHub + +**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)** + + Video Tutorial by Roberto Jorge Tech + Video Tutorial by LanPad + +## 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. +[![Download OpenSpeedTest-Server V2.1](https://open.cachefly.net/assets/images/OSTV2-SS.png)](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1") +#### Fully Optimized and ready to use applications. + Download from the Microsoft Store Download from the Mac App Store Download from the App Store Download from the Google Play Store Download from the Snap Store Download from the Docker Hub Download from the Helm Store Download from GitHub + + +### 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/3/current/assets/css/app.css b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/css/app.css new file mode 100644 index 00000000..39fa9393 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/css/app.css @@ -0,0 +1,382 @@ +/* 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/3/current/assets/css/darkmode.css b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/css/darkmode.css new file mode 100644 index 00000000..14fef300 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/css/darkmode.css @@ -0,0 +1,45 @@ +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/3/current/assets/fonts/roboto-v30-latin-500.eot b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.eot new file mode 100644 index 00000000..fec03612 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.eot differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.svg b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.svg new file mode 100644 index 00000000..67eecf44 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.svg @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.ttf b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.ttf new file mode 100644 index 00000000..4f515e2a Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.ttf differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.woff b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.woff new file mode 100644 index 00000000..d39bb52a Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.woff differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.woff2 b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.woff2 new file mode 100644 index 00000000..29342a8d Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-500.woff2 differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.eot b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.eot new file mode 100644 index 00000000..c244b089 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.eot differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.svg b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.svg new file mode 100644 index 00000000..627f5a36 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.svg @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.ttf b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.ttf new file mode 100644 index 00000000..d0e63254 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.ttf differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.woff b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.woff new file mode 100644 index 00000000..9eaa94f9 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.woff differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.woff2 b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.woff2 new file mode 100644 index 00000000..020729ef Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/fonts/roboto-v30-latin-regular.woff2 differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/app.svg b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/app.svg new file mode 100644 index 00000000..01441ac0 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/app.svg @@ -0,0 +1,459 @@ + + + + + + + + + + + + + 0 + .5 + 1 + 10 + 100 + 500 + 1000+ + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DOWNLOAD + + + + + UPLOAD + + + + + + + + + + PING + + + + JITTER + + + --- + Mbps + + + --- + Mbps + + + -- + ms + + + -- + ms + + + + + + + + + -- + Jitter + -- + ms + + + + + + + + + + + + Start + + + + + + + + + + + + + + + + + + + Network Error + + + + SpeedTest by OpenSpeedTest™️ + + + + + + + + + + + + + + + + + + + + + HTML5 Network Performance Estimation Tool. by OpenSpeedTest™ + + + + + + The download speed is how fast you can pull data from the server to you in the form of images, videos, text and more. Activities such as listening to music on Spotify, downloading large files or streaming videos on Netflix all require you to download data. + + + The upload speed is how fast you send data from you to others in the form of images, videos, text and more. Activities such as uploading to YouTube or Sending email, playing live games like PubG, Voice and Video calling a friend require fast upload speeds for you to send data to someone else’s server. + + + Ping "Round-trip time" is more or less well defined as the network delay from point A to B and back. This is the sum of all encoding, queueing, processing, decoding, and propagation delays in both directions. Essentially, it's the delay when A may be expecting an answer from B for a request that requires very little processing. A fast ping means a more responsive connection, especially in applications where timing is everything (like video games). Ping is measured in Milliseconds (ms). Jitter is simply the difference in Ping "Round-trip time" . In other words, jitter is measuring time difference in packet inter-arrival time. Jitter helps diagnose internet connection stability. The higher the jitter value, the worse the stability of the connection. + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + + + Ping is measured in Milliseconds (ms). + + + Jitter is measured in Milliseconds (ms). + + + + + Shows you real-time network traffic graph for Upload! + + + Shows you real-time network traffic graph for Download! + + + Your download speed! + + + Your upload speed! + + + Your ping! + + + Your jitter! + + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + + + Ping is measured in Milliseconds (ms). + + + Jitter is measured in Milliseconds (ms). + + + + + Shows you real-time network traffic graph for Upload! + + + Shows you real-time network traffic graph for Download! + + + Your download speed! + + + Your upload speed! + + + Your ping! + + + Your jitter! + + + + + Click here to Run a Speed Test! Or Press "Enter" + + + Options + + + + + + HTML5 Network Performance Estimation Tool. by OpenSpeedTest™ + + + + + + The download speed is how fast you can pull data from the server to you in the form of images, videos, text and more. Activities such as listening to music on Spotify, downloading large files or streaming videos on Netflix all require you to download data. + + + The upload speed is how fast you send data from you to others in the form of images, videos, text and more. Activities such as uploading to YouTube or Sending email, playing live games like PubG, Voice and Video calling a friend require fast upload speeds for you to send data to someone else’s server. + + + Ping "Round-trip time" is more or less well defined as the network delay from point A to B and back. This is the sum of all encoding, queueing, processing, decoding, and propagation delays in both directions. Essentially, it's the delay when A may be expecting an answer from B for a request that requires very little processing. A fast ping means a more responsive connection, especially in applications where timing is everything (like video games). Ping is measured in Milliseconds (ms). Jitter is simply the difference in Ping "Round-trip time" . In other words, jitter is measuring time difference in packet inter-arrival time. Jitter helps diagnose internet connection stability. The higher the jitter value, the worse the stability of the connection. + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + Ping is measured in Milliseconds (ms). + + + + + + Shows you real-time network traffic graph for Download! + + + Upload speed is measured in megabits per second (Mbps). + + + Your ping! and Jitter + + + Your upload speed! + + + Your download speed! + + + + + + + + + Click here to run a speed! + + + Options + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/android-chrome-192x192.png b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/android-chrome-192x192.png new file mode 100644 index 00000000..df78b83c Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/android-chrome-192x192.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/android-chrome-512x512.png b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/android-chrome-512x512.png new file mode 100644 index 00000000..559d3eaf Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/android-chrome-512x512.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/apple-touch-icon.png b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/apple-touch-icon.png new file mode 100644 index 00000000..14aec788 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/apple-touch-icon.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/browserconfig.xml b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/browserconfig.xml new file mode 100644 index 00000000..ef1658c6 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #ffc40d + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/favicon-16x16.png b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/favicon-16x16.png new file mode 100644 index 00000000..0dd76a80 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/favicon-16x16.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/favicon-32x32.png b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/favicon-32x32.png new file mode 100644 index 00000000..e3ad7510 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/favicon-32x32.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/favicon.ico b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/favicon.ico new file mode 100644 index 00000000..bebc1524 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/favicon.ico differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-1x.png b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-1x.png new file mode 100644 index 00000000..50bdeae8 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-1x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-2x.png b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-2x.png new file mode 100644 index 00000000..98687998 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-2x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-3x.png b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-3x.png new file mode 100644 index 00000000..b612922b Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-3x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-4x.png b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-4x.png new file mode 100644 index 00000000..5936c147 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/launcher-icon-4x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/mstile-150x150.png b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/mstile-150x150.png new file mode 100644 index 00000000..eb66ae2b Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/mstile-150x150.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/safari-pinned-tab.svg b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/safari-pinned-tab.svg new file mode 100644 index 00000000..e525e9b4 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/safari-pinned-tab.svg @@ -0,0 +1,108 @@ + + + + +Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + + + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/site.webmanifest b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/site.webmanifest new file mode 100644 index 00000000..058491fb --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/images/icons/site.webmanifest @@ -0,0 +1,22 @@ +{ + "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/3/current/assets/js/app-2.5.4.js b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/js/app-2.5.4.js new file mode 100644 index 00000000..f5b5b6e4 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/js/app-2.5.4.js @@ -0,0 +1,1427 @@ +/* + 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/3/current/assets/js/app-2.5.4.min.js b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/js/app-2.5.4.min.js new file mode 100644 index 00000000..0df99a1f --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/assets/js/app-2.5.4.min.js @@ -0,0 +1,51 @@ +/* + 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/3/current/downloading b/data/agent/var/lib/openflare/pages/deployments/3/current/downloading new file mode 100644 index 00000000..b78c32fa Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/current/downloading differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/hosted.html b/data/agent/var/lib/openflare/pages/deployments/3/current/hosted.html new file mode 100644 index 00000000..ea51ac3b --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/hosted.html @@ -0,0 +1,25 @@ + + + + + + + Speedtest by OpenSpeedtest.com + + + + +
+ Speed Test by OpenSpeedTest™ +
+ + \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/index.html b/data/agent/var/lib/openflare/pages/deployments/3/current/index.html new file mode 100644 index 00000000..2772b6b6 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/current/index.html @@ -0,0 +1,167 @@ + + + + SpeedTest by OpenSpeedTest™ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + +
+ SpeedTest by OpenSpeedTest™ is a Free and Open-Source HTML5 Network Speed Test Software. +

© Copyright 2013-2024 OpenSpeedTest™ All Rights Reserved.

+
+ + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/3/current/upload b/data/agent/var/lib/openflare/pages/deployments/3/current/upload new file mode 100644 index 00000000..e69de29b diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.gitignore b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.gitignore new file mode 100644 index 00000000..e43b0f98 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.openflare-pages.json b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.openflare-pages.json new file mode 100644 index 00000000..8b73ac2e --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/.openflare-pages.json @@ -0,0 +1 @@ +{"deployment_id":3,"checksum":"4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6"} \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/License.md b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/License.md new file mode 100644 index 00000000..b93a9207 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/License.md @@ -0,0 +1,21 @@ +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/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/README.md b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/README.md new file mode 100644 index 00000000..17d89eeb --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/README.md @@ -0,0 +1,506 @@ +# **[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 + +--- + + +[![Download OpenSpeedTest-Server V2.1](https://github.com/openspeedtest/v2-Test/raw/main/images/10G-S.gif)](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1") + Download from the Microsoft Store Download from the Mac App Store Download from the App Store Download from the Google Play Store Download from the Snap Store Download from the Docker Hub Download from the Helm Store Download from GitHub + +**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)** + + Video Tutorial by Roberto Jorge Tech + Video Tutorial by LanPad + +## 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. +[![Download OpenSpeedTest-Server V2.1](https://open.cachefly.net/assets/images/OSTV2-SS.png)](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1") +#### Fully Optimized and ready to use applications. + Download from the Microsoft Store Download from the Mac App Store Download from the App Store Download from the Google Play Store Download from the Snap Store Download from the Docker Hub Download from the Helm Store Download from GitHub + + +### 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/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/app.css b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/app.css new file mode 100644 index 00000000..39fa9393 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/app.css @@ -0,0 +1,382 @@ +/* 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/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/darkmode.css b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/darkmode.css new file mode 100644 index 00000000..14fef300 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/css/darkmode.css @@ -0,0 +1,45 @@ +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/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.eot b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.eot new file mode 100644 index 00000000..fec03612 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.eot differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.svg b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.svg new file mode 100644 index 00000000..67eecf44 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.svg @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.ttf b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.ttf new file mode 100644 index 00000000..4f515e2a Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.ttf differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff new file mode 100644 index 00000000..d39bb52a Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff2 b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff2 new file mode 100644 index 00000000..29342a8d Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-500.woff2 differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.eot b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.eot new file mode 100644 index 00000000..c244b089 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.eot differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.svg b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.svg new file mode 100644 index 00000000..627f5a36 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.svg @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.ttf b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.ttf new file mode 100644 index 00000000..d0e63254 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.ttf differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff new file mode 100644 index 00000000..9eaa94f9 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff2 b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff2 new file mode 100644 index 00000000..020729ef Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/fonts/roboto-v30-latin-regular.woff2 differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/app.svg b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/app.svg new file mode 100644 index 00000000..01441ac0 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/app.svg @@ -0,0 +1,459 @@ + + + + + + + + + + + + + 0 + .5 + 1 + 10 + 100 + 500 + 1000+ + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DOWNLOAD + + + + + UPLOAD + + + + + + + + + + PING + + + + JITTER + + + --- + Mbps + + + --- + Mbps + + + -- + ms + + + -- + ms + + + + + + + + + -- + Jitter + -- + ms + + + + + + + + + + + + Start + + + + + + + + + + + + + + + + + + + Network Error + + + + SpeedTest by OpenSpeedTest™️ + + + + + + + + + + + + + + + + + + + + + HTML5 Network Performance Estimation Tool. by OpenSpeedTest™ + + + + + + The download speed is how fast you can pull data from the server to you in the form of images, videos, text and more. Activities such as listening to music on Spotify, downloading large files or streaming videos on Netflix all require you to download data. + + + The upload speed is how fast you send data from you to others in the form of images, videos, text and more. Activities such as uploading to YouTube or Sending email, playing live games like PubG, Voice and Video calling a friend require fast upload speeds for you to send data to someone else’s server. + + + Ping "Round-trip time" is more or less well defined as the network delay from point A to B and back. This is the sum of all encoding, queueing, processing, decoding, and propagation delays in both directions. Essentially, it's the delay when A may be expecting an answer from B for a request that requires very little processing. A fast ping means a more responsive connection, especially in applications where timing is everything (like video games). Ping is measured in Milliseconds (ms). Jitter is simply the difference in Ping "Round-trip time" . In other words, jitter is measuring time difference in packet inter-arrival time. Jitter helps diagnose internet connection stability. The higher the jitter value, the worse the stability of the connection. + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + + + Ping is measured in Milliseconds (ms). + + + Jitter is measured in Milliseconds (ms). + + + + + Shows you real-time network traffic graph for Upload! + + + Shows you real-time network traffic graph for Download! + + + Your download speed! + + + Your upload speed! + + + Your ping! + + + Your jitter! + + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + + + Ping is measured in Milliseconds (ms). + + + Jitter is measured in Milliseconds (ms). + + + + + Shows you real-time network traffic graph for Upload! + + + Shows you real-time network traffic graph for Download! + + + Your download speed! + + + Your upload speed! + + + Your ping! + + + Your jitter! + + + + + Click here to Run a Speed Test! Or Press "Enter" + + + Options + + + + + + HTML5 Network Performance Estimation Tool. by OpenSpeedTest™ + + + + + + The download speed is how fast you can pull data from the server to you in the form of images, videos, text and more. Activities such as listening to music on Spotify, downloading large files or streaming videos on Netflix all require you to download data. + + + The upload speed is how fast you send data from you to others in the form of images, videos, text and more. Activities such as uploading to YouTube or Sending email, playing live games like PubG, Voice and Video calling a friend require fast upload speeds for you to send data to someone else’s server. + + + Ping "Round-trip time" is more or less well defined as the network delay from point A to B and back. This is the sum of all encoding, queueing, processing, decoding, and propagation delays in both directions. Essentially, it's the delay when A may be expecting an answer from B for a request that requires very little processing. A fast ping means a more responsive connection, especially in applications where timing is everything (like video games). Ping is measured in Milliseconds (ms). Jitter is simply the difference in Ping "Round-trip time" . In other words, jitter is measuring time difference in packet inter-arrival time. Jitter helps diagnose internet connection stability. The higher the jitter value, the worse the stability of the connection. + + + + + + + + + Download speed is measured in megabits per second (Mbps). + + + Upload speed is measured in megabits per second (Mbps). + + + Ping is measured in Milliseconds (ms). + + + + + + Shows you real-time network traffic graph for Download! + + + Upload speed is measured in megabits per second (Mbps). + + + Your ping! and Jitter + + + Your upload speed! + + + Your download speed! + + + + + + + + + Click here to run a speed! + + + Options + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-192x192.png b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-192x192.png new file mode 100644 index 00000000..df78b83c Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-192x192.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-512x512.png b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-512x512.png new file mode 100644 index 00000000..559d3eaf Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/android-chrome-512x512.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/apple-touch-icon.png b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/apple-touch-icon.png new file mode 100644 index 00000000..14aec788 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/apple-touch-icon.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/browserconfig.xml b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/browserconfig.xml new file mode 100644 index 00000000..ef1658c6 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #ffc40d + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-16x16.png b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-16x16.png new file mode 100644 index 00000000..0dd76a80 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-16x16.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-32x32.png b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-32x32.png new file mode 100644 index 00000000..e3ad7510 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon-32x32.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon.ico b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon.ico new file mode 100644 index 00000000..bebc1524 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/favicon.ico differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-1x.png b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-1x.png new file mode 100644 index 00000000..50bdeae8 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-1x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-2x.png b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-2x.png new file mode 100644 index 00000000..98687998 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-2x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-3x.png b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-3x.png new file mode 100644 index 00000000..b612922b Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-3x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-4x.png b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-4x.png new file mode 100644 index 00000000..5936c147 Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/launcher-icon-4x.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/mstile-150x150.png b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/mstile-150x150.png new file mode 100644 index 00000000..eb66ae2b Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/mstile-150x150.png differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/safari-pinned-tab.svg b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/safari-pinned-tab.svg new file mode 100644 index 00000000..e525e9b4 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/safari-pinned-tab.svg @@ -0,0 +1,108 @@ + + + + +Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + + + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/site.webmanifest b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/site.webmanifest new file mode 100644 index 00000000..058491fb --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/images/icons/site.webmanifest @@ -0,0 +1,22 @@ +{ + "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/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.js b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.js new file mode 100644 index 00000000..f5b5b6e4 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.js @@ -0,0 +1,1427 @@ +/* + 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/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.min.js b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.min.js new file mode 100644 index 00000000..0df99a1f --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/assets/js/app-2.5.4.min.js @@ -0,0 +1,51 @@ +/* + 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/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/downloading b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/downloading new file mode 100644 index 00000000..b78c32fa Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/downloading differ diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/hosted.html b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/hosted.html new file mode 100644 index 00000000..ea51ac3b --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/hosted.html @@ -0,0 +1,25 @@ + + + + + + + Speedtest by OpenSpeedtest.com + + + + +
+ Speed Test by OpenSpeedTest™ +
+ + \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/index.html b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/index.html new file mode 100644 index 00000000..2772b6b6 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/index.html @@ -0,0 +1,167 @@ + + + + SpeedTest by OpenSpeedTest™ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + +
+ SpeedTest by OpenSpeedTest™ is a Free and Open-Source HTML5 Network Speed Test Software. +

© Copyright 2013-2024 OpenSpeedTest™ All Rights Reserved.

+
+ + + + + + diff --git a/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/upload b/data/agent/var/lib/openflare/pages/deployments/3/releases/4b4e50095b4b0ea6fac74ad141dae50c3497481a0710b47e30b0f579951d55c6/upload new file mode 100644 index 00000000..e69de29b diff --git a/data/agent/var/lib/openflare/pages/deployments/4/current/.openflare-pages.json b/data/agent/var/lib/openflare/pages/deployments/4/current/.openflare-pages.json new file mode 100644 index 00000000..08ec7e7b --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/4/current/.openflare-pages.json @@ -0,0 +1 @@ +{"deployment_id":4,"checksum":"50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2"} \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/4/current/__MACOSX/._build b/data/agent/var/lib/openflare/pages/deployments/4/current/__MACOSX/._build new file mode 100755 index 00000000..a869c39e Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/4/current/__MACOSX/._build differ diff --git a/data/agent/var/lib/openflare/pages/deployments/4/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/.openflare-pages.json b/data/agent/var/lib/openflare/pages/deployments/4/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/.openflare-pages.json new file mode 100644 index 00000000..08ec7e7b --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/4/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/.openflare-pages.json @@ -0,0 +1 @@ +{"deployment_id":4,"checksum":"50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2"} \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/4/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/__MACOSX/._build b/data/agent/var/lib/openflare/pages/deployments/4/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/__MACOSX/._build new file mode 100755 index 00000000..a869c39e Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/4/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/__MACOSX/._build differ diff --git a/data/agent/var/lib/openflare/pages/deployments/5/current/.openflare-pages.json b/data/agent/var/lib/openflare/pages/deployments/5/current/.openflare-pages.json new file mode 100644 index 00000000..897af358 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/5/current/.openflare-pages.json @@ -0,0 +1 @@ +{"deployment_id":5,"checksum":"50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2"} \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/5/current/__MACOSX/._build b/data/agent/var/lib/openflare/pages/deployments/5/current/__MACOSX/._build new file mode 100755 index 00000000..a869c39e Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/5/current/__MACOSX/._build differ diff --git a/data/agent/var/lib/openflare/pages/deployments/5/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/.openflare-pages.json b/data/agent/var/lib/openflare/pages/deployments/5/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/.openflare-pages.json new file mode 100644 index 00000000..897af358 --- /dev/null +++ b/data/agent/var/lib/openflare/pages/deployments/5/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/.openflare-pages.json @@ -0,0 +1 @@ +{"deployment_id":5,"checksum":"50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2"} \ No newline at end of file diff --git a/data/agent/var/lib/openflare/pages/deployments/5/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/__MACOSX/._build b/data/agent/var/lib/openflare/pages/deployments/5/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/__MACOSX/._build new file mode 100755 index 00000000..a869c39e Binary files /dev/null and b/data/agent/var/lib/openflare/pages/deployments/5/releases/50cf372aadd13c763da8c8657a374cdd70b14e7c2d89d9ad35f53c62561f73d2/__MACOSX/._build differ diff --git a/data/flared/flared-state.json b/data/flared/flared-state.json new file mode 100644 index 00000000..5051c7ad --- /dev/null +++ b/data/flared/flared-state.json @@ -0,0 +1,4 @@ +{ + "Version": "20260604-002", + "Checksum": "47362a4edad373922a14ee157a5b8c9db99432cde75f7ed7533b7e5cf8f4202d" +} \ No newline at end of file diff --git a/data/flared/frpc_node-34153b9566e6f8a634d1f1da689a0d45.toml b/data/flared/frpc_node-34153b9566e6f8a634d1f1da689a0d45.toml new file mode 100644 index 00000000..534cc2c5 --- /dev/null +++ b/data/flared/frpc_node-34153b9566e6f8a634d1f1da689a0d45.toml @@ -0,0 +1,12 @@ +serverAddr = "127.0.0.1" +serverPort = 17000 +auth.method = "token" +auth.token = "f977f20f25883e624eb83ee9be84926c" + +[[proxies]] +name = "node-d3dbcc88b3cc381c004bf04eafbfbbdb-local2-arctel-de" +type = "http" +localIP = "abc" +localPort = 5666 +customDomains = ["local2.arctel.de"] + diff --git a/data/relay/frps.toml b/data/relay/frps.toml new file mode 100644 index 00000000..386c92cf --- /dev/null +++ b/data/relay/frps.toml @@ -0,0 +1,11 @@ +bindPort = 17000 +vhostHTTPPort = 8080 +[auth] +method = "token" +token = "f977f20f25883e624eb83ee9be84926c" + +[webServer] +addr = "0.0.0.0" +port = 17500 +user = "admin" +password = "85464eeb72c49abc430569d6b9c77f78" diff --git a/data/relay/relay-state.json b/data/relay/relay-state.json new file mode 100644 index 00000000..4839fd46 --- /dev/null +++ b/data/relay/relay-state.json @@ -0,0 +1,7 @@ +{ + "last_auth_token": "", + "last_profile_fingerprint": "8b44bae0a094467933f9ddeb35b11451dbabbb231e710902587cb791917c3e9f", + "last_cpu_stat_total": 1696, + "last_cpu_stat_idle": 1267, + "last_metric_at_unix": 1780827595 +} \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 7bc62a56..3e101290 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,8 +1,8 @@ services: agent: build: - context: . - dockerfile: openflare-agent/Dockerfile + context: ./openflare-server + dockerfile: docker/Dockerfile.agent container_name: openflare-agent restart: unless-stopped @@ -12,7 +12,7 @@ services: - "127.0.0.1:18081:18081" volumes: - - ./openflare-agent/data/:/data + - ./data/agent/:/data environment: OPENFLARE_SERVER_URL: "http://host.docker.internal:3000" @@ -24,13 +24,13 @@ services: relay: build: - context: . - dockerfile: openflare-relay/Dockerfile + context: ./openflare-server + dockerfile: docker/Dockerfile.relay container_name: openflare-relay network_mode: host restart: unless-stopped volumes: - - ./openflare-relay/data/:/app/data + - ./data/relay/:/app/data environment: OPENFLARE_SERVER_URL: http://host.docker.internal:3000 OPENFLARE_DISCOVERY_TOKEN: 85464eeb72c49abc430569d6b9c77f78 @@ -41,14 +41,15 @@ services: flared: build: - context: . - dockerfile: openflared/Dockerfile + context: ./openflare-server + dockerfile: docker/Dockerfile.flared container_name: openflare-flared network_mode: "host" restart: unless-stopped volumes: - - ./openflared/data/:/app/data + - ./data/flared/:/app/data environment: OPENFLARE_SERVER_URL: "http://host.docker.internal:3000" OPENFLARE_TUNNEL_TOKEN: deb0783ac1e264a9d86440169aca0f09 + diff --git a/go.mod b/go.mod deleted file mode 100644 index bc6f8358..00000000 --- a/go.mod +++ /dev/null @@ -1,99 +0,0 @@ -module github.com/rain-kl/openflare - -go 1.25.7 - -require ( - github.com/appleboy/gin-jwt/v2 v2.10.3 - github.com/bwmarrin/snowflake v0.3.0 - github.com/dgraph-io/ristretto/v2 v2.2.0 - github.com/expr-lang/expr v1.17.8 - github.com/gin-contrib/cors v1.6.0 - github.com/gin-contrib/sessions v0.0.5 - github.com/gin-contrib/static v0.0.1 - github.com/gin-gonic/gin v1.10.0 - github.com/glebarez/sqlite v1.11.0 - github.com/go-acme/lego/v4 v4.35.2 - github.com/go-playground/validator/v10 v10.25.0 - github.com/go-redis/redis/v8 v8.11.5 - github.com/google/uuid v1.6.0 - github.com/oschwald/maxminddb-golang v1.13.1 - github.com/pressly/goose/v3 v3.27.1 - github.com/robfig/cron/v3 v3.0.1 - github.com/swaggo/files v1.0.1 - github.com/swaggo/gin-swagger v1.6.1 - github.com/swaggo/swag v1.16.4 - golang.org/x/crypto v0.50.0 - golang.org/x/net v0.53.0 - gorm.io/driver/postgres v1.6.0 - gorm.io/gorm v1.25.10 - gorm.io/sharding v0.6.2 -) - -require ( - github.com/KyleBanks/depth v1.2.1 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/boj/redistore v0.0.0-20180917114910-cd5dcc76aeff // indirect - github.com/bytedance/sonic v1.12.9 // indirect - github.com/bytedance/sonic/loader v0.2.3 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/cloudwego/base64x v0.1.5 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/dustin/go-humanize v1.0.1 // indirect - github.com/gabriel-vasile/mimetype v1.4.13 // indirect - github.com/gin-contrib/sse v1.0.0 // indirect - github.com/glebarez/go-sqlite v1.21.2 // indirect - github.com/go-jose/go-jose/v4 v4.1.4 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.6 // indirect - github.com/go-openapi/spec v0.20.4 // indirect - github.com/go-openapi/swag v0.19.15 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/goccy/go-json v0.10.5 // indirect - github.com/golang-jwt/jwt/v4 v4.5.2 // indirect - github.com/gomodule/redigo v2.0.0+incompatible // indirect - github.com/gorilla/context v1.1.1 // indirect - github.com/gorilla/securecookie v1.1.1 // indirect - github.com/gorilla/sessions v1.2.1 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect - github.com/jackc/pgx/v5 v5.9.2 // indirect - github.com/jackc/puddle/v2 v2.2.2 // indirect - github.com/jinzhu/inflection v1.0.0 // indirect - github.com/jinzhu/now v1.1.5 // indirect - github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.13-0.20220915233716-71ac16282d12 // indirect - github.com/klauspost/cpuid/v2 v2.2.9 // indirect - github.com/leodido/go-urn v1.4.0 // indirect - github.com/longbridgeapp/sqlparser v0.3.1 // indirect - github.com/mailru/easyjson v0.7.6 // indirect - github.com/mattn/go-isatty v0.0.21 // indirect - github.com/mfridman/interpolate v0.0.2 // indirect - github.com/miekg/dns v1.1.72 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect - github.com/ncruces/go-strftime v1.0.0 // indirect - github.com/pelletier/go-toml/v2 v2.2.3 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/sethvargo/go-retry v0.3.0 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.12 // indirect - github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect - go.uber.org/multierr v1.11.0 // indirect - golang.org/x/arch v0.14.0 // indirect - golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect - golang.org/x/mod v0.35.0 // indirect - golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.43.0 // indirect - golang.org/x/text v0.36.0 // indirect - golang.org/x/tools v0.44.0 // indirect - google.golang.org/protobuf v1.36.11 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - modernc.org/libc v1.72.1 // indirect - modernc.org/mathutil v1.7.1 // indirect - modernc.org/memory v1.11.0 // indirect - modernc.org/sqlite v1.49.1 // indirect -) diff --git a/go.sum b/go.sum deleted file mode 100644 index cfa3d8ff..00000000 --- a/go.sum +++ /dev/null @@ -1,344 +0,0 @@ -filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= -filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= -github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= -github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/appleboy/gin-jwt/v2 v2.10.3 h1:KNcPC+XPRNpuoBh+j+rgs5bQxN+SwG/0tHbIqpRoBGc= -github.com/appleboy/gin-jwt/v2 v2.10.3/go.mod h1:LDUaQ8mF2W6LyXIbd5wqlV2SFebuyYs4RDwqMNgpsp8= -github.com/appleboy/gofight/v2 v2.1.2 h1:VOy3jow4vIK8BRQJoC/I9muxyYlJ2yb9ht2hZoS3rf4= -github.com/appleboy/gofight/v2 v2.1.2/go.mod h1:frW+U1QZEdDgixycTj4CygQ48yLTUhplt43+Wczp3rw= -github.com/boj/redistore v0.0.0-20180917114910-cd5dcc76aeff h1:RmdPFa+slIr4SCBg4st/l/vZWVe9QJKMXGO60Bxbe04= -github.com/boj/redistore v0.0.0-20180917114910-cd5dcc76aeff/go.mod h1:+RTT1BOk5P97fT2CiHkbFQwkK3mjsFAP6zCYV2aXtjw= -github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= -github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= -github.com/bytedance/sonic v1.12.9 h1:Od1BvK55NnewtGaJsTDeAOSnLVO2BTSLOe0+ooKokmQ= -github.com/bytedance/sonic v1.12.9/go.mod h1:uVvFidNmlt9+wa31S1urfwwthTWteBgG0hWuoKAXTx8= -github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= -github.com/bytedance/sonic/loader v0.2.3 h1:yctD0Q3v2NOGfSWPLPvG2ggA2kV6TS6s4wioyEqssH0= -github.com/bytedance/sonic/loader v0.2.3/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= -github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= -github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= -github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= -github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/ristretto/v2 v2.2.0 h1:bkY3XzJcXoMuELV8F+vS8kzNgicwQFAaGINAEJdWGOM= -github.com/dgraph-io/ristretto/v2 v2.2.0/go.mod h1:RZrm63UmcBAaYWC1DotLYBmTvgkrs0+XhBd7Npn7/zI= -github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da h1:aIftn67I1fkbMa512G+w+Pxci9hJPB8oMnkcP3iZF38= -github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/expr-lang/expr v1.17.8 h1:W1loDTT+0PQf5YteHSTpju2qfUfNoBt4yw9+wOEU9VM= -github.com/expr-lang/expr v1.17.8/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= -github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= -github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= -github.com/gabriel-vasile/mimetype v1.4.13 h1:46nXokslUBsAJE/wMsp5gtO500a4F3Nkz9Ufpk2AcUM= -github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s= -github.com/gin-contrib/cors v1.6.0 h1:0Z7D/bVhE6ja07lI8CTjTonp6SB07o8bNuFyRbsBUQg= -github.com/gin-contrib/cors v1.6.0/go.mod h1:cI+h6iOAyxKRtUtC6iF/Si1KSFvGm/gK+kshxlCi8ro= -github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= -github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= -github.com/gin-contrib/sessions v0.0.5 h1:CATtfHmLMQrMNpJRgzjWXD7worTh7g7ritsQfmF+0jE= -github.com/gin-contrib/sessions v0.0.5/go.mod h1:vYAuaUPqie3WUSsft6HUlCjlwwoJQs97miaG2+7neKY= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-contrib/sse v1.0.0 h1:y3bT1mUWUxDpW4JLQg/HnTqV4rozuW4tC9eFKTxYI9E= -github.com/gin-contrib/sse v1.0.0/go.mod h1:zNuFdwarAygJBht0NTKiSi3jRf6RbqeILZ9Sp6Slhe0= -github.com/gin-contrib/static v0.0.1 h1:JVxuvHPuUfkoul12N7dtQw7KRn/pSMq7Ue1Va9Swm1U= -github.com/gin-contrib/static v0.0.1/go.mod h1:CSxeF+wep05e0kCOsqWdAWbSszmc31zTIbD8TvWl7Hs= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= -github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= -github.com/glebarez/go-sqlite v1.21.2 h1:3a6LFC4sKahUunAmynQKLZceZCOzUthkRkEAl9gAXWo= -github.com/glebarez/go-sqlite v1.21.2/go.mod h1:sfxdZyhQjTM2Wry3gVYWaW072Ri1WMdWJi0k6+3382k= -github.com/glebarez/sqlite v1.11.0 h1:wSG0irqzP6VurnMEpFGer5Li19RpIRi2qvQz++w0GMw= -github.com/glebarez/sqlite v1.11.0/go.mod h1:h8/o8j5wiAsqSPoWELDUdJXhjAhsVliSn7bWZjOhrgQ= -github.com/go-acme/lego/v4 v4.35.2 h1:uVQg+KC/yj9R2g7Q9W5wDqhvQvxV5SMu5eqFVoN5xZU= -github.com/go-acme/lego/v4 v4.35.2/go.mod h1:pX2jN5n8OphMGY1IaMjYm5DAEzguBaKRt8AvJAgJXpc= -github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= -github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= -github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.25.0 h1:5Dh7cjvzR7BRZadnsVOzPhWsrwUr0nmsZJxEAnFLNO8= -github.com/go-playground/validator/v10 v10.25.0/go.mod h1:GGzBIJMuE98Ic/kJsBXbz1x/7cByt++cQ+YOuDM5wus= -github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= -github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo= -github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU= -github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= -github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= -github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= -github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= -github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= -github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs= -github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= -github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= -github.com/gorilla/sessions v1.1.1/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= -github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= -github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= -github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= -github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.9.2 h1:3ZhOzMWnR4yJ+RW1XImIPsD1aNSz4T4fyP7zlQb56hw= -github.com/jackc/pgx/v5 v5.9.2/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= -github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= -github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.13-0.20220915233716-71ac16282d12 h1:9Nu54bhS/H/Kgo2/7xNSUuC5G28VR8ljfrLKU2G4IjU= -github.com/json-iterator/go v1.1.13-0.20220915233716-71ac16282d12/go.mod h1:TBzl5BIHNXfS9+C35ZyJaklL7mLDbgUkcgXzSLa8Tk0= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= -github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= -github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/longbridgeapp/assert v1.1.0 h1:L+/HISOhuGbNAAmJNXgk3+Tm5QmSB70kwdktJXgjL+I= -github.com/longbridgeapp/assert v1.1.0/go.mod h1:UOI7O3rzlzlz715lQm0atWs6JbrYGuIJUEeOekutL6o= -github.com/longbridgeapp/sqlparser v0.3.1 h1:iWOZWGIFgQrJRgobLXUNJdvqGRpbVXkyKUKUA5CNJBE= -github.com/longbridgeapp/sqlparser v0.3.1/go.mod h1:GIHaUq8zvYyHLCLMJJykx1CdM6LHtkUih/QaJXySSx4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.21 h1:xYae+lCNBP7QuW4PUnNG61ffM4hVIfm+zUzDuSzYLGs= -github.com/mattn/go-isatty v0.0.21/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= -github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= -github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= -github.com/miekg/dns v1.1.72 h1:vhmr+TF2A3tuoGNkLDFK9zi36F2LS+hKTRW0Uf8kbzI= -github.com/miekg/dns v1.1.72/go.mod h1:+EuEPhdHOsfk6Wk5TT2CzssZdqkmFhf8r+aVyDEToIs= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= -github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w= -github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -github.com/oschwald/maxminddb-golang v1.13.1 h1:G3wwjdN9JmIK2o/ermkHM+98oX5fS+k5MbwsmL4MRQE= -github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk4IsCNThNdTmnaBZ/F8= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pressly/goose/v3 v3.27.1 h1:6uEvcprBybDmW4hcz3gYujhARhye+GoWKhEWyzD5sh4= -github.com/pressly/goose/v3 v3.27.1/go.mod h1:maruOxsPnIG2yHHyo8UqKWXYKFcH7Q76csUV7+7KYoM= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= -github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE= -github.com/sethvargo/go-retry v0.3.0/go.mod h1:mNX17F0C/HguQMyMyJxcnU471gOZGxCLyYaFyAZraas= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= -github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= -github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= -github.com/swaggo/gin-swagger v1.6.1 h1:Ri06G4gc9N4t4k8hekMigJ9zKTFSlqj/9paAQCQs7cY= -github.com/swaggo/gin-swagger v1.6.1/go.mod h1:LQ+hJStHakCWRiK/YNYtJOu4mR2FP+pxLnILT/qNiTw= -github.com/swaggo/swag v1.16.4 h1:clWJtd9LStiG3VeijiCfOVODP6VpHtKdQy9ELFG3s1A= -github.com/swaggo/swag v1.16.4/go.mod h1:VBsHJRsDvfYvqoiMKnsdwhNV9LEMHgEDZcyVYX0sxPg= -github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= -github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= -github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM= -github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -golang.org/x/arch v0.14.0 h1:z9JUEZWr8x4rR0OU6c4/4t6E6jOZ8/QBS2bBYBm4tx4= -golang.org/x/arch v0.14.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= -golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= -golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM= -golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= -golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= -golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= -golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= -golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= -golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= -google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= -gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= -gorm.io/driver/postgres v1.6.0 h1:2dxzU8xJ+ivvqTRph34QX+WrRaJlmfyPqXmoGVjMBa4= -gorm.io/driver/postgres v1.6.0/go.mod h1:vUw0mrGgrTK+uPHEhAdV4sfFELrByKVGnaVRkXDhtWo= -gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s= -gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= -gorm.io/hints v1.1.2 h1:b5j0kwk5p4+3BtDtYqqfY+ATSxjj+6ptPgVveuynn9o= -gorm.io/hints v1.1.2/go.mod h1:/ARdpUHAtyEMCh5NNi3tI7FsGh+Cj/MIUlvNxCNCFWg= -gorm.io/plugin/dbresolver v1.5.1 h1:s9Dj9f7r+1rE3nx/Ywzc85nXptUEaeOO0pt27xdopM8= -gorm.io/plugin/dbresolver v1.5.1/go.mod h1:l4Cn87EHLEYuqUncpEeTC2tTJQkjngPSD+lo8hIvcT0= -gorm.io/sharding v0.6.2 h1:V9inmbdhN+RfWPEKTvbKKKv7qxLz1CneBDQvuL5P7jg= -gorm.io/sharding v0.6.2/go.mod h1:dXaAZv0qyUmLkLAciQ+NH2O1D1A4/ttrrZ/XK4xW9HU= -modernc.org/cc/v4 v4.28.1 h1:XpLbkYVQ24E8tX5u8+yWGvaxerxkR/S4zqxI8ZoSBuc= -modernc.org/cc/v4 v4.28.1/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI= -modernc.org/ccgo/v4 v4.33.0 h1:dspBCm75jsj8Y/ufwAMVfe375L2iYdMyQ2QG/v3hL54= -modernc.org/ccgo/v4 v4.33.0/go.mod h1:+RhXBoRYzRwaH21mV/aj6XvQRDtfjcZfAlPMsQo8CR0= -modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM= -modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU= -modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI= -modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito= -modernc.org/gc/v3 v3.1.2 h1:ZtDCnhonXSZexk/AYsegNRV1lJGgaNZJuKjJSWKyEqo= -modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY= -modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks= -modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI= -modernc.org/libc v1.72.1 h1:db1xwJ6u1kE3KHTFTTbe2GCrczHPKzlURP0aDC4NGD0= -modernc.org/libc v1.72.1/go.mod h1:HRMiC/PhPGLIPM7GzAFCbI+oSgE3dhZ8FWftmRrHVlY= -modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= -modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= -modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI= -modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw= -modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg= -modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns= -modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w= -modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE= -modernc.org/sqlite v1.49.1 h1:dYGHTKcX1sJ+EQDnUzvz4TJ5GbuvhNJa8Fg6ElGx73U= -modernc.org/sqlite v1.49.1/go.mod h1:m0w8xhwYUVY3H6pSDwc3gkJ/irZT/0YEXwBlhaxQEew= -modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= -modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= -modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= -modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= diff --git a/openflare-agent/.gitignore b/openflare-agent/.gitignore deleted file mode 100644 index 6320cd24..00000000 --- a/openflare-agent/.gitignore +++ /dev/null @@ -1 +0,0 @@ -data \ No newline at end of file diff --git a/openflare-agent/agent.json b/openflare-agent/agent.json deleted file mode 100644 index e4808bfd..00000000 --- a/openflare-agent/agent.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "server_url": "http://127.0.0.1:3000", - "agent_token": "373956188ddead1df6dd7c86cd330b73", - "data_dir": "./data", - "openresty_path": "openresty", - "heartbeat_interval": 10000, - "request_timeout": 10000 -} diff --git a/openflare-relay/.gitignore b/openflare-relay/.gitignore deleted file mode 100644 index 5fac6285..00000000 --- a/openflare-relay/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/data/ \ No newline at end of file diff --git a/openflare-server/.dmux-hooks/AGENTS.md b/openflare-server/.dmux-hooks/AGENTS.md deleted file mode 100644 index 1a5001bb..00000000 --- a/openflare-server/.dmux-hooks/AGENTS.md +++ /dev/null @@ -1,445 +0,0 @@ -# dmux Hooks System - Agent Reference - -**Auto-generated documentation for AI agents** - -This document contains everything an AI agent needs to create, modify, and understand dmux hooks. It is automatically generated from the dmux source code and embedded in the binary. - -## What You're Working On - -You are editing hooks for **dmux**, a tmux pane manager that creates AI-powered development workflows. Each pane runs in its own git worktree with an AI agent. - -## Your Goal - -Create executable bash scripts in `.dmux-hooks/` that run automatically at key lifecycle events. - -## Quick Start - -1. **Create a hook file**: `touch .dmux-hooks/worktree_created` -2. **Make it executable**: `chmod +x .dmux-hooks/worktree_created` -3. **Add shebang**: Start with `#!/bin/bash` -4. **Use environment variables**: Access `$DMUX_ROOT`, `$DMUX_WORKTREE_PATH`, etc. -5. **Test it**: Set env vars manually and run the script - -## Hook Execution Model - -- **Mostly non-blocking**: Most hooks run in background (detached processes) -- **Bootstrap-gated**: `worktree_created` blocks agent launch so setup can finish first, with no fixed timeout -- **Live bootstrap output**: During `worktree_created`, stdout/stderr is streamed into the new pane's setup UI -- **Failure behavior**: Background hook errors are logged; gated hooks can abort the operation -- **Environment-based**: All context passed via environment variables -- **Version controlled**: Hooks in `.dmux-hooks/` are shared with team -- **Priority resolution**: `.dmux-hooks/` → `.dmux/hooks/` → `~/.dmux/hooks/` - -## Available Hooks - -### Pane Lifecycle Hooks - -| Hook | When | Common Use Cases | -|------|------|------------------| -| `before_pane_create` | Before pane creation | Validation, notifications, pre-flight checks | -| `pane_created` | After pane, before worktree | Configure tmux settings, prepare environment | -| `worktree_created` | After worktree creation, before agent launch | Install deps, copy configs, setup git | -| `before_pane_close` | Before closing | Save state, backup uncommitted work | -| `pane_closed` | After closed | Cleanup resources, analytics, notifications | - -### Worktree Lifecycle Hooks - -| Hook | When | Common Use Cases | -|------|------|------------------| -| `before_worktree_remove` | Before worktree removal | Archive worktree, save artifacts | -| `worktree_removed` | After worktree removed | Cleanup external references | - -### Merge Lifecycle Hooks - -| Hook | When | Common Use Cases | -|------|------|------------------| -| `pre_merge` | Before merge operation | Run final tests, create backups | -| `post_merge` | After successful merge | Deploy, close issues, notify team | - -### Interactive Hooks (with HTTP callbacks) - -| Hook | When | Common Use Cases | -|------|------|------------------| -| `run_test` | When tests triggered | Run test suite, report status via HTTP | -| `run_dev` | When dev server triggered | Start dev server, create tunnel, report URL | - - -## Environment Variables - -### Always Available -```bash -DMUX_ROOT="/path/to/project" # Project root directory -DMUX_SERVER_PORT="3142" # HTTP server port -``` - -### Pane Context (most hooks) -```bash -DMUX_PANE_ID="dmux-1234567890" # dmux pane identifier -DMUX_SLUG="fix-auth-bug" # Branch/worktree name -DMUX_PROMPT="Fix authentication bug" # User's prompt -DMUX_AGENT="claude" # Agent type (registry id, e.g. claude, codex, opencode) -DMUX_TMUX_PANE_ID="%38" # tmux pane ID -``` - -### Worktree Context -```bash -DMUX_WORKTREE_PATH="/path/.dmux/worktrees/fix-auth-bug" -DMUX_BRANCH="fix-auth-bug" # Same as slug -``` - -### Bootstrap Progress Context -```bash -DMUX_PROGRESS="1" # Set when output is shown in the new pane setup UI -DMUX_STATUS_PREFIX="DMUX_STATUS:" # Prefix for clean status messages -``` - -`worktree_created` can emit progress while it runs. Any stdout/stderr line is shown in the setup UI; lines prefixed with `$DMUX_STATUS_PREFIX` are displayed without the prefix. - -```bash -status() { - if [ "${DMUX_PROGRESS:-0}" = "1" ]; then - echo "${DMUX_STATUS_PREFIX:-DMUX_STATUS:} $*" - else - echo "[Hook] $*" - fi -} -``` - -### Merge Context -```bash -DMUX_TARGET_BRANCH="main" # Branch being merged into -``` - -## HTTP Callback API - -Interactive hooks (`run_test` and `run_dev`) can update dmux UI via HTTP. - -### Update Test Status -```bash -curl -X PUT "http://localhost:$DMUX_SERVER_PORT/api/panes/$DMUX_PANE_ID/test" -H "Content-Type: application/json" -d '{"status": "running", "output": "optional test output"}' - -# Status values: "running" | "passed" | "failed" -``` - -### Update Dev Server -```bash -curl -X PUT "http://localhost:$DMUX_SERVER_PORT/api/panes/$DMUX_PANE_ID/dev" -H "Content-Type: application/json" -d '{"status": "running", "url": "http://localhost:3000"}' - -# Status values: "running" | "stopped" -# url: Can be localhost or tunnel URL (ngrok, cloudflared, etc.) -``` - -## Common Patterns - -### Pattern 1: Install Dependencies -```bash -#!/bin/bash -# .dmux-hooks/worktree_created - -cd "$DMUX_WORKTREE_PATH" - -status() { - if [ "${DMUX_PROGRESS:-0}" = "1" ]; then - echo "${DMUX_STATUS_PREFIX:-DMUX_STATUS:} $*" - else - echo "[Hook] $*" - fi -} - -if [ -f "pnpm-lock.yaml" ]; then - status "Installing dependencies with pnpm" - pnpm install --prefer-offline -elif [ -f "package-lock.json" ]; then - status "Installing dependencies with npm" - npm install -elif [ -f "yarn.lock" ]; then - status "Installing dependencies with yarn" - yarn install -elif [ -f "Gemfile" ]; then - status "Installing gems" - bundle install -elif [ -f "requirements.txt" ]; then - status "Installing Python dependencies" - pip install -r requirements.txt -elif [ -f "Cargo.toml" ]; then - status "Building Rust project" - cargo build -fi -``` - -### Pattern 2: Copy Configuration -```bash -#!/bin/bash -# .dmux-hooks/worktree_created - -# Copy environment file -if [ -f "$DMUX_ROOT/.env.local" ]; then - cp "$DMUX_ROOT/.env.local" "$DMUX_WORKTREE_PATH/.env.local" -fi - -# Copy other config files -for file in .env.development .npmrc .yarnrc; do - if [ -f "$DMUX_ROOT/$file" ]; then - cp "$DMUX_ROOT/$file" "$DMUX_WORKTREE_PATH/$file" - fi -done -``` - -### Pattern 3: Run Tests with Status Updates -```bash -#!/bin/bash -# .dmux-hooks/run_test - -set -e -cd "$DMUX_WORKTREE_PATH" -API="http://localhost:$DMUX_SERVER_PORT/api/panes/$DMUX_PANE_ID/test" - -# Update: starting -curl -s -X PUT "$API" -H "Content-Type: application/json" -d '{"status": "running"}' > /dev/null - -# Run tests and capture output -OUTPUT_FILE="/tmp/dmux-test-$DMUX_PANE_ID.txt" -if pnpm test > "$OUTPUT_FILE" 2>&1; then - STATUS="passed" -else - STATUS="failed" -fi - -# Get output (truncate if too long) -OUTPUT=$(head -c 5000 "$OUTPUT_FILE") - -# Update: complete -curl -s -X PUT "$API" -H "Content-Type: application/json" -d "$(jq -n --arg status "$STATUS" --arg output "$OUTPUT" '{status: $status, output: $output}')" > /dev/null - -rm -f "$OUTPUT_FILE" -``` - -### Pattern 4: Dev Server with Tunnel -```bash -#!/bin/bash -# .dmux-hooks/run_dev - -set -e -cd "$DMUX_WORKTREE_PATH" -API="http://localhost:$DMUX_SERVER_PORT/api/panes/$DMUX_PANE_ID/dev" - -# Start dev server in background -LOG_FILE="/tmp/dmux-dev-$DMUX_PANE_ID.log" -pnpm dev > "$LOG_FILE" 2>&1 & -DEV_PID=$! - -# Wait for server to start -sleep 5 - -# Detect port from logs -PORT=$(grep -oP 'localhost:Kd+' "$LOG_FILE" | head -1) -[ -z "$PORT" ] && PORT=3000 - -# Optional: Create tunnel with cloudflared -if command -v cloudflared &> /dev/null; then - TUNNEL=$(cloudflared tunnel --url "http://localhost:$PORT" 2>&1 | grep -oP 'https://[a-z0-9-]+.trycloudflare.com' | head -1) - URL="${TUNNEL:-http://localhost:$PORT}" -else - URL="http://localhost:$PORT" -fi - -# Report status -curl -s -X PUT "$API" -H "Content-Type: application/json" -d "{"status": "running", "url": "$URL"}" > /dev/null - -echo "[Hook] Dev server running at $URL (PID: $DEV_PID)" -``` - -### Pattern 5: Post-Merge Deployment -```bash -#!/bin/bash -# .dmux-hooks/post_merge - -set -e -cd "$DMUX_ROOT" - -# Only deploy from main/master -if [ "$DMUX_TARGET_BRANCH" != "main" ] && [ "$DMUX_TARGET_BRANCH" != "master" ]; then - exit 0 -fi - -# Push to remote -git push origin "$DMUX_TARGET_BRANCH" - -# Trigger deployment (example: Vercel) -if [ -n "$VERCEL_TOKEN" ]; then - curl -s -X POST "https://api.vercel.com/v1/deployments" -H "Authorization: Bearer $VERCEL_TOKEN" -H "Content-Type: application/json" -d '{"name": "my-project"}' > /dev/null -fi - -# Close GitHub issue if prompt contains #123 -ISSUE=$(echo "$DMUX_PROMPT" | grep -oP '#Kd+' | head -1) -if [ -n "$ISSUE" ] && command -v gh &> /dev/null; then - gh issue close "$ISSUE" -c "Resolved in $DMUX_SLUG, merged to $DMUX_TARGET_BRANCH" 2>/dev/null || true -fi -``` - -## Best Practices - -1. **Always start with shebang**: `#!/bin/bash` -2. **Set error handling**: `set -e` (exit on error) -3. **Make executable**: `chmod +x .dmux-hooks/hook_name` -4. **Background long operations**: Append `&` to avoid blocking -5. **Check for required tools**: `command -v tool &> /dev/null` -6. **Log for debugging**: `echo "[Hook] message" >> "$DMUX_ROOT/.dmux/hooks.log"` -7. **Handle missing vars gracefully**: `[ -z "$VAR" ] && exit 0` -8. **Use silent curl**: `curl -s` to avoid noise in logs -9. **Clean up temp files**: Remove files in `/tmp/` -10. **Test before committing**: Run hooks manually with mock env vars - -## Testing Hooks - -### Manual Testing -```bash -# 1. Set environment variables -export DMUX_ROOT="$(pwd)" -export DMUX_PANE_ID="test-pane" -export DMUX_SLUG="test-branch" -export DMUX_WORKTREE_PATH="$(pwd)" -export DMUX_SERVER_PORT="3142" -export DMUX_AGENT="claude" -export DMUX_PROMPT="Test prompt" - -# 2. Run hook directly -./.dmux-hooks/worktree_created - -# 3. Check exit code -echo $? # Should be 0 for success -``` - -### Syntax Check -```bash -# Check for syntax errors without running -bash -n ./.dmux-hooks/worktree_created -``` - -### Shellcheck (if available) -```bash -shellcheck ./.dmux-hooks/worktree_created -``` - -## Project Context Analysis - -Before creating hooks, analyze these files in the project: - -### Package Manager Detection -```bash -# Check which package manager is used -if [ -f "pnpm-lock.yaml" ]; then - # Use: pnpm install, pnpm test, pnpm dev -elif [ -f "package-lock.json" ]; then - # Use: npm install, npm test, npm run dev -elif [ -f "yarn.lock" ]; then - # Use: yarn install, yarn test, yarn dev -fi -``` - -### Test Command Discovery -```bash -# Read package.json to find test command -cat package.json | grep '"test"' -# Or with jq: -jq -r '.scripts.test' package.json -``` - -### Dev Command Discovery -```bash -# Read package.json to find dev command -cat package.json | grep '"dev"' -# Or with jq: -jq -r '.scripts.dev' package.json -``` - -### Environment Variables -```bash -# Check for .env files to copy -ls -la | grep '.env' -``` - -### Build System -```bash -# Detect build system -if [ -f "vite.config.ts" ]; then - # Vite project -elif [ -f "next.config.js" ]; then - # Next.js project -elif [ -f "nuxt.config.ts" ]; then - # Nuxt project -fi -``` - -## Common Mistakes to Avoid - -❌ **Blocking operations**: `sleep 60` (blocks dmux) -✅ **Background long tasks**: `slow_operation &` - -❌ **Hardcoded paths**: `/Users/me/project` -✅ **Use variables**: `"$DMUX_ROOT"` - -❌ **Assuming tools exist**: `pnpm install` -✅ **Check first**: `command -v pnpm && pnpm install` - -❌ **No error handling**: Script fails silently -✅ **Set error mode**: `set -e` or check exit codes - -❌ **Forgetting executable bit**: Hook won't run -✅ **Make executable**: `chmod +x` - -❌ **Noisy output**: Clutters dmux logs -✅ **Silent operations**: `curl -s`, `> /dev/null 2>&1` - -❌ **Not testing**: Deploy and hope -✅ **Test manually**: Run with mock env vars first - -## Debugging - -If a hook isn't working: - -1. **Check if file exists**: `ls -la .dmux-hooks/` -2. **Check permissions**: Should show `x` in `rwxr-xr-x` -3. **Check syntax**: `bash -n .dmux-hooks/hook_name` -4. **Test manually**: Set env vars and run -5. **Check logs**: dmux logs to stderr with `[Hooks]` prefix -6. **Simplify**: Remove complex parts, test basic version -7. **Check tool availability**: `command -v required_tool` - -### Debug Mode -```bash -#!/bin/bash -# Add to top of hook for debugging -set -x # Print each command before executing -set -e # Exit on error - -# Your hook logic here -``` - -## Summary Checklist - -When creating a new hook: - -- [ ] Create file in `.dmux-hooks/` -- [ ] Add shebang: `#!/bin/bash` -- [ ] Make executable: `chmod +x` -- [ ] Add `set -e` for error handling -- [ ] Use environment variables (never hardcode paths) -- [ ] Keep blocking hooks chatty with status output -- [ ] Background long operations with `&` only when the hook does not gate the operation -- [ ] Check for required tools before using -- [ ] Test manually with mock env vars -- [ ] Add comments explaining what it does -- [ ] Commit to version control - -## Getting Help - -- **Full documentation**: See `HOOKS.md` in project root -- **Claude-specific tips**: See `CLAUDE.md` in `.dmux-hooks/` -- **Examples**: Check `.dmux-hooks/examples/` directory -- **dmux API**: See `API.md` for REST endpoints - ---- - -*This documentation was auto-generated from dmux source code.* -*Version: 2026-05-25* diff --git a/openflare-server/.dmux-hooks/CLAUDE.md b/openflare-server/.dmux-hooks/CLAUDE.md deleted file mode 100644 index 1a5001bb..00000000 --- a/openflare-server/.dmux-hooks/CLAUDE.md +++ /dev/null @@ -1,445 +0,0 @@ -# dmux Hooks System - Agent Reference - -**Auto-generated documentation for AI agents** - -This document contains everything an AI agent needs to create, modify, and understand dmux hooks. It is automatically generated from the dmux source code and embedded in the binary. - -## What You're Working On - -You are editing hooks for **dmux**, a tmux pane manager that creates AI-powered development workflows. Each pane runs in its own git worktree with an AI agent. - -## Your Goal - -Create executable bash scripts in `.dmux-hooks/` that run automatically at key lifecycle events. - -## Quick Start - -1. **Create a hook file**: `touch .dmux-hooks/worktree_created` -2. **Make it executable**: `chmod +x .dmux-hooks/worktree_created` -3. **Add shebang**: Start with `#!/bin/bash` -4. **Use environment variables**: Access `$DMUX_ROOT`, `$DMUX_WORKTREE_PATH`, etc. -5. **Test it**: Set env vars manually and run the script - -## Hook Execution Model - -- **Mostly non-blocking**: Most hooks run in background (detached processes) -- **Bootstrap-gated**: `worktree_created` blocks agent launch so setup can finish first, with no fixed timeout -- **Live bootstrap output**: During `worktree_created`, stdout/stderr is streamed into the new pane's setup UI -- **Failure behavior**: Background hook errors are logged; gated hooks can abort the operation -- **Environment-based**: All context passed via environment variables -- **Version controlled**: Hooks in `.dmux-hooks/` are shared with team -- **Priority resolution**: `.dmux-hooks/` → `.dmux/hooks/` → `~/.dmux/hooks/` - -## Available Hooks - -### Pane Lifecycle Hooks - -| Hook | When | Common Use Cases | -|------|------|------------------| -| `before_pane_create` | Before pane creation | Validation, notifications, pre-flight checks | -| `pane_created` | After pane, before worktree | Configure tmux settings, prepare environment | -| `worktree_created` | After worktree creation, before agent launch | Install deps, copy configs, setup git | -| `before_pane_close` | Before closing | Save state, backup uncommitted work | -| `pane_closed` | After closed | Cleanup resources, analytics, notifications | - -### Worktree Lifecycle Hooks - -| Hook | When | Common Use Cases | -|------|------|------------------| -| `before_worktree_remove` | Before worktree removal | Archive worktree, save artifacts | -| `worktree_removed` | After worktree removed | Cleanup external references | - -### Merge Lifecycle Hooks - -| Hook | When | Common Use Cases | -|------|------|------------------| -| `pre_merge` | Before merge operation | Run final tests, create backups | -| `post_merge` | After successful merge | Deploy, close issues, notify team | - -### Interactive Hooks (with HTTP callbacks) - -| Hook | When | Common Use Cases | -|------|------|------------------| -| `run_test` | When tests triggered | Run test suite, report status via HTTP | -| `run_dev` | When dev server triggered | Start dev server, create tunnel, report URL | - - -## Environment Variables - -### Always Available -```bash -DMUX_ROOT="/path/to/project" # Project root directory -DMUX_SERVER_PORT="3142" # HTTP server port -``` - -### Pane Context (most hooks) -```bash -DMUX_PANE_ID="dmux-1234567890" # dmux pane identifier -DMUX_SLUG="fix-auth-bug" # Branch/worktree name -DMUX_PROMPT="Fix authentication bug" # User's prompt -DMUX_AGENT="claude" # Agent type (registry id, e.g. claude, codex, opencode) -DMUX_TMUX_PANE_ID="%38" # tmux pane ID -``` - -### Worktree Context -```bash -DMUX_WORKTREE_PATH="/path/.dmux/worktrees/fix-auth-bug" -DMUX_BRANCH="fix-auth-bug" # Same as slug -``` - -### Bootstrap Progress Context -```bash -DMUX_PROGRESS="1" # Set when output is shown in the new pane setup UI -DMUX_STATUS_PREFIX="DMUX_STATUS:" # Prefix for clean status messages -``` - -`worktree_created` can emit progress while it runs. Any stdout/stderr line is shown in the setup UI; lines prefixed with `$DMUX_STATUS_PREFIX` are displayed without the prefix. - -```bash -status() { - if [ "${DMUX_PROGRESS:-0}" = "1" ]; then - echo "${DMUX_STATUS_PREFIX:-DMUX_STATUS:} $*" - else - echo "[Hook] $*" - fi -} -``` - -### Merge Context -```bash -DMUX_TARGET_BRANCH="main" # Branch being merged into -``` - -## HTTP Callback API - -Interactive hooks (`run_test` and `run_dev`) can update dmux UI via HTTP. - -### Update Test Status -```bash -curl -X PUT "http://localhost:$DMUX_SERVER_PORT/api/panes/$DMUX_PANE_ID/test" -H "Content-Type: application/json" -d '{"status": "running", "output": "optional test output"}' - -# Status values: "running" | "passed" | "failed" -``` - -### Update Dev Server -```bash -curl -X PUT "http://localhost:$DMUX_SERVER_PORT/api/panes/$DMUX_PANE_ID/dev" -H "Content-Type: application/json" -d '{"status": "running", "url": "http://localhost:3000"}' - -# Status values: "running" | "stopped" -# url: Can be localhost or tunnel URL (ngrok, cloudflared, etc.) -``` - -## Common Patterns - -### Pattern 1: Install Dependencies -```bash -#!/bin/bash -# .dmux-hooks/worktree_created - -cd "$DMUX_WORKTREE_PATH" - -status() { - if [ "${DMUX_PROGRESS:-0}" = "1" ]; then - echo "${DMUX_STATUS_PREFIX:-DMUX_STATUS:} $*" - else - echo "[Hook] $*" - fi -} - -if [ -f "pnpm-lock.yaml" ]; then - status "Installing dependencies with pnpm" - pnpm install --prefer-offline -elif [ -f "package-lock.json" ]; then - status "Installing dependencies with npm" - npm install -elif [ -f "yarn.lock" ]; then - status "Installing dependencies with yarn" - yarn install -elif [ -f "Gemfile" ]; then - status "Installing gems" - bundle install -elif [ -f "requirements.txt" ]; then - status "Installing Python dependencies" - pip install -r requirements.txt -elif [ -f "Cargo.toml" ]; then - status "Building Rust project" - cargo build -fi -``` - -### Pattern 2: Copy Configuration -```bash -#!/bin/bash -# .dmux-hooks/worktree_created - -# Copy environment file -if [ -f "$DMUX_ROOT/.env.local" ]; then - cp "$DMUX_ROOT/.env.local" "$DMUX_WORKTREE_PATH/.env.local" -fi - -# Copy other config files -for file in .env.development .npmrc .yarnrc; do - if [ -f "$DMUX_ROOT/$file" ]; then - cp "$DMUX_ROOT/$file" "$DMUX_WORKTREE_PATH/$file" - fi -done -``` - -### Pattern 3: Run Tests with Status Updates -```bash -#!/bin/bash -# .dmux-hooks/run_test - -set -e -cd "$DMUX_WORKTREE_PATH" -API="http://localhost:$DMUX_SERVER_PORT/api/panes/$DMUX_PANE_ID/test" - -# Update: starting -curl -s -X PUT "$API" -H "Content-Type: application/json" -d '{"status": "running"}' > /dev/null - -# Run tests and capture output -OUTPUT_FILE="/tmp/dmux-test-$DMUX_PANE_ID.txt" -if pnpm test > "$OUTPUT_FILE" 2>&1; then - STATUS="passed" -else - STATUS="failed" -fi - -# Get output (truncate if too long) -OUTPUT=$(head -c 5000 "$OUTPUT_FILE") - -# Update: complete -curl -s -X PUT "$API" -H "Content-Type: application/json" -d "$(jq -n --arg status "$STATUS" --arg output "$OUTPUT" '{status: $status, output: $output}')" > /dev/null - -rm -f "$OUTPUT_FILE" -``` - -### Pattern 4: Dev Server with Tunnel -```bash -#!/bin/bash -# .dmux-hooks/run_dev - -set -e -cd "$DMUX_WORKTREE_PATH" -API="http://localhost:$DMUX_SERVER_PORT/api/panes/$DMUX_PANE_ID/dev" - -# Start dev server in background -LOG_FILE="/tmp/dmux-dev-$DMUX_PANE_ID.log" -pnpm dev > "$LOG_FILE" 2>&1 & -DEV_PID=$! - -# Wait for server to start -sleep 5 - -# Detect port from logs -PORT=$(grep -oP 'localhost:Kd+' "$LOG_FILE" | head -1) -[ -z "$PORT" ] && PORT=3000 - -# Optional: Create tunnel with cloudflared -if command -v cloudflared &> /dev/null; then - TUNNEL=$(cloudflared tunnel --url "http://localhost:$PORT" 2>&1 | grep -oP 'https://[a-z0-9-]+.trycloudflare.com' | head -1) - URL="${TUNNEL:-http://localhost:$PORT}" -else - URL="http://localhost:$PORT" -fi - -# Report status -curl -s -X PUT "$API" -H "Content-Type: application/json" -d "{"status": "running", "url": "$URL"}" > /dev/null - -echo "[Hook] Dev server running at $URL (PID: $DEV_PID)" -``` - -### Pattern 5: Post-Merge Deployment -```bash -#!/bin/bash -# .dmux-hooks/post_merge - -set -e -cd "$DMUX_ROOT" - -# Only deploy from main/master -if [ "$DMUX_TARGET_BRANCH" != "main" ] && [ "$DMUX_TARGET_BRANCH" != "master" ]; then - exit 0 -fi - -# Push to remote -git push origin "$DMUX_TARGET_BRANCH" - -# Trigger deployment (example: Vercel) -if [ -n "$VERCEL_TOKEN" ]; then - curl -s -X POST "https://api.vercel.com/v1/deployments" -H "Authorization: Bearer $VERCEL_TOKEN" -H "Content-Type: application/json" -d '{"name": "my-project"}' > /dev/null -fi - -# Close GitHub issue if prompt contains #123 -ISSUE=$(echo "$DMUX_PROMPT" | grep -oP '#Kd+' | head -1) -if [ -n "$ISSUE" ] && command -v gh &> /dev/null; then - gh issue close "$ISSUE" -c "Resolved in $DMUX_SLUG, merged to $DMUX_TARGET_BRANCH" 2>/dev/null || true -fi -``` - -## Best Practices - -1. **Always start with shebang**: `#!/bin/bash` -2. **Set error handling**: `set -e` (exit on error) -3. **Make executable**: `chmod +x .dmux-hooks/hook_name` -4. **Background long operations**: Append `&` to avoid blocking -5. **Check for required tools**: `command -v tool &> /dev/null` -6. **Log for debugging**: `echo "[Hook] message" >> "$DMUX_ROOT/.dmux/hooks.log"` -7. **Handle missing vars gracefully**: `[ -z "$VAR" ] && exit 0` -8. **Use silent curl**: `curl -s` to avoid noise in logs -9. **Clean up temp files**: Remove files in `/tmp/` -10. **Test before committing**: Run hooks manually with mock env vars - -## Testing Hooks - -### Manual Testing -```bash -# 1. Set environment variables -export DMUX_ROOT="$(pwd)" -export DMUX_PANE_ID="test-pane" -export DMUX_SLUG="test-branch" -export DMUX_WORKTREE_PATH="$(pwd)" -export DMUX_SERVER_PORT="3142" -export DMUX_AGENT="claude" -export DMUX_PROMPT="Test prompt" - -# 2. Run hook directly -./.dmux-hooks/worktree_created - -# 3. Check exit code -echo $? # Should be 0 for success -``` - -### Syntax Check -```bash -# Check for syntax errors without running -bash -n ./.dmux-hooks/worktree_created -``` - -### Shellcheck (if available) -```bash -shellcheck ./.dmux-hooks/worktree_created -``` - -## Project Context Analysis - -Before creating hooks, analyze these files in the project: - -### Package Manager Detection -```bash -# Check which package manager is used -if [ -f "pnpm-lock.yaml" ]; then - # Use: pnpm install, pnpm test, pnpm dev -elif [ -f "package-lock.json" ]; then - # Use: npm install, npm test, npm run dev -elif [ -f "yarn.lock" ]; then - # Use: yarn install, yarn test, yarn dev -fi -``` - -### Test Command Discovery -```bash -# Read package.json to find test command -cat package.json | grep '"test"' -# Or with jq: -jq -r '.scripts.test' package.json -``` - -### Dev Command Discovery -```bash -# Read package.json to find dev command -cat package.json | grep '"dev"' -# Or with jq: -jq -r '.scripts.dev' package.json -``` - -### Environment Variables -```bash -# Check for .env files to copy -ls -la | grep '.env' -``` - -### Build System -```bash -# Detect build system -if [ -f "vite.config.ts" ]; then - # Vite project -elif [ -f "next.config.js" ]; then - # Next.js project -elif [ -f "nuxt.config.ts" ]; then - # Nuxt project -fi -``` - -## Common Mistakes to Avoid - -❌ **Blocking operations**: `sleep 60` (blocks dmux) -✅ **Background long tasks**: `slow_operation &` - -❌ **Hardcoded paths**: `/Users/me/project` -✅ **Use variables**: `"$DMUX_ROOT"` - -❌ **Assuming tools exist**: `pnpm install` -✅ **Check first**: `command -v pnpm && pnpm install` - -❌ **No error handling**: Script fails silently -✅ **Set error mode**: `set -e` or check exit codes - -❌ **Forgetting executable bit**: Hook won't run -✅ **Make executable**: `chmod +x` - -❌ **Noisy output**: Clutters dmux logs -✅ **Silent operations**: `curl -s`, `> /dev/null 2>&1` - -❌ **Not testing**: Deploy and hope -✅ **Test manually**: Run with mock env vars first - -## Debugging - -If a hook isn't working: - -1. **Check if file exists**: `ls -la .dmux-hooks/` -2. **Check permissions**: Should show `x` in `rwxr-xr-x` -3. **Check syntax**: `bash -n .dmux-hooks/hook_name` -4. **Test manually**: Set env vars and run -5. **Check logs**: dmux logs to stderr with `[Hooks]` prefix -6. **Simplify**: Remove complex parts, test basic version -7. **Check tool availability**: `command -v required_tool` - -### Debug Mode -```bash -#!/bin/bash -# Add to top of hook for debugging -set -x # Print each command before executing -set -e # Exit on error - -# Your hook logic here -``` - -## Summary Checklist - -When creating a new hook: - -- [ ] Create file in `.dmux-hooks/` -- [ ] Add shebang: `#!/bin/bash` -- [ ] Make executable: `chmod +x` -- [ ] Add `set -e` for error handling -- [ ] Use environment variables (never hardcode paths) -- [ ] Keep blocking hooks chatty with status output -- [ ] Background long operations with `&` only when the hook does not gate the operation -- [ ] Check for required tools before using -- [ ] Test manually with mock env vars -- [ ] Add comments explaining what it does -- [ ] Commit to version control - -## Getting Help - -- **Full documentation**: See `HOOKS.md` in project root -- **Claude-specific tips**: See `CLAUDE.md` in `.dmux-hooks/` -- **Examples**: Check `.dmux-hooks/examples/` directory -- **dmux API**: See `API.md` for REST endpoints - ---- - -*This documentation was auto-generated from dmux source code.* -*Version: 2026-05-25* diff --git a/openflare-server/.dmux-hooks/README.md b/openflare-server/.dmux-hooks/README.md deleted file mode 100644 index 202222ee..00000000 --- a/openflare-server/.dmux-hooks/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# dmux Hooks - -This directory contains hooks that run automatically at key lifecycle events in dmux. - -## Quick Start - -1. **Read the documentation**: - - `AGENTS.md` - Complete reference (for any AI agent) - - `CLAUDE.md` - Same content (Claude Code looks for this filename) - -2. **Check examples**: - - `examples/` directory contains starter templates - -3. **Create a hook**: - ```bash - touch worktree_created - chmod +x worktree_created - nano worktree_created - ``` - -4. **Test it**: - ```bash - export DMUX_ROOT="$(pwd)" - export DMUX_WORKTREE_PATH="$(pwd)" - ./worktree_created - ``` - -## Available Hooks - -- `before_pane_create` - Before pane creation -- `pane_created` - After pane created -- `worktree_created` - After worktree setup -- `before_pane_close` - Before closing -- `pane_closed` - After closed -- `before_worktree_remove` - Before worktree removal -- `worktree_removed` - After worktree removed -- `pre_merge` - Before merge -- `post_merge` - After merge -- `run_test` - When running tests -- `run_dev` - When starting dev server - -## Documentation - -See `AGENTS.md` or `CLAUDE.md` for complete documentation including: -- Environment variables -- HTTP callback API -- Common patterns -- Best practices -- Testing strategies - -## Note - -This directory is **version controlled**. Hooks you create here will be shared with your team. diff --git a/openflare-server/.dmux-hooks/examples/post_merge.example b/openflare-server/.dmux-hooks/examples/post_merge.example deleted file mode 100755 index 9b5c58d1..00000000 --- a/openflare-server/.dmux-hooks/examples/post_merge.example +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# Example: post_merge hook -# -# This hook runs after a successful merge into the target branch. -# Use it to trigger deployments, close issues, notify teams, etc. - -set -e - -echo "[Hook] Post-merge processing for $DMUX_SLUG → $DMUX_TARGET_BRANCH" - -cd "$DMUX_ROOT" - -# Push to remote if merging to main/master -if [ "$DMUX_TARGET_BRANCH" = "main" ] || [ "$DMUX_TARGET_BRANCH" = "master" ]; then - echo "[Hook] Pushing to origin/$DMUX_TARGET_BRANCH" - git push origin "$DMUX_TARGET_BRANCH" - - # Optional: Trigger deployment - # if [ -n "$VERCEL_TOKEN" ]; then - # echo "[Hook] Triggering Vercel deployment..." - # curl -X POST "https://api.vercel.com/v1/deployments" \ - # -H "Authorization: Bearer $VERCEL_TOKEN" \ - # -H "Content-Type: application/json" \ - # -d '{ - # "name": "my-project", - # "gitSource": { - # "type": "github", - # "ref": "main" - # } - # }' - # fi -fi - -# Close related GitHub issue (if prompt contains #123 format) -ISSUE_NUM=$(echo "$DMUX_PROMPT" | grep -oP '#\K\d+' | head -1) -if [ -n "$ISSUE_NUM" ]; then - echo "[Hook] Closing GitHub issue #$ISSUE_NUM" - if command -v gh &> /dev/null; then - gh issue close "$ISSUE_NUM" \ - -c "Resolved in branch $DMUX_SLUG, merged to $DMUX_TARGET_BRANCH" \ - 2>/dev/null || echo "[Hook] Warning: Failed to close issue (maybe already closed?)" - else - echo "[Hook] GitHub CLI (gh) not found, skipping issue close" - fi -fi - -# Send notification to Slack -# if [ -n "$SLACK_WEBHOOK" ]; then -# echo "[Hook] Sending Slack notification" -# curl -s -X POST "$SLACK_WEBHOOK" \ -# -H "Content-Type: application/json" \ -# -d "{ -# \"text\": \"Merged: $DMUX_SLUG → $DMUX_TARGET_BRANCH\", -# \"blocks\": [ -# { -# \"type\": \"section\", -# \"text\": { -# \"type\": \"mrkdwn\", -# \"text\": \"*Branch Merged* :rocket:\n\n*From:* \`$DMUX_SLUG\`\n*To:* \`$DMUX_TARGET_BRANCH\`\n*Task:* $DMUX_PROMPT\" -# } -# } -# ] -# }" > /dev/null -# fi - -echo "[Hook] Post-merge processing complete" diff --git a/openflare-server/.dmux-hooks/examples/run_dev.example b/openflare-server/.dmux-hooks/examples/run_dev.example deleted file mode 100755 index c2005f43..00000000 --- a/openflare-server/.dmux-hooks/examples/run_dev.example +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# Example: run_dev hook -# -# This hook starts a dev server and optionally creates a tunnel for sharing. -# It reports the server URL back to dmux via the HTTP API. - -set -e - -echo "[Hook] Starting dev server for $DMUX_SLUG" - -cd "$DMUX_WORKTREE_PATH" -API_URL="http://localhost:$DMUX_SERVER_PORT/api/panes/$DMUX_PANE_ID/dev" - -# Update status: starting -curl -s -X PUT "$API_URL" \ - -H "Content-Type: application/json" \ - -d '{"status": "running"}' > /dev/null - -# Start dev server in background -# Adjust the command for your project (pnpm dev, npm run dev, vite, etc.) -LOG_FILE="/tmp/dmux-dev-$DMUX_PANE_ID.log" -pnpm dev > "$LOG_FILE" 2>&1 & -DEV_PID=$! - -# Wait for server to be ready -echo "[Hook] Waiting for dev server to start..." -sleep 5 - -# Detect port from log output -# Adjust the grep pattern for your dev server's output format -PORT=$(grep -oP '(?<=localhost:)\d+' "$LOG_FILE" | head -1) - -if [ -z "$PORT" ]; then - echo "[Hook] Warning: Could not detect port from logs, using default 3000" - PORT=3000 -fi - -LOCAL_URL="http://localhost:$PORT" -echo "[Hook] Dev server running at $LOCAL_URL" - -# Optional: Create a public tunnel (uncomment to enable) -# Requires ngrok, cloudflared, or another tunneling tool - -# Example with cloudflared: -# TUNNEL_URL=$(cloudflared tunnel --url "$LOCAL_URL" 2>&1 | \ -# grep -oP 'https://[a-z0-9-]+\.trycloudflare\.com' | head -1) - -# Example with ngrok: -# TUNNEL_URL=$(ngrok http $PORT --log=stdout 2>&1 | \ -# grep -oP 'url=https://[^"]+' | head -1 | cut -d= -f2) - -# For now, just use local URL (uncomment tunnel code above to enable) -FINAL_URL="$LOCAL_URL" - -# Report status back to dmux -curl -s -X PUT "$API_URL" \ - -H "Content-Type: application/json" \ - -d "{\"status\": \"running\", \"url\": \"$FINAL_URL\"}" > /dev/null - -echo "[Hook] Dev server ready at: $FINAL_URL" -echo "[Hook] Dev server PID: $DEV_PID" -echo "[Hook] Log file: $LOG_FILE" diff --git a/openflare-server/.dmux-hooks/examples/run_test.example b/openflare-server/.dmux-hooks/examples/run_test.example deleted file mode 100755 index 6b286a1c..00000000 --- a/openflare-server/.dmux-hooks/examples/run_test.example +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# Example: run_test hook -# -# This hook runs tests and reports the status back to dmux via the HTTP API. -# Status updates appear in real-time in the dmux UI. - -set -e - -echo "[Hook] Running tests for $DMUX_SLUG" - -cd "$DMUX_WORKTREE_PATH" -API_URL="http://localhost:$DMUX_SERVER_PORT/api/panes/$DMUX_PANE_ID/test" - -# Update status: running -curl -s -X PUT "$API_URL" \ - -H "Content-Type: application/json" \ - -d '{"status": "running"}' > /dev/null - -echo "[Hook] Running test suite..." - -# Capture test output -OUTPUT_FILE="/tmp/dmux-test-$DMUX_PANE_ID.txt" - -# Run tests (adjust command for your project) -# Examples: -# - pnpm test -# - npm test -# - vitest run -# - jest -# - pytest -# - cargo test -if pnpm test > "$OUTPUT_FILE" 2>&1; then - STATUS="passed" - echo "[Hook] Tests passed ✓" -else - STATUS="failed" - echo "[Hook] Tests failed ✗" -fi - -# Get output (truncate if too long) -OUTPUT=$(head -c 5000 "$OUTPUT_FILE") - -# Report results back to dmux -curl -s -X PUT "$API_URL" \ - -H "Content-Type: application/json" \ - -d "$(jq -n \ - --arg status "$STATUS" \ - --arg output "$OUTPUT" \ - '{status: $status, output: $output}')" > /dev/null - -# Cleanup -rm -f "$OUTPUT_FILE" - -echo "[Hook] Test results reported to dmux" - -# Exit with test status -if [ "$STATUS" = "passed" ]; then - exit 0 -else - exit 1 -fi diff --git a/openflare-server/.dmux-hooks/examples/worktree_created.example b/openflare-server/.dmux-hooks/examples/worktree_created.example deleted file mode 100755 index 61c2979b..00000000 --- a/openflare-server/.dmux-hooks/examples/worktree_created.example +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# Example: worktree_created hook -# -# This hook runs after a new worktree is created and before the agent launches. -# Use it to set up the worktree environment (install deps, copy configs, etc.) -# Stdout/stderr is streamed into the new pane's setup UI while this hook runs. -# dmux waits for this hook without a fixed timeout. - -set -e # Exit on error - -status() { - if [ "${DMUX_PROGRESS:-0}" = "1" ]; then - echo "${DMUX_STATUS_PREFIX:-DMUX_STATUS:} $*" - else - echo "[Hook] $*" - fi -} - -status "Setting up worktree: $DMUX_SLUG" - -cd "$DMUX_WORKTREE_PATH" - -# Install dependencies before the agent launches. -if [ -f "pnpm-lock.yaml" ]; then - status "Installing dependencies with pnpm" - pnpm install --prefer-offline -elif [ -f "package-lock.json" ]; then - status "Installing dependencies with npm" - npm install -elif [ -f "yarn.lock" ]; then - status "Installing dependencies with yarn" - yarn install -fi - -# Copy environment file if it exists -if [ -f "$DMUX_ROOT/.env.local" ]; then - status "Copying .env.local" - cp "$DMUX_ROOT/.env.local" "$DMUX_WORKTREE_PATH/.env.local" -fi - -# Keep existing git author identity. -# Do not set git user.name/user.email in this hook. - -# Create a log entry -echo "[$(date)] Created worktree: $DMUX_SLUG | Agent: $DMUX_AGENT | Prompt: $DMUX_PROMPT" \ - >> "$DMUX_ROOT/.dmux/worktree_history.log" - -status "Worktree setup complete" diff --git a/openflare-agent/cmd/agent/main.go b/openflare-server/cmd/agent/main.go similarity index 83% rename from openflare-agent/cmd/agent/main.go rename to openflare-server/cmd/agent/main.go index cb3f62a7..e27120be 100644 --- a/openflare-agent/cmd/agent/main.go +++ b/openflare-server/cmd/agent/main.go @@ -8,17 +8,17 @@ import ( "os/signal" "syscall" - "github.com/rain-kl/openflare/openflare-agent/internal/agent" - "github.com/rain-kl/openflare/openflare-agent/internal/config" - "github.com/rain-kl/openflare/openflare-agent/internal/geoipupdate" - "github.com/rain-kl/openflare/openflare-agent/internal/heartbeat" - "github.com/rain-kl/openflare/openflare-agent/internal/httpclient" - "github.com/rain-kl/openflare/openflare-agent/internal/logging" - "github.com/rain-kl/openflare/openflare-agent/internal/nginx" - "github.com/rain-kl/openflare/openflare-agent/internal/state" - syncservice "github.com/rain-kl/openflare/openflare-agent/internal/sync" - "github.com/rain-kl/openflare/openflare-agent/internal/updater" - "github.com/rain-kl/openflare/openflare-agent/internal/wsclient" + "github.com/Rain-kl/Wavelet/internal/agent/agent" + "github.com/Rain-kl/Wavelet/internal/agent/config" + "github.com/Rain-kl/Wavelet/internal/agent/geoipupdate" + "github.com/Rain-kl/Wavelet/internal/agent/heartbeat" + "github.com/Rain-kl/Wavelet/internal/agent/httpclient" + "github.com/Rain-kl/Wavelet/internal/agent/logging" + "github.com/Rain-kl/Wavelet/internal/agent/nginx" + "github.com/Rain-kl/Wavelet/internal/agent/state" + syncservice "github.com/Rain-kl/Wavelet/internal/agent/sync" + "github.com/Rain-kl/Wavelet/internal/agent/updater" + "github.com/Rain-kl/Wavelet/internal/agent/wsclient" ) func main() { diff --git a/openflared/cmd/flared/main.go b/openflare-server/cmd/flared/main.go similarity index 82% rename from openflared/cmd/flared/main.go rename to openflare-server/cmd/flared/main.go index 4bca026f..a0e30401 100644 --- a/openflared/cmd/flared/main.go +++ b/openflare-server/cmd/flared/main.go @@ -9,13 +9,13 @@ import ( "strings" "syscall" - "github.com/rain-kl/openflare/openflared/internal/config" - "github.com/rain-kl/openflare/openflared/internal/flared" - "github.com/rain-kl/openflare/openflared/internal/frpc" - "github.com/rain-kl/openflare/openflared/internal/heartbeat" - "github.com/rain-kl/openflare/openflared/internal/httpclient" - "github.com/rain-kl/openflare/openflared/internal/sync" - "github.com/rain-kl/openflare/openflared/internal/wsclient" + "github.com/Rain-kl/Wavelet/internal/flared/config" + "github.com/Rain-kl/Wavelet/internal/flared/flared" + "github.com/Rain-kl/Wavelet/internal/flared/frpc" + "github.com/Rain-kl/Wavelet/internal/flared/heartbeat" + "github.com/Rain-kl/Wavelet/internal/flared/httpclient" + "github.com/Rain-kl/Wavelet/internal/flared/sync" + "github.com/Rain-kl/Wavelet/internal/flared/wsclient" ) func main() { diff --git a/openflare-relay/cmd/relay/main.go b/openflare-server/cmd/relay/main.go similarity index 81% rename from openflare-relay/cmd/relay/main.go rename to openflare-server/cmd/relay/main.go index 06137f45..9cd59290 100644 --- a/openflare-relay/cmd/relay/main.go +++ b/openflare-server/cmd/relay/main.go @@ -9,13 +9,13 @@ import ( "strings" "syscall" - "github.com/rain-kl/openflare/openflare-relay/internal/config" - "github.com/rain-kl/openflare/openflare-relay/internal/frps" - "github.com/rain-kl/openflare/openflare-relay/internal/heartbeat" - "github.com/rain-kl/openflare/openflare-relay/internal/httpclient" - "github.com/rain-kl/openflare/openflare-relay/internal/relay" - "github.com/rain-kl/openflare/openflare-relay/internal/state" - "github.com/rain-kl/openflare/openflare-relay/internal/wsclient" + "github.com/Rain-kl/Wavelet/internal/relay/config" + "github.com/Rain-kl/Wavelet/internal/relay/frps" + "github.com/Rain-kl/Wavelet/internal/relay/heartbeat" + "github.com/Rain-kl/Wavelet/internal/relay/httpclient" + "github.com/Rain-kl/Wavelet/internal/relay/relay" + "github.com/Rain-kl/Wavelet/internal/relay/state" + "github.com/Rain-kl/Wavelet/internal/relay/wsclient" ) func main() { diff --git a/openflare-agent/Dockerfile b/openflare-server/docker/Dockerfile.agent similarity index 79% rename from openflare-agent/Dockerfile rename to openflare-server/docker/Dockerfile.agent index b4f68fa8..514f33e5 100644 --- a/openflare-agent/Dockerfile +++ b/openflare-server/docker/Dockerfile.agent @@ -16,11 +16,10 @@ COPY go.mod go.sum ./ RUN --mount=type=cache,target=/go/pkg/mod \ go mod download -COPY openflare-agent ./openflare-agent -COPY pkg ./pkg +COPY . . RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ - go build -trimpath -ldflags "-s -w -X 'github.com/rain-kl/openflare/openflare-agent/internal/config.Version=$VERSION'" -o /build/bin/openflare-agent ./openflare-agent/cmd/agent + go build -trimpath -ldflags "-s -w -X 'github.com/Rain-kl/Wavelet/internal/agent/config.Version=$VERSION'" -o /build/bin/openflare-agent ./cmd/agent/main.go FROM openresty/openresty:alpine diff --git a/openflared/Dockerfile b/openflare-server/docker/Dockerfile.flared similarity index 78% rename from openflared/Dockerfile rename to openflare-server/docker/Dockerfile.flared index 94b3df3b..fcf45810 100644 --- a/openflared/Dockerfile +++ b/openflare-server/docker/Dockerfile.flared @@ -6,16 +6,14 @@ FROM golang:1.25-alpine AS builder ARG VERSION WORKDIR /build - COPY go.mod go.sum ./ RUN --mount=type=cache,target=/go/pkg/mod \ go mod download -COPY openflared/ ./openflared/ -COPY pkg/ ./pkg/ +COPY . . RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ - CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags "-s -w -X 'github.com/rain-kl/openflare/openflared/internal/config.Version=$VERSION'" -o flared ./openflared/cmd/flared + CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags "-s -w -X 'github.com/Rain-kl/Wavelet/internal/flared/config.Version=$VERSION'" -o flared ./cmd/flared/main.go # Final runtime image FROM fatedier/frpc:v0.69.0 diff --git a/openflare-relay/Dockerfile b/openflare-server/docker/Dockerfile.relay similarity index 76% rename from openflare-relay/Dockerfile rename to openflare-server/docker/Dockerfile.relay index 1903e313..d60654f7 100644 --- a/openflare-relay/Dockerfile +++ b/openflare-server/docker/Dockerfile.relay @@ -10,11 +10,10 @@ COPY go.mod go.sum ./ RUN --mount=type=cache,target=/go/pkg/mod \ go mod download -COPY openflare-relay ./openflare-relay -COPY pkg ./pkg +COPY . . RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ - CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags "-s -w -X 'github.com/rain-kl/openflare/openflare-relay/internal/config.Version=$VERSION'" -o /build/bin/openflare-relay ./openflare-relay/cmd/relay + CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags "-s -w -X 'github.com/Rain-kl/Wavelet/internal/relay/config.Version=$VERSION'" -o /build/bin/openflare-relay ./cmd/relay/main.go # Final runtime image FROM fatedier/frps:v0.69.0 diff --git a/openflare-server/go.mod b/openflare-server/go.mod index 0b00b53c..14bccfad 100644 --- a/openflare-server/go.mod +++ b/openflare-server/go.mod @@ -13,6 +13,7 @@ require ( github.com/bwmarrin/snowflake v0.3.0 github.com/coreos/go-oidc/v3 v3.17.0 github.com/deepteams/webp v1.2.3 + github.com/dgraph-io/ristretto/v2 v2.2.0 github.com/expr-lang/expr v1.17.8 github.com/gin-contrib/sessions v1.0.4 github.com/gin-gonic/gin v1.11.0 @@ -23,9 +24,9 @@ require ( github.com/gorilla/websocket v1.5.3 github.com/hibiken/asynq v0.25.1 github.com/maypok86/otter/v2 v2.3.0 + github.com/oschwald/maxminddb-golang v1.13.1 github.com/peterbourgon/diskv/v3 v3.0.1 github.com/pressly/goose/v3 v3.27.1 - github.com/rain-kl/openflare v0.0.0 github.com/redis/go-redis/extra/redisotel/v9 v9.16.0 github.com/redis/go-redis/v9 v9.16.0 github.com/robfig/cron/v3 v3.0.1 @@ -48,6 +49,7 @@ require ( golang.org/x/crypto v0.51.0 golang.org/x/image v0.42.0 golang.org/x/mod v0.36.0 + golang.org/x/net v0.54.0 golang.org/x/oauth2 v0.36.0 golang.org/x/sync v0.21.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 @@ -59,8 +61,6 @@ require ( gorm.io/plugin/opentelemetry v0.1.14 ) -replace github.com/rain-kl/openflare => ../ - require ( filippo.io/edwards25519 v1.2.0 // indirect github.com/ClickHouse/ch-go v0.71.0 // indirect @@ -88,7 +88,6 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudwego/base64x v0.1.6 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -142,7 +141,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/ncruces/go-strftime v1.0.0 // indirect - github.com/oschwald/maxminddb-golang v1.13.1 // indirect github.com/paulmach/orb v0.13.0 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pierrec/lz4/v4 v4.1.26 // indirect @@ -171,7 +169,6 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/arch v0.22.0 // indirect - golang.org/x/net v0.54.0 // indirect golang.org/x/sys v0.44.0 // indirect golang.org/x/text v0.38.0 // indirect golang.org/x/time v0.15.0 // indirect diff --git a/openflare-agent/internal/agent/runner.go b/openflare-server/internal/agent/agent/runner.go similarity index 98% rename from openflare-agent/internal/agent/runner.go rename to openflare-server/internal/agent/agent/runner.go index de6ac82d..1bb8f620 100644 --- a/openflare-agent/internal/agent/runner.go +++ b/openflare-server/internal/agent/agent/runner.go @@ -8,11 +8,11 @@ import ( "strings" "time" - "github.com/rain-kl/openflare/openflare-agent/internal/config" - "github.com/rain-kl/openflare/openflare-agent/internal/observability" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" - "github.com/rain-kl/openflare/openflare-agent/internal/state" - "github.com/rain-kl/openflare/openflare-agent/internal/wsclient" + "github.com/Rain-kl/Wavelet/internal/agent/config" + "github.com/Rain-kl/Wavelet/internal/agent/observability" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/state" + "github.com/Rain-kl/Wavelet/internal/agent/wsclient" ) type HeartbeatService interface { diff --git a/openflare-agent/internal/agent/runner_test.go b/openflare-server/internal/agent/agent/runner_test.go similarity index 99% rename from openflare-agent/internal/agent/runner_test.go rename to openflare-server/internal/agent/agent/runner_test.go index 09d18430..0866f443 100644 --- a/openflare-agent/internal/agent/runner_test.go +++ b/openflare-server/internal/agent/agent/runner_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - "github.com/rain-kl/openflare/openflare-agent/internal/config" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" - "github.com/rain-kl/openflare/openflare-agent/internal/state" + "github.com/Rain-kl/Wavelet/internal/agent/config" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/state" ) type fakeHeartbeatService struct { diff --git a/openflare-agent/internal/config/config.go b/openflare-server/internal/agent/config/config.go similarity index 99% rename from openflare-agent/internal/config/config.go rename to openflare-server/internal/agent/config/config.go index 100a0016..ec093c39 100644 --- a/openflare-agent/internal/config/config.go +++ b/openflare-server/internal/agent/config/config.go @@ -13,9 +13,9 @@ import ( "strings" "time" - "github.com/rain-kl/openflare/pkg/geoip" - "github.com/rain-kl/openflare/pkg/geoip/iputil" - "github.com/rain-kl/openflare/pkg/utils" + "github.com/Rain-kl/Wavelet/pkg/geoip" + "github.com/Rain-kl/Wavelet/pkg/geoip/iputil" + "github.com/Rain-kl/Wavelet/pkg/utils" ) const ( diff --git a/openflare-agent/internal/config/config_test.go b/openflare-server/internal/agent/config/config_test.go similarity index 99% rename from openflare-agent/internal/config/config_test.go rename to openflare-server/internal/agent/config/config_test.go index bdf67ff1..3979c9e4 100644 --- a/openflare-agent/internal/config/config_test.go +++ b/openflare-server/internal/agent/config/config_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/rain-kl/openflare/pkg/geoip" + "github.com/Rain-kl/Wavelet/pkg/geoip" ) func TestLoadDefaultsToManagedBinaryPaths(t *testing.T) { diff --git a/openflare-agent/internal/config/duration.go b/openflare-server/internal/agent/config/duration.go similarity index 100% rename from openflare-agent/internal/config/duration.go rename to openflare-server/internal/agent/config/duration.go diff --git a/openflare-agent/internal/config/version.go b/openflare-server/internal/agent/config/version.go similarity index 100% rename from openflare-agent/internal/config/version.go rename to openflare-server/internal/agent/config/version.go diff --git a/openflare-agent/internal/geoipdata/GeoLite2-Country.mmdb b/openflare-server/internal/agent/geoipdata/GeoLite2-Country.mmdb similarity index 100% rename from openflare-agent/internal/geoipdata/GeoLite2-Country.mmdb rename to openflare-server/internal/agent/geoipdata/GeoLite2-Country.mmdb diff --git a/openflare-agent/internal/geoipdata/data.go b/openflare-server/internal/agent/geoipdata/data.go similarity index 100% rename from openflare-agent/internal/geoipdata/data.go rename to openflare-server/internal/agent/geoipdata/data.go diff --git a/openflare-agent/internal/geoipupdate/updater.go b/openflare-server/internal/agent/geoipupdate/updater.go similarity index 93% rename from openflare-agent/internal/geoipupdate/updater.go rename to openflare-server/internal/agent/geoipupdate/updater.go index 1beb4998..29a0ab17 100644 --- a/openflare-agent/internal/geoipupdate/updater.go +++ b/openflare-server/internal/agent/geoipupdate/updater.go @@ -9,8 +9,8 @@ import ( "path/filepath" "time" - "github.com/rain-kl/openflare/openflare-agent/internal/geoipdata" - "github.com/rain-kl/openflare/pkg/geoip" + "github.com/Rain-kl/Wavelet/internal/agent/geoipdata" + "github.com/Rain-kl/Wavelet/pkg/geoip" ) type Updater struct { diff --git a/openflare-agent/internal/geoipupdate/updater_test.go b/openflare-server/internal/agent/geoipupdate/updater_test.go similarity index 100% rename from openflare-agent/internal/geoipupdate/updater_test.go rename to openflare-server/internal/agent/geoipupdate/updater_test.go diff --git a/openflare-agent/internal/heartbeat/service.go b/openflare-server/internal/agent/heartbeat/service.go similarity index 92% rename from openflare-agent/internal/heartbeat/service.go rename to openflare-server/internal/agent/heartbeat/service.go index 8defec2c..e481620f 100644 --- a/openflare-agent/internal/heartbeat/service.go +++ b/openflare-server/internal/agent/heartbeat/service.go @@ -3,7 +3,7 @@ package heartbeat import ( "context" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" ) type Client interface { diff --git a/openflare-agent/internal/httpclient/client.go b/openflare-server/internal/agent/httpclient/client.go similarity index 98% rename from openflare-agent/internal/httpclient/client.go rename to openflare-server/internal/agent/httpclient/client.go index 2a68b4e6..6ba38cb7 100644 --- a/openflare-agent/internal/httpclient/client.go +++ b/openflare-server/internal/agent/httpclient/client.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" ) type Client struct { @@ -191,4 +191,4 @@ func readBodyError(body []byte, fallback string) error { return errors.New(errBody.ErrorMsg) } return errors.New(fallback) -} \ No newline at end of file +} diff --git a/openflare-agent/internal/logging/logger.go b/openflare-server/internal/agent/logging/logger.go similarity index 100% rename from openflare-agent/internal/logging/logger.go rename to openflare-server/internal/agent/logging/logger.go diff --git a/openflare-agent/internal/nginx/manager.go b/openflare-server/internal/agent/nginx/manager.go similarity index 99% rename from openflare-agent/internal/nginx/manager.go rename to openflare-server/internal/agent/nginx/manager.go index e69ae750..822d2e15 100644 --- a/openflare-agent/internal/nginx/manager.go +++ b/openflare-server/internal/agent/nginx/manager.go @@ -20,10 +20,10 @@ import ( "strings" "time" - openrestyrender "github.com/rain-kl/openflare/pkg/render/openresty" - "github.com/rain-kl/openflare/pkg/utils" + openrestyrender "github.com/Rain-kl/Wavelet/pkg/render/openresty" + "github.com/Rain-kl/Wavelet/pkg/utils" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" ) const RuntimeConfigDirPlaceholder = "__OPENFLARE_RUNTIME_CONFIG_DIR__" diff --git a/openflare-agent/internal/nginx/manager_test.go b/openflare-server/internal/agent/nginx/manager_test.go similarity index 99% rename from openflare-agent/internal/nginx/manager_test.go rename to openflare-server/internal/agent/nginx/manager_test.go index 17e65825..4b54db6b 100644 --- a/openflare-agent/internal/nginx/manager_test.go +++ b/openflare-server/internal/agent/nginx/manager_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" ) type runCall struct { diff --git a/openflare-agent/internal/nginx/mimetypes.go b/openflare-server/internal/agent/nginx/mimetypes.go similarity index 100% rename from openflare-agent/internal/nginx/mimetypes.go rename to openflare-server/internal/agent/nginx/mimetypes.go diff --git a/openflare-agent/internal/nginx/observability_assets.go b/openflare-server/internal/agent/nginx/observability_assets.go similarity index 98% rename from openflare-agent/internal/nginx/observability_assets.go rename to openflare-server/internal/agent/nginx/observability_assets.go index 4d08aebd..3953d48e 100644 --- a/openflare-agent/internal/nginx/observability_assets.go +++ b/openflare-server/internal/agent/nginx/observability_assets.go @@ -1,6 +1,6 @@ package nginx -import "github.com/rain-kl/openflare/openflare-agent/internal/protocol" +import "github.com/Rain-kl/Wavelet/internal/agent/protocol" const ( openRestyObservabilityWindowTTL = "7200" diff --git a/openflare-agent/internal/nginx/pow_assets.go b/openflare-server/internal/agent/nginx/pow_assets.go similarity index 99% rename from openflare-agent/internal/nginx/pow_assets.go rename to openflare-server/internal/agent/nginx/pow_assets.go index 747145a1..ef48a7a7 100644 --- a/openflare-agent/internal/nginx/pow_assets.go +++ b/openflare-server/internal/agent/nginx/pow_assets.go @@ -5,7 +5,7 @@ import ( "path/filepath" "strings" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" ) //go:embed pow_static diff --git a/openflare-server/internal/agent/nginx/pow_static/css/static/geist.woff2 b/openflare-server/internal/agent/nginx/pow_static/css/static/geist.woff2 new file mode 100644 index 00000000..6fd61c44 Binary files /dev/null and b/openflare-server/internal/agent/nginx/pow_static/css/static/geist.woff2 differ diff --git a/openflare-server/internal/agent/nginx/pow_static/css/static/iosevka-curly.woff2 b/openflare-server/internal/agent/nginx/pow_static/css/static/iosevka-curly.woff2 new file mode 100644 index 00000000..df9df40c Binary files /dev/null and b/openflare-server/internal/agent/nginx/pow_static/css/static/iosevka-curly.woff2 differ diff --git a/openflare-server/internal/agent/nginx/pow_static/css/static/podkova.css b/openflare-server/internal/agent/nginx/pow_static/css/static/podkova.css new file mode 100644 index 00000000..efa1fd7a --- /dev/null +++ b/openflare-server/internal/agent/nginx/pow_static/css/static/podkova.css @@ -0,0 +1,7 @@ +@font-face { + font-family: "Podkova"; + font-style: normal; + font-weight: 400 800; + font-display: swap; + src: url("podkova.woff2") format("woff2"); +} diff --git a/openflare-server/internal/agent/nginx/pow_static/css/static/podkova.woff2 b/openflare-server/internal/agent/nginx/pow_static/css/static/podkova.woff2 new file mode 100644 index 00000000..508f97d3 Binary files /dev/null and b/openflare-server/internal/agent/nginx/pow_static/css/static/podkova.woff2 differ diff --git a/openflare-server/internal/agent/nginx/pow_static/css/xess.css b/openflare-server/internal/agent/nginx/pow_static/css/xess.css new file mode 100644 index 00000000..67a0c4ba --- /dev/null +++ b/openflare-server/internal/agent/nginx/pow_static/css/xess.css @@ -0,0 +1,149 @@ +: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/openflare-server/internal/agent/nginx/pow_static/img/happy.webp b/openflare-server/internal/agent/nginx/pow_static/img/happy.webp new file mode 100644 index 00000000..40b979da Binary files /dev/null and b/openflare-server/internal/agent/nginx/pow_static/img/happy.webp differ diff --git a/openflare-server/internal/agent/nginx/pow_static/img/pensive.webp b/openflare-server/internal/agent/nginx/pow_static/img/pensive.webp new file mode 100644 index 00000000..e26faefe Binary files /dev/null and b/openflare-server/internal/agent/nginx/pow_static/img/pensive.webp differ diff --git a/openflare-server/internal/agent/nginx/pow_static/img/reject.webp b/openflare-server/internal/agent/nginx/pow_static/img/reject.webp new file mode 100644 index 00000000..17bc9398 Binary files /dev/null and b/openflare-server/internal/agent/nginx/pow_static/img/reject.webp differ diff --git a/openflare-server/internal/agent/nginx/pow_static/js/algorithms/index.mjs b/openflare-server/internal/agent/nginx/pow_static/js/algorithms/index.mjs new file mode 100644 index 00000000..24a47324 --- /dev/null +++ b/openflare-server/internal/agent/nginx/pow_static/js/algorithms/index.mjs @@ -0,0 +1,32 @@ +/* +@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/openflare-server/internal/agent/nginx/pow_static/js/main.mjs b/openflare-server/internal/agent/nginx/pow_static/js/main.mjs new file mode 100644 index 00000000..7f496602 --- /dev/null +++ b/openflare-server/internal/agent/nginx/pow_static/js/main.mjs @@ -0,0 +1,32 @@ +/* +@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/openflare-server/internal/agent/nginx/pow_static/js/worker/sha256-purejs.mjs b/openflare-server/internal/agent/nginx/pow_static/js/worker/sha256-purejs.mjs new file mode 100644 index 00000000..e2c2d196 --- /dev/null +++ b/openflare-server/internal/agent/nginx/pow_static/js/worker/sha256-purejs.mjs @@ -0,0 +1,32 @@ +/* +@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/openflare-server/internal/agent/nginx/pow_static/js/worker/sha256-webcrypto.mjs b/openflare-server/internal/agent/nginx/pow_static/js/worker/sha256-webcrypto.mjs new file mode 100644 index 00000000..7d32193b --- /dev/null +++ b/openflare-server/internal/agent/nginx/pow_static/js/worker/sha256-webcrypto.mjs @@ -0,0 +1,32 @@ +/* +@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/openflare-server/internal/agent/nginx/pow_static/locales/en.json b/openflare-server/internal/agent/nginx/pow_static/locales/en.json new file mode 100644 index 00000000..4dffb969 --- /dev/null +++ b/openflare-server/internal/agent/nginx/pow_static/locales/en.json @@ -0,0 +1,66 @@ +{ + "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/openflare-server/internal/agent/nginx/pow_static/locales/zh-CN.json b/openflare-server/internal/agent/nginx/pow_static/locales/zh-CN.json new file mode 100644 index 00000000..19529607 --- /dev/null +++ b/openflare-server/internal/agent/nginx/pow_static/locales/zh-CN.json @@ -0,0 +1,66 @@ +{ + "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/openflare-agent/internal/nginx/waf_assets.go b/openflare-server/internal/agent/nginx/waf_assets.go similarity index 99% rename from openflare-agent/internal/nginx/waf_assets.go rename to openflare-server/internal/agent/nginx/waf_assets.go index 18ddfc39..3edd8953 100644 --- a/openflare-agent/internal/nginx/waf_assets.go +++ b/openflare-server/internal/agent/nginx/waf_assets.go @@ -1,6 +1,6 @@ package nginx -import "github.com/rain-kl/openflare/openflare-agent/internal/protocol" +import "github.com/Rain-kl/Wavelet/internal/agent/protocol" const openRestyWAFRuntimeLua = `local _M = {} diff --git a/openflare-agent/internal/observability/collector.go b/openflare-server/internal/agent/observability/collector.go similarity index 97% rename from openflare-agent/internal/observability/collector.go rename to openflare-server/internal/agent/observability/collector.go index a9b13a61..1ced9b97 100644 --- a/openflare-agent/internal/observability/collector.go +++ b/openflare-server/internal/agent/observability/collector.go @@ -13,9 +13,9 @@ import ( "syscall" "time" - "github.com/rain-kl/openflare/openflare-agent/internal/config" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" - "github.com/rain-kl/openflare/openflare-agent/internal/state" + "github.com/Rain-kl/Wavelet/internal/agent/config" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/state" ) func BuildProfile(cfg *config.Config, stateStore *state.Store) *protocol.NodeSystemProfile { diff --git a/openflare-agent/internal/observability/openresty_local.go b/openflare-server/internal/agent/observability/openresty_local.go similarity index 96% rename from openflare-agent/internal/observability/openresty_local.go rename to openflare-server/internal/agent/observability/openresty_local.go index c2357ddc..65702eea 100644 --- a/openflare-agent/internal/observability/openresty_local.go +++ b/openflare-server/internal/agent/observability/openresty_local.go @@ -10,8 +10,8 @@ import ( "strings" "time" - "github.com/rain-kl/openflare/openflare-agent/internal/config" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/config" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" ) const openRestyObservabilityPath = "/openflare/observability" diff --git a/openflare-agent/internal/observability/openresty_local_test.go b/openflare-server/internal/agent/observability/openresty_local_test.go similarity index 97% rename from openflare-agent/internal/observability/openresty_local_test.go rename to openflare-server/internal/agent/observability/openresty_local_test.go index 81e213e4..dcfe7d35 100644 --- a/openflare-agent/internal/observability/openresty_local_test.go +++ b/openflare-server/internal/agent/observability/openresty_local_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/rain-kl/openflare/openflare-agent/internal/config" + "github.com/Rain-kl/Wavelet/internal/agent/config" ) func TestCollectManagedOpenRestyMetrics(t *testing.T) { diff --git a/openflare-agent/internal/observability/traffic.go b/openflare-server/internal/agent/observability/traffic.go similarity index 98% rename from openflare-agent/internal/observability/traffic.go rename to openflare-server/internal/agent/observability/traffic.go index 7ceed5d4..a1b425c5 100644 --- a/openflare-agent/internal/observability/traffic.go +++ b/openflare-server/internal/agent/observability/traffic.go @@ -13,9 +13,9 @@ import ( "strings" "time" - "github.com/rain-kl/openflare/openflare-agent/internal/config" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" - "github.com/rain-kl/openflare/openflare-agent/internal/state" + "github.com/Rain-kl/Wavelet/internal/agent/config" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/state" ) type accessLogRecord struct { diff --git a/openflare-agent/internal/observability/traffic_test.go b/openflare-server/internal/agent/observability/traffic_test.go similarity index 97% rename from openflare-agent/internal/observability/traffic_test.go rename to openflare-server/internal/agent/observability/traffic_test.go index 700d5135..86892dfe 100644 --- a/openflare-agent/internal/observability/traffic_test.go +++ b/openflare-server/internal/agent/observability/traffic_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - "github.com/rain-kl/openflare/openflare-agent/internal/config" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" - "github.com/rain-kl/openflare/openflare-agent/internal/state" + "github.com/Rain-kl/Wavelet/internal/agent/config" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/state" ) func TestBuildTrafficReportAggregatesManagedAccessLog(t *testing.T) { diff --git a/openflare-agent/internal/protocol/agent_api.go b/openflare-server/internal/agent/protocol/agent_api.go similarity index 99% rename from openflare-agent/internal/protocol/agent_api.go rename to openflare-server/internal/agent/protocol/agent_api.go index dafc1939..66c8ef3c 100644 --- a/openflare-agent/internal/protocol/agent_api.go +++ b/openflare-server/internal/agent/protocol/agent_api.go @@ -204,4 +204,4 @@ type WAFIPGroupSyncResponse struct { type SupportFile struct { Path string `json:"path"` Content string `json:"content"` -} \ No newline at end of file +} diff --git a/openflare-agent/internal/state/observability_buffer.go b/openflare-server/internal/agent/state/observability_buffer.go similarity index 99% rename from openflare-agent/internal/state/observability_buffer.go rename to openflare-server/internal/agent/state/observability_buffer.go index 21a1436c..9748be23 100644 --- a/openflare-agent/internal/state/observability_buffer.go +++ b/openflare-server/internal/agent/state/observability_buffer.go @@ -8,7 +8,7 @@ import ( "strconv" "sync" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" ) const observabilityBufferWindowSeconds = 60 diff --git a/openflare-agent/internal/state/observability_buffer_test.go b/openflare-server/internal/agent/state/observability_buffer_test.go similarity index 98% rename from openflare-agent/internal/state/observability_buffer_test.go rename to openflare-server/internal/agent/state/observability_buffer_test.go index 5764f8cb..f2c2ccc1 100644 --- a/openflare-agent/internal/state/observability_buffer_test.go +++ b/openflare-server/internal/agent/state/observability_buffer_test.go @@ -4,7 +4,7 @@ import ( "path/filepath" "testing" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" ) func TestObservabilityBufferStoreUpsertReplayAndAck(t *testing.T) { diff --git a/openflare-agent/internal/state/state.go b/openflare-server/internal/agent/state/state.go similarity index 100% rename from openflare-agent/internal/state/state.go rename to openflare-server/internal/agent/state/state.go diff --git a/openflare-agent/internal/state/state_test.go b/openflare-server/internal/agent/state/state_test.go similarity index 100% rename from openflare-agent/internal/state/state_test.go rename to openflare-server/internal/agent/state/state_test.go diff --git a/openflare-agent/internal/sync/pages.go b/openflare-server/internal/agent/sync/pages.go similarity index 99% rename from openflare-agent/internal/sync/pages.go rename to openflare-server/internal/agent/sync/pages.go index 3faa89ac..22dd5c4b 100644 --- a/openflare-agent/internal/sync/pages.go +++ b/openflare-server/internal/agent/sync/pages.go @@ -15,7 +15,7 @@ import ( "path/filepath" "strings" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" ) type pagesSourceDocument struct { diff --git a/openflare-agent/internal/sync/service.go b/openflare-server/internal/agent/sync/service.go similarity index 98% rename from openflare-agent/internal/sync/service.go rename to openflare-server/internal/agent/sync/service.go index d7d24351..de12c879 100644 --- a/openflare-agent/internal/sync/service.go +++ b/openflare-server/internal/agent/sync/service.go @@ -11,11 +11,11 @@ import ( "sort" "strings" - openrestyrender "github.com/rain-kl/openflare/pkg/render/openresty" + openrestyrender "github.com/Rain-kl/Wavelet/pkg/render/openresty" - "github.com/rain-kl/openflare/openflare-agent/internal/nginx" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" - "github.com/rain-kl/openflare/openflare-agent/internal/state" + "github.com/Rain-kl/Wavelet/internal/agent/nginx" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/state" ) const ( diff --git a/openflare-agent/internal/sync/service_test.go b/openflare-server/internal/agent/sync/service_test.go similarity index 99% rename from openflare-agent/internal/sync/service_test.go rename to openflare-server/internal/agent/sync/service_test.go index 033bc623..8aed0c7b 100644 --- a/openflare-agent/internal/sync/service_test.go +++ b/openflare-server/internal/agent/sync/service_test.go @@ -13,9 +13,9 @@ import ( "testing" "time" - "github.com/rain-kl/openflare/openflare-agent/internal/nginx" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" - "github.com/rain-kl/openflare/openflare-agent/internal/state" + "github.com/Rain-kl/Wavelet/internal/agent/nginx" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" + "github.com/Rain-kl/Wavelet/internal/agent/state" ) type fakeExecutor struct { diff --git a/openflare-agent/internal/updater/restart_unix.go b/openflare-server/internal/agent/updater/restart_unix.go similarity index 100% rename from openflare-agent/internal/updater/restart_unix.go rename to openflare-server/internal/agent/updater/restart_unix.go diff --git a/openflare-agent/internal/updater/restart_unix_test.go b/openflare-server/internal/agent/updater/restart_unix_test.go similarity index 100% rename from openflare-agent/internal/updater/restart_unix_test.go rename to openflare-server/internal/agent/updater/restart_unix_test.go diff --git a/openflare-agent/internal/updater/restart_windows.go b/openflare-server/internal/agent/updater/restart_windows.go similarity index 100% rename from openflare-agent/internal/updater/restart_windows.go rename to openflare-server/internal/agent/updater/restart_windows.go diff --git a/openflare-agent/internal/updater/updater.go b/openflare-server/internal/agent/updater/updater.go similarity index 98% rename from openflare-agent/internal/updater/updater.go rename to openflare-server/internal/agent/updater/updater.go index 486c2b21..b1f6144b 100644 --- a/openflare-agent/internal/updater/updater.go +++ b/openflare-server/internal/agent/updater/updater.go @@ -14,10 +14,10 @@ import ( "strings" "time" - "github.com/rain-kl/openflare/pkg/utils" + "github.com/Rain-kl/Wavelet/pkg/utils" - "github.com/rain-kl/openflare/openflare-agent/internal/agent" - "github.com/rain-kl/openflare/openflare-agent/internal/config" + "github.com/Rain-kl/Wavelet/internal/agent/agent" + "github.com/Rain-kl/Wavelet/internal/agent/config" ) const maxChecksumAssetSize = 64 * 1024 diff --git a/openflare-agent/internal/updater/updater_test.go b/openflare-server/internal/agent/updater/updater_test.go similarity index 98% rename from openflare-agent/internal/updater/updater_test.go rename to openflare-server/internal/agent/updater/updater_test.go index 43b29e41..c7f0b8c7 100644 --- a/openflare-agent/internal/updater/updater_test.go +++ b/openflare-server/internal/agent/updater/updater_test.go @@ -12,8 +12,8 @@ import ( "strings" "testing" - "github.com/rain-kl/openflare/openflare-agent/internal/agent" - "github.com/rain-kl/openflare/openflare-agent/internal/config" + "github.com/Rain-kl/Wavelet/internal/agent/agent" + "github.com/Rain-kl/Wavelet/internal/agent/config" ) type roundTripFunc func(req *http.Request) (*http.Response, error) diff --git a/openflare-agent/internal/wsclient/client.go b/openflare-server/internal/agent/wsclient/client.go similarity index 93% rename from openflare-agent/internal/wsclient/client.go rename to openflare-server/internal/agent/wsclient/client.go index a6584b6a..371f9d5f 100644 --- a/openflare-agent/internal/wsclient/client.go +++ b/openflare-server/internal/agent/wsclient/client.go @@ -4,8 +4,8 @@ import ( "context" "time" - "github.com/rain-kl/openflare/openflare-agent/internal/protocol" - shared "github.com/rain-kl/openflare/pkg/wsclient" + "github.com/Rain-kl/Wavelet/internal/agent/protocol" + shared "github.com/Rain-kl/Wavelet/pkg/wsclient" ) type WSMessage = shared.WSMessage diff --git a/openflare-server/internal/apps/admin/push/custom_events/admin_login_test.go b/openflare-server/internal/apps/admin/push/custom_events/admin_login_test.go index 4fc0881b..a7687b07 100644 --- a/openflare-server/internal/apps/admin/push/custom_events/admin_login_test.go +++ b/openflare-server/internal/apps/admin/push/custom_events/admin_login_test.go @@ -13,6 +13,7 @@ import ( "github.com/Rain-kl/Wavelet/internal/apps/admin/push" "github.com/Rain-kl/Wavelet/internal/listener" "github.com/Rain-kl/Wavelet/internal/model" + "github.com/Rain-kl/Wavelet/internal/repository" "github.com/Rain-kl/Wavelet/internal/task" "github.com/Rain-kl/Wavelet/internal/testhelper" "github.com/hibiken/asynq" @@ -166,6 +167,7 @@ func TestAdminLoginPushIntegration(t *testing.T) { require.NoError(t, dbConn.Where("event_key = ?", AdminLogin.Key).First(&event).Error) event.Enabled = false require.NoError(t, dbConn.Save(&event).Error) + repository.DeleteActivePushEventCache(context.Background(), AdminLogin.Key) listener.EmitAdminLoggedIn(context.Background(), adminUser, "10.0.0.1") waitForAsyncTrigger(t) diff --git a/openflare-server/internal/apps/admin/push/push_test.go b/openflare-server/internal/apps/admin/push/push_test.go index 4464f975..705c4cb7 100644 --- a/openflare-server/internal/apps/admin/push/push_test.go +++ b/openflare-server/internal/apps/admin/push/push_test.go @@ -25,7 +25,9 @@ import ( "github.com/stretchr/testify/require" "gorm.io/gorm" + "github.com/Rain-kl/Wavelet/internal/apps/oauth" "github.com/Rain-kl/Wavelet/internal/common/response" + "github.com/Rain-kl/Wavelet/internal/repository" ) var adminLoginEvent = EventMetadata{ @@ -191,6 +193,7 @@ func TestEventTrigger(t *testing.T) { event.Targets = []string{"admin_user"} err = dbConn.Save(&event).Error require.NoError(t, err) + repository.DeleteActivePushEventCache(context.Background(), "admin_login") // Trigger body := map[string]any{ @@ -249,6 +252,7 @@ func TestEventTrigger(t *testing.T) { event.Targets = []string{"user.username"} // 动态目标 err = dbConn.Save(&event).Error require.NoError(t, err) + repository.DeleteActivePushEventCache(context.Background(), "admin_login") // Trigger with empty body (simulates cron scheduler triggering) DefaultTrigger.Trigger(context.Background(), adminLoginEvent, nil) @@ -372,6 +376,7 @@ func TestPushRouters(t *testing.T) { // 2. 为该事件关联渠道后,再切换开启,应当成功 event.Channels = []string{"email"} dbConn.Save(&event) + repository.DeleteActivePushEventCache(context.Background(), event.EventKey) req2, _ := http.NewRequest("POST", "/api/v1/admin/push/events/"+strconv.FormatUint(event.ID, 10)+"/toggle", nil) w2 := httptest.NewRecorder() diff --git a/openflare-server/internal/apps/cap/routers_test.go b/openflare-server/internal/apps/cap/routers_test.go index a99da38c..4f72d2ed 100644 --- a/openflare-server/internal/apps/cap/routers_test.go +++ b/openflare-server/internal/apps/cap/routers_test.go @@ -37,6 +37,15 @@ func TestCapEndpointsAndMiddleware(t *testing.T) { c.JSON(http.StatusOK, response.OK("login success")) }) + // Ensure CAPTCHA is disabled initially for step 2 + if err := sqliteDB.Model(&model.SystemConfig{}).Where("key = ?", model.ConfigKeyCapLoginEnabled).Update("value", "false").Error; err != nil { + t.Fatalf("failed to disable cap_login_enabled in DB: %v", err) + } + if err := repository.InvalidateSystemConfigCache(context.Background(), model.ConfigKeyCapLoginEnabled); err != nil { + t.Fatalf("InvalidateSystemConfigCache() error = %v", err) + } + InvalidateRuntimeSettings() + // 1. Test challenge generation w := httptest.NewRecorder() req, _ := http.NewRequest("POST", "/api/cap/challenge", nil) diff --git a/openflare-server/internal/apps/openflare/agent/access_log_region.go b/openflare-server/internal/apps/openflare/agent/access_log_region.go index f3823535..2e9dd76b 100644 --- a/openflare-server/internal/apps/openflare/agent/access_log_region.go +++ b/openflare-server/internal/apps/openflare/agent/access_log_region.go @@ -8,7 +8,7 @@ import ( "net" "strings" - pkggeoip "github.com/rain-kl/openflare/pkg/geoip" + pkggeoip "github.com/Rain-kl/Wavelet/pkg/geoip" ) var accessLogGeoProviderFactory = func() (pkggeoip.GeoIPService, error) { diff --git a/openflare-server/internal/apps/openflare/agent/config.go b/openflare-server/internal/apps/openflare/agent/config.go index 122697f9..7ee88edf 100644 --- a/openflare-server/internal/apps/openflare/agent/config.go +++ b/openflare-server/internal/apps/openflare/agent/config.go @@ -11,7 +11,7 @@ import ( "time" "github.com/Rain-kl/Wavelet/internal/db" - openrestyrender "github.com/rain-kl/openflare/pkg/render/openresty" + openrestyrender "github.com/Rain-kl/Wavelet/pkg/render/openresty" "gorm.io/gorm" ) diff --git a/openflare-server/internal/apps/openflare/agent/config_test.go b/openflare-server/internal/apps/openflare/agent/config_test.go index 2a4f2c8e..8da277ce 100644 --- a/openflare-server/internal/apps/openflare/agent/config_test.go +++ b/openflare-server/internal/apps/openflare/agent/config_test.go @@ -6,7 +6,7 @@ package agent import ( "testing" - openrestyrender "github.com/rain-kl/openflare/pkg/render/openresty" + openrestyrender "github.com/Rain-kl/Wavelet/pkg/render/openresty" ) func TestIsRuntimeGeneratedSupportFile(t *testing.T) { diff --git a/openflare-server/internal/apps/openflare/agent/helpers_test.go b/openflare-server/internal/apps/openflare/agent/helpers_test.go index a7e9ec23..98e00c88 100644 --- a/openflare-server/internal/apps/openflare/agent/helpers_test.go +++ b/openflare-server/internal/apps/openflare/agent/helpers_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/Rain-kl/Wavelet/internal/model" - pkggeoip "github.com/rain-kl/openflare/pkg/geoip" + pkggeoip "github.com/Rain-kl/Wavelet/pkg/geoip" ) type fakeGeoIPProvider struct { diff --git a/openflare-server/internal/apps/openflare/config_version/renderer.go b/openflare-server/internal/apps/openflare/config_version/renderer.go index a5a70e2a..e3112ea7 100644 --- a/openflare-server/internal/apps/openflare/config_version/renderer.go +++ b/openflare-server/internal/apps/openflare/config_version/renderer.go @@ -4,7 +4,7 @@ package config_version import ( - openrestyrender "github.com/rain-kl/openflare/pkg/render/openresty" + openrestyrender "github.com/Rain-kl/Wavelet/pkg/render/openresty" ) // SupportFile is a rendered configuration support artifact. diff --git a/openflare-server/internal/apps/openflare/config_version/snapshot.go b/openflare-server/internal/apps/openflare/config_version/snapshot.go index 8909237b..6912d98a 100644 --- a/openflare-server/internal/apps/openflare/config_version/snapshot.go +++ b/openflare-server/internal/apps/openflare/config_version/snapshot.go @@ -13,7 +13,7 @@ import ( "github.com/Rain-kl/Wavelet/internal/apps/openflare/waf" "github.com/Rain-kl/Wavelet/internal/model" - openrestyrender "github.com/rain-kl/openflare/pkg/render/openresty" + openrestyrender "github.com/Rain-kl/Wavelet/pkg/render/openresty" ) type snapshotRoute struct { diff --git a/openflare-server/internal/apps/openflare/flared/middleware_test.go b/openflare-server/internal/apps/openflare/flared/middleware_test.go index cffd3148..8dbe26d4 100644 --- a/openflare-server/internal/apps/openflare/flared/middleware_test.go +++ b/openflare-server/internal/apps/openflare/flared/middleware_test.go @@ -9,6 +9,7 @@ import ( "net/http/httptest" "testing" + "github.com/Rain-kl/Wavelet/internal/common/response" "github.com/Rain-kl/Wavelet/internal/db" "github.com/Rain-kl/Wavelet/internal/model" "github.com/gin-gonic/gin" @@ -53,6 +54,7 @@ func TestTunnelAuthMissingToken(t *testing.T) { gin.SetMode(gin.TestMode) engine := gin.New() + engine.Use(response.ErrorHandlerMiddleware()) engine.GET("/flared/test", TunnelAuth(), func(c *gin.Context) { c.Status(http.StatusOK) }) @@ -71,6 +73,7 @@ func TestTunnelAuthRejectsWrongNodeType(t *testing.T) { gin.SetMode(gin.TestMode) engine := gin.New() + engine.Use(response.ErrorHandlerMiddleware()) engine.GET("/flared/test", TunnelAuth(), func(c *gin.Context) { c.Status(http.StatusOK) }) diff --git a/openflare-server/internal/apps/openflare/geoip/lookup.go b/openflare-server/internal/apps/openflare/geoip/lookup.go index dcd892bb..3ce1f190 100644 --- a/openflare-server/internal/apps/openflare/geoip/lookup.go +++ b/openflare-server/internal/apps/openflare/geoip/lookup.go @@ -9,7 +9,7 @@ import ( "net" "strings" - pkggeoip "github.com/rain-kl/openflare/pkg/geoip" + pkggeoip "github.com/Rain-kl/Wavelet/pkg/geoip" ) // LookupView is the legacy OpenFlare GeoIP lookup response shape. diff --git a/openflare-server/internal/apps/openflare/geoip/lookup_test.go b/openflare-server/internal/apps/openflare/geoip/lookup_test.go index 02467be7..3ea878a0 100644 --- a/openflare-server/internal/apps/openflare/geoip/lookup_test.go +++ b/openflare-server/internal/apps/openflare/geoip/lookup_test.go @@ -7,7 +7,7 @@ import ( "net" "testing" - pkggeoip "github.com/rain-kl/openflare/pkg/geoip" + pkggeoip "github.com/Rain-kl/Wavelet/pkg/geoip" ) type fakeLookupProvider struct{} diff --git a/openflare-server/internal/apps/openflare/relay/middleware_test.go b/openflare-server/internal/apps/openflare/relay/middleware_test.go index 492b5565..163e0ec1 100644 --- a/openflare-server/internal/apps/openflare/relay/middleware_test.go +++ b/openflare-server/internal/apps/openflare/relay/middleware_test.go @@ -9,6 +9,7 @@ import ( "net/http/httptest" "testing" + "github.com/Rain-kl/Wavelet/internal/common/response" "github.com/Rain-kl/Wavelet/internal/db" "github.com/Rain-kl/Wavelet/internal/model" "github.com/gin-gonic/gin" @@ -53,6 +54,7 @@ func TestRelayAuthMissingToken(t *testing.T) { gin.SetMode(gin.TestMode) engine := gin.New() + engine.Use(response.ErrorHandlerMiddleware()) engine.GET("/relay/test", RelayAuth(), func(c *gin.Context) { c.Status(http.StatusOK) }) @@ -71,6 +73,7 @@ func TestRelayAuthRejectsWrongNodeType(t *testing.T) { gin.SetMode(gin.TestMode) engine := gin.New() + engine.Use(response.ErrorHandlerMiddleware()) engine.GET("/relay/test", RelayAuth(), func(c *gin.Context) { c.Status(http.StatusOK) }) diff --git a/openflare-server/internal/apps/user/routers_test.go b/openflare-server/internal/apps/user/routers_test.go index 79828c8d..6699b6aa 100644 --- a/openflare-server/internal/apps/user/routers_test.go +++ b/openflare-server/internal/apps/user/routers_test.go @@ -139,6 +139,11 @@ func TestRegisterCreatesAuthenticatedEncryptedUser(t *testing.T) { dbConn, _, cleanup := testhelper.SetupTestEnvironment(t) defer cleanup() + // Enable registration for this test + dbConn.Model(&model.SystemConfig{}).Where("key = ?", model.ConfigKeyRegistrationEnabled).Update("value", "true") + dbConn.Model(&model.SystemConfig{}).Where("key = ?", model.ConfigKeyPasswordRegisterEnabled).Update("value", "true") + _ = repository.InvalidateAllSystemConfigCaches(context.Background()) + router := setupUserTestRouter(t) payload := registerRequest{ Username: "newuser", diff --git a/openflare-server/internal/db/migrator/migrator_test.go b/openflare-server/internal/db/migrator/migrator_test.go index 56a1241f..1f061bba 100644 --- a/openflare-server/internal/db/migrator/migrator_test.go +++ b/openflare-server/internal/db/migrator/migrator_test.go @@ -104,11 +104,11 @@ func TestMigrateClearsStaleSystemConfigCache(t *testing.T) { }) staleConfig := model.SystemConfig{ - Key: model.ConfigKeyCapLoginEnabled, + Key: model.ConfigKeyEmailLoginVerificationEnabled, Value: "true", Type: "system", } - if err := db.HSetJSON(context.Background(), repository.SystemConfigRedisHashKey, model.ConfigKeyCapLoginEnabled, &staleConfig); err != nil { + if err := db.HSetJSON(context.Background(), repository.SystemConfigRedisHashKey, model.ConfigKeyEmailLoginVerificationEnabled, &staleConfig); err != nil { t.Fatalf("HSetJSON() error = %v", err) } @@ -122,11 +122,11 @@ func TestMigrateClearsStaleSystemConfigCache(t *testing.T) { t.Fatalf("system config cache exists = %d, want 0", exists) } - enabled, err := repository.GetBoolByKey(context.Background(), model.ConfigKeyCapLoginEnabled) + enabled, err := repository.GetBoolByKey(context.Background(), model.ConfigKeyEmailLoginVerificationEnabled) if err != nil { - t.Fatalf("GetBoolByKey(%s) error = %v", model.ConfigKeyCapLoginEnabled, err) + t.Fatalf("GetBoolByKey(%s) error = %v", model.ConfigKeyEmailLoginVerificationEnabled, err) } if enabled { - t.Fatalf("GetBoolByKey(%s) = true, want false", model.ConfigKeyCapLoginEnabled) + t.Fatalf("GetBoolByKey(%s) = true, want false", model.ConfigKeyEmailLoginVerificationEnabled) } } diff --git a/openflared/internal/config/config.go b/openflare-server/internal/flared/config/config.go similarity index 100% rename from openflared/internal/config/config.go rename to openflare-server/internal/flared/config/config.go diff --git a/openflare-relay/internal/config/version.go b/openflare-server/internal/flared/config/version.go similarity index 100% rename from openflare-relay/internal/config/version.go rename to openflare-server/internal/flared/config/version.go diff --git a/openflared/internal/flared/runner.go b/openflare-server/internal/flared/flared/runner.go similarity index 82% rename from openflared/internal/flared/runner.go rename to openflare-server/internal/flared/flared/runner.go index 8dce39ef..52fdbc40 100644 --- a/openflared/internal/flared/runner.go +++ b/openflare-server/internal/flared/flared/runner.go @@ -5,12 +5,12 @@ import ( "log/slog" "time" - "github.com/rain-kl/openflare/openflared/internal/config" - "github.com/rain-kl/openflare/openflared/internal/frpc" - "github.com/rain-kl/openflare/openflared/internal/heartbeat" - "github.com/rain-kl/openflare/openflared/internal/httpclient" - "github.com/rain-kl/openflare/openflared/internal/sync" - "github.com/rain-kl/openflare/openflared/internal/wsclient" + "github.com/Rain-kl/Wavelet/internal/flared/config" + "github.com/Rain-kl/Wavelet/internal/flared/frpc" + "github.com/Rain-kl/Wavelet/internal/flared/heartbeat" + "github.com/Rain-kl/Wavelet/internal/flared/httpclient" + "github.com/Rain-kl/Wavelet/internal/flared/sync" + "github.com/Rain-kl/Wavelet/internal/flared/wsclient" ) type Runner struct { diff --git a/openflared/internal/frpc/manager.go b/openflare-server/internal/flared/frpc/manager.go similarity index 98% rename from openflared/internal/frpc/manager.go rename to openflare-server/internal/flared/frpc/manager.go index 9e4fe066..26bb0432 100644 --- a/openflared/internal/frpc/manager.go +++ b/openflare-server/internal/flared/frpc/manager.go @@ -14,8 +14,8 @@ import ( "sync" "time" - "github.com/rain-kl/openflare/openflared/internal/config" - service "github.com/rain-kl/openflare/pkg/protocol" + "github.com/Rain-kl/Wavelet/internal/flared/config" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) type Manager struct { diff --git a/openflared/internal/frpc/manager_test.go b/openflare-server/internal/flared/frpc/manager_test.go similarity index 98% rename from openflared/internal/frpc/manager_test.go rename to openflare-server/internal/flared/frpc/manager_test.go index 6d88128a..a94c7609 100644 --- a/openflared/internal/frpc/manager_test.go +++ b/openflare-server/internal/flared/frpc/manager_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/rain-kl/openflare/openflared/internal/config" - service "github.com/rain-kl/openflare/pkg/protocol" + "github.com/Rain-kl/Wavelet/internal/flared/config" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) // Helper to write control file for the dummy script diff --git a/openflared/internal/heartbeat/service.go b/openflare-server/internal/flared/heartbeat/service.go similarity index 89% rename from openflared/internal/heartbeat/service.go rename to openflare-server/internal/flared/heartbeat/service.go index d01bf583..75f6d2d2 100644 --- a/openflared/internal/heartbeat/service.go +++ b/openflare-server/internal/flared/heartbeat/service.go @@ -6,13 +6,13 @@ import ( "net" "time" - "github.com/rain-kl/openflare/openflared/internal/config" - "github.com/rain-kl/openflare/openflared/internal/frpc" - "github.com/rain-kl/openflare/openflared/internal/httpclient" - "github.com/rain-kl/openflare/openflared/internal/updater" - "github.com/rain-kl/openflare/pkg/geoip" - "github.com/rain-kl/openflare/pkg/geoip/iputil" - service "github.com/rain-kl/openflare/pkg/protocol" + "github.com/Rain-kl/Wavelet/internal/flared/config" + "github.com/Rain-kl/Wavelet/internal/flared/frpc" + "github.com/Rain-kl/Wavelet/internal/flared/httpclient" + "github.com/Rain-kl/Wavelet/internal/flared/updater" + "github.com/Rain-kl/Wavelet/pkg/geoip" + "github.com/Rain-kl/Wavelet/pkg/geoip/iputil" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) var ( diff --git a/openflared/internal/httpclient/client.go b/openflare-server/internal/flared/httpclient/client.go similarity index 98% rename from openflared/internal/httpclient/client.go rename to openflare-server/internal/flared/httpclient/client.go index bf96f855..821bdb35 100644 --- a/openflared/internal/httpclient/client.go +++ b/openflare-server/internal/flared/httpclient/client.go @@ -11,7 +11,7 @@ import ( "strings" "time" - service "github.com/rain-kl/openflare/pkg/protocol" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) type APIResponse[T any] struct { @@ -140,4 +140,4 @@ func readBodyError(body []byte, fallback string) error { return errors.New(errBody.ErrorMsg) } return errors.New(fallback) -} \ No newline at end of file +} diff --git a/openflared/internal/sync/service.go b/openflare-server/internal/flared/sync/service.go similarity index 88% rename from openflared/internal/sync/service.go rename to openflare-server/internal/flared/sync/service.go index 576d9683..2783bcff 100644 --- a/openflared/internal/sync/service.go +++ b/openflare-server/internal/flared/sync/service.go @@ -5,10 +5,10 @@ import ( "log/slog" "time" - "github.com/rain-kl/openflare/openflared/internal/config" - "github.com/rain-kl/openflare/openflared/internal/frpc" - "github.com/rain-kl/openflare/openflared/internal/httpclient" - service "github.com/rain-kl/openflare/pkg/protocol" + "github.com/Rain-kl/Wavelet/internal/flared/config" + "github.com/Rain-kl/Wavelet/internal/flared/frpc" + "github.com/Rain-kl/Wavelet/internal/flared/httpclient" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) type Service struct { diff --git a/openflare-relay/internal/updater/restart_unix.go b/openflare-server/internal/flared/updater/restart_unix.go similarity index 100% rename from openflare-relay/internal/updater/restart_unix.go rename to openflare-server/internal/flared/updater/restart_unix.go diff --git a/openflare-relay/internal/updater/restart_windows.go b/openflare-server/internal/flared/updater/restart_windows.go similarity index 100% rename from openflare-relay/internal/updater/restart_windows.go rename to openflare-server/internal/flared/updater/restart_windows.go diff --git a/openflared/internal/updater/updater.go b/openflare-server/internal/flared/updater/updater.go similarity index 99% rename from openflared/internal/updater/updater.go rename to openflare-server/internal/flared/updater/updater.go index dcf11849..f5c406e1 100644 --- a/openflared/internal/updater/updater.go +++ b/openflare-server/internal/flared/updater/updater.go @@ -14,9 +14,9 @@ import ( "strings" "time" - "github.com/rain-kl/openflare/pkg/utils" + "github.com/Rain-kl/Wavelet/pkg/utils" - "github.com/rain-kl/openflare/openflared/internal/config" + "github.com/Rain-kl/Wavelet/internal/flared/config" ) const maxChecksumAssetSize = 64 * 1024 diff --git a/openflared/internal/wsclient/client.go b/openflare-server/internal/flared/wsclient/client.go similarity index 93% rename from openflared/internal/wsclient/client.go rename to openflare-server/internal/flared/wsclient/client.go index fce44832..66855de3 100644 --- a/openflared/internal/wsclient/client.go +++ b/openflare-server/internal/flared/wsclient/client.go @@ -5,8 +5,8 @@ import ( "encoding/json" "time" - service "github.com/rain-kl/openflare/pkg/protocol" - shared "github.com/rain-kl/openflare/pkg/wsclient" + service "github.com/Rain-kl/Wavelet/pkg/protocol" + shared "github.com/Rain-kl/Wavelet/pkg/wsclient" ) type WSMessage = shared.WSMessage diff --git a/openflare-relay/internal/config/config.go b/openflare-server/internal/relay/config/config.go similarity index 98% rename from openflare-relay/internal/config/config.go rename to openflare-server/internal/relay/config/config.go index 1d12acc5..1e00ef6f 100644 --- a/openflare-relay/internal/config/config.go +++ b/openflare-server/internal/relay/config/config.go @@ -10,8 +10,8 @@ import ( "strings" "time" - "github.com/rain-kl/openflare/pkg/geoip" - "github.com/rain-kl/openflare/pkg/geoip/iputil" + "github.com/Rain-kl/Wavelet/pkg/geoip" + "github.com/Rain-kl/Wavelet/pkg/geoip/iputil" ) type MillisecondDuration time.Duration diff --git a/openflared/internal/config/version.go b/openflare-server/internal/relay/config/version.go similarity index 100% rename from openflared/internal/config/version.go rename to openflare-server/internal/relay/config/version.go diff --git a/openflare-relay/internal/frps/manager.go b/openflare-server/internal/relay/frps/manager.go similarity index 99% rename from openflare-relay/internal/frps/manager.go rename to openflare-server/internal/relay/frps/manager.go index 466f28fb..521b1dba 100644 --- a/openflare-relay/internal/frps/manager.go +++ b/openflare-server/internal/relay/frps/manager.go @@ -12,7 +12,7 @@ import ( "sync" "time" - service "github.com/rain-kl/openflare/pkg/protocol" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) type Manager struct { diff --git a/openflare-relay/internal/frps/manager_test.go b/openflare-server/internal/relay/frps/manager_test.go similarity index 99% rename from openflare-relay/internal/frps/manager_test.go rename to openflare-server/internal/relay/frps/manager_test.go index 81da6cd2..546239dc 100644 --- a/openflare-relay/internal/frps/manager_test.go +++ b/openflare-server/internal/relay/frps/manager_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - service "github.com/rain-kl/openflare/pkg/protocol" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) // Helper to write control file for the dummy script diff --git a/openflare-relay/internal/heartbeat/service.go b/openflare-server/internal/relay/heartbeat/service.go similarity index 85% rename from openflare-relay/internal/heartbeat/service.go rename to openflare-server/internal/relay/heartbeat/service.go index 2bfd6afc..fb293f34 100644 --- a/openflare-relay/internal/heartbeat/service.go +++ b/openflare-server/internal/relay/heartbeat/service.go @@ -5,13 +5,13 @@ import ( "log/slog" "time" - "github.com/rain-kl/openflare/openflare-relay/internal/config" - "github.com/rain-kl/openflare/openflare-relay/internal/frps" - "github.com/rain-kl/openflare/openflare-relay/internal/httpclient" - "github.com/rain-kl/openflare/openflare-relay/internal/observability" - "github.com/rain-kl/openflare/openflare-relay/internal/state" - "github.com/rain-kl/openflare/openflare-relay/internal/updater" - service "github.com/rain-kl/openflare/pkg/protocol" + "github.com/Rain-kl/Wavelet/internal/relay/config" + "github.com/Rain-kl/Wavelet/internal/relay/frps" + "github.com/Rain-kl/Wavelet/internal/relay/httpclient" + "github.com/Rain-kl/Wavelet/internal/relay/observability" + "github.com/Rain-kl/Wavelet/internal/relay/state" + "github.com/Rain-kl/Wavelet/internal/relay/updater" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) type Service struct { diff --git a/openflare-relay/internal/httpclient/client.go b/openflare-server/internal/relay/httpclient/client.go similarity index 98% rename from openflare-relay/internal/httpclient/client.go rename to openflare-server/internal/relay/httpclient/client.go index cd61ed10..d580326a 100644 --- a/openflare-relay/internal/httpclient/client.go +++ b/openflare-server/internal/relay/httpclient/client.go @@ -11,7 +11,7 @@ import ( "strings" "time" - service "github.com/rain-kl/openflare/pkg/protocol" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) type APIResponse[T any] struct { @@ -121,4 +121,4 @@ func readBodyError(body []byte, fallback string) error { return errors.New(errBody.ErrorMsg) } return errors.New(fallback) -} \ No newline at end of file +} diff --git a/openflare-relay/internal/observability/collector.go b/openflare-server/internal/relay/observability/collector.go similarity index 97% rename from openflare-relay/internal/observability/collector.go rename to openflare-server/internal/relay/observability/collector.go index 5b89e6a5..c04ea0dc 100644 --- a/openflare-relay/internal/observability/collector.go +++ b/openflare-server/internal/relay/observability/collector.go @@ -13,10 +13,10 @@ import ( "syscall" "time" - "github.com/rain-kl/openflare/openflare-relay/internal/config" - "github.com/rain-kl/openflare/openflare-relay/internal/frps" - "github.com/rain-kl/openflare/openflare-relay/internal/state" - service "github.com/rain-kl/openflare/pkg/protocol" + "github.com/Rain-kl/Wavelet/internal/relay/config" + "github.com/Rain-kl/Wavelet/internal/relay/frps" + "github.com/Rain-kl/Wavelet/internal/relay/state" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) func BuildProfile(cfg *config.Config, stateStore *state.Store) *service.AgentNodeSystemProfile { diff --git a/openflare-relay/internal/relay/runner.go b/openflare-server/internal/relay/relay/runner.go similarity index 80% rename from openflare-relay/internal/relay/runner.go rename to openflare-server/internal/relay/relay/runner.go index 5d589aa9..b4e79509 100644 --- a/openflare-relay/internal/relay/runner.go +++ b/openflare-server/internal/relay/relay/runner.go @@ -6,13 +6,13 @@ import ( "log/slog" "time" - "github.com/rain-kl/openflare/openflare-relay/internal/config" - "github.com/rain-kl/openflare/openflare-relay/internal/frps" - "github.com/rain-kl/openflare/openflare-relay/internal/heartbeat" - "github.com/rain-kl/openflare/openflare-relay/internal/httpclient" - "github.com/rain-kl/openflare/openflare-relay/internal/state" - "github.com/rain-kl/openflare/openflare-relay/internal/wsclient" - service "github.com/rain-kl/openflare/pkg/protocol" + "github.com/Rain-kl/Wavelet/internal/relay/config" + "github.com/Rain-kl/Wavelet/internal/relay/frps" + "github.com/Rain-kl/Wavelet/internal/relay/heartbeat" + "github.com/Rain-kl/Wavelet/internal/relay/httpclient" + "github.com/Rain-kl/Wavelet/internal/relay/state" + "github.com/Rain-kl/Wavelet/internal/relay/wsclient" + service "github.com/Rain-kl/Wavelet/pkg/protocol" ) type Runner struct { diff --git a/openflare-relay/internal/state/store.go b/openflare-server/internal/relay/state/store.go similarity index 100% rename from openflare-relay/internal/state/store.go rename to openflare-server/internal/relay/state/store.go diff --git a/openflared/internal/updater/restart_unix.go b/openflare-server/internal/relay/updater/restart_unix.go similarity index 100% rename from openflared/internal/updater/restart_unix.go rename to openflare-server/internal/relay/updater/restart_unix.go diff --git a/openflared/internal/updater/restart_windows.go b/openflare-server/internal/relay/updater/restart_windows.go similarity index 100% rename from openflared/internal/updater/restart_windows.go rename to openflare-server/internal/relay/updater/restart_windows.go diff --git a/openflare-relay/internal/updater/updater.go b/openflare-server/internal/relay/updater/updater.go similarity index 98% rename from openflare-relay/internal/updater/updater.go rename to openflare-server/internal/relay/updater/updater.go index a386c97b..9c044578 100644 --- a/openflare-relay/internal/updater/updater.go +++ b/openflare-server/internal/relay/updater/updater.go @@ -14,9 +14,9 @@ import ( "strings" "time" - "github.com/rain-kl/openflare/pkg/utils" + "github.com/Rain-kl/Wavelet/pkg/utils" - "github.com/rain-kl/openflare/openflare-relay/internal/config" + "github.com/Rain-kl/Wavelet/internal/relay/config" ) const maxChecksumAssetSize = 64 * 1024 diff --git a/openflare-relay/internal/wsclient/client.go b/openflare-server/internal/relay/wsclient/client.go similarity index 93% rename from openflare-relay/internal/wsclient/client.go rename to openflare-server/internal/relay/wsclient/client.go index 81c089a5..db795417 100644 --- a/openflare-relay/internal/wsclient/client.go +++ b/openflare-server/internal/relay/wsclient/client.go @@ -5,8 +5,8 @@ import ( "encoding/json" "time" - service "github.com/rain-kl/openflare/pkg/protocol" - shared "github.com/rain-kl/openflare/pkg/wsclient" + service "github.com/Rain-kl/Wavelet/pkg/protocol" + shared "github.com/Rain-kl/Wavelet/pkg/wsclient" ) type WSMessage = shared.WSMessage diff --git a/pkg/geoip/emptyProvider.go b/openflare-server/pkg/geoip/emptyProvider.go similarity index 100% rename from pkg/geoip/emptyProvider.go rename to openflare-server/pkg/geoip/emptyProvider.go diff --git a/pkg/geoip/geoip.go b/openflare-server/pkg/geoip/geoip.go similarity index 100% rename from pkg/geoip/geoip.go rename to openflare-server/pkg/geoip/geoip.go diff --git a/pkg/geoip/geoip_test.go b/openflare-server/pkg/geoip/geoip_test.go similarity index 100% rename from pkg/geoip/geoip_test.go rename to openflare-server/pkg/geoip/geoip_test.go diff --git a/pkg/geoip/geojs.go b/openflare-server/pkg/geoip/geojs.go similarity index 100% rename from pkg/geoip/geojs.go rename to openflare-server/pkg/geoip/geojs.go diff --git a/pkg/geoip/ipapi.go b/openflare-server/pkg/geoip/ipapi.go similarity index 100% rename from pkg/geoip/ipapi.go rename to openflare-server/pkg/geoip/ipapi.go diff --git a/pkg/geoip/ipinfo.go b/openflare-server/pkg/geoip/ipinfo.go similarity index 100% rename from pkg/geoip/ipinfo.go rename to openflare-server/pkg/geoip/ipinfo.go diff --git a/pkg/geoip/iputil/iputil.go b/openflare-server/pkg/geoip/iputil/iputil.go similarity index 100% rename from pkg/geoip/iputil/iputil.go rename to openflare-server/pkg/geoip/iputil/iputil.go diff --git a/pkg/geoip/iputil/iputil_test.go b/openflare-server/pkg/geoip/iputil/iputil_test.go similarity index 100% rename from pkg/geoip/iputil/iputil_test.go rename to openflare-server/pkg/geoip/iputil/iputil_test.go diff --git a/pkg/geoip/mmdb.go b/openflare-server/pkg/geoip/mmdb.go similarity index 100% rename from pkg/geoip/mmdb.go rename to openflare-server/pkg/geoip/mmdb.go diff --git a/pkg/geoip/outboundip.go b/openflare-server/pkg/geoip/outboundip.go similarity index 98% rename from pkg/geoip/outboundip.go rename to openflare-server/pkg/geoip/outboundip.go index dc1976f1..718b862a 100644 --- a/pkg/geoip/outboundip.go +++ b/openflare-server/pkg/geoip/outboundip.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/rain-kl/openflare/pkg/geoip/iputil" + "github.com/Rain-kl/Wavelet/pkg/geoip/iputil" ) const defaultOutboundIPLookupTimeout = 5 * time.Second diff --git a/pkg/geoip/outboundip_test.go b/openflare-server/pkg/geoip/outboundip_test.go similarity index 100% rename from pkg/geoip/outboundip_test.go rename to openflare-server/pkg/geoip/outboundip_test.go diff --git a/pkg/protocol/server.go b/openflare-server/pkg/protocol/server.go similarity index 100% rename from pkg/protocol/server.go rename to openflare-server/pkg/protocol/server.go diff --git a/pkg/render/openresty/render.go b/openflare-server/pkg/render/openresty/render.go similarity index 100% rename from pkg/render/openresty/render.go rename to openflare-server/pkg/render/openresty/render.go diff --git a/pkg/render/openresty/render_test.go b/openflare-server/pkg/render/openresty/render_test.go similarity index 100% rename from pkg/render/openresty/render_test.go rename to openflare-server/pkg/render/openresty/render_test.go diff --git a/pkg/render/openresty/types.go b/openflare-server/pkg/render/openresty/types.go similarity index 100% rename from pkg/render/openresty/types.go rename to openflare-server/pkg/render/openresty/types.go diff --git a/pkg/utils/format.go b/openflare-server/pkg/utils/format.go similarity index 100% rename from pkg/utils/format.go rename to openflare-server/pkg/utils/format.go diff --git a/pkg/utils/network.go b/openflare-server/pkg/utils/network.go similarity index 100% rename from pkg/utils/network.go rename to openflare-server/pkg/utils/network.go diff --git a/pkg/utils/slice.go b/openflare-server/pkg/utils/slice.go similarity index 100% rename from pkg/utils/slice.go rename to openflare-server/pkg/utils/slice.go diff --git a/pkg/utils/string.go b/openflare-server/pkg/utils/string.go similarity index 100% rename from pkg/utils/string.go rename to openflare-server/pkg/utils/string.go diff --git a/pkg/utils/value.go b/openflare-server/pkg/utils/value.go similarity index 100% rename from pkg/utils/value.go rename to openflare-server/pkg/utils/value.go diff --git a/pkg/utils/version.go b/openflare-server/pkg/utils/version.go similarity index 100% rename from pkg/utils/version.go rename to openflare-server/pkg/utils/version.go diff --git a/pkg/wsclient/client.go b/openflare-server/pkg/wsclient/client.go similarity index 100% rename from pkg/wsclient/client.go rename to openflare-server/pkg/wsclient/client.go diff --git a/openflared/.gitignore b/openflared/.gitignore deleted file mode 100644 index 5fac6285..00000000 --- a/openflared/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/data/ \ No newline at end of file