[Bugfix] Improve OPML route security (#535)

* WIP - moved plugs; set up a new token-protected route plug

* Added a route_token column to settings model

* Hooked up token_protected_route plug to database

* Hooked up new OPML route to UI; turned RSS and OPML feed buttons into links

* Docs, tests

* Added a note about the phoenix bug
This commit is contained in:
Kieran
2024-12-30 17:40:23 -08:00
committed by GitHub
parent 246ca3b299
commit f51b219860
12 changed files with 295 additions and 158 deletions
@@ -0,0 +1,11 @@
defmodule Pinchflat.Repo.Migrations.AddRouteTokenToSettings do
use Ecto.Migration
def change do
alter table(:settings) do
add :route_token, :string, null: false, default: "tmp-token"
end
execute "UPDATE settings SET route_token = gen_random_uuid();", "SELECT 1;"
end
end