diff --git a/.env.dev b/.env.dev index f13026e26..39f64d03f 100644 --- a/.env.dev +++ b/.env.dev @@ -12,3 +12,9 @@ MUSIC_DIRECTORY_PATH=/music BROWSABLE_API_ENABLED=True FORWARDED_PROTO=http LDAP_ENABLED=False + +# Uncomment this if you're using traefik/https +# FORCE_HTTPS_URLS=True + +# Customize to your needs +POSTGRES_VERSION=11 diff --git a/.gitignore b/.gitignore index 398338166..e62b1ce62 100644 --- a/.gitignore +++ b/.gitignore @@ -93,4 +93,6 @@ po/*.po docs/swagger _build front/src/translations.json +front/src/translations/*.json front/locales/en_US/LC_MESSAGES/app.po +*.prof diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e930ccc76..bbe1bd02f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,8 @@ variables: IMAGE_NAME: funkwhale/funkwhale IMAGE: $IMAGE_NAME:$CI_COMMIT_REF_NAME - IMAGE_LATEST: $IMAGE_NAME:latest + ALL_IN_ONE_IMAGE_NAME: funkwhale/all-in-one + ALL_IN_ONE_IMAGE: $ALL_IN_ONE_IMAGE_NAME:$CI_COMMIT_REF_NAME PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache" PYTHONDONTWRITEBYTECODE: "true" REVIEW_DOMAIN: preview.funkwhale.audio @@ -131,16 +132,15 @@ flake8: test_api: services: - - postgres:9.4 + - postgres:11 - redis:3 stage: test - image: funkwhale/funkwhale:latest + image: funkwhale/funkwhale:develop cache: key: "$CI_PROJECT_ID__pip_cache" paths: - "$PIP_CACHE_DIR" variables: - DJANGO_ALLOWED_HOSTS: "localhost" DATABASE_URL: "postgresql://postgres@postgres/postgres" FUNKWHALE_URL: "https://funkwhale.ci" DJANGO_SETTINGS_MODULE: config.settings.local @@ -148,11 +148,10 @@ test_api: - branches before_script: - cd api - - apt-get update - - grep "^[^#;]" requirements.apt | grep -Fv "python3-dev" | xargs apt-get install -y --no-install-recommends - - pip install -r requirements/base.txt - - pip install -r requirements/local.txt - - pip install -r requirements/test.txt + - sed -i '/Pillow/d' requirements/base.txt + - pip3 install -r requirements/base.txt + - pip3 install -r requirements/local.txt + - pip3 install -r requirements/test.txt script: - pytest --cov=funkwhale_api tests/ tags: @@ -166,7 +165,7 @@ test_front: only: - branches script: - - yarn install + - yarn install --check-files - yarn test:unit cache: key: "funkwhale__front_dependencies" @@ -194,11 +193,6 @@ build_front: # cf https://dev.funkwhale.audio/funkwhale/funkwhale/issues/169 - yarn build | tee /dev/stderr | (! grep -i 'ERROR in') - chmod -R 755 dist - cache: - key: "funkwhale__front_dependencies" - paths: - - front/node_modules - - front/yarn.lock artifacts: name: "front_${CI_COMMIT_REF_NAME}" paths: @@ -207,6 +201,7 @@ build_front: - tags@funkwhale/funkwhale - master@funkwhale/funkwhale - develop@funkwhale/funkwhale + tags: - docker @@ -236,9 +231,11 @@ pages: docker_release: stage: deploy + image: bash before_script: - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD - cp -r front/dist api/frontend + - (if [ "$CI_COMMIT_REF_NAME" == "develop" ]; then ./scripts/set-api-build-metadata.sh $(echo $CI_COMMIT_SHA | cut -c 1-8); fi); - cd api script: - docker build -t $IMAGE . @@ -249,15 +246,42 @@ docker_release: tags: - docker-build +docker_all_in_one_release: + stage: deploy + image: bash + variables: + ALL_IN_ONE_REF: master + ALL_IN_ONE_ARTIFACT_URL: https://github.com/thetarkus/docker-funkwhale/archive/$ALL_IN_ONE_REF.zip + BUILD_PATH: all_in_one + before_script: + - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD + - (if [ "$CI_COMMIT_REF_NAME" == "develop" ]; then ./scripts/set-api-build-metadata.sh $(echo $CI_COMMIT_SHA | cut -c 1-8); fi); + script: + - wget $ALL_IN_ONE_ARTIFACT_URL -O all_in_one.zip + - unzip -o all_in_one.zip -d tmpdir + - mv tmpdir/docker-funkwhale-$ALL_IN_ONE_REF $BUILD_PATH && rmdir tmpdir + - cp -r api $BUILD_PATH/src/api + - cp -r front $BUILD_PATH/src/front + - cd $BUILD_PATH + - ./scripts/download-nginx-template.sh src/ $CI_COMMIT_REF_NAME + - docker build -t $ALL_IN_ONE_IMAGE . + - docker push $ALL_IN_ONE_IMAGE + only: + - develop@funkwhale/funkwhale + - tags@funkwhale/funkwhale + tags: + - docker-build + build_api: # Simply publish a zip containing api/ directory stage: deploy - image: busybox + image: bash artifacts: name: "api_${CI_COMMIT_REF_NAME}" paths: - api script: + - (if [ "$CI_COMMIT_REF_NAME" == "develop" ]; then ./scripts/set-api-build-metadata.sh $(echo $CI_COMMIT_SHA | cut -c 1-8); fi); - chmod -R 750 api - echo Done! only: diff --git a/.gitlab/issue_templates/Bug.md b/.gitlab/issue_templates/Bug.md index 967186030..aa8893527 100644 --- a/.gitlab/issue_templates/Bug.md +++ b/.gitlab/issue_templates/Bug.md @@ -34,6 +34,12 @@ Describe the expected behaviour. ## Context + + +**Funkwhale version(s) affected**: x.y + + + + diff --git a/front/public/index.html b/front/public/index.html index e6232290b..7b09feaf0 100644 --- a/front/public/index.html +++ b/front/public/index.html @@ -11,7 +11,7 @@
diff --git a/front/public/settings.json b/front/public/settings.json index 133fb5672..6264b12cf 100644 --- a/front/public/settings.json +++ b/front/public/settings.json @@ -1,3 +1,6 @@ { - "additionalStylesheets": ["/custom.css"] + "additionalStylesheets": [ + "/front/custom.css" + ], + "defaultServerUrl": null } diff --git a/front/scripts/i18n-compile.sh b/front/scripts/i18n-compile.sh index 955913393..eb4e9970a 100755 --- a/front/scripts/i18n-compile.sh +++ b/front/scripts/i18n-compile.sh @@ -1,3 +1,9 @@ #!/bin/bash -eux -locales=$(tail -n +2 src/locales.js | sed -e 's/export default //' | jq '.locales[].code' | xargs echo) -find locales -name '*.po' | xargs $(yarn bin)/gettext-compile --output src/translations.json +locales=$(tail -n +2 src/locales.js | sed -e 's/export default //' | jq '.locales[].code' | grep -v 'en_US' | xargs echo) +mkdir -p src/translations + +for locale in $locales; do + $(yarn bin)/gettext-compile locales/$locale/LC_MESSAGES/app.po --output src/translations/$locale.json +done + +# find locales -name '*.po' | xargs $(yarn bin)/gettext-compile --output src/translations.json diff --git a/front/src/App.vue b/front/src/App.vue index 16154b130..2ce3ba3ed 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -1,20 +1,34 @@ diff --git a/front/src/Embed.vue b/front/src/Embed.vue new file mode 100644 index 000000000..7987b054a --- /dev/null +++ b/front/src/Embed.vue @@ -0,0 +1,565 @@ + + + + + diff --git a/front/src/assets/audio/default-cover.png b/front/src/assets/audio/default-cover.png index 86aa7acbd..a583124e2 100644 Binary files a/front/src/assets/audio/default-cover.png and b/front/src/assets/audio/default-cover.png differ diff --git a/front/src/assets/embed/default-cover.jpeg b/front/src/assets/embed/default-cover.jpeg new file mode 100644 index 000000000..3eb05a40a Binary files /dev/null and b/front/src/assets/embed/default-cover.jpeg differ diff --git a/front/src/components/About.vue b/front/src/components/About.vue index 438fed67d..cfffb7b6a 100644 --- a/front/src/components/About.vue +++ b/front/src/components/About.vue @@ -1,6 +1,6 @@ + diff --git a/front/src/components/Home.vue b/front/src/components/Home.vue index 3448d10df..800f77b9f 100644 --- a/front/src/components/Home.vue +++ b/front/src/components/Home.vue @@ -1,6 +1,6 @@ - - - diff --git a/front/src/components/PageNotFound.vue b/front/src/components/PageNotFound.vue index 115bc5d02..ef4e66f45 100644 --- a/front/src/components/PageNotFound.vue +++ b/front/src/components/PageNotFound.vue @@ -1,6 +1,6 @@ - - - diff --git a/front/src/components/ShortcutsModal.vue b/front/src/components/ShortcutsModal.vue new file mode 100644 index 000000000..2338658dd --- /dev/null +++ b/front/src/components/ShortcutsModal.vue @@ -0,0 +1,95 @@ + + + + + + diff --git a/front/src/components/Sidebar.vue b/front/src/components/Sidebar.vue index efd6f416c..3a5bf2db8 100644 --- a/front/src/components/Sidebar.vue +++ b/front/src/components/Sidebar.vue @@ -1,6 +1,6 @@