Magento 2 module for ngrok.io service support

Overview

Magento 2 ngrok

Magento 2 module for ngrok service support. Automatically updates Magento base url based on domain used in the request. Modifies full-page and block-html caching to separate Magento caches for local and ngrok domains. No broken links or non loaded scripts and styles while browsing Magento web instance.

Installation

To install the module to your local Magento 2 dev environment, simply run the command below.

composer require --dev shkoliar/magento-ngrok

The next step is to check if module is installed and exists in the modules list.

bin/magento module:status

And the last part is enabling the module.

bin/magento module:enable Shkoliar_Ngrok

Optionally you may want to run also bin/magento setup:upgrade and bin/magento setup:di:compile commands to ensure that the enabled modules are properly registered and classes are generated.

Usage

Module itself does not require any configuration, it checks for request domain and activated only if it's .ngrok.io. So it works only when it needed for ngrok secure tunnels.

License

MIT

You might also like...
The Assure Alliance support website. This website is based on Questions2Answers and is a forum for support using Biblical Tools

The Assure Alliance support website. This website is based on Questions2Answers and is a forum for support using Biblical Tools

The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.

netz98 magerun CLI tools for Magento 2 The n98 magerun cli tools provides some handy tools to work with Magento from command line. Build Status Latest

 Content Fuzzyfyr Module for Magento® 2
Content Fuzzyfyr Module for Magento® 2

Content Fuzzyfyr Module for Magento® 2 The Content Fuzzyfyr module for Magento® 2 fills up empty content fields - and if needed - switches real conten

Magento 2 module to quickly acces products, orders and customer from admin menu

Magento 2 module to quickly access product, order or customer views Introduction The Magento 2 backend can be sluggish. Ever wanted to access a produc

Extract and evolution of the magento2-currency-precision module from the magento2-jp project from @Magento

Currency Precision Module for Magento 2 This module aims to help merchants to manage easily their currency precision in Magento 2. DISCLAIMER Initiall

A Magento 1.x module which facilitates automatic purging of static assets from HTTP caches such as browser cache, CDN, Varnish, etc using best practices outlined within the HTML5 boilerplate community.

Magento Cachebuster Cachebuster is a Magento module which facilitates automatic purging of static assets from HTTP caches such as browser cache, CDN,

New Ultimate Module Creator for Magento 1.7 +

Ultimate Module Creator 1.9.6.0 Notice Because of lack of time, motivation and because Magento2 is already a mature platform, I'm deciding to pull the

Magento 2 Message Queue Open Source Module

Magento 2 Message Queue Module Lightweight implementation of message queue for Magento 2 Community Edition. System requirements This extension support

Module for integrating Fastly CDN with Magento 2 installations

FASTLY CDN FOR MAGENTO2 DOCUMENTATION Thank you for using the "Fastly CDN module for Magento2" (Fastly_Cdn). This package contains everything you need

Comments
  • Incorrect URLs after first page load

    Incorrect URLs after first page load

    I've been able to successfully load the first page of my site, but every link that is generated after that points to my usual localhost URL rather than my ngrok URL.

    I notice in StoreBaseUrl::afterGetBaseUrl() that the $result is https://local.mydevsite.com/index.php/en_CA/ and thus isn't getting picked up in the conditional on line 48. That being said, I'm not sure that it's supposed to be since it isn't technically a base URL at that point. I also tried removing the first part of the condition to force it to use the ngrok URL, and that does work, but none of the static assets load, so I'm not able to test properly.

    The only other thing I could think of was my nginx config, but I don't see anything obvious there (I've attached it in case you have time to look at it). Do you have any ideas?

    I forgot to mention, my Magento version is 2.3.3. I'm sure this works on a clean install, so I'm hoping you might be able to wager a guess as to what I could look at changing.

    anon_nginx.txt

    opened by jamiethorpe 2
  • Optimized for use Ngrok v2 free, compatibility for PHP 8.1 and Magento 2.4.x

    Optimized for use Ngrok v2 free, compatibility for PHP 8.1 and Magento 2.4.x

    Optimized for use with free account of Ngrok, Compatibility for PHP 7.4 and PHP 8.1. Compatibility for Magento 2.3.x and Magento 2.4.x. Prevent Loop when auto redirect is enable in Magento

    opened by josecruzchavez 0
  • infinite redirects

    infinite redirects

    First I want to say thank you for building this and making it public. I very much appreciate it. I've been having some issues getting this to work correctly.

    I'm running magento2 in wamp with a virtual host name 'http://magento.local' which works correctly loading magento at that url. I am not forcing secure url on frontend or admin. When I go to the ngrok 'http://xxx.ngrok.io' url, magento loads the homepage but with all css and js resources broken as they point to the local url of 'http://magento.local and are blocked by cross domain origin'. So of course now I install and enable this module.

    with the module installed and enabled and cache cleared, setup upgrade and di compile run. index reindexed etc.

    At the Ngrok url http://xxx.ngrok.io the I get an infinite 302 redirect loop back to that same ngrok url

    hitting a static php file directly 'http://xxx.ngrok.io/ngroktest/test.php' it does return a successful 200

    When I log __METHOD__ at the top of Shkoliar\Ngrok\Plugin\Model::afterGetBaseUrl, I see that the method is running, when I comment out the method, the homepage loads but with all resources blocked pointing to the 'magento.local' path.

    I have disabled and cleared all caches, I have run cache:clean and cache:flush, setup:update and di:compile along with index:reindex and static-content:deploy -f. I have deploy mode in developer. I have tried this with rewrite on and off. I have tried clearing browser cache and cookies, and using different browsers I never used before. I am running ngrok like so ngrok http -host-header=magento.local 80

    Is there something else I am missing?

    opened by eraq 7
Owner
Dmitry Shkoliar
Zend Certified PHP Engineer, Magento 2 Certified, React, TypeScript, Docker, Varnish, PWA.
Dmitry Shkoliar
Magento 2 Module Experius Page Not Found 404. This module saves all 404 url to a database table

Magento 2 Module Experius Page Not Found 404 This module saves all 404 urls to a database table. Adds an admin grid with 404s It includes a count so y

Experius 28 Dec 9, 2022
Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Strategery 123 Nov 20, 2021
This Magento extension provides a Real Full Page Caching for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

This Magento extension provides a Real Full Page Caching (FPC) for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

Hugues Alary 95 Feb 11, 2022
Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.

TARS - A Linux Foundation Project TARS Foundation Official Website TARS Project Official Website WeChat Group: TARS01 WeChat Offical Account: TarsClou

THE TARS FOUNDATION PROJECTS 9.6k Jan 1, 2023
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
MOFHY Lite is a priceless MyOwnFreeHost Client Area for account management, ticket support system and a free ssl service

MOFHY Lite is a priceless MyOwnFreeHost Client Area for account management, ticket support system and a free ssl service. It has easy to use features much like the WHMCS Digit UI interface.

MOFHY Developers 1 Oct 21, 2022
Self-service RMA for Magento.

Simple Returns Self-service RMA for Magento. Table of Contents Description Features Customer Administrator Developer Other Notes Documentation Install

Aurora Extensions 22 Sep 18, 2022
Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers

Magento 2 SMTP Extension - Gmail, G Suite, Amazon SES, Office 365, Mailgun, SendGrid, Mandrill and other SMTP servers. For Magento 2.0.x, 2.1.x, 2.2.x

MagePal :: Magento Extensions 303 Oct 7, 2022
Michael Pratt 307 Dec 23, 2022