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

Merge from upstream #5

Merged
merged 54 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
43457d5
Bump version from jQuery 3.3.1 to 3.5.1
nanasess Jan 12, 2021
8710ebd
forタグにif条件の追加はTwig2.10で非推奨なので修正
kurozumi Feb 17, 2021
9687191
Doctrine ORM3.0ではサポートされないので、flushにエンティティを指定している処理を修正。
kurozumi Feb 17, 2021
e26c7b3
Twig2.9以降filterタグは非推奨なのでapplyタグに変更
kurozumi Feb 17, 2021
eda333d
CSVインポートの時に文字列に含まれる改行コードを残すようにする
yshirai-joolen Feb 18, 2021
5277414
CSVインポートテストが空行の存在を想定してないので修正
yshirai-joolen Feb 26, 2021
b5ceda5
docker-compose.*.yml を分割
nanasess Mar 9, 2021
33bbca8
APP_ENVは Docker コンテナ経由で渡せるように修正
nanasess Mar 9, 2021
fc0df6a
Fix memory_limit to 786M
nanasess Mar 9, 2021
f2601a3
未使用の環境変数を削除
nanasess Mar 9, 2021
a7cfaf1
ログイン時のカートマージでカートが別れる場合のDoctrineのエラーを回避
okazy Mar 16, 2021
c3a02f8
Merge branch '4.0' of https://github.com/EC-CUBE/ec-cube into 4.0
kurozumi Mar 16, 2021
5c5d965
Merge pull request #6 from okazy/kurozumi-patch-13
kurozumi Mar 16, 2021
0b394f9
Merge branch '4.0' of github.com:kurozumi/ec-cube into 4.0
kurozumi Mar 16, 2021
a6ba83a
ログイン時のカートマージでカートが別れる場合のDoctrineのエラーを回避
okazy Mar 16, 2021
e402e73
Merge branch 'kurozumi-patch-13' of github.com:kurozumi/ec-cube into …
kurozumi Mar 16, 2021
84881bc
ログイン時のカートマージでカートが別れる場合のDoctrineのエラーを回避
okazy Mar 16, 2021
8efdd10
Merge branch 'kurozumi-patch-13' of github.com:kurozumi/ec-cube into …
kurozumi Mar 16, 2021
0ba5d6e
Revert "Twig2.9以降filterタグは非推奨なのでapplyタグに変更"
kurozumi Mar 16, 2021
94acdbc
Merge branch 'kurozumi-patch-13' of github.com:kurozumi/ec-cube into …
kurozumi Mar 16, 2021
6866c8a
Merge pull request #4924 from kurozumi/kurozumi-patch-12
matsuoshi Mar 16, 2021
b0bc5ef
Merge pull request #4925 from kurozumi/kurozumi-patch-13
matsuoshi Mar 16, 2021
427f21a
Hogeプラグインのcomposer.jsonを修正
izayoi256 Mar 16, 2021
9a471e4
Merge branch '4.0' of https://github.com/EC-CUBE/ec-cube into 4.0
kurozumi Mar 16, 2021
47e0362
非推奨の文字列を修正
kurozumi Mar 17, 2021
98b5104
Merge pull request #4971 from kurozumi/deprecated-message-fix
okazy Mar 18, 2021
8e027bf
Merge pull request #4968 from izayoi256/bugfix/hoge
okazy Mar 18, 2021
ce95030
Merge pull request #4833 from nanasess/update-jquery
okazy Mar 18, 2021
c3c7123
管理画面ログイン履歴、IP拒否リスト機能を実装
dk-umebius Mar 21, 2021
fb06bb3
Remove .travis.yml
nanasess Mar 22, 2021
592d081
Remove obsolete ymls
nanasess Mar 22, 2021
bc553e8
docker-php-entrypoint で APP_ENV を設定するよう修正
nanasess Mar 22, 2021
f5dd1c8
Merge pull request #4979 from nanasess/delete-travis
okazy Mar 23, 2021
b898cc9
ログイン履歴機能の文言など調整
okazy Mar 23, 2021
17438a7
ログインステータスのマイグレーションで環境変数 ECCUBE_LOCALE が未設定の場合は日本語で登録する
okazy Mar 23, 2021
d6597c8
Merge pull request #15 from okazy/umebius/admin/login_history
dk-umebius Mar 23, 2021
3e492f7
Merge pull request #4942 from yshirai-joolen/remove_drop_new_line
chihiro-adachi Mar 23, 2021
ac53139
Badge を GitHub Actions に変更
nanasess Mar 23, 2021
fa1dfb7
Travis CI 連携廃止に伴い削除
nanasess Mar 24, 2021
6c95d36
Merge pull request #4983 from nanasess/change-badge
okazy Mar 25, 2021
035120b
Merge pull request #4984 from nanasess/remove-codeception.sh
okazy Mar 25, 2021
f3c187f
IP制限(拒否リスト)とログイン履歴とE2Eテストを追加
okazy Mar 25, 2021
ae20e4e
Merge pull request #16 from okazy/umebius/admin/login_history
dk-umebius Mar 25, 2021
2cf0b53
管理画面のお知らせのE2Eテストをリダイレクトに対応
okazy Mar 26, 2021
91bee5a
テストケースのIDを修正
okazy Mar 26, 2021
e0817fc
Merge pull request #17 from okazy/umebius/admin/login_history
dk-umebius Mar 26, 2021
3f40c76
nginx.conf.sample に bin ディレクトリを追加
nanasess Mar 26, 2021
3f08e3f
Merge pull request #4978 from U-Mebius/umebius/admin/login_history
okazy Mar 30, 2021
471d5d3
Merge pull request #4992 from nanasess/add-bin-nginx
okazy Mar 30, 2021
b5d1bb1
Bump y18n from 3.2.1 to 3.2.2
dependabot[bot] Mar 30, 2021
d2bcb0d
Merge pull request #4955 from nanasess/split-docker-compose
chihiro-adachi Mar 30, 2021
7c59b53
Merge pull request #4989 from okazy/fix/e2e-top-information
chihiro-adachi Mar 31, 2021
23da54c
Merge pull request #4993 from EC-CUBE/dependabot/npm_and_yarn/y18n-3.2.2
okazy Apr 1, 2021
60f8669
Merge pull request #4999 from okazy/improve/4.0
Apr 5, 2021
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
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ MAILER_URL=null://localhost
#ECCUBE_ADMIN_ROUTE=admin
#ECCUBE_USER_DATA_ROUTE=user_data
#ECCUBE_ADMIN_ALLOW_HOSTS=[]
#ECCUBE_ADMIN_DENY_HOSTS=[]
#ECCUBE_FORCE_SSL=false
#ECCUBE_TEMPLATE_CODE=default
#ECCUBE_AUTH_MAGIC=<change.me>
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,13 @@ jobs:
rm -rf $GITHUB_WORKSPACE/.gitignore
rm -rf $GITHUB_WORKSPACE/.buildpath
rm -rf $GITHUB_WORKSPACE/.gitmodules
rm -rf $GITHUB_WORKSPACE/.scrutinizer.yml
rm -rf $GITHUB_WORKSPACE/.travis.yml
rm -rf $GITHUB_WORKSPACE/appveyor.yml
rm -rf $GITHUB_WORKSPACE/.coveralls.yml
rm -rf $GITHUB_WORKSPACE/.php_cs.dist
rm -rf $GITHUB_WORKSPACE/phpunit.xml.dist
rm -rf $GITHUB_WORKSPACE/phpstan.neon.dist
rm -rf $GITHUB_WORKSPACE/app.json
rm -rf $GITHUB_WORKSPACE/Procfile
rm -rf $GITHUB_WORKSPACE/LICENSE.txt
rm -rf $GITHUB_WORKSPACE/README.md
rm -rf $GITHUB_WORKSPACE/codeception.sh
rm -rf $GITHUB_WORKSPACE/codeception.yml
rm -rf $GITHUB_WORKSPACE/app/Plugin/*
rm -rf $GITHUB_WORKSPACE/codeception
Expand Down
426 changes: 0 additions & 426 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ EXPOSE 443
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Override with custom configuration settings
COPY dockerbuild/php.ini $PHP_INI_DIR/conf.d/
COPY dockerbuild/docker-php-entrypoint /usr/local/bin/

RUN chown www-data:www-data /var/www \
&& mkdir -p ${APACHE_DOCUMENT_ROOT}/vendor \
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# EC-CUBE 4.0

[![Build Status](https://travis-ci.com/EC-CUBE/ec-cube.svg?branch=4.0)](https://travis-ci.com/EC-CUBE/ec-cube)
[![Unit test for EC-CUBE](https://github.com/EC-CUBE/ec-cube/actions/workflows/unit-test.yml/badge.svg?branch=4.0)](https://github.com/EC-CUBE/ec-cube/actions/workflows/unit-test.yml)
[![E2E test for EC-CUBE](https://github.com/EC-CUBE/ec-cube/actions/workflows/e2e-test.yml/badge.svg?branch=4.0)](https://github.com/EC-CUBE/ec-cube/actions/workflows/e2e-test.yml)
[![Plugin test for EC-CUBE](https://github.com/EC-CUBE/ec-cube/actions/workflows/plugin-test.yml/badge.svg?branch=4.0)](https://github.com/EC-CUBE/ec-cube/actions/workflows/plugin-test.yml)
[![PHPStan](https://github.com/EC-CUBE/ec-cube/actions/workflows/phpstan.yml/badge.svg?branch=4.0)](https://github.com/EC-CUBE/ec-cube/actions/workflows/phpstan.yml)
[![codecov](https://codecov.io/gh/EC-CUBE/ec-cube/branch/4.0/graph/badge.svg?token=BhnPjjvfwd)](https://codecov.io/gh/EC-CUBE/ec-cube)

[![Slack](https://img.shields.io/badge/slack-join%5fchat-brightgreen.svg?style=flat)](https://join.slack.com/t/ec-cube/shared_invite/enQtNDA1MDYzNDQxMTIzLTY5MTRhOGQ2MmZhMjQxYTAwMmVlMDc5MDU2NjJlZmFiM2E3M2Q0M2Y3OTRlMGY4NTQzN2JiZDBkNmQwNTUzYzc)
Expand Down
59 changes: 59 additions & 0 deletions app/DoctrineMigrations/Version20210319122142.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

declare(strict_types=1);

/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Eccube\Entity\Master\LoginHistoryStatus;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210319122142 extends AbstractMigration
{
public function up(Schema $schema): void
{
$lang = env('ECCUBE_LOCALE');
$statuses = [
LoginHistoryStatus::FAILURE => $lang === 'en' ? 'Failure' : '失敗',
LoginHistoryStatus::SUCCESS => $lang === 'en' ? 'Success' : '成功',
];

$sortNo = $this->connection->fetchColumn('SELECT MAX(sort_no) + 1 FROM mtb_login_history_status');
if (is_null($sortNo)) {
$sortNo = 0;
}

foreach ($statuses as $id => $name) {
$statusExists = $this->connection->fetchColumn(
'SELECT COUNT(*) FROM mtb_login_history_status WHERE id = :id',
[':id' => $id]
);

if ($statusExists == 0) {
$this->addSql(
"INSERT INTO mtb_login_history_status (id, name, sort_no, discriminator_type) VALUES (?, ?, ?, 'loginhistorystatus')",
[$id, $name, $sortNo++]
);
}
}
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}
6 changes: 3 additions & 3 deletions app/Plugin/HogePlugin/composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "ec-cube/Hoge",
"name": "ec-cube/HogePlugin",
"version": "1.0.0",
"description": "プラグインサンプル",
"type": "eccube-plugin",
"extra": {
"code": "Hoge"
"code": "HogePlugin"
}
}
}
2 changes: 2 additions & 0 deletions app/config/eccube/packages/eccube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ parameters:
env(ECCUBE_ADMIN_ROUTE): 'admin'
env(ECCUBE_USER_DATA_ROUTE): 'user_data'
env(ECCUBE_ADMIN_ALLOW_HOSTS): '[]'
env(ECCUBE_ADMIN_DENY_HOSTS): '[]'
env(ECCUBE_FORCE_SSL): false
env(ECCUBE_TEMPLATE_CODE): 'default'
env(ECCUBE_AUTH_MAGIC): '<change.me>'
Expand All @@ -20,6 +21,7 @@ parameters:
eccube_admin_route: '%env(ECCUBE_ADMIN_ROUTE)%'
eccube_user_data_route: '%env(ECCUBE_USER_DATA_ROUTE)%'
eccube_admin_allow_hosts: '%env(json:ECCUBE_ADMIN_ALLOW_HOSTS)%'
eccube_admin_deny_hosts: '%env(json:ECCUBE_ADMIN_DENY_HOSTS)%'
eccube_force_ssl: '%env(bool:ECCUBE_FORCE_SSL)%'
eccube.theme: '%env(ECCUBE_TEMPLATE_CODE)%'
eccube_theme_code: '%eccube.theme%'
Expand Down
3 changes: 3 additions & 0 deletions app/config/eccube/packages/eccube_nav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ parameters:
security:
name: admin.setting.system.security_management
url: admin_setting_system_security
login_history:
name: admin.setting.system.login_history
url: admin_setting_system_login_history
log:
name: admin.setting.system.log_display
url: admin_setting_system_log
Expand Down
26 changes: 0 additions & 26 deletions codeception.sh

This file was deleted.

2 changes: 1 addition & 1 deletion codeception/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function logoutAsAdmin()
$isLogin = $I->grabTextFrom('header.c-headerBar div.c-headerBar__container a.c-headerBar__userMenu span');
if ($isLogin == '管理者 様') {
$I->click('header.c-headerBar div.c-headerBar__container a.c-headerBar__userMenu');
$I->click('#page_admin_homepage div.popover .popover-body a:last-child');
$I->click('body div.popover .popover-body a:last-child');
$config = Fixtures::get('config');
$I->amOnPage('/'.$config['eccube_admin_route'].'/logout');
$I->see('ログイン', '#form1 > button');
Expand Down
63 changes: 63 additions & 0 deletions codeception/_support/Page/Admin/LoginHistoryPage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php

/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Page\Admin;

class LoginHistoryPage extends AbstractAdminPageStyleGuide
{
public static $URL = '/setting/system/login_history';

public static $検索条件 = ['id' => 'admin_search_login_history_multi'];
public static $検索ボタン = '#search_form .c-outsideBlock__contents button';
public static $詳細検索ボタン = '//*[@id="search_form"]/div[1]/div[1]/div/div/div[2]/a/span';
public static $検索結果_メッセージ = '//*[@id="search_form"]/div[2]/span';

public function __construct(\AcceptanceTester $I)
{
parent::__construct($I);
}

public static function go(\AcceptanceTester $I)
{
$page = new self($I);

return $page->goPage(self::$URL, 'ログイン履歴システム設定');
}

/**
* 指定したログインID/IPアドレスで検索する。
*
* @param string $multi ログインID/IPアドレス
*
* @return $this
*/
public function 検索($multi = '')
{
$this->tester->fillField(self::$検索条件, $multi);
$this->tester->click(self::$検索ボタン);
$this->tester->see('ログイン履歴システム設定', '.c-pageTitle');

return $this;
}

