aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2020-07-16 08:52:14 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2020-10-15 22:28:49 +0300
commit14054cd004d91e89644c31d61b08d50ff0df09dd (patch)
treeb27039c20c6d584b393043bd23e6fda11640e6e8
parent20e68b30f08e0e0eae691dcf541968e344efdaae (diff)
downloadpleroma-14054cd004d91e89644c31d61b08d50ff0df09dd.tar.gz
update task messages
-rwxr-xr-xinstallation/init.d/pleroma1
-rw-r--r--lib/mix/tasks/pleroma/release_env.ex32
2 files changed, 23 insertions, 10 deletions
diff --git a/installation/init.d/pleroma b/installation/init.d/pleroma
index 384536f7e..e908cda1b 100755
--- a/installation/init.d/pleroma
+++ b/installation/init.d/pleroma
@@ -8,6 +8,7 @@ pidfile="/var/run/pleroma.pid"
directory=/opt/pleroma
healthcheck_delay=60
healthcheck_timer=30
+export $(cat /opt/pleroma/config/pleroma.env)
: ${pleroma_port:-4000}
diff --git a/lib/mix/tasks/pleroma/release_env.ex b/lib/mix/tasks/pleroma/release_env.ex
index cbbbdeff6..63030c5cc 100644
--- a/lib/mix/tasks/pleroma/release_env.ex
+++ b/lib/mix/tasks/pleroma/release_env.ex
@@ -23,14 +23,15 @@ defmodule Mix.Tasks.Pleroma.ReleaseEnv do
]
)
- env_path =
+ file_path =
get_option(
options,
:path,
"Environment file path",
- "config/pleroma.env"
+ "./config/pleroma.env"
)
- |> Path.expand()
+
+ env_path = Path.expand(file_path)
proceed? =
if File.exists?(env_path) do
@@ -45,13 +46,24 @@ defmodule Mix.Tasks.Pleroma.ReleaseEnv do
end
if proceed? do
- do_generate(env_path)
+ case do_generate(env_path) do
+ {:error, reason} ->
+ shell_error(
+ File.Error.message(%{action: "write to file", reason: reason, path: env_path})
+ )
- shell_info(
- "The file generated: #{env_path}.\nTo use the enviroment file need to add the line ';EnvironmentFile=#{
- env_path
- }' in service file (/installation/pleroma.service)."
- )
+ _ ->
+ shell_info("\nThe file generated: #{env_path}.\n")
+
+ shell_info("""
+ WARNING: before start pleroma app please to made the file read-only and non-modifiable.
+ Example:
+ chmod 0444 #{file_path}
+ chattr +i #{file_path}
+ """)
+ end
+ else
+ shell_info("\nThe file is exist. #{env_path}.\n")
end
end
@@ -59,6 +71,6 @@ defmodule Mix.Tasks.Pleroma.ReleaseEnv do
content = "RELEASE_COOKIE=#{Base.encode32(:crypto.strong_rand_bytes(32))}"
File.mkdir_p!(Path.dirname(path))
- File.write!(path, content)
+ File.write(path, content)
end
end