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

Allow ghost backup to run with --no-prompt, take authData from command line arguments #1817

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tonydelanuez
Copy link

@tonydelanuez tonydelanuez commented Jan 28, 2024

ghost backup --no-prompt wasn't actually taking the arguments from the command line required to properly call the exportTask (authData).

This commit checks for authData {username, password} from the command line and passes through to the necessary task calls.

The test spec setup for these were a bit odd (I've never looked at this codebase before but this was blocking my work), so here are some screenshots? 😅

Note: One of the screenshotted "working" calls fails because localhost in Node 18 automagically favors iPv6. We successfully auth for the backup process with --no-prompt and some auth arguments.

Throw SystemError when not username and password passed but in no-prompt mode:
Screenshot 2024-01-27 at 6 33 00 PM

Without --no-prompt, use AuthData from interactive CLI:
Screenshot 2024-01-27 at 6 32 27 PM

With authdata provided and --no-prompt, successfully auth (don't worry, test password for my local dev instance):
Screenshot 2024-01-27 at 6 42 24 PM

Working on my actual Ghost instance:

tdoot@util-arm:/var/www/decked$ ../../code/Ghost-CLI/bin/ghost backup --no-prompt --username <redacted> --password <redacted>

Love open source? We’re hiring JavaScript Engineers to work on Ghost full-time.
https://careers.ghost.org


+ sudo systemctl is-active ghost_decked-gg-1
+ sudo mkdir -p /var/www/decked/backup
+ sudo cp /var/www/decked/backup/content-from-v5.76.2-on-2024-01-28-04-48-40.json /var/www/decked/content/data/content-from-v5.76.2-on-2024-01-28-04-48-40.json
+ sudo cp /var/www/decked/backup/members-from-v5.76.2-on-2024-01-28-04-48-40.csv /var/www/decked/content/data/members-from-v5.76.2-on-2024-01-28-04-48-40.csv
+ sudo chown -R ghost:ghost /var/www/decked/content
✔ Backing up site
Backup saved to /var/www/decked/backup-from-v5.76.2-on-2024-01-28-04-48-40.zip

`ghost backup --no-prompt` wasn't actually taking the arguments
from the command line required to properly call the exportTask
(authData).

This commit checks for authData {username, password} from the
command line and passes through to the necessary task calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant