GithubHelp home page GithubHelp logo

easyengine / site-command Goto Github PK

View Code? Open in Web Editor NEW
17.0 6.0 28.0 2.62 MB

Performs basic site functions in easyengine

PHP 96.21% Gherkin 0.67% Mustache 3.12%
easyengine hacktoberfest hacktoberfest2020

site-command's Introduction

easyengine/site-command

Build Status

Quick links: Using | Contributing | Support

Using

This package implements the following commands:

ee site create --type=html

Runs the standard HTML site installation.

ee site create --type=html <site-name> [--ssl=<value>] [--wildcard] [--type=<type>] [--skip-status-check]

OPTIONS

<site-name>
	Name of website.

[--ssl=<value>]
	Enables ssl via letsencrypt certificate.

[--wildcard]
	Gets wildcard SSL .

[--type=<type>]
	Type of the site to be created. Values: html,php,wp etc.

[--skip-status-check]
	Skips site status check.

EXAMPLES

# Create html site
$ ee site create example.com

# Create html site with ssl from letsencrypt
$ ee site create example.com --ssl=le

# Create html site with wildcard ssl
$ ee site create example.com --ssl=le --wildcard

# Create html site with self signed certificate
$ ee site create example.com --ssl=self

ee site delete

Deletes a website.

ee site delete <site-name> [--yes]

OPTIONS

<site-name>
	Name of website to be deleted.

[--yes]
	Do not prompt for confirmation.

EXAMPLES

# Delete site
$ ee site delete example.com

ee site update

Supports updating and upgrading site.

ee site update [<site-name>] [--ssl=<ssl>] [--wildcard]
[<site-name>]
	Name of the site.

[--ssl=<ssl>]
	Enable ssl on site

[--wildcard]
	Enable wildcard SSL on site.

EXAMPLES

# Add SSL to non-ssl site
$ ee site update example.com --ssl=le

# Add SSL to non-ssl site
$ ee site update example.com --ssl=le --wildcard

# Add self-signed SSL to non-ssl site
$ ee site update example.com --ssl=self

ee site create --type=html

Runs the standard HTML site installation.

ee site create --type=html <site-name> [--ssl=<value>] [--wildcard] [--type=<type>] [--skip-status-check]

OPTIONS

<site-name>
	Name of website.

[--ssl=<value>]
	Enables ssl via letsencrypt certificate.

[--wildcard]
	Gets wildcard SSL .

[--type=<type>]
	Type of the site to be created. Values: html,php,wp etc.

[--skip-status-check]
	Skips site status check.

EXAMPLES

# Create html site
$ ee site create example.com

# Create html site with ssl from letsencrypt
$ ee site create example.com --ssl=le

# Create html site with wildcard ssl
$ ee site create example.com --ssl=le --wildcard

# Create html site with self signed certificate
$ ee site create example.com --ssl=self

ee site enable

Enables a website. It will start the docker containers of the website if they are stopped.

ee site enable [<site-name>] [--force] [--verify]

OPTIONS

[<site-name>]
	Name of website to be enabled.

[--force]
	Force execution of site enable.

[--verify]
	Verify if required global services are working.

EXAMPLES

# Enable site
$ ee site enable example.com

# Enable site with verification of dependent global services. (Note: This takes longer time to enable the
site.)
$ ee site enable example.com --verify

# Force enable a site.
$ ee site enable example.com --force

ee site disable

Disables a website. It will stop and remove the docker containers of the website if they are running.

ee site disable [<site-name>]

OPTIONS

[<site-name>]
	Name of website to be disabled.

EXAMPLES

# Disable site
$ ee site disable example.com

ee site ssl

Verifies ssl challenge and also renews certificates(if expired).

ee site ssl <site-name> [--force]

OPTIONS

<site-name>
	Name of website.

[--force]
	Force renewal.

ee site info

Display all the relevant site information, credentials and useful links.

ee site info [<site-name>]
[<site-name>]
	Name of the website whose info is required.

EXAMPLES

# Display site info
$ ee site info example.com

ee site list

Lists the created websites.

ee site list [--enabled] [--disabled] [--format=<format>]

abstract list

[--enabled]
	List only enabled sites.

[--disabled]
	List only disabled sites.

[--format=<format>]
	Render output in a particular format.
	---
	default: table
	options:
	  - table
	  - csv
	  - yaml
	  - json
	  - count
	  - text
	---

EXAMPLES

# List all sites
$ ee site list

# List enabled sites
$ ee site list --enabled

# List disabled sites
$ ee site list --disabled

# List all sites in JSON
$ ee site list --format=json

# Count all sites
$ ee site list --format=count

ee site reload --type=html

Runs the standard HTML site installation.

ee site reload --type=html <site-name> [--ssl=<value>] [--wildcard] [--type=<type>] [--skip-status-check]

OPTIONS

<site-name>
	Name of website.

[--ssl=<value>]
	Enables ssl via letsencrypt certificate.

[--wildcard]
	Gets wildcard SSL .

[--type=<type>]
	Type of the site to be created. Values: html,php,wp etc.

[--skip-status-check]
	Skips site status check.

EXAMPLES

# Create html site
$ ee site create example.com

# Create html site with ssl from letsencrypt
$ ee site create example.com --ssl=le

# Create html site with wildcard ssl
$ ee site create example.com --ssl=le --wildcard

# Create html site with self signed certificate
$ ee site create example.com --ssl=self

ee site restart --type=html

Runs the standard HTML site installation.

ee site restart --type=html <site-name> [--ssl=<value>] [--wildcard] [--type=<type>] [--skip-status-check]

OPTIONS

<site-name>
	Name of website.

[--ssl=<value>]
	Enables ssl via letsencrypt certificate.

[--wildcard]
	Gets wildcard SSL .

[--type=<type>]
	Type of the site to be created. Values: html,php,wp etc.

[--skip-status-check]
	Skips site status check.

EXAMPLES

# Create html site
$ ee site create example.com

# Create html site with ssl from letsencrypt
$ ee site create example.com --ssl=le

# Create html site with wildcard ssl
$ ee site create example.com --ssl=le --wildcard

# Create html site with self signed certificate
$ ee site create example.com --ssl=self

ee site share

Share a site online using ngrok.

ee site share <site-name> [--disable] [--refresh] [--token=<token>]

OPTIONS

<site-name>
	Name of website.

[--disable]
	Take online link down.

[--refresh]
	Refresh site share if link has expired.

[--token=<token>]
	ngrok token.

EXAMPLES

# Share a site online
$ ee site share example.com

# Refresh shareed link if expired
$ ee site share example.com --refresh

# Disable online link
$ ee site share example.com --disable

ee site clean

Clears Object and Page cache for site.

ee site clean [<site-name>] [--page] [--object]

OPTIONS

[<site-name>]
	Name of website to be enabled.

[--page]
	Clear page cache.

[--object]
	Clear object cache.

EXAMPLES

# Clear Both cache type for site.
$ ee site clean example.com

# Clear Object cache for site.
$ ee site clean example.com --object

# Clear Page cache for site.
$ ee site clean example.com --page

Contributing

We appreciate you taking the initiative to contribute to this project.

Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

Reporting a bug

Think you’ve found a bug? We’d love for you to help us get it fixed.

Before you create a new issue, you should search existing issues to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.

Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please create a new issue. Include as much detail as you can, and clear steps to reproduce if possible.

Creating a pull request

Want to contribute a new feature? Please first open a new issue to discuss whether the feature is a good fit for the project.

Support

Github issues aren't for general support questions, but there are other venues you can try: https://easyengine.io/support/

This README.md is generated dynamically from the project's codebase using ee scaffold package-readme (doc). To suggest changes, please submit a pull request against the corresponding part of the codebase.

site-command's People

Contributors

abhijitrakas avatar dharmin avatar dhsathiya avatar dishitpala avatar jayshamnani avatar kirtangajjar avatar mbtamuli avatar mrrobot47 avatar piyushkhurana avatar rahulsprajapati avatar sagarnasit avatar tersor avatar thrijith avatar vaishaliagola27 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

site-command's Issues

Cache type check missing in site delete sub-command

The cache type check is missing in site-deletion, due to that it is trying to disconnect the site from caching docker container even though it is not connected to it. The variable $cache_type has also not been declared in the class.

Add site update command

  • Upgrade PHP version
  • Upgrade to ssl (reverse not supported)
  • Upgrade cache (enable/disable)
  • Upgrade between site types
    • Upgrade between WP types - WP subdom, WP subdir

Add provision to filter site info

A provision to narrow down the data displayed in site info.
Something like: ee site info --field=<field> or something similar can be helpful.

Add --skip-cleanup flag

It would be very helpful while debugging site creation issues. Other than core developers, It would be helpful to contributors and package developers who would like to add custom site type.

Allow deletion of multiple sites.

Currently EasyEngine doesn't allow deletion of multiple sites.

root@localhost:~# ee site delete demo1.example.com demo.example.com
Error: Too many positional arguments: demo.example.com

Unable to run redis sites.

There is an error due to which sites created with

  1. --wpredis
  2. --wpsubdir --wpredis
  3. --wpsubdom --wpredis

doesn't start.

Global Services

For global services also, use docker-compose as it will help in case of upgrade.

site enable fails for ssl sites

Site enable currently fails in ssl sites:

$ ee site enable example.com

Enabling site example.com.
global-db: Service already running
PHP Warning:  file_put_contents(/opt/easyengine/sites/example.com/app/htdocs/check.html): failed to open stream: No such file or directory in phar:///usr/local/bin/ee/vendor/easyengine/site-command/src/helper/class-ee-site.php on line 642
PHP Fatal error:  Uncaught Exception: Unrecognized value in --ssl flag: letsencrypt in phar:///usr/local/bin/ee/vendor/easyengine/site-command/src/helper/class-ee-site.php:566
Stack trace:
#0 phar:///usr/local/bin/ee/vendor/easyengine/site-command/src/helper/class-ee-site.php(500): EE\Site\Type\EE_Site_Command->init_ssl('vanguard1.blr.r...', '/opt/easyengine...', 'letsencrypt', '0')
#1 phar:///usr/local/bin/ee/vendor/easyengine/site-command/src/helper/class-ee-site.php(311): EE\Site\Type\EE_Site_Command->www_ssl_wrapper()
#2 [internal function]: EE\Site\Type\EE_Site_Command->enable(Array, Array)
#3 phar:///usr/local/bin/ee/php/EE/Dispatcher/CommandFactory.php(96): call_user_func(Array, Array, Array)
#4 [internal function]: EE\Dispatcher\CommandFactory::EE\Dispatcher\{closure}(Array, Array)
#5 phar:///usr/local/bin/ee/php/EE/Dispatcher/Subcommand.php(425): call_user_func(Object(Closure), Array, Array)
#6 phar:///usr/local/bin/ee/php/EE/Runner.php(275): EE\Dispatcher\Subcommand->invoke(Array, Array, Array)
#7 phar:///usr/local/b in phar:///usr/local/bin/ee/vendor/easyengine/site-command/src/helper/class-ee-site.php on line 566
Warning: An Error occurred. Initiating clean-up.
Warning: Exiting gracefully after rolling back. This may take some time.
Success: Rollback complete. Exiting now.

Site disable should remove redirect files

Site disable needs to remove the redirect files otherwise there will be issues causing to other sites and wrong redirects by nginx-proxy.

While re-enabling the site it should be regenerated with appropriate values from database.

Returning info even if sitename doesn't exist.

root@localhost:~/ee-sites/single-le.mytest.in# ee site list
List of all Sites:

single-le.mytest.in

root@localhost:~/ee-sites/single-le.mytest.in# ee site info single.mytest.in
Details for site single-le.mytest.in:
+--------------------+----------------------------------------------+
| Access phpMyAdmin  | http://single-le.mytest.in/ee-admin/pma/     |
+--------------------+----------------------------------------------+
| Access mail        | http://single-le.mytest.in/ee-admin/mailhog/ |
+--------------------+----------------------------------------------+
| Site Title         | single-le.mytest.in                          |
+--------------------+----------------------------------------------+
| DB Root Password   | K3m2giH2evZA                                 |
+--------------------+----------------------------------------------+
| DB Name            | single_le_rstuff_in                          |
+--------------------+----------------------------------------------+
| DB User            | wordpress                                    |
+--------------------+----------------------------------------------+
| DB Password        | x3hEyke3DyYy                                 |
+--------------------+----------------------------------------------+
| E-Mail             | [email protected]                     |
+--------------------+----------------------------------------------+
| Cache Type         | none                                         |
+--------------------+----------------------------------------------+
| WordPress Username | admin                                        |
+--------------------+----------------------------------------------+
| WordPress Password | DOtZjDDCDeVB                                 |
+--------------------+----------------------------------------------+

Deprecate --wpredis flag

As now we support only one type of caching(wpredis). We should rename --wpredis to something more generic that indicates site will be cached like --cached.

Site creation fails.

Site creation fails. The .env file seems to be missing two entries, the database name and the username.

MYSQL_ROOT_PASSWORD=toNNLJknChmy
MYSQL_DATABASE=
MYSQL_USER=
MYSQL_PASSWORD=toNNLJknChmy

WORDPRESS_DB_HOST=db
VIRTUAL_HOST=demo.test
[email protected]
USER_ID=1000
GROUP_ID=1000

Site info inconsistent

Fields like Site, Site Root, Site Title are not available for all sites types.

# ee site info html.example.com
+--------------+----------------------------------------+
| Site         | https://html.example.com               |
+--------------+----------------------------------------+
| Site Root    | /opt/easyengine/sites/html.example.com |
+--------------+----------------------------------------+
| SSL          | Enabled                                |
+--------------+----------------------------------------+
| SSL Wildcard | Yes                                    |
+--------------+----------------------------------------+


# ee site info wordpress.example.com
+--------------------+---------------------------------------+
| Site               | https://wordpress.example.com         |
+--------------------+---------------------------------------+
| Site Title         | wordpress.example.com                 |
+--------------------+---------------------------------------+
| WordPress Username | admin                                 |
+--------------------+---------------------------------------+
| WordPress Password | ors1mDrEw9po                          |
+--------------------+---------------------------------------+
| DB Host            | global-db                             |
+--------------------+---------------------------------------+
| DB Name            | wordpress_example_com_6LrK9           |
+--------------------+---------------------------------------+
| DB User            | wordpress.example.com-KPn1ZC_PuDt9    |
+--------------------+---------------------------------------+
| DB Password        | wq2JRDLYXzbk                          |
+--------------------+---------------------------------------+
| E-Mail             | [email protected]           |
+--------------------+---------------------------------------+
| SSL                | Enabled                               |
+--------------------+---------------------------------------+
| SSL Wildcard       | No                                    |
+--------------------+---------------------------------------+
| Cache              | Enabled                               |
+--------------------+---------------------------------------+

Remove addition of extra prefix in utility function create_user_in_db

Site utility function create_user_in_db adds prefix to db name and db user even when it is passed by the user. This should be removed to respect the flags and user input.

Once this is done a PR is needed in site-type-wp as well as site-type-php to handle duplicate user check. This is because previously duplicate user clash was not possible as there was always a random suffix added. Now with new changes as this may be possible in case of user input it needs to go in try-catch block.

Create separate migration file for `site` and `site_meta`.

There are two table migrations in a single migration file. If any error occurs during site_meta migration then the site table shouldn't be there after revert but it will remain if we put both migrations in single file because drop table code is also in the same migration file which will not be executed if an error occurs in same migration.

Add confirmation to the delete commands

In the WP CLI world, commands that delete something usually come with a confirmation flag.

I noticed now that the ee site delete command has this warning:

Warning: Doesn't ask for confirmation

I'd recommend adding the confirmation flag. As it is a best practice so that the person is aware and confirm the action he/she is about to take.

Create http site and upgrade it to https in DNS challenge

Note: This issue pertains to wildcard certificates.

During DNS challenge, some DNS providers can take many hours before DNS changes have been propagated. As we do not have integration with any DNS providers(cloudflare, Route53 etc.), hence we gave users option to verify DNS challenge by themselves during SSL site creation using ee site ssl method.

However until DNS records are propogated, we cannot request certs from LetsEncrypt and hence cannot enable https on the site. So we need to create a http site and then upgrade it to https only after ee has certs for the site.

To do this, we need to do following:

  • Ensure site is created as http in database during site create
  • Ensure https redirection are not added till certs are received.
  • Site db entry should be changed to https and https redirection should be added

Fix ssl site creation issue when site is already deleted

Steps to reproduce:

1. ee site create example.com --le
2. ee site delete example.com
3. ee site create example.com --le

Expected output:
Site created in step 3 is https

Actual output:
Site created is http

Reason:
We do remove certs from nginx-proxy, but we don't remove certs from acme-conf directory(and we shouldn't).

Now when we create a new site in step 3, acmephp checks in acme-conf folder and assumes that certs are present hence they don't need to be requested.

Solution:
Call method to copy certs to nginx-proxy even if certs are present

Allow other PHP app installation

All my WordPress installations are now being transformed into Bedrock installations, also I deploy Laravel and Lumen apps in the servers.

These can be done with EasyEngine v3.x, but needs a bit of hacking. Mainly changing the document root. Any plan on these scenarios?

Allow provision for wildcard certificate for all site-types

Currently, EasyEngine only issues a wildcard certificate for subdomain multisite type. There should be a provision to allow the generation of wildcard certificate for any site-type. This would be helpful when someone has to create multiple sub-sites of the same, then it would be very simple to reuse the wildcard certificate instead of generating a new one every time. Also, it will ease the maintenance.

ee site create example.com --le=wildcard
ee site create one.example.com --le # will use the above wildcard domain
ee site create two.example.com --le # will use the above wildcard domain

Site delete should delete data from other tables

When we delete a site, we don't delete it's data from other tables like cron, auth, whitelist, site_meta etc...

Also it should trigger cleanup actions which would regenerate files (auth files, cron files etc...)
It should also purge cache of that site if any.

Things to do on cleanup:

  • Delete DB entries
  • Remove related files
  • Purge Cache

Update volume mountings for sites

Currently on /var/www/htdocs is being mounted to /opt/easyengine/sites/example.com/app/src.
Also, inside the above mentioned app directory there are services related directories of postfix, db etc.

Need to change the mounting such that:
/opt/easyengine/sites/example.com/app/ -> /var/www/
/opt/easyengine/sites/example.com/services/ -> Contains services related directories and data.

Remove redundant function reload_proxy_container

There are two functions doing same thing in site-utils - reload_proxy_container and reload_global_proxy_container. Since reload_global_proxy_container sounds better and is also used in other packages, we could replace reload_proxy_container with reload_global_proxy_container across all packages.

Unable to create site when in other site's path

Steps to reproduce -

ee site create a.test                                                                                                                                                             
cd /opt/easyengine/sites/a.test
ee site create b.test                                                                                                                                                             

This gives following error -

Error: a.test is not a valid site-name. Did you mean `ee site create b.test`?

Warning while creating site in beta.4

╭─root@bionic-test
╰─# ee cli version
EE 4.0.0-beta.4
╭─root@bionic-test
╰─# ee site create one.test
Warning: This is a beta version. Please don't use it in production.
Configuring project.
Success: Network started.
Success: Site connected to ee-nginx-proxy.
Creating WordPress site one.test.
Copying configuration files.
PHP Warning:  file_put_contents(/opt/easyengine/nginx/conf.d/one.test-redirect.conf): failed to open stream: No such file or directory in phar:///usr/local/bin/ee/vendor/easyengine/site-command/src/Site_Command.php on line 780
Success: Configuration files copied.
Pulling latest images. This may take some time.
Starting site's services.
Downloading and configuring WordPress.
Success: Host entry successfully added.
Checking and verifying site-up status. This may take some time.
.
Installing WordPress site.
Success: http://one.test has been created successfully!
Details for site one.test:
+--------------------+-----------------------------------+
| Site               | http://one.test                   |
+--------------------+-----------------------------------+
| Access phpMyAdmin  | http://one.test/ee-admin/pma/     |
+--------------------+-----------------------------------+
| Access mailhog     | http://one.test/ee-admin/mailhog/ |
+--------------------+-----------------------------------+
| Site Title         | one.test                          |
+--------------------+-----------------------------------+
| DB Root Password   | 6PtIQxkfDH5l                      |
+--------------------+-----------------------------------+
| DB Name            | one_test                          |
+--------------------+-----------------------------------+
| DB User            | wordpress                         |
+--------------------+-----------------------------------+
| DB Password        | CPg7xgUIvKeC                      |
+--------------------+-----------------------------------+
| E-Mail             | [email protected]                     |
+--------------------+-----------------------------------+
| Cache Type         | none                              |
+--------------------+-----------------------------------+
| SSL                | Not Enabled                       |
+--------------------+-----------------------------------+
| WordPress Username | admin                             |
+--------------------+-----------------------------------+
| WordPress Password | JjBnoRMlewo5                      |
+--------------------+-----------------------------------+
Site entry created.

On a fresh VM, a warning is being thrown. I've attached the log file also truncated to only contain information about this site.
ee.log

Improve site info

In the ee site info command, information about the site like status of ssl, auth, etc.

Update --wildcard message in site command

Update ee site le site-name with ee site ssl site-name in the following message.

IMPORTANT: Run ee site le site-name once the dns changes have propagated to complete the certification generation and installation.

Creating site with global database fails

Steps to Reproduce

  1. Get latest develop-v4 branch and install requirements
git clone https://github.com/EasyEngine/easyengine.git
cd easyengine
git checkout develop-v4
composer install
  1. Create site using ./bin/ee site create example.com --ssl=le --wildcard
  2. Create second site using ./bin/ee site create one.example.com --type=wp
  3. Create third site using ./bin/ee site create two.example.com --type=wp

Actual Results

curl -s -IL https://two.example.com/ | grep -Fi link
link: <https://two.example.com/index.php?rest_route=/>; rel="https://api.w.org/"
curl -s -IL https://two.example.com/ | grep -Fi link
link: <https://one.example.com/index.php?rest_route=/>; rel="https://api.w.org/"
curl -s -IL https://two.example.com/ | grep -Fi link
link: <https://two.example.com/index.php?rest_route=/>; rel="https://api.w.org/"
curl -s -IL https://two.example.com/ | grep -Fi link
link: <https://one.example.com/index.php?rest_route=/>; rel="https://api.w.org/"

Expected Results

curl -s -IL https://two.example.com/ | grep -Fi link
link: <https://two.example.com/index.php?rest_route=/>; rel="https://api.w.org/"
curl -s -IL https://two.example.com/ | grep -Fi link
link: <https://two.example.com/index.php?rest_route=/>; rel="https://api.w.org/"
curl -s -IL https://two.example.com/ | grep -Fi link
link: <https://two.example.com/index.php?rest_route=/>; rel="https://api.w.org/"
curl -s -IL https://two.example.com/ | grep -Fi link
link: <https://two.example.com/index.php?rest_route=/>; rel="https://api.w.org/"

Can't connect to MySQL server on 'db' (111 "Connection refused")

Getting this issue when creating a site.

Debug: COMMAND: docker-compose exec --user='www-data' php wp config create --dbuser='wordpress' --dbname='rahul_test4_local' --dbpass='dbpass' --dbhost='db'  --dbcharset=utf8 (33.629s)
Debug: STDOUT: ERROR 2003 (HY000): Can't connect to MySQL server on 'db' (111 "Connection refused")

Seem like the mysql/db service is not available or properly running at the time of site config create.

Adding healthcheck seems to be working for me which I suppose used to create docker container with making sure the "docker-compose up" command runs successfully after the health check pass else it will fail and then we will revert site operation.

Add following healthcheck in db service. ref: https://docs.docker.com/compose/compose-file/#healthcheck

healthcheck:
      test: "/etc/init.d/mysql status"
      interval: 1s
      retries: 120

Cannot create subdomain after domain has been created

I try to setup multiple sites on a single server with subdomains and get this error after the main domain site was created:

Warning: cURL error 51: SSL: no alternative certificate subject name matches target host name 'sub2.example.com' (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

To repeat this try following:

ee site create sub1.example.com --le   # => works
ee site create example.com --le        # => works
ee site create sub2.example.com --le   # => fails with the above error
ee site delete example.com             # => works
ee site create sub2.example.com --le   # => works
ee site create example.com --le        # => works
ee site create sub3.example.com --le   # => fails with the above error

Tested om Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-30-generic x86_64)
with EasyEngine v4 Beta-6 (same problem with Beta 5)

HTTP auth issues

  • site delete should also remove HTTP auth files
  • Enabling global auth does not allow creation of new sites

Update site-status check to accomodate global auth

site-status-check in site-utilities needs to be updated to send proper credentials in case global auth is set to get a proper 200 OK http code response. Currently, the status check fails as it gets a 401 Unauthorized response when global auth is setup.

Display correct message when site is not enabled

While verifying SSL on disabled site, following message is displayed -

$ ee site ssl example.com
Starting SSL verification.
Error: Site example.com is not enabled. Use `ee site up example.com` to enable it.

Correct message should be -

Use `ee site enable example.com` to enable it.

Errors due to incomplete search-replace

Running ee site list --enabled throws following error -

PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such column: is_enabled in phar:///usr/local/bin/ee/php/class-ee-db.php:114
Stack trace:
#0 phar:///usr/local/bin/ee/php/class-ee-db.php(114): PDO->prepare('SELECT * FROM s...')
#1 phar:///usr/local/bin/ee/php/class-ee-db.php(286): EE_DB->common_retrieval_function()
#2 phar:///usr/local/bin/ee/php/class-ee-db.php(275): EE_DB->get()
#3 phar:///usr/local/bin/ee/php/EE/Model/Base.php(180): EE_DB->all()
#4 phar:///usr/local/bin/ee/vendor/easyengine/site-command/src/helper/class-ee-site.php(105): EE\Model\Base::where('is_enabled', true)
#5 [internal function]: EE\Site\Type\EE_Site_Command->_list(Array, Array)
#6 phar:///usr/local/bin/ee/php/EE/Dispatcher/CommandFactory.php(96): call_user_func(Array, Array, Array)
#7 [internal function]: EE\Dispatcher\CommandFactory::EE\Dispatcher\{closure}(Array, Array)
#8 phar:///usr/local/bin/ee/php/EE/Dispatcher/Subcommand.php(425): call_user_func(Object(Closure), Array, Array)
#9 phar:///usr/local/bin/ee/php/EE/Runner in phar:///usr/local/bin/ee/php/class-ee-db.php on line 114
Warning: An Error occurred. Initiating clean-up.
Warning: Exiting gracefully after rolling back. This may take some time.
Success: Rollback complete. Exiting now.

To fix it, we have to replace is_enabled to site_enabled in https://github.com/EasyEngine/site-command/blob/develop/src/helper/class-ee-site.php#L105 and https://github.com/EasyEngine/site-command/blob/develop/src/helper/class-ee-site.php#L107

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.