Skip to content
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

Vaddy追加 #6070

Merged
merged 48 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bfec2b9
一時的にactionsを削除
kiy0taka Jan 16, 2023
ea48f89
temp
kiy0taka Jan 16, 2023
1b4ebfd
mail -> mailcatcher
kiy0taka Jan 16, 2023
f810056
20.24
kiy0taka Feb 6, 2023
b11f7f8
20.04
kiy0taka Feb 6, 2023
c7a12d9
Remove Azure from apt sources
kiy0taka Feb 6, 2023
12b9846
scan
kiy0taka Feb 6, 2023
11f832c
scan2
kiy0taka Feb 7, 2023
d808725
scan3
kiy0taka Feb 7, 2023
01ce555
scan4
kiy0taka Feb 7, 2023
730eaf9
disable rate limit
kiy0taka Feb 13, 2023
b1c480c
remove workaround
kiy0taka Feb 13, 2023
a2a4f18
setup plugins
kiy0taka Feb 13, 2023
3bc131a
scan2
kiy0taka Feb 13, 2023
71c84b5
scan2
kiy0taka Feb 14, 2023
4552bfa
@vaddy -> @group vaddy
kiy0taka Feb 14, 2023
1e8bd13
scan3
kiy0taka Feb 14, 2023
66f8c66
scan1
kiy0taka Jun 6, 2023
e84709c
scan 1.5
kiy0taka Jun 7, 2023
4094055
scan2
kiy0taka Jun 8, 2023
6119179
scan3
kiy0taka Jun 8, 2023
28cda26
scan4
kiy0taka Jun 9, 2023
435cf9c
VAddyのソース取り込み
dotani1111 Oct 4, 2023
221a86b
admin01を動かしてみる
dotani1111 Oct 4, 2023
4c75287
fix
dotani1111 Oct 4, 2023
8308ae4
admin01,admin02,frontを試してみる。
dotani1111 Oct 4, 2023
02f8e8e
Merge branch '4.2' into dev/vaddy42
dotani1111 Oct 11, 2023
a224051
不要テスト削除
dotani1111 Oct 11, 2023
5425f8d
テスト2回目
dotani1111 Oct 12, 2023
2c90d2b
テスト3回目
dotani1111 Oct 12, 2023
66c30d5
テスト4回目
dotani1111 Oct 13, 2023
6b272b2
テスト漏れ
dotani1111 Oct 16, 2023
0f2172a
Merge branch '4.2' into dev/vaddy42
dotani1111 Oct 23, 2023
6dce40c
追加されたVAddy以外のテストを削除
dotani1111 Oct 23, 2023
64878d3
テストの実行1
dotani1111 Oct 23, 2023
d2b5f0f
テストの実行2
dotani1111 Oct 23, 2023
a54750b
テストの実行3
dotani1111 Oct 23, 2023
ca3fca8
テストの実行4
dotani1111 Oct 24, 2023
e71c215
テストの実行5
dotani1111 Oct 24, 2023
c9d521e
テストの実行6
dotani1111 Oct 24, 2023
30fd20c
再々Vaddyの実行1
dotani1111 Oct 26, 2023
ae5fc2e
再々Vaddyの実行2
dotani1111 Oct 26, 2023
b0cbb7a
再々Vaddyの実行3
dotani1111 Oct 26, 2023
16b1057
再々Vaddyの実行4
dotani1111 Oct 27, 2023
fccabda
テストを分割して実施する1
dotani1111 Oct 30, 2023
13ebabe
テストを分割して実施する2
dotani1111 Oct 30, 2023
33494d0
Merge branch '4.2' into dev/vaddy42
dotani1111 Dec 12, 2023
1c531d6
add:削除したテストを復活
dotani1111 Dec 12, 2023
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
161 changes: 161 additions & 0 deletions .github/workflows/vaddy/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: 'Prepare VAddy'
on:
workflow_call:

inputs:
vaddy-verification-code:
description: 'VAddy verification code'
required: true
type: string
vaddy-fqdn:
description: 'VAddy FQDN'
required: true
type: string
vaddy-user:
description: 'VAddy USER'
required: true
type: string
vaddy-auth-key:
description: 'VAddy AUTH key'
required: true
type: string

runs:
using: "composite"
steps:

- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: '7.4'

- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master

- name: Install fonts
shell: bash
run: sudo apt install fonts-noto

- name: "VAddy: install"
working-directory: /tmp
shell: bash
run: |
wget -q https://github.com/vaddy/go-vaddy/archive/master.zip
unzip master.zip
echo 'export VADDY_AUTH_KEY="${{ inputs.vaddy-auth-key }}"
export VADDY_FQDN="${{ inputs.vaddy-fqdn }}"
export VADDY_VERIFICATION_CODE="${{ inputs.vaddy-verification-code }}"
export VADDY_USER="${{ inputs.vaddy-user }}"
export VADDY_YOUR_LOCAL_IP="127.0.0.1"
export VADDY_YOUR_LOCAL_PORT="8080"
export VADDY_HTTPS_PROXY=""' > go-vaddy-master/privatenet/conf/vaddy.conf
mkdir -p ${HOME}/.ssh
echo 'Host *.vaddy.net
StrictHostKeyChecking no' >> ${HOME}/.ssh/config

- name: Get Composer Cache Directory
id: composer-cache
shell: bash
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

- name: "EC-CUBE: setup"
shell: bash
env:
DATABASE_URL: postgres://postgres:[email protected]:5432/eccube_db
DATABASE_SERVER_VERSION: 14
run: |
composer install --no-scripts --no-dev --no-interaction --optimize-autoloader --no-plugins
php bin/template_jp.php
rm -rf app/Plugin/*
echo '<?php
namespace Eccube\Doctrine\EventSubscriber;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Events;
class CancelDeletionEventSubscriber implements EventSubscriber
{
public function getSubscribedEvents()
{
return [Events::preRemove];
}
public function preRemove(LifecycleEventArgs $event)
{
$event->getEntityManager()->detach($event->getEntity());
}
}' > src/Eccube/Doctrine/EventSubscriber/CancelDeletionEventSubscriber.php
sed -i.bak -e 's_$fs->remove_// $fs->remove_' src/Eccube/Controller/Admin/Content/PageController.php
rm -f app/config/eccube/packages/dev/web_profiler.yaml
sed -i -e "s/eccube_login_throttling_max_attempts: 5/eccube_login_throttling_max_attempts: 1024/" -e "s/eccube_login_throttling_interval: '30 minutes'/eccube_login_throttling_interval: '1 minutes'/" app/config/eccube/packages/eccube.yaml
rm -f app/config/eccube/packages/prod/eccube_rate_limiter.yaml
sed -i -e 's/30 min/1 min/g' app/config/eccube/packages/eccube_rate_limiter.yaml
bin/console cache:clear
bin/console debug:container --parameter eccube_login_throttling_max_attempts
bin/console debug:container --parameter eccube_login_throttling_interval
bin/console debug:config eccube
bin/console doctrine:database:create --env=dev
bin/console doctrine:schema:create --env=dev
bin/console eccube:fixtures:load --env=dev
chmod -R 777 html

- name: Setup Plugins
shell: bash
env:
APP_ENV: 'prod'
DATABASE_URL: postgres://postgres:[email protected]:5432/eccube_db
DATABASE_SERVER_VERSION: 14
PGPASSWORD: 'password'
run: |
bin/console eccube:composer:require "ec-cube/recommend42"
bin/console eccube:composer:require "ec-cube/coupon42"
bin/console eccube:composer:require "ec-cube/mailmagazine42"
bin/console eccube:composer:require "ec-cube/salesreport42"
bin/console eccube:composer:require "ec-cube/relatedproduct42"
bin/console eccube:composer:require "ec-cube/securitychecker42"
bin/console eccube:composer:require "ec-cube/productreview42"
bin/console eccube:composer:require "ec-cube/api42"
bin/console eccube:composer:require "ec-cube/sitekit42"
psql eccube_db -h 127.0.0.1 -U postgres -c "select id,name,code,0 as enabled,version,source,0 as initialized,'2021-08-13 00:00:00' as create_date,'2021-08-13 00:00:00' as update_date,discriminator_type from dtb_plugin;" -A -F, --pset footer > src/Eccube/Resource/doctrine/import_csv/ja/dtb_plugin.csv

- name: "EC-CUBE: package"
shell: bash
working-directory: ../
run: ${{ github.event.repository.name }}/package.sh

- name: "EC-CUBE: build"
shell: bash
run: docker build -t ec-cube .

- name: "Codeception: prepare"
shell: bash
run: |
echo "APP_ENV=codeception" > .env
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
echo ">>> Started chrome-driver"
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
composer install --no-scripts --no-interaction --optimize-autoloader
sudo echo "127.0.0.1 ${{ inputs.vaddy-fqdn }}" | sudo tee -a /etc/hosts
echo "modules:
config:
WebDriver:
host: '127.0.0.1'
port: 9515
url: "http://${{ inputs.vaddy-fqdn }}:8080"
browser: chrome
capabilities:
chromeOptions:
args: ["--headless", "--disable-gpu"]
prefs:
download.default_directory: '%PWD%/codeception/_support/_downloads'
MailCatcher:
url: '172.17.0.1'
port: 1080" > codeception/_envs/local.yml
97 changes: 97 additions & 0 deletions .github/workflows/vaddy/scan/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: 'Run VAddy scan'
on:
workflow_call:

inputs:
command:
description: 'codeception command'
required: true
vaddy-verification-code:
description: 'VAddy verification code'
required: true
type: string
vaddy-proxy:
description: 'VAddy proxy'
required: true
type: string
vaddy-proxy-port:
description: 'VAddy proxy port number'
required: true
type: string
vaddy-fqdn:
description: 'VAddy FQDN'
required: true
type: string

runs:
using: "composite"
steps:
- name: "EC-CUBE: run"
shell: bash
run: |
docker run \
-e APP_ENV=prod \
-e APP_DEBUG=0 \
-e DATABASE_URL="postgres://postgres:[email protected]:5432/eccube_db" \
-e DATABASE_SERVER_VERSION=14 \
-e MAILER_URL="smtp://172.17.0.1:1025" \
-v ${PWD}/html:/tmp/html \
--rm -d -p 8080:80 --name eccube ec-cube
until [ $(docker inspect -f {{.State.Health.Status}} eccube) != "starting" ]; do
echo -n .
sleep 10;
done;
docker cp ../eccube.tar.gz eccube:/tmp/
docker exec -w /tmp eccube bash -c "rm -rf /var/www/html; tar xf /tmp/eccube.tar.gz -C /var/www; mv /var/www/ec-cube /var/www/html; chown -R www-data: /var/www/html"
docker exec eccube bash -c "rm -rf /var/www/html/html; ln -s /tmp/html /var/www/html/html;"
docker exec -u www-data eccube bin/console eccube:install -n
docker exec -u www-data -e VADDY_VERIFICATION_CODE=${{ inputs.vaddy-verification-code }} eccube bash -c 'echo ${VADDY_VERIFICATION_CODE} > vaddy-${VADDY_VERIFICATION_CODE}.html'
docker exec -u www-data eccube bash -c 'for code in Api42 Coupon42 MailMagazine42 ProductReview42 Recommend42 RelatedProduct42 SalesReport42 Securitychecker42 SiteKit42; do bin/console eccube:plugin:enable --code $code; done'

- name: "VAddy: connect"
shell: bash
working-directory: /tmp/go-vaddy-master/privatenet
run: ./vaddy_privatenet.sh connect

- name: "VAddy: crawl"
shell: bash
env:
APP_ENV: "codeception"
DATABASE_URL: "postgres://postgres:[email protected]:5432/eccube_db"
DATABASE_SERVER_VERSION: "14"
MAILER_URL: "smtp://127.0.0.1:1025"
BASE_URL: "http://${{ inputs.vaddy-fqdn }}:8080"
VADDY_PROXY: "${{ inputs.vaddy-proxy }}"
VADDY_PROXY_PORT: "${{ inputs.vaddy-proxy-port }}"
VADDY_VERIFICATION_CODE: "${{ inputs.vaddy-verification-code }}"
VADDY_CRAWL: "${{ inputs.command }}"
run: |
vendor/bin/codecept -vvv run acceptance --env chrome,local,vaddy VaddyCest:begin
vendor/bin/codecept -vvv run -g vaddy acceptance --env chrome,local,vaddy --html report.html ${{ inputs.command }} || true
vendor/bin/codecept -vvv run acceptance --env chrome,local,vaddy VaddyCest:commit

- name: Upload report
uses: actions/upload-artifact@v2
with:
name: crawl-reports
path: codeception/_output/**/*

- name: "VAddy: disconnect"
shell: bash
if: ${{ always() }}
working-directory: /tmp/go-vaddy-master/privatenet
run: ./vaddy_privatenet.sh disconnect

- name: "VAddy: scan"
shell: bash
continue-on-error: true
env:
VADDY_CRAWL: "${{ inputs.command }}"
working-directory: /tmp/go-vaddy-master/privatenet
run: ./vaddy_privatenet.sh scan

- name: "EC-CUBE: stop"
shell: bash
if: ${{ always() }}
continue-on-error: true
run: docker rm -f -v eccube
Loading
Loading