From 649528517313ac2d0097cc0ffa8250ff48f411b2 Mon Sep 17 00:00:00 2001 From: sn0w Date: Sun, 20 Jan 2019 02:13:51 +0100 Subject: [PATCH] Add cp command --- config.dist.exs | 2 +- pleroma | 49 ++++++++++++++++++++++++++++++------------------- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/config.dist.exs b/config.dist.exs index 1e5a268..d5b477e 100644 --- a/config.dist.exs +++ b/config.dist.exs @@ -18,7 +18,7 @@ config :pleroma, Pleroma.Repo, # Uncomment what you need or delete it all. # # Want to use the config generator instead? -# Try `./pleroma mix pleroma.instance gen` and then `./pleroma cp conf/generated_config.exs config.exs`. +# Try `./pleroma mix pleroma.instance gen` and then `./pleroma cp /home/pleroma/pleroma/config/generated_config.exs config.exs`. # # Need some inspiration? # Take a look at https://git.pleroma.social/pleroma/pleroma/tree/develop/config diff --git a/pleroma b/pleroma index 2cb4d60..8631c47 100755 --- a/pleroma +++ b/pleroma @@ -270,6 +270,13 @@ action__mod() { fi } +action__cp() { + container="$(docker_compose ps -q server)" + + echo "$container:$1 -> $2" + docker cp "$container:$1" "$2" +} + ######################################################### # Help # ######################################################### @@ -282,36 +289,40 @@ Usage: $0 [action] [action-args...] Actions: - build (Re)build the pleroma container. + build (Re)build the pleroma container. - dump Dump the generated docker-compose.yml to stdout. + dump Dump the generated docker-compose.yml to stdout. - debug [bin] [args...] Launches a new pleroma container but uses \$bin instead of phx.server as entrypoint. - **Warning**: This is intended for debugging pleroma with tools like :debugger and :observer. - It thus forwards your X-Server into docker and temporarily fiddles with your xhost - access controls. If this is a security concern for you, please export NO_X_FORWARDING=1 - before launching a debugger session. + debug [bin] [args...] Launches a new pleroma container but uses \$bin instead of phx.server as entrypoint. + **Warning**: This is intended for debugging pleroma with tools like :debugger and :observer. + It thus forwards your X-Server into docker and temporarily fiddles with your xhost + access controls. If this is a security concern for you, please export NO_X_FORWARDING=1 + before launching a debugger session. - enter Spawn a shell inside the container for debugging/maintenance. - This command does not link to the postgres container. - If you need that use #debug instead. + enter Spawn a shell inside the container for debugging/maintenance. + This command does not link to the postgres container. + If you need that use #debug instead. - logs Show the current container logs. + logs Show the current container logs. - mix [task] [args...] Run a mix task without entering the container. + mix [task] [args...] Run a mix task without entering the container. - mod [file] Creates the file in custom.d and downloads the content from pleroma.social. - The download respects your \$PLEROMA_VERSION from .env. + mod [file] Creates the file in custom.d and downloads the content from pleroma.social. + The download respects your \$PLEROMA_VERSION from .env. - passthrough / p [...] Pass any custom command to docker-compose. + passthrough / p [...] Pass any custom command to docker-compose. - restart Executes #stop and #start respectively. + restart Executes #stop and #start respectively. - start / up Start pleroma and sibling services. + start / up Start pleroma and sibling services. - stop / down Stop pleroma and sibling services. + stop / down Stop pleroma and sibling services. - status / ps Show the current container status. + status / ps Show the current container status. + + copy / cp [source] [target] Copy a file from your pc to the pleroma container. + This operation only works in one direction. + For making permanent changes to the container use custom.d. Environment: DEBUG can be used to modify the loglevel.