diff --git a/.build.yml b/.build.yml index 6e2cb09..81366f8 100644 --- a/.build.yml +++ b/.build.yml @@ -5,33 +5,33 @@ packages: - postgresql-contrib - docker artifacts: -- management/_build/prod/rel/recycledcloud.tar.gz +- meta/_build/prod/rel/meta.tar.gz sources: -- https://code.recycled.cloud/e-Durable/management.git +- https://code.recycled.cloud/RecycledCloud/met.git tasks: - setup: | sudo service postgresql setup sudo service postgresql start sudo service docker start - cd management + cd meta mix local.hex --force mix local.rebar --force mix deps.get - build: | - cd management + cd meta MIX_ENV=test mix deps.compile MIX_ENV=test mix compile - test: | - cd management + cd meta sudo docker pull code.ungleich.ch:5050/fnux/e-durable-oci-images/openldap-playground:latest CALL_CONTAINER_RUNTIME_AS_ROOT=1 LDAP_WAIT_LOOPS=100 MIX_ENV=test mix test - lint: | - cd management + cd meta MIX_ENV=test mix credo - release: | - cd management + cd meta MIX_ENV=prod mix compile MIX_ENV=prod mix phx.digest MIX_ENV=prod mix release cd _build/prod/rel - tar cvzf recycledcloud.tar.gz recycledcloud/ + tar cvzf meta.tar.gz met/ diff --git a/CHANGELOG.md b/CHANGELOG.md index fa6de5c..043acbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# meta 0.5.0, not yet release + +* Rename app from Recycled Cloud / management to Meta + # management 0.4.0, 2021-04-09 * Initial VM dashboard diff --git a/README.md b/README.md index 14fa082..4ad22a5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Recycled Cloud Management Interface +# Recycled Cloud Management Interface (Meta) -[![builds.sr.ht status](https://builds.sr.ht/~fnux.svg?search=recycledcloud-management)](https://builds.sr.ht/~fnux?search=recycledcloud-management) +[![builds.sr.ht status](https://builds.sr.ht/~fnux.svg?search=recycledcloud-meta)](https://builds.sr.ht/~fnux?search=recycledcloud-meta) This repository tracks the initial work for a web interface atop the recycled cloud. It is written in [Elixir](https://elixir-lang.org/), making use of the diff --git a/config/config.exs b/config/config.exs index bdcb2e1..b74371f 100644 --- a/config/config.exs +++ b/config/config.exs @@ -7,17 +7,17 @@ # General application configuration use Mix.Config -config :recycledcloud, - namespace: RecycledCloud, - ecto_repos: [RecycledCloud.Repo], +config :meta, + namespace: Meta, + ecto_repos: [Meta.Repo], enable_registration: true # Configures the endpoint -config :recycledcloud, RecycledCloudWeb.Endpoint, +config :meta, MetaWeb.Endpoint, url: [host: "localhost"], secret_key_base: "bm4MGjSLcEbL3HEDg2H0LlcJ5d3nIkogyd/PpGW1iXdEbKbtM0N8Ct4Jh/PbsnoS", - render_errors: [view: RecycledCloudWeb.ErrorView, accepts: ~w(html json), layout: false], - pubsub_server: RecycledCloud.PubSub, + render_errors: [view: MetaWeb.ErrorView, accepts: ~w(html json), layout: false], + pubsub_server: Meta.PubSub, live_view: [signing_salt: "kTyyWZd5"] # Configures Elixir's Logger diff --git a/config/dev.exs b/config/dev.exs index b41d77d..91d9aec 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,10 +1,10 @@ use Mix.Config # Configure your database -config :recycledcloud, RecycledCloud.Repo, +config :meta, Meta.Repo, username: "postgres", password: "postgres", - database: "recycledcloud_dev", + database: "meta_dev", hostname: "localhost", show_sensitive_data_on_connection_error: true, pool_size: 10 @@ -15,7 +15,7 @@ config :recycledcloud, RecycledCloud.Repo, # The watchers configuration can be used to run external # watchers to your application. For example, we use it # with webpack to recompile .js and .css sources. -config :recycledcloud, RecycledCloudWeb.Endpoint, +config :meta, MetaWeb.Endpoint, http: [port: 4000], debug_errors: true, code_reloader: true, @@ -47,13 +47,13 @@ config :recycledcloud, RecycledCloudWeb.Endpoint, # different ports. # Watch static and templates for browser reloading. -config :recycledcloud, RecycledCloudWeb.Endpoint, +config :meta, MetaWeb.Endpoint, live_reload: [ patterns: [ ~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$", ~r"priv/gettext/.*(po)$", - ~r"lib/recycledcloud_web/(live|views)/.*(ex)$", - ~r"lib/recycledcloud_web/templates/.*(eex)$" + ~r"lib/meta_web/(live|views)/.*(ex)$", + ~r"lib/meta_web/templates/.*(eex)$" ] ] @@ -68,11 +68,11 @@ config :phoenix, :stacktrace_depth, 20 config :phoenix, :plug_init_mode, :runtime # Send emails to local memory for development. -config :recycledcloud, RecycledCloud.Mailer, +config :meta, Meta.Mailer, adapter: Bamboo.LocalAdapter # LDAP configuration -config :recycledcloud, :ldap, +config :meta, :ldap, server: "127.0.0.1", port: 3089, ssl: false, @@ -82,7 +82,7 @@ config :recycledcloud, :ldap, default_group_gid: 1000 ## Odoo API credentials -config :recycledcloud, :odoo, +config :meta, :odoo, server: "https://odoo.staging.e-durable.ch", database: "e-Durable", user: "user", diff --git a/config/prod.exs b/config/prod.exs index e4f779d..05535ae 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -9,7 +9,7 @@ use Mix.Config # manifest is generated by the `mix phx.digest` task, # which you should run after static files are built and # before starting your production server. -config :recycledcloud, RecycledCloudWeb.Endpoint, +config :meta, MetaWeb.Endpoint, url: [host: "example.com", port: 80], cache_static_manifest: "priv/static/cache_manifest.json" @@ -21,7 +21,7 @@ config :logger, level: :info # To get SSL working, you will need to add the `https` key # to the previous section and set your `:url` port to 443: # -# config :recycledcloud, RecycledCloudWeb.Endpoint, +# config :meta, MetaWeb.Endpoint, # ... # url: [host: "example.com", port: 443], # https: [ @@ -45,7 +45,7 @@ config :logger, level: :info # We also recommend setting `force_ssl` in your endpoint, ensuring # no data is ever sent via http, always redirecting to https: # -# config :recycledcloud, RecycledCloudWeb.Endpoint, +# config :meta, MetaWeb.Endpoint, # force_ssl: [hsts: true] # # Check `Plug.SSL` for all available options in `force_ssl`. diff --git a/config/release-runtime.exs b/config/release-runtime.exs index 7c7eebb..94189ef 100644 --- a/config/release-runtime.exs +++ b/config/release-runtime.exs @@ -10,7 +10,7 @@ database_url = For example: ecto://USER:PASS@HOST/DATABASE """ -config :recycledcloud, RecycledCloud.Repo, +config :meta, Meta.Repo, # ssl: true, url: database_url, pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10") @@ -22,7 +22,7 @@ secret_key_base = You can generate one by calling: mix phx.gen.secret """ -config :recycledcloud, RecycledCloudWeb.Endpoint, +config :meta, MetaWeb.Endpoint, http: [ port: String.to_integer(System.get_env("PORT") || "4000"), transport_options: [socket_opts: [:inet6]] @@ -34,7 +34,7 @@ config :recycledcloud, RecycledCloudWeb.Endpoint, # If you are doing OTP releases, you need to instruct Phoenix # to start each relevant endpoint: # -config :recycledcloud, RecycledCloudWeb.Endpoint, server: true +config :meta, MetaWeb.Endpoint, server: true # # Then you can assemble a release by calling `mix release`. # See `mix help release` for more information. diff --git a/config/test.exs b/config/test.exs index b325936..4b8dfb8 100644 --- a/config/test.exs +++ b/config/test.exs @@ -8,16 +8,16 @@ config :bcrypt_elixir, :log_rounds, 1 # The MIX_TEST_PARTITION environment variable can be used # to provide built-in test partitioning in CI environment. # Run `mix help test` for more information. -config :recycledcloud, RecycledCloud.Repo, +config :meta, Meta.Repo, username: "postgres", password: "postgres", - database: "recycledcloud_test#{System.get_env("MIX_TEST_PARTITION")}", + database: "meta_test#{System.get_env("MIX_TEST_PARTITION")}", hostname: "localhost", pool: Ecto.Adapters.SQL.Sandbox # We don't run a server during test. If one is required, # you can enable the server option below. -config :recycledcloud, RecycledCloudWeb.Endpoint, +config :meta, MetaWeb.Endpoint, http: [port: 4002], server: false @@ -25,7 +25,7 @@ config :recycledcloud, RecycledCloudWeb.Endpoint, config :logger, level: :warn # LDAP configuration -config :recycledcloud, :ldap, +config :meta, :ldap, server: "127.0.0.1", port: 3089, ssl: false, @@ -34,5 +34,5 @@ config :recycledcloud, :ldap, bind_pw: "admin" # Send emails to local memory for testing. -config :recycledcloud, RecycledCloud.Mailer, +config :meta, Meta.Mailer, adapter: Bamboo.LocalAdapter diff --git a/lib/recycledcloud.ex b/lib/meta.ex similarity index 82% rename from lib/recycledcloud.ex rename to lib/meta.ex index 9a80729..67cdf9b 100644 --- a/lib/recycledcloud.ex +++ b/lib/meta.ex @@ -1,6 +1,6 @@ -defmodule RecycledCloud do +defmodule Meta do @moduledoc """ - RecycledCloud keeps the contexts that define your domain + Meta keeps the contexts that define your domain and business logic. Contexts are also responsible for managing your data, regardless diff --git a/lib/recycledcloud/accounts.ex b/lib/meta/accounts.ex similarity index 98% rename from lib/recycledcloud/accounts.ex rename to lib/meta/accounts.ex index 9a95a10..c1bd435 100644 --- a/lib/recycledcloud/accounts.ex +++ b/lib/meta/accounts.ex @@ -1,11 +1,11 @@ -defmodule RecycledCloud.Accounts do +defmodule Meta.Accounts do @moduledoc """ The Accounts context. """ import Ecto.Query, warn: false - alias RecycledCloud.Repo - alias RecycledCloud.Accounts.{User, Key, UserToken, UserNotifier} + alias Meta.Repo + alias Meta.Accounts.{User, Key, UserToken, UserNotifier} ## Database getters diff --git a/lib/recycledcloud/accounts/key.ex b/lib/meta/accounts/key.ex similarity index 93% rename from lib/recycledcloud/accounts/key.ex rename to lib/meta/accounts/key.ex index 6410969..597bcfa 100644 --- a/lib/recycledcloud/accounts/key.ex +++ b/lib/meta/accounts/key.ex @@ -1,4 +1,4 @@ -defmodule RecycledCloud.Accounts.Key do +defmodule Meta.Accounts.Key do use Ecto.Schema import Ecto.Changeset @@ -6,7 +6,7 @@ defmodule RecycledCloud.Accounts.Key do field :comment, :string field :value, :string field :fingerprint, :string - belongs_to :user, RecycledCloud.Accounts.User + belongs_to :user, Meta.Accounts.User timestamps() end diff --git a/lib/recycledcloud/accounts/user.ex b/lib/meta/accounts/user.ex similarity index 97% rename from lib/recycledcloud/accounts/user.ex rename to lib/meta/accounts/user.ex index d77b2fb..d0039b9 100644 --- a/lib/recycledcloud/accounts/user.ex +++ b/lib/meta/accounts/user.ex @@ -1,10 +1,10 @@ -defmodule RecycledCloud.Accounts.User do +defmodule Meta.Accounts.User do use Ecto.Schema import Ecto.Changeset require Logger - alias RecycledCloud.{LDAP,Accounts} - alias RecycledCloud.Accounts.User - alias RecycledCloud.Repo + alias Meta.{LDAP,Accounts} + alias Meta.Accounts.User + alias Meta.Repo @min_password_lenght 6 @max_password_lenght 80 @@ -74,7 +74,7 @@ defmodule RecycledCloud.Accounts.User do defp create_ldap_user(%User{} = user) do # TODO: read dn template from conf, gid_number - conf = Application.get_env(:recycledcloud, :ldap) + conf = Application.get_env(:meta, :ldap) basetree = conf |> Keyword.get(:base_dn) default_group_gid = conf |> Keyword.get(:default_group_gid, 1000) @@ -156,7 +156,7 @@ defmodule RecycledCloud.Accounts.User do user |> cast(attrs, [:username, :password, :email, :dn, :captcha]) - |> RecycledCloud.Captcha.validate(expected_captcha_result) + |> Meta.Captcha.validate(expected_captcha_result) |> validate_username() |> validate_email() |> validate_password() diff --git a/lib/recycledcloud/accounts/user_notifier.ex b/lib/meta/accounts/user_notifier.ex similarity index 94% rename from lib/recycledcloud/accounts/user_notifier.ex rename to lib/meta/accounts/user_notifier.ex index 83caf5f..9d7c10b 100644 --- a/lib/recycledcloud/accounts/user_notifier.ex +++ b/lib/meta/accounts/user_notifier.ex @@ -1,5 +1,5 @@ -defmodule RecycledCloud.Accounts.UserNotifier do - alias RecycledCloud.Mailer +defmodule Meta.Accounts.UserNotifier do + alias Meta.Mailer import Bamboo.Email defp deliver(to, body) do diff --git a/lib/recycledcloud/accounts/user_token.ex b/lib/meta/accounts/user_token.ex similarity index 87% rename from lib/recycledcloud/accounts/user_token.ex rename to lib/meta/accounts/user_token.ex index c3497ba..a1b7d37 100644 --- a/lib/recycledcloud/accounts/user_token.ex +++ b/lib/meta/accounts/user_token.ex @@ -1,4 +1,4 @@ -defmodule RecycledCloud.Accounts.UserToken do +defmodule Meta.Accounts.UserToken do use Ecto.Schema import Ecto.Query @@ -16,7 +16,7 @@ defmodule RecycledCloud.Accounts.UserToken do field :token, :binary field :context, :string field :sent_to, :string - belongs_to :user, RecycledCloud.Accounts.User + belongs_to :user, Meta.Accounts.User timestamps(updated_at: false) end @@ -28,7 +28,7 @@ defmodule RecycledCloud.Accounts.UserToken do """ def build_session_token(user) do token = :crypto.strong_rand_bytes(@rand_size) - {token, %RecycledCloud.Accounts.UserToken{token: token, context: "session", user_id: user.id}} + {token, %Meta.Accounts.UserToken{token: token, context: "session", user_id: user.id}} end @doc """ @@ -63,7 +63,7 @@ defmodule RecycledCloud.Accounts.UserToken do hashed_token = :crypto.hash(@hash_algorithm, token) {Base.url_encode64(token, padding: false), - %RecycledCloud.Accounts.UserToken{ + %Meta.Accounts.UserToken{ token: hashed_token, context: context, sent_to: sent_to, @@ -123,17 +123,17 @@ defmodule RecycledCloud.Accounts.UserToken do Returns the given token with the given context. """ def token_and_context_query(token, context) do - from RecycledCloud.Accounts.UserToken, where: [token: ^token, context: ^context] + from Meta.Accounts.UserToken, where: [token: ^token, context: ^context] end @doc """ Gets all tokens for the given user for the given contexts. """ def user_and_contexts_query(user, :all) do - from t in RecycledCloud.Accounts.UserToken, where: t.user_id == ^user.id + from t in Meta.Accounts.UserToken, where: t.user_id == ^user.id end def user_and_contexts_query(user, [_ | _] = contexts) do - from t in RecycledCloud.Accounts.UserToken, where: t.user_id == ^user.id and t.context in ^contexts + from t in Meta.Accounts.UserToken, where: t.user_id == ^user.id and t.context in ^contexts end end diff --git a/lib/recycledcloud/application.ex b/lib/meta/application.ex similarity index 59% rename from lib/recycledcloud/application.ex rename to lib/meta/application.ex index bc035fb..315830c 100644 --- a/lib/recycledcloud/application.ex +++ b/lib/meta/application.ex @@ -1,4 +1,4 @@ -defmodule RecycledCloud.Application do +defmodule Meta.Application do # See https://hexdocs.pm/elixir/Application.html # for more information on OTP Applications @moduledoc false @@ -8,31 +8,31 @@ defmodule RecycledCloud.Application do def start(_type, _args) do children = [ # Start the Ecto repository - RecycledCloud.Repo, + Meta.Repo, # Start the Telemetry supervisor - RecycledCloudWeb.Telemetry, + MetaWeb.Telemetry, # Start the PubSub system - {Phoenix.PubSub, name: RecycledCloud.PubSub}, + {Phoenix.PubSub, name: Meta.PubSub}, # Start the Endpoint (http/https) - RecycledCloudWeb.Endpoint, + MetaWeb.Endpoint, # Starts LDAP connection pool - RecycledCloud.LDAP, + Meta.LDAP, # Starts Odoo client - RecycledCloud.Odoo - # Start a worker by calling: RecycledCloud.Worker.start_link(arg) - # {RecycledCloud.Worker, arg} + Meta.Odoo + # Start a worker by calling: Meta.Worker.start_link(arg) + # {Meta.Worker, arg} ] # See https://hexdocs.pm/elixir/Supervisor.html # for other strategies and supported options - opts = [strategy: :one_for_one, name: RecycledCloud.Supervisor] + opts = [strategy: :one_for_one, name: Meta.Supervisor] Supervisor.start_link(children, opts) end # Tell Phoenix to update the endpoint configuration # whenever the application is updated. def config_change(changed, _new, removed) do - RecycledCloudWeb.Endpoint.config_change(changed, removed) + MetaWeb.Endpoint.config_change(changed, removed) :ok end end diff --git a/lib/recycledcloud/billing/invoice.ex b/lib/meta/billing/invoice.ex similarity index 86% rename from lib/recycledcloud/billing/invoice.ex rename to lib/meta/billing/invoice.ex index b783e7a..5ca8e2f 100644 --- a/lib/recycledcloud/billing/invoice.ex +++ b/lib/meta/billing/invoice.ex @@ -1,6 +1,6 @@ -defmodule RecycledCloud.Billing.Invoice do - alias RecycledCloud.Billing.{Partner, Invoice} - alias RecycledCloud.Odoo +defmodule Meta.Billing.Invoice do + alias Meta.Billing.{Partner, Invoice} + alias Meta.Odoo use Ecto.Schema diff --git a/lib/recycledcloud/billing/partner.ex b/lib/meta/billing/partner.ex similarity index 92% rename from lib/recycledcloud/billing/partner.ex rename to lib/meta/billing/partner.ex index e084f1e..2756a9f 100644 --- a/lib/recycledcloud/billing/partner.ex +++ b/lib/meta/billing/partner.ex @@ -1,8 +1,8 @@ -defmodule RecycledCloud.Billing.Partner do - alias RecycledCloud.Accounts.User - alias RecycledCloud.Billing.Partner - alias RecycledCloud.Odoo - alias RecycledCloud.Repo +defmodule Meta.Billing.Partner do + alias Meta.Accounts.User + alias Meta.Billing.Partner + alias Meta.Odoo + alias Meta.Repo import Ecto.Changeset use Ecto.Schema diff --git a/lib/recycledcloud/captcha.ex b/lib/meta/captcha.ex similarity index 95% rename from lib/recycledcloud/captcha.ex rename to lib/meta/captcha.ex index d45f309..d0e7ba1 100644 --- a/lib/recycledcloud/captcha.ex +++ b/lib/meta/captcha.ex @@ -1,4 +1,4 @@ -defmodule RecycledCloud.Captcha do +defmodule Meta.Captcha do # We can't use a graphical-only captcha library such as # https://hex.pm/packages/captcha since it would break accessibility for # blind people. Let's make it simple maths instead! diff --git a/lib/recycledcloud/ldap.ex b/lib/meta/ldap.ex similarity index 94% rename from lib/recycledcloud/ldap.ex rename to lib/meta/ldap.ex index 1f2435f..7c1218a 100644 --- a/lib/recycledcloud/ldap.ex +++ b/lib/meta/ldap.ex @@ -1,4 +1,4 @@ -defmodule RecycledCloud.LDAP do +defmodule Meta.LDAP do require Logger use GenServer @@ -54,7 +54,7 @@ defmodule RecycledCloud.LDAP do ### def search(ldap_conn, field, value, search_timeout \\ 1000) do - base_dn = Application.get_env(:recycledcloud, :ldap) |> Keyword.get(:base_dn) + base_dn = Application.get_env(:meta, :ldap) |> Keyword.get(:base_dn) opts = [ {:base, to_charlist(base_dn)}, {:scope, :eldap.wholeSubtree()}, @@ -89,7 +89,7 @@ defmodule RecycledCloud.LDAP do defp internal_execute_query(query, ldap_conn), do: query.(ldap_conn) defp bind(ldap_conn) do - conf = Application.get_env(:recycledcloud, :ldap, []) + conf = Application.get_env(:meta, :ldap, []) dn = conf |> Keyword.get(:bind_dn) pw = conf |> Keyword.get(:bind_pw) @@ -98,7 +98,7 @@ defmodule RecycledCloud.LDAP do # The method is used by the RC.LDAPTestEnvironment module. def connect do - conf = Application.get_env(:recycledcloud, :ldap, []) + conf = Application.get_env(:meta, :ldap, []) host = Keyword.get(conf, :server, "localhost") |> String.to_charlist opts = [ diff --git a/lib/recycledcloud/mailer.ex b/lib/meta/mailer.ex similarity index 59% rename from lib/recycledcloud/mailer.ex rename to lib/meta/mailer.ex index b3e748b..5546e09 100644 --- a/lib/recycledcloud/mailer.ex +++ b/lib/meta/mailer.ex @@ -1,5 +1,5 @@ -defmodule RecycledCloud.Mailer do - use Bamboo.Mailer, otp_app: :recycledcloud +defmodule Meta.Mailer do + use Bamboo.Mailer, otp_app: :meta import Bamboo.Email @from "no-reply@recycled.cloud" diff --git a/lib/recycledcloud/odoo.ex b/lib/meta/odoo.ex similarity index 96% rename from lib/recycledcloud/odoo.ex rename to lib/meta/odoo.ex index ba4d2bf..fae4886 100644 --- a/lib/recycledcloud/odoo.ex +++ b/lib/meta/odoo.ex @@ -1,4 +1,4 @@ -defmodule RecycledCloud.Odoo do +defmodule Meta.Odoo do use GenServer require Logger @@ -8,7 +8,7 @@ defmodule RecycledCloud.Odoo do # Odoo 14.0 API is documented at https://www.odoo.com/documentation/14.0/webservices/odoo.html defp get_odoo_config(key) do - Application.get_env(:recycledcloud, :odoo, []) |> Keyword.get(key) + Application.get_env(:meta, :odoo, []) |> Keyword.get(key) end defp post!(call, endpoint) do diff --git a/lib/recycledcloud/opennebula.ex b/lib/meta/opennebula.ex similarity index 93% rename from lib/recycledcloud/opennebula.ex rename to lib/meta/opennebula.ex index 9aa0d5b..2b50672 100644 --- a/lib/recycledcloud/opennebula.ex +++ b/lib/meta/opennebula.ex @@ -1,18 +1,18 @@ -defmodule RecycledCloud.OpenNebula do +defmodule Meta.OpenNebula do @moduledoc """ The OpenNebula context and XML-RPC Interface. See http://docs.opennebula.io/5.12/integration/system_interfaces/api.html for details. """ - alias RecycledCloud.OpenNebula.{VM, VMPool} + alias Meta.OpenNebula.{VM, VMPool} require Logger # OpenNebula daemon. @endpoint "/RPC2" defp get_opennebula_config(key) do - Application.get_env(:recycledcloud, :opennebula, []) |> Keyword.get(key) + Application.get_env(:meta, :opennebula, []) |> Keyword.get(key) end def get_locations() do diff --git a/lib/recycledcloud/opennebula/schema.ex b/lib/meta/opennebula/schema.ex similarity index 90% rename from lib/recycledcloud/opennebula/schema.ex rename to lib/meta/opennebula/schema.ex index 278ae30..c629012 100644 --- a/lib/recycledcloud/opennebula/schema.ex +++ b/lib/meta/opennebula/schema.ex @@ -1,4 +1,4 @@ -defmodule RecycledCloud.OpenNebula.Schema do +defmodule Meta.OpenNebula.Schema do @moduledoc """ Helpers used to process OpenNebula's XSD schema. @@ -24,8 +24,8 @@ defmodule RecycledCloud.OpenNebula.Schema do """ require Logger - alias RecycledCloud.OpenNebula.Schema - alias RecycledCloud.OpenNebula.Schema.Records + alias Meta.OpenNebula.Schema + alias Meta.OpenNebula.Schema.Records @opennebula_release "5.12" @@ -33,7 +33,7 @@ defmodule RecycledCloud.OpenNebula.Schema do # Data-binding: access and extract XSD models. defp get_raw(type, object) do - priv_dir = :code.priv_dir(:recycledcloud) |> to_string + priv_dir = :code.priv_dir(:meta) |> to_string {data_dir, extension} = case type do :xsd -> {"xsd-src", ".xsd"} :hrl -> {"xsd-records", ".hrl"} @@ -73,8 +73,8 @@ defmodule RecycledCloud.OpenNebula.Schema do schema = elem(data, 0) if schema in Keyword.keys(Schema.Records.__info__(:macros)) do call = quote do - require RecycledCloud.OpenNebula.Schema.Records - RecycledCloud.OpenNebula.Schema.Records."XSD"(:data) + require Meta.OpenNebula.Schema.Records + Meta.OpenNebula.Schema.Records."XSD"(:data) end replace = fn :XSD, {model, data} -> {model, {model, data}} diff --git a/lib/recycledcloud/opennebula/schema/records.ex b/lib/meta/opennebula/schema/records.ex similarity index 85% rename from lib/recycledcloud/opennebula/schema/records.ex rename to lib/meta/opennebula/schema/records.ex index 96988ff..74f469b 100644 --- a/lib/recycledcloud/opennebula/schema/records.ex +++ b/lib/meta/opennebula/schema/records.ex @@ -1,4 +1,4 @@ -defmodule RecycledCloud.OpenNebula.Schema.Records do +defmodule Meta.OpenNebula.Schema.Records do @moduledoc """ Here we define XSD template into something we can play with (Records). @@ -6,11 +6,11 @@ defmodule RecycledCloud.OpenNebula.Schema.Records do code - which is what we're doing right now: the records are defined in .hrl (erlang headers) by erlsom. - See RecycledCloud.OpenNebula.Schema module for details. + See Meta.OpenNebula.Schema module for details. """ require Record - alias RecycledCloud.OpenNebula.Schema + alias Meta.OpenNebula.Schema @models %{ "vm" => Schema.generate_model_for("vm"), diff --git a/lib/recycledcloud/opennebula/vm.ex b/lib/meta/opennebula/vm.ex similarity index 98% rename from lib/recycledcloud/opennebula/vm.ex rename to lib/meta/opennebula/vm.ex index 9cac3ab..ac78bc8 100644 --- a/lib/recycledcloud/opennebula/vm.ex +++ b/lib/meta/opennebula/vm.ex @@ -1,9 +1,9 @@ -defmodule RecycledCloud.OpenNebula.VM do +defmodule Meta.OpenNebula.VM do @moduledoc """ OpenNebula VM: http://docs.opennebula.io/5.12/integration/system_interfaces/api.html#one-vm-info """ - alias RecycledCloud.OpenNebula, as: ONE - alias RecycledCloud.OpenNebula.Schema + alias Meta.OpenNebula, as: ONE + alias Meta.OpenNebula.Schema @states [ {:any, -2}, diff --git a/lib/recycledcloud/opennebula/vm_pool.ex b/lib/meta/opennebula/vm_pool.ex similarity index 91% rename from lib/recycledcloud/opennebula/vm_pool.ex rename to lib/meta/opennebula/vm_pool.ex index a33a777..feaeb5e 100644 --- a/lib/recycledcloud/opennebula/vm_pool.ex +++ b/lib/meta/opennebula/vm_pool.ex @@ -1,9 +1,9 @@ -defmodule RecycledCloud.OpenNebula.VMPool do +defmodule Meta.OpenNebula.VMPool do @moduledoc """ OpenNebula VM Pool: http://docs.opennebula.io/5.12/integration/system_interfaces/api.html#one-vmpool-info """ - alias RecycledCloud.OpenNebula, as: ONE - alias RecycledCloud.OpenNebula.Schema + alias Meta.OpenNebula, as: ONE + alias Meta.OpenNebula.Schema # Filters ressourses. # (user) ID >= 0 matches an user's resources. diff --git a/lib/recycledcloud/release.ex b/lib/meta/release.ex similarity index 88% rename from lib/recycledcloud/release.ex rename to lib/meta/release.ex index 3faeb57..37af326 100644 --- a/lib/recycledcloud/release.ex +++ b/lib/meta/release.ex @@ -1,5 +1,5 @@ -defmodule RecycledCloud.Release do - @app :recycledcloud +defmodule Meta.Release do + @app :meta def migrate do load_app() diff --git a/lib/meta/repo.ex b/lib/meta/repo.ex new file mode 100644 index 0000000..5742f2e --- /dev/null +++ b/lib/meta/repo.ex @@ -0,0 +1,5 @@ +defmodule Meta.Repo do + use Ecto.Repo, + otp_app: :meta, + adapter: Ecto.Adapters.Postgres +end diff --git a/lib/recycledcloud/support_request.ex b/lib/meta/support_request.ex similarity index 78% rename from lib/recycledcloud/support_request.ex rename to lib/meta/support_request.ex index 2d13700..276fe91 100644 --- a/lib/recycledcloud/support_request.ex +++ b/lib/meta/support_request.ex @@ -1,11 +1,11 @@ -defmodule RecycledCloud.SupportRequest do +defmodule Meta.SupportRequest do use Ecto.Schema import Ecto.Changeset import Bamboo.Email - alias RecycledCloud.SupportRequest - alias RecycledCloud.Mailer - alias RecycledCloud.Captcha + alias Meta.SupportRequest + alias Meta.Mailer + alias Meta.Captcha embedded_schema do field :name, :string @@ -26,8 +26,8 @@ defmodule RecycledCloud.SupportRequest do end def send(%SupportRequest{} = request) do - admin_email = Application.get_env(:recycledcloud, :admin_email) - host = Application.get_env(:recycledcloud, RecycledCloudWeb.Endpoint) + admin_email = Application.get_env(:meta, :admin_email) + host = Application.get_env(:meta, MetaWeb.Endpoint) |> Keyword.get(:url, []) |> Keyword.get(:host, "localhost") diff --git a/lib/recycledcloud_web.ex b/lib/meta_web.ex similarity index 73% rename from lib/recycledcloud_web.ex rename to lib/meta_web.ex index 7919182..0bb7582 100644 --- a/lib/recycledcloud_web.ex +++ b/lib/meta_web.ex @@ -1,12 +1,12 @@ -defmodule RecycledCloudWeb do +defmodule MetaWeb do @moduledoc """ The entrypoint for defining your web interface, such as controllers, views, channels and so on. This can be used in your application as: - use RecycledCloudWeb, :controller - use RecycledCloudWeb, :view + use MetaWeb, :controller + use MetaWeb, :view The definitions below will be executed for every view, controller, etc, so keep them short and clean, focused @@ -19,19 +19,19 @@ defmodule RecycledCloudWeb do def controller do quote do - use Phoenix.Controller, namespace: RecycledCloudWeb + use Phoenix.Controller, namespace: MetaWeb import Plug.Conn - import RecycledCloudWeb.Gettext - alias RecycledCloudWeb.Router.Helpers, as: Routes + import MetaWeb.Gettext + alias MetaWeb.Router.Helpers, as: Routes end end def view do quote do use Phoenix.View, - root: "lib/recycledcloud_web/templates", - namespace: RecycledCloudWeb + root: "lib/meta_web/templates", + namespace: MetaWeb # Import convenience functions from controllers import Phoenix.Controller, @@ -54,7 +54,7 @@ defmodule RecycledCloudWeb do def channel do quote do use Phoenix.Channel - import RecycledCloudWeb.Gettext + import MetaWeb.Gettext end end @@ -66,9 +66,9 @@ defmodule RecycledCloudWeb do # Import basic rendering functionality (render, render_layout, etc) import Phoenix.View - import RecycledCloudWeb.ErrorHelpers - import RecycledCloudWeb.Gettext - alias RecycledCloudWeb.Router.Helpers, as: Routes + import MetaWeb.ErrorHelpers + import MetaWeb.Gettext + alias MetaWeb.Router.Helpers, as: Routes end end diff --git a/lib/recycledcloud_web/channels/user_socket.ex b/lib/meta_web/channels/user_socket.ex similarity index 83% rename from lib/recycledcloud_web/channels/user_socket.ex rename to lib/meta_web/channels/user_socket.ex index 264ef65..d020607 100644 --- a/lib/recycledcloud_web/channels/user_socket.ex +++ b/lib/meta_web/channels/user_socket.ex @@ -1,8 +1,8 @@ -defmodule RecycledCloudWeb.UserSocket do +defmodule MetaWeb.UserSocket do use Phoenix.Socket ## Channels - # channel "room:*", RecycledCloudWeb.RoomChannel + # channel "room:*", MetaWeb.RoomChannel # Socket params are passed from the client and can # be used to verify and authenticate a user. After @@ -27,7 +27,7 @@ defmodule RecycledCloudWeb.UserSocket do # Would allow you to broadcast a "disconnect" event and terminate # all active sockets and channels for a given user: # - # RecycledCloudWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{}) + # MetaWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{}) # # Returning `nil` makes this socket anonymous. @impl true diff --git a/lib/recycledcloud_web/controllers/billing_controller.ex b/lib/meta_web/controllers/billing_controller.ex similarity index 86% rename from lib/recycledcloud_web/controllers/billing_controller.ex rename to lib/meta_web/controllers/billing_controller.ex index 4cfe757..328fc77 100644 --- a/lib/recycledcloud_web/controllers/billing_controller.ex +++ b/lib/meta_web/controllers/billing_controller.ex @@ -1,8 +1,8 @@ -defmodule RecycledCloudWeb.BillingController do - use RecycledCloudWeb, :controller +defmodule MetaWeb.BillingController do + use MetaWeb, :controller - alias RecycledCloud.Billing.{Partner, Invoice} - alias RecycledCloud.Repo + alias Meta.Billing.{Partner, Invoice} + alias Meta.Repo def current_partner(conn) do user = conn.assigns.current_user diff --git a/lib/meta_web/controllers/page_controller.ex b/lib/meta_web/controllers/page_controller.ex new file mode 100644 index 0000000..87bda33 --- /dev/null +++ b/lib/meta_web/controllers/page_controller.ex @@ -0,0 +1,7 @@ +defmodule MetaWeb.PageController do + use MetaWeb, :controller + + def index(conn, _params) do + render(conn, "index.html") + end +end diff --git a/lib/recycledcloud_web/controllers/support_controller.ex b/lib/meta_web/controllers/support_controller.ex similarity index 87% rename from lib/recycledcloud_web/controllers/support_controller.ex rename to lib/meta_web/controllers/support_controller.ex index de95cf3..f6d0345 100644 --- a/lib/recycledcloud_web/controllers/support_controller.ex +++ b/lib/meta_web/controllers/support_controller.ex @@ -1,8 +1,8 @@ -defmodule RecycledCloudWeb.SupportController do - use RecycledCloudWeb, :controller +defmodule MetaWeb.SupportController do + use MetaWeb, :controller - alias RecycledCloud.SupportRequest - alias RecycledCloud.Captcha + alias Meta.SupportRequest + alias Meta.Captcha def new(conn, _params) do {captcha_text, captcha_result} = Captcha.generate() diff --git a/lib/recycledcloud_web/controllers/user_auth.ex b/lib/meta_web/controllers/user_auth.ex similarity index 95% rename from lib/recycledcloud_web/controllers/user_auth.ex rename to lib/meta_web/controllers/user_auth.ex index ad081bd..aa3eacb 100644 --- a/lib/recycledcloud_web/controllers/user_auth.ex +++ b/lib/meta_web/controllers/user_auth.ex @@ -1,9 +1,9 @@ -defmodule RecycledCloudWeb.UserAuth do +defmodule MetaWeb.UserAuth do import Plug.Conn import Phoenix.Controller - alias RecycledCloud.Accounts - alias RecycledCloudWeb.Router.Helpers, as: Routes + alias Meta.Accounts + alias MetaWeb.Router.Helpers, as: Routes # Make the remember me cookie valid for 60 days. # If you want bump or reduce this value, also change @@ -75,7 +75,7 @@ defmodule RecycledCloudWeb.UserAuth do user_token && Accounts.delete_session_token(user_token) if live_socket_id = get_session(conn, :live_socket_id) do - RecycledCloudWeb.Endpoint.broadcast(live_socket_id, "disconnect", %{}) + MetaWeb.Endpoint.broadcast(live_socket_id, "disconnect", %{}) end conn diff --git a/lib/recycledcloud_web/controllers/user_confirmation_controller.ex b/lib/meta_web/controllers/user_confirmation_controller.ex similarity index 92% rename from lib/recycledcloud_web/controllers/user_confirmation_controller.ex rename to lib/meta_web/controllers/user_confirmation_controller.ex index 66b6021..d5dbf34 100644 --- a/lib/recycledcloud_web/controllers/user_confirmation_controller.ex +++ b/lib/meta_web/controllers/user_confirmation_controller.ex @@ -1,7 +1,7 @@ -defmodule RecycledCloudWeb.UserConfirmationController do - use RecycledCloudWeb, :controller +defmodule MetaWeb.UserConfirmationController do + use MetaWeb, :controller - alias RecycledCloud.Accounts + alias Meta.Accounts def new(conn, _params) do render(conn, "new.html") diff --git a/lib/recycledcloud_web/controllers/user_keys_controller.ex b/lib/meta_web/controllers/user_keys_controller.ex similarity index 91% rename from lib/recycledcloud_web/controllers/user_keys_controller.ex rename to lib/meta_web/controllers/user_keys_controller.ex index ee4742a..8217fca 100644 --- a/lib/recycledcloud_web/controllers/user_keys_controller.ex +++ b/lib/meta_web/controllers/user_keys_controller.ex @@ -1,7 +1,7 @@ -defmodule RecycledCloudWeb.UserKeysController do - use RecycledCloudWeb, :controller +defmodule MetaWeb.UserKeysController do + use MetaWeb, :controller - alias RecycledCloud.Accounts + alias Meta.Accounts def index(conn, %{"username" => username}) do case Accounts.get_user_by_username(username) do diff --git a/lib/recycledcloud_web/controllers/user_registration_controller.ex b/lib/meta_web/controllers/user_registration_controller.ex similarity index 83% rename from lib/recycledcloud_web/controllers/user_registration_controller.ex rename to lib/meta_web/controllers/user_registration_controller.ex index 3b6f271..5eddbb7 100644 --- a/lib/recycledcloud_web/controllers/user_registration_controller.ex +++ b/lib/meta_web/controllers/user_registration_controller.ex @@ -1,13 +1,13 @@ -defmodule RecycledCloudWeb.UserRegistrationController do - use RecycledCloudWeb, :controller +defmodule MetaWeb.UserRegistrationController do + use MetaWeb, :controller - alias RecycledCloud.Captcha - alias RecycledCloud.Accounts - alias RecycledCloud.Accounts.User - alias RecycledCloudWeb.UserAuth + alias Meta.Captcha + alias Meta.Accounts + alias Meta.Accounts.User + alias MetaWeb.UserAuth defp is_registration_enabled?() do - Application.get_env(:recycledcloud, :enable_registration) + Application.get_env(:meta, :enable_registration) end def new(conn, _params) do diff --git a/lib/recycledcloud_web/controllers/user_reset_password_controller.ex b/lib/meta_web/controllers/user_reset_password_controller.ex similarity index 93% rename from lib/recycledcloud_web/controllers/user_reset_password_controller.ex rename to lib/meta_web/controllers/user_reset_password_controller.ex index 76df16f..6a85d37 100644 --- a/lib/recycledcloud_web/controllers/user_reset_password_controller.ex +++ b/lib/meta_web/controllers/user_reset_password_controller.ex @@ -1,7 +1,7 @@ -defmodule RecycledCloudWeb.UserResetPasswordController do - use RecycledCloudWeb, :controller +defmodule MetaWeb.UserResetPasswordController do + use MetaWeb, :controller - alias RecycledCloud.Accounts + alias Meta.Accounts plug :get_user_by_reset_password_token when action in [:edit, :update] diff --git a/lib/recycledcloud_web/controllers/user_session_controller.ex b/lib/meta_web/controllers/user_session_controller.ex similarity index 78% rename from lib/recycledcloud_web/controllers/user_session_controller.ex rename to lib/meta_web/controllers/user_session_controller.ex index d91fd24..edcd1db 100644 --- a/lib/recycledcloud_web/controllers/user_session_controller.ex +++ b/lib/meta_web/controllers/user_session_controller.ex @@ -1,8 +1,8 @@ -defmodule RecycledCloudWeb.UserSessionController do - use RecycledCloudWeb, :controller +defmodule MetaWeb.UserSessionController do + use MetaWeb, :controller - alias RecycledCloud.Accounts - alias RecycledCloudWeb.UserAuth + alias Meta.Accounts + alias MetaWeb.UserAuth def new(conn, _params) do render(conn, "new.html", error_message: nil) diff --git a/lib/recycledcloud_web/controllers/user_settings_controller.ex b/lib/meta_web/controllers/user_settings_controller.ex similarity index 93% rename from lib/recycledcloud_web/controllers/user_settings_controller.ex rename to lib/meta_web/controllers/user_settings_controller.ex index e4711ba..ec73f1e 100644 --- a/lib/recycledcloud_web/controllers/user_settings_controller.ex +++ b/lib/meta_web/controllers/user_settings_controller.ex @@ -1,8 +1,8 @@ -defmodule RecycledCloudWeb.UserSettingsController do - use RecycledCloudWeb, :controller +defmodule MetaWeb.UserSettingsController do + use MetaWeb, :controller - alias RecycledCloud.Accounts - alias RecycledCloudWeb.UserAuth + alias Meta.Accounts + alias MetaWeb.UserAuth plug :assign_email_and_password_changesets diff --git a/lib/recycledcloud_web/controllers/virtual_machine_hosting_controller.ex b/lib/meta_web/controllers/virtual_machine_hosting_controller.ex similarity index 92% rename from lib/recycledcloud_web/controllers/virtual_machine_hosting_controller.ex rename to lib/meta_web/controllers/virtual_machine_hosting_controller.ex index b38775d..8560bc5 100644 --- a/lib/recycledcloud_web/controllers/virtual_machine_hosting_controller.ex +++ b/lib/meta_web/controllers/virtual_machine_hosting_controller.ex @@ -1,7 +1,7 @@ -defmodule RecycledCloudWeb.VirtualMachineHostingController do - use RecycledCloudWeb, :controller +defmodule MetaWeb.VirtualMachineHostingController do + use MetaWeb, :controller - alias RecycledCloud.OpenNebula, as: ONE + alias Meta.OpenNebula, as: ONE def index(conn, _params) do username = conn.assigns.current_user.username diff --git a/lib/recycledcloud_web/endpoint.ex b/lib/meta_web/endpoint.ex similarity index 80% rename from lib/recycledcloud_web/endpoint.ex rename to lib/meta_web/endpoint.ex index 4233dae..0169019 100644 --- a/lib/recycledcloud_web/endpoint.ex +++ b/lib/meta_web/endpoint.ex @@ -1,16 +1,16 @@ -defmodule RecycledCloudWeb.Endpoint do - use Phoenix.Endpoint, otp_app: :recycledcloud +defmodule MetaWeb.Endpoint do + use Phoenix.Endpoint, otp_app: :meta # The session will be stored in the cookie and signed, # this means its contents can be read but not tampered with. # Set :encryption_salt if you would also like to encrypt it. @session_options [ store: :cookie, - key: "_recycledcloud_key", + key: "_meta_key", signing_salt: "6k95bz+m" ] - socket "/socket", RecycledCloudWeb.UserSocket, + socket "/socket", MetaWeb.UserSocket, websocket: true, longpoll: false @@ -20,7 +20,7 @@ defmodule RecycledCloudWeb.Endpoint do # when deploying your static files in production. plug Plug.Static, at: "/", - from: :recycledcloud, + from: :meta, gzip: false, only: ~w(css fonts images js favicon.ico robots.txt) @@ -30,7 +30,7 @@ defmodule RecycledCloudWeb.Endpoint do socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket plug Phoenix.LiveReloader plug Phoenix.CodeReloader - plug Phoenix.Ecto.CheckRepoStatus, otp_app: :recycledcloud + plug Phoenix.Ecto.CheckRepoStatus, otp_app: :meta end plug Plug.RequestId @@ -44,5 +44,5 @@ defmodule RecycledCloudWeb.Endpoint do plug Plug.MethodOverride plug Plug.Head plug Plug.Session, @session_options - plug RecycledCloudWeb.Router + plug MetaWeb.Router end diff --git a/lib/recycledcloud_web/gettext.ex b/lib/meta_web/gettext.ex similarity index 84% rename from lib/recycledcloud_web/gettext.ex rename to lib/meta_web/gettext.ex index b36790b..0a9a7f6 100644 --- a/lib/recycledcloud_web/gettext.ex +++ b/lib/meta_web/gettext.ex @@ -1,11 +1,11 @@ -defmodule RecycledCloudWeb.Gettext do +defmodule MetaWeb.Gettext do @moduledoc """ A module providing Internationalization with a gettext-based API. By using [Gettext](https://hexdocs.pm/gettext), your module gains a set of macros for translations, for example: - import RecycledCloudWeb.Gettext + import MetaWeb.Gettext # Simple translation gettext("Here is the string to translate") @@ -20,5 +20,5 @@ defmodule RecycledCloudWeb.Gettext do See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. """ - use Gettext, otp_app: :recycledcloud + use Gettext, otp_app: :meta end diff --git a/lib/recycledcloud_web/router.ex b/lib/meta_web/router.ex similarity index 89% rename from lib/recycledcloud_web/router.ex rename to lib/meta_web/router.ex index 0f05658..4a48249 100644 --- a/lib/recycledcloud_web/router.ex +++ b/lib/meta_web/router.ex @@ -1,7 +1,7 @@ -defmodule RecycledCloudWeb.Router do - use RecycledCloudWeb, :router +defmodule MetaWeb.Router do + use MetaWeb, :router - import RecycledCloudWeb.UserAuth + import MetaWeb.UserAuth pipeline :browser do plug :accepts, ["html"] @@ -28,14 +28,14 @@ defmodule RecycledCloudWeb.Router do plug :accepts, ["text"] end - scope "/", RecycledCloudWeb do + scope "/", MetaWeb do pipe_through :browser get "/", PageController, :index get "/support/new", SupportController, :new end - scope "/", RecycledCloudWeb do + scope "/", MetaWeb do pipe_through :browser_with_forgery # The static recycled.cloud website POST this endpoint, which basically is @@ -43,7 +43,7 @@ defmodule RecycledCloudWeb.Router do post "/support/new", SupportController, :create end - scope "/", RecycledCloudWeb do + scope "/", MetaWeb do pipe_through :plain get "/keys/:username", UserKeysController, :index @@ -51,7 +51,7 @@ defmodule RecycledCloudWeb.Router do ## Authentication routes - scope "/", RecycledCloudWeb do + scope "/", MetaWeb do pipe_through [:browser, :redirect_if_user_is_authenticated] get "/users/register", UserRegistrationController, :new @@ -64,7 +64,7 @@ defmodule RecycledCloudWeb.Router do put "/users/reset_password/:token", UserResetPasswordController, :update end - scope "/", RecycledCloudWeb do + scope "/", MetaWeb do pipe_through [:browser, :require_authenticated_user] get "/users/settings", UserSettingsController, :edit @@ -79,7 +79,7 @@ defmodule RecycledCloudWeb.Router do get "/hosting/vm/:location/:id", VirtualMachineHostingController, :show end - scope "/", RecycledCloudWeb do + scope "/", MetaWeb do pipe_through [:browser] get "/users/log_out", UserSessionController, :delete @@ -91,7 +91,7 @@ defmodule RecycledCloudWeb.Router do # In-memory mailer for development purposes only. # See https://hexdocs.pm/bamboo/Bamboo.SentEmailViewerPlug.html for details. - if RecycledCloud.env() == :dev do + if Meta.env() == :dev do forward "/outbox", Bamboo.SentEmailViewerPlug end end diff --git a/lib/recycledcloud_web/telemetry.ex b/lib/meta_web/telemetry.ex similarity index 72% rename from lib/recycledcloud_web/telemetry.ex rename to lib/meta_web/telemetry.ex index 39c34ec..8b302ca 100644 --- a/lib/recycledcloud_web/telemetry.ex +++ b/lib/meta_web/telemetry.ex @@ -1,4 +1,4 @@ -defmodule RecycledCloudWeb.Telemetry do +defmodule MetaWeb.Telemetry do use Supervisor import Telemetry.Metrics @@ -31,11 +31,11 @@ defmodule RecycledCloudWeb.Telemetry do ), # Database Metrics - summary("recycledcloud.repo.query.total_time", unit: {:native, :millisecond}), - summary("recycledcloud.repo.query.decode_time", unit: {:native, :millisecond}), - summary("recycledcloud.repo.query.query_time", unit: {:native, :millisecond}), - summary("recycledcloud.repo.query.queue_time", unit: {:native, :millisecond}), - summary("recycledcloud.repo.query.idle_time", unit: {:native, :millisecond}), + summary("meta.repo.query.total_time", unit: {:native, :millisecond}), + summary("meta.repo.query.decode_time", unit: {:native, :millisecond}), + summary("meta.repo.query.query_time", unit: {:native, :millisecond}), + summary("meta.repo.query.queue_time", unit: {:native, :millisecond}), + summary("meta.repo.query.idle_time", unit: {:native, :millisecond}), # VM Metrics summary("vm.memory.total", unit: {:byte, :kilobyte}), @@ -49,7 +49,7 @@ defmodule RecycledCloudWeb.Telemetry do [ # A module, function and arguments to be invoked periodically. # This function must call :telemetry.execute/3 and a metric must be added above. - # {RecycledCloudWeb, :count_users, []} + # {MetaWeb, :count_users, []} ] end end diff --git a/lib/recycledcloud_web/templates/billing/index.html.eex b/lib/meta_web/templates/billing/index.html.eex similarity index 100% rename from lib/recycledcloud_web/templates/billing/index.html.eex rename to lib/meta_web/templates/billing/index.html.eex diff --git a/lib/recycledcloud_web/templates/layout/_sidebar_nav.html.eex b/lib/meta_web/templates/layout/_sidebar_nav.html.eex similarity index 100% rename from lib/recycledcloud_web/templates/layout/_sidebar_nav.html.eex rename to lib/meta_web/templates/layout/_sidebar_nav.html.eex diff --git a/lib/recycledcloud_web/templates/layout/app.html.eex b/lib/meta_web/templates/layout/app.html.eex similarity index 85% rename from lib/recycledcloud_web/templates/layout/app.html.eex rename to lib/meta_web/templates/layout/app.html.eex index 780756e..83a2b72 100644 --- a/lib/recycledcloud_web/templates/layout/app.html.eex +++ b/lib/meta_web/templates/layout/app.html.eex @@ -4,7 +4,7 @@ -