ddev / ddev

Docker-based local PHP+Node.js web development environments
https://ddev.com
Apache License 2.0
2.43k stars 579 forks source link

Default Push confirmation message to "No" / "N" #6103

Closed cballenar closed 2 weeks ago

cballenar commented 1 month ago

Is there an existing issue for this?

Output of ddev debug test

Expand `ddev debug test` diagnostic information ``` Running bash [-c /var/folders/jk/0g46zw0x6nn884cx936clgnh0000gn/T/test_ddev.sh] ======= Existing project config ========= These config files were loaded for project test: [/Users/cballenar/Repositories/test/.ddev/config.yaml] name: test type: drupal10 php_version: 8.1 webserver_type: nginx-fpm webimage: ddev/ddev-webserver:v1.22.7 additional_hostnames: [] additional_fqdns: [] database: {mariadb 10.4} project_tld: ddev.site use_dns_when_possible: true composer_version: 2 nodejs_version: 18 default_container_timeout: 120 ======= Creating dummy project named tryddevproject-8580 in ../tryddevproject-8580 ========= OS Information: Darwin unknown.local 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:06 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T8103 arm64 ProductName: macOS ProductVersion: 14.4 BuildVersion: 23E214 User information: uid=501(cballenar) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),701(com.apple.sharepoint.group.1),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae) DDEV version: ITEM VALUE DDEV version v1.22.7 architecture arm64 db ddev/ddev-dbserver-mariadb-10.4:v1.22.7 ddev-ssh-agent ddev/ddev-ssh-agent:v1.22.7 docker 24.0.6 docker-compose v2.24.5 docker-platform docker-desktop mutagen 0.17.2 os darwin router ddev/ddev-traefik-router:v1.22.7 web ddev/ddev-webserver:v1.22.7 PROXY settings: HTTP_PROXY='' HTTPS_PROXY='' http_proxy='' NO_PROXY='' ======= DDEV global info ========= Global configuration: instrumentation-opt-in=true omit-containers=[] performance-mode=mutagen router-bind-all-interfaces=false internet-detection-timeout-ms=3000 disable-http2=false use-letsencrypt=false letsencrypt-email= table-style=default simple-formatting=false use-hardened-images=false fail-on-hook-fail=false required-docker-compose-version=v2.24.5 use-docker-compose-from-path=false project-tld=ddev.site xdebug-ide-location= no-bind-mounts=false router=traefik wsl2-no-windows-hosts-mgt=false router-http-port=80 router-https-port=443 mailpit-http-port=8025 mailpit-https-port=8026 traefik-monitor-port=10999 ======= DOCKER info ========= docker location: lrwxr-xr-x 1 root wheel 54 Mar 3 2022 /usr/local/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker Docker Desktop Version: Docker Desktop for Mac 4.23.0 build 120376 docker version: Client: Cloud integration: v1.0.35+desktop.4 Version: 24.0.6 API version: 1.43 Go version: go1.20.7 Git commit: ed223bc Built: Mon Sep 4 12:28:49 2023 OS/Arch: darwin/arm64 Context: default Server: Docker Desktop 4.23.0 (120376) Engine: Version: 24.0.6 API version: 1.43 (minimum version 1.12) Go version: go1.20.7 Git commit: 1a79695 Built: Mon Sep 4 12:31:36 2023 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.22 GitCommit: 8165feabfdfe38c65b599c4993d227328c231fca runc: Version: 1.1.8 GitCommit: v1.1.8-0-g82f18fe docker-init: Version: 0.19.0 GitCommit: de40ad0 DOCKER_DEFAULT_PLATFORM=notset ======= Mutagen Info ========= Mutagen is installed in ddev, version=0.17.2 -------------------------------------------------------------------------------- Name: test Identifier: sync_DAH17acJFTLDXx7DIQGNndJ1DYPT8tcv2fyScZHvkVO Labels: com.ddev.config-hash: 14ec34369b3ff3ec2757e0868f6d18b23a386b2c com.ddev.volume-signature: Users-cballenar-docker-run-1713284717 Configuration: Synchronization mode: Two Way Resolved Hashing algorithm: Default (SHA-1) Maximum allowed entry count: Default (2⁶⁴−1) Maximum staging file size: Default (18 EB) Symbolic link mode: POSIX Raw Ignore VCS mode: Default (Propagate) Ignores: /.git /.tarballs /.ddev/db_snapshots /.ddev/.importdb* .DS_Store .idea /sites/default/files Permissions mode: Default (Portable) Alpha: URL: /Users/cballenar/Repositories/test Configuration: Watch mode: Default (Portable) Watch polling interval: Default (10 seconds) Probe mode: Default (Probe) Scan mode: Default (Accelerated) Stage mode: Neighboring File mode: Default (0600) Directory mode: Default (0700) Default file/directory owner: Default Default file/directory group: Default Connected: Yes Synchronizable contents: 29 directories 79 files (146 kB) 0 symbolic links Beta: URL: docker://ddev-test-web/var/www/html DOCKER_HOST=unix:///Users/cballenar/.docker/run/docker.sock Configuration: Watch mode: Default (Portable) Watch polling interval: Default (10 seconds) Probe mode: Default (Probe) Scan mode: Default (Accelerated) Stage mode: Neighboring File mode: Default (0600) Directory mode: Default (0700) Default file/directory owner: Default Default file/directory group: Default Compression: Default (DEFLATE) Connected: Yes Synchronizable contents: 29 directories 79 files (146 kB) 0 symbolic links Status: Watching for changes -------------------------------------------------------------------------------- ======= Docker Info ========= Docker platform: docker-desktop Using Docker context: default (unix:///Users/cballenar/.docker/run/docker.sock) docker-compose: v2.24.5 Using DOCKER_HOST=unix:///Users/cballenar/.docker/run/docker.sock Docker version: 24.0.6 Able to run simple container that mounts a volume. Able to use internet inside container. Docker disk space: Filesystem Size Used Available Use% Mounted on overlay 146.4G 84.3G 54.6G 61% / Container ddev-test-db Stopped Container ddev-test-web Stopped Container ddev-test-web Stopped Container ddev-test-db Stopped Container ddev-test-db Removed Container ddev-test-web Removed Network ddev-test_default Removed Project test has been stopped. Stopped Mutagen daemon The ddev-ssh-agent container has been removed. When you start it again you will have to use 'ddev auth ssh' to provide key authentication again. Network ddev_default removed Existing docker containers: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES Network ddev_default created Starting tryddevproject-8580... Network ddev-tryddevproject-8580_default created Container ddev-ssh-agent Created Container ddev-ssh-agent Started ssh-agent container is running: If you want to add authentication to the ssh-agent container, run 'ddev auth ssh' to enable your keys. Building project images... Project images built in 0s. Container ddev-tryddevproject-8580-web Created Container ddev-tryddevproject-8580-db Created Container ddev-tryddevproject-8580-web Started Container ddev-tryddevproject-8580-db Started You have Mutagen enabled and your 'php' project type doesn't have `upload_dirs` set. For faster startup and less disk usage, set upload_dirs to where your user-generated files are stored. If this is intended you can disable this warning with `ddev config --disable-upload-dirs-warning`. Starting Mutagen sync process... Mutagen sync flush completed in 2s. For details on sync status 'ddev mutagen st tryddevproject-8580 -l' Waiting for web/db containers to become ready: [web db] Starting ddev-router if necessary... Container ddev-router Created Container ddev-router Started Waiting for additional project containers to become ready... All project containers are now ready. Successfully started tryddevproject-8580 Project can be reached at https://tryddevproject-8580.ddev.site https://127.0.0.1:50293 ======== Curl of site from inside container: HTTP/1.1 200 OK Server: nginx Date: Tue, 16 Apr 2024 16:26:44 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive Vary: Accept-Encoding ======== curl -I of http://tryddevproject-8580.ddev.site from outside: HTTP/1.1 200 OK Content-Type: text/html; charset=UTF-8 Date: Tue, 16 Apr 2024 16:26:44 GMT Server: nginx Vary: Accept-Encoding ======== full curl of http://tryddevproject-8580.ddev.site from outside: Success accessing database... db via TCP/IP ddev is working. You will want to delete this project with 'ddev delete -Oy tryddevproject-8580' ======== Project ownership on host: drwxr-xr-x 4 cballenar staff 128 Apr 16 12:25 ../tryddevproject-8580 ======== Project ownership in container: drwxr-xr-x 4 cballenar dialout 4096 Apr 16 16:26 /var/www/html ======== In-container filesystem: Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/vda1 ext4 153472156 87173620 58469704 60% /var/www ======== curl again of tryddevproject-8580 from host: Success accessing database... db via TCP/IP ddev is working. You will want to delete this project with 'ddev delete -Oy tryddevproject-8580' Thanks for running the diagnostic. It was successful. Please provide the output of this script in a new gist at gist.github.com Running ddev launch in 5 seconds Please run cleanup after debugging with 'ddev debug testcleanup' ```

Expected Behavior

When performing sensitive operations such as push to an environment (possibly prod) and prompted to confirm, I expect the confirmation script to default to "No", e.g.,

Would you like to continue (not recommended)? **[N/y]** (no):

Actual Behavior

When running ddev [provider] push the confirmation message reads:

Would you like to continue (not recommended)? **[Y/n]** (yes):

Steps To Reproduce

  1. setup any project with a web_environment
  2. run ddev [provider] push

Anything else?

According to the confirm script the logic seems to already be defaulting to false. (can someone confirm this?)

Because this utility is used elsewhere, and is likely already expected in some cases where default "Y" makes sense, it'll be good to create another function or pass another variable to this function to obtain an inverse action of the confirmation message. But either way it'd risk confusing any users that may already be accustomed to this.

rfay commented 1 month ago

PR is welcome!

Also note that removing the push section from a custom provider integration is a good idea.

cballenar commented 1 month ago

Awesome, i'll work on it.

Is 'removing the push section' an existing feature? Because that also crossed my mind and I thought about submitting a feature request for that.

Thanks @rfay !

rfay commented 1 month ago

All hosting integrations can be edited. See https://ddev.readthedocs.io/en/latest/users/providers/

DDEV also provides the push command to push database and files to upstream. This is very dangerous to your upstream site and should only be used when appropriate. We don’t even recommended implementing the push stanzas in your YAML file, but it’s there if it suits your workflow.