From: Christian Heller Date: Wed, 26 Feb 2020 00:01:50 +0000 (+0100) Subject: Improve Pleroma compile script. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/process?a=commitdiff_plain;h=1747130e42eb346a024808db24c71fbee98cb442;p=config Improve Pleroma compile script. --- diff --git a/buster/setup_scripts/setup_pleroma_source.sh b/buster/setup_scripts/setup_pleroma_source.sh index 6c0d153..57989a1 100755 --- a/buster/setup_scripts/setup_pleroma_source.sh +++ b/buster/setup_scripts/setup_pleroma_source.sh @@ -16,18 +16,13 @@ config_tree_prefix="${HOME}/config/buster" ./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" web nft -f /etc/nftables.conf -# Set up letsencrypt certificate. TODO: Is it auto-renewed? -ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default -certbot --nginx --agree-tos --redirect --no-eff-email -m "${mail}" -d "${domain}" -rm /etc/nginx/sites-enabled/default - # Prepare user. -adduser --system --group --shell /bin/false --home /opt/pleroma pleroma +adduser --system --group --shell /bin/false --home /var/lib/pleroma pleroma # TODO: integrate this into apt-mark/pleroma apt -y install build-essential #elixir erlang-dev erlang-tools erlang-parsetools erlang-eldap erlang-ssh erlang-xmerl build-essential # Not listed by doc. -apt -y install wget #erlang-inets erlnag-erlware-commons +apt -y install wget gnupg #erlang-inets erlnag-erlware-commons wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb dpkg -i /tmp/erlang-solutions_1.0_all.deb @@ -41,7 +36,7 @@ su pleroma -s $SHELL -lc 'mix local.hex --force' su pleroma -s $SHELL -lc 'mix local.rebar --force' su pleroma -s $SHELL -lc 'mix deps.get' su pleroma -s $SHELL -lc "mix pleroma.instance gen \ ---output /etc/pleroma/config.exs \ +--output config/generated_config.exs \ --output-psql /tmp/setup_db.psql \ --domain ${domain} \ --instance-name plom-roma \ @@ -50,6 +45,7 @@ su pleroma -s $SHELL -lc "mix pleroma.instance gen \ --dbhost localhost \ --dbname pleroma \ --dbuser pleroma \ +--db-configurable N \ --rum N \ --indexable N \ --uploads-dir /var/lib/pleroma/uploads \ @@ -58,11 +54,17 @@ su pleroma -s $SHELL -lc "mix pleroma.instance gen \ --listen-port 4000 \ --dbpass $(pwgen -s 100 1)" su pleroma -s $SHELL -lc 'mv config/{generated_config.exs,prod.secret.exs}' -su postgrs -s $SHELL -lc 'psql -f /opt/pleroma/config/setup_db.psql' +su postgres -s $SHELL -lc 'psql -f /tmp/setup_db.psql' su pleroma -s $SHELL -lc 'MIX_ENV=prod mix ecto.migrate' -su pleroma -s $SHELL -lc 'MIX_ENV=prod mix phx.server' +#su pleroma -s $SHELL -lc 'MIX_ENV=prod mix phx.server' # TODO: config customization, single-pixel hack, info panel, TOS +# config dev.secret.exs + +# Set up letsencrypt certificate. TODO: Is it auto-renewed? +ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default +certbot --nginx --agree-tos --redirect --no-eff-email -m "${mail}" -d "${domain}" +rm /etc/nginx/sites-enabled/default # Prepare NGINX config for Pleroma. cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.nginx