public function 詳細検索_ステータス($value)
{
$this->tester->click(self::$詳細検索ボタン);
$this->tester->wait(1);
$this->tester->checkOption(['id' => 'admin_search_login_history_Status_'.$value]);
$this->tester->click(self::$検索ボタン);
$this->tester->see('ログイン履歴システム設定', '.c-pageTitle');

return $this;
}
}
4 changes: 2 additions & 2 deletions codeception/acceptance/EA01TopCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ public function top_001(\AcceptanceTester $I)
// お知らせの記事をクリックすると設定されたURLに遷移することを確認
$I->switchToIFrame('information');
$selector = '.news_area .link_list .tableish a:nth-child(1)';
$url = $I->grabAttributeFrom($selector, 'href');
$url = $I->executeJS('return location.href');
$I->click(['css' => $selector]);
$I->switchToNewWindow();
$I->assertEquals($url, $I->executeJS('return location.href'), $url.' が一致しません');
$I->assertNotEquals($url, $I->executeJS('return location.href'), $url.' から遷移していません。');
$I->switchToWindow();

// ショップ情報の在庫切れ商品をクリックすると商品管理ページに遷移することを確認
Expand Down
67 changes: 65 additions & 2 deletions codeception/acceptance/EA08SysteminfoCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Codeception\Util\Fixtures;
use Page\Admin\AuthorityManagePage;
use Page\Admin\LoginHistoryPage;

