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

Implement auto update feature #813

Merged
merged 6 commits into from
Mar 10, 2023
Merged

Implement auto update feature #813

merged 6 commits into from
Mar 10, 2023

Conversation

aancw
Copy link
Contributor

@aancw aancw commented Mar 9, 2023

Fixes #812

For testing this feature, you need to clone my update-package branch and change the version in cargo.toml to previous version because the latest version is 2.9.0.

version = "2.8.0"

Tested on x86_64-macos. Need tester for linux and windows.

❯ ./feroxbuster --update
Checking target-arch... x86_64-macos
Checking current version... v2.8.0
Checking latest released version... v2.9.0
New release found! v2.8.0 --> v2.9.0
New release is compatible

feroxbuster release status:
  * Current exe: "/Users/user/GitHub/feroxbuster/target/debug/feroxbuster"
  * New exe release: "x86_64-macos-feroxbuster.tar.gz"
  * New exe download url: "https://api.github.com/repos/epi052/feroxbuster/releases/assets/98535323"

The new release will be downloaded/extracted and the existing binary will be replaced.
Do you want to continue? [Y/n] y
Downloading...
[00:00:01] [========================================] 2.18 MiB/2.18 MiB (0s) Done                                                                                                                                        Extracting archive... Done
Replacing binary file... Done
Updated version: `2.9.0`!

Landing a Pull Request (PR)

Long form explanations of most of the items below can be found in the CONTRIBUTING guide.

Branching checklist

  • There is an issue associated with your PR (bug, feature, etc.. if not, create one)
  • Your PR description references the associated issue (i.e. fixes #123456)
  • Code is in its own branch
  • Branch name is related to the PR contents
  • PR targets main

Static analysis checks

  • All rust files are formatted using cargo fmt
  • All clippy checks pass when running cargo clippy --all-targets --all-features -- -D warnings -A clippy::mutex-atomic
  • All existing tests pass

Documentation

Additional Tests

  • New code is unit tested
  • New code is integration tested, as needed
  • New tests pass

@epi052
Copy link
Owner

epi052 commented Mar 10, 2023

started a review, should have it done tomorrow morning 🙏

@epi052
Copy link
Owner

epi052 commented Mar 10, 2023

first pass looked good! this is a really nice quality of life addition. I made some comments iwth request for edits, take your time with any response, and thank you!

README.md Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
ferox-config.toml.example Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
src/banner/container.rs Outdated Show resolved Hide resolved
tests/test_banner.rs Outdated Show resolved Hide resolved
src/parser.rs Outdated Show resolved Hide resolved
src/parser.rs Outdated Show resolved Hide resolved
src/parser.rs Outdated Show resolved Hide resolved
src/parser.rs Show resolved Hide resolved
@aancw
Copy link
Contributor Author

aancw commented Mar 10, 2023

Okay. I will start to update the code

@aancw
Copy link
Contributor Author

aancw commented Mar 10, 2023

This is after error handling and match condition for update

  • When application is uptodate
feroxbuster/target/debug  update-package [!]
❯ ./feroxbuster --update
Checking target-arch... x86_64-macos
Checking current version... v2.9.0
Checking latest released version... v2.9.0

Feroxbuster 2.9.0 is up to date
  • If something error happen, self_update will handle the error and feroxbuster just print the error
feroxbuster/target/debug  update-package [!]
❯ ./feroxbuster --update
Checking target-arch... x86_64-macos
Checking current version... v2.9.0
Checking latest released version...
[ERROR] ReqwestError: error sending request for url (https://api.github.com/repos/epi052/feroxbuster/releases/latest): error trying to connect: dns error: failed to lookup address information: nodename nor servname provided, or not known
  • If update available
feroxbuster/target/debug  update-package [!]
❯ ./feroxbuster --update
Checking target-arch... x86_64-macos
Checking current version... v2.8.0
Checking latest released version... v2.9.0
New release found! v2.8.0 --> v2.9.0
New release is compatible

feroxbuster release status:
  * Current exe: "/Users/user/feroxbuster/target/debug/feroxbuster"
  * New exe release: "x86_64-macos-feroxbuster.tar.gz"
  * New exe download url: "https://api.github.com/repos/epi052/feroxbuster/releases/assets/98535323"

The new release will be downloaded/extracted and the existing binary will be replaced.
Do you want to continue? [Y/n] y
Downloading...
[00:00:14] [========================================] 2.18 MiB/2.18 MiB (0s) Done                                                       Extracting archive... Done
Replacing binary file... Done

Feroxbuster updated to 2.9.0 version

@aancw
Copy link
Contributor Author

aancw commented Mar 10, 2023

All requested change is resolved. Please review my change when you are available. Thank you.

@epi052
Copy link
Owner

epi052 commented Mar 10, 2023

Looks great, tysm! merging

@epi052 epi052 merged commit 4067be2 into epi052:main Mar 10, 2023
@epi052
Copy link
Owner

epi052 commented Mar 10, 2023

@all-contributors add @aancw for ideas

@allcontributors
Copy link
Contributor

@epi052

I've put up a pull request to add @aancw! 🎉

@aancw
Copy link
Contributor Author

aancw commented Mar 11, 2023

Looks great, tysm! merging

You're welcome. Sorry i was forgot about the updated test text that cause error in CI

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.

[FEATURE REQUEST] Auto Update feature
2 participants