Commit Graph

59 Commits

Author SHA1 Message Date
Roger ccc8643d86 feat: add interactive terminal password prompt for keychain unlock (#558)
* feat(darwin): add interactive terminal password prompt for keychain unlock (#556)
* test: add unit tests for keyretriever and address review feedback

- Add errStorageNotFound sentinel error for precise error matching
- Non-TTY TerminalPasswordRetriever returns nil silently (review #558)
- Add darwin tests: findStorageKey, empty password, non-TTY skip
- Add linux tests: FallbackRetriever peanuts key, DefaultRetriever chain

* fix: add nolint:unused for errStorageNotFound on Windows, clean up error message

errStorageNotFound is only used on darwin/linux; Windows lint flagged it
as unused. Also simplify error format to avoid "storage" duplication.

* fix: add nolint:unused for errStorageNotFound, simplify error message

errStorageNotFound is only referenced on darwin and linux; Windows lint
flags it as unused. Also remove redundant "storage" prefix from the
error format string.
2026-04-06 01:27:13 +08:00
Roger 4c3dd9704f chore: add Go version lint check, modernize issue templates (#557)
- Add go.mod version check in lint workflow (fails if go directive != 1.20)
- Add golang.org/x/sys to dependabot ignore list (newer versions require Go 1.21+)
- Fix golang.org/x/text ignore comment
- Migrate issue templates from markdown to YAML forms:
- Update PR template (dev → main, add go.mod checklist item)
- Update .gitignore for YAML issue templates
2026-04-06 00:33:25 +08:00
dependabot[bot] a1d4fddddf chore(deps): bump codecov/codecov-action from 5 to 6 (#553)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5 to 6.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-05 21:43:10 +08:00
Roger 6902243895 chore: update CI/CD workflows, Homebrew and new contributors (#552) 2026-04-05 21:18:49 +08:00
Roger 2c4e871e59 fix: strip host_key prefix from Chrome 130+ cookie values (#526)
* fix: strip SHA256(host_key) prefix from Chrome 130+ cookie values

Chrome 130 (Cookie DB schema v24) prepends SHA256(domain) to cookie
values before encryption to prevent cross-domain replay attacks.
After decryption, this 32-byte hash must be verified and stripped.

Changes:
- Add stripCookieHash() that verifies SHA256(host_key) and strips
  the prefix only when it matches (auto-compatible with older Chrome)
- Fix edge case: cookies with empty values (exactly 32 bytes = hash only)
- Add decrypt_test.go with v10 round-trip encryption/decryption test
- Add stripCookieHash test cases for v24+, older Chrome, empty values,
  short values, and host mismatch scenarios

Closes #524

* fix: strip SHA256(host_key) prefix from Chrome 130+ cookie values

Chrome 130 (Cookie DB schema v24) prepends SHA256(domain) to cookie
values before encryption to prevent cross-domain replay attacks.
After decryption, this 32-byte hash must be verified and stripped.

Changes:
- Add stripCookieHash() that verifies SHA256(host_key) and strips
  the prefix only when it matches (auto-compatible with older Chrome)
- Fix edge case: cookies with empty values (exactly 32 bytes = hash only)
- Add table-driven decrypt tests for v10/v20/DPAPI per platform
- Add Windows-specific DPAPI round-trip test using CryptProtectData
- Add shared testAESKey constant in testutil_test.go
- Add stripCookieHash tests for v24+, older Chrome, empty values,
  short values, and host mismatch scenarios
- Extend lint CI to run on ubuntu, windows, and macos

Closes #524

* fix: remove DPAPI test from darwin/linux (returns nil on Linux)

DecryptWithDPAPI returns nil error on Linux (silent no-op) but error
on macOS, causing the test to fail on Ubuntu CI. DPAPI round-trip
testing is properly covered in decrypt_windows_test.go.

* fix: resolve Windows CI lint errors exposed by multi-platform lint

- Add _ = before windows.CloseHandle calls to satisfy errcheck
- Add build tag to params.go (only used on macOS/Linux, not Windows)

* fix: add .gitattributes to force LF and refactor cookie tests

- Add .gitattributes with `* text=auto eol=lf` to prevent CRLF
  conversion on Windows CI causing gofumpt false positives
- Add .gitattributes to .gitignore whitelist
- Refactor stripCookieHash tests into table-driven style

* fix: address Copilot review on decrypt tests

- Assert error on wrong key instead of ignoring it (AES-CBC returns
  padding error, not silent empty result)
- Guard empty plaintext in encryptWithDPAPI to prevent nil pointer panic
- Convert uint32 to int for make/copy slice bounds in Windows test

* fix: assert specific error message in wrong key decrypt test
2026-04-04 01:41:01 +08:00
Roger d0971ca098 chore: update CI, golangci-lint, and CLAUDE.md (#511)
* chore: update CI, golangci-lint, and CLAUDE.md
* fix: resolve CI failures on Windows test and lint
* fix: resolve Windows test path and main.go line length lint issues
* fix: auto-format log/ with gofumpt, exclude pre-refactoring lint issues
* fix: resolve remaining lint issues, remove unnecessary exclusions
* fix: remove invalid G117 gosec rule, use text exclusion for secret pattern
* fix: align CI golangci-lint version with local (v2.4 -> v2.10)
2026-03-23 01:40:59 +08:00
Roger d101da627d fix: upgrade golangci-lint to v2 and modernize configuration (#487)
* fix: upgrade golangci-lint to v2 and modernize configuration

- Migrate from golangci-lint v1 to v2 configuration format
- Update GitHub Actions workflow to use golangci-lint-action@v8
- Set golangci-lint version to v2.2.0 for stability
- Add comprehensive linter configuration with Go 1.20 compatibility
- Temporarily disable strict linting rules to unblock development
- Configure formatters (gofmt, goimports, gci) separately per v2 requirements
- Add extensive exclusion rules for gradual rule enforcement

This change establishes a modern linting baseline that can be progressively
enhanced as code quality improves. All major linting issues have been
configured as non-blocking to allow incremental improvements.

* chore: update golangci-lint to v2.4.0 for compatibility

- Update golangci-lint version from v2.2.0 to v2.4.0 in GitHub Actions
- Aligns CI environment with local development version
- Resolves configuration validation errors

* fix: update golangci-lint config to v2.4.0 compatible format

- Remove deprecated v1 fields (skip-dirs, skip-files from run section)
- Move exclusions to linters.exclusions section
- Fix goimports.local-prefixes to be array format
- Remove gci.skip-generated and custom-order (not supported)
- Replace disable-all with default: standard
- Remove deprecated issues section, use linters.exclusions instead
- Fix output format from colored-line-number to text with colors
- Remove unsupported fields from linter settings

This ensures the config passes 'golangci-lint config verify' validation
2025-09-02 23:18:27 +08:00
ᴍᴏᴏɴD4ʀᴋ ad020cf135 chore: downgrade golang version to 1.20, support Windows 7. (#435)
* chore: downgrade golang version to 1.20, support windows 7

* chore: Update dependencies for Go project.

- Update dependencies in go.sum
- Improvements and optimizations in various files
- Bug fixes and error handling enhancements

* chore: Update modernc.org/sqlite library versions in go.mod and go.sum files

- Update version of `modernc.org/sqlite` to `v1.31.1` in `go.mod` and `go.sum` files
- Update module hash in `go.sum` file for `modernc.org/sqlite`
- Ensure consistency between `go.mod` and `go.sum` files in relation to `modernc.org/sqlite` version

* chore: replace log/slog with standard logger (#436)

* chore: replace log/slog with standard logger

* chore: Update Go dependencies and versions

- Update Go version from `1.22.5` to `1.20` and other dependencies
- Update critical dependencies to latest versions
- Ensure compatibility with new versions of dependencies

* chore: Optimize dependency management in workflows

- Update build and lint workflows to use `go mod tidy` for getting dependencies
- Change modules download mode to `'mod'` in linters configuration
- Add step to get dependencies in lint workflow

* refactor: Update dependencies and refactor Chromium key deletion logic

- Update `modernc.org/sqlite` to `v1.31.1` in `go.mod` and `go.sum`
- Increase version number to `0.5.0` in `cmd/hack-browser-data/main.go`
- Refactor and update logic for filtering and copying items in `browser/chromium/chromium.go`

* Improve logging functionality and data type conversion

- Add `String()` method to `DataType` enum in types.go
- Update log level to Debug in logger_test.go
- Set log level to Debug in `TestLoggerDebug` and `TestLoggerDebugf` functions
2024-10-22 13:01:13 +08:00
moonD4rk f1f0907a1c chore: Optimize GitHub actions and dependencies updates 2024-07-16 11:37:57 +08:00
moonD4rk 5ead3ba3c3 ci: Refactor project workflows, build with goreleaser
- Add configuration files for `goreleaser.yml` and GitHub workflows
- Update Go version to `1.22.x`
- Adjust workflow names and triggers in `.github/workflows` folder
2024-07-15 22:47:11 +08:00
dependabot[bot] 940e960932 chore(deps): bump golangci/golangci-lint-action from 4 to 6
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 4 to 6.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v4...v6)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 22:47:11 +08:00
dependabot[bot] fa09f73221 chore(deps): bump crazy-max/ghaction-xgo from 2 to 3
Bumps [crazy-max/ghaction-xgo](https://github.com/crazy-max/ghaction-xgo) from 2 to 3.
- [Release notes](https://github.com/crazy-max/ghaction-xgo/releases)
- [Commits](https://github.com/crazy-max/ghaction-xgo/compare/v2...v3)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-xgo
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-12 20:06:04 +08:00
dependabot[bot] 242f00cd53 chore(deps): bump release-drafter/release-drafter from 5 to 6
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5 to 6.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5...v6)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-12 20:05:55 +08:00
dependabot[bot] 3fd08019f9 chore(deps): bump actions/upload-release-asset from 1.0.1 to 1.0.2
Bumps [actions/upload-release-asset](https://github.com/actions/upload-release-asset) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/actions/upload-release-asset/releases)
- [Commits](https://github.com/actions/upload-release-asset/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: actions/upload-release-asset
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-12 20:05:45 +08:00
dependabot[bot] c296da4de2 chore(deps): bump golangci/golangci-lint-action from 3 to 4
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3 to 4.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-12 20:05:34 +08:00
ᴍᴏᴏɴD4ʀᴋ 06fc064418 refactor/dependence: Upgrade Golang version and dependencies. (#322)
* chore: Set up automated package updates with dependabot.
2024-04-12 20:01:29 +08:00
moonD4rk c31cf602ed ci: Improve GitHub Actions workflow for linting. 2024-04-12 20:01:29 +08:00
ᴍᴏᴏɴD4ʀᴋ 18786d1ebc ci: Disable build setup-go cache flag (#309) 2024-04-12 20:01:29 +08:00
ᴍᴏᴏɴD4ʀᴋ 096f69ff7f fix: Upgrade CI resolve the issue of cache expiration. (#308) 2024-04-12 20:01:29 +08:00
ᴍᴏᴏɴD4ʀᴋ 7bd5a06875 ci: Improve Golang code quality with updated lint configuration file (#307)
* refactor: Optimize code logic and reduce nesting.

* ci: Improve Golang code quality with updated configuration file

* chore: Update GitHub actions setup-go to version 5 and optimize caching.
2024-04-12 20:01:29 +08:00
ᴍᴏᴏɴD4ʀᴋ 700b981e5d feat: Upgrade GitHub Actions to v4 for greater stability (#304)
* ci: Upgrade GitHub Actions to v4 for greater stability

- Close #303
- Upgrade GitHub Actions to v4 in all workflows
- Fix zipping and uploading of Linux arm64 assets in release workflow
- Simplify and remove unnecessary steps in build workflow
2024-01-27 23:15:05 +08:00
ᴍᴏᴏɴD4ʀᴋ baa0e09ad2 dev: Remove CGO go-sqlite3 with pure go driver (#292)
* chore: Resize logo and update browser support in READMEs (#284)

* chore: Resize logo and update browser support in READMEs

* docs: Update Coverage Status badge URL

* chore: add typos check linter in github actions (#285)

* refactor: Disable JSON handling in logger/logger.go.

* chore: Standardize spelling and add typos check workflows.

* refactor: Update SQLite driver import for browsing data package.

* refactor: Refactor browsing data package to use SQLite driver instead of SQLite3.

* docs: Add contribution guidelines to README file (#289)

* chore: Refactor file and directory names for improved organization and consistency
2024-01-19 15:45:24 +08:00
ᴍᴏᴏɴD4ʀᴋ cd2b1964c4 chore: add typos check linter in github actions (#285)
* refactor: Disable JSON handling in logger/logger.go.

* chore: Standardize spelling and add typos check workflows.

- Update GitHub Action name to 'unit tests'
- Add spell-check step with custom config to lint workflow
- Use latest version of golangci/lint-action in lint workflow
- Rename variable 'crypted' to 'encrypted' in crypto_windows.go
- Fix typos in comments and error/log messages throughout the codebase
- Update .gitignore to exclude typos.toml file
2024-01-17 13:52:59 +08:00
ᴍᴏᴏɴD4ʀᴋ 23037e16fd Chore: Add CONTRIBUTING.md guidelines and standardized templates (#279)
* chore: Improve GitHub workflows, issue template, and gitignore entries

- Add support for manual triggering of build and lint workflows.
- Improve bug report template by clarifying prompts and adding checklist and tips for better explanation of issues.
- Ignore `.md` files in `.github` and `.github/ISSUE_TEMPLATE` folders.
- Add badges for test running and coverage status in README.md.

* chore: Add standardized templates to repository

- Add pull request and feature request templates to the `.github` folder

* docs: Add CONTRIBUTING.md guidelines and update .gitignore.

- Update .gitignore to remove exclusions for browsing history files
- Add an exclusion for CONTRIBUTING.md in the Community section in .gitignore
- Create CONTRIBUTING.md with guidelines for contributors.
2024-01-13 18:08:35 +08:00
ᴍᴏᴏɴD4ʀᴋ eed1d12282 dev: refactor items and update repo deploy (#278)
* refactor: Refactor file paths and use map to store item names

- Refactored file paths for various browsing data types to use a consistent method of generating temporary file names
- Modified parsing functions in many browsing data types to use the new temporary file naming scheme
- Renamed `FileName` to `Filename` for consistency in the `item` package
- Removed unnecessary code and comments throughout various files
- Made minor improvements to some Item methods such as `TempFilename` and `FileName`

* ci: Optimize GitHub actions and update Go versions. (#274)

* ci: Optimize GitHub actions and update Go versions.

- Add GitHub actions for unit testing, linting, building, and releasing
- Use a matrix strategy to test on different versions and platforms
- Update setup-go and go-version options for compatibility
- Format code and build zip files for different operating systems
- Upload releases to GitHub with specific asset names and types

* fix: Refactor item file naming convention

- Update `filename()` function to return `UnsupportedItem` in specific cases
- Replace `UnknownItem` with `UnsupportedItem` in `Filename` method of `Item` struct
- Refactor code for clarity and consistency

* ci: Update GitHub workflow with latest setup-go version

- Update setup-go action to v3 in lint.yml GitHub workflow
- Omits some big changes in file diff summary
- Improve overall workflow reliability and efficiency

* ci: Improve GitHub actions across platforms

- Improve Windows compatibility in build workflow
- Optimize unit testing for pull requests
- Upgrade Coveralls GitHub action to v2 for improved coverage tracking

* build: Optimize build process for consistency and efficiency

- Ensure consistency of line endings by disabling Git's automatic conversion
- Add format check for Windows systems
- Update Go version in strategy matrix to `1.21.x`
- Remove unused dependencies from build process
- Include all packages in repository in build command

* ci: Refactor GitHub workflow configuration

- Remove unnecessary checks for `windows-latest` in github workflow
- Change `gofmt` check to `diff` for formatting
- Remove unneeded Git configuration for encoding of line endings
- Close #273

* ci: Update default branch references in GitHub Actions workflows (#277)

- Update Github Actions workflows to use `main` branch instead of `master`.
- Rename `master` branch to `main` in `lint.yml` and `build.yml` files.
- Change default branch to `main` in `contributors.yml` workflow file.
2024-01-13 15:58:53 +08:00
ᴍᴏᴏɴD4ʀᴋ f4b4ad1258 chore: remove auto released github actions 2024-01-09 20:57:42 +08:00
moonD4rk 83fc248195 chore: update Go version and dependencies for builds
- Update Go version from `1.20` to `1.21` in go.mod, .github/workflows/build.yml, and .github/workflows/lint.yml
2023-10-02 22:37:42 +08:00
ᴍᴏᴏɴD4ʀᴋ dae8edad60 chore: upgrade cross compile ghaction-xgo actions verison 2023-03-11 23:27:20 +08:00
moonD4rk 60772a47f4 chore: update actions go version to 1.20 2023-03-11 21:22:22 +08:00
ᴍᴏᴏɴD4ʀᴋ a2bfdeb130 chore: add golangci-lint action config file 2022-08-14 22:55:00 +08:00
ᴍᴏᴏɴD4ʀᴋ 77bdde8d0e chore: manually trigger release actions 2022-08-14 22:53:42 +08:00
ᴍᴏᴏɴD4ʀᴋ 05957c1bb2 chore: update golang version to 1.19 2022-08-14 22:32:36 +08:00
ᴍᴏᴏɴD4ʀᴋ d78a68c957 chore: update release actions go version to 1.18 2022-04-17 16:41:18 +08:00
ᴍᴏᴏɴD4ʀᴋ 1e0eb81881 chore: update github workflows go version to 1.18 2022-04-17 16:39:21 +08:00
ᴍᴏᴏɴD4ʀᴋ 38a40cb29c deploy: update release action. 2021-12-13 22:03:24 +08:00
ᴍᴏᴏɴD4ʀᴋ 52fc05e7f8 deploy: new release with release-drafter action 2021-12-10 16:40:53 +08:00
ᴍᴏᴏɴD4ʀᴋ 9108a2ff2d deploy: create release-drafter template 2021-12-10 16:40:03 +08:00
ᴍᴏᴏɴD4ʀᴋ 3729455fbe chore: update bug report template 2021-12-10 16:37:56 +08:00
ᴍᴏᴏɴD4ʀᴋ 4870b5214e chore: update release actions 2021-07-04 17:56:56 +08:00
ᴍᴏᴏɴD4ʀᴋ 5500de2aaa chore: update release actions Close #58 2021-07-04 17:24:08 +08:00
moond4rk ba10711b5b chore: update CI, support golang verison to 1.14+ 2020-12-20 15:29:58 +08:00
moond4rk 138c33dade chore: add contributes workflow, resolve #55 2020-12-20 15:14:35 +08:00
moond4rk 66eb7423e0 chore: remove set-env variable in github action Close #38 2020-11-08 02:13:51 +08:00
moond4rk fde8da74f9 chore: add upx to github action workflow 2020-11-08 01:34:41 +08:00
ᴍᴏᴏɴD4ʀᴋ 7c54a282c0 chore: update issue template and ci platform 2020-09-28 16:37:33 +08:00
ᴍᴏᴏɴD4ʀᴋ 54cc5da8d7 fix: firefox history last_visit_time null Close #10 2020-09-03 17:44:03 +08:00
ᴍᴏᴏɴD4ʀᴋ 85af63bfcd chore: support golang 1.15 ci 2020-08-17 10:18:18 +08:00
ᴍᴏᴏɴD4ʀᴋ 32d479c7a0 chore: update issue templates 2020-07-24 16:33:52 +08:00
ᴍᴏᴏɴD4ʀᴋ ce31d557e0 chore: remove windows 32 bit 2020-07-10 16:58:01 +08:00
ᴍᴏᴏɴD4ʀᴋ 0d6d779d40 feat: add linux release Closes #12 2020-07-10 16:52:16 +08:00