From b0d1af4e17002ffaf9b0860a1821d0f04a49df20 Mon Sep 17 00:00:00 2001 From: Srinivas Date: Sun, 29 Nov 2020 12:02:47 -0600 Subject: [PATCH 01/14] Force Composer 1.0 for Docker Some of the UF Dependencies are not yet compatible with Composer 2.x so forcing downgrade to Composer 1.x --- docker/app/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/app/Dockerfile b/docker/app/Dockerfile index 5c61b9ea1..0f8d92b40 100644 --- a/docker/app/Dockerfile +++ b/docker/app/Dockerfile @@ -25,6 +25,8 @@ RUN apt-get install -y \ # COMPOSER INSTALL RUN curl -sSfo /tmp/composer.phar https://getcomposer.org/installer RUN php /tmp/composer.phar --install-dir=/usr/local/bin --filename=composer +# Force Composer Stable Version 1 +RUN composer selfupdate --1 # Install and configure PHP extensions RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ From b843e60805cf6ca2de082801cc049d21e8b309ab Mon Sep 17 00:00:00 2001 From: SarahBaghdadi Date: Wed, 2 Dec 2020 20:38:01 -0500 Subject: [PATCH 02/14] Update error.html.twig - main content container The error page content should be in a container so that it doesn't live right up against the edge of the DOM. Adding the `container` class to this div will fix it. --- app/sprinkles/core/templates/pages/abstract/error.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/sprinkles/core/templates/pages/abstract/error.html.twig b/app/sprinkles/core/templates/pages/abstract/error.html.twig index a6da90c60..568ff3046 100644 --- a/app/sprinkles/core/templates/pages/abstract/error.html.twig +++ b/app/sprinkles/core/templates/pages/abstract/error.html.twig @@ -9,7 +9,7 @@
-
+
{% block headline %}

{% endblock %}
@@ -29,4 +29,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} From c3dd9b098f44830f02da0344144e0e5ac27b18e7 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Tue, 29 Dec 2020 11:05:11 -0500 Subject: [PATCH 03/14] Replace Travis with GitHub Actions (#1132) See you in hell Travis ! --- .github/workflows/Build.yml | 326 ++++++++++++++++++++++++++++++++++++ .travis.yml | 58 ------- build/before_install.sh | 50 ------ 3 files changed, 326 insertions(+), 108 deletions(-) create mode 100644 .github/workflows/Build.yml delete mode 100644 .travis.yml delete mode 100644 build/before_install.sh diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml new file mode 100644 index 000000000..c354ceeb8 --- /dev/null +++ b/.github/workflows/Build.yml @@ -0,0 +1,326 @@ +name: Build + +on: + push: + branches: ['*'] + pull_request: + branches: ['*'] + schedule: + - cron: "0 0 * * 5" + +jobs: + PHPUnit-MySQL: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.1', '7.2', '7.3', '7.4'] + + runs-on: ubuntu-latest + name: PHPUnit - PHP ${{ matrix.php_versions }} - MySQL + + env: + TEST_DB: default + UF_MODE: debug + DB_DRIVER: mysql + DB_HOST: 127.0.0.1 + DB_USER: userfrosting + DB_PASSWORD: password + DB_NAME: userfrosting + DB_PORT: 3306 + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_versions }} + extensions: mbstring, dom, fileinfo, gd, memcached, redis + coverage: xdebug + tools: pecl, composer:v1 + + - uses: actions/setup-node@v2 + with: + node-version: 10 + + - name: Setup Redis-server + uses: supercharge/redis-github-action@1.1.0 + with: + redis-version: 6 + + - name: Setup Memcached + uses: niden/actions-memcached@v7 + + - name: Shutdown Ubuntu MySQL (SUDO) + run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it + + - name: Set up MySQL (PHP <= 7.3 -> MySQL 5) + if: ${{ matrix.php_versions != 7.4 }} + uses: mirromutth/mysql-action@v1.1 + with: + mysql version: '5' + mysql database: 'userfrosting' + mysql user: 'userfrosting' + mysql password: 'password' + + - name: Set up MySQL (PHP >= 7.4 -> MySQL 8) + if: ${{ matrix.php_versions == 7.4 }} + uses: mirromutth/mysql-action@v1.1 + with: + mysql version: '8' + mysql database: 'userfrosting' + mysql user: 'userfrosting' + mysql password: 'password' + + - name: Copy .env + run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" + + - name: Install Dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Bakery Debug + run: php bakery debug + + - name: Migrate DB + run: php bakery migrate + + - name: Build Assets + run: php bakery build-assets + + - name: Execute tests + run: app/vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true + + PHPUnit-SQLite: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.1', '7.2', '7.3', '7.4'] + + runs-on: ubuntu-latest + name: PHPUnit - PHP ${{ matrix.php_versions }} - SQLite + + env: + TEST_DB: default + UF_MODE: debug + DB_DRIVER: sqlite + DB_NAME: database/database.sqlite + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_versions }} + extensions: mbstring, dom, fileinfo, gd, memcached, redis + coverage: xdebug + tools: pecl, composer:v1 + + - uses: actions/setup-node@v2 + with: + node-version: 10 + + - name: Setup Redis-server + uses: supercharge/redis-github-action@1.1.0 + with: + redis-version: 6 + + - name: Setup Memcached + uses: niden/actions-memcached@v7 + + - name: Copy .env + run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" + + - name: Install Dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Create SQLite Database + run: | + mkdir -p database + touch database/database.sqlite + + - name: Bakery Debug + run: php bakery debug + + - name: Migrate DB + run: php bakery migrate + + - name: Build Assets + run: php bakery build-assets + + - name: Execute tests + run: app/vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true + + PHPUnit-Postgre: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.1', '7.2', '7.3', '7.4'] + + runs-on: ubuntu-latest + name: PHPUnit - PHP ${{ matrix.php_versions }} - PostgreSQL + + env: + TEST_DB: default + UF_MODE: debug + DB_DRIVER: pgsql + DB_HOST: 127.0.0.1 + DB_USER: userfrosting + DB_PASSWORD: password + DB_NAME: userfrosting + DB_PORT: 5432 + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_versions }} + extensions: mbstring, dom, fileinfo, gd, memcached, redis + coverage: xdebug + tools: pecl, composer:v1 + + - uses: actions/setup-node@v2 + with: + node-version: 10 + + - name: Setup Redis-server + uses: supercharge/redis-github-action@1.1.0 + with: + redis-version: 6 + + - name: Setup Memcached + uses: niden/actions-memcached@v7 + + - name: Copy .env + run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" + + - name: Install Dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Setup PostgreSQL + uses: Harmon758/postgresql-action@v1.0.0 + with: + postgresql db: 'userfrosting' + postgresql user: 'userfrosting' + postgresql password: 'password' + + - name: Bakery Debug + run: php bakery debug + + - name: Migrate DB + run: php bakery migrate + + - name: Build Assets + run: php bakery build-assets + + - name: Execute tests + run: app/vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true + + PHPUnit-Windows: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.1', '7.2', '7.3', '7.4'] + + runs-on: windows-latest + name: PHPUnit - PHP ${{ matrix.php_versions }} - Windows + + env: + TEST_DB: default + UF_MODE: debug + DB_DRIVER: sqlite + DB_NAME: database/database.sqlite + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_versions }} + extensions: mbstring, dom, fileinfo, gd, pdo, sqlite, pdo_sqlite + coverage: xdebug + tools: pecl, composer:v1 + + - name: Copy .env + run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" + + - name: Install Dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Create Database + run: | + mkdir -p database + touch database/database.sqlite + + - name: Execute build with SQLite Env + run: | + php bakery debug + php bakery migrate + app/vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true + + Asset-Build: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.4'] + node_versions: ['10', '11', '12', '14'] + os: [ubuntu-latest, windows-latest] + + runs-on: ${{ matrix.os }} + name: Assets Build - PHP ${{ matrix.php_versions }} - Node ${{ matrix.node_versions }} - ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_versions }} + extensions: mbstring, dom, fileinfo, gd + coverage: xdebug + tools: pecl, composer:v1 + + - uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node_versions }} + + - name: Copy .env + run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" + + - name: Install Dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Execute build + run: php bakery build-assets \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e8eb42d2f..000000000 --- a/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -dist: xenial -language: php - -services: - - mysql - - postgresql - - memcached - - redis - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - -env: - jobs: - - DB=mysql - - DB=sqlite - - DB=pgsql - - DB=memory - -jobs: - fast_finish: true - -cache: - directories: - - $HOME/.composer/cache - -before_install: - # Force use of Composer 1.x - - composer self-update --1 - # copy sprinkles.json - - cp app/sprinkles.example.json app/sprinkles.json - # set up db - - bash build/before_install.sh $DB - # update node - - nvm install 10.12.0 - # Install Redis and Memcached - - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - printf "\n" | pecl install -f redis - -before_script: - # install deps and UF - - COMPOSER_MEMORY_LIMIT=-1 travis_retry composer install --no-interaction - - php bakery debug - - php bakery build-assets - - php bakery migrate - -script: - # run unit tests - - app/vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -after_failure: - - cat app/log/userfrosting.log diff --git a/build/before_install.sh b/build/before_install.sh deleted file mode 100644 index 637b54eac..000000000 --- a/build/before_install.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# Inspired by ownCloud´s before_install.sh script <3 -# - -WORKDIR=$PWD -DB=$1 - -echo "Work directory: $WORKDIR" -echo "Database: $DB" - -# -# set up mysql -# -if [ "$DB" == "mysql" ] ; then - echo "Setting up mysql ..." - mysql -u root -e "CREATE DATABASE userfrosting;" - mysql -u root -e "GRANT ALL ON userfrosting.* TO 'travis'@'localhost';" - printf "UF_MODE=\"debug\"\nDB_DRIVER=\"mysql\"\nDB_HOST=\"localhost\"\nDB_PORT=\"3306\"\nDB_NAME=\"userfrosting\"\nDB_USER=\"travis\"\nDB_PASSWORD=\"\"\nTEST_DB=\"default\"\n" > app/.env -fi - -# -# set up pgsql -# -if [ "$DB" == "pgsql" ] ; then - echo "Setting up pgsql ..." - psql -c "CREATE DATABASE userfrosting;" -U postgres - psql -c "GRANT ALL PRIVILEGES ON DATABASE userfrosting TO postgres;" -U postgres - printf "UF_MODE=\"debug\"\nDB_DRIVER=\"pgsql\"\nDB_HOST=\"localhost\"\nDB_PORT=\"5432\"\nDB_NAME=\"userfrosting\"\nDB_USER=\"postgres\"\nDB_PASSWORD=\"\"\nTEST_DB=\"default\"\n" > app/.env -fi - -# -# set up sqlite -# -if [ "$DB" == "sqlite" ] ; then - echo "Setting up sqlite ..." - touch userfrosting.db - printf "UF_MODE=\"debug\"\nDB_DRIVER=\"sqlite\"\nDB_HOST=127.0.0.1\nDB_NAME=\"userfrosting.db\"\nTEST_DB=\"default\"\n" > app/.env -fi - -# -# set up memory -# Need to setup MySQL for the debug part -# -if [ "$DB" == "memory" ] ; then - echo "Setting up in memory sqlite ..." - mysql -u root -e "CREATE DATABASE userfrosting;" - mysql -u root -e "GRANT ALL ON userfrosting.* TO 'travis'@'localhost';" - printf "UF_MODE=\"debug\"\nDB_DRIVER=\"mysql\"\nDB_HOST=\"localhost\"\nDB_PORT=\"3306\"\nDB_NAME=\"userfrosting\"\nDB_USER=\"travis\"\nDB_PASSWORD=\"\"\n" > app/.env -fi From 28cf517c8c68e10cebc19db17b6c77513aeb895a Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Tue, 29 Dec 2020 11:08:49 -0500 Subject: [PATCH 04/14] Update README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a0268dc83..b50f11f48 100644 --- a/README.md +++ b/README.md @@ -3,22 +3,22 @@ [![Latest Version](https://img.shields.io/github/release/userfrosting/UserFrosting.svg)](https://github.com/userfrosting/UserFrosting/releases) ![PHP Version](https://img.shields.io/packagist/php-v/userfrosting/userfrosting.svg?color=brightgreen) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md) -[![Join the chat at https://chat.userfrosting.com/channel/support](https://demo.rocket.chat/images/join-chat.svg)](https://chat.userfrosting.com/channel/support) +[![Join the chat at https://chat.userfrosting.com/channel/support](https://chat.userfrosting.com/api/v1/shield.svg?name=UserFrosting)](https://chat.userfrosting.com/channel/support) [![Backers on Open Collective](https://opencollective.com/userfrosting/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/userfrosting/sponsors/badge.svg)](#sponsors) [![Donate](https://img.shields.io/badge/Open%20Collective-Donate-blue.svg)](https://opencollective.com/userfrosting#backer) | Branch | Version | Build | Coverage | Style | | ------ |:-------:|:-----:|:--------:|:-----:| -| [master] | ![](https://img.shields.io/github/release/userfrosting/userfrosting.svg?color=success&label=Version) | [![](https://travis-ci.org/userfrosting/UserFrosting.svg?branch=master)][UF-Travis] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/master/graph/badge.svg)][UF-Codecov] | [![][style-master]][style] | -| [hotfix] | ![](https://img.shields.io/badge/Version-v4.4.x-yellow.svg) | [![](https://travis-ci.org/userfrosting/UserFrosting.svg?branch=hotfix)][UF-Travis] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/hotfix/graph/badge.svg)][UF-Codecov] | [![][style-hotfix]][style] | -| [develop] | ![](https://img.shields.io/badge/Version-v4.5.x-orange.svg) | [![](https://travis-ci.org/userfrosting/UserFrosting.svg?branch=develop)][UF-Travis] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/develop/graph/badge.svg)][UF-Codecov] | [![][style-develop]][style] | +| [master] | ![](https://img.shields.io/github/release/userfrosting/userfrosting.svg?color=success&label=Version) | [![](https://github.com/userfrosting/userfrosting/workflows/Build/badge.svg?branch=master)][UF-Build] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/master/graph/badge.svg)][UF-Codecov] | [![][style-master]][style] | +| [hotfix] | ![](https://img.shields.io/badge/Version-v4.4.x-yellow.svg) | [![](https://github.com/userfrosting/userfrosting/workflows/Build/badge.svg?branch=hotfix)][UF-Build] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/hotfix/graph/badge.svg)][UF-Codecov] | [![][style-hotfix]][style] | +| [develop] | ![](https://img.shields.io/badge/Version-v4.5.x-orange.svg) | [![](https://github.com/userfrosting/userfrosting/workflows/Build/badge.svg?branch=develop)][UF-Build] | [![](https://codecov.io/gh/userfrosting/userfrosting/branch/develop/graph/badge.svg)][UF-Codecov] | [![][style-develop]][style] | [master]: https://github.com/userfrosting/UserFrosting [hotfix]: https://github.com/userfrosting/UserFrosting/tree/hotfix [develop]: https://github.com/userfrosting/UserFrosting/tree/develop -[UF-Travis]: https://travis-ci.org/userfrosting/UserFrosting +[UF-Build]: https://github.com/userfrosting/userfrosting/actions?query=workflow%3ABuild [UF-Codecov]: https://codecov.io/gh/userfrosting/userfrosting [style-master]: https://github.styleci.io/repos/18148206/shield?branch=master&style=flat [style-hotfix]: https://github.styleci.io/repos/18148206/shield?branch=hotfix&style=flat From 954ab32611abf0ac55d4b909d846824dcc0074e5 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Tue, 29 Dec 2020 11:32:16 -0500 Subject: [PATCH 05/14] Added missing `build-assets` in Windows Build --- .github/workflows/Build.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index c354ceeb8..8eaa6933c 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -265,6 +265,10 @@ jobs: extensions: mbstring, dom, fileinfo, gd, pdo, sqlite, pdo_sqlite coverage: xdebug tools: pecl, composer:v1 + + - uses: actions/setup-node@v2 + with: + node-version: 10 - name: Copy .env run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" @@ -272,16 +276,22 @@ jobs: - name: Install Dependencies run: composer install --prefer-dist --no-progress --no-suggest - - name: Create Database + - name: Create SQLite Database run: | mkdir -p database touch database/database.sqlite - - - name: Execute build with SQLite Env - run: | - php bakery debug - php bakery migrate - app/vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Bakery Debug + run: php bakery debug + + - name: Migrate DB + run: php bakery migrate + + - name: Build Assets + run: php bakery build-assets + + - name: Execute tests + run: app/vendor/bin/phpunit --coverage-clover=coverage.xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 From 371caa9287d2a38becf75c7b132adf06e3732109 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Tue, 29 Dec 2020 13:50:19 -0500 Subject: [PATCH 06/14] Set version to 4.4.5 --- app/defines.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/defines.php b/app/defines.php index cbd11bdea..778df9d38 100755 --- a/app/defines.php +++ b/app/defines.php @@ -11,7 +11,7 @@ namespace UserFrosting; // Some standard defines -define('UserFrosting\VERSION', '4.4.4'); +define('UserFrosting\VERSION', '4.4.5'); define('UserFrosting\DS', '/'); define('UserFrosting\PHP_MIN_VERSION', '7.1'); define('UserFrosting\PHP_RECOMMENDED_VERSION', '7.3'); From ace70d66b5652fad76575db7b75f7fc0a8c280f6 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Tue, 29 Dec 2020 14:40:33 -0500 Subject: [PATCH 07/14] Updated Homestead config & doc (close #1134) --- vagrant/README.md | 42 ++++++++++++++++++++++++++++++------------ vagrant/after.sh | 15 +++++++++++++-- vagrant/bootstrap.yaml | 5 ++--- 3 files changed, 45 insertions(+), 17 deletions(-) diff --git a/vagrant/README.md b/vagrant/README.md index 8d7a81ede..1ab888454 100644 --- a/vagrant/README.md +++ b/vagrant/README.md @@ -2,7 +2,7 @@ UserFrosting includes support for Vagrant. This allows you to run UserFrosting without the need to set up your own local web server with traditional WAMP/MAMP stacks. It also provides a consistent environment between developers for writing and debugging code changes more productively. -UserFrosting uses the [Laravel/Homestead](https://laravel.com/docs/5.6/homestead) Vagrant box. It runs a Linux server with Ubuntu 16.04, PHP 7.1, Nginx, SQLite3, MySQL, and a whole lot more (complete specs below). +UserFrosting uses the [Laravel/Homestead](https://laravel.com/docs/8.x/homestead) Vagrant box. It runs a Linux server with Ubuntu 16.04, PHP 7.4, Nginx, SQLite, MySQL, and a whole lot more (complete specs below). ## Get Started @@ -12,7 +12,7 @@ UserFrosting uses the [Laravel/Homestead](https://laravel.com/docs/5.6/homestead * Clone Homestead from the root of your cloned fork of the UserFrosting Git repository ```sh -git clone https://github.com/laravel/homestead.git vagrant/Homestead +git clone https://github.com/laravel/homestead.git vagrant/Homestead -b 20.04 ``` * Run `vagrant up` from the root of your cloned fork of the UserFrosting Git repository @@ -21,10 +21,35 @@ git clone https://github.com/laravel/homestead.git vagrant/Homestead $ vagrant up ``` -* Access UserFrosting at `http://192.168.10.10/` +Once finished, you must update your computer's hosts file. This file is typically located at `/etc/hosts` for MacOS/Linux or `C:\Windows\System32\drivers\etc\hosts` for Windows. Open this file and add the following line to it, at the very bottom, and save. + +``` +192.168.10.10 userfrosting.test +``` + +* Access UserFrosting at `http://userfrosting.test/` * Username: **admin** * Password: **adminadmin12** +## Troubleshoot + +On MacOS, if you experience error related to `failed to open stream: No such file or directory`, open `vagrant/bootstrap.yaml`, find this : + +``` + - map: . + to: /home/vagrant/userfrosting +``` + +and replace with : + +``` + - map: . + to: /home/vagrant/userfrosting + type: "nfs" +``` + +Reload the VM using `vagrant reload --provision` + ## Additional commands: * Access your Linux server from the command line: @@ -56,12 +81,6 @@ $ vagrant destroy By default, UserFrosting is pre-configured to install with a MySQL database. You can, however, switch to PostegreSQL or SQLite3 by editing the `install-config.yml` file in the vagrant directory. The next time you run `vagrant up` (or `vagrant provision`) it will be installed under the new configuration. -If you prefer to access UserFrosting from the more friendly URL `http://userfrosting.test` then you must update your computer's hosts file. This file is typically located at `/etc/hosts` for Mac/Linux or `C:\Windows\System32\drivers\etc\hosts` for Windows. Open this file and add the following line to it, at the very bottom, and save. - -``` -192.168.10.10 userfrosting.test -``` - ## How it all works When you vagrant up, the Laravel/Homestead box is transparently loaded as a Virtual Machine on your computer (this may take several minutes the very first time while it downloads the VM image to your computer). Your local UserFrosting repository clone is mirrored/shared with the VM, so you can work on the UserFrosting code on your computer, and see the changes immediately when you browse to UserFrosting at the URL provided by the VM. @@ -98,10 +117,9 @@ $ mysql -uhomestead -psecret UserFrosting < /home/vagrant/userfrosting/userfrost ### Included Software -* Ubuntu 16.04 +* Ubuntu 20.04 * Git -* PHP 7.1 -* HHVM +* PHP 7.4 * Nginx * MySQL * Sqlite3 diff --git a/vagrant/after.sh b/vagrant/after.sh index 4be3d9800..0c077e6df 100644 --- a/vagrant/after.sh +++ b/vagrant/after.sh @@ -2,21 +2,31 @@ BASE_PATH="/home/vagrant/userfrosting" +# Welcome message +echo "\n\n" +echo " *****************************\n" +echo " * Welcome to UserFrosting ! *\n" +echo " *****************************\n" + # Update nodejs +echo "\n\n >> Updating npm\n" npm cache clean -f npm install -g n n -q lts # Ensure composer deps are installed +echo "\n\n >> Installating Composer\n" cd ${BASE_PATH} +composer self-update --1 composer install # Setup .env +echo "\n\n >> Setting up Sprinkles\n" echo 'UF_MODE=""' > app/.env echo 'DB_DRIVER="mysql"' >> app/.env echo 'DB_HOST="localhost"' >> app/.env echo 'DB_PORT="3306"' >> app/.env -echo 'DB_NAME="UserFrosting"' >> app/.env +echo 'DB_NAME="homestead"' >> app/.env echo 'DB_USER="homestead"' >> app/.env echo 'DB_PASSWORD="secret"' >> app/.env echo 'SMTP_HOST="host.example.com"' >> app/.env @@ -27,9 +37,10 @@ echo 'SMTP_PASSWORD="password"' >> app/.env cp app/sprinkles.example.json app/sprinkles.json # Install UserFrosting +echo "\n\n >> UserFrosting installation\n" php bakery debug php bakery migrate php bakery create-admin --username="admin" --email="admin@userfrosting.test" --password="adminadmin12" --firstName="Admin" --lastName="istrator" php bakery build-assets -echo "\n\nUserFrosting is ready at http://192.168.10.10/" +echo "\n\nUserFrosting should be ready at http://userfrosting.test (Don't forget to update your hosts file !)" diff --git a/vagrant/bootstrap.yaml b/vagrant/bootstrap.yaml index 49fd4f547..76165dd0a 100644 --- a/vagrant/bootstrap.yaml +++ b/vagrant/bootstrap.yaml @@ -18,8 +18,7 @@ folders: sites: - map: userfrosting.test to: /home/vagrant/userfrosting/public + php: "7.4" - map: phpmyadmin.test to: /usr/share/phpmyadmin - -databases: - - UserFrosting + php: "7.4" From 5313fe679df29ee9ef65ff3d883969236138b7ce Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Tue, 29 Dec 2020 16:51:08 -0500 Subject: [PATCH 08/14] Create new locator instead --- .../core/tests/Integration/I18n/SiteLocaleTest.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/sprinkles/core/tests/Integration/I18n/SiteLocaleTest.php b/app/sprinkles/core/tests/Integration/I18n/SiteLocaleTest.php index 15746ea7e..046fde7c7 100644 --- a/app/sprinkles/core/tests/Integration/I18n/SiteLocaleTest.php +++ b/app/sprinkles/core/tests/Integration/I18n/SiteLocaleTest.php @@ -15,6 +15,7 @@ use UserFrosting\I18n\Locale; use UserFrosting\Sprinkle\Core\I18n\SiteLocale; use UserFrosting\Tests\TestCase; +use UserFrosting\UniformResourceLocator\ResourceLocator; /** * SiteLocaleTest class. @@ -86,11 +87,9 @@ public function testgetAvailable(): void */ public function testgetAvailableOptions(): void { - // Implement fake locale file location - - /** @var \UserFrosting\UniformResourceLocator\ResourceLocator $locator */ - $locator = $this->ci->locator; - $locator->removeStream('locale')->registerStream('locale', '', __DIR__ . '/data', true); + // Implement fake locale file location & locator + $locator = new ResourceLocator(__DIR__); + $locator->registerStream('locale', '', 'data', true); // Set expectations. Note the sort applied here $expected = [ @@ -98,7 +97,9 @@ public function testgetAvailableOptions(): void 'fr_FR' => 'Tomato', // Just to be sure the fake locale are loaded ;) ]; - $options = $this->ci->locale->getAvailableOptions(); + /** @var \UserFrosting\Sprinkle\Core\I18n\SiteLocale */ + $locale = $this->ci->locale; + $options = $locale->getAvailableOptions(); $this->assertIsArray($options); $this->assertSame($expected, $options); From 0c6cca2d2d442259f82a0f38dc2efab51a0b5c1f Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Tue, 29 Dec 2020 17:45:25 -0500 Subject: [PATCH 09/14] Fix test to follow flysystem convention --- .../core/tests/Integration/Filesystem/FilesystemTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/sprinkles/core/tests/Integration/Filesystem/FilesystemTest.php b/app/sprinkles/core/tests/Integration/Filesystem/FilesystemTest.php index bc51a38fd..481d49a21 100644 --- a/app/sprinkles/core/tests/Integration/Filesystem/FilesystemTest.php +++ b/app/sprinkles/core/tests/Integration/Filesystem/FilesystemTest.php @@ -134,19 +134,23 @@ public function testNonExistingAdapter() /** * @depends testNonExistingAdapter + * @see https://github.com/thephpleague/flysystem/blob/13352d2303b67ecfc1306ef1fdb507df1a0fc79f/src/Adapter/Local.php#L47 */ public function testAddingAdapter() { $filesystemManager = $this->ci->filesystem; $filesystemManager->extend('localTest', function ($configService, $config) { - return new Filesystem(new LocalAdapter($config['root'])); + $adapter = new LocalAdapter($config['root']); + + return new Filesystem($adapter); }); $disk = $filesystemManager->disk('testingDriver'); $this->assertInstanceOf(FilesystemAdapter::class, $disk); // Make sure the path was set correctly - $this->assertEquals(\UserFrosting\STORAGE_DIR . \UserFrosting\DS . 'testingDriver' . \UserFrosting\DS, $disk->path('')); + $path = $disk->path(''); + $this->assertEquals(\UserFrosting\STORAGE_DIR . \UserFrosting\DS . 'testingDriver' . DIRECTORY_SEPARATOR, $path); } } From 4f901dce882f325091604bacab750b9057b932e6 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Tue, 29 Dec 2020 17:57:34 -0500 Subject: [PATCH 10/14] Changed Postgre action provider --- .github/workflows/Build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 8eaa6933c..253369a42 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -215,7 +215,7 @@ jobs: run: composer install --prefer-dist --no-progress --no-suggest - name: Setup PostgreSQL - uses: Harmon758/postgresql-action@v1.0.0 + uses: huaxk/postgis-action@v1 with: postgresql db: 'userfrosting' postgresql user: 'userfrosting' From ce0ae755ca7b4cdae0ee004d66f81cbe7da5af8f Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Tue, 29 Dec 2020 18:06:23 -0500 Subject: [PATCH 11/14] Reordering task (Current theory is Postgre is not 100% ready when task finish, so moving it earlier in the build should help) --- .github/workflows/Build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 253369a42..a262f4b09 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -195,6 +195,13 @@ jobs: extensions: mbstring, dom, fileinfo, gd, memcached, redis coverage: xdebug tools: pecl, composer:v1 + + - name: Setup PostgreSQL + uses: harmon758/postgresql-action@v1 + with: + postgresql db: 'userfrosting' + postgresql user: 'userfrosting' + postgresql password: 'password' - uses: actions/setup-node@v2 with: @@ -214,13 +221,6 @@ jobs: - name: Install Dependencies run: composer install --prefer-dist --no-progress --no-suggest - - name: Setup PostgreSQL - uses: huaxk/postgis-action@v1 - with: - postgresql db: 'userfrosting' - postgresql user: 'userfrosting' - postgresql password: 'password' - - name: Bakery Debug run: php bakery debug From 8daf5444bf4ca5bb23ad83b8b14e05dd64595a4f Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Thu, 4 Mar 2021 20:31:10 -0500 Subject: [PATCH 12/14] Update Build --- .github/workflows/Build.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index a262f4b09..fad51e30a 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -36,7 +36,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php_versions }} - extensions: mbstring, dom, fileinfo, gd, memcached, redis + extensions: mbstring, dom, fileinfo, gd, memcached, redis, pdo_sqlite coverage: xdebug tools: pecl, composer:v1 @@ -72,6 +72,12 @@ jobs: mysql database: 'userfrosting' mysql user: 'userfrosting' mysql password: 'password' + + - name: Wait for MySQL + run: | + while ! mysqladmin ping --host=127.0.0.1 --password=password --silent; do + sleep 1 + done - name: Copy .env run: php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');" @@ -120,7 +126,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php_versions }} - extensions: mbstring, dom, fileinfo, gd, memcached, redis + extensions: mbstring, dom, fileinfo, gd, memcached, redis, pdo_sqlite coverage: xdebug tools: pecl, composer:v1 @@ -192,7 +198,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php_versions }} - extensions: mbstring, dom, fileinfo, gd, memcached, redis + extensions: mbstring, dom, fileinfo, gd, memcached, redis, pdo_sqlite coverage: xdebug tools: pecl, composer:v1 From afe52f900daa113230f952e204f2de7a53f0a01f Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Thu, 4 Mar 2021 21:19:28 -0500 Subject: [PATCH 13/14] Update build definition --- .github/workflows/Build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index fad51e30a..0275b540b 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -98,6 +98,7 @@ jobs: run: app/vendor/bin/phpunit --coverage-clover=coverage.xml - name: Upload coverage to Codecov + if: github.event_name != 'schedule' uses: codecov/codecov-action@v1 with: file: ./coverage.xml @@ -166,6 +167,7 @@ jobs: run: app/vendor/bin/phpunit --coverage-clover=coverage.xml - name: Upload coverage to Codecov + if: github.event_name != 'schedule' uses: codecov/codecov-action@v1 with: file: ./coverage.xml @@ -198,7 +200,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php_versions }} - extensions: mbstring, dom, fileinfo, gd, memcached, redis, pdo_sqlite + extensions: mbstring, dom, fileinfo, gd, memcached, redis, pdo_sqlite, pdo_pgsql coverage: xdebug tools: pecl, composer:v1 @@ -240,6 +242,7 @@ jobs: run: app/vendor/bin/phpunit --coverage-clover=coverage.xml - name: Upload coverage to Codecov + if: github.event_name != 'schedule' uses: codecov/codecov-action@v1 with: file: ./coverage.xml @@ -311,7 +314,7 @@ jobs: fail-fast: false matrix: php_versions: ['7.4'] - node_versions: ['10', '11', '12', '14'] + node_versions: ['10', '12', '14'] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} From 977d0d781b9f77012ba170b412d8cb7b63a716d7 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Fri, 5 Mar 2021 20:11:47 -0500 Subject: [PATCH 14/14] Update Changelog --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 093b9cdf2..9a312cb33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [v4.4.5] + +### Changed +- Replaced Travis with Github Actions +- Force Composer 1.0 for Docker ([#1126]) +- Update error.html.twig - add container ([#1128]) +- Update some tests +- Update Vagrant doc & config + ## [v4.4.4] ### Fixed @@ -983,6 +992,8 @@ See [http://learn.userfrosting.com/upgrading/40-to-41](Upgrading 4.0.x to 4.1.x [#1107]: https://github.com/userfrosting/UserFrosting/pull/1107 [#1109]: https://github.com/userfrosting/UserFrosting/pull/1109 [#1114]: https://github.com/userfrosting/UserFrosting/pull/1114 +[#1126]: https://github.com/userfrosting/UserFrosting/pull/1126 +[#1128]: https://github.com/userfrosting/UserFrosting/pull/1128 [v4.2.0]: https://github.com/userfrosting/UserFrosting/compare/v4.1.22...v4.2.0 [v4.2.1]: https://github.com/userfrosting/UserFrosting/compare/v4.2.0...v.4.2.1 @@ -997,3 +1008,4 @@ See [http://learn.userfrosting.com/upgrading/40-to-41](Upgrading 4.0.x to 4.1.x [v4.4.2]: https://github.com/userfrosting/UserFrosting/compare/v4.4.1...v4.4.2 [v4.4.3]: https://github.com/userfrosting/UserFrosting/compare/v4.4.2...v4.4.3 [v4.4.4]: https://github.com/userfrosting/UserFrosting/compare/v4.4.3...v4.4.4 +[v4.4.5]: https://github.com/userfrosting/UserFrosting/compare/v4.4.4...v4.4.5