Skip to content

fixing funkwhale #358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tfgrid3/funkwhale/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Expose ports for HTTP access
EXPOSE 5000
EXPOSE 80

# Command to run Zinit in the container
CMD ["/sbin/zinit", "init", "--container"]
32 changes: 21 additions & 11 deletions tfgrid3/funkwhale/scripts/start-fk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -ex
# Check if FUNKWHALE_VERSION is set, if not, default to 1.4.0
FUNKWHALE_VERSION=${FUNKWHALE_VERSION:-1.4.0}

# Create and Change to Funkwhale directory
mkdir /srv/funkwhale/
# Change to Funkwhale directory
mkdir -p /srv/funkwhale/
cd /srv/funkwhale/

# Download the Docker Compose and environment files for the specified version
Expand All @@ -21,26 +21,36 @@ sed -i "s#^DJANGO_SECRET_KEY=.*#DJANGO_SECRET_KEY=$DJANGO_SECRET#" .env

# Add environment variables to the .env file
sed -i "s#^FUNKWHALE_VERSION=.*#FUNKWHALE_VERSION=$FUNKWHALE_VERSION#" .env
sed -i "s#^FUNKWHALE_HOSTNAME=.*#FUNKWHALE_HOSTNAME=$Domain#" .env
sed -i 's/^FUNKWHALE_API_IP=.*/FUNKWHALE_API_IP=0.0.0.0/' .env
sed -i "s#^FUNKWHALE_HOSTNAME=.*#FUNKWHALE_HOSTNAME=$domain#" .env
sed -i "s#^FUNKWHALE_HOSTNAME=.*#FUNKWHALE_HOSTNAME=$FUNKWHALE_HOSTNAME#" .env
sed -i "s#^FUNKWHALE_API_IP=.*#FUNKWHALE_API_IP=0.0.0.0#" .env
sed -i 's/^FUNKWHALE_API_PORT=.*/FUNKWHALE_API_PORT=80/' .env

# Setting SMTP Config
bash /usr/local/bin/configure-smtp.sh
# Pull the latest Docker images for Funkwhale
docker-compose pull

# Start PSQL service
docker-compose up -d postgres

# Waiting for postgres to be ready
echo "[INFO] Waiting for PostgreSQL to be ready..."
until docker-compose exec -T postgres pg_isready -U funkwhale > /dev/null 2>&1; do
echo "[INFO] PostgreSQL not ready yet. Retrying in 5s..."
sleep 5
done

echo "[SUCCESS] PostgreSQL is ready. Continuing..."

# Run database migrations
docker-compose run --rm api funkwhale-manage migrate

# Create a superuser using the provided credentials
docker-compose run --rm -T api funkwhale-manage fw users create --superuser <<EOF
$FUNKWHALE_SUPERUSER_NAME
$FUNKWHALE_SUPERUSER_PASSWORD
$FUNKWHALE_SUPERUSER_EMAIL
EOF
USER_INPUT=$(printf "%s\n%s\n%s" \
"$FUNKWHALE_SUPERUSER_NAME" \
"$FUNKWHALE_SUPERUSER_PASSWORD" \
"$FUNKWHALE_SUPERUSER_EMAIL")

echo "$USER_INPUT" | docker-compose run --rm -T api funkwhale-manage fw users create --superuser

# Start Funkwhale services
docker-compose up -d
Loading