From 2dc42a6cb75e32e56d2b4d41b0ac54fae99735dd Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 4 Jun 2026 16:34:49 -0500 Subject: [PATCH] update robots.txt --- lib/aprsme/is/is.ex | 39 ++++++++++++++++++++++++++++++--------- priv/static/robots.txt | 27 ++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/lib/aprsme/is/is.ex b/lib/aprsme/is/is.ex index eddc3e1..cab779d 100644 --- a/lib/aprsme/is/is.ex +++ b/lib/aprsme/is/is.ex @@ -277,7 +277,10 @@ defmodule Aprsme.Is do if state.keepalive_timer, do: Process.cancel_timer(state.keepalive_timer) :gen_tcp.close(socket) schedule_reconnect(5000) - {:reply, {:error, error}, %{state | socket: nil, timer: nil, keepalive_timer: nil}} + + state = track_failure(%{state | socket: nil, timer: nil, keepalive_timer: nil}) + + {:reply, {:error, error}, state} end end end @@ -405,8 +408,17 @@ defmodule Aprsme.Is do # Schedule reconnect schedule_reconnect(5000) - {:noreply, - %{state | socket: nil, timer: nil, keepalive_timer: nil, backpressure_active: false, safety_valve_timer: nil}} + state = + track_failure(%{ + state + | socket: nil, + timer: nil, + keepalive_timer: nil, + backpressure_active: false, + safety_valve_timer: nil + }) + + {:noreply, state} end def handle_info({:tcp_error, _socket, reason}, state) do @@ -419,8 +431,17 @@ defmodule Aprsme.Is do # Schedule reconnect schedule_reconnect(5000) - {:noreply, - %{state | socket: nil, timer: nil, keepalive_timer: nil, backpressure_active: false, safety_valve_timer: nil}} + state = + track_failure(%{ + state + | socket: nil, + timer: nil, + keepalive_timer: nil, + backpressure_active: false, + safety_valve_timer: nil + }) + + {:noreply, state} end def handle_info(:reconnect, state) do @@ -440,26 +461,26 @@ defmodule Aprsme.Is do keepalive_timer = create_keepalive_timer(@keepalive_interval) {:noreply, - %{ + reset_failure(%{ state | socket: socket, timer: timer, keepalive_timer: keepalive_timer, backpressure_active: false, safety_valve_timer: nil - }} + })} error -> Logger.warning("Failed to login to APRS-IS: #{inspect(error)}, will retry in 10 seconds") :gen_tcp.close(socket) schedule_reconnect(10_000) - {:noreply, state} + {:noreply, track_failure(state)} end error -> Logger.warning("Unable to reconnect to APRS-IS: #{inspect(error)}, will retry in 10 seconds") schedule_reconnect(10_000) - {:noreply, state} + {:noreply, track_failure(state)} end end diff --git a/priv/static/robots.txt b/priv/static/robots.txt index a92d101..3c1b24f 100644 --- a/priv/static/robots.txt +++ b/priv/static/robots.txt @@ -1,6 +1,27 @@ -# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file -# -# To ban all spiders from the entire site uncomment the next two lines: +# As a condition of accessing this website, you agree to abide by the following +# content signals: + +# (a) If a Content-Signal = yes, you may collect content for the corresponding +# use. +# (b) If a Content-Signal = no, you may not collect content for the +# corresponding use. +# (c) If the website operator does not include a Content-Signal for a +# corresponding use, the website operator neither grants nor restricts +# permission via Content-Signal with respect to the corresponding use. + +# The content signals and their meanings are: + +# search: building a search index and providing search results (e.g., returning +# hyperlinks and short excerpts from your website's contents). Search does not +# include providing AI-generated search summaries. +# ai-input: inputting content into one or more AI models (e.g., retrieval +# augmented generation, grounding, or other real-time taking of content for +# generative AI search answers). +# ai-train: training or fine-tuning AI models. + +# ANY RESTRICTIONS EXPRESSED VIA CONTENT SIGNALS ARE EXPRESS RESERVATIONS OF +# RIGHTS UNDER ARTICLE 4 OF THE EUROPEAN UNION DIRECTIVE 2019/790 ON COPYRIGHT +# AND RELATED RIGHTS IN THE DIGITAL SINGLE MARKET. User-agent: * Content-Signal: search=yes,ai-train=no