- `--anonymize-uploads <Y|N>` - randomize uploaded filenames
- `--dedupe-uploads <Y|N>` - store files based on their hash to reduce data storage requirements if duplicates are uploaded with different filenames
- `--skip-release-env` - skip generation the release environment file
+- `--release-env-file` - release environment file path
strip_uploads: :string,
anonymize_uploads: :string,
dedupe_uploads: :string,
- skip_release_env: :boolean
+ skip_release_env: :boolean,
+ release_env_file: :string
],
aliases: [
o: :output,
""")
else
shell_info("Generation the environment file:")
- Mix.Tasks.Pleroma.ReleaseEnv.run(["gen"])
+
+ release_env_args =
+ with path when not is_nil(path) <- Keyword.get(options, :release_env_file) do
+ ["gen", "--path", path]
+ else
+ _ -> ["gen"]
+ end
+
+ Mix.Tasks.Pleroma.ReleaseEnv.run(release_env_args)
end
shell_info(
defmodule Mix.Tasks.Pleroma.InstanceTest do
use ExUnit.Case
+ @release_env_file "./test/pleroma.test.env"
+
setup do
File.mkdir_p!(tmp_path())
File.rm_rf(Path.join(static_dir, "robots.txt"))
end
+ if File.exists?(@release_env_file), do: File.rm_rf(@release_env_file)
+
Pleroma.Config.put([:instance, :static_dir], static_dir)
end)
"--dedupe-uploads",
"n",
"--anonymize-uploads",
- "n"
+ "n",
+ "--release-env-file",
+ @release_env_file
])
end
assert generated_config =~ "filters: [Pleroma.Upload.Filter.ExifTool]"
assert File.read!(tmp_path() <> "setup.psql") == generated_setup_psql()
assert File.exists?(Path.expand("./test/instance/static/robots.txt"))
+ assert File.exists?(@release_env_file)
+
+ assert File.read!(@release_env_file) =~ ~r/^RELEASE_COOKIE=.*/
end
defp generated_setup_psql do