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

refactor: remove imagick dependency #5143

Merged
merged 4 commits into from May 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
extensions: imagick, redis
extensions: redis
coverage: none
- name: Check PHP Version
run: php -v
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: imagick, redis
extensions: redis
coverage: none
- name: Check PHP Version
run: php -v
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Expand Up @@ -41,7 +41,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
extensions: imagick, redis
extensions: redis
coverage: none
- name: Check PHP Version
run: php -v
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/migration_tests.yml
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: imagick, redis, ${{ matrix.connection }}
extensions: redis, ${{ matrix.connection }}
coverage: none
- name: Check PHP Version
run: php -v
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -77,7 +77,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
extensions: imagick, redis
extensions: redis
coverage: none

# Composer
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
extensions: imagick, redis
extensions: redis
coverage: none

- name: Get Composer Cache Directory
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
extensions: imagick, redis
extensions: redis
coverage: none

- name: Get Composer Cache Directory
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Expand Up @@ -41,7 +41,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: imagick, redis, ${{ matrix.connection }}
extensions: redis, ${{ matrix.connection }}
coverage: none
- name: Check PHP Version
run: php -v
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: imagick, redis, ${{ matrix.connection }}
extensions: redis, ${{ matrix.connection }}
coverage: xdebug
- name: Check PHP Version
run: php -v
Expand Down
1 change: 0 additions & 1 deletion .platform.app.yaml
Expand Up @@ -15,7 +15,6 @@ runtime:
- gmp
- redis
- sodium
- imagick

# The hooks that will be performed when the package is deployed.
hooks:
Expand Down
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -13,7 +13,6 @@
"ext-bcmath": "*",
"ext-gd": "*",
"ext-gmp": "*",
"ext-imagick": "*",
"ext-intl": "*",
"ext-redis": "*",
"asbiin/laravel-webauthn": "^1.0",
Expand Down
13 changes: 6 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 30 additions & 16 deletions config/google2fa.php
Expand Up @@ -3,43 +3,45 @@
return [

/*
* Auth container binding
* Enable / disable Google2FA.
*/

'enabled' => env('MFA_ENABLED', env('2FA_ENABLED', true)),

/*
* Lifetime in minutes.
*
* In case you need your users to be asked for a new one time passwords from time to time.
*/

'lifetime' => 0, // 0 = eternal
'lifetime' => env('OTP_LIFETIME', 0), // 0 = eternal

/*
* Renew lifetime at every new request.
*/

'keep_alive' => true,
'keep_alive' => env('OTP_KEEP_ALIVE', true),

/*
* Auth container binding
* Auth container binding.
*/

'auth' => 'auth',

/*
* 2FA verified session var
* Guard.
*/
'guard' => '',

/*
* 2FA verified session var.
*/

'session_var' => 'google2fa',

/*
* One Time Password request input name
* One Time Password request input name.
*/
'otp_input' => 'one_time_password',

/*
* One Time Password Window
* One Time Password Window.
*/
'window' => 8,

Expand All @@ -49,22 +51,34 @@
'forbid_old_passwords' => false,

/*
* User's table column for google2fa secret
* User's table column for google2fa secret.
*/
'otp_secret_column' => 'google2fa_secret',

/*
* One Time Password View
* One Time Password View.
*/
'view' => 'auth/validate2fa',

/*
* One Time Password error message
* One Time Password error message.
*/
'error_messages' => [
'wrong_otp' => 'The two factor authentication has failed.',
'wrong_otp' => "The 'One Time Password' typed was wrong.",
'cannot_be_empty' => 'One Time Password cannot be empty.',
'unknown' => 'An unknown error has occurred. Please try again.',
'unknown' => 'An unknown error has occurred. Please try again.',
],

/*
* Throw exceptions or just fire events?
*/
'throw_exceptions' => env('OTP_THROW_EXCEPTION', true),

/*
* Which image backend to use for generating QR codes?
*
* Supports imagemagick, svg and eps
*/
'qrcode_image_backend' => \PragmaRX\Google2FALaravel\Support\Constants::QRCODE_IMAGE_BACKEND_SVG,

];
1 change: 0 additions & 1 deletion docs/installation/providers/cpanel.md
Expand Up @@ -39,7 +39,6 @@ Monica can be configured in shared hosting environments with a little difference
- sodium
- xml
- zip
- imagick