/**
* @group admin
Expand Down Expand Up @@ -308,6 +309,24 @@ public function systeminfo_セキュリティ管理SSL(\AcceptanceTester $I)
$I->click('#page_admin_setting_system_security form div.c-contentsArea__cols > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button');
}

/**
* GitHub Actions は IPv6で実行されており、アクセス拒否のテストはできない
*/
public function systeminfo_セキュリティ管理IP制限_拒否リスト(\AcceptanceTester $I)
{
$I->wantTo('EA0804-UC01-T05 セキュリティ管理 - IP制限(拒否リスト)');

// 表示
$config = Fixtures::get('config');
$I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/security');
$I->see('セキュリティ管理システム設定', '#page_admin_setting_system_security .c-pageTitle__titles');

$I->fillField(['id' => 'admin_security_admin_deny_hosts'], '1.1.1.1');
$I->click('#page_admin_setting_system_security form div.c-contentsArea__cols > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button');

$I->see('保存しました', AuthorityManagePage::$完了メッセージ);
}

public function systeminfo_権限管理追加(\AcceptanceTester $I)
{
$I->wantTo('EA0805-UC01-T01 権限管理 - 追加');
Expand Down Expand Up @@ -377,12 +396,56 @@ public function systeminfo_マスターデータ管理(\AcceptanceTester $I)
$I->see('無回答', '#customer_form #admin_customer_sex');
}

public function systeminfo_ログイン履歴検索(\AcceptanceTester $I)
{
$I->wantTo('EA0808-UC01-T01 ログイン履歴 - 検索');

LoginHistoryPage::go($I)->検索('admin');

// 1項目目をチェック
$I->see('admin', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody/tr[1]/td[2]');
$I->see('成功', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody/tr[1]/td[5]/span');

LoginHistoryPage::go($I)->検索('admin-failure');

$I->see('検索結果:0件が該当しました', LoginHistoryPage::$検索結果_メッセージ);

$I->logoutAsAdmin();

// ログインに失敗する
$I->submitForm('#form1', [
'login_id' => 'admin-failure',
'password' => 'password',
]);

$I->loginAsAdmin();

LoginHistoryPage::go($I)->検索('admin-failure');

// 1項目目をチェック
$I->see('admin-failure', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody/tr[1]/td[2]');
$I->see('失敗', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody/tr[1]/td[5]/span');


// ステータスで詳細検索

LoginHistoryPage::go($I)->検索();

$I->see('失敗', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody');
$I->see('成功', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody');

LoginHistoryPage::go($I)->詳細検索_ステータス('0');

$I->see('失敗', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody');
$I->dontSee('成功', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody');
}

/**
* ATTENTION 後続のテストが失敗するため、最後に実行する必要がある
*/
public function systeminfo_セキュリティ管理IP制限(\AcceptanceTester $I)
public function systeminfo_セキュリティ管理IP制限_許可リスト(\AcceptanceTester $I)
{
$I->wantTo('EA0804-UC01-T03 セキュリティ管理 - IP制限');
$I->wantTo('EA0804-UC01-T03 セキュリティ管理 - IP制限(許可リスト)');

$findPlugins = Fixtures::get('findPlugins');
$Plugins = $findPlugins();
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3'

services:
ec-cube:
volumes:
- ".:/var/www/html:cached"
27 changes: 27 additions & 0 deletions docker-compose.mysql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3'

volumes:
mysql-database:
driver: local

services:
ec-cube:
depends_on:
- mysql
environment:
DATABASE_URL: "mysql://dbuser:secret@mysql/eccubedb"
DATABASE_SERVER_VERSION: 10

mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: eccubedb
MYSQL_USER: dbuser
MYSQL_PASSWORD: secret
volumes:
- mysql-database:/var/lib/mysql
ports:
- 13306:3306
networks:
- backend
File renamed without changes.
Loading