Compare commits
2 commits
ecc3953bf1
...
0c2777eb12
Author | SHA1 | Date | |
---|---|---|---|
0c2777eb12 | |||
6ed5abc17d |
2 changed files with 4 additions and 5 deletions
|
@ -16,13 +16,11 @@ config :nulla, Nulla.Repo,
|
||||||
# The watchers configuration can be used to run external
|
# The watchers configuration can be used to run external
|
||||||
# watchers to your application. For example, we can use it
|
# watchers to your application. For example, we can use it
|
||||||
# to bundle .js and .css sources.
|
# to bundle .js and .css sources.
|
||||||
host = System.get_env("PHX_HOST") || "example.com"
|
|
||||||
port = String.to_integer(System.get_env("PORT") || "4000")
|
port = String.to_integer(System.get_env("PORT") || "4000")
|
||||||
|
|
||||||
config :nulla, NullaWeb.Endpoint,
|
config :nulla, NullaWeb.Endpoint,
|
||||||
# Binding to loopback ipv4 address prevents access from other machines.
|
# Binding to loopback ipv4 address prevents access from other machines.
|
||||||
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
|
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
|
||||||
url: [host: host, port: port],
|
|
||||||
http: [ip: {127, 0, 0, 1}, port: port],
|
http: [ip: {127, 0, 0, 1}, port: port],
|
||||||
check_origin: false,
|
check_origin: false,
|
||||||
code_reloader: true,
|
code_reloader: true,
|
||||||
|
|
|
@ -2,6 +2,7 @@ defmodule NullaWeb.ActorController do
|
||||||
use NullaWeb, :controller
|
use NullaWeb, :controller
|
||||||
alias Nulla.ActivityPub
|
alias Nulla.ActivityPub
|
||||||
alias Nulla.Models.Actor
|
alias Nulla.Models.Actor
|
||||||
|
alias Nulla.Models.Relation
|
||||||
alias Nulla.Models.Note
|
alias Nulla.Models.Note
|
||||||
alias Nulla.Models.InstanceSettings
|
alias Nulla.Models.InstanceSettings
|
||||||
|
|
||||||
|
@ -22,17 +23,17 @@ defmodule NullaWeb.ActorController do
|
||||||
|> put_resp_content_type("application/activity+json")
|
|> put_resp_content_type("application/activity+json")
|
||||||
|> send_resp(200, Jason.encode!(ActivityPub.actor(actor)))
|
|> send_resp(200, Jason.encode!(ActivityPub.actor(actor)))
|
||||||
else
|
else
|
||||||
|
following = Relation.count_following(actor.id)
|
||||||
|
followers = Relation.count_followers(actor.id)
|
||||||
notes = Note.get_latest_notes(actor.id)
|
notes = Note.get_latest_notes(actor.id)
|
||||||
following = 0
|
|
||||||
followers = 0
|
|
||||||
|
|
||||||
render(
|
render(
|
||||||
conn,
|
conn,
|
||||||
:show,
|
:show,
|
||||||
actor: actor,
|
actor: actor,
|
||||||
notes: notes,
|
|
||||||
following: following,
|
following: following,
|
||||||
followers: followers,
|
followers: followers,
|
||||||
|
notes: notes,
|
||||||
layout: false
|
layout: false
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue