Initial Commit

This commit is contained in:
red 2025-03-04 09:51:26 -05:00
commit 0ec5aa83d5
8 changed files with 506 additions and 0 deletions

33
pleroma/Dockerfile Normal file
View file

@ -0,0 +1,33 @@
FROM alpine
ARG HOME=/opt/pleroma
ENV HOME=${HOME}
ARG DATA=/var/lib/pleroma
ENV DATA=${DATA}
RUN wget 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=amd64-musl' -O /tmp/pleroma.zip
RUN unzip /tmp/pleroma.zip -d /tmp/
RUN apk update && \
apk add exiftool ffmpeg vips libmagic ncurses postgresql-client
RUN adduser --system --shell /bin/false --home ${HOME} pleroma &&\
mkdir -p ${DATA} &&\
chown -R pleroma ${DATA} &&\
mkdir -p /etc/pleroma &&\
chown -R pleroma /etc/pleroma &&\
mv /tmp/release/* ${HOME} &&\
chown -R pleroma ${HOME}
RUN rm -r /tmp/release
RUN rm /tmp/pleroma.zip
USER pleroma
COPY --chmod=0764 --chown=pleroma ./static-files/ /static-files/
COPY --chmod=0640 --chown=pleroma ./docker.exs /etc/pleroma/config.exs
COPY --chmod=0755 ./docker-entrypoint.sh ${HOME}
EXPOSE 4000
ENTRYPOINT ["/opt/pleroma/docker-entrypoint.sh"]

15
pleroma/docker-entrypoint.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/ash
set -e
mkdir -p ${DATA}/uploads && mkdir -p ${DATA}/static
cp -rf /static-files/* ${DATA}/static
echo "-- Waiting for database..."
while ! pg_isready -U ${DB_USER:-pleroma} -d postgres://${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-pleroma} -t 1; do sleep 1s; done;
echo $DB_PASSWORD
echo "-- Running migrations..."
$HOME/bin/pleroma_ctl migrate
echo "-- Starting!"
exec $HOME/bin/pleroma start

78
pleroma/docker.exs Normal file
View file

@ -0,0 +1,78 @@
# Pleroma instance configuration
# NOTE: This file should not be committed to a repo or otherwise made public
# without removing sensitive information.
import Config
config :pleroma, Pleroma.Web.Endpoint,
url: [host: System.get_env("DOMAIN", "localhost"), scheme: "https", port: 443],
http: [ip: {0, 0, 0, 0}, port: 4000],
secret_key_base: System.get_env("SECRET_KEY_BASE"),
signing_salt: System.get_env("SIGNING_SALT")
config :pleroma, :instance,
name: System.get_env("INSTANCE_NAME", "Pleroma"),
email: System.get_env("ADMIN_EMAIL"),
notify_email: System.get_env("NOTIFY_EMAIL"),
limit: 5000,
registrations_open: false,
invites_enabled: true,
healthcheck: true
config :pleroma, :media_proxy,
enabled: false,
redirect_on_failure: true
#base_url: "https://cache.pleroma.social"
config :pleroma, Pleroma.Repo,
adapter: Ecto.Adapters.Postgres,
username: System.get_env("DB_USER", "pleroma"),
password: System.get_env("DB_PASS"),
database: System.get_env("DB_NAME", "pleroma"),
hostname: System.get_env("DB_HOST", "db")
# Configure web push notifications
config :web_push_encryption, :vapid_details,
subject: "mailto:#{System.get_env("NOTIFY_EMAIL")}",
public_key: System.get_env("WEB_PUSH_PUBLIC_KEY"),
private_key: System.get_env("WEB_PUSH_PRIVATE_KEY")
config :pleroma, :database, rum_enabled: false
config :pleroma, :instance, static_dir: "/var/lib/pleroma/static"
config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads"
# Enable Strict-Transport-Security once SSL is working:
# config :pleroma, :http_security,
# sts: true
# Configure S3 support if desired.
# The public S3 endpoint (base_url) is different depending on region and provider,
# consult your S3 provider's documentation for details on what to use.
#
# config :pleroma, Pleroma.Upload,
# uploader: Pleroma.Uploaders.S3,
# base_url: "https://s3.amazonaws.com"
#
# config :pleroma, Pleroma.Uploaders.S3,
# bucket: "some-bucket",
# bucket_namespace: "my-namespace",
# truncated_namespace: nil,
# streaming_enabled: true
#
# Configure S3 credentials:
# config :ex_aws, :s3,
# access_key_id: "xxxxxxxxxxxxx",
# secret_access_key: "yyyyyyyyyyyy",
# region: "us-east-1",
# scheme: "https://"
#
# For using third-party S3 clones like wasabi, also do:
# config :ex_aws, :s3,
# host: "s3.wasabisys.com"
config :joken, default_signer: System.get_env("DEFAULT_SIGNER")
config :pleroma, configurable_from_database: false
config :pleroma, Pleroma.Upload, filters: [Pleroma.Upload.Filter.Exiftool.StripLocation, Pleroma.Upload.Filter.Dedupe]

View file

@ -0,0 +1,22 @@
<div>
<p>
Please email me if you want an account. Service is beta quality at best
for now, and work is ongoing. You either already know my email address,
or you can find it in the instance's nodeinfo.
</p>
<ul>
<li>Do not violate United States law.</li>
<li>Do not engage in pedophile/pro-pedophile activity.</li>
<li>Do not cause problems for this site on purpose:
<ul>
<li>
No fedposting.
</li>
<li>
Phonebooking is technically legal in the United States, but
be smart about your post scope, please and thanks.
</li>
</ul>
</li>
</ul>
</div>