forked from rapidez/rapidez
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:rapidez/rapidez
- Loading branch information
Showing
21 changed files
with
312 additions
and
95 deletions.
There are no files selected for viewing
Empty file.
13 changes: 13 additions & 0 deletions
13
.docker/elasticsearch/entrypoints/set-rapidez-user-password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#! /bin/sh | ||
# Set the username and password for the web user. | ||
if [ x${ELASTIC_PASSWORD} == x ]; then | ||
echo "Set the ELASTICSEARCH_PASS environment variable in the .env file"; | ||
exit 1; | ||
elif [ x${ELASTICSEARCH_RAPIDEZ_PASS} == x ]; then | ||
echo "Set the ELASTICSEARCH_RAPIDEZ_PASS environment variable in the .env file"; | ||
exit 1; | ||
fi; | ||
echo "Setting passwords"; | ||
until curl -s -X POST "localhost:9200/_security/role/web?pretty" -u "elastic:${ELASTIC_PASSWORD}" -H "Content-Type: application/json" -d'{"indices": [{"names": [ "rapidez_*" ],"privileges": ["read"]}]}' | grep "^{"; do sleep 10; done; | ||
until curl -s -X POST "localhost:9200/_security/user/web?pretty" -u "elastic:${ELASTIC_PASSWORD}" -H "Content-Type: application/json" -d'{"password" : "${ELASTICSEARCH_RAPIDEZ_PASS}","roles" : [ "web" ]}' | grep "^{"; do sleep 10; done; | ||
echo "All done!"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#! /bin/bash | ||
# In the docker container any script within the /entrypoints folder will be executed | ||
# Just make sure your script does not run blocking. | ||
# Ff it does, make sure you watch $ENTRYPOINT_PID if it exits the container should shut down, and so should your script | ||
|
||
($@) & | ||
export ENTRYPOINT_PID=$!; | ||
ENTRYPOINT_PIDS=(); | ||
|
||
shopt -s nullglob; | ||
for entrypoint in /entrypoints/*; do | ||
chmod +x $entrypoint; | ||
$entrypoint & | ||
ENTRYPOINT_PIDS+=($!); | ||
done; | ||
shopt -u nullglob; | ||
|
||
ENTRYPOINT_PIDS+=($ENTRYPOINT_PID); | ||
|
||
for pid in ${ENTRYPOINT_PIDS[@]}; do | ||
wait ${pid}; | ||
exitcode=$?; | ||
if [[ $exitcode != 0 ]]; then | ||
# Exit when any process fails | ||
exit $exitcode; | ||
fi; | ||
done; | ||
|
||
# Exit with the last exit code (entrypoint) | ||
exit $exitcode; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#! /bin/bash | ||
|
||
if [[ x${MAGENTO_ADMIN_USER} == x ]]; then | ||
echo "MAGENTO_ADMIN_USER missing, skipping admin creation. You can login as exampleuser examplepassword123"; | ||
exit 0; | ||
elif [[ x${MAGENTO_ADMIN_PASSWORD} == x ]]; then | ||
echo "MAGENTO_ADMIN_PASSWORD missing, skipping admin creation. You can login as exampleuser examplepassword123"; | ||
exit 0; | ||
fi; | ||
for i in {1..60}; do | ||
[[ `ps -aux | grep 'mysqld' | wc -l` -ge 3 ]] && break || sleep 5; | ||
done; | ||
sleep 10; | ||
# Delete exampleuser | ||
magerun2 admin:user:delete exampleuser -f; | ||
# Create admin password | ||
magerun2 admin:user:create --admin-user='${MAGENTO_ADMIN_USER}' --admin-password='${MAGENTO_ADMIN_PASSWORD}' --admin-email='${MAGENTO_ADMIN_EMAIL:[email protected]}' --admin-firstname='${MAGENTO_ADMIN_FIRSTNAME:-admin}' --admin-lastname='${MAGENTO_ADMIN_LASTNAME:-admin}'; | ||
# Change admin password in case of password change. | ||
magerun2 admin:user:change-password '${MAGENTO_ADMIN_USER}' '${MAGENTO_ADMIN_PASSWORD}'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#! /bin/sh | ||
|
||
magerun2 module:disable Magento_JwtUserToken Magento_AdobeStockAdminUi Magento_AdminAdobeIms Magento_TwoFactorAuth |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: "Push Docker Container" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Additional tag to push' | ||
required: false | ||
schedule: | ||
- cron: '0 10 * * 1' | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
ghcr.io/rapidez/rapidez | ||
tags: | | ||
type=ref,event=branch | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }} | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,32 @@ | ||
FROM php:8.1-fpm-alpine | ||
|
||
LABEL maintainer="Rapidez" | ||
LABEL org.opencontainers.image.source=https://github.com/rapidez/rapidez | ||
LABEL org.opencontainers.image.url=https://rapidez.io | ||
LABEL org.opencontainers.image.documentation=https://docs.rapidez.io | ||
LABEL org.opencontainers.image.vendor="Rapidez" | ||
LABEL org.opencontainers.image.description="Headless Magento - with Laravel, Vue and Reactive Search" | ||
LABEL org.opencontainers.image.licenses="GPL-3.0" | ||
|
||
ARG WWWGROUP | ||
|
||
WORKDIR /var/www/html | ||
|
||
RUN docker-php-ext-enable sodium | ||
RUN docker-php-ext-install exif pdo pdo_mysql | ||
RUN apk add --update libpng-dev jpeg-dev libwebp-dev freetype-dev libmcrypt-dev gd-dev jpegoptim optipng pngquant gifsicle \ | ||
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \ | ||
&& docker-php-ext-configure opcache --enable-opcache \ | ||
&& docker-php-ext-enable sodium \ | ||
&& docker-php-ext-install exif pdo pdo_mysql gd opcache \ | ||
&& php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \ | ||
&& apk add --update nodejs npm yarn \ | ||
&& echo "* * * * * cd /var/www/html && php artisan schedule:run" > /etc/crontabs/www-data | ||
|
||
RUN php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \ | ||
&& apk add --update nodejs npm yarn | ||
|
||
RUN composer create-project rapidez/rapidez . \ | ||
COPY . /var/www/html/ | ||
RUN chown www-data:www-data -R /var/www/html | ||
USER www-data | ||
RUN composer install \ | ||
&& php -r "file_exists('.env') || copy('.env.example', '.env');" \ | ||
&& sed -i -E 's/((APP|MAGENTO|ELASTICSEARCH)_(URL|HOST)=.*)/# \1/g' .env \ | ||
&& sed -i 's/protected $proxies;/protected $proxies = ["127.0.0.1\/8","172.17.0.0\/14"];/g' app/Http/Middleware/TrustProxies.php \ | ||
&& php artisan rapidez:install \ | ||
&& yarn && yarn run prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
import "Vendor/rapidez/core/resources/js/app.js"; | ||
import "Vendor/rapidez/account/resources/js/callbacks.js"; | ||
import "Vendor/rapidez/wishlist/resources/js/wishlist.js"; | ||
import './components.js' | ||
|
||
import.meta.glob([ | ||
// Automatically import all installed Rapidez module scripts. | ||
'Vendor/rapidez/*/resources/js/package.js', | ||
// To exclude a specific file add the path with a !: (https://vitejs.dev/guide/features.html#negative-patterns) | ||
// '!Vendor/rapidez/account/resources/js/package.js', | ||
// Or to load all js files from another vendor: (https://vitejs.dev/guide/features.html#multiple-patterns) | ||
// 'Vendor/<vendor>/*/resources/js/package.js', | ||
], { eager: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(() => { | ||
const components = { | ||
// Eager load all components not containing an extra . in the name | ||
...import.meta.glob(['./components/**/*([^\.]).vue'], { eager: true, import: 'default' }), | ||
// Lazy load all components not ending with .lazy.vue | ||
...import.meta.glob(['./components/**/*.lazy.vue'], { eager: false, import: 'default' }) | ||
}; | ||
for (const path in components) { | ||
let componentName = path | ||
.split('/').pop() // Remove directories | ||
.split('.').shift() // Remove extension | ||
.replace(/^.|[A-Z]/g, letter => `-${letter.toLowerCase()}`) // PascalCase to snake_case | ||
.substr(1) // Remove the starting dash | ||
|
||
// Register component using their filename. | ||
Vue.component(componentName, components[path]) | ||
} | ||
})(); |
Oops, something went wrong.