소스 검색

update task messages

chore/update-floki-find-usage
Maksim Pechnikov 3 년 전
부모
커밋
4e0e19a706
2개의 변경된 파일23개의 추가작업 그리고 10개의 파일을 삭제
  1. +1
    -0
      installation/init.d/pleroma
  2. +22
    -10
      lib/mix/tasks/pleroma/release_env.ex

+ 1
- 0
installation/init.d/pleroma 파일 보기

@@ -8,6 +8,7 @@ pidfile="/var/run/pleroma.pid"
directory=/opt/pleroma directory=/opt/pleroma
healthcheck_delay=60 healthcheck_delay=60
healthcheck_timer=30 healthcheck_timer=30
export $(cat /opt/pleroma/config/pleroma.env)


: ${pleroma_port:-4000} : ${pleroma_port:-4000}




+ 22
- 10
lib/mix/tasks/pleroma/release_env.ex 파일 보기

@@ -23,14 +23,15 @@ defmodule Mix.Tasks.Pleroma.ReleaseEnv do
] ]
) )


env_path =
file_path =
get_option( get_option(
options, options,
:path, :path,
"Environment file path", "Environment file path",
"config/pleroma.env"
"./config/pleroma.env"
) )
|> Path.expand()

env_path = Path.expand(file_path)


proceed? = proceed? =
if File.exists?(env_path) do if File.exists?(env_path) do
@@ -45,13 +46,24 @@ defmodule Mix.Tasks.Pleroma.ReleaseEnv do
end end


if proceed? do 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
end end


@@ -59,6 +71,6 @@ defmodule Mix.Tasks.Pleroma.ReleaseEnv do
content = "RELEASE_COOKIE=#{Base.encode32(:crypto.strong_rand_bytes(32))}" content = "RELEASE_COOKIE=#{Base.encode32(:crypto.strong_rand_bytes(32))}"


File.mkdir_p!(Path.dirname(path)) File.mkdir_p!(Path.dirname(path))
File.write!(path, content)
File.write(path, content)
end end
end end

불러오는 중...
취소
저장