Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F51209
D2.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
34 KB
Subscribers
None
D2.diff
View Options
diff --git a/Admin.md b/Admin.md
--- a/Admin.md
+++ b/Admin.md
@@ -1,6 +1,6 @@
-# ircbot admin bot
+# nola bot admin
-Everything is supposed to be ran inside a remote IEx console: `./bin/lsg remote`.
+Everything is supposed to be ran inside a remote IEx console: `./bin/nola remote`.
## Connection management
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# ircbot
+# nola
Some stupid and badly coded IRC bot. Can be spotted as "bavaria" on irc.random.sh, but is multi-connections and also elsewhere (poor channels).
@@ -24,7 +24,7 @@
Build a release using `MIX_ENV=prod mix release`.
-# bot
+# nola
## ideas
diff --git a/config/config.exs b/config/config.exs
--- a/config/config.exs
+++ b/config/config.exs
@@ -13,12 +13,12 @@
config :phoenix, :json_library, Jason
# General application configuration
-config :lsg,
- namespace: LSG
+config :nola,
+ namespace: Nola
-config :lsg, :data_path, "priv"
+config :nola, :data_path, "priv"
-config :lsg, :brand,
+config :nola, :brand,
name: "Nola",
source_url: "https://phab.random.sh/source/Bot/"
@@ -32,22 +32,22 @@
]
# Configures the endpoint
-config :lsg, LSGWeb.Endpoint,
+config :nola, NolaWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: "cAFb7x2p/D7PdV8/C6Os18uygoD0FVQh3efNEFc5+5L529q3dofZtZye/BG12MRZ",
- render_errors: [view: LSGWeb.ErrorView, accepts: ~w(html json)],
+ render_errors: [view: NolaWeb.ErrorView, accepts: ~w(html json)],
server: true,
live_view: [signing_salt: "CHANGE_ME_FFS"],
- pubsub: [name: LSG.PubSub,
+ pubsub: [name: Nola.PubSub,
adapter: Phoenix.PubSub.PG2]
config :mime, :types, %{"text/event-stream" => ["sse"]}
-config :lsg, LSG.IRC.LastFmHandler,
+config :nola, Nola.IRC.LastFmHandler,
api_key: "x",
api_secret: "x"
-config :lsg, LSG.IRC.YouTubeHandler,
+config :nola, Nola.IRC.YouTubeHandler,
api_key: "x",
invidious: "yewtu.be"
diff --git a/config/dev.exs b/config/dev.exs
--- a/config/dev.exs
+++ b/config/dev.exs
@@ -6,7 +6,7 @@
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with brunch.io to recompile .js and .css sources.
-config :lsg, LSGWeb.Endpoint,
+config :nola, NolaWeb.Endpoint,
http: [port: 4012, ip: {0,0,0,0}],
debug_errors: true,
code_reloader: true,
@@ -29,14 +29,14 @@
# different ports.
# Watch static and templates for browser reloading.
-config :lsg, LSGWeb.Endpoint,
+config :nola, NolaWeb.Endpoint,
live_reload: [
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
~r{priv/gettext/.*(po)$},
- ~r{lib/lsg_web/controllers/.*(ex)$},
- ~r{lib/lsg_web/views/.*(ex)$},
- ~r{lib/lsg_web/templates/.*(eex)$}
+ ~r{lib/nola_web/controllers/.*(ex)$},
+ ~r{lib/nola_web/views/.*(ex)$},
+ ~r{lib/nola_web/templates/.*(eex)$}
]
],
watchers: [
diff --git a/config/prod.exs b/config/prod.exs
--- a/config/prod.exs
+++ b/config/prod.exs
@@ -1,6 +1,6 @@
use Mix.Config
-config :lsg, LSGWeb.Endpoint,
+config :nola, NolaWeb.Endpoint,
http: [ip: {0,0,0,0}, port: 4000]
config :logger_json, :backend,
diff --git a/config/test.exs b/config/test.exs
--- a/config/test.exs
+++ b/config/test.exs
@@ -2,7 +2,7 @@
# We don't run a server during test. If one is required,
# you can enable the server option below.
-config :lsg, LSGWeb.Endpoint,
+config :nola, NolaWeb.Endpoint,
http: [port: 4001],
server: false
diff --git a/lib/couch.ex b/lib/couch.ex
--- a/lib/couch.ex
+++ b/lib/couch.ex
@@ -70,7 +70,7 @@
end
defp prepare_request(path, headers \\ [], params \\ [], options \\ []) do
- config = Application.get_env(:lsg, :couch)
+ config = Application.get_env(:nola, :couch)
base_url = Keyword.get(config, :url, "http://localhost:5984")
url = URI.merge(base_url, Path.join(path)) |> to_string()
diff --git a/lib/lsg/application.ex b/lib/lsg/application.ex
--- a/lib/lsg/application.ex
+++ b/lib/lsg/application.ex
@@ -45,9 +45,9 @@
end
defp start_telegram() do
- token = Keyword.get(Application.get_env(:lsg, :telegram, []), :key)
+ token = Keyword.get(Application.get_env(:nola, :telegram, []), :key)
options = [
- username: Keyword.get(Application.get_env(:lsg, :telegram, []), :nick, "beauttebot"),
+ username: Keyword.get(Application.get_env(:nola, :telegram, []), :nick, "beauttebot"),
purge: false
]
telegram = Telegram.Bot.ChatBot.Supervisor.start_link({Nola.Telegram, token, options})
diff --git a/lib/lsg/icecast.ex b/lib/lsg/icecast.ex
--- a/lib/lsg/icecast.ex
+++ b/lib/lsg/icecast.ex
@@ -41,7 +41,7 @@
Logger.error "Icecast HTTP Error: #{inspect error}"
state
end
- interval = Application.get_env(:lsg, :icecast_poll_interval, 60_000)
+ interval = Application.get_env(:nola, :icecast_poll_interval, 60_000)
:timer.send_after(interval, :poll)
state
end
diff --git a/lib/lsg/lsg.ex b/lib/lsg/lsg.ex
--- a/lib/lsg/lsg.ex
+++ b/lib/lsg/lsg.ex
@@ -7,8 +7,8 @@
owner_email: "contact@my.nola.bot"
]
- def env(), do: Application.get_env(:lsg)
- def env(key, default \\ nil), do: Application.get_env(:lsg, key, default)
+ def env(), do: Application.get_env(:nola)
+ def env(key, default \\ nil), do: Application.get_env(:nola, key, default)
def brand(), do: env(:brand, @default_brand)
def brand(key), do: Keyword.get(brand(), key)
@@ -20,11 +20,11 @@
end
def data_path do
- Application.get_env(:lsg, :data_path)
+ Application.get_env(:nola, :data_path)
end
def version do
- Application.spec(:lsg)[:vsn]
+ Application.spec(:nola)[:vsn]
end
end
diff --git a/lib/lsg_irc/base_plugin.ex b/lib/lsg_irc/base_plugin.ex
--- a/lib/lsg_irc/base_plugin.ex
+++ b/lib/lsg_irc/base_plugin.ex
@@ -109,7 +109,7 @@
end
def handle_info({:irc, :trigger, "version", message = %{trigger: %{type: :bang}}}, _) do
- {:ok, vsn} = :application.get_key(:lsg, :vsn)
+ {:ok, vsn} = :application.get_key(:nola, :vsn)
ver = List.to_string(vsn)
url = NolaWeb.Router.Helpers.irc_url(NolaWeb.Endpoint, :index)
elixir_ver = Application.started_applications() |> List.keyfind(:elixir, 0) |> elem(2) |> to_string()
diff --git a/lib/lsg_irc/finance_plugin.ex b/lib/lsg_irc/finance_plugin.ex
--- a/lib/lsg_irc/finance_plugin.ex
+++ b/lib/lsg_irc/finance_plugin.ex
@@ -183,7 +183,7 @@
end
defp api_key() do
- Application.get_env(:lsg, :alphavantage, [])
+ Application.get_env(:nola, :alphavantage, [])
|> Keyword.get(:api_key, "demo")
end
diff --git a/lib/lsg_irc/last_fm_plugin.ex b/lib/lsg_irc/last_fm_plugin.ex
--- a/lib/lsg_irc/last_fm_plugin.ex
+++ b/lib/lsg_irc/last_fm_plugin.ex
@@ -124,7 +124,7 @@
end
defp now_playing(user) do
- api = Application.get_env(:lsg, :lastfm)[:api_key]
+ api = Application.get_env(:nola, :lastfm)[:api_key]
url = "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&format=json&limit=1&extended=1" <> "&api_key=" <> api <> "&user="<> user
case HTTPoison.get(url) do
{:ok, %HTTPoison.Response{status_code: 200, body: body}} -> Jason.decode(body)
@@ -136,7 +136,7 @@
end
end
defp fetch_track(user, %{"recenttracks" => %{"track" => [ t = %{"name" => name, "artist" => %{"name" => artist}} | _]}}) do
- api = Application.get_env(:lsg, :lastfm)[:api_key]
+ api = Application.get_env(:nola, :lastfm)[:api_key]
url = "http://ws.audioscrobbler.com/2.0/?method=track.getInfo&format=json" <> "&api_key=" <> api <> "&username="<> user <> "&artist="<>URI.encode(artist)<>"&track="<>URI.encode(name)
case HTTPoison.get(url) do
{:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
diff --git a/lib/lsg_irc/link_plugin.ex b/lib/lsg_irc/link_plugin.ex
--- a/lib/lsg_irc/link_plugin.ex
+++ b/lib/lsg_irc/link_plugin.ex
@@ -15,7 +15,7 @@
## Configuration:
```
- config :lsg, Nola.IRC.LinkPlugin,
+ config :nola, Nola.IRC.LinkPlugin,
handlers: [
Nola.IRC.LinkPlugin.Youtube: [
invidious: true
@@ -112,7 +112,7 @@
def expand_link(acc=[uri | _]) do
Logger.debug("link: expanding: #{inspect uri}")
- handlers = Keyword.get(Application.get_env(:lsg, __MODULE__, [handlers: []]), :handlers)
+ handlers = Keyword.get(Application.get_env(:nola, __MODULE__, [handlers: []]), :handlers)
handler = Enum.reduce_while(handlers, nil, fn({module, opts}, acc) ->
Logger.debug("link: attempt expanding: #{inspect module} for #{inspect uri}")
module = Module.concat([module])
@@ -162,7 +162,7 @@
length = Map.get(headers, "content-length", "0")
{length, _} = Integer.parse(length)
- handlers = Keyword.get(Application.get_env(:lsg, __MODULE__, [handlers: []]), :handlers)
+ handlers = Keyword.get(Application.get_env(:nola, __MODULE__, [handlers: []]), :handlers)
handler = Enum.reduce_while(handlers, false, fn({module, opts}, acc) ->
module = Module.concat([module])
try do
diff --git a/lib/lsg_irc/link_plugin/imgur.ex b/lib/lsg_irc/link_plugin/imgur.ex
--- a/lib/lsg_irc/link_plugin/imgur.ex
+++ b/lib/lsg_irc/link_plugin/imgur.ex
@@ -9,7 +9,7 @@
Needs to have a Imgur API key configured:
```
- config :lsg, :imgur,
+ config :nola, :imgur,
client_id: "xxxxxxxx",
client_secret: "xxxxxxxxxxxxxxxxxxxx"
```
@@ -46,7 +46,7 @@
end
def expand_imgur_image(image_id, opts) do
- client_id = Keyword.get(Application.get_env(:lsg, :imgur, []), :client_id, "42")
+ client_id = Keyword.get(Application.get_env(:nola, :imgur, []), :client_id, "42")
headers = [{"Authorization", "Client-ID #{client_id}"}]
options = []
case HTTPoison.get("https://api.imgur.com/3/image/#{image_id}", headers, options) do
@@ -65,7 +65,7 @@
end
def expand_imgur_album(album_id, opts) do
- client_id = Keyword.get(Application.get_env(:lsg, :imgur, []), :client_id, "42")
+ client_id = Keyword.get(Application.get_env(:nola, :imgur, []), :client_id, "42")
headers = [{"Authorization", "Client-ID #{client_id}"}]
options = []
case HTTPoison.get("https://api.imgur.com/3/album/#{album_id}", headers, options) do
diff --git a/lib/lsg_irc/link_plugin/youtube.ex b/lib/lsg_irc/link_plugin/youtube.ex
--- a/lib/lsg_irc/link_plugin/youtube.ex
+++ b/lib/lsg_irc/link_plugin/youtube.ex
@@ -7,7 +7,7 @@
needs an API key:
```
- config :lsg, :youtube,
+ config :nola, :youtube,
api_key: "xxxxxxxxxxxxx"
```
@@ -32,7 +32,7 @@
@impl true
def expand(uri, %{video_id: video_id}, opts) do
- key = Application.get_env(:lsg, :youtube)[:api_key]
+ key = Application.get_env(:nola, :youtube)[:api_key]
params = %{
"part" => "snippet,contentDetails,statistics",
"id" => video_id,
diff --git a/lib/lsg_irc/preums_plugin.ex b/lib/lsg_irc/preums_plugin.ex
--- a/lib/lsg_irc/preums_plugin.ex
+++ b/lib/lsg_irc/preums_plugin.ex
@@ -229,7 +229,7 @@
end
defp timezone(channel) do
- env = Application.get_env(:lsg, Nola.IRC.PreumsPlugin, [])
+ env = Application.get_env(:nola, Nola.IRC.PreumsPlugin, [])
channels = Keyword.get(env, :channels, %{})
channel_settings = Map.get(channels, channel, [])
default = Keyword.get(env, :default_tz, "Europe/Paris")
diff --git a/lib/lsg_irc/sms_plugin.ex b/lib/lsg_irc/sms_plugin.ex
--- a/lib/lsg_irc/sms_plugin.ex
+++ b/lib/lsg_irc/sms_plugin.ex
@@ -51,7 +51,7 @@
end
def my_number() do
- Keyword.get(Application.get_env(:lsg, :sms, []), :number, "+33000000000")
+ Keyword.get(Application.get_env(:nola, :sms, []), :number, "+33000000000")
end
def start_link() do
@@ -59,7 +59,7 @@
end
def path() do
- account = Keyword.get(Application.get_env(:lsg, :sms), :account)
+ account = Keyword.get(Application.get_env(:nola, :sms), :account)
"https://eu.api.ovh.com/1.0/sms/#{account}"
end
@@ -156,7 +156,7 @@
end
defp env() do
- Application.get_env(:lsg, :sms)
+ Application.get_env(:nola, :sms)
end
defp env(key) do
diff --git a/lib/lsg_irc/txt_plugin.ex b/lib/lsg_irc/txt_plugin.ex
--- a/lib/lsg_irc/txt_plugin.ex
+++ b/lib/lsg_irc/txt_plugin.ex
@@ -55,7 +55,7 @@
def init([]) do
dets_locks_filename = (Nola.data_path() <> "/" <> "txtlocks.dets") |> String.to_charlist
{:ok, locks} = :dets.open_file(dets_locks_filename, [])
- markov_handler = Keyword.get(Application.get_env(:lsg, __MODULE__, []), :markov_handler, Nola.IRC.TxtPlugin.Markov.Native)
+ markov_handler = Keyword.get(Application.get_env(:nola, __MODULE__, []), :markov_handler, Nola.IRC.TxtPlugin.Markov.Native)
{:ok, markov} = markov_handler.start_link()
{:ok, _} = Registry.register(IRC.PubSub, "triggers", [plugin: __MODULE__])
{:ok, %__MODULE__{locks: locks, markov_handler: markov_handler, markov: markov, triggers: load()}}
@@ -516,7 +516,7 @@
end
def directory() do
- Application.get_env(:lsg, :data_path) <> "/irc.txt/"
+ Application.get_env(:nola, :data_path) <> "/irc.txt/"
end
defp can_write?(%{rw: rw?, locks: locks}, msg = %{channel: nil, sender: sender}, trigger) do
diff --git a/lib/lsg_irc/txt_plugin/markov_py_markovify.ex b/lib/lsg_irc/txt_plugin/markov_py_markovify.ex
--- a/lib/lsg_irc/txt_plugin/markov_py_markovify.ex
+++ b/lib/lsg_irc/txt_plugin/markov_py_markovify.ex
@@ -27,8 +27,8 @@
end
defp script() do
- default_script = to_string(:code.priv_dir(:lsg)) <> "/irc/txt/markovify.py"
- env = Application.get_env(:lsg, Nola.IRC.TxtPlugin, [])
+ default_script = to_string(:code.priv_dir(:nola)) <> "/irc/txt/markovify.py"
+ env = Application.get_env(:nola, Nola.IRC.TxtPlugin, [])
|> Keyword.get(:py_markovify, [])
{Keyword.get(env, :python, "python3"), Keyword.get(env, :script, default_script)}
diff --git a/lib/lsg_irc/wolfram_alpha_plugin.ex b/lib/lsg_irc/wolfram_alpha_plugin.ex
--- a/lib/lsg_irc/wolfram_alpha_plugin.ex
+++ b/lib/lsg_irc/wolfram_alpha_plugin.ex
@@ -22,7 +22,7 @@
def handle_info({:irc, :trigger, _, m = %IRC.Message{trigger: %IRC.Trigger{type: :bang, args: query}}}, state) do
query = Enum.join(query, " ")
params = %{
- "appid" => Keyword.get(Application.get_env(:lsg, :wolframalpha, []), :app_id, "NO_APP_ID"),
+ "appid" => Keyword.get(Application.get_env(:nola, :wolframalpha, []), :app_id, "NO_APP_ID"),
"units" => "metric",
"i" => query
}
diff --git a/lib/lsg_irc/youtube_plugin.ex b/lib/lsg_irc/youtube_plugin.ex
--- a/lib/lsg_irc/youtube_plugin.ex
+++ b/lib/lsg_irc/youtube_plugin.ex
@@ -56,7 +56,7 @@
defp search(query) do
query = query
|> String.strip
- key = Application.get_env(:lsg, :youtube)[:api_key]
+ key = Application.get_env(:nola, :youtube)[:api_key]
params = %{
"key" => key,
"maxResults" => 1,
diff --git a/lib/lsg_telegram/room.ex b/lib/lsg_telegram/room.ex
--- a/lib/lsg_telegram/room.ex
+++ b/lib/lsg_telegram/room.ex
@@ -37,7 +37,7 @@
@impl Telegram.ChatBot
def init(id) when is_integer(id) and id < 0 do
- token = Keyword.get(Application.get_env(:lsg, :telegram, []), :key)
+ token = Keyword.get(Application.get_env(:nola, :telegram, []), :key)
{:ok, chat} = Api.request(token, "getChat", chat_id: id)
Logger.metadata(transport: :telegram, id: id, telegram_room_id: id)
tg_room = case room(id) do
@@ -164,7 +164,7 @@
{:ok, %HTTPoison.Response{status_code: 200, body: body}} <- HTTPoison.get(path),
<<smol_body::binary-size(20), _::binary>> = body,
{:ok, magic} <- GenMagic.Pool.perform(Nola.GenMagic, {:bytes, smol_body}),
- bucket = Application.get_env(:lsg, :s3, []) |> Keyword.get(:bucket),
+ bucket = Application.get_env(:nola, :s3, []) |> Keyword.get(:bucket),
ext = Path.extname(file["file_path"]),
s3path = "#{account.id}/#{file_unique_id}#{ext}",
s3req = ExAws.S3.put_object(bucket, s3path, body, acl: :public_read, content_type: magic.mime_type),
diff --git a/lib/lsg_telegram/telegram.ex b/lib/lsg_telegram/telegram.ex
--- a/lib/lsg_telegram/telegram.ex
+++ b/lib/lsg_telegram/telegram.ex
@@ -8,7 +8,7 @@
def send_message(id, text, md2 \\ false) do
md = if md2, do: "MarkdownV2", else: "Markdown"
- token = Keyword.get(Application.get_env(:lsg, :telegram, []), :key)
+ token = Keyword.get(Application.get_env(:nola, :telegram, []), :key)
Telegram.Bot.ChatBot.Chat.Session.Supervisor.start_child(Nola.Telegram, id)
Telegram.Api.request(token, "sendMessage", chat_id: id, text: text, parse_mode: "Markdown")
end
@@ -135,7 +135,7 @@
{:ok, %HTTPoison.Response{status_code: 200, body: body}} <- HTTPoison.get(path),
<<smol_body::binary-size(20), _::binary>> = body,
{:ok, magic} <- GenMagic.Pool.perform(Nola.GenMagic, {:bytes, smol_body}),
- bucket = Application.get_env(:lsg, :s3, []) |> Keyword.get(:bucket),
+ bucket = Application.get_env(:nola, :s3, []) |> Keyword.get(:bucket),
ext = Path.extname(file["file_path"]),
s3path = "#{account.id}/#{file_unique_id}#{ext}",
Telegram.Api.request(t, "editMessageText", chat_id: chat_id, message_id: m_id, text: "*Uploading...*", reply_markup: %{}, parse_mode: "MarkdownV2"),
diff --git a/lib/lsg_web/controllers/irc_controller.ex b/lib/lsg_web/controllers/irc_controller.ex
--- a/lib/lsg_web/controllers/irc_controller.ex
+++ b/lib/lsg_web/controllers/irc_controller.ex
@@ -76,7 +76,7 @@
end
defp data() do
- dir = Application.get_env(:lsg, :data_path) <> "/irc.txt/"
+ dir = Application.get_env(:nola, :data_path) <> "/irc.txt/"
Path.wildcard(dir <> "/*.txt")
|> Enum.reduce(%{}, fn(path, m) ->
path = String.split(path, "/")
diff --git a/lib/lsg_web/controllers/open_id_controller.ex b/lib/lsg_web/controllers/open_id_controller.ex
--- a/lib/lsg_web/controllers/open_id_controller.ex
+++ b/lib/lsg_web/controllers/open_id_controller.ex
@@ -50,7 +50,7 @@
end
defp new_client() do
- config = Application.get_env(:lsg, :oidc)
+ config = Application.get_env(:nola, :oidc)
OAuth2.Client.new([
strategy: OAuth2.Strategy.AuthCode,
client_id: config[:client_id],
diff --git a/lib/lsg_web/endpoint.ex b/lib/lsg_web/endpoint.ex
--- a/lib/lsg_web/endpoint.ex
+++ b/lib/lsg_web/endpoint.ex
@@ -1,13 +1,13 @@
defmodule NolaWeb.Endpoint do
use Sentry.PlugCapture
- use Phoenix.Endpoint, otp_app: :lsg
+ use Phoenix.Endpoint, otp_app: :nola
# Serve at "/" the static files from "priv/static" directory.
#
# You should set gzip to true if you are running phoenix.digest
# when deploying your static files in production.
plug Plug.Static,
- at: "/", from: :lsg, gzip: false,
+ at: "/", from: :nola, gzip: false,
only: ~w(assets css js fonts images favicon.ico robots.txt)
# Code reloading can be explicitly enabled under the
@@ -31,7 +31,7 @@
plug Plug.Head
@session_options [store: :cookie,
- key: "_lsg_key",
+ key: "_nola_key",
signing_salt: "+p7K3wrj"]
diff --git a/lib/lsg_web/gettext.ex b/lib/lsg_web/gettext.ex
--- a/lib/lsg_web/gettext.ex
+++ b/lib/lsg_web/gettext.ex
@@ -20,5 +20,5 @@
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
"""
- use Gettext, otp_app: :lsg
+ use Gettext, otp_app: :nola
end
diff --git a/lib/lsg_web/live/chat_live.html.heex b/lib/lsg_web/live/chat_live.html.heex
--- a/lib/lsg_web/live/chat_live.html.heex
+++ b/lib/lsg_web/live/chat_live.html.heex
@@ -27,7 +27,7 @@
<%= if is_map(message) && Map.get(message, :__struct__) == IRC.Message do %>
<li class="flex gap-2 place-items-center message"
data-account-id={message.account.id}>
- <LSGWeb.MessageComponent.content
+ <NolaWeb.MessageComponent.content
message={message}
self={message.account.id == @account_id}
text={message.text}
@@ -41,10 +41,10 @@
<%= if is_map(message) && Map.get(message, :type) do %>
<li class="flex gap-2 place-items-center event">
- <LSGWeb.Component.naive_date_time_utc datetime={message.at} format="time-24-with-seconds" />
+ <NolaWeb.Component.naive_date_time_utc datetime={message.at} format="time-24-with-seconds" />
<span class="inline-block font-bold flex-none cursor-default text-gray-700">* * *</span>
<span class="inline-block flex-grow cursor-default text-gray-700">
- <LSGWeb.EventComponent.content event={message}
+ <NolaWeb.EventComponent.content event={message}
self={@users[message.user_id] && @users[message.user_id].account == @account_id}
user={@users[message.user_id]}
/>
diff --git a/lib/lsg_web/lsg_web.ex b/lib/lsg_web/lsg_web.ex
--- a/lib/lsg_web/lsg_web.ex
+++ b/lib/lsg_web/lsg_web.ex
@@ -55,7 +55,7 @@
def view do
quote do
- use Phoenix.View, root: "lib/lsg_web/templates",
+ use Phoenix.View, root: "lib/nola_web/templates",
namespace: NolaWeb
# Import convenience functions from controllers
diff --git a/lib/lsg_web/templates/alcoolog/index.html.eex b/lib/lsg_web/templates/alcoolog/index.html.eex
--- a/lib/lsg_web/templates/alcoolog/index.html.eex
+++ b/lib/lsg_web/templates/alcoolog/index.html.eex
@@ -38,7 +38,7 @@
<%= if status.last_descr && status.last_descr != "" do %>
<br /><%= status.last_descr %>
<% end %>
- <br/><small><%= LSGWeb.LayoutView.format_time(status.last_at) %></small>
+ <br/><small><%= NolaWeb.LayoutView.format_time(status.last_at) %></small>
</p>
<p class="mt-1 text-gray-500 text-sm leading-5 truncate">
@@ -131,7 +131,7 @@
<% date = DateTime.from_unix!(date, :millisecond) %>
<tr class="<%= class %>">
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 font-medium text-gray-900">
- <%= LSGWeb.LayoutView.format_time(date, false) %>
+ <%= NolaWeb.LayoutView.format_time(date, false) %>
</td>
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 font-medium text-gray-900">
<%= link nick, to: alcoolog_path(@conn, :nick, @network, nick) %>
@@ -161,7 +161,7 @@
(function() {
// oui s trè moch :( :( :(
var ctx = document.getElementById('myChart').getContext('2d');
- d3.json('<%= alcoolog_path(@conn, :index_gls_json, @network, LSGWeb.format_chan(@channel)) %>', function(data) {
+ d3.json('<%= alcoolog_path(@conn, :index_gls_json, @network, NolaWeb.format_chan(@channel)) %>', function(data) {
var dynamicColors = function() {
var r = Math.floor(Math.random() * 255);
diff --git a/lib/lsg_web/templates/alcoolog/user.html.eex b/lib/lsg_web/templates/alcoolog/user.html.eex
--- a/lib/lsg_web/templates/alcoolog/user.html.eex
+++ b/lib/lsg_web/templates/alcoolog/user.html.eex
@@ -12,7 +12,7 @@
<% end %>
</span>
- <span class="px-3 text-gray-500 text-sm font-thin"><%= LSGWeb.LayoutView.format_time(@stats.last_at) %></span>
+ <span class="px-3 text-gray-500 text-sm font-thin"><%= NolaWeb.LayoutView.format_time(@stats.last_at) %></span>
</h3>
@@ -34,7 +34,7 @@
<% end %>
</span>
- <span class="px-3 text-gray-500 text-sm font-thin"><%= LSGWeb.LayoutView.format_time(@stats.last_at) %></span>
+ <span class="px-3 text-gray-500 text-sm font-thin"><%= NolaWeb.LayoutView.format_time(@stats.last_at) %></span>
</h3>
<% end %>
@@ -65,7 +65,7 @@
<% class = if(Integer.is_even(index), do: "bg-gray-50", else: "bg-white") %>
<tr class="<%= class %>">
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 font-medium text-gray-900">
- <%= LSGWeb.LayoutView.format_time(date, false) %>
+ <%= NolaWeb.LayoutView.format_time(date, false) %>
</td>
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500"><%= cl %>cl <%= deg %>°</td>
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500"><%= comment||"" %></td>
diff --git a/lib/lsg_web/templates/irc/index.html.eex b/lib/lsg_web/templates/irc/index.html.eex
--- a/lib/lsg_web/templates/irc/index.html.eex
+++ b/lib/lsg_web/templates/irc/index.html.eex
@@ -1,6 +1,6 @@
<div class="hidden sm:block">
<nav class="flex flex-wrap space-x-4">
- <%= link("live", to: LSGWeb.Router.Helpers.live_path(LSGWeb.Endpoint, LSGWeb.ChatLive, @network, LSGWeb.format_chan(@chan)), class: "py-4 font-medium leading-5 rounded-md text-gray-500 hover:text-gray-700 focus:outline-none focus:text-indigo-600 focus:bg-indigo-50", 'data-turbo': false) %>
+ <%= link("live", to: NolaWeb.Router.Helpers.live_path(NolaWeb.Endpoint, NolaWeb.ChatLive, @network, NolaWeb.format_chan(@chan)), class: "py-4 font-medium leading-5 rounded-md text-gray-500 hover:text-gray-700 focus:outline-none focus:text-indigo-600 focus:bg-indigo-50", 'data-turbo': false) %>
<% list = for {identifier, _} <- @commands do %>
<% name = String.replace(identifier, "_", " ") %>
<%= link(name, to: "##{identifier}", class: "py-4 font-medium leading-5 rounded-md text-gray-500 hover:text-gray-700 focus:outline-none focus:text-indigo-600 focus:bg-indigo-50") %>
@@ -19,7 +19,7 @@
<%= for {identifier, help} <- @commands do %>
<%= if help do %>
<div class="bg-white border-b border-gray-200" id="<%= identifier %>">
- <div class="prose w-auto max-w-full"><%= LSGWeb.LayoutView.liquid_markdown(@conn, help) %></div>
+ <div class="prose w-auto max-w-full"><%= NolaWeb.LayoutView.liquid_markdown(@conn, help) %></div>
</div>
<% end %>
<% end %>
@@ -39,6 +39,6 @@
<p>
<small>
- running beautte version <%= LSG.version() %> — <a href="<%= LSG.source_url() %>">git</a>
+ running beautte version <%= Nola.version() %> — <a href="<%= Nola.source_url() %>">git</a>
</small>
</p>
diff --git a/lib/lsg_web/templates/irc/txts.html.eex b/lib/lsg_web/templates/irc/txts.html.eex
--- a/lib/lsg_web/templates/irc/txts.html.eex
+++ b/lib/lsg_web/templates/irc/txts.html.eex
@@ -7,7 +7,7 @@
<ul class="mt-3 grid grid-cols-1 gap-5 sm:gap-6 sm:grid-cols-4 lg:grid-cols-6">
<%= for {txt, data} <- @data do %>
<% base_url = cond do
- @conn.assigns[:chan] -> "/#{@conn.assigns.network}/#{LSGWeb.format_chan(@conn.assigns.chan)}"
+ @conn.assigns[:chan] -> "/#{@conn.assigns.network}/#{NolaWeb.format_chan(@conn.assigns.chan)}"
true -> "/-"
end %>
<li class="col-span-1 flex shadow-sm rounded-m">
@@ -22,7 +22,7 @@
</ul>
</div>
-<div class="prose mt-12" id="help""><%= LSGWeb.LayoutView.liquid_markdown(@conn, @doc) %></div>
+<div class="prose mt-12" id="help""><%= NolaWeb.LayoutView.liquid_markdown(@conn, @doc) %></div>
<div class="mt-24">
<h2 class="text-gray-500 text-xs font-medium uppercase tracking-wide">
@@ -32,7 +32,7 @@
<ul class="mt-3 grid grid-cols-1 gap-5 sm:gap-6 sm:grid-cols-4 lg:grid-cols-6">
<%= for {txt, data} <- @system do %>
<% base_url = cond do
- @conn.assigns[:chan] -> "/#{@conn.assigns.network}/#{LSGWeb.format_chan(@conn.assigns.chan)}"
+ @conn.assigns[:chan] -> "/#{@conn.assigns.network}/#{NolaWeb.format_chan(@conn.assigns.chan)}"
true -> "/-"
end %>
<li class="col-span-1 flex shadow-sm rounded-m">
diff --git a/lib/lsg_web/templates/layout/app.html.eex b/lib/lsg_web/templates/layout/app.html.eex
--- a/lib/lsg_web/templates/layout/app.html.eex
+++ b/lib/lsg_web/templates/layout/app.html.eex
@@ -10,7 +10,7 @@
</div>
<div class="hidden md:block">
<div class="ml-10 flex items-baseline">
- <a href="/" class="px-3 py-2 rounded-md text-sm font-medium text-white bg-gray-900 focus:outline-none focus:text-white focus:bg-gray-700">bot.goulag.org</a>
+ <a href="/" class="px-3 py-2 rounded-md text-sm font-medium text-white bg-gray-900 focus:outline-none focus:text-white focus:bg-gray-700"><%= Nola.name() %></a>
<!--<a href="#" class="ml-4 px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700">Team</a>
<a href="#" class="ml-4 px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700">Projects</a>
<a href="#" class="ml-4 px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700">Calendar</a>
@@ -106,7 +106,7 @@
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<h1 class="text-3xl leading-9 font-bold text-white">
<%= if n = @conn.assigns[:network] do %><a href="/<%= n %>"><%= n %></a> › <% end %>
- <%= if c = @conn.assigns[:chan] do %><a href="/<%= @conn.assigns.network %>/<%= LSGWeb.format_chan(c) %>"><%= c %></a> › <% end %>
+ <%= if c = @conn.assigns[:chan] do %><a href="/<%= @conn.assigns.network %>/<%= NolaWeb.format_chan(c) %>"><%= c %></a> › <% end %>
<%= for({name, href} <- Enum.uniq(@conn.assigns[:breadcrumbs]||[]), do: [link(name, to: href), raw(" › ")]) %>
<%= @conn.assigns[:title] %>
</h1>
diff --git a/lib/lsg_web/templates/page/user.html.eex b/lib/lsg_web/templates/page/user.html.eex
--- a/lib/lsg_web/templates/page/user.html.eex
+++ b/lib/lsg_web/templates/page/user.html.eex
@@ -10,7 +10,7 @@
<ul>
<%= for {net, channel} <- @memberships do %>
<li>
- <% url = LSGWeb.Router.Helpers.irc_path(LSGWeb.Endpoint, :index, net, LSGWeb.format_chan(channel)) %>
+ <% url = NolaWeb.Router.Helpers.irc_path(NolaWeb.Endpoint, :index, net, NolaWeb.format_chan(channel)) %>
<%= link([net, ": ", content_tag(:strong, channel)], to: url) %>
</li>
<% end %>
diff --git a/lib/open_ai.ex b/lib/open_ai.ex
--- a/lib/open_ai.ex
+++ b/lib/open_ai.ex
@@ -1,7 +1,7 @@
defmodule OpenAi do
def post(path, data, options \\ []) do
- config = Application.get_env(:lsg, :openai, [])
+ config = Application.get_env(:nola, :openai, [])
url = "https://api.openai.com#{path}"
headers = [{"user-agent", "internal private experiment bot, href@random.sh"},
{"content-type", "application/json"},
diff --git a/lib/untappd.ex b/lib/untappd.ex
--- a/lib/untappd.ex
+++ b/lib/untappd.ex
@@ -88,7 +88,7 @@
end
def env() do
- Application.get_env(:lsg, :untappd)
+ Application.get_env(:nola, :untappd)
end
end
diff --git a/rel/config.exs b/rel/config.exs
--- a/rel/config.exs
+++ b/rel/config.exs
@@ -44,8 +44,8 @@
# when running `mix release`, the first release in the file
# will be used by default
-release :lsg do
- set version: current_version(:lsg)
+release :nola do
+ set version: current_version(:nola)
set applications: [
:runtime_tools
]
diff --git a/test/correction_plugin_test.exs b/test/correction_plugin_test.exs
--- a/test/correction_plugin_test.exs
+++ b/test/correction_plugin_test.exs
@@ -1,4 +1,4 @@
-defmodule LSG.IRC.CorrectionPluginTest do
+defmodule Nola.IRC.CorrectionPluginTest do
use ExUnit.Case
test "works" do
@@ -6,7 +6,7 @@
assert x == "correction: <oof> prout les salopes"
end, network: "test", channel: "#test"}
hist = %{text: "pouet les salopes", sender: %{nick: "oof"}}
- LSG.IRC.CorrectionPlugin.correction(message, %{"test/#test" => [hist]})
+ Nola.IRC.CorrectionPlugin.correction(message, %{"test/#test" => [hist]})
end
end
diff --git a/test/lsg_web/controllers/page_controller_test.exs b/test/lsg_web/controllers/page_controller_test.exs
--- a/test/lsg_web/controllers/page_controller_test.exs
+++ b/test/lsg_web/controllers/page_controller_test.exs
@@ -1,5 +1,5 @@
-defmodule LSGWeb.PageControllerTest do
- use LSGWeb.ConnCase
+defmodule NolaWeb.PageControllerTest do
+ use NolaWeb.ConnCase
test "GET /", %{conn: conn} do
conn = get conn, "/"
diff --git a/test/lsg_web/views/error_view_test.exs b/test/lsg_web/views/error_view_test.exs
--- a/test/lsg_web/views/error_view_test.exs
+++ b/test/lsg_web/views/error_view_test.exs
@@ -1,21 +1,21 @@
-defmodule LSGWeb.ErrorViewTest do
- use LSGWeb.ConnCase, async: true
+defmodule NolaWeb.ErrorViewTest do
+ use NolaWeb.ConnCase, async: true
# Bring render/3 and render_to_string/3 for testing custom views
import Phoenix.View
test "renders 404.html" do
- assert render_to_string(LSGWeb.ErrorView, "404.html", []) ==
+ assert render_to_string(NolaWeb.ErrorView, "404.html", []) ==
"Page not found"
end
test "render 500.html" do
- assert render_to_string(LSGWeb.ErrorView, "500.html", []) ==
+ assert render_to_string(NolaWeb.ErrorView, "500.html", []) ==
"Internal server error"
end
test "render any other" do
- assert render_to_string(LSGWeb.ErrorView, "505.html", []) ==
+ assert render_to_string(NolaWeb.ErrorView, "505.html", []) ==
"Internal server error"
end
end
diff --git a/test/lsg_web/views/layout_view_test.exs b/test/lsg_web/views/layout_view_test.exs
--- a/test/lsg_web/views/layout_view_test.exs
+++ b/test/lsg_web/views/layout_view_test.exs
@@ -1,3 +1,3 @@
-defmodule LSGWeb.LayoutViewTest do
- use LSGWeb.ConnCase, async: true
+defmodule NolaWeb.LayoutViewTest do
+ use NolaWeb.ConnCase, async: true
end
diff --git a/test/lsg_web/views/page_view_test.exs b/test/lsg_web/views/page_view_test.exs
--- a/test/lsg_web/views/page_view_test.exs
+++ b/test/lsg_web/views/page_view_test.exs
@@ -1,3 +1,3 @@
-defmodule LSGWeb.PageViewTest do
- use LSGWeb.ConnCase, async: true
+defmodule NolaWeb.PageViewTest do
+ use NolaWeb.ConnCase, async: true
end
diff --git a/test/support/channel_case.ex b/test/support/channel_case.ex
--- a/test/support/channel_case.ex
+++ b/test/support/channel_case.ex
@@ -1,4 +1,4 @@
-defmodule LSGWeb.ChannelCase do
+defmodule NolaWeb.ChannelCase do
@moduledoc """
This module defines the test case to be used by
channel tests.
@@ -21,7 +21,7 @@
use Phoenix.ChannelTest
# The default endpoint for testing
- @endpoint LSGWeb.Endpoint
+ @endpoint NolaWeb.Endpoint
end
end
diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex
--- a/test/support/conn_case.ex
+++ b/test/support/conn_case.ex
@@ -1,4 +1,4 @@
-defmodule LSGWeb.ConnCase do
+defmodule NolaWeb.ConnCase do
@moduledoc """
This module defines the test case to be used by
tests that require setting up a connection.
@@ -19,10 +19,10 @@
quote do
# Import conveniences for testing with connections
use Phoenix.ConnTest
- import LSGWeb.Router.Helpers
+ import NolaWeb.Router.Helpers
# The default endpoint for testing
- @endpoint LSGWeb.Endpoint
+ @endpoint NolaWeb.Endpoint
end
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 13, 11:58 AM (13 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33519
Default Alt Text
D2.diff (34 KB)
Attached To
D2: Nola
Event Timeline
Log In to Comment