- Keyword.get(options, :dbpass) ||
- case Mix.shell().prompt(
- "What is the password used to connect to your database? [autogenerated]"
- ) do
- "\n" -> :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
- dbpass -> dbpass |> String.trim()
- end
+ get_option(
+ options,
+ :dbpass,
+ "What is the password used to connect to your database?",
+ :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64),
+ "autogenerated"
+ )
+
+ rum_enabled =
+ get_option(
+ options,
+ :rum,
+ "Would you like to use RUM indices?",
+ "n"
+ ) === "y"
+
+ listen_port =
+ get_option(
+ options,
+ :listen_port,
+ "What port will the app listen to (leave it if you are using the default setup with nginx)?",
+ 4000
+ )
+
+ listen_ip =
+ get_option(
+ options,
+ :listen_ip,
+ "What ip will the app listen to (leave it if you are using the default setup with nginx)?",
+ "127.0.0.1"
+ )
+
+ uploads_dir =
+ get_option(
+ options,
+ :uploads_dir,
+ "What directory should media uploads go in (when using the local uploader)?",
+ Config.get([Pleroma.Uploaders.Local, :uploads])
+ )
+ |> Path.expand()
+
+ static_dir =
+ get_option(
+ options,
+ :static_dir,
+ "What directory should custom public files be read from (custom emojis, frontend bundle overrides, robots.txt, etc.)?",
+ Config.get([:instance, :static_dir])
+ )
+ |> Path.expand()
+
+ strip_uploads =
+ get_option(
+ options,
+ :strip_uploads,
+ "Do you want to strip location (GPS) data from uploaded images? (y/n)",
+ "y"
+ ) === "y"
+
+ anonymize_uploads =
+ get_option(
+ options,
+ :anonymize_uploads,
+ "Do you want to anonymize the filenames of uploads? (y/n)",
+ "n"
+ ) === "y"
+
+ dedupe_uploads =
+ get_option(
+ options,
+ :dedupe_uploads,
+ "Do you want to deduplicate uploaded files? (y/n)",
+ "n"
+ ) === "y"
+
+ Config.put([:instance, :static_dir], static_dir)