In most cases, this will be under the section called 'PHP Version' in cPanel where you can enable and disable modules.

Expand Down
2 changes: 1 addition & 1 deletion docs/installation/providers/debian.md
Expand Up @@ -45,7 +45,7 @@ sudo apt install -y git
Install PHP 7.4 with these extensions:

```sh
sudo apt install -y php php-bcmath php-curl php-gd php-gmp php-imagick \
sudo apt install -y php php-bcmath php-curl php-gd php-gmp \
php-intl php-mbstring php-mysql php-redis php-xml php-zip
```

Expand Down
1 change: 0 additions & 1 deletion docs/installation/providers/generic.md
Expand Up @@ -47,7 +47,6 @@ If you don't want to use Docker, the best way to setup the project is to use the
- sodium
- xml
- zip
- imagick

**Composer:** After you're done installing PHP, you'll need the Composer dependency manager. It is not enough to just install Composer, you also need to make sure it is installed globally for Monica's installation to run smoothly:

Expand Down
4 changes: 2 additions & 2 deletions docs/installation/providers/ubuntu.md
Expand Up @@ -56,8 +56,8 @@ Then install php 7.4 with these extensions:
```sh
sudo apt update
sudo apt install -y php7.4 php7.4-bcmath php7.4-cli php7.4-curl php7.4-common \
php7.4-fpm php7.4-gd php7.4-gmp php7.4-imagick php7.4-intl php7.4-json \
php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-redis php7.4-xml php7.4-zip
php7.4-fpm php7.4-gd php7.4-gmp php7.4-intl php7.4-json php7.4-mbstring \
php7.4-mysql php7.4-opcache php7.4-redis php7.4-xml php7.4-zip
```

**Composer:** After you're done installing PHP, you'll need the [Composer](https://getcomposer.org/download/) dependency manager.
Expand Down
3 changes: 1 addition & 2 deletions resources/js/components/settings/MfaActivate.vue
Expand Up @@ -19,9 +19,8 @@

<div class="panel-body">
{{ $t('settings.2fa_enable_otp') }}
<div v-html="image"></div>
<p>
<img id="barcode" alt="Image of QR barcode" :src="image" />
<br />
{{ $t('settings.2fa_enable_otp_help') }}
<code id="secretkey">
{{ secret }}
Expand Down
2 changes: 0 additions & 2 deletions scripts/docker/Dockerfile
Expand Up @@ -64,13 +64,11 @@ RUN set -ex; \
pecl install APCu; \
pecl install memcached; \
pecl install redis; \
pecl install imagick; \
\
docker-php-ext-enable \
apcu \
memcached \
redis \
imagick \
; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
Expand Down
4 changes: 2 additions & 2 deletions scripts/vagrant/build/install-monica.sh
Expand Up @@ -52,8 +52,8 @@ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin

echo -e "\n\033[4;32mInstalling packages for Monica\033[0;40m"
apt-get install -y php7.4-bcmath php7.4-cli php7.4-curl php7.4-common php7.4-fpm \
php7.4-gd php7.4-gmp php7.4-imagick php7.4-intl php7.4-json php7.4-mbstring \
php7.4-mysql php7.4-opcache php7.4-redis php7.4-xml php7.4-zip >/dev/null
php7.4-gd php7.4-gmp php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql \
php7.4-opcache php7.4-redis php7.4-xml php7.4-zip >/dev/null

echo -e "\n\033[4;32mInstalling node.js\033[0;40m"
curl -fsSL https://deb.nodesource.com/setup_14.x | bash - >/dev/null
Expand Down