Browse Source
Fixes the caching problem and configuration madness. Startup on a migrated database takes about 1 to 3 seconds instead of minutes now. I don't know what went through my head when building the old stuff. Let's just pretend all commits up until here never happended. We good? nice~pull/5/head

8 changed files with 85 additions and 220 deletions
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
use Mix.Config |
||||
|
||||
# pleroma/pleroma/pleroma are the default credentials for the |
||||
# managed database container. "db" is the default interlinked hostname. |
||||
# You shouldn't need to change this unless you modifed .env |
||||
config :pleroma, Pleroma.Repo, |
||||
adapter: Ecto.Adapters.Postgres, |
||||
username: "pleroma", |
||||
password: "pleroma", |
||||
database: "pleroma", |
||||
hostname: "db", |
||||
pool_size: 10 |
||||
|
||||
# vvv Your awesome config options go here vvv |
@ -1,110 +0,0 @@
@@ -1,110 +0,0 @@
|
||||
version: 1 |
||||
|
||||
# |
||||
# Pleroma settings |
||||
# |
||||
# You can enter any config in here that you want. |
||||
# Pleroma-Docker will try to translate it into elixir for you. |
||||
# |
||||
# <T> is a special member for modifying the YAML->Elixir translation. |
||||
# When set to `Array` it causes the generation of a "keyed array" literal instead |
||||
# of multiple named parameters to `config`. |
||||
# |
||||
# <D> is a special prefix that causes a string to be passed <D>irectly without quoting. |
||||
# Useful for referencing modules like Ecto adapters or other symbols that are usually wrapped in yaml. |
||||
# |
||||
# Remember to take a look at your config with `./pleroma config`. |
||||
# |
||||
|
||||
app: |
||||
# The loglevel to use in pleroma. |
||||
:logger: |
||||
level: <D>:info |
||||
|
||||
:pleroma: |
||||
Pleroma.Repo: |
||||
# Credentials for your database. |
||||
# You should leave this as-is if you want to use the managed db container. |
||||
hostname: db |
||||
username: pleroma |
||||
password: pleroma |
||||
database: pleroma |
||||
pool_size: 16 |
||||
adapter: <D>Ecto.Adapters.Postgres |
||||
|
||||
Pleroma.Web.Endpoint: |
||||
# Location where your instance will be reachable. |
||||
url: |
||||
<T>: Array |
||||
scheme: https |
||||
host: coolsite.moe |
||||
port: 443 |
||||
|
||||
# Base for your secret keys. |
||||
# Better make this random. |
||||
secret_key_base: asdf0815 |
||||
|
||||
Pleroma.Upload: |
||||
# Where to store your uploads. |
||||
# You should probably leave this as-is. |
||||
# /uploads will be mounted into ::docker::datadir. |
||||
uploads: /uploads |
||||
|
||||
# Remove metadata from uploads? |
||||
strip_exif: true |
||||
|
||||
:chat: |
||||
# Enable chat functionality? |
||||
enabled: true |
||||
|
||||
:media_proxy: |
||||
# Enable the proxy? |
||||
enabled: true |
||||
|
||||
# Emit a 302 to the original resource when uncached? |
||||
redirect_on_failure: true |
||||
|
||||
# Where your proxy is reachable |
||||
base_url: https://media.coolsite.moe |
||||
|
||||
:instance: |
||||
# The name of your instance. |
||||
name: super cool stuff club |
||||
|
||||
# Short description of your instance |
||||
description: we do super cool stuff in super cool stuff club |
||||
|
||||
# The admin's email address. |
||||
email: admin@coolsite.moe |
||||
|
||||
# How many chars a notice may have at max. |
||||
limit: 4096 |
||||
|
||||
# May new members sign up? |
||||
registrations_open: true |
||||
|
||||
# Allow connections to other instances? |
||||
# (Turn this off for testing) |
||||
federating: true |
||||
|
||||
# The rewrite policies / quarantines to enable. |
||||
# This is a powerful feature which should be used with care. |
||||
# Take a look at https://git.pleroma.social/pleroma/pleroma/wikis/Message%20rewrite%20facility%20configuration%20(how%20to%20block%20instances). |
||||
# Then uncomment only the things you really need |
||||
|
||||
# quarantined_instances: |
||||
# - badguys.moe |
||||
|
||||
# rewrite_policy: |
||||
# - Pleroma.Web.ActivityPub.MRF.SimplePolicy |
||||
|
||||
# :mrf_simple: |
||||
# media_removal: |
||||
# - illegalporn.biz |
||||
# media_nsfw: |
||||
# - porn.biz |
||||
# - porn.business |
||||
# reject: |
||||
# - spam.com |
||||
# federated_timeline_removal: |
||||
# - spam.university |
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
use Mix.Config |
||||
|
||||
# pleroma/pleroma/pleroma are the default credentials for the |
||||
# managed database container. "db" is the default interlinked hostname. |
||||
# You shouldn't need to change this unless you modifed .env |
||||
config :pleroma, Pleroma.Repo, |
||||
adapter: Ecto.Adapters.Postgres, |
||||
username: "pleroma", |
||||
password: "pleroma", |
||||
database: "pleroma", |
||||
hostname: "db", |
||||
pool_size: 10 |
||||
|
||||
# vvv Your awesome config options go here vvv |
@ -1,59 +0,0 @@
@@ -1,59 +0,0 @@
|
||||
#!/usr/bin/env ruby |
||||
|
||||
# |
||||
# TODO: Write a better translator. |
||||
# This is just rough text replacement right now |
||||
# but it's already way better than the exs stuff |
||||
# we had durin the .env files. |
||||
# |
||||
|
||||
require 'yaml' |
||||
require 'json' |
||||
|
||||
def getval(val) |
||||
if val.is_a?(String) |
||||
val.start_with?('<D>') ? val.delete('<D>') : val.to_json() |
||||
else |
||||
val.to_json() |
||||
end |
||||
end |
||||
|
||||
config = YAML.load_file(ARGV[0]) |
||||
|
||||
if config["version"] != 1 |
||||
raise "Incompatible config version (#{config["version"]} != 1)" |
||||
end |
||||
|
||||
buf = "use Mix.Config\n\n" |
||||
|
||||
config["app"].each do |atom, content| |
||||
content.each do |sub, settings| |
||||
buf += "config :#{atom}, #{sub.is_a?(Symbol) ? ":#{sub}" : sub}" |
||||
|
||||
if !settings.is_a?(Hash) |
||||
buf += ": #{getval(settings)}\n" |
||||
next |
||||
end |
||||
|
||||
settings.each do |name, value| |
||||
if value.is_a?(Hash) && value["<T>"] == "Array" |
||||
value.delete("<T>") |
||||
|
||||
buf += ", #{name}: [" |
||||
|
||||
value.each do |k, v| |
||||
buf += "#{k}: #{getval(v)}," |
||||
end |
||||
buf.chop!() |
||||
|
||||
buf += "]" |
||||
else |
||||
buf += ", #{name}: #{getval(value)}" |
||||
end |
||||
end |
||||
|
||||
buf += "\n" |
||||
end |
||||
end |
||||
|
||||
puts buf |
Loading…
Reference in new issue