...
 
Commits (2)
......@@ -8,12 +8,13 @@
"version": "2.5.2",
"healthCheckPath": "/about",
"httpPort": 8000,
"memoryLimit": 536870912,
"memoryLimit": 671088640,
"addons": {
"localstorage": {},
"postgresql": {},
"redis": {},
"sendmail": {}
"sendmail": {},
"ldap": {}
},
"minBoxVersion": "1.8.1",
"manifestVersion": 1,
......
......@@ -28,6 +28,9 @@ RUN git init && \
git fetch --depth=1 origin $(git ls-remote --tags | grep refs/tags | grep -v 'rc[0-9]*$' | cut -f2 | sort -V | tail -n 1 | cut -d '/' -f3-) && \
git checkout FETCH_HEAD
COPY patches /app/code/patches
RUN for patch in /app/code/patches/*; do patch -N -p0 < $patch; done
RUN bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test && \
yarn install --pure-lockfile
......@@ -41,6 +44,8 @@ RUN SECRET_KEY_BASE=insecure.secret_key_base OTP_SECRET=insecure.otp_secret \
RUN ln -fs /app/data/.env.production /app/code/.env.production
RUN ln -fs /app/data/bullet.log /app/code/log/bullet.log
RUN ln -fs /app/data/system /app/code/public/system
RUN rm -rf /app/code/tmp && ln -fs /tmp /app/code/tmp
CMD /app/code/start.sh
COPY nginx.conf /etc/nginx/sites-enabled/mastodon
......
......@@ -20,6 +20,7 @@ services:
tmpfs:
- /run
- /tmp
read_only: true
postgres:
image: postgres
environment:
......
......@@ -10,7 +10,7 @@ DB_PORT="${POSTGRESQL_PORT:-"5432"}"
DB_NAME="${POSTGRESQL_DATABASE:-"mastodon"}"
DB_USER="${POSTGRESQL_USERNAME:-"mastodon"}"
DB_PASS="${POSTGRESQL_PASSWORD:-"mastodon"}"
DATABASE_URL="${POSTGRESQL_URL:-"postgresql://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}"}"
DATABASE_URL="${POSTGRESQL_URL:-"postgresql://${POSTGRESQL_USERNAME:-"mastodon"}:${POSTGRESQL_PASSWORD:-"mastodon"}@${POSTGRESQL_HOST:-"localhost"}:${POSTGRESQL_PORT:-"5432"}/${POSTGRESQL_DATABASE:-"mastodon"}"}"
REDIS_HOST="${REDIS_HOST:-"localhost"}"
REDIS_PORT="${REDIS_PORT:-"6379"}"
......@@ -30,7 +30,8 @@ LDAP_PORT=${LDAP_PORT}
LDAP_BASE=${LDAP_USERS_BASE_DN}
LDAP_BIND_DN=${LDAP_BIND_DN}
LDAP_PASSWORD=${LDAP_BIND_PASSWORD}
LDAP_UID=mail
LDAP_UID=username
LDAP_SEARCH_FILTER=(|(%{uid}=%{email})(mail=%{email}))
# the following is generated by start.sh
END
......
Index: lib/devise/ldap_authenticatable.rb
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- lib/devise/ldap_authenticatable.rb (date 1539296558000)
+++ lib/devise/ldap_authenticatable.rb (date 1540988096000)
@@ -12,10 +12,6 @@
host: Devise.ldap_host,
port: Devise.ldap_port,
base: Devise.ldap_base,
- encryption: {
- method: Devise.ldap_method,
- tls_options: tls_options,
- },
auth: {
method: :simple,
username: Devise.ldap_bind_dn,
......@@ -2,20 +2,24 @@
echo "=>Configuring mastodon<="
bash /app/code/mastodon.env.template > /app/data/.env.production
if ! [ -f /app/data/.keys.env ]; then
if ! [ -d /app/data/system ]; then
echo "=>First run, generating keys and setting up the DB<="
export RANDFILE=/app/data/.rnd
echo -e "SECRET_KEY_BASE=$(openssl rand -hex 64)\nOTP_SECRET=$(openssl rand -hex 64)" > /app/data/.keys.env
source /app/data/.keys.env
HOME=/app/data bundle exec rake mastodon:webpush:generate_vapid_key >> /app/data/.keys.env
export RANDFILE=/tmp/.rnd
echo -e "SECRET_KEY_BASE=$(openssl rand -hex 64)\nOTP_SECRET=$(openssl rand -hex 64)" | \
tee /app/data/.keys.env >> /app/data/.env.production
HOME=/app/data bundle exec rake mastodon:webpush:generate_vapid_key | \
tee -a /app/data/.keys.env >> /app/data/.env.production
SAFETY_ASSURED=1 HOME=/app/data bundle exec rails db:schema:load db:seed
# the app writes to the following dirs:
mkdir -p /app/data/system && chown cloudron:cloudron /app/data/system
fi
cat /app/data/.keys.env >> /app/data/.env.production
else
cat /app/data/.keys.env >> /app/data/.env.production
fi
echo "=>Starting mastodon<="
......