pentacent / keila

Open Source Newsletter Tool.
https://keila.io
GNU Affero General Public License v3.0
1.26k stars 61 forks source link

Docker changes for image upload? #171

Closed flinthamm closed 1 year ago

flinthamm commented 1 year ago

Using https://hub.docker.com/r/pentacent/keila TAG: 0.10.0

Cannot get new image uploads to work with Docker/Postgres setup, presumable a volume needs to be specified or is image storage BLOB or similar held in database?

The image upload button in the editor gets as far as allowing selection of a file to upload and displays the selected filename but then when the "Start Upload" button is selected, it just disappears. There is no mention of any changes or environment variables for this new feature in the documentation or other issues that I can see?

The log generates: 09:18:36.408 [error] GenServer #PID<0.2662.0> terminating keila_1 | ** (KeyError) key :dir not found in: [serve: true] keila_1 | (elixir 1.12.3) lib/keyword.ex:420: Keyword.fetch!/2 keila_1 | (keila 0.9.0) lib/keila/files/storage_adapters/local.ex:53: Keila.Files.StorageAdapters.Local.get_dir/0 keila_1 | (keila 0.9.0) lib/keila/files/storage_adapters/local.ex:20: Keila.Files.StorageAdapters.Local.store/2 keila_1 | (keila 0.9.0) lib/keila/files/files.ex:30: Keila.Files.store_file/3 keila_1 | (phoenix_live_view 0.17.11) lib/phoenix_live_view/upload_channel.ex:21: Phoenix.LiveView.UploadChannel.consume/3 keila_1 | (elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2 keila_1 | (keila 0.9.0) lib/keila_web/components/file_manager_live.ex:33: KeilaWeb.FileManagerLiveComponent.handle_event/3 keila_1 | (phoenix_live_view 0.17.11) lib/phoenix_live_view/channel.ex:600: anonymous fn/4 in Phoenix.LiveView.Channel.inner_component_handle_event/4 keila_1 | Last message: %Phoenix.Socket.Message{event: "event", join_ref: "4", payload: %{"cid" => 1, "event" => "upload", "type" => "form", "value" => ""}, ref: "16", topic: "lv:phx-FzJ1xJ-X9A2x1QbB"}

The log shows "keila 0.9.0" but this is 0.10.0. otherwise the image upload would not be available but presumably this is merely a label that's not updated.

Can someone confirm what might need to change, perhaps a database upgrade and/or directory mapping in Docker? Thank you

wmnnd commented 1 year ago

Thank you for reporting this issue! This is a bug that I’ve just fixed in 4fe0c2619fd9f7a8d2e771e3994aef0fd543f2cc now. You should have seen a warning when starting Keila though that you didn’t configure a path for the uploads.

Until the new Docker image is out, you can simply specify USER_CONTENT_DIR (which, as you've already mentioned, should ideally point to a volume to make sure your data is persisted).

wmnnd commented 1 year ago

P.S.: Thanks for pointing out the issue in the docs as well, I’ve now updated them: https://www.keila.io/docs/configuration