logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

config.md (3256B)


  1. # Transferring the config to/from the database
  2. {! backend/administration/CLI_tasks/general_cli_task_info.include !}
  3. ## Transfer config from file to DB.
  4. !!! note
  5. You need to add the following to your config before executing this command:
  6. ```elixir
  7. config :pleroma, configurable_from_database: true
  8. ```
  9. === "OTP"
  10. ```sh
  11. ./bin/pleroma_ctl config migrate_to_db
  12. ```
  13. === "From Source"
  14. ```sh
  15. mix pleroma.config migrate_to_db
  16. ```
  17. ## Transfer config from DB to `config/env.exported_from_db.secret.exs`
  18. !!! note
  19. In-Database configuration will still be applied after executing this command unless you set the following in your config:
  20. ```elixir
  21. config :pleroma, configurable_from_database: false
  22. ```
  23. Options:
  24. - `<path>` - where to save migrated config. E.g. `--path=/tmp`. If file saved into non-standard folder, you must manually copy file into directory where Pleroma can read it. For OTP install path will be `PLEROMA_CONFIG_PATH` or `/etc/pleroma`. For installation from source - `config` directory in the pleroma folder.
  25. - `<env>` - environment, for which is migrated config. By default is `prod`.
  26. - To delete transferred settings from database optional flag `-d` can be used
  27. === "OTP"
  28. ```sh
  29. ./bin/pleroma_ctl config migrate_from_db [--env=<env>] [-d] [--path=<path>]
  30. ```
  31. === "From Source"
  32. ```sh
  33. mix pleroma.config migrate_from_db [--env=<env>] [-d] [--path=<path>]
  34. ```
  35. ## Dump all of the config settings defined in the database
  36. === "OTP"
  37. ```sh
  38. ./bin/pleroma_ctl config dump
  39. ```
  40. === "From Source"
  41. ```sh
  42. mix pleroma.config dump
  43. ```
  44. ## List individual configuration groups in the database
  45. === "OTP"
  46. ```sh
  47. ./bin/pleroma_ctl config groups
  48. ```
  49. === "From Source"
  50. ```sh
  51. mix pleroma.config groups
  52. ```
  53. ## Dump the saved configuration values for a specific group or key
  54. e.g., this shows all the settings under `config :pleroma`
  55. === "OTP"
  56. ```sh
  57. ./bin/pleroma_ctl config dump pleroma
  58. ```
  59. === "From Source"
  60. ```sh
  61. mix pleroma.config dump pleroma
  62. ```
  63. To get values under a specific key:
  64. e.g., this shows all the settings under `config :pleroma, :instance`
  65. === "OTP"
  66. ```sh
  67. ./bin/pleroma_ctl config dump pleroma instance
  68. ```
  69. === "From Source"
  70. ```sh
  71. mix pleroma.config dump pleroma instance
  72. ```
  73. ## Delete the saved configuration values for a specific group or key
  74. e.g., this deletes all the settings under `config :tesla`
  75. === "OTP"
  76. ```sh
  77. ./bin/pleroma_ctl config delete [--force] tesla
  78. ```
  79. === "From Source"
  80. ```sh
  81. mix pleroma.config delete [--force] tesla
  82. ```
  83. To delete values under a specific key:
  84. e.g., this deletes all the settings under `config :phoenix, :stacktrace_depth`
  85. === "OTP"
  86. ```sh
  87. ./bin/pleroma_ctl config delete [--force] phoenix stacktrace_depth
  88. ```
  89. === "From Source"
  90. ```sh
  91. mix pleroma.config delete [--force] phoenix stacktrace_depth
  92. ```
  93. ## Remove all settings from the database
  94. This forcibly removes all saved values in the database.
  95. === "OTP"
  96. ```sh
  97. ./bin/pleroma_ctl config [--force] reset
  98. ```
  99. === "From Source"
  100. ```sh
  101. mix pleroma.config [--force] reset
  102. ```