Compare commits

...

277 Commits

Author SHA1 Message Date
Leendert de Borst
2d59117112 Merge pull request #765 from lanedirt/764-prepare-0160-release
Bump version to 0.16.0
2025-04-07 09:36:36 +02:00
dependabot[bot]
ccb66af1ca Bump vite (#766)
Bumps the npm_and_yarn group with 1 update in the /browser-extension directory: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 6.2.4 to 6.2.5
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.2.5/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.5/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.2.5
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-04 21:42:36 +02:00
Leendert de Borst
f4093a9199 Fix safari extension settings open bug (#764) 2025-04-03 19:35:32 +02:00
Leendert de Borst
290601ccfb Update README.md (#764) 2025-04-03 17:35:46 +02:00
Leendert de Borst
77be2a339e Bump version to 0.16.0 (#764) 2025-04-03 16:52:05 +02:00
Leendert de Borst
c0b23c15e7 Make browser extension identity generator language aware (#761) 2025-04-03 15:25:20 +02:00
Leendert de Borst
4af158b35d Update tests (#760) 2025-04-03 13:28:22 +02:00
Leendert de Borst
abfabc2a4a Update credential terminology (#760) 2025-04-03 13:28:22 +02:00
Leendert de Borst
a0036da781 Fix search widget click outside behavior (#760) 2025-04-03 13:28:22 +02:00
Leendert de Borst
99f084558d Improve form autofill and add new test case (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
d7be5fc308 Add enter to submit for custom alias form (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
485e867c50 Generic refactor and UX tweaks (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
d2e5f3c715 Add datetime empty string sanity check converter to client (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
0cbe5fec93 Update alias email reference (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
7f7c729e82 Update create popup UI (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
35cc29e751 Refactor linting issues (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
8a16a29727 Remember last used email/username input (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
708cffc49e UI usability tweaks (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
74c0ace2b5 Pass password to the to be created credential (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
55175a7db6 UI tweaks (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
7e1f33e4e1 Update form validation (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
81362b165b Add manual credential option to create new alias popup (#758) 2025-04-03 12:54:08 +02:00
Leendert de Borst
41d6511eb2 Attach shadowroot to html immediately instead as waiting for element doesn't work (#756) 2025-04-02 17:12:50 +02:00
Leendert de Borst
60ba96cb86 Remove autocomplete=off check and attach autofill popup shadowroot to input itself (#756) 2025-04-02 17:12:50 +02:00
Leendert de Borst
fdd8c8b37e Add BadRequest handling to browser extension auth (#734) 2025-04-02 12:55:55 +02:00
Leendert de Borst
53fcb2f2e4 Exclude primary email from confirm email field search (#732) 2025-04-01 22:44:03 +02:00
Leendert de Borst
b1848320d9 Add FormDetector hidden field tests (#732) 2025-04-01 22:44:03 +02:00
Leendert de Borst
610be7e30b Improve FormDetector to ignore hidden elements and improve email detection (#732) 2025-04-01 22:44:03 +02:00
Leendert de Borst
933e458776 Fill in username in email field if no email is available (#732) 2025-04-01 22:44:03 +02:00
Leendert de Borst
b460e6ec20 Fix null issue when searching in popup (#732) 2025-04-01 22:44:03 +02:00
Leendert de Borst
80cd371ee3 Add retry to faviconextractor to bypass certain cookiewalls (#745) 2025-04-01 17:16:58 +02:00
Leendert de Borst
915e12d541 Centralize favicon render logic and make it format aware (#745) 2025-04-01 17:16:58 +02:00
Leendert de Borst
c8d78e0b02 Merge pull request #748 from lanedirt/746-bug-browser-extension-renders-credential-without-alias-full-name-field-as-null-null
Optimize display of legacy credentials that don't have alias fields
2025-04-01 13:54:55 +02:00
Leendert de Borst
199941a837 Make CheckHasAlias static (#746) 2025-04-01 13:54:34 +02:00
Leendert de Borst
1e0c586dba Merge branch '746-bug-browser-extension-renders-credential-without-alias-full-name-field-as-null-null' of https://github.com/lanedirt/AliasVault into 746-bug-browser-extension-renders-credential-without-alias-full-name-field-as-null-null
* '746-bug-browser-extension-renders-credential-without-alias-full-name-field-as-null-null' of https://github.com/lanedirt/AliasVault:
  Add birthdate minvalue filter to main client UI (#746)
2025-04-01 13:38:27 +02:00
Leendert de Borst
37e59dcd4e Update PlaywrightInputHelper.cs (#746) 2025-04-01 13:37:52 +02:00
Leendert de Borst
e665130ea7 Add birthdate minvalue filter to main client UI (#746) 2025-04-01 13:29:23 +02:00
Leendert de Borst
c0aac4ef72 Add birthdate minvalue filter to main client UI (#746) 2025-04-01 13:06:31 +02:00
Leendert de Borst
8319ddcce4 Only show fields when they have a value in main client (#746) 2025-04-01 12:58:07 +02:00
Leendert de Borst
adc6293f4b Only show credential fields that have a value in browser extension (#746) 2025-04-01 12:47:28 +02:00
Leendert de Borst
418bfed663 Add browser extension vscode build task (#746) 2025-04-01 10:41:16 +02:00
Leendert de Borst
7074113cbf Update install.md 2025-04-01 10:22:10 +02:00
Leendert de Borst
ddb610051a Fix install curl command to follow redirects 2025-04-01 10:21:38 +02:00
Leendert de Borst
188b7a4062 Update FaviconExtractor.cs (#736) 2025-04-01 00:28:12 +02:00
Leendert de Borst
989d17708f Add duplicate entry detection to import wizard 2025-04-01 00:28:12 +02:00
Leendert de Borst
77a4b4fcba Make credential view link have a http prefix (#542) 2025-04-01 00:27:54 +02:00
Leendert de Borst
0462e3522b Remove git pre-commit hook requirement 2025-03-31 23:57:28 +02:00
Leendert de Borst
f6bddf730f Make search field output full width on mobile (#736) 2025-03-31 23:26:41 +02:00
dependabot[bot]
035403e3e3 Bump vite
Bumps the npm_and_yarn group with 1 update in the /browser-extension directory: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 6.2.3 to 6.2.4
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.2.4/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.4/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-31 21:04:15 +02:00
Leendert de Borst
33ebbf0fd5 Include favicon and username in search results (#736) 2025-03-31 18:40:24 +02:00
Leendert de Borst
55c75ec094 Change loading spinners to non-blocking AliasVault style (#739) 2025-03-31 18:08:24 +02:00
Leendert de Borst
6e244e611c Refactor to reduce complexity (#735) 2025-03-31 17:53:03 +02:00
Leendert de Borst
e1dc9eb447 Add bulk favicon extraction to import (#735) 2025-03-31 17:53:03 +02:00
Leendert de Borst
7a8b31a98a Improve favicon extraction by resizing too large icons (#735) 2025-03-31 17:53:03 +02:00
Leendert de Borst
9baa70f022 Update text and CSS (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
24106475f9 Refactor (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
c50178967a Add E2E import test (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
a69a6a91e2 Update comments (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
1dca845731 Add separate ResourceReaderUtility to E2E project because of namespace(#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
9bec5a3ae5 Fix double navigation redirect bug (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
1a8dae44ec Refactor returnUrl methods in client (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
ec15c76001 Add import link to OOBE home screen (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
e0c11ba0f6 Add separate importers for KeePass, KeePassXC and Strongbox (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
a72f1139f9 Add firefox import card (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
a3a3d39664 Add firefox importer and unit test (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
014a705a5e Add chrome import card (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
6dfb922292 Add chrome importer and unit test (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
cb78d8a636 Add combined client build task and unit test task (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
a4c4a9c8ec Update todos (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
6f5ae7c17e Add 1Password importer (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
43f5e0c647 Add confirm dialog to vault export actions (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
0e5f611670 Add TOTP code sanitize to import (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
70b7ac6f9f Make AliasVault export/import work again (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
14ee466bec Add logo to modal (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
ea9c3c5683 Update importer icons (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
30b812e8a3 Add importer help text (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
27ba14ee34 UI tweaks (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
2e851701f9 Update multistep form flow and reduce boilerplate (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
a2c2caed79 Add multistep import flow (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
c00e6c6a4d Do import on submit (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
09dda0147b Update ImportExport.razor (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
ef7398b47a Fix Bitwarden CSV import (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
dc769bb5d4 Adjust UnitTests namespace, add CSV importer unit tests (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
634fc281a2 Add Bitwarden importer scaffolding (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
e93b0575ff Refactor import record to credential conversion to BaseImporter.cs (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
3f6575dfe5 Refactor CSV import logic to utility class (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
390877f8f3 Rename CsvImportExport to ImportExport utility (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
55ee3bfd4a Add sample CSV import mapping logic (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
423fe00692 Make example import flow work (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
f8e0d6a293 Refactor import base component to use Blazor childcontent (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
a20b0ed83a Add import/export page UI scaffolding (#542) 2025-03-31 14:18:29 +02:00
Leendert de Borst
ca043954ec Update roadmap 2025-03-28 17:36:37 +01:00
Leendert de Borst
4f0104e8f9 Bump version to 0.15.1 (#729) 2025-03-27 15:52:59 +01:00
Leendert de Borst
ea37c4d8c6 Make .env.example work with install.sh (#727) 2025-03-27 15:41:51 +01:00
Leendert de Borst
95be4beb13 Do env create before other env set commands (#727) 2025-03-27 15:41:51 +01:00
Leendert de Borst
716ef0b30c Update docs layout (#727) 2025-03-27 15:41:51 +01:00
Leendert de Borst
fc0eb0e7e7 Update README.md (#727) 2025-03-27 15:41:51 +01:00
Leendert de Borst
9670178aec Update manual setup instructions (#727) 2025-03-27 15:41:51 +01:00
Leendert de Borst
8503be4d52 Add documentation to .env.example (#727) 2025-03-27 15:41:51 +01:00
Leendert de Borst
9eadcaa2ed Make latest version retrieval work in latest MacOS bash (#725) 2025-03-27 10:17:54 +01:00
dependabot[bot]
e0ed8fd285 Bump vite
Bumps the npm_and_yarn group with 1 update in the /browser-extension directory: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 6.2.0 to 6.2.3
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.2.3/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.3/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-25 20:19:33 +01:00
Leendert de Borst
61748c3d03 Update README.md 2025-03-25 18:37:57 +01:00
Leendert de Borst
faff4844f5 Update release.yml publish paths (#722) 2025-03-25 13:32:50 +01:00
Leendert de Borst
09d931484a Update GitHub workflows (#722) 2025-03-25 13:29:26 +01:00
Leendert de Borst
1678595c13 Bump version to 0.15.0 (#722) 2025-03-25 13:13:05 +01:00
Leendert de Borst
8945b33705 Add install.sh to release artifacts (#722) 2025-03-25 13:13:05 +01:00
Leendert de Borst
4ee044ffb9 Update faviconextractor HtmlAgilityPack call (#715) 2025-03-25 11:53:04 +01:00
dependabot[bot]
5443e147b1 Bump HtmlAgilityPack from 1.11.74 to 1.12.0
Bumps [HtmlAgilityPack](https://github.com/zzzprojects/html-agility-pack) from 1.11.74 to 1.12.0.
- [Release notes](https://github.com/zzzprojects/html-agility-pack/releases)
- [Commits](https://github.com/zzzprojects/html-agility-pack/compare/v1.11.74...v1.12.0)

---
updated-dependencies:
- dependency-name: HtmlAgilityPack
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-25 11:53:04 +01:00
Leendert de Borst
05edda8b48 Show returning users count in admin dashboard (#720) 2025-03-25 10:48:55 +01:00
Leendert de Borst
179bb62604 Fix bug in search for null credential fields (#718) 2025-03-24 22:21:34 +01:00
Leendert de Borst
1f5863b066 Fix vault dismiss logic when user is not logged in (#718) 2025-03-24 22:21:34 +01:00
Leendert de Borst
ef36a08ef4 Update password autofill to improve compatibility (#718) 2025-03-24 22:21:34 +01:00
dependabot[bot]
4f7212668e Bump Swashbuckle.AspNetCore from 7.3.2 to 8.0.0
Bumps [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 7.3.2 to 8.0.0.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v7.3.2...v8.0.0)

---
updated-dependencies:
- dependency-name: Swashbuckle.AspNetCore
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 17:52:47 +01:00
dependabot[bot]
41bb7ed701 Bump Microsoft.AspNetCore.Components.WebAssembly.DevServer
Bumps [Microsoft.AspNetCore.Components.WebAssembly.DevServer](https://github.com/dotnet/aspnetcore) from 9.0.2 to 9.0.3.
- [Release notes](https://github.com/dotnet/aspnetcore/releases)
- [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md)
- [Commits](https://github.com/dotnet/aspnetcore/compare/v9.0.2...v9.0.3)

---
updated-dependencies:
- dependency-name: Microsoft.AspNetCore.Components.WebAssembly.DevServer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 17:51:49 +01:00
dependabot[bot]
78286b1ac1 Bump nokogiri in /docs in the bundler group across 1 directory
Bumps the bundler group with 1 update in the /docs directory: [nokogiri](https://github.com/sparklemotion/nokogiri).


Updates `nokogiri` from 1.18.3 to 1.18.4
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.3...v1.18.4)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
  dependency-group: bundler
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-22 10:34:01 +01:00
Leendert de Borst
7bc8bb3fc2 Create FUNDING.yml 2025-03-21 16:36:47 +01:00
Leendert de Borst
c576062025 Fix hyperlinks absolute vs relative address (#711) 2025-03-20 13:55:32 +01:00
Leendert de Borst
1194d54e6f Add E2E test for email claim disable logic (#711) 2025-03-20 13:55:32 +01:00
Leendert de Borst
e782a6a51f Reject emails addressed to disabled email claim (#711) 2025-03-20 13:55:32 +01:00
Leendert de Borst
2071a7c4fe Add email claim enable/disable toggle to admin (#711) 2025-03-20 13:55:32 +01:00
Leendert de Borst
8c1e5a7bf8 Add email claim table disabled boolean (#711) 2025-03-20 13:55:32 +01:00
Leendert de Borst
b8f9e7fa2c Merge pull request #710 from lanedirt/641-add-statistics-graphs-to-admin
Add analytics charts to admin dashboard
2025-03-20 10:04:24 +01:00
Leendert de Borst
a0a541aff9 Update admin tests (#641) 2025-03-19 22:17:59 +01:00
Leendert de Borst
d6932f33ea Update email list page and tweak search fields (#641) 2025-03-19 22:10:13 +01:00
Leendert de Borst
9ea845b497 Add ApexChart service and integrate dark mode (#641) 2025-03-19 19:33:42 +01:00
Leendert de Borst
917d6f6bcc Add charts to admin dashboard (#641) 2025-03-19 17:49:09 +01:00
Leendert de Borst
39a263d157 Update docs (#641) 2025-03-19 15:34:35 +01:00
Leendert de Borst
c7360ee23c Add general log source context to term filter (#705) 2025-03-19 14:23:51 +01:00
Leendert de Borst
d1924f4044 Update header text (#705) 2025-03-19 14:23:51 +01:00
Leendert de Borst
4d86356990 Update users page with credential count column (#705) 2025-03-19 14:23:51 +01:00
Leendert de Borst
505a2445eb Reset page back to 1 when search term changes in admin (#705) 2025-03-19 14:23:51 +01:00
Leendert de Borst
75385c4b5d Remove WASM DevServer package from admin which caused it to not run in debug (#705) 2025-03-19 14:23:51 +01:00
Leendert de Borst
4d4053c7fb Update package-lock.json (#705) 2025-03-19 14:23:51 +01:00
Leendert de Borst
43062d0d93 Update .vscode tasks (#705) 2025-03-19 14:23:51 +01:00
Leendert de Borst
956709da54 Merge pull request #706 from lanedirt/167-allow-customizing-password-generation-options
Make password generation options customizable
2025-03-18 22:15:53 +01:00
Leendert de Borst
496e0ab754 Refactor PasswordGenerator.ts (#167) 2025-03-18 22:04:11 +01:00
Leendert de Borst
ef97aac848 Merge branch 'main' into 167-allow-customizing-password-generation-options 2025-03-18 18:22:09 +01:00
Leendert de Borst
998fa1913f Update dotnet nuget packages to 9.0.3 (#707) 2025-03-18 18:08:32 +01:00
Leendert de Borst
79cd265c3e Add browser extension password settings test (#167) 2025-03-18 17:40:31 +01:00
Leendert de Borst
ed5fd5b861 Disable autofill extension for aliasvault client by default (#167) 2025-03-18 17:12:34 +01:00
Leendert de Borst
5e2dde252d Update tests (#167) 2025-03-18 16:51:49 +01:00
Leendert de Borst
79950ab9fc Add password generator settings awareness to browser extension (#167) 2025-03-18 16:30:41 +01:00
Leendert de Borst
dffa651512 Cleanup (#167) 2025-03-18 14:37:24 +01:00
Leendert de Borst
2dc36cea11 Add password settings to general settings page (#167) 2025-03-18 14:17:49 +01:00
Leendert de Borst
ad4c2c7b41 Add modalwrapper component for keydown detection (#167) 2025-03-18 13:41:43 +01:00
Leendert de Borst
2022cdb58b Improve UX (#167) 2025-03-18 13:08:56 +01:00
Leendert de Borst
5f779ce360 Update UI style (#167) 2025-03-18 12:37:10 +01:00
Leendert de Borst
b9d981f80b Refactor (#167) 2025-03-18 11:30:36 +01:00
Leendert de Borst
65110abf4c Add range binds and sanity checks (#167) 2025-03-18 10:47:06 +01:00
Leendert de Borst
b0e939ef23 Add support for temp or global password settings persist (#167) 2025-03-18 10:19:53 +01:00
Leendert de Borst
607c0da5b4 Make password settings a separate component (#167) 2025-03-18 10:05:10 +01:00
Leendert de Borst
1de7f831b5 Fix recent email refresh duplicate calls (#167) 2025-03-17 22:19:31 +01:00
Leendert de Borst
ef328718cd Refactor password generator and make all use general settings (#167) 2025-03-17 21:28:57 +01:00
Leendert de Borst
465c4cc730 Update username and password button style (#167) 2025-03-17 20:37:26 +01:00
Leendert de Borst
0dceeeffa4 Update docs to include Windows instructions (#703) 2025-03-17 17:56:21 +01:00
Leendert de Borst
af24464a8d Convert install.sh line endings so it works on Windows out of the box (#703) 2025-03-17 17:56:21 +01:00
Leendert de Borst
5aa82d8149 Update username and password edit field GUI (#167) 2025-03-17 15:06:15 +01:00
Leendert de Borst
e848e05cce Cleanup and simplify install.sh (#690) 2025-03-16 15:35:58 +01:00
Leendert de Borst
323be10d03 Tweak password edit component UI (#167) 2025-03-15 18:24:35 +01:00
Leendert de Borst
51b382a739 Add password generation settings GUI scaffolding (#167) 2025-03-15 18:03:45 +01:00
Leendert de Borst
7954104dfc Update README.md 2025-03-14 17:54:51 +01:00
Leendert de Borst
4c7b44c04a Bump version to 0.14.0 (#688) 2025-03-14 14:17:26 +01:00
Leendert de Borst
b41449f892 Remove Microsoft.IdentityModel packages from API which caused method not found bug (#668) 2025-03-14 13:13:36 +01:00
dependabot[bot]
934d0d9e56 Bump Microsoft.IdentityModel.Tokens from 8.6.0 to 8.6.1
Bumps [Microsoft.IdentityModel.Tokens](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) from 8.6.0 to 8.6.1.
- [Release notes](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases)
- [Changelog](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/8.6.0...8.6.1)

---
updated-dependencies:
- dependency-name: Microsoft.IdentityModel.Tokens
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-14 13:13:36 +01:00
Leendert de Borst
99d0da1119 Update docs and README.md (#680) 2025-03-13 15:10:01 +01:00
Leendert de Borst
c74e05d400 Improve create credential popup page title extraction (#686) 2025-03-13 15:09:21 +01:00
dependabot[bot]
844bdab92f Bump MailKit from 4.10.0 to 4.11.0
Bumps [MailKit](https://github.com/jstedfast/MailKit) from 4.10.0 to 4.11.0.
- [Changelog](https://github.com/jstedfast/MailKit/blob/master/ReleaseNotes.md)
- [Commits](https://github.com/jstedfast/MailKit/compare/4.10.0...4.11.0)

---
updated-dependencies:
- dependency-name: MailKit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-13 14:13:02 +01:00
dependabot[bot]
1345e3c657 Bump MimeKit from 4.10.0 to 4.11.0
Bumps [MimeKit](https://github.com/jstedfast/MimeKit) from 4.10.0 to 4.11.0.
- [Changelog](https://github.com/jstedfast/MimeKit/blob/master/ReleaseNotes.md)
- [Commits](https://github.com/jstedfast/MimeKit/compare/4.10.0...4.11.0)

---
updated-dependencies:
- dependency-name: MimeKit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-13 14:12:55 +01:00
Leendert de Borst
4fdf7ce92c Show autofill popup dismiss button when vault is locked (#682) 2025-03-13 14:12:43 +01:00
Leendert de Borst
852d9b5e98 Update tests to wait until all password chars have been entered (#684) 2025-03-13 13:47:39 +01:00
Leendert de Borst
3c72fa3fde Update password autofill mechanism to simulate user typing behavior (#684) 2025-03-13 13:47:39 +01:00
Leendert de Borst
b61b747e4b Add default font-family (#680) 2025-03-13 13:29:57 +01:00
Leendert de Borst
1b4389c7d7 Show manual instructions if opening preferences fails (#680) 2025-03-13 13:29:57 +01:00
Leendert de Borst
499d2759ce Add Safari extension docs (#680) 2025-03-13 13:29:57 +01:00
Leendert de Borst
d0140a8ddb Fix MacOS wrapper app links and content (#680) 2025-03-13 13:29:57 +01:00
Leendert de Borst
76dc465032 Refactor (#678) 2025-03-12 22:02:11 +01:00
Leendert de Borst
84420104ee Iframe and position tweaks (#678) 2025-03-12 22:02:11 +01:00
Leendert de Borst
1109bde521 Refactor all inline styles to separate style.css (#678) 2025-03-12 22:02:11 +01:00
Leendert de Borst
134a173148 Import stylesheet for contentScript (#678) 2025-03-12 22:02:11 +01:00
Leendert de Borst
83be492b3a Refactor injectIcon (#678) 2025-03-12 22:02:11 +01:00
Leendert de Borst
fac72e5a11 Refactor content script to use shadowroot UI (#678) 2025-03-12 22:02:11 +01:00
Leendert de Borst
5eb885da20 Refactor (#661) 2025-03-12 16:07:16 +01:00
Leendert de Borst
da4f286757 Add download links for Firefox, Edge, Safari and Brave (#661) 2025-03-12 16:07:16 +01:00
Leendert de Borst
f6db447ad4 Add Safari extension XCode project scaffolding (#661) 2025-03-12 16:07:16 +01:00
Leendert de Borst
b472ba749c Fix padding issue with search field in Safari (#661) 2025-03-12 16:07:16 +01:00
Leendert de Borst
ef68b3b265 Fix scroll issue for Safari browser (#661) 2025-03-12 16:07:16 +01:00
Leendert de Borst
08d4a8b656 Add light/dark mode toggle to browser extension settings (#661) 2025-03-12 16:07:16 +01:00
Leendert de Borst
93ac131508 Refactor expanded mode check to be called from React (#661) 2025-03-12 16:07:16 +01:00
Leendert de Borst
a7d1536140 Refactor and tweak UI (#672) 2025-03-11 16:59:12 +01:00
Leendert de Borst
4fa3fedea2 Add TotpViewer component (#672) 2025-03-11 16:59:12 +01:00
Leendert de Borst
038e8babb1 Update TotpViewer.razor (#672) 2025-03-11 16:59:12 +01:00
Leendert de Borst
0845477041 Add private vs public email domain documentation (#673) 2025-03-11 11:17:23 +01:00
Leendert de Borst
90156dd1f8 Refactor (#181) 2025-03-11 10:29:25 +01:00
Leendert de Borst
fe4b11cf4d Add TOTP E2E tests (#181) 2025-03-11 10:29:25 +01:00
Leendert de Borst
2cbf234d05 Refactor (#181) 2025-03-11 10:29:25 +01:00
Leendert de Borst
a53575b4bf Add click to copy and form validation (#181) 2025-03-11 10:29:25 +01:00
Leendert de Borst
697abc6828 Refactor TOTP code to work view AddEdit/View mode (#181) 2025-03-11 10:29:25 +01:00
Leendert de Borst
e96cfa3940 Update UX (#181) 2025-03-11 10:29:25 +01:00
Leendert de Borst
61a88e6715 Add credentials TOTP code scaffolding (#181) 2025-03-11 10:29:25 +01:00
Leendert de Borst
e07a35b214 Add firefox addon link to docs (#665) 2025-03-11 09:59:07 +01:00
Leendert de Borst
4a79fafbb9 Update README.md 2025-03-09 21:32:02 +01:00
Leendert de Borst
02b9bff64e Update browser-extension-build.yml (#665) 2025-03-09 20:46:50 +01:00
Leendert de Borst
55e02478b4 Merge pull request #666 from lanedirt/665-prepare-0130-release
Bump version to 0.13.0
2025-03-09 20:25:25 +01:00
Leendert de Borst
a576908ae2 Add edge extension store link (#665) 2025-03-09 19:55:21 +01:00
Leendert de Borst
95510f793b Unzip before uploading files to artifact (#665) 2025-03-09 16:39:53 +01:00
Leendert de Borst
20a4a82b1b Add compression level to prevent re-compressing (#665) 2025-03-09 16:28:50 +01:00
Leendert de Borst
61ba6e1a3c Store less vault revisions to reduce history filesize (#663) 2025-03-08 00:36:37 +00:00
Leendert de Borst
f28f1f07b8 Bump version to 0.13.0 (#665) 2025-03-08 01:23:32 +01:00
Leendert de Borst
7f186f1345 Update browser-extension-build.yml use short git hash (#581) 2025-03-07 22:50:55 +01:00
Leendert de Borst
129b50afba Update browser-extension-build.yml artifact paths (#581) 2025-03-07 22:32:31 +01:00
Leendert de Borst
bad0f485a9 Update browser-extension-build.yml to make all filenames consistent (#581) 2025-03-07 18:35:06 +01:00
Leendert de Borst
5d9ae7d189 Update browser-extension-build.yml firefox glob pattern (#581) 2025-03-07 18:30:58 +01:00
Leendert de Borst
ef8ab63b66 Add full paths to browser-extension-build.yml (#581) 2025-03-07 18:22:01 +01:00
dependabot[bot]
469466995c Bump NUglify from 1.21.12 to 1.21.13
Bumps [NUglify](https://github.com/trullock/NUglify) from 1.21.12 to 1.21.13.
- [Release notes](https://github.com/trullock/NUglify/releases)
- [Changelog](https://github.com/trullock/NUglify/blob/master/changelog.md)
- [Commits](https://github.com/trullock/NUglify/compare/v1.21.12...v1.21.13)

---
updated-dependencies:
- dependency-name: NUglify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-07 17:16:18 +00:00
dependabot[bot]
62c5edc7dc Bump Swashbuckle.AspNetCore from 7.2.0 to 7.3.1
Bumps [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 7.2.0 to 7.3.1.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v7.2.0...v7.3.1)

---
updated-dependencies:
- dependency-name: Swashbuckle.AspNetCore
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-07 17:16:08 +00:00
dependabot[bot]
ba625a30ea Bump NUnit3TestAdapter from 4.6.0 to 5.0.0
Bumps [NUnit3TestAdapter](https://github.com/nunit/nunit3-vs-adapter) from 4.6.0 to 5.0.0.
- [Release notes](https://github.com/nunit/nunit3-vs-adapter/releases)
- [Commits](https://github.com/nunit/nunit3-vs-adapter/compare/V4.6.0...V5.0.0)

---
updated-dependencies:
- dependency-name: NUnit3TestAdapter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-07 17:15:57 +00:00
dependabot[bot]
bcdcbef912 Bump HtmlAgilityPack from 1.11.72 to 1.11.74
Bumps [HtmlAgilityPack](https://github.com/zzzprojects/html-agility-pack) from 1.11.72 to 1.11.74.
- [Release notes](https://github.com/zzzprojects/html-agility-pack/releases)
- [Commits](https://github.com/zzzprojects/html-agility-pack/compare/v1.11.72...v1.11.74)

---
updated-dependencies:
- dependency-name: HtmlAgilityPack
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-07 17:15:49 +00:00
Leendert de Borst
a64ed4817a Add returning users and email aliases cards to admin dashboard (#640) 2025-03-07 17:15:39 +00:00
Leendert de Borst
919a33defb Add total amount of records to admin page lists (#640) 2025-03-07 17:15:39 +00:00
Leendert de Borst
7e08f64175 Update MS edge browser extension docs (#581) 2025-03-07 17:18:38 +01:00
Leendert de Borst
e525bd1c2d Merge pull request #660 from lanedirt/581-feature-request-add-firefox-browser-extension
Add Firefox and Edge browser extension
2025-03-07 16:14:32 +00:00
Leendert de Borst
7298f8914d Add MS Edge as browser extension build target (#581) 2025-03-07 17:00:14 +01:00
Leendert de Borst
c476c53101 Update browser extension dictionaries folder load (#581) 2025-03-07 16:35:56 +01:00
Leendert de Borst
b6c7e88000 Refactor stop words to lang file (#581) 2025-03-07 15:34:24 +01:00
Leendert de Borst
26624e165a Update supported browser extension list in API (#581) 2025-03-07 15:28:07 +01:00
Leendert de Borst
c079b830b5 Add browser specific client name (#581) 2025-03-07 15:16:36 +01:00
Leendert de Borst
165a89e946 Use style.css instead of inline styles (#581) 2025-03-07 15:14:04 +01:00
Leendert de Borst
5042e1b696 Fix lint (#581) 2025-03-07 15:00:52 +01:00
Leendert de Borst
472a79a12b Update npm cache path (#581) 2025-03-07 14:58:23 +01:00
Leendert de Borst
97730cd721 Remove old browser extensions dir (#581) 2025-03-07 14:48:07 +01:00
Leendert de Borst
d5400faf95 Refactor chrome specific API, set font-size to 75% for all browsers (#581) 2025-03-07 14:47:12 +01:00
Leendert de Borst
9b8da64858 Refactor react entrypoint (#581) 2025-03-07 13:30:27 +01:00
Leendert de Borst
9ce776be2b Update docs for firefox browser extension (#581) 2025-03-07 13:05:22 +01:00
Leendert de Borst
d674c77216 Add firefox as browser extension target (#581) 2025-03-07 12:42:29 +01:00
Leendert de Borst
e41c4b3213 Update E2E tests (#581) 2025-03-07 12:18:40 +01:00
Leendert de Borst
f88670787f Update readme (#581) 2025-03-07 12:18:29 +01:00
Leendert de Borst
261be3ab34 Update feature_request.md 2025-03-07 12:01:52 +01:00
Leendert de Borst
0bace49e95 Update browser extension output path (#581) 2025-03-07 11:33:27 +01:00
Leendert de Borst
bb82952c74 Update github browser extension workflow for new path (#581) 2025-03-07 11:22:59 +01:00
Leendert de Borst
fd5244a686 Fix all linting issues (#581) 2025-03-07 01:18:14 +01:00
Leendert de Borst
09bc4286d9 Add linting packages (#581) 2025-03-07 00:49:47 +01:00
Leendert de Borst
4c45047d23 Add identity generator dict loader and test packages (#581) 2025-03-07 00:27:20 +01:00
Leendert de Borst
5251ea53ca Refactor contextmenu to use wxt browser api (#581) 2025-03-06 23:37:45 +01:00
Leendert de Borst
2da9955213 Refactor popup settings to use wxt browser (#581) 2025-03-06 23:29:05 +01:00
Leendert de Borst
fab12daacf Change index.html to popup.html paths (#581) 2025-03-06 19:32:23 +01:00
Leendert de Borst
9ba467479a Refactor messaging to use webext-bridge (#581) 2025-03-06 19:07:12 +01:00
Leendert de Borst
8e698a21fa Add all dependencies, refactor messaging (#581) 2025-03-06 18:47:16 +01:00
Leendert de Borst
28a0c7eb1f Wrap browser extension in wxt for multi-browser compilation (#581) 2025-03-06 16:17:14 +01:00
Leendert de Borst
fcbe8da1e6 Add minimum height to credential table view to not obstruct settings popup (#656) 2025-03-06 13:06:56 +00:00
Leendert de Borst
a0a3a2e14a Hide browser extension autofill injected icon on key press (#653) 2025-03-06 11:27:50 +00:00
Leendert de Borst
4fff14480b Add troubleshooting guide to docs (#655) 2025-03-06 11:11:15 +00:00
Leendert de Borst
c7ad42a63e Update PULL_REQUEST_TEMPLATE.md 2025-03-06 11:32:51 +01:00
Leendert de Borst
6df3c03682 Add less severe log message for email received for orphaned user email claim (#651) 2025-03-06 10:27:49 +00:00
Leendert de Borst
7da5557b98 Refactor favicon fetch to separate method (#649) 2025-03-06 09:41:52 +00:00
Leendert de Borst
38399e00cb Add favicon extract resize and compression (#649) 2025-03-06 09:41:52 +00:00
Leendert de Borst
b30338de37 Add extension version to settings page (#647) 2025-03-06 09:41:41 +00:00
Leendert de Borst
ceaa7731fe Update bottomnav to update selected item on path change (#647) 2025-03-06 09:41:41 +00:00
Leendert de Borst
b66c41e4c9 Add manual merge button, fix db upgrade test revision number (#643) 2025-03-05 19:40:31 +00:00
Leendert de Borst
9e478c94f9 Add browser extension vault outdate check, fix db create wait flow (#643) 2025-03-05 19:40:31 +00:00
Leendert de Borst
b415043b4e Add E2E test for browser extension credential create flow (#643) 2025-03-05 19:40:31 +00:00
dependabot[bot]
10f6525e94 Bump the npm_and_yarn group across 1 directory with 2 updates
Bumps the npm_and_yarn group with 2 updates in the /browser-extensions/chrome directory: [esbuild](https://github.com/evanw/esbuild) and [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `esbuild` from 0.24.2 to 0.25.0
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2024.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.24.2...v0.25.0)

Updates `vite` from 6.0.11 to 6.2.0
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@6.2.0/packages/vite)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: vite
  dependency-type: direct:development
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-05 19:29:21 +00:00
dependabot[bot]
5fb12f26fe Bump uri in /docs in the bundler group across 1 directory
Bumps the bundler group with 1 update in the /docs directory: [uri](https://github.com/ruby/uri).


Updates `uri` from 1.0.2 to 1.0.3
- [Release notes](https://github.com/ruby/uri/releases)
- [Commits](https://github.com/ruby/uri/compare/v1.0.2...v1.0.3)

---
updated-dependencies:
- dependency-name: uri
  dependency-type: indirect
  dependency-group: bundler
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-05 16:21:51 +00:00
Leendert de Borst
6047c8f80d Update ConversionUtility.tsx (#638) 2025-03-05 12:15:39 +00:00
Leendert de Borst
1b6e220c5a Update TestUtils.ts (#638) 2025-03-05 12:15:39 +00:00
Leendert de Borst
b2093b5892 Refactor birthdate and gender field fill methods (#638) 2025-03-05 12:15:39 +00:00
Leendert de Borst
b81eabc583 Add locale specific formfiller tests and refactor all locale parts (#638) 2025-03-05 12:15:39 +00:00
Leendert de Borst
0c4be1398d Add FormFiller unit tests (#638) 2025-03-05 12:15:39 +00:00
Leendert de Borst
4aa0e5f8a1 Refactor form fill logic to its own class (#638) 2025-03-05 12:15:39 +00:00
Leendert de Borst
63c737b6cc Update tests (#628) 2025-03-04 17:43:06 +00:00
Leendert de Borst
44c2331b42 Refactor (#628) 2025-03-04 17:43:06 +00:00
Leendert de Borst
8f9058e1b8 Tweak tutorial with browser extension dl links (#628) 2025-03-04 17:43:06 +00:00
Leendert de Borst
613fb7db12 Refactor browser extension info to shared constants (#628) 2025-03-04 17:43:06 +00:00
Leendert de Borst
c4738637f1 Upload empty vault directly as part of creation step (#628) 2025-03-04 17:43:06 +00:00
Jack Bayliss
151cb19de8 Update README.md (#634) 2025-03-04 14:33:52 +01:00
Leendert de Borst
b0c53ca7b4 Add screenshots to README.md (#633)
* Update README.md

* Update README.md

* Update README.md
2025-03-03 13:43:27 +01:00
Leendert de Borst
586285c5e8 Update README.md 2025-03-03 12:09:24 +01:00
Leendert de Borst
5ca8fb92c8 Update README.md 2025-03-03 11:50:49 +01:00
432 changed files with 25306 additions and 6615 deletions

View File

@@ -1,10 +1,106 @@
# ----------------------------------------------------------------------------
# AliasVault configuration file.
#
# Note: we recommend using the provided install.sh script to install and
# configure AliasVault, as this will automatically set all of the following
# variables for you and allow you to easily change them later via the CLI.
# It also allows for easily updating AliasVault to a newer version in the
# future.
#
# However if you still wish to manually install or configure AliasVault,
# you can do so below.
#
# After changing settings here, make sure to restart all AliasVault
# Docker containers to apply the changes.
# ----------------------------------------------------------------------------
# Set the ports that your AliasVault will be accessible at.
# These are the default ports that will be used by the `reverse-proxy` and `smtp` containers.
# You can change these to any other ports that are available on your system.
HTTP_PORT=80
HTTPS_PORT=443
SMTP_PORT=25
SMTP_TLS_PORT=587
# Set the hostname that your AliasVault will be accessible at.
# E.g. `aliasvault.mydomain.com` or if you're running it on your local machine, choose `localhost`.
HOSTNAME=
# Set a random 32 character string for the JWT key.
# This can be generated using the following command:
# $ openssl rand -base64 32
JWT_KEY=
# Set the password for the data protection certificate.
# This can be generated using the following command:
# $ openssl rand -base64 32
DATA_PROTECTION_CERT_PASS=
ADMIN_PASSWORD_HASH=
ADMIN_PASSWORD_GENERATED=2024-01-01T00:00:00Z
PRIVATE_EMAIL_DOMAINS=
SMTP_TLS_ENABLED=false
LETSENCRYPT_ENABLED=false
# ----------------------------------------------------------------------------
# Database configuration
# ----------------------------------------------------------------------------
# These are the credentials that are used by the PostgreSQL container
# on startup to create the database and user, and for the application to
# connect to the database.
POSTGRES_DB=aliasvault
POSTGRES_USER=aliasvault
# Set the password for the database user.
# This can be generated using the following command:
# $ openssl rand -base64 32
POSTGRES_PASSWORD=
# Note: in order to change the password for an existing installation
# refer to https://docs.aliasvault.net/misc/dev/database-operations.html
# ----------------------------------------------------------------------------
# Admin user configuration
# ----------------------------------------------------------------------------
# Set the password for the admin user. This is an encrypted hash that needs
# to be generated using the `aliasvault-cli` tool. This allows you to login
# to the admin panel at https://your-hostname/admin.
#
# For example:
# docker run --rm ghcr.io/lanedirt/aliasvault-installcli:latest hash-password "my-password"
#
# Then copy the output and paste it into the ADMIN_PASSWORD_HASH variable below.
# When changing the hash, update the ADMIN_PASSWORD_GENERATED variable to the current date and time
# and then restart the AliasVault docker containers to apply the changes.
ADMIN_PASSWORD_HASH=
# Set the date and time the admin password was last generated. When changing the
# admin password hash manually, make sure to increase this value so the system
# knows that the password has been changed and should be overwritten with the new hash.
ADMIN_PASSWORD_GENERATED=2024-01-01T00:00:00Z
# ----------------------------------------------------------------------------
# Email server configuration for email aliases
# ----------------------------------------------------------------------------
# In order to use AliasVault's private email domains feature, you need to configure
# your DNS. Please refer to the full documentation for more instructions on DNS:
# https://docs.aliasvault.net/installation/install.html#3-email-server-setup
#
# Set the private email domains below that are allowed to be used (comma separated values).
# Example: PRIVATE_EMAIL_DOMAINS=example.com,example2.org
# To disable the private email domains feature, set this to "DISABLED.TLD"
PRIVATE_EMAIL_DOMAINS=DISABLED.TLD
# Set whether TLS is enabled for SMTP.
SMTP_TLS_ENABLED=false
# ----------------------------------------------------------------------------
# Let's Encrypt configuration
# ----------------------------------------------------------------------------
# Set whether Let's Encrypt is enabled. This is only supported through
# the install.sh script.
LETSENCRYPT_ENABLED=false
# ----------------------------------------------------------------------------
# Optional configuration settings
# ----------------------------------------------------------------------------
PUBLIC_REGISTRATION_ENABLED=true
IP_LOGGING_ENABLED=true
# Set the support email address which is shown to users in the main web app.
# Keep this blank if you don't want to show a support email.
SUPPORT_EMAIL=

31
.gitattributes vendored
View File

@@ -1,2 +1,31 @@
# Auto detect text files and perform LF normalization
# Set default behavior to automatically normalize line endings
* text=auto
# Common files should always use LF (Unix-style) line endings
*.sh text eol=lf
*.cs text eol=lf
*.razor text eol=lf
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.xml text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
# Docker files should use LF
Dockerfile text eol=lf
docker-compose*.yml text eol=lf
# Config files should use LF
*.conf text eol=lf
*.config text eol=lf
.env* text eol=lf
# Batch scripts should always use CRLF (Windows-style) line endings
*.bat text eol=crlf
*.cmd text eol=crlf
# Documentation should be normalized
*.md text
*.txt text

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
# These are supported funding model platforms
buy_me_a_coffee: lanedirt

View File

@@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for AliasVault
title: '[Feature Request] '
labels: enhancement
labels: '⚡️ enhancement'
assignees: ''
---

View File

@@ -1,21 +1,15 @@
## Description
Please include a summary of the changes and the related issue(s).
- [ ] Bug fix
- [ ] Feature enhancement
- [ ] Documentation update
- [ ] Other (please describe):
## Related Issues
Link to any issues that this PR addresses:
Fixes #[issue-number]
## Checklist
- [ ] Code adheres to project standards and guidelines.
- [ ] Documentation has been updated where applicable.
## Additional Information
Add any additional context, screenshots, or explanations here.
Add any additional context, screenshots, or explanations here.

View File

@@ -1,10 +0,0 @@
#!/bin/bash
# Commit-msg hook to check commit messages for issue number in format "(#123)"
commit_message=$(cat "$1")
if ! grep -q "(\#[0-9]\+)" <<< "$commit_message"; then
echo "Error: Commit message must contain an issue number in the format \"(#123)\""
exit 1
fi

View File

@@ -0,0 +1,164 @@
name: Browser Extension Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build-chrome-extension:
runs-on: ubuntu-latest
defaults:
run:
working-directory: browser-extension
steps:
- uses: actions/checkout@v4
- name: Get short SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: browser-extension/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build extension
run: npm run build:chrome
- name: Run tests
run: npm run test
- name: Run linting
run: npm run lint
- name: Zip Chrome Extension
run: npm run zip:chrome
- name: Unzip for artifact
run: |
mkdir -p dist/chrome-unpacked
unzip dist/aliasvault-browser-extension-*-chrome.zip -d dist/chrome-unpacked
- name: Upload dist artifact Chrome
uses: actions/upload-artifact@v4
with:
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', steps.vars.outputs.sha_short) || steps.vars.outputs.sha_short) }}-chrome
path: browser-extension/dist/chrome-unpacked
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
build-firefox-extension:
runs-on: ubuntu-latest
defaults:
run:
working-directory: browser-extension
steps:
- uses: actions/checkout@v4
- name: Get short SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: browser-extension/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build extension
run: npm run build:firefox
- name: Run tests
run: npm run test
- name: Run linting
run: npm run lint
- name: Zip Firefox Extension
run: npm run zip:firefox
- name: Unzip for artifact
run: |
mkdir -p dist/firefox-unpacked
unzip dist/aliasvault-browser-extension-*-firefox.zip -d dist/firefox-unpacked
mkdir -p dist/sources-unpacked
unzip dist/aliasvault-browser-extension-*-sources.zip -d dist/sources-unpacked
- name: Upload dist artifact Firefox
uses: actions/upload-artifact@v4
with:
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', steps.vars.outputs.sha_short) || steps.vars.outputs.sha_short) }}-firefox
path: browser-extension/dist/firefox-unpacked
- name: Upload dist artifact Firefox sources
uses: actions/upload-artifact@v4
with:
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', steps.vars.outputs.sha_short) || steps.vars.outputs.sha_short) }}-sources
path: browser-extension/dist/sources-unpacked
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
build-edge-extension:
runs-on: ubuntu-latest
defaults:
run:
working-directory: browser-extension
steps:
- uses: actions/checkout@v4
- name: Get short SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: browser-extension/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build extension
run: npm run build:edge
- name: Run tests
run: npm run test
- name: Run linting
run: npm run lint
- name: Zip Edge Extension
run: npm run zip:edge
- name: Unzip for artifact
run: |
mkdir -p dist/edge-unpacked
unzip dist/aliasvault-browser-extension-*-edge.zip -d dist/edge-unpacked
- name: Upload dist artifact Edge
uses: actions/upload-artifact@v4
with:
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', steps.vars.outputs.sha_short) || steps.vars.outputs.sha_short) }}-edge
path: browser-extension/dist/edge-unpacked
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}

View File

@@ -1,70 +0,0 @@
name: Browser Extension Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]
workflow_dispatch:
jobs:
chrome-extension:
runs-on: ubuntu-latest
defaults:
run:
working-directory: browser-extensions/chrome
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: browser-extensions/chrome/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build extension
run: npm run build
- name: Run tests
run: npm run test
- name: Run linting
run: npm run lint
- name: Upload dist artifact
uses: actions/upload-artifact@v4
with:
name: aliasvault-chrome-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', github.sha) || github.sha) }}
path: browser-extensions/chrome/dist/
upload-release-assets:
runs-on: ubuntu-latest
needs: chrome-extension
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download built artifact
uses: actions/download-artifact@v4
with:
name: aliasvault-chrome-extension-${{ github.ref_name }}
path: browser-extensions/chrome/dist/
- name: Zip Chrome Extension
run: |
cd browser-extensions/chrome/dist
zip -r ../../../aliasvault-chrome-extension-${{ github.ref_name }}.zip .
- name: Upload Chrome Extension ZIP to Release
uses: softprops/action-gh-release@v2
with:
files: aliasvault-chrome-extension-${{ github.ref_name }}.zip
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -92,9 +92,9 @@ jobs:
exit 1
fi
- name: Test install.sh reset-password output
- name: Test install.sh reset-admin-password output
run: |
output=$(./install.sh reset-password)
output=$(./install.sh reset-admin-password)
if ! echo "$output" | grep -E '.*New admin password: [A-Za-z0-9+/=]{8,}.*'; then
echo "Password reset output format is incorrect"
echo "Expected: 'New admin password: <at least 8 base64 chars>'"

View File

@@ -43,44 +43,54 @@ jobs:
- name: Set permissions and run install.sh
id: install_script
continue-on-error: true
run: |
chmod +x install.sh
./install.sh install --verbose
- name: Check if failure was due to version mismatch
if: steps.install_script.outcome == 'failure'
run: |
if grep -q "Install script needs updating to match version" <<< "$(./install.sh install --verbose 2>&1)"; then
echo "Test skipped: Install script version is newer than latest release version. This is expected behavior if the install script is run on a branch that is ahead of the latest release."
exit 0
else
echo "Test failed due to an unexpected error"
exit 1
fi
{
./install.sh install --verbose
exit_code=$?
if [ $exit_code -eq 2 ]; then
echo "Test skipped: Install script version is newer than latest release version. This is expected behavior if the install script is run on a branch that is ahead of the latest release."
echo "skip_remaining=true" >> $GITHUB_OUTPUT
true # Force success exit code
elif [ $exit_code -ne 0 ]; then
false # Propagate failure
fi
} || {
if [ $exit_code -eq 2 ]; then
echo "skip_remaining=true" >> $GITHUB_OUTPUT
true # Version mismatch is okay
else
exit $exit_code # Propagate other failures
fi
}
- name: Set up Docker Compose
if: ${{ !steps.install_script.outputs.skip_remaining }}
run: docker compose -f docker-compose.yml up -d
- name: Wait for services to be up
if: ${{ !steps.install_script.outputs.skip_remaining }}
run: |
# Wait for a few seconds
sleep 10
- name: Test if localhost:443 (WASM app) responds
uses: nick-fields/retry@v3
with:
timeout_minutes: 2
max_attempts: 3
command: |
http_code=$(curl -k -s -o /dev/null -w "%{http_code}" https://localhost:443)
if [ "$http_code" -ne 200 ]; then
echo "Service did not respond with 200 OK. Check if client app and/or nginx is configured correctly."
exit 1
else
echo "Service responded with 200 OK"
fi
- name: Test if localhost:443 (WASM app) responds
if: ${{ !steps.install_script.outputs.skip_remaining }}
uses: nick-fields/retry@v3
with:
timeout_minutes: 2
max_attempts: 3
command: |
http_code=$(curl -k -s -o /dev/null -w "%{http_code}" https://localhost:443)
if [ "$http_code" -ne 200 ]; then
echo "Service did not respond with 200 OK. Check if client app and/or nginx is configured correctly."
exit 1
else
echo "Service responded with 200 OK"
fi
- name: Test if localhost:443/api (WebApi) responds
if: ${{ !steps.install_script.outputs.skip_remaining }}
uses: nick-fields/retry@v3
with:
timeout_minutes: 2
@@ -95,6 +105,7 @@ jobs:
fi
- name: Test if localhost:443/admin (Admin) responds
if: ${{ !steps.install_script.outputs.skip_remaining }}
uses: nick-fields/retry@v3
with:
timeout_minutes: 2
@@ -109,6 +120,7 @@ jobs:
fi
- name: Test if localhost:2525 (SmtpService) responds
if: ${{ !steps.install_script.outputs.skip_remaining }}
uses: nick-fields/retry@v3
with:
timeout_minutes: 2
@@ -121,9 +133,10 @@ jobs:
echo "SmtpService responded on port 2525"
fi
- name: Test install.sh reset-password output
- name: Test install.sh reset-admin-password output
if: ${{ !steps.install_script.outputs.skip_remaining }}
run: |
output=$(./install.sh reset-password)
output=$(./install.sh reset-admin-password)
if ! echo "$output" | grep -E '.*New admin password: [A-Za-z0-9+/=]{8,}.*'; then
echo "Password reset output format is incorrect. Expected format: 'New admin password: <at least 8 base64 chars>'"
echo "Actual output: $output"

View File

@@ -1,5 +1,4 @@
# This workflow will publish new Docker images to the GitHub Container Registry when a new release is published.
name: Publish Docker Images
name: Release
on:
release:
@@ -11,7 +10,56 @@ env:
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
upload-install-script:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Upload install.sh to release
uses: softprops/action-gh-release@v2
with:
files: install.sh
token: ${{ secrets.GITHUB_TOKEN }}
package-browser-extensions:
runs-on: ubuntu-latest
defaults:
run:
working-directory: browser-extension
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: browser-extension/package-lock.json
- name: Install dependencies
run: npm ci
- name: Zip extensions
run: |
npm run zip:chrome
npm run zip:firefox
npm run zip:edge
- name: Upload extensions to release
uses: softprops/action-gh-release@v2
with:
files: |
browser-extension/dist/aliasvault-browser-extension-*-chrome.zip
browser-extension/dist/aliasvault-browser-extension-*-firefox.zip
browser-extension/dist/aliasvault-browser-extension-*-edge.zip
browser-extension/dist/aliasvault-browser-extension-*-sources.zip
token: ${{ secrets.GITHUB_TOKEN }}
build-and-push-docker:
needs: [upload-install-script, package-browser-extensions]
runs-on: ubuntu-latest
permissions:
contents: read
@@ -114,4 +162,4 @@ jobs:
file: src/Utilities/AliasVault.InstallCli/Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-installcli:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-installcli:${{ github.ref_name }}
tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-installcli:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-installcli:${{ github.ref_name }}

4
.vscode/launch.json vendored
View File

@@ -2,10 +2,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "C#: AliasVault.WebApp [http]",
"name": "C#: AliasVault.Client [http]",
"type": "dotnet",
"request": "launch",
"projectPath": "${workspaceFolder}/src/AliasVault.WebApp/AliasVault.WebApp.csproj",
"projectPath": "${workspaceFolder}/src/AliasVault.Client/AliasVault.Client.csproj",
"launchConfigurationId": "TargetFramework=;http"
},
{

116
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,116 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build and watch API",
"type": "shell",
"command": "dotnet watch",
"args": [],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}/src/AliasVault.Api"
}
},
{
"label": "Build and watch Client",
"type": "shell",
"command": "dotnet watch",
"args": [],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}/src/AliasVault.Client"
}
},
{
"label": "Build and watch Admin",
"type": "shell",
"command": "dotnet watch",
"args": [],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}/src/AliasVault.Admin"
}
},
{
"label": "Build and watch Client CSS",
"type": "shell",
"command": "npm",
"args": ["run", "build:client-css"],
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/src/AliasVault.Client"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Build and watch Admin CSS",
"type": "shell",
"command": "npm",
"args": ["run", "build:admin-css"],
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/src/AliasVault.Admin"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Build and watch Client (API + Client + CSS)",
"dependsOn": [
"Build and watch API",
"Build and watch Client",
"Build and watch Client CSS"
],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Run Unit Tests",
"type": "shell",
"command": "dotnet",
"args": ["test"],
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}/src/Tests/AliasVault.UnitTests"
},
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Run Browser Extension (Chrome Dev)",
"type": "shell",
"command": "npm",
"args": ["run", "dev:chrome"],
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/browser-extension"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

View File

@@ -1,7 +1,7 @@
# Contributing to the source code
We welcome contributions to AliasVault. Please read the guidelines on the official AliasVault docs website on how to get your local development environment setup and the general contribution guidelines:
https://docs.aliasvault.net/misc/dev/contributing.html
https://docs.aliasvault.net/misc/dev/
> Tip: if the URL above is not available, the raw doc pages can also be found in the `docs` folder in this repository.

127
README.md
View File

@@ -1,41 +1,54 @@
<div align="center">
🌟 **If you find this project useful, please consider giving it a star!** 🌟
<h1><img src="https://github.com/user-attachments/assets/933c8b45-a190-4df6-913e-b7c64ad9938b" width="40" /> AliasVault</h1>
<p align="center">
<a href="https://app.aliasvault.net">Try cloud version 🔥</a> • <a href="https://aliasvault.net?utm_source=gh-readme">Website 🌐</a> • <a href="https://docs.aliasvault.net?utm_source=gh-readme">Documentation 📚</a> • <a href="#self-host">Self-host instructions ⚙️</a>
</p>
<p align="center">
<strong>Open-source password and (email) alias manager</strong>
</p>
# AliasVault: password & (email) alias manager [<img src="https://github.com/user-attachments/assets/933c8b45-a190-4df6-913e-b7c64ad9938b" width="100" align="right" alt="AliasVault">](https://github.com/lanedirt/AliasVault)
[<img src="https://img.shields.io/github/v/release/lanedirt/AliasVault?include_prereleases&logo=github">](https://github.com/lanedirt/AliasVault/releases)
[<img src="https://img.shields.io/github/actions/workflow/status/lanedirt/AliasVault/docker-compose-build.yml?label=docker-compose%20build">](https://github.com/lanedirt/AliasVault/actions/workflows/docker-compose-build.yml)
[<img src="https://img.shields.io/github/actions/workflow/status/lanedirt/AliasVault/dotnet-unit-tests.yml?label=unit tests">](https://github.com/lanedirt/AliasVault/actions/workflows/dotnet-build-run-tests.yml)
[<img src="https://img.shields.io/github/actions/workflow/status/lanedirt/AliasVault/dotnet-integration-tests.yml?label=integration tests">](https://github.com/lanedirt/AliasVault/actions/workflows/dotnet-build-run-tests.yml)
[<img src="https://img.shields.io/github/actions/workflow/status/lanedirt/AliasVault/dotnet-e2e-client-tests.yml?label=e2e tests">](https://github.com/lanedirt/AliasVault/actions/workflows/dotnet-e2e-client-tests.yml)
[<img src="https://img.shields.io/sonar/coverage/lanedirt_AliasVault?server=https%3A%2F%2Fsonarcloud.io&label=test code coverage">](https://sonarcloud.io/summary/new_code?id=lanedirt_AliasVault)
[<img src="https://img.shields.io/sonar/quality_gate/lanedirt_AliasVault?server=https%3A%2F%2Fsonarcloud.io&label=sonarcloud&logo=sonarcloud">](https://sonarcloud.io/summary/new_code?id=lanedirt_AliasVault)
</div>
[<img alt="Discord" src="https://img.shields.io/discord/1309300619026235422?logo=discord&logoColor=%237289da&label=discord&color=%237289da">](https://discord.gg/DsaXMTEtpF)
<div align="center">
> AliasVault is an end-to-end encrypted password and (email) alias manager that protects your privacy by creating alternative identities, passwords and email addresses for every website you use. Use the official supported cloud version or self-host AliasVault on your own server with Docker.
[<img alt="Discord" src="https://img.shields.io/discord/1309300619026235422?logo=discord&logoColor=%237289da&label=join%20discord%20chat&color=%237289da">](https://discord.gg/DsaXMTEtpF)
</div>
AliasVault is an end-to-end encrypted password and (email) alias manager that protects your privacy by creating alternative identities, passwords and email addresses for every website you use. AliasVault can be self-hosted on your own server with Docker.
- <a href="https://app.aliasvault.net">Try the cloud version 🔥</a> - <a href="https://aliasvault.net?utm_source=gh-readme">Website 🌐</a> - <a href="https://docs.aliasvault.net?utm_source=gh-readme">Documentation 📚</a> - <a href="#self-hosting">Self-host instructions ⚙️</a> - <a href="https://aliasvault.net/plugins?utm_source=gh-readme">Browser Extensions 🔌</a>
### What makes AliasVault unique:
- **Zero-knowledge architecture**: All data is end-to-end encrypted on the client and stored in encrypted state on the server. Your master password never leaves your device and the server never has access to your data.
- **Built-in email server**: AliasVault includes its own email server that allows you to generate virtual email addresses for each alias. Emails sent to these addresses are instantly visible in the AliasVault app.
- **Alias generation**: Generate aliases and assign them to a website, allowing you to use different email addresses and usernames for each website. Keeping your online identities separate and secure, making it harder for bad actors to link your accounts.
- **Open-source**: The source code is available on GitHub and can be self-hosted on your own server.
- **Zero-knowledge architecture**:
- All data is end-to-end encrypted on the client and stored in encrypted state on the server. Your master password never leaves your device and the server never has access to your data.
- **Built-in email server**:
- AliasVault includes its own email server that allows you to generate real working email addresses for each alias. Emails sent to these addresses are instantly visible in the AliasVault app and browser extension.
- **Alias generation**:
- Generate aliases and assign them to a website, allowing you to use different email addresses and usernames for each website. Keeping your online identities separate and secure, making it harder for bad actors to link your accounts.
- **Open-source & Self-hostable**:
- The source code is available on GitHub and AliasVault can be self-hosted on your own server via an easy install script.
> Note: AliasVault is currently in active development and some features may not yet have been (fully) implemented. If you run into any issues, please create an issue on GitHub.
## Screenshots
<table>
<tr>
<th align="center">Browser Extension</th>
<th align="center">Generate email and aliases</th>
</tr>
<tr>
<td align="center">
<img src="https://github.com/user-attachments/assets/d9ffd3dc-08a0-462d-8148-e8da5ec5a520" alt="Browser Autofill" />
</td>
<td align="center">
<img src="https://github.com/user-attachments/assets/86752994-d469-4b0e-b633-c089e0aed12b" alt="Generate Aliases" />
</td>
</tr>
<tr>
<th align="center">Strong security</th>
<th align="center">Easy self-host</th>
</tr>
<tr>
<td align="center">
<img src="https://github.com/user-attachments/assets/26b66379-10a5-4b8b-9c69-e64b553a10be" alt="Strong security" />
</td>
<td align="center">
<img src="https://github.com/user-attachments/assets/47c7002a-e326-4507-8801-194e134e00dd" alt="Easy self-host installation" />
</td>
</tr>
</table>
## Official Cloud Version
The official cloud version of AliasVault is freely available at [app.aliasvault.net](https://app.aliasvault.net). This fully supported platform is always up to date with our latest release. Create an account to protect your privacy today.
@@ -57,7 +70,7 @@ This method uses pre-built Docker images and works on minimal hardware specifica
```bash
# Download install script from latest stable release
curl -o install.sh https://raw.githubusercontent.com/lanedirt/AliasVault/0.12.3/install.sh
curl -L -o install.sh https://github.com/lanedirt/AliasVault/releases/latest/download/install.sh
# Make install script executable and run it. This will create the .env file, pull the Docker images, and start the AliasVault containers.
chmod +x install.sh
@@ -71,7 +84,7 @@ The install script will output the URL where the app is available. By default th
> Note: If you want to change the default AliasVault ports you can do so in the `.env` file.
## Documentation
For more detailed information about the installation process and other topics, please see the official documentation website:
For more information about the installation process, manual setup instructions and other topics, please see the official documentation website:
- [Documentation website (docs.aliasvault.net) 📚](https://docs.aliasvault.net)
## Security Architecture
@@ -88,44 +101,34 @@ For detailed information about our encryption implementation and security archit
- [Security Architecture Diagram](https://docs.aliasvault.net/architecture)
## Roadmap
AliasVault is under active development with new features being added regularly. We believe in transparency and want to share our vision for the future of the platform. Here's what we've accomplished and what we're working on next:
AliasVault is under active development, with a strong focus on usability, security, and cross-platform support.
The main focus is on ensuring robust usability for everyday tasks, including comprehensive autofill capabilities across all platforms.
🛠️ Incremental releases are published every 23 weeks, with a strong emphasis on real-world testing and user feedback.
During this phase, AliasVault can safely be used in production as it maintains strict data integrity and automatic migration guarantees.
Core features that are being worked on:
- [x] Core password & alias management
- [x] End-to-end encryption
- [x] Full end-to-end encryption
- [x] Built-in email server for aliases
- [x] Single-command Docker-based installation
- [x] Chrome browser extension
- [ ] Firefox browser extension (https://github.com/lanedirt/AliasVault/issues/581)
- [ ] Add and associate TOTP MFA tokens to credentials (https://github.com/lanedirt/AliasVault/issues/181)
- [ ] Add support for connecting custom user domains to cloud hosted version (https://github.com/lanedirt/AliasVault/issues/485)
- [ ] Import passwords from existing password managers (https://github.com/lanedirt/AliasVault/issues/542)
- [x] Easy self-hosted installer
- [x] Browser extensions with autofill feature (Chrome, Firefox, Edge, Safari, Brave)
- [x] Built-in TOTP authenticator
- [x] Import passwords from traditional password managers
- [ ] iOS and Android native apps
- [ ] Data model improvements to support reusable identities in combination with aliases
- [ ] Support for FIDO2/WebAuthn hardware keys and passkeys
- [ ] Adding support for family/team sharing (organization features)
### Future Plans
- [ ] Mobile apps (iOS, Android)
- [ ] Team / organization features (sharing passwords/aliases)
- [ ] Disposable phone number service
👉 [View the full AliasVault roadmap here](https://github.com/lanedirt/AliasVault/issues/731)
Want to suggest a feature? Join our [Discord](https://discord.gg/DsaXMTEtpF) or create an issue on GitHub.
### Got feedback or ideas?
Feel free to open an issue or join our [Discord](https://discord.gg/DsaXMTEtpF)! Contributions are warmly welcomed—whether in feature development, testing, or spreading the word. Get in touch on Discord if you're interested in contributing.
## Tech Stack & Security
### Support the mission
Your donation helps me dedicate more time and resources to improving AliasVault, making the internet safer for everyone!
AliasVault is built with a modern, secure, and scalable technology stack, ensuring robust encryption and privacy protection.
<a href="https://www.buymeacoffee.com/lanedirt" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
### Core Technologies
- **C# & ASP.NET Core** Reliable, high-performance backend for Web API.
- **Blazor WASM** Secure, interactive web UI.
- **PostgreSQL & SQLite** Database solutions, with SQLite powering encrypted user vaults.
- **Docker** Containerized deployment for scalability.
- **Next.JS & React & Typescript** - Powering the AliasVault website and browser extensions
### Security & Cryptography
- **Argon2id (Konscious.Security.Cryptography)** Industry-leading password hashing.
- **SRP** Secure Remote Password (SRP-6a) protocol for authentication.
- **MimeKit & SmtpServer** Secure email processing and virtual addresses.
### Additional Tools
- **Tailwind CSS & Flowbite** Modern UI design.
- **Playwright** Automated end-to-end testing.
- **SonarCloud** Continuous code quality monitoring.
AliasVault prioritizes security, performance, and user privacy with a technology stack trusted by the industry.

View File

@@ -29,7 +29,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AliasVault.E2ETests.Client.
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{607945F3-9896-4544-99EC-F3496CF4D36B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AliasVault.CsvImportExport", "src\Utilities\AliasVault.CsvImportExport\AliasVault.CsvImportExport.csproj", "{A9C9A606-C87E-4298-AB32-09B1884D7487}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AliasVault.ImportExport", "src\Utilities\AliasVault.ImportExport\AliasVault.ImportExport.csproj", "{A9C9A606-C87E-4298-AB32-09B1884D7487}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{8A477241-B96C-4174-968D-D40CB77F1ECD}"
EndProject
@@ -59,8 +59,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AliasVault.Cryptography.Cli
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generators", "Generators", "{03D55CA4-20B3-4FEA-9ADD-3C7B5B10E0FE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AliasVault.Generators.Password", "src\Generators\AliasVault.Generators.Password\AliasVault.Generators.Password.csproj", "{47F47A1B-49E0-406A-81C8-31FF2E4C339B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AliasVault.Generators.Identity", "src\Generators\AliasVault.Generators.Identity\AliasVault.Generators.Identity.csproj", "{80E74FBC-4EC8-45FB-B210-473337C484B5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{DD359F0A-0180-4F8F-9E48-46213386BA4D}"
@@ -161,10 +159,6 @@ Global
{542C7B7D-C2B4-4AE3-9B2C-C62FCF4DFF8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{542C7B7D-C2B4-4AE3-9B2C-C62FCF4DFF8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{542C7B7D-C2B4-4AE3-9B2C-C62FCF4DFF8E}.Release|Any CPU.Build.0 = Release|Any CPU
{47F47A1B-49E0-406A-81C8-31FF2E4C339B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47F47A1B-49E0-406A-81C8-31FF2E4C339B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47F47A1B-49E0-406A-81C8-31FF2E4C339B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47F47A1B-49E0-406A-81C8-31FF2E4C339B}.Release|Any CPU.Build.0 = Release|Any CPU
{80E74FBC-4EC8-45FB-B210-473337C484B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80E74FBC-4EC8-45FB-B210-473337C484B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80E74FBC-4EC8-45FB-B210-473337C484B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -188,6 +182,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{ED328644-A152-403D-86EB-81201AA07744} = {01AB9389-2F89-4F8E-A688-BF4BF1FC42C8}
{8E6A418A-B305-465D-857D-49953605C18E} = {29DE523D-EEF2-41E9-AC12-F20D8D02BEBB}
{15EFE0D0-F41B-47D7-86B7-8F840335CB82} = {DD359F0A-0180-4F8F-9E48-46213386BA4D}
{AF013D08-1BF6-4E23-87D2-37F614BE7952} = {29DE523D-EEF2-41E9-AC12-F20D8D02BEBB}
{1277105D-50CD-4CE0-9C2C-549F46867E54} = {5F7417F6-4388-49CC-9511-ED63C4A6488A}
{FE10F294-817F-477E-A24F-8597A15AF0B5} = {5F7417F6-4388-49CC-9511-ED63C4A6488A}
@@ -198,16 +193,14 @@ Global
{1C7C8DE9-5F2A-43DB-A25E-33319E80A509} = {29DE523D-EEF2-41E9-AC12-F20D8D02BEBB}
{857BCD0E-753F-437A-AF75-B995B4D9A5FE} = {01AB9389-2F89-4F8E-A688-BF4BF1FC42C8}
{FF0B0E64-1AE2-415C-A404-0EB78010821A} = {01AB9389-2F89-4F8E-A688-BF4BF1FC42C8}
{59642CEF-D90A-4A6B-AD3F-9C6300D1E3FC} = {DD359F0A-0180-4F8F-9E48-46213386BA4D}
{951C3DF8-DF22-4B2B-839F-FBA26DDD8ABD} = {01AB9389-2F89-4F8E-A688-BF4BF1FC42C8}
{E8D9C551-67D2-4651-8EDF-4262DF7375CE} = {01AB9389-2F89-4F8E-A688-BF4BF1FC42C8}
{DA175274-0FF7-4436-9266-742F96C2D1ED} = {01AB9389-2F89-4F8E-A688-BF4BF1FC42C8}
{BB7E701E-B1C6-453E-800A-E12CE256318D} = {01AB9389-2F89-4F8E-A688-BF4BF1FC42C8}
{341EC443-0B6B-4E8C-AF46-D6156573CEA5} = {BB7E701E-B1C6-453E-800A-E12CE256318D}
{542C7B7D-C2B4-4AE3-9B2C-C62FCF4DFF8E} = {BB7E701E-B1C6-453E-800A-E12CE256318D}
{47F47A1B-49E0-406A-81C8-31FF2E4C339B} = {03D55CA4-20B3-4FEA-9ADD-3C7B5B10E0FE}
{80E74FBC-4EC8-45FB-B210-473337C484B5} = {03D55CA4-20B3-4FEA-9ADD-3C7B5B10E0FE}
{59642CEF-D90A-4A6B-AD3F-9C6300D1E3FC} = {DD359F0A-0180-4F8F-9E48-46213386BA4D}
{15EFE0D0-F41B-47D7-86B7-8F840335CB82} = {DD359F0A-0180-4F8F-9E48-46213386BA4D}
{40CA41BF-9E67-4D0A-A3F8-38B94992E4CA} = {DD359F0A-0180-4F8F-9E48-46213386BA4D}
{D631A936-DD1C-40CC-B735-BD0A5D4F46A1} = {8A477241-B96C-4174-968D-D40CB77F1ECD}
{34FADEB6-4B56-463B-B359-F844B43D76D9} = {DD359F0A-0180-4F8F-9E48-46213386BA4D}

33
browser-extension/.gitignore vendored Normal file
View File

@@ -0,0 +1,33 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.output
dist
stats.html
stats-*.json
.wxt
web-ext.config.ts
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Dictionaries
# During build these are copied from the ../dictionaries folder because firefox zip requires all files to be in the root of the zip.
# Therefore this copied folder is not committed to the repo the original folder is already available outside this directory.
# See vite-plugins/identity-gen-dict-loader.ts for more details.
dictionaries

View File

@@ -0,0 +1,25 @@
This folder contains the source code for the browser extensions for AliasVault.
The browser extension is built using WXT and React:
- [WXT](https://wxt.dev/) is a build tool for browser extensions.
- [React](https://reactjs.org/) is a JavaScript library for building user interfaces.
To build the browser extension, run the following command in this directory:
### Build the browser extension
```bash
npm install
# Build the Chrome extension (saves in dist/chrome-mv3)
npm run zip:chrome
# Build the Firefox extension (creates two zip files in dist)
npm run zip:firefox
# Build the Edge extension (saves in dist/edge-mv3)
npm run zip:edge
# Build the Safari extension (saves in dist/safari-mv2 which is referenced by the dist/safari-xcode/AliasVault.xcodeproj project)
npm run build:safari
# Open the dist/safari-xcode/AliasVault.xcodeproj project in MacOS Xcode and run the project. This will install the extension to your Safari browser locally.
```

View File

@@ -119,9 +119,9 @@ export default [
{
languageOptions: {
globals: {
NodeJS: true,
...globals.node,
...globals.browser,
...globals.node,
NodeJS: true,
chrome: 'readonly',
}
}

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,55 +1,64 @@
{
"name": "chrome",
"version": "1.0.0",
"main": "index.tsx",
"name": "aliasvault-browser-extension",
"description": "AliasVault Browser Extension",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev:chrome": "wxt -b chrome",
"dev:firefox": "wxt -b firefox",
"dev:edge": "wxt -b edge",
"build:chrome": "wxt build -b chrome",
"build:firefox": "wxt build -b firefox",
"build:edge": "wxt build -b edge",
"build:safari": "wxt build -b safari",
"test": "vitest",
"dev": "vite dev",
"preview": "vite preview",
"test:coverage": "vitest run --coverage",
"lint": "eslint src",
"lint:custom": "eslint",
"lint:fix": "eslint src --fix",
"build": "vite build"
"zip": "wxt zip",
"zip:chrome": "wxt zip -b chrome",
"zip:firefox": "wxt zip -b firefox",
"zip:edge": "wxt zip -b edge",
"compile": "tsc --noEmit",
"postinstall": "wxt prepare"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"@types/node": "^22.13.10",
"argon2-browser": "^1.18.0",
"buffer": "^6.0.3",
"eslint-plugin-jsdoc": "^50.6.3",
"globals": "^15.14.0",
"jsdoc": "^4.0.4",
"globals": "^16.0.0",
"otpauth": "^9.3.6",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router-dom": "^7.1.4",
"secure-remote-password": "github:LinusU/secure-remote-password#73e5f732b6ca0cdbdc19da1a0c5f48cdbad2cbf0",
"sql.js": "^1.12.0",
"vitest": "^3.0.4"
"vitest": "^3.0.8",
"webext-bridge": "^6.0.1"
},
"devDependencies": {
"@types/chrome": "^0.0.280",
"@types/jsdom": "^21.1.7",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"@types/sql.js": "^1.4.9",
"@typescript-eslint/eslint-plugin": "^8.21.0",
"@typescript-eslint/parser": "^8.21.0",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/ui": "^3.0.4",
"@vitest/coverage-v8": "^3.0.8",
"@wxt-dev/module-react": "^1.1.2",
"autoprefixer": "^10.4.20",
"concurrently": "^9.1.2",
"eslint": "^9.19.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^50.6.3",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"jsdom": "^26.0.0",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^6.0.11",
"typescript": "^5.6.3",
"vite-plugin-static-copy": "^2.2.0",
"vite-plugin-web-extension": "^4.4.3"
"wxt": "^0.19.13"
}
}

View File

@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

View File

@@ -0,0 +1,62 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## User settings
xcuserdata/
## Obj-C/Swift specific
*.hmap
## App packaging
*.ipa
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build/
# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.Safari.web-extension</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,42 @@
//
// SafariWebExtensionHandler.swift
// AliasVault Extension
//
// Created by Leendert de Borst on 12/03/2025.
//
import SafariServices
import os.log
class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling {
func beginRequest(with context: NSExtensionContext) {
let request = context.inputItems.first as? NSExtensionItem
let profile: UUID?
if #available(iOS 17.0, macOS 14.0, *) {
profile = request?.userInfo?[SFExtensionProfileKey] as? UUID
} else {
profile = request?.userInfo?["profile"] as? UUID
}
let message: Any?
if #available(iOS 15.0, macOS 11.0, *) {
message = request?.userInfo?[SFExtensionMessageKey]
} else {
message = request?.userInfo?["message"]
}
os_log(.default, "Received message from browser.runtime.sendNativeMessage: %@ (profile: %@)", String(describing: message), profile?.uuidString ?? "none")
let response = NSExtensionItem()
if #available(iOS 15.0, macOS 11.0, *) {
response.userInfo = [ SFExtensionMessageKey: [ "echo": message ] ]
} else {
response.userInfo = [ "message": [ "echo": message ] ]
}
context.completeRequest(returningItems: [ response ], completionHandler: nil)
}
}

View File

@@ -0,0 +1,619 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objects = {
/* Begin PBXBuildFile section */
CE0CAFA72D81A9F7006174AB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0CAFA62D81A9F7006174AB /* AppDelegate.swift */; };
CE0CAFAB2D81A9F7006174AB /* Base in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFAA2D81A9F7006174AB /* Base */; };
CE0CAFAD2D81A9F7006174AB /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFAC2D81A9F7006174AB /* Icon.png */; };
CE0CAFAF2D81A9F7006174AB /* Style.css in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFAE2D81A9F7006174AB /* Style.css */; };
CE0CAFB12D81A9F7006174AB /* Script.js in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFB02D81A9F7006174AB /* Script.js */; };
CE0CAFB32D81A9F7006174AB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0CAFB22D81A9F7006174AB /* ViewController.swift */; };
CE0CAFB62D81A9F7006174AB /* Base in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFB52D81A9F7006174AB /* Base */; };
CE0CAFB82D81A9F8006174AB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFB72D81A9F8006174AB /* Assets.xcassets */; };
CE0CAFC12D81A9F8006174AB /* AliasVault Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = CE0CAFC02D81A9F8006174AB /* AliasVault Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
CE0CAFC62D81A9F8006174AB /* SafariWebExtensionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0CAFC52D81A9F8006174AB /* SafariWebExtensionHandler.swift */; };
CE0CAFDB2D81A9F8006174AB /* background.js in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFD32D81A9F8006174AB /* background.js */; };
CE0CAFDC2D81A9F8006174AB /* popup.html in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFD42D81A9F8006174AB /* popup.html */; };
CE0CAFDD2D81A9F8006174AB /* chunks in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFD52D81A9F8006174AB /* chunks */; };
CE0CAFDE2D81A9F8006174AB /* content-scripts in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFD62D81A9F8006174AB /* content-scripts */; };
CE0CAFDF2D81A9F8006174AB /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFD72D81A9F8006174AB /* manifest.json */; };
CE0CAFE02D81A9F8006174AB /* icon in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFD82D81A9F8006174AB /* icon */; };
CE0CAFE12D81A9F8006174AB /* assets in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFD92D81A9F8006174AB /* assets */; };
CE0CAFE22D81A9F8006174AB /* src in Resources */ = {isa = PBXBuildFile; fileRef = CE0CAFDA2D81A9F8006174AB /* src */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
CE0CAFC22D81A9F8006174AB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = CE0CAF9B2D81A9F7006174AB /* Project object */;
proxyType = 1;
remoteGlobalIDString = CE0CAFBF2D81A9F8006174AB;
remoteInfo = "AliasVault Extension";
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
CE0CAFCE2D81A9F8006174AB /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
CE0CAFC12D81A9F8006174AB /* AliasVault Extension.appex in Embed Foundation Extensions */,
);
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
CE0CAFA32D81A9F7006174AB /* AliasVault.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AliasVault.app; sourceTree = BUILT_PRODUCTS_DIR; };
CE0CAFA62D81A9F7006174AB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
CE0CAFAA2D81A9F7006174AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = Base; path = ../Base.lproj/Main.html; sourceTree = "<group>"; };
CE0CAFAC2D81A9F7006174AB /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
CE0CAFAE2D81A9F7006174AB /* Style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = Style.css; sourceTree = "<group>"; };
CE0CAFB02D81A9F7006174AB /* Script.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Script.js; sourceTree = "<group>"; };
CE0CAFB22D81A9F7006174AB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
CE0CAFB52D81A9F7006174AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
CE0CAFB72D81A9F8006174AB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
CE0CAFB92D81A9F8006174AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CE0CAFBA2D81A9F8006174AB /* AliasVault.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AliasVault.entitlements; sourceTree = "<group>"; };
CE0CAFBB2D81A9F8006174AB /* AliasVault.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AliasVault.entitlements; sourceTree = "<group>"; };
CE0CAFC02D81A9F8006174AB /* AliasVault Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "AliasVault Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
CE0CAFC52D81A9F8006174AB /* SafariWebExtensionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariWebExtensionHandler.swift; sourceTree = "<group>"; };
CE0CAFC72D81A9F8006174AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CE0CAFC82D81A9F8006174AB /* AliasVault_Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AliasVault_Extension.entitlements; sourceTree = "<group>"; };
CE0CAFD32D81A9F8006174AB /* background.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = background.js; path = "../../../dist/safari-mv2/background.js"; sourceTree = "<group>"; };
CE0CAFD42D81A9F8006174AB /* popup.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = popup.html; path = "../../../dist/safari-mv2/popup.html"; sourceTree = "<group>"; };
CE0CAFD52D81A9F8006174AB /* chunks */ = {isa = PBXFileReference; lastKnownFileType = folder; name = chunks; path = "../../../dist/safari-mv2/chunks"; sourceTree = "<group>"; };
CE0CAFD62D81A9F8006174AB /* content-scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "content-scripts"; path = "../../../dist/safari-mv2/content-scripts"; sourceTree = "<group>"; };
CE0CAFD72D81A9F8006174AB /* manifest.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = manifest.json; path = "../../../dist/safari-mv2/manifest.json"; sourceTree = "<group>"; };
CE0CAFD82D81A9F8006174AB /* icon */ = {isa = PBXFileReference; lastKnownFileType = folder; name = icon; path = "../../../dist/safari-mv2/icon"; sourceTree = "<group>"; };
CE0CAFD92D81A9F8006174AB /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = "../../../dist/safari-mv2/assets"; sourceTree = "<group>"; };
CE0CAFDA2D81A9F8006174AB /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = "../../../dist/safari-mv2/src"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
CE0CAFA02D81A9F7006174AB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
CE0CAFBD2D81A9F8006174AB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
CE0CAF9A2D81A9F7006174AB = {
isa = PBXGroup;
children = (
CE0CAFA52D81A9F7006174AB /* AliasVault */,
CE0CAFC42D81A9F8006174AB /* AliasVault Extension */,
CE0CAFA42D81A9F7006174AB /* Products */,
);
sourceTree = "<group>";
};
CE0CAFA42D81A9F7006174AB /* Products */ = {
isa = PBXGroup;
children = (
CE0CAFA32D81A9F7006174AB /* AliasVault.app */,
CE0CAFC02D81A9F8006174AB /* AliasVault Extension.appex */,
);
name = Products;
sourceTree = "<group>";
};
CE0CAFA52D81A9F7006174AB /* AliasVault */ = {
isa = PBXGroup;
children = (
CE0CAFA62D81A9F7006174AB /* AppDelegate.swift */,
CE0CAFB22D81A9F7006174AB /* ViewController.swift */,
CE0CAFB42D81A9F7006174AB /* Main.storyboard */,
CE0CAFB72D81A9F8006174AB /* Assets.xcassets */,
CE0CAFB92D81A9F8006174AB /* Info.plist */,
CE0CAFBA2D81A9F8006174AB /* AliasVault.entitlements */,
CE0CAFBB2D81A9F8006174AB /* AliasVault.entitlements */,
CE0CAFA82D81A9F7006174AB /* Resources */,
);
path = AliasVault;
sourceTree = "<group>";
};
CE0CAFA82D81A9F7006174AB /* Resources */ = {
isa = PBXGroup;
children = (
CE0CAFA92D81A9F7006174AB /* Main.html */,
CE0CAFAC2D81A9F7006174AB /* Icon.png */,
CE0CAFAE2D81A9F7006174AB /* Style.css */,
CE0CAFB02D81A9F7006174AB /* Script.js */,
);
path = Resources;
sourceTree = "<group>";
};
CE0CAFC42D81A9F8006174AB /* AliasVault Extension */ = {
isa = PBXGroup;
children = (
CE0CAFD22D81A9F8006174AB /* Resources */,
CE0CAFC52D81A9F8006174AB /* SafariWebExtensionHandler.swift */,
CE0CAFC72D81A9F8006174AB /* Info.plist */,
CE0CAFC82D81A9F8006174AB /* AliasVault_Extension.entitlements */,
);
path = "AliasVault Extension";
sourceTree = "<group>";
};
CE0CAFD22D81A9F8006174AB /* Resources */ = {
isa = PBXGroup;
children = (
CE0CAFD32D81A9F8006174AB /* background.js */,
CE0CAFD42D81A9F8006174AB /* popup.html */,
CE0CAFD52D81A9F8006174AB /* chunks */,
CE0CAFD62D81A9F8006174AB /* content-scripts */,
CE0CAFD72D81A9F8006174AB /* manifest.json */,
CE0CAFD82D81A9F8006174AB /* icon */,
CE0CAFD92D81A9F8006174AB /* assets */,
CE0CAFDA2D81A9F8006174AB /* src */,
);
name = Resources;
path = "AliasVault Extension";
sourceTree = SOURCE_ROOT;
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
CE0CAFA22D81A9F7006174AB /* AliasVault */ = {
isa = PBXNativeTarget;
buildConfigurationList = CE0CAFCF2D81A9F8006174AB /* Build configuration list for PBXNativeTarget "AliasVault" */;
buildPhases = (
CE0CAF9F2D81A9F7006174AB /* Sources */,
CE0CAFA02D81A9F7006174AB /* Frameworks */,
CE0CAFA12D81A9F7006174AB /* Resources */,
CE0CAFCE2D81A9F8006174AB /* Embed Foundation Extensions */,
);
buildRules = (
);
dependencies = (
CE0CAFC32D81A9F8006174AB /* PBXTargetDependency */,
);
name = AliasVault;
productName = AliasVault;
productReference = CE0CAFA32D81A9F7006174AB /* AliasVault.app */;
productType = "com.apple.product-type.application";
};
CE0CAFBF2D81A9F8006174AB /* AliasVault Extension */ = {
isa = PBXNativeTarget;
buildConfigurationList = CE0CAFCB2D81A9F8006174AB /* Build configuration list for PBXNativeTarget "AliasVault Extension" */;
buildPhases = (
CE0CAFBC2D81A9F8006174AB /* Sources */,
CE0CAFBD2D81A9F8006174AB /* Frameworks */,
CE0CAFBE2D81A9F8006174AB /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "AliasVault Extension";
productName = "AliasVault Extension";
productReference = CE0CAFC02D81A9F8006174AB /* AliasVault Extension.appex */;
productType = "com.apple.product-type.app-extension";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
CE0CAF9B2D81A9F7006174AB /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1540;
LastUpgradeCheck = 1540;
TargetAttributes = {
CE0CAFA22D81A9F7006174AB = {
CreatedOnToolsVersion = 15.4;
};
CE0CAFBF2D81A9F8006174AB = {
CreatedOnToolsVersion = 15.4;
};
};
};
buildConfigurationList = CE0CAF9E2D81A9F7006174AB /* Build configuration list for PBXProject "AliasVault" */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = CE0CAF9A2D81A9F7006174AB;
productRefGroup = CE0CAFA42D81A9F7006174AB /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
CE0CAFA22D81A9F7006174AB /* AliasVault */,
CE0CAFBF2D81A9F8006174AB /* AliasVault Extension */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
CE0CAFA12D81A9F7006174AB /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CE0CAFAD2D81A9F7006174AB /* Icon.png in Resources */,
CE0CAFB12D81A9F7006174AB /* Script.js in Resources */,
CE0CAFAB2D81A9F7006174AB /* Base in Resources */,
CE0CAFAF2D81A9F7006174AB /* Style.css in Resources */,
CE0CAFB82D81A9F8006174AB /* Assets.xcassets in Resources */,
CE0CAFB62D81A9F7006174AB /* Base in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
CE0CAFBE2D81A9F8006174AB /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CE0CAFDD2D81A9F8006174AB /* chunks in Resources */,
CE0CAFE02D81A9F8006174AB /* icon in Resources */,
CE0CAFE12D81A9F8006174AB /* assets in Resources */,
CE0CAFE22D81A9F8006174AB /* src in Resources */,
CE0CAFDB2D81A9F8006174AB /* background.js in Resources */,
CE0CAFDF2D81A9F8006174AB /* manifest.json in Resources */,
CE0CAFDC2D81A9F8006174AB /* popup.html in Resources */,
CE0CAFDE2D81A9F8006174AB /* content-scripts in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
CE0CAF9F2D81A9F7006174AB /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CE0CAFB32D81A9F7006174AB /* ViewController.swift in Sources */,
CE0CAFA72D81A9F7006174AB /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
CE0CAFBC2D81A9F8006174AB /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CE0CAFC62D81A9F8006174AB /* SafariWebExtensionHandler.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
CE0CAFC32D81A9F8006174AB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = CE0CAFBF2D81A9F8006174AB /* AliasVault Extension */;
targetProxy = CE0CAFC22D81A9F8006174AB /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
CE0CAFA92D81A9F7006174AB /* Main.html */ = {
isa = PBXVariantGroup;
children = (
CE0CAFAA2D81A9F7006174AB /* Base */,
);
name = Main.html;
sourceTree = "<group>";
};
CE0CAFB42D81A9F7006174AB /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
CE0CAFB52D81A9F7006174AB /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
CE0CAFC92D81A9F8006174AB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 14.5;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
CE0CAFCA2D81A9F8006174AB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 14.5;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
};
name = Release;
};
CE0CAFCC2D81A9F8006174AB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "AliasVault Extension/AliasVault_Extension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 8PHW4HN3F7;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "AliasVault Extension/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "AliasVault Extension";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
);
PRODUCT_BUNDLE_IDENTIFIER = net.aliasvault.safari.extension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
CE0CAFCD2D81A9F8006174AB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "AliasVault Extension/AliasVault_Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 8PHW4HN3F7;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "AliasVault Extension/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "AliasVault Extension";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
);
PRODUCT_BUNDLE_IDENTIFIER = net.aliasvault.safari.extension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
CE0CAFD02D81A9F8006174AB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = AliasVault/AliasVault.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_TEAM = 8PHW4HN3F7;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = AliasVault/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = AliasVault;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.16.0;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
"-framework",
WebKit,
);
PRODUCT_BUNDLE_IDENTIFIER = net.aliasvault.safari;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
CE0CAFD12D81A9F8006174AB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = AliasVault/AliasVault.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_TEAM = 8PHW4HN3F7;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = AliasVault/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = AliasVault;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.16.0;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
"-framework",
WebKit,
);
PRODUCT_BUNDLE_IDENTIFIER = net.aliasvault.safari;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
CE0CAF9E2D81A9F7006174AB /* Build configuration list for PBXProject "AliasVault" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CE0CAFC92D81A9F8006174AB /* Debug */,
CE0CAFCA2D81A9F8006174AB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CE0CAFCB2D81A9F8006174AB /* Build configuration list for PBXNativeTarget "AliasVault Extension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CE0CAFCC2D81A9F8006174AB /* Debug */,
CE0CAFCD2D81A9F8006174AB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CE0CAFCF2D81A9F8006174AB /* Build configuration list for PBXNativeTarget "AliasVault" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CE0CAFD02D81A9F8006174AB /* Debug */,
CE0CAFD12D81A9F8006174AB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = CE0CAF9B2D81A9F7006174AB /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,21 @@
//
// AppDelegate.swift
// AliasVault
//
// Created by Leendert de Borst on 12/03/2025.
//
import Cocoa
@main
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ notification: Notification) {
// Override point for customization after application launch.
}
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
}

View File

@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "mac-icon-16@1x.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "mac-icon-16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "mac-icon-32@1x.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "mac-icon-32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "mac-icon-128@1x.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "mac-icon-128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "mac-icon-256@1x.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "mac-icon-256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "mac-icon-512@1x.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "mac-icon-512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,20 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>AliasVault</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="../Style.css">
<script src="../Script.js" defer></script>
</head>
<body>
<img src="../Icon.png" width="128" height="128" alt="AliasVault Icon">
<p class="state-unknown">To enable AliasVaults browser extension, go to the Safari Extensions preferences.</p>
<p class="state-on">AliasVaults browser extension is currently enabled in Safari. If you wish to turn it off, go to the Safari Extensions preferences.</p>
<p class="state-off">AliasVaults browser extension is currently disabled in Safari. If you wish to turn it on, go to the Safari Extensions preferences.</p>
<button class="open-preferences">Open Safari Extensions Preferences…</button>
</body>
</html>

View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="19085" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19085"/>
<plugIn identifier="com.apple.WebKit2IBPlugin" version="19085"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Application-->
<scene sceneID="JPo-4y-FX3">
<objects>
<application id="hnw-xV-0zn" sceneMemberID="viewController">
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="AliasVault" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="AliasVault" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About AliasVault" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Hide AliasVault" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
</connections>
</menuItem>
<menuItem title="Show All" id="Kd2-mp-pUS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit AliasVault" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
<items>
<menuItem title="AliasVault Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
<connections>
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider="target"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="76" y="-134"/>
</scene>
<!--Window Controller-->
<scene sceneID="R2V-B0-nI4">
<objects>
<windowController showSeguePresentationStyle="single" id="B8D-0N-5wS" sceneMemberID="viewController">
<window key="window" title="AliasVault" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" animationBehavior="default" id="IQv-IB-iLA">
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<windowCollectionBehavior key="collectionBehavior" fullScreenNone="YES"/>
<rect key="contentRect" x="196" y="240" width="425" height="325"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
<connections>
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
</connections>
</window>
<connections>
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
</connections>
</windowController>
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="250"/>
</scene>
<!--View Controller-->
<scene sceneID="hIz-AP-VOD">
<objects>
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="425" height="325"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<wkWebView wantsLayer="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eOr-cG-IQY">
<rect key="frame" x="0.0" y="0.0" width="425" height="325"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<wkWebViewConfiguration key="configuration">
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
<wkPreferences key="preferences"/>
</wkWebViewConfiguration>
</wkWebView>
</subviews>
</view>
<connections>
<outlet property="webView" destination="eOr-cG-IQY" id="GFe-mU-dBY"/>
</connections>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="655"/>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SFSafariWebExtensionConverterVersion</key>
<string>15.4</string>
</dict>
</plist>

View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

@@ -0,0 +1,22 @@
function show(enabled, useSettingsInsteadOfPreferences) {
if (useSettingsInsteadOfPreferences) {
document.getElementsByClassName('state-on')[0].innerText = "AliasVault's Safari browser extension is succesfully enabled. If you wish to turn it off, go to the Safari Extensions preferences.";
document.getElementsByClassName('state-off')[0].innerText = "AliasVault's Safari browser extension is currently disabled. If you wish to turn it on, go to the Safari Extensions preferences.";
document.getElementsByClassName('state-unknown')[0].innerText = "To enable AliasVault's Safari browser extension, go to the Safari Extensions preferences.";
document.getElementsByClassName('open-preferences')[0].innerText = "Open Safari Extensions Preferences…";
}
if (typeof enabled === "boolean") {
document.body.classList.toggle(`state-on`, enabled);
document.body.classList.toggle(`state-off`, !enabled);
} else {
document.body.classList.remove(`state-on`);
document.body.classList.remove(`state-off`);
}
}
function openPreferences() {
webkit.messageHandlers.controller.postMessage("open-preferences");
}
document.querySelector("button.open-preferences").addEventListener("click", openPreferences);

View File

@@ -0,0 +1,44 @@
* {
-webkit-user-select: none;
-webkit-user-drag: none;
cursor: default;
}
:root {
color-scheme: light dark;
--spacing: 20px;
}
html {
height: 100%;
}
body {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
gap: var(--spacing);
margin: 0 calc(var(--spacing) * 2);
height: 100%;
text-align: center;
font: -apple-system-short-body;
font-family: -apple-system-short-body, system-ui;
}
body:not(.state-on, .state-off) :is(.state-on, .state-off) {
display: none;
}
body.state-on :is(.state-off, .state-unknown) {
display: none;
}
body.state-off :is(.state-on, .state-unknown) {
display: none;
}
button {
font-size: 1em;
}

View File

@@ -0,0 +1,74 @@
//
// ViewController.swift
// AliasVault
//
// Created by Leendert de Borst on 12/03/2025.
//
import Cocoa
import SafariServices
import WebKit
let extensionBundleIdentifier = "net.aliasvault.safari.extension"
class ViewController: NSViewController, WKNavigationDelegate, WKScriptMessageHandler {
@IBOutlet var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
self.webView.navigationDelegate = self
self.webView.configuration.userContentController.add(self, name: "controller")
self.webView.loadFileURL(Bundle.main.url(forResource: "Main", withExtension: "html")!, allowingReadAccessTo: Bundle.main.resourceURL!)
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
SFSafariExtensionManager.getStateOfSafariExtension(withIdentifier: extensionBundleIdentifier) { (state, error) in
guard let state = state, error == nil else {
// Insert code to inform the user that something went wrong.
return
}
DispatchQueue.main.async {
if #available(macOS 13, *) {
webView.evaluateJavaScript("show(\(state.isEnabled), true)")
} else {
webView.evaluateJavaScript("show(\(state.isEnabled), false)")
}
}
}
}
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
if (message.body as! String != "open-preferences") {
return;
}
SFSafariApplication.showPreferencesForExtension(withIdentifier: extensionBundleIdentifier) { error in
DispatchQueue.main.async {
if let error = error {
// Show manual instructions in case opening the preferences fails due to restricted permissions.
let alert = NSAlert()
alert.messageText = "Safari Extensions Settings"
alert.informativeText = """
Please follow these steps to enable the extension:
1. Open Safari
2. Click Safari > Settings in the menu bar
3. Go to Extensions
4. Find and enable "AliasVault"
"""
alert.addButton(withTitle: "OK")
alert.runModal()
}
else {
// Close app
NSApplication.shared.terminate(nil)
}
}
}
}
}

View File

@@ -0,0 +1,29 @@
This folder contains the Xcode project used to publish the Safari version of the AliasVault browser extension to Apple.
This project was created using the `safari-web-extension-converter` tool. This XCode project is a simple wrapper around the
WXT React browser extension, which is required by Apple in order to package and submit a Safari extension.
For more information see:
- https://developer.apple.com/documentation/safariservices/converting-a-web-extension-for-safari
- https://developer.apple.com/documentation/safariservices/running-your-safari-web-extension
To recreate this project, run the following command in the browser-extension root directory:
```bash
# Build the Safari extension via the normal build process (outputs in dist/safari-mv2)
npm run build:safari
# Convert the safari extension to an Xcode project (requires MacOS/XCode command line interface)
xcrun safari-web-extension-converter --bundle-identifier net.aliasvault.safari --macos-only dist/safari-mv2 --project-location safari-xcode --force
# After the Xcode project is opened, you can run the extension by clicking the "Run" button in the top left corner of the Xcode window.
# This will install the extension to your Safari browser and allow you to run it.
```
> Note: This project does not need to be recreated when the extension is updated. It loads all extension files from the dist/safari-mv2 directory that is created by the `build:safari` command. To update the extension and/or publish a new version:
> 1. Run `npm run build:safari` to rebuild the Safari extension
> 2. Open this Xcode project and rebuild it to get the latest version
> 3. Submit the extension to Apple for review via Xcode:
> - Select the "Archive" option from the Product menu
> - Select the newly created archive and click "Distribute App"
> - Select "Distribute" and follow the instructions to submit to App Store Connect

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -0,0 +1,34 @@
import { browser } from "wxt/browser";
import { defineBackground } from 'wxt/sandbox';
import { onMessage } from "webext-bridge/background";
import { setupContextMenus, handleContextMenuClick } from './background/ContextMenu';
import { handleCheckAuthStatus, handleClearVault, handleCreateIdentity, handleGetCredentials, handleGetDefaultEmailDomain, handleGetDefaultIdentityLanguage, handleGetDerivedKey, handleGetPasswordSettings, handleGetVault, handleStoreVault, handleSyncVault } from './background/VaultMessageHandler';
import { handleOpenPopup, handlePopupWithCredential } from './background/PopupMessageHandler';
export default defineBackground({
/**
* This is the main entry point for the background script.
*/
main() {
// Set up context menus
setupContextMenus();
browser.contextMenus.onClicked.addListener((info: browser.contextMenus.OnClickData, tab?: browser.tabs.Tab) =>
handleContextMenuClick(info, tab)
);
// Listen for messages using webext-bridge
onMessage('CHECK_AUTH_STATUS', () => handleCheckAuthStatus());
onMessage('STORE_VAULT', ({ data }) => handleStoreVault(data));
onMessage('SYNC_VAULT', () => handleSyncVault());
onMessage('GET_VAULT', () => handleGetVault());
onMessage('CLEAR_VAULT', () => handleClearVault());
onMessage('GET_CREDENTIALS', () => handleGetCredentials());
onMessage('CREATE_IDENTITY', ({ data }) => handleCreateIdentity(data));
onMessage('GET_DEFAULT_EMAIL_DOMAIN', () => handleGetDefaultEmailDomain());
onMessage('GET_DEFAULT_IDENTITY_LANGUAGE', () => handleGetDefaultIdentityLanguage());
onMessage('GET_PASSWORD_SETTINGS', () => handleGetPasswordSettings());
onMessage('GET_DERIVED_KEY', () => handleGetDerivedKey());
onMessage('OPEN_POPUP', () => handleOpenPopup());
onMessage('OPEN_POPUP_WITH_CREDENTIAL', ({ data }) => handlePopupWithCredential(data));
}
});

View File

@@ -1,18 +1,20 @@
import { PasswordGenerator } from '../shared/generators/Password/PasswordGenerator';
import { sendMessage } from 'webext-bridge/background';
import { PasswordGenerator } from '../../utils/generators/Password/PasswordGenerator';
import { browser } from 'wxt/browser';
/**
* Setup the context menus.
*/
export function setupContextMenus() : void {
// Create root menu
chrome.contextMenus.create({
browser.contextMenus.create({
id: "aliasvault-root",
title: "AliasVault",
contexts: ["all"]
});
// Add fill option first (only for editable fields)
chrome.contextMenus.create({
browser.contextMenus.create({
id: "aliasvault-activate-form",
parentId: "aliasvault-root",
title: "Autofill with AliasVault",
@@ -20,7 +22,7 @@ export function setupContextMenus() : void {
});
// Add separator (only for editable fields)
chrome.contextMenus.create({
browser.contextMenus.create({
id: "aliasvault-separator",
parentId: "aliasvault-root",
type: "separator",
@@ -28,7 +30,7 @@ export function setupContextMenus() : void {
});
// Add password generator option
chrome.contextMenus.create({
browser.contextMenus.create({
id: "aliasvault-generate-password",
parentId: "aliasvault-root",
title: "Generate random password (copy to clipboard)",
@@ -39,15 +41,15 @@ export function setupContextMenus() : void {
/**
* Handle context menu clicks.
*/
export function handleContextMenuClick(info: chrome.contextMenus.OnClickData, tab?: chrome.tabs.Tab) : void {
export function handleContextMenuClick(info: browser.contextMenus.OnClickData, tab?: browser.tabs.Tab) : void {
if (info.menuItemId === "aliasvault-generate-password") {
// Initialize password generator
const passwordGenerator = new PasswordGenerator();
const password = passwordGenerator.generateRandomPassword();
// Use chrome.scripting to write password to clipboard from active tab
// Use browser.scripting to write password to clipboard from active tab
if (tab?.id) {
chrome.scripting.executeScript({
browser.scripting.executeScript({
target: { tabId: tab.id },
func: copyPasswordToClipboard,
args: [password]
@@ -57,22 +59,14 @@ export function handleContextMenuClick(info: chrome.contextMenus.OnClickData, ta
if (info.menuItemId === "aliasvault-activate-form" && tab?.id) {
// First get the active element's identifier
chrome.scripting.executeScript({
browser.scripting.executeScript({
target: { tabId: tab.id },
func: getActiveElementIdentifier,
}, (results) => {
const elementIdentifier = results[0]?.result;
if (elementIdentifier) {
// Then send message to content script with proper error handling
chrome.tabs.sendMessage(
tab.id,
{
type: 'OPEN_ALIASVAULT_POPUP',
elementIdentifier
}
).catch(error => {
console.error('Error sending message to content script:', error);
});
// Send message to content script with proper tab targeting
sendMessage('OPEN_AUTOFILL_POPUP', { elementIdentifier }, `content-script@${tab.id}`);
}
});
}

View File

@@ -0,0 +1,34 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { browser } from "wxt/browser";
import { BoolResponse } from '../../utils/types/messaging/BoolResponse';
/**
* Handle opening the popup.
*/
export function handleOpenPopup() : Promise<BoolResponse> {
return (async () : Promise<BoolResponse> => {
browser.windows.create({
url: browser.runtime.getURL('/popup.html?mode=inline_unlock&expanded=true'),
type: 'popup',
width: 400,
height: 600,
focused: true
});
return { success: true };
})();
}
/**
* Handle opening the popup with a credential.
*/
export function handlePopupWithCredential(message: any) : Promise<BoolResponse> {
return (async () : Promise<BoolResponse> => {
browser.windows.create({
url: browser.runtime.getURL(`/popup.html?expanded=true#/credentials/${message.credentialId}`),
type: 'popup',
width: 400,
height: 600,
focused: true
});
return { success: true };
})();
}

View File

@@ -0,0 +1,374 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import EncryptionUtility from '../../utils/EncryptionUtility';
import SqliteClient from '../../utils/SqliteClient';
import { WebApiService } from '../../utils/WebApiService';
import { Vault } from '../../utils/types/webapi/Vault';
import { VaultResponse } from '../../utils/types/webapi/VaultResponse';
import { VaultPostResponse } from '../../utils/types/webapi/VaultPostResponse';
import { storage } from 'wxt/storage';
import { BoolResponse as messageBoolResponse } from '../../utils/types/messaging/BoolResponse';
import { VaultResponse as messageVaultResponse } from '../../utils/types/messaging/VaultResponse';
import { CredentialsResponse as messageCredentialsResponse } from '../../utils/types/messaging/CredentialsResponse';
import { StringResponse as stringResponse } from '../../utils/types/messaging/StringResponse';
import { PasswordSettingsResponse as messagePasswordSettingsResponse } from '../../utils/types/messaging/PasswordSettingsResponse';
/**
* Check if the user is logged in and if the vault is locked.
*/
export async function handleCheckAuthStatus() : Promise<{ isLoggedIn: boolean, isVaultLocked: boolean }> {
const username = await storage.getItem('local:username');
const accessToken = await storage.getItem('local:accessToken');
const vaultData = await storage.getItem('session:encryptedVault');
const isLoggedIn = username !== null && accessToken !== null;
const isVaultLocked = isLoggedIn && vaultData === null;
return {
isLoggedIn,
isVaultLocked
};
}
/**
* Store the vault in browser storage.
*/
export async function handleStoreVault(
message: any,
) : Promise<messageBoolResponse> {
try {
const vaultResponse = message.vaultResponse as VaultResponse;
const encryptedVaultBlob = vaultResponse.vault.blob;
// Store encrypted vault and derived key in session storage.
await storage.setItems([
{ key: 'session:encryptedVault', value: encryptedVaultBlob },
{ key: 'session:derivedKey', value: message.derivedKey },
{ key: 'session:publicEmailDomains', value: vaultResponse.vault.publicEmailDomainList },
{ key: 'session:privateEmailDomains', value: vaultResponse.vault.privateEmailDomainList },
{ key: 'session:vaultRevisionNumber', value: vaultResponse.vault.currentRevisionNumber }
]);
return { success: true };
} catch (error) {
console.error('Failed to store vault:', error);
return { success: false, error: 'Failed to store vault' };
}
}
/**
* Sync the vault with the server to check if a newer vault is available. If so, the vault will be updated.
*/
export async function handleSyncVault(
) : Promise<messageBoolResponse> {
const webApi = new WebApiService(() => {});
const statusResponse = await webApi.getStatus();
const statusError = webApi.validateStatusResponse(statusResponse);
if (statusError !== null) {
return { success: false, error: statusError };
}
const vaultRevisionNumber = await storage.getItem('session:vaultRevisionNumber') as number;
if (statusResponse.vaultRevision > vaultRevisionNumber) {
// Retrieve the latest vault from the server.
const vaultResponse = await webApi.get<VaultResponse>('Vault');
await storage.setItems([
{ key: 'session:encryptedVault', value: vaultResponse.vault.blob },
{ key: 'session:publicEmailDomains', value: vaultResponse.vault.publicEmailDomainList },
{ key: 'session:privateEmailDomains', value: vaultResponse.vault.privateEmailDomainList },
{ key: 'session:vaultRevisionNumber', value: vaultResponse.vault.currentRevisionNumber }
]);
}
return { success: true };
}
/**
* Get the vault from browser storage.
*/
export async function handleGetVault(
) : Promise<messageVaultResponse> {
try {
const encryptedVault = await storage.getItem('session:encryptedVault') as string;
const derivedKey = await storage.getItem('session:derivedKey') as string;
const publicEmailDomains = await storage.getItem('session:publicEmailDomains') as string[];
const privateEmailDomains = await storage.getItem('session:privateEmailDomains') as string[];
const vaultRevisionNumber = await storage.getItem('session:vaultRevisionNumber') as number;
if (!encryptedVault) {
console.error('Vault not available');
return { success: false, error: 'Vault not available' };
}
const decryptedVault = await EncryptionUtility.symmetricDecrypt(
encryptedVault,
derivedKey
);
return {
success: true,
vault: decryptedVault,
publicEmailDomains: publicEmailDomains ?? [],
privateEmailDomains: privateEmailDomains ?? [],
vaultRevisionNumber: vaultRevisionNumber ?? 0
};
} catch (error) {
console.error('Failed to get vault:', error);
return { success: false, error: 'Failed to get vault' };
}
}
/**
* Clear the vault from browser storage.
*/
export function handleClearVault(
) : messageBoolResponse {
storage.removeItems([
'session:encryptedVault',
'session:derivedKey',
'session:publicEmailDomains',
'session:privateEmailDomains',
'session:vaultRevisionNumber'
]);
return { success: true };
}
/**
* Get all credentials.
*/
export async function handleGetCredentials(
) : Promise<messageCredentialsResponse> {
const derivedKey = await storage.getItem('session:derivedKey') as string;
if (!derivedKey) {
return { success: false, error: 'Vault is locked' };
}
try {
const sqliteClient = await createVaultSqliteClient();
const credentials = sqliteClient.getAllCredentials();
return { success: true, credentials: credentials };
} catch (error) {
console.error('Error getting credentials:', error);
return { success: false, error: 'Failed to get credentials' };
}
}
/**
* Create an identity.
*/
export async function handleCreateIdentity(
message: any,
) : Promise<messageBoolResponse> {
const derivedKey = await storage.getItem('session:derivedKey') as string;
if (!derivedKey) {
return { success: false, error: 'Vault is locked' };
}
try {
const sqliteClient = await createVaultSqliteClient();
// Add the new credential to the vault/database.
sqliteClient.createCredential(message.credential);
// Upload the new vault to the server.
await uploadNewVaultToServer(sqliteClient);
return { success: true };
} catch (error) {
console.error('Failed to create identity:', error);
return { success: false, error: 'Failed to create identity' };
}
}
/**
* Get the email addresses for a vault.
*/
export async function getEmailAddressesForVault(
sqliteClient: SqliteClient
): Promise<string[]> {
// TODO: create separate query to only get email addresses to avoid loading all credentials.
const credentials = sqliteClient.getAllCredentials();
// Get metadata from storage
const privateEmailDomains = await storage.getItem('session:privateEmailDomains') as string[];
const emailAddresses = credentials
.filter(cred => cred.Alias?.Email != null)
.map(cred => cred.Alias.Email ?? '')
.filter((email, index, self) => self.indexOf(email) === index);
return emailAddresses.filter(email => {
const domain = email?.split('@')[1];
return domain && privateEmailDomains.includes(domain);
});
}
/**
* Get default email domain for a vault.
*/
export function handleGetDefaultEmailDomain(
) : Promise<stringResponse> {
return (async () : Promise<stringResponse> => {
try {
const privateEmailDomains = await storage.getItem('session:privateEmailDomains') as string[];
const publicEmailDomains = await storage.getItem('session:publicEmailDomains') as string[];
const sqliteClient = await createVaultSqliteClient();
const defaultEmailDomain = sqliteClient.getDefaultEmailDomain();
/**
* Check if a domain is valid.
*/
const isValidDomain = (domain: string) : boolean => {
const isValid = (domain &&
domain !== 'DISABLED.TLD' &&
(privateEmailDomains.includes(domain) || publicEmailDomains.includes(domain))) as boolean;
return isValid;
};
// First check if the default domain that is configured in the vault is still valid.
if (defaultEmailDomain && isValidDomain(defaultEmailDomain)) {
return { success: true, value: defaultEmailDomain };
}
// If default domain is not valid, fall back to first available private domain.
const firstPrivate = privateEmailDomains.find(isValidDomain);
if (firstPrivate) {
return { success: true, value: firstPrivate };
}
// Return first valid public domain if no private domains are available.
const firstPublic = publicEmailDomains.find(isValidDomain);
if (firstPublic) {
return { success: true, value: firstPublic };
}
// Return null if no valid domains are found
return { success: true };
} catch (error) {
console.error('Error getting default email domain:', error);
return { success: false, error: 'Failed to get default email domain' };
}
})();
}
/**
* Get the default identity language.
*/
export async function handleGetDefaultIdentityLanguage(
) : Promise<stringResponse> {
try {
const sqliteClient = await createVaultSqliteClient();
const settingValue = sqliteClient.getDefaultIdentityLanguage();
return { success: true, value: settingValue };
} catch (error) {
console.error('Error getting default identity language:', error);
return { success: false, error: 'Failed to get default identity language' };
}
}
/**
* Get the password settings.
*/
export async function handleGetPasswordSettings(
) : Promise<messagePasswordSettingsResponse> {
try {
const sqliteClient = await createVaultSqliteClient();
const passwordSettings = sqliteClient.getPasswordSettings();
return { success: true, settings: passwordSettings };
} catch (error) {
console.error('Error getting password settings:', error);
return { success: false, error: 'Failed to get password settings' };
}
}
/**
* Get the derived key for the encrypted vault.
*/
export async function handleGetDerivedKey(
) : Promise<string> {
const derivedKey = await storage.getItem('session:derivedKey') as string;
return derivedKey;
}
/**
* Upload a new version of the vault to the server using the provided sqlite client.
*/
async function uploadNewVaultToServer(sqliteClient: SqliteClient) : Promise<void> {
const updatedVaultData = sqliteClient.exportToBase64();
const derivedKey = await storage.getItem('session:derivedKey') as string;
const encryptedVault = await EncryptionUtility.symmetricEncrypt(
updatedVaultData,
derivedKey
);
await storage.setItems([
{ key: 'session:encryptedVault', value: encryptedVault }
]);
// Get metadata from storage
const vaultRevisionNumber = await storage.getItem('session:vaultRevisionNumber') as number;
// Upload new encrypted vault to server.
const username = await storage.getItem('local:username') as string;
const emailAddresses = await getEmailAddressesForVault(sqliteClient);
const newVault: Vault = {
blob: encryptedVault,
createdAt: new Date().toISOString(),
credentialsCount: sqliteClient.getAllCredentials().length,
currentRevisionNumber: vaultRevisionNumber,
emailAddressList: emailAddresses,
privateEmailDomainList: [], // Empty on purpose, API will not use this for vault updates.
publicEmailDomainList: [], // Empty on purpose, API will not use this for vault updates.
encryptionPublicKey: '', // Empty on purpose, only required if new public/private key pair is generated.
client: '', // Empty on purpose, API will not use this for vault updates.
updatedAt: new Date().toISOString(),
username: username,
version: sqliteClient.getDatabaseVersion() ?? '0.0.0'
};
const webApi = new WebApiService(() => {});
const response = await webApi.post<Vault, VaultPostResponse>('Vault', newVault);
// Check if response is successful (.status === 0)
if (response.status === 0) {
await storage.setItem('session:vaultRevisionNumber', response.newRevisionNumber);
} else {
throw new Error('Failed to upload new vault to server');
}
}
/**
* Create a new sqlite client for the stored vault.
*/
async function createVaultSqliteClient() : Promise<SqliteClient> {
const encryptedVault = await storage.getItem('session:encryptedVault') as string;
const derivedKey = await storage.getItem('session:derivedKey') as string;
if (!encryptedVault || !derivedKey) {
throw new Error('No vault or derived key found');
}
// Decrypt the vault.
const decryptedVault = await EncryptionUtility.symmetricDecrypt(
encryptedVault,
derivedKey
);
// Initialize the SQLite client with the decrypted vault.
const sqliteClient = new SqliteClient();
await sqliteClient.initializeFromBase64(decryptedVault);
return sqliteClient;
}

View File

@@ -0,0 +1,109 @@
import './contentScript/style.css';
import { FormDetector } from '../utils/formDetector/FormDetector';
import { isAutoShowPopupEnabled, openAutofillPopup, removeExistingPopup } from './contentScript/Popup';
import { injectIcon, popupDebounceTimeHasPassed } from './contentScript/Form';
import { onMessage } from "webext-bridge/content-script";
import { BoolResponse as messageBoolResponse } from '../utils/types/messaging/BoolResponse';
import { defineContentScript } from 'wxt/sandbox';
import { createShadowRootUi } from 'wxt/client';
export default defineContentScript({
matches: ['<all_urls>'],
cssInjectionMode: 'ui',
allFrames: true,
matchAboutBlank: true,
runAt: 'document_start',
/**
* Main entry point for the content script.
*/
async main(ctx) {
if (ctx.isInvalid) {
return;
}
// Create a shadow root UI for isolation
const ui = await createShadowRootUi(ctx, {
name: 'aliasvault-ui',
position: 'inline',
anchor: 'html',
/**
* Handle mount.
*/
onMount(container) {
/**
* Handle input field focus.
*/
const handleFocusIn = async (e: FocusEvent) : Promise<void> => {
if (ctx.isInvalid) {
return;
}
// Check if element itself, html or body has av-disable attribute like av-disable="true"
const avDisable = (e.target as HTMLElement).getAttribute('av-disable') ?? document.body?.getAttribute('av-disable') ?? document.documentElement.getAttribute('av-disable');
if (avDisable === 'true') {
return;
}
const target = e.target as HTMLInputElement;
const textInputTypes = ['text', 'email', 'tel', 'password', 'search', 'url'];
if (target.tagName === 'INPUT' && textInputTypes.includes(target.type) && !target.dataset.aliasvaultIgnore) {
const formDetector = new FormDetector(document, target);
if (!formDetector.containsLoginForm()) {
return;
}
injectIcon(target, container);
// Only show popup if its enabled and debounce time has passed.
if (await isAutoShowPopupEnabled() && popupDebounceTimeHasPassed()) {
openAutofillPopup(target, container);
}
}
};
// Listen for input field focus in the main document
document.addEventListener('focusin', handleFocusIn);
// Listen for popstate events (back/forward navigation)
window.addEventListener('popstate', () => {
if (ctx.isInvalid) {
return;
}
removeExistingPopup(container);
});
// Listen for messages from the background script
onMessage('OPEN_AUTOFILL_POPUP', async (message: { data: { elementIdentifier: string } }) : Promise<messageBoolResponse> => {
const { data } = message;
const { elementIdentifier } = data;
if (!elementIdentifier) {
return { success: false, error: 'No element identifier provided' };
}
const target = document.getElementById(elementIdentifier) ?? document.getElementsByName(elementIdentifier)[0];
if (!(target instanceof HTMLInputElement)) {
return { success: false, error: 'Target element is not an input field' };
}
const formDetector = new FormDetector(document, target);
if (!formDetector.containsLoginForm()) {
return { success: false, error: 'No form found' };
}
injectIcon(target, container);
openAutofillPopup(target, container);
return { success: true };
});
},
});
// Mount the UI to create the shadow root
ui.autoMount();
},
});

View File

@@ -1,4 +1,5 @@
import { Credential } from "../shared/types/Credential";
import { CombinedStopWords } from "@/utils/formDetector/FieldPatterns";
import { Credential } from "../../utils/types/Credential";
/**
* Filter credentials based on current URL and page context to determine which credentials to show
@@ -26,7 +27,7 @@ export function filterCredentials(credentials: Credential[], currentUrl: string,
const credDomainParts = credUrlObject.hostname.toLowerCase().split('.');
const currentDomainParts = currentUrlObject.hostname.toLowerCase().split('.');
// Get root domain (last two parts, e.g., 'aliasvaul.net')
// Get root domain (last two parts, e.g., 'aliasvault.net')
const credRootDomain = credDomainParts.slice(-2).join('.');
const currentRootDomain = currentDomainParts.slice(-2).join('.');
@@ -40,22 +41,11 @@ export function filterCredentials(credentials: Credential[], currentUrl: string,
// 3. Page title word match if still no matches
if (filtered.length === 0 && pageTitle.length > 0) {
// TODO: make bad words list configurable per language.
const badWords = new Set([
'login', 'signin', 'sign', 'register', 'signup', 'account',
'portal', 'dashboard', 'home', 'welcome', 'authentication',
'page', 'site', 'secure', 'password', 'access', 'member',
'user', 'profile', 'auth', 'session', 'inloggen',
'registreren', 'registratie', 'free', 'gratis', 'create',
'new', 'aanmelden', 'inschrijven', 'nieuwsbrief', 'schrijf',
'your', 'jouw'
]);
const titleWords = pageTitle.toLowerCase()
.split(/\s+/)
.filter(word =>
word.length > 3 && // Filter out words shorter than 4 characters
!badWords.has(word.toLowerCase()) // Filter out generic words
!CombinedStopWords.has(word.toLowerCase()) // Filter out generic words
);
filtered = credentials.filter(cred =>

View File

@@ -0,0 +1,221 @@
import { FormDetector } from "../../utils/formDetector/FormDetector";
import { FormFiller } from "../../utils/formDetector/FormFiller";
import { Credential } from "../../utils/types/Credential";
import { openAutofillPopup } from "./Popup";
/**
* Global timestamp to track popup debounce time.
* This is used to not show the popup again for a specific amount of time.
* Used after autofill events to prevent spamming the popup from automatic
* triggered browser events which can cause "focus" events to trigger.
*/
let popupDebounceTime = 0;
/**
* Check if popup can be shown based on debounce time.
*/
export function popupDebounceTimeHasPassed() : boolean {
if (Date.now() < popupDebounceTime) {
return false;
}
return true;
}
/**
* Hide popup for a specific amount of time.
*/
export function hidePopupFor(ms: number) : void {
popupDebounceTime = Date.now() + ms;
}
/**
* Fill credential into current form.
*
* @param credential - The credential to fill.
* @param input - The input element that triggered the popup. Required when filling credentials to know which form to fill.
*/
export function fillCredential(credential: Credential, input: HTMLInputElement) : void {
// Set debounce time to 300ms to prevent the popup from being shown again within 300ms because of autofill events.
hidePopupFor(300);
const formDetector = new FormDetector(document, input);
const form = formDetector.getForm();
if (!form) {
// No form found, so we can't fill anything.
return;
}
const formFiller = new FormFiller(form, triggerInputEvents);
formFiller.fillFields(credential);
}
/**
* Inject icon for a focused input element
*/
export function injectIcon(input: HTMLInputElement, container: HTMLElement): void {
const aliasvaultIconSvg = `<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 500 500" version="1.1" viewBox="0 0 500 500" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<path d="m459.87 294.95c0.016205 5.4005 0.03241 10.801-0.35022 16.873-1.111 6.3392-1.1941 12.173-2.6351 17.649-10.922 41.508-36.731 69.481-77.351 83.408-7.2157 2.4739-14.972 3.3702-22.479 4.995-23.629 0.042205-47.257 0.11453-70.886 0.12027-46.762 0.011322-93.523-0.01416-140.95-0.43411-8.59-2.0024-16.766-2.8352-24.398-5.3326-21.595-7.0666-39.523-19.656-53.708-37.552-10.227-12.903-17.579-27.17-21.28-43.221-1.475-6.3967-2.4711-12.904-3.6852-19.361-0.051849-5.747-0.1037-11.494 0.26915-17.886 4.159-42.973 27.68-71.638 63.562-92.153 0-0.70761-0.001961-1.6988 3.12e-4 -2.69 0.022484-9.8293-1.3071-19.894 0.35664-29.438 3.2391-18.579 11.08-35.272 23.763-49.773 12.098-13.832 26.457-23.989 43.609-30.029 7.813-2.7512 16.14-4.0417 24.234-5.9948 7.392-0.025734 14.784-0.05146 22.835 0.32253 4.1959 0.95392 7.7946 1.2538 11.258 2.1053 17.16 4.2192 32.287 12.176 45.469 24.104 2.2558 2.0411 4.372 6.6241 9.621 3.868 16.839-8.8419 34.718-11.597 53.603-8.594 16.791 2.6699 31.602 9.4308 44.236 20.636 11.531 10.227 19.84 22.841 25.393 37.236 6.3436 16.445 10.389 33.163 6.0798 49.389 7.9587 8.9321 15.807 16.704 22.421 25.414 9.162 12.065 15.33 25.746 18.144 40.776 0.97046 5.1848 1.9111 10.375 2.8654 15.563m-71.597 71.012c5.5615-5.2284 12.002-9.7986 16.508-15.817 10.474-13.992 14.333-29.916 11.288-47.446-2.2496-12.95-8.1973-24.076-17.243-33.063-12.746-12.663-28.865-18.614-46.786-18.569-69.912 0.17712-139.82 0.56831-209.74 0.96176-15.922 0.089599-29.168 7.4209-39.685 18.296-14.45 14.944-20.408 33.343-16.655 54.368 2.2763 12.754 8.2167 23.748 17.158 32.66 13.299 13.255 30.097 18.653 48.728 18.651 59.321-0.005188 118.64 0.042358 177.96-0.046601 9.5912-0.014374 19.181-0.86588 28.773-0.88855 10.649-0.025146 19.978-3.825 29.687-9.1074z" fill="#EEC170"/>
<path d="m162.77 293c15.654 4.3883 20.627 22.967 10.304 34.98-5.3104 6.1795-14.817 8.3208-24.278 5.0472-7.0723-2.4471-12.332-10.362-12.876-17.933-1.0451-14.542 11.089-23.176 21.705-23.046 1.5794 0.019287 3.1517 0.61566 5.1461 0.95184z" fill="#EEC170"/>
<path d="m227.18 293.64c7.8499 2.3973 11.938 8.2143 13.524 15.077 1.8591 8.0439-0.44817 15.706-7.1588 21.121-6.7633 5.4572-14.417 6.8794-22.578 3.1483-8.2972-3.7933-12.836-10.849-12.736-19.438 0.1687-14.497 14.13-25.368 28.948-19.908z" fill="#EEC170"/>
<path d="m261.57 319.07c-2.495-14.418 4.6853-22.603 14.596-26.108 9.8945-3.4995 23.181 3.4303 26.267 13.779 4.6504 15.591-7.1651 29.064-21.665 28.161-8.5254-0.53088-17.202-6.5094-19.198-15.831z" fill="#EEC170"/>
<path d="m336.91 333.41c-9.0175-4.2491-15.337-14.349-13.829-21.682 3.0825-14.989 13.341-20.304 23.018-19.585 10.653 0.79141 17.93 7.407 19.765 17.547 1.9588 10.824-4.1171 19.939-13.494 23.703-5.272 2.1162-10.091 1.5086-15.46 0.017883z" fill="#EEC170"/>
</svg>`;
const ICON_HTML = `
<div class="av-input-icon">
<img src="data:image/svg+xml;base64,${btoa(aliasvaultIconSvg)}" style="width: 100%; height: 100%;" />
</div>
`;
// Generate unique ID if input doesn't have one
if (!input.id) {
input.id = `aliasvault-input-${Math.random().toString(36).substring(2, 11)}`;
}
// Create an overlay container at document level if it doesn't exist
let overlayContainer = container.querySelector('#aliasvault-overlay-container');
if (!overlayContainer) {
overlayContainer = document.createElement('div') as HTMLElement;
overlayContainer.id = 'aliasvault-overlay-container';
overlayContainer.className = 'av-overlay-container';
container.appendChild(overlayContainer);
}
// Create the icon element from the HTML template
const iconContainer = document.createElement('div');
iconContainer.innerHTML = ICON_HTML;
const icon = iconContainer.firstElementChild as HTMLElement;
icon.setAttribute('data-icon-for', input.id);
// Enable pointer events just for the icon
icon.style.pointerEvents = 'auto';
/**
* Update position of the icon.
*/
const updateIconPosition = () : void => {
const rect = input.getBoundingClientRect();
icon.style.position = 'fixed';
icon.style.top = `${rect.top + (rect.height - 24) / 2}px`;
icon.style.left = `${rect.right - 32}px`;
};
// Update position initially and on relevant events
updateIconPosition();
window.addEventListener('scroll', updateIconPosition, true);
window.addEventListener('resize', updateIconPosition);
// Add click event to trigger the autofill popup and refocus the input
icon.addEventListener('click', (e: MouseEvent) => {
e.preventDefault();
e.stopPropagation();
setTimeout(() => input.focus(), 0);
openAutofillPopup(input, container);
});
// Append the icon to the overlay container
overlayContainer.appendChild(icon);
// Fade in the icon
requestAnimationFrame(() => {
icon.style.opacity = '1';
});
/**
* Remove the icon when the input loses focus.
*/
const handleBlur = (): void => {
icon.style.opacity = '0';
setTimeout(() => {
icon.remove();
input.removeEventListener('blur', handleBlur);
input.removeEventListener('keydown', handleKeyPress);
window.removeEventListener('scroll', updateIconPosition, true);
window.removeEventListener('resize', updateIconPosition);
// Remove overlay container if it's empty
if (!overlayContainer.children.length) {
overlayContainer.remove();
}
}, 200);
};
/**
* Handle key press to dismiss icon.
*/
const handleKeyPress = (e: KeyboardEvent): void => {
// Dismiss on Enter, Escape, or Tab.
if (e.key === 'Enter' || e.key === 'Escape' || e.key === 'Tab') {
handleBlur();
}
};
input.addEventListener('blur', handleBlur);
input.addEventListener('keydown', handleKeyPress);
}
/**
* Trigger input events for an element to trigger form validation
* which some websites require before the "continue" button is enabled.
*/
function triggerInputEvents(element: HTMLInputElement | HTMLSelectElement, animate: boolean = true) : void {
// Add keyframe animation if animation is requested
if (animate) {
// Create an overlay div that will show the highlight effect
const overlay = document.createElement('div');
/**
* Update position of the overlay.
*/
const updatePosition = () : void => {
const rect = element.getBoundingClientRect();
overlay.style.cssText = `
position: fixed;
z-index: 999999991;
pointer-events: none;
top: ${rect.top}px;
left: ${rect.left}px;
width: ${rect.width}px;
height: ${rect.height}px;
background-color: rgba(244, 149, 65, 0.3);
border-radius: ${getComputedStyle(element).borderRadius};
animation: fadeOut 1.4s ease-out forwards;
`;
};
updatePosition();
// Add scroll event listener
window.addEventListener('scroll', updatePosition);
const style = document.createElement('style');
style.textContent = `
@keyframes fadeOut {
0% { opacity: 1; transform: scale(1.02); }
100% { opacity: 0; transform: scale(1); }
}
`;
document.head.appendChild(style);
document.body.appendChild(overlay);
// Remove overlay and cleanup after animation
setTimeout(() => {
window.removeEventListener('scroll', updatePosition);
overlay.remove();
style.remove();
}, 1400);
}
// Trigger events
element.dispatchEvent(new Event('input', { bubbles: true }));
element.dispatchEvent(new Event('change', { bubbles: true }));
if (element.type === 'radio') {
element.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
element.dispatchEvent(new MouseEvent('mouseup', { bubbles: true }));
element.dispatchEvent(new MouseEvent('click', { bubbles: true }));
}
}

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,768 @@
/* AliasVault Content Script Styles */
body {
position: absolute;
}
/* Base Popup Styles */
.av-popup {
position: absolute;
z-index: 2147483646;
background-color: rgb(31, 41, 55);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
width: 320px;
border: 1px solid rgb(55, 65, 81);
border-radius: 4px;
max-width: 90vw;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 14px;
color: #333;
overflow: hidden;
box-sizing: border-box;
margin-top: 4px;
}
/* Loading Popup Styles */
.av-loading-container {
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
gap: 8px;
}
.av-loading-spinner {
width: 16px;
height: 16px;
border: 2px solid #e5e7eb;
border-radius: 50%;
border-top-color: transparent;
animation: av-loading-spin 1s linear infinite;
}
@keyframes av-loading-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.av-loading-text {
font-size: 14px;
font-weight: 500;
line-height: normal;
color: #e5e7eb;
}
/* Credential List Styles */
.av-credential-list {
max-height: 180px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: #4b5563 #1f2937;
line-height: 1.3;
}
.av-credential-item {
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
transition: background-color 0.2s ease;
border-radius: 4px;
width: 100%;
box-sizing: border-box;
text-align: left;
}
.av-credential-item:hover {
background-color: #2d3748;
}
.av-credential-info {
display: flex;
align-items: center;
gap: 16px;
flex-grow: 1;
padding: 10px 16px;
border-radius: 4px;
transition: background-color 0.2s ease;
min-width: 0;
}
.av-credential-logo {
width: 20px;
height: 20px;
}
.av-credential-text {
display: flex;
flex-direction: column;
flex-grow: 1;
min-width: 0;
margin-right: 8px;
}
.av-service-name {
font-weight: 500;
white-space: nowrap;
overflow: hidden;
font-size: 14px;
text-overflow: ellipsis;
color: #f3f4f6;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.av-service-details {
font-size: 0.85em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #9ca3af;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.av-popout-icon {
display: flex;
align-items: center;
padding: 4px;
margin-right: 16px;
opacity: 0.6;
border-radius: 4px;
flex-shrink: 0;
color: #ffffff;
transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.av-popout-icon:hover {
opacity: 1;
background-color: #ffffff;
color: #000000;
}
.av-no-matches {
padding-left: 10px;
padding-top: 8px;
padding-bottom: 8px;
font-size: 14px;
color: #9ca3af;
font-style: italic;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
text-align: left;
}
/* Divider */
.av-divider {
height: 1px;
background: #374151;
margin-bottom: 8px;
}
/* Action Container */
.av-action-container {
display: flex;
padding-left: 8px;
padding-right: 8px;
padding-bottom: 8px;
gap: 8px;
}
/* Button Styles */
.av-button {
padding: 6px 12px;
border-radius: 4px;
background: #374151;
color: #e5e7eb;
font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
cursor: pointer;
border: none;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
transition: background-color 0.2s ease;
}
.av-button:hover {
background-color: #4b5563;
}
.av-button-primary {
background-color: #374151;
}
.av-button-primary:hover {
background-color: #d68338;
}
.av-button-close {
padding: 6px;
}
.av-button-close:hover {
background-color: #dc2626;
color: #ffffff;
}
/* Search Input */
.av-search-input {
flex: 2;
border-radius: 4px;
background: #374151;
color: #e5e7eb;
font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
border: 1px solid #4b5563;
outline: none;
line-height: 1;
text-align: center;
}
.av-search-input::placeholder {
color: #bdbebe;
}
.av-search-input:focus {
border-color: #2563eb;
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
/* Vault Locked Popup */
.av-vault-locked {
padding: 12px 16px;
position: relative;
}
.av-vault-locked:hover {
background-color: #374151;
}
.av-vault-locked-container {
display: flex;
align-items: center;
padding-right: 32px;
width: 100%;
transition: background-color 0.2s ease;
border-radius: 4px;
}
.av-vault-locked-message {
color: #d1d5db;
font-size: 14px;
flex-grow: 1;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.av-vault-locked-button {
background: none;
border: none;
cursor: pointer;
padding: 4px;
padding-right: 28px;
display: flex;
align-items: center;
justify-content: center;
color: #d68338;
border-radius: 4px;
margin-left: 8px;
}
.av-vault-locked-close {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
padding: 4px;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
border: 1px solid #6f6f6f;
}
/* Create Name Popup */
.av-create-popup-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 2147483647;
display: flex;
align-items: center;
justify-content: center;
}
.av-create-popup {
position: relative;
z-index: 1000000000;
background: #1f2937;
border: 1px solid #374151;
border-radius: 8px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06),
0 20px 25px -5px rgba(0, 0, 0, 0.1);
width: 400px;
max-width: 90vw;
transform: scale(0.95);
opacity: 0;
padding: 16px 24px;
transition: transform 0.2s ease, opacity 0.2s ease;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.av-create-popup.show {
transform: scale(1);
opacity: 1;
}
.av-create-popup-title {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #f8f9fa;
}
.av-create-popup-help-text {
margin: 4px 0 0;
font-size: 13px;
color: #9ca3af;
text-align: center;
line-height: 1.4;
padding: 0 16px;
}
.av-create-popup-modes {
display: flex;
flex-direction: column;
gap: 16px;
margin-bottom: 10px;
}
.av-create-popup-mode-btn {
display: flex;
align-items: center;
gap: 16px;
padding: 8px;
background: #374151;
border: 1px solid #4b5563;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
text-align: left;
width: 100%;
}
.av-create-popup-mode-btn:hover {
background: #4b5563;
transform: translateY(-1px);
}
.av-create-popup-mode-icon {
display: flex;
align-items: center;
justify-content: center;
width: 48px;
height: 48px;
background: #1f2937;
border-radius: 8px;
color: #d68338;
}
.av-create-popup-mode-icon .av-icon {
width: 24px;
height: 24px;
}
.av-create-popup-mode-content {
flex: 1;
}
.av-create-popup-mode-content h4 {
margin: 0 0 4px 0;
font-size: 16px;
font-weight: 600;
color: #f8f9fa;
}
.av-create-popup-mode-content p {
margin: 0;
font-size: 14px;
color: #9ca3af;
}
.av-create-popup-input {
width: 100%;
padding: 8px 12px;
border: 1px solid #374151;
border-radius: 6px;
background: #374151;
color: #f8f9fa;
font-size: 14px;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
box-sizing: border-box;
}
.av-create-popup-input:focus {
border-color: #2563eb;
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.av-create-popup-input-default {
color: #737373;
}
/* Custom Credential UI Styles */
.av-create-popup-custom-toggle {
margin: 16px 0;
padding: 0 16px;
}
.av-create-popup-toggle-label {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
user-select: none;
}
.av-create-popup-toggle-text {
font-size: 14px;
color: #4b5563;
}
.av-create-popup-custom-fields {
margin: 16px 0;
padding: 0 16px;
}
.av-create-popup-field-group {
margin-bottom: 24px;
}
.av-create-popup-field-group label {
display: block;
margin-bottom: 0.5rem;
color: #eee;
font-size: 0.875rem;
font-weight: 500;
}
.av-create-popup-input-error {
border-color: #ef4444 !important;
box-shadow: 0 0 0 1px #ef4444 !important;
}
.av-create-popup-error-text {
color: #ef4444;
font-size: 0.875rem;
margin-top: 0.25rem;
margin-left: 5px;
}
.av-create-popup-password-preview {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
}
.av-create-popup-password-preview input {
flex: 1;
width: 100%;
}
.av-create-popup-regenerate-btn {
display: flex;
align-items: center;
justify-content: center;
padding: 9px;
background: #374151;
border: none;
border-radius: 4px;
cursor: pointer;
color: #e5e7eb;
transition: background-color 0.2s ease;
flex-shrink: 0;
}
.av-create-popup-regenerate-btn:hover {
background-color: #4b5563;
}
.av-create-popup-regenerate-btn .av-icon {
width: 16px;
height: 16px;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
.av-create-popup-error {
margin-top: 16px;
padding: 8px 12px;
background-color: #fee2e2;
color: #dc2626;
border-radius: 4px;
font-size: 14px;
animation: fadeIn 0.2s ease-in-out;
}
.av-create-popup-actions {
display: flex;
justify-content: flex-end;
gap: 12px;
margin-top: 24px;
}
.av-create-popup-back {
padding: 8px 16px;
border-radius: 6px;
border: 1px solid #374151;
background: transparent;
color: #f8f9fa;
cursor: pointer;
font-size: 14px;
transition: all 0.2s ease;
}
.av-create-popup-back:hover {
background: #374151;
}
.av-create-popup-cancel {
padding: 8px 16px;
border-radius: 6px;
border: 1px solid #374151;
background: transparent;
color: #f8f9fa;
cursor: pointer;
font-size: 14px;
transition: all 0.2s ease;
}
.av-create-popup-cancel:hover {
background: #374151;
}
.av-create-popup-save {
padding: 8px 16px;
border-radius: 6px;
border: none;
background: #d68338;
color: white;
cursor: pointer;
font-size: 14px;
transition: all 0.2s ease;
}
.av-create-popup-save:hover {
background: #c97731;
transform: translateY(-1px);
}
/* SVG Icons */
.av-icon {
width: 16px;
height: 16px;
fill: none;
stroke: currentColor;
stroke-width: 2;
}
.av-icon-lock {
width: 20px;
height: 20px;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
/* Form Icon Styles */
.av-overlay-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 2147483640;
}
.av-input-icon {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
cursor: pointer;
width: 24px;
height: 24px;
pointer-events: auto;
opacity: 0;
transition: opacity 0.2s ease-in-out;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeOut {
0% { opacity: 1; transform: scale(1.02); }
100% { opacity: 0; transform: scale(1); }
}
/* Create Popup Styles */
.av-create-popup-header {
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
}
.av-create-popup-mode {
margin-top: 20px;
}
.av-create-popup-title-container {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
justify-content: center;
cursor: pointer;
padding: 4px 8px;
border-radius: 4px;
transition: background-color 0.2s;
}
.av-create-popup-title-wrapper {
display: flex;
align-items: center;
gap: 8px;
color: #d68338;
}
.av-create-popup-title-wrapper .av-icon {
width: 20px;
height: 20px;
stroke-width: 1.5;
stroke-linecap: round;
stroke-linejoin: round;
}
.av-create-popup-title-wrapper .av-create-popup-title {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #f8f9fa;
}
.av-create-popup-title-container:hover {
background-color: #374151;
}
.av-create-popup-mode-dropdown {
background: none;
border: none;
padding: 4px;
cursor: pointer;
color: #9ca3af;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
transition: background-color 0.2s;
}
.av-create-popup-mode-dropdown:hover {
background-color: #4b5563;
}
.av-create-popup-mode-dropdown .av-icon {
width: 16px;
height: 16px;
}
.av-create-popup-mode-dropdown-menu {
position: absolute;
left: 50%;
transform: translateX(-50%);
background: #1f2937;
border: 1px solid #374151;
border-radius: 8px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
z-index: 1000;
min-width: 280px;
}
.av-create-popup-mode-dropdown-menu::before {
content: '';
position: absolute;
top: -6px;
left: 50%;
width: 12px;
height: 12px;
background: #1f2937;
border-left: 1px solid #374151;
border-top: 1px solid #374151;
transform: translateX(-50%) rotate(45deg);
}
.av-create-popup-mode-option {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
width: 100%;
border: none;
background: none;
cursor: pointer;
text-align: left;
transition: background-color 0.2s;
position: relative;
z-index: 100;
}
.av-create-popup-mode-option:hover {
background-color: #374151;
}
.av-create-popup-mode-option .av-create-popup-mode-icon {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
background-color: #374151;
border-radius: 8px;
color: #d68338;
}
.av-create-popup-mode-option .av-create-popup-mode-content {
flex: 1;
}
.av-create-popup-mode-option .av-create-popup-mode-content h4 {
margin: 0;
font-size: 14px;
font-weight: 600;
color: #f8f9fa;
}
.av-create-popup-mode-option .av-create-popup-mode-content p {
margin: 4px 0 0;
font-size: 12px;
color: #9ca3af;
}

View File

@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { HashRouter as Router, Routes, Route } from 'react-router-dom';
import { useAuth } from './context/AuthContext';
import { useMinDurationLoading } from './hooks/useMinDurationLoading';
import { useMinDurationLoading } from '../../hooks/useMinDurationLoading';
import Header from './components/Layout/Header';
import BottomNav from './components/Layout/BottomNav';
import AuthSettings from './pages/AuthSettings';
@@ -83,7 +83,8 @@ const App: React.FC = () => {
className="flex-1 overflow-y-auto bg-gray-100 dark:bg-gray-900"
style={{
paddingTop: '64px',
height: 'calc(100vh - 120px)',
height: 'calc(100% - 120px)',
maxHeight: '600px',
}}
>
<div className="p-4 mb-16">

View File

@@ -1,7 +1,7 @@
import React from 'react';
type ButtonProps = {
onClick: () => void;
onClick?: () => void;
children: React.ReactNode;
type?: 'button' | 'submit' | 'reset';
variant?: 'primary' | 'secondary';

View File

@@ -1,10 +1,11 @@
import React, { useState, useEffect } from 'react';
import { useWebApi } from '../context/WebApiContext';
import { useDb } from '../context/DbContext';
import EncryptionUtility from '../../shared/EncryptionUtility';
import { MailboxEmail } from '../../shared/types/webapi/MailboxEmail';
import EncryptionUtility from '../../../utils/EncryptionUtility';
import { MailboxEmail } from '../../../utils/types/webapi/MailboxEmail';
import { Link } from 'react-router-dom';
import { AppInfo } from '../../shared/AppInfo';
import { AppInfo } from '../../../utils/AppInfo';
import { storage } from 'wxt/storage';
type EmailPreviewProps = {
email: string;
@@ -26,8 +27,8 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) => {
*/
const isPublicDomain = async (emailAddress: string): Promise<boolean> => {
// Get metadata from storage
const storageResult = await chrome.storage.session.get(['publicEmailDomains']);
return storageResult.publicEmailDomains.some(domain => emailAddress.toLowerCase().endsWith(domain));
const publicEmailDomains = await storage.getItem('session:publicEmailDomains') as string[] ?? [];
return publicEmailDomains.some(domain => emailAddress.toLowerCase().endsWith(domain));
};
useEffect(() => {
@@ -134,7 +135,7 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) => {
href={`https://spamok.com/${email.split('@')[0]}/${mail.id}`}
target="_blank"
rel="noopener noreferrer"
className={`flex justify-between items-center p-2 rounded cursor-pointer bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${
className={`flex justify-between items-center p-2 ps-3 pe-3 rounded cursor-pointer bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${
mail.id > lastEmailId ? 'bg-yellow-50 dark:bg-yellow-900/30' : ''
}`}
>
@@ -151,7 +152,7 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) => {
<Link
key={mail.id}
to={`/emails/${mail.id}`}
className={`flex justify-between items-center p-2 rounded cursor-pointer bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${
className={`flex justify-between items-center p-2 ps-3 pe-3 rounded cursor-pointer bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${
mail.id > lastEmailId ? 'bg-yellow-50 dark:bg-yellow-900/30' : ''
}`}
>

View File

@@ -1,8 +1,10 @@
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import React, { useState, useEffect } from 'react';
import { useNavigate, useLocation } from 'react-router-dom';
import { useAuth } from '../../context/AuthContext';
import { useDb } from '../../context/DbContext';
type TabName = 'credentials' | 'emails' | 'settings';
/**
* Bottom nav component.
*/
@@ -10,12 +12,21 @@ const BottomNav: React.FC = () => {
const authContext = useAuth();
const dbContext = useDb();
const navigate = useNavigate();
const [currentTab, setCurrentTab] = useState<'credentials' | 'emails' | 'settings'>('credentials');
const location = useLocation();
const [currentTab, setCurrentTab] = useState<TabName>('credentials');
// Add effect to update currentTab based on route
useEffect(() => {
const path = location.pathname.substring(1) as TabName;
if (['credentials', 'emails', 'settings'].includes(path)) {
setCurrentTab(path);
}
}, [location]);
/**
* Handle tab change.
*/
const handleTabChange = (tab: 'credentials' | 'emails' | 'settings') : void => {
const handleTabChange = (tab: TabName) : void => {
setCurrentTab(tab);
navigate(`/${tab}`);
};

View File

@@ -2,7 +2,9 @@ import React from 'react';
import { UserMenu } from './UserMenu';
import { useNavigate, useLocation } from 'react-router-dom';
import { useAuth } from '../../context/AuthContext';
import { AppInfo } from '../../../shared/AppInfo';
import { AppInfo } from '../../../../utils/AppInfo';
import { storage } from 'wxt/storage';
/**
* Header props.
*/
@@ -28,10 +30,10 @@ const Header: React.FC<HeaderProps> = ({
* Open the client tab.
*/
const openClientTab = async () : Promise<void> => {
const setting = await chrome.storage.local.get(['clientUrl']);
const settingClientUrl = await storage.getItem('local:clientUrl') as string;
let clientUrl = AppInfo.DEFAULT_CLIENT_URL;
if (setting.clientUrl && setting.clientUrl.length > 0) {
clientUrl = setting.clientUrl;
if (settingClientUrl && settingClientUrl.length > 0) {
clientUrl = settingClientUrl;
}
window.open(clientUrl, '_blank');
@@ -52,6 +54,19 @@ const Header: React.FC<HeaderProps> = ({
navigate('/auth-settings');
};
/**
* Handle logo click.
*/
const logoClick = () : void => {
// If logged in, navigate to credentials.
if (authContext.isLoggedIn) {
navigate('/credentials');
} else {
// If not logged in, navigate to index.
navigate('/');
}
};
return (
<header className="fixed z-30 w-full bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700">
<div className="flex items-center h-16 px-4">
@@ -74,9 +89,17 @@ const Header: React.FC<HeaderProps> = ({
</button>
) : (
<div className="flex items-center">
<img src="/assets/images/logo.svg" alt="AliasVault" className="h-8 w-8 mr-2" />
<h1 className="text-gray-900 dark:text-white text-xl font-bold">AliasVault</h1>
<span className="text-primary-500 text-[10px] ml-1 font-normal">BETA</span>
<button
onClick={() => logoClick()}
className="flex items-center hover:opacity-80 transition-opacity"
>
<img src="/assets/images/logo.svg" alt="AliasVault" className="h-8 w-8 mr-2" />
<h1 className="text-gray-900 dark:text-white text-xl font-bold">AliasVault</h1>
{/* Hide beta badge on Safari as it's not allowed to show non-production badges */}
{!import.meta.env.SAFARI && (
<span className="text-primary-500 text-[10px] ml-1 font-normal">BETA</span>
)}
</button>
</div>
)}

View File

@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { AppInfo } from '../../shared/AppInfo';
import { AppInfo } from '../../../utils/AppInfo';
import { storage } from 'wxt/storage';
/**
* Component for displaying the login server information.
@@ -14,8 +15,8 @@ const LoginServerInfo: React.FC = () => {
* Loads the base URL for the login server.
*/
const loadApiUrl = async () : Promise<void> => {
const result = await chrome.storage.local.get(['apiUrl']);
setBaseUrl(result.apiUrl ?? AppInfo.DEFAULT_API_URL);
const apiUrl = await storage.getItem('local:apiUrl') as string;
setBaseUrl(apiUrl ?? AppInfo.DEFAULT_API_URL);
};
loadApiUrl();
}, []);

View File

@@ -0,0 +1,192 @@
import React, { useState, useEffect } from 'react';
import { useDb } from '../context/DbContext';
import { TotpCode } from '../../../utils/types/TotpCode';
import * as OTPAuth from 'otpauth';
type TotpViewerProps = {
credentialId: string;
}
/**
* This component shows TOTP codes for a credential.
*/
export const TotpViewer: React.FC<TotpViewerProps> = ({ credentialId }) => {
const [totpCodes, setTotpCodes] = useState<TotpCode[]>([]);
const [loading, setLoading] = useState(true);
const [currentCodes, setCurrentCodes] = useState<Record<string, string>>({});
const [copiedId, setCopiedId] = useState<string | null>(null);
const dbContext = useDb();
/**
* Gets the remaining seconds for the TOTP code.
*/
const getRemainingSeconds = (step = 30): number => {
const totp = new OTPAuth.TOTP({
secret: 'dummy', // We only need this for timing calculations
algorithm: 'SHA1',
digits: 6,
period: step
});
return totp.period - (Math.floor(Date.now() / 1000) % totp.period);
};
/**
* Gets the remaining percentage for the TOTP code.
*/
const getRemainingPercentage = (): number => {
const remaining = getRemainingSeconds();
// Invert the percentage so it counts down instead of up
return Math.floor(((30.0 - remaining) / 30.0) * 100);
};
/**
* Generates a TOTP code for a given secret key.
*/
const generateTotpCode = (secretKey: string): string => {
try {
const totp = new OTPAuth.TOTP({
secret: secretKey,
algorithm: 'SHA1',
digits: 6,
period: 30
});
return totp.generate();
} catch (error) {
console.error('Error generating TOTP code:', error);
return 'Error';
}
};
/**
* Copies a TOTP code to the clipboard.
*/
const copyToClipboard = async (code: string, id: string): Promise<void> => {
try {
await navigator.clipboard.writeText(code);
setCopiedId(id);
// Reset copied state after 2 seconds
setTimeout(() => {
setCopiedId(null);
}, 2000);
} catch (error) {
console.error('Failed to copy:', error);
}
};
useEffect(() => {
/**
* Loads the TOTP codes for the credential.
*/
const loadTotpCodes = async (): Promise<void> => {
if (!dbContext?.sqliteClient) {
return;
}
try {
const codes = dbContext.sqliteClient.getTotpCodesForCredential(credentialId);
setTotpCodes(codes);
} catch (error) {
console.error('Error loading TOTP codes:', error);
} finally {
setLoading(false);
}
};
loadTotpCodes();
}, [credentialId, dbContext?.sqliteClient]);
useEffect(() => {
/**
* Updates the current TOTP codes.
*/
const updateTotpCodes = (prevCodes: Record<string, string>): Record<string, string> => {
const newCodes: Record<string, string> = {};
totpCodes.forEach(code => {
const generatedCode = generateTotpCode(code.SecretKey);
// Only update if we have a valid code
if (generatedCode !== 'Error') {
newCodes[code.Id] = generatedCode;
} else {
// Keep the previous code if there's an error
newCodes[code.Id] = prevCodes[code.Id] ?? 'Error';
}
});
return newCodes;
};
// Generate initial codes
const initialCodes: Record<string, string> = {};
totpCodes.forEach(code => {
initialCodes[code.Id] = generateTotpCode(code.SecretKey);
});
setCurrentCodes(initialCodes);
// Set up interval to refresh codes
const intervalId = setInterval(() => {
setCurrentCodes(updateTotpCodes);
}, 1000);
// Clean up interval on unmount or when totpCodes change
return () : void => {
clearInterval(intervalId);
};
}, [totpCodes]);
if (loading) {
return (
<div className="text-gray-500 dark:text-gray-400 mb-4">
<h2 className="text-lg font-semibold text-gray-900 dark:text-white mb-2">Two-factor authentication</h2>
Loading TOTP codes...
</div>
);
}
if (totpCodes.length === 0) {
return null;
}
return (
<div className="mb-4">
<div className="space-y-2">
<h2 className="text-base font-semibold text-gray-900 dark:text-white">Two-factor authentication</h2>
<div className="grid grid-cols-1 gap-2">
{totpCodes.map(totpCode => (
<button
key={totpCode.Id}
className={`w-full text-left p-2 ps-3 pe-3 rounded bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700`}
onClick={() => copyToClipboard(currentCodes[totpCode.Id], totpCode.Id)}
aria-label={`Copy ${totpCode.Name} code`}
>
<div className="flex justify-between items-center gap-2">
<div className="flex items-center flex-1">
<h4 className="text-sm font-medium text-gray-900 dark:text-white">{totpCode.Name}</h4>
</div>
<div className="flex items-center gap-2">
<div className="flex flex-col items-end">
<span className="text-lg font-bold text-gray-900 dark:text-white">
{currentCodes[totpCode.Id]}
</span>
<div className="text-xs">
{copiedId === totpCode.Id ? (
<span className="text-green-600 dark:text-green-400">Copied!</span>
) : (
<span className="text-gray-500 dark:text-gray-400">{getRemainingSeconds()}s</span>
)}
</div>
</div>
<div className="w-1 h-6 bg-gray-200 rounded-full dark:bg-gray-600">
<div
className="bg-blue-600 rounded-full transition-all"
style={{ height: `${getRemainingPercentage()}%`, width: '100%' }}
/>
</div>
</div>
</div>
</button>
))}
</div>
</div>
</div>
);
};

View File

@@ -1,5 +1,8 @@
import React, { createContext, useContext, useState, useEffect, useMemo, useCallback } from 'react';
import { useDb } from './DbContext';
import { storage } from 'wxt/storage';
import { sendMessage } from 'webext-bridge/popup';
import { VAULT_LOCKED_DISMISS_UNTIL_KEY } from '@/entrypoints/contentScript/Popup';
type AuthContextType = {
isLoggedIn: boolean;
@@ -35,9 +38,11 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
* Initialize the authentication state.
*/
const initializeAuth = async () : Promise<void> => {
const stored = await chrome.storage.local.get(['accessToken', 'refreshToken', 'username']);
if (stored.accessToken && stored.refreshToken && stored.username) {
setUsername(stored.username);
const accessToken = await storage.getItem('local:accessToken') as string;
const refreshToken = await storage.getItem('local:refreshToken') as string;
const username = await storage.getItem('local:username') as string;
if (accessToken && refreshToken && username) {
setUsername(username);
setIsLoggedIn(true);
}
setIsInitialized(true);
@@ -50,11 +55,9 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
* Set auth tokens in chrome storage as part of the login process. After db is initialized, the login method should be called as well.
*/
const setAuthTokens = useCallback(async (username: string, accessToken: string, refreshToken: string) : Promise<void> => {
await chrome.storage.local.set({
username,
accessToken,
refreshToken
});
await storage.setItem('local:username', username);
await storage.setItem('local:accessToken', accessToken);
await storage.setItem('local:refreshToken', refreshToken);
setUsername(username);
}, []);
@@ -64,14 +67,17 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
*/
const login = useCallback(async () : Promise<void> => {
setIsLoggedIn(true);
// Clear dismiss until (which can be enabled after user has dimissed vault is locked popup) to ensure popup is shown.
await storage.setItem(VAULT_LOCKED_DISMISS_UNTIL_KEY, 0);
}, []);
/**
* Logout the user and clear the auth tokens from chrome storage.
*/
const logout = useCallback(async (errorMessage?: string) : Promise<void> => {
await chrome.runtime.sendMessage({ type: 'CLEAR_VAULT' });
await chrome.storage.local.remove(['username', 'accessToken', 'refreshToken']);
await sendMessage('CLEAR_VAULT', {}, 'background');
await storage.removeItems(['local:username', 'local:accessToken', 'local:refreshToken']);
dbContext?.clearDatabase();
// Set local storage global message that will be shown on the login page.

View File

@@ -1,7 +1,9 @@
import React, { createContext, useContext, useState, useEffect, useCallback, useMemo } from 'react';
import SqliteClient from '../../shared/SqliteClient';
import { VaultResponse } from '../../shared/types/webapi/VaultResponse';
import EncryptionUtility from '../../shared/EncryptionUtility';
import SqliteClient from '../../../utils/SqliteClient';
import { VaultResponse } from '../../../utils/types/webapi/VaultResponse';
import EncryptionUtility from '../../../utils/EncryptionUtility';
import { VaultResponse as messageVaultResponse } from '../../../utils/types/messaging/VaultResponse';
import { sendMessage } from 'webext-bridge/popup';
type DbContextType = {
sqliteClient: SqliteClient | null;
@@ -71,16 +73,15 @@ export const DbProvider: React.FC<{ children: React.ReactNode }> = ({ children }
/*
* Store encrypted vault in background worker.
*/
chrome.runtime.sendMessage({
type: 'STORE_VAULT',
sendMessage('STORE_VAULT', {
derivedKey: derivedKey,
vaultResponse: vaultResponse,
});
}, 'background');
}, []);
const checkStoredVault = useCallback(async () => {
try {
const response = await chrome.runtime.sendMessage({ type: 'GET_VAULT' });
const response = await sendMessage('GET_VAULT', {}, 'background') as messageVaultResponse;
if (response?.vault) {
const client = new SqliteClient();
await client.initializeFromBase64(response.vault);
@@ -88,9 +89,9 @@ export const DbProvider: React.FC<{ children: React.ReactNode }> = ({ children }
setSqliteClient(client);
setDbInitialized(true);
setDbAvailable(true);
setPublicEmailDomains(response.publicEmailDomains);
setPrivateEmailDomains(response.privateEmailDomains);
setVaultRevision(response.vaultRevisionNumber);
setPublicEmailDomains(response.publicEmailDomains ?? []);
setPrivateEmailDomains(response.privateEmailDomains ?? []);
setVaultRevision(response.vaultRevisionNumber ?? 0);
} else {
setDbInitialized(true);
setDbAvailable(false);
@@ -117,7 +118,7 @@ export const DbProvider: React.FC<{ children: React.ReactNode }> = ({ children }
const clearDatabase = useCallback(() : void => {
setSqliteClient(null);
setDbInitialized(false);
chrome.runtime.sendMessage({ type: 'CLEAR_VAULT' });
sendMessage('CLEAR_VAULT', {}, 'background');
}, []);
const contextValue = useMemo(() => ({

View File

@@ -0,0 +1,134 @@
import React, { createContext, useContext, useState, useMemo, useEffect, useCallback } from 'react';
import { storage } from 'wxt/storage';
/**
* Theme type.
*/
type Theme = 'light' | 'dark' | 'system';
/**
* Theme preference key in storage.
*/
const THEME_PREFERENCE_KEY = 'local:theme';
/**
* Theme context type.
*/
type ThemeContextType = {
theme: Theme;
setTheme: (theme: Theme) => void;
isDarkMode: boolean;
}
/**
* Theme context.
*/
const ThemeContext = createContext<ThemeContextType | undefined>(undefined);
/**
* Theme provider
*/
export const ThemeProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
/**
* Theme state that can be 'light', 'dark', or 'system'.
*/
const [theme, setTheme] = useState<Theme>('system');
/**
* Tracks whether dark mode is active (based on theme or system preference).
*/
const [isDarkMode, setIsDarkMode] = useState<boolean>(false);
useEffect(() => {
/**
* Load theme setting from storage.
*/
const loadTheme = async () : Promise<void> => {
const savedTheme = await getTheme();
setTheme(savedTheme);
};
loadTheme();
}, []);
/**
* Set the theme and save to storage.
*/
const updateTheme = useCallback((newTheme: Theme): void => {
setTheme(newTheme);
setStoredTheme(newTheme);
}, []);
/**
* Get the theme from storage.
*/
const getTheme = async (): Promise<Theme> => {
return (await storage.getItem(THEME_PREFERENCE_KEY) as Theme) || 'system';
};
/**
* Set the theme in storage.
*/
const setStoredTheme = async (theme: Theme): Promise<void> => {
await storage.setItem(THEME_PREFERENCE_KEY, theme);
};
/**
* Effect to apply theme to document and handle system preference changes
*/
useEffect(() => {
/**
* Update the dark mode status.
*/
const updateDarkMode = (): void => {
if (theme === 'system') {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
setIsDarkMode(prefersDark);
document.documentElement.classList.toggle('dark', prefersDark);
} else {
const isDark = theme === 'dark';
setIsDarkMode(isDark);
document.documentElement.classList.toggle('dark', isDark);
}
};
// Initial update
updateDarkMode();
// Listen for system preference changes if using 'system' theme
if (theme === 'system') {
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
/**
* Update the dark mode status when the system preference changes.
*/
const handler = () : void => updateDarkMode();
mediaQuery.addEventListener('change', handler);
return () : void => mediaQuery.removeEventListener('change', handler);
}
}, [theme]);
const value = useMemo(
() => ({
theme,
setTheme: updateTheme,
isDarkMode,
}),
[theme, isDarkMode, updateTheme]
);
return (
<ThemeContext.Provider value={value}>
{children}
</ThemeContext.Provider>
);
};
/**
* Hook to use theme state
*/
export const useTheme = (): ThemeContextType => {
const context = useContext(ThemeContext);
if (context === undefined) {
throw new Error('useTheme must be used within a ThemeProvider');
}
return context;
};

View File

@@ -1,5 +1,5 @@
import React, { createContext, useContext, useEffect, useState } from 'react';
import { WebApiService } from '../../shared/WebApiService';
import { WebApiService } from '../../../utils/WebApiService';
import { useAuth } from './AuthContext';
const WebApiContext = createContext<WebApiService | null>(null);

View File

@@ -4,9 +4,11 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AliasVault</title>
<link href="~/assets/tailwind.css" rel="stylesheet" />
<meta name="manifest.type" content="browser_action" />
</head>
<body class="bg-white dark:bg-gray-900">
<div id="root"></div>
<script type="module" src="src/app/Index.tsx"></script>
<script type="module" src="./main.tsx"></script>
</body>
</html>

View File

@@ -4,6 +4,11 @@ import { AuthProvider } from './context/AuthContext';
import { WebApiProvider } from './context/WebApiContext';
import { DbProvider } from './context/DbContext';
import { LoadingProvider } from './context/LoadingContext';
import { ThemeProvider } from './context/ThemeContext';
import { setupExpandedMode } from '../../utils/ExpandedMode';
// Run before React initializes to ensure the popup is always a fixed width except for when explicitly expanded.
setupExpandedMode();
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
@@ -11,7 +16,9 @@ root.render(
<AuthProvider>
<WebApiProvider>
<LoadingProvider>
<App />
<ThemeProvider>
<App />
</ThemeProvider>
</LoadingProvider>
</WebApiProvider>
</AuthProvider>

View File

@@ -1,5 +1,7 @@
import React, { useState, useEffect } from 'react';
import { AppInfo } from '../../shared/AppInfo';
import { AppInfo } from '../../../utils/AppInfo';
import { storage } from 'wxt/storage';
import { GLOBAL_POPUP_ENABLED_KEY, DISABLED_SITES_KEY, VAULT_LOCKED_DISMISS_UNTIL_KEY } from '../../contentScript/Popup';
type ApiOption = {
label: string;
@@ -18,56 +20,86 @@ const AuthSettings: React.FC = () => {
const [selectedOption, setSelectedOption] = useState<string>('');
const [customUrl, setCustomUrl] = useState<string>('');
const [customClientUrl, setCustomClientUrl] = useState<string>('');
const [isGloballyEnabled, setIsGloballyEnabled] = useState<boolean>(true);
useEffect(() => {
// Load saved URLs from storage
chrome.storage.local.get(['apiUrl', 'clientUrl'], (result) => {
const savedUrl = result.apiUrl;
const savedClientUrl = result.clientUrl;
const matchingOption = DEFAULT_OPTIONS.find(opt => opt.value === savedUrl);
/**
* Load the stored settings from the storage.
*/
const loadStoredSettings = async () : Promise<void> => {
const apiUrl = await storage.getItem('local:apiUrl') as string;
const clientUrl = await storage.getItem('local:clientUrl') as string;
const globallyEnabled = await storage.getItem(GLOBAL_POPUP_ENABLED_KEY) !== false; // Default to true if not set
const dismissUntil = await storage.getItem(VAULT_LOCKED_DISMISS_UNTIL_KEY) as number;
if (dismissUntil) {
setIsGloballyEnabled(false);
} else {
setIsGloballyEnabled(globallyEnabled);
}
const matchingOption = DEFAULT_OPTIONS.find(opt => opt.value === apiUrl);
if (matchingOption) {
setSelectedOption(matchingOption.value);
} else if (savedUrl) {
} else if (apiUrl) {
setSelectedOption('custom');
setCustomUrl(savedUrl);
setCustomClientUrl(savedClientUrl ?? '');
setCustomUrl(apiUrl);
setCustomClientUrl(clientUrl ?? '');
} else {
setSelectedOption(DEFAULT_OPTIONS[0].value);
}
});
};
loadStoredSettings();
}, []);
/**
* Handle option change
*/
const handleOptionChange = (e: React.ChangeEvent<HTMLSelectElement>) : void => {
const handleOptionChange = async (e: React.ChangeEvent<HTMLSelectElement>) : Promise<void> => {
const value = e.target.value;
setSelectedOption(value);
if (value !== 'custom') {
chrome.storage.local.set({
apiUrl: '',
clientUrl: '',
});
await storage.setItem('local:apiUrl', '');
await storage.setItem('local:clientUrl', '');
}
};
/**
* Handle custom API URL change
*/
const handleCustomUrlChange = (e: React.ChangeEvent<HTMLInputElement>) : void => {
const handleCustomUrlChange = async (e: React.ChangeEvent<HTMLInputElement>) : Promise<void> => {
const value = e.target.value;
setCustomUrl(value);
chrome.storage.local.set({ apiUrl: value });
await storage.setItem('local:apiUrl', value);
};
/**
* Handle custom client URL change
* @param e
*/
const handleCustomClientUrlChange = (e: React.ChangeEvent<HTMLInputElement>) : void => {
const handleCustomClientUrlChange = async (e: React.ChangeEvent<HTMLInputElement>) : Promise<void> => {
const value = e.target.value;
setCustomClientUrl(value);
chrome.storage.local.set({ clientUrl: value });
await storage.setItem('local:clientUrl', value);
};
/**
* Toggle global popup.
*/
const toggleGlobalPopup = async () : Promise<void> => {
const newGloballyEnabled = !isGloballyEnabled;
await storage.setItem(GLOBAL_POPUP_ENABLED_KEY, newGloballyEnabled);
if (newGloballyEnabled) {
// Reset all disabled sites when enabling globally
await storage.setItem(DISABLED_SITES_KEY, []);
await storage.setItem(VAULT_LOCKED_DISMISS_UNTIL_KEY, 0);
}
setIsGloballyEnabled(newGloballyEnabled);
};
return (
@@ -119,6 +151,27 @@ const AuthSettings: React.FC = () => {
</div>
</>
)}
{/* Autofill Popup Settings Section */}
<div className="mb-6">
<div className="flex flex-col gap-2">
<p className="text-sm font-medium text-gray-900 dark:text-white">Autofill popup</p>
<button
onClick={toggleGlobalPopup}
className={`px-4 py-2 rounded-md transition-colors ${
isGloballyEnabled
? 'bg-green-200 text-green-800 hover:bg-green-300 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50'
: 'bg-red-200 text-red-800 hover:bg-red-300 dark:bg-red-900/30 dark:text-red-400 dark:hover:bg-red-900/50'
}`}
>
{isGloballyEnabled ? 'Enabled' : 'Disabled'}
</button>
</div>
</div>
<div className="text-center text-gray-400 dark:text-gray-600">
Version: {AppInfo.VERSION}
</div>
</div>
);
};

View File

@@ -0,0 +1,329 @@
import React, { useState, useEffect, useCallback } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { useDb } from '../context/DbContext';
import { Credential } from '../../../utils/types/Credential';
import { FormInputCopyToClipboard } from '../components/FormInputCopyToClipboard';
import { EmailPreview } from '../components/EmailPreview';
import { TotpViewer } from '../components/TotpViewer';
import { useLoading } from '../context/LoadingContext';
import SqliteClient from '../../../utils/SqliteClient';
type BlockProps = {
children: React.ReactNode;
className?: string;
}
/**
* Render a block.
*/
const Block: React.FC<BlockProps> = ({ children, className = '' }) => (
<div className={`space-y-4 ${className}`}>
{children}
</div>
);
/**
* Render the header block.
*/
const HeaderBlock: React.FC<{ credential: Credential; onOpenNewPopup: () => void }> = ({ credential, onOpenNewPopup }) => (
<Block className="mb-6">
<div className="flex items-center justify-between">
<div className="flex items-center">
<img
src={SqliteClient.imgSrcFromBytes(credential.Logo)}
alt={credential.ServiceName}
className="w-12 h-12 rounded-lg mr-4"
/>
<div>
<h1 className="text-2xl font-bold text-gray-900 dark:text-white">{credential.ServiceName}</h1>
{credential.ServiceUrl && (
<a
href={credential.ServiceUrl}
target="_blank"
rel="noopener noreferrer"
className="text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300"
>
{credential.ServiceUrl}
</a>
)}
</div>
</div>
<button
onClick={onOpenNewPopup}
className="text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
title="Open in new window"
>
<svg
className="w-5 h-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"
/>
</svg>
</button>
</div>
</Block>
);
/**
* Render the email block.
*/
const EmailBlock: React.FC<{ email: string; isSupported: boolean }> = ({ email, isSupported }) => (
<Block>
{isSupported && <EmailPreview email={email} />}
</Block>
);
/**
* Render the TOTP viewer block.
*/
const TotpBlock: React.FC<{ credentialId: string }> = ({ credentialId }) => (
<Block>
<TotpViewer credentialId={credentialId} />
</Block>
);
/**
* Render the login credentials block.
*/
const LoginCredentialsBlock: React.FC<{ credential: Credential }> = ({ credential }) => {
const email = credential.Alias?.Email?.trim();
const username = credential.Username?.trim();
const password = credential.Password?.trim();
if (!email && !username && !password) {
return null;
}
return (
<Block>
<h2 className="text-xl font-semibold text-gray-900 dark:text-white">Login credentials</h2>
{email && (
<FormInputCopyToClipboard
id="email"
label="Email"
value={email}
/>
)}
{username && (
<FormInputCopyToClipboard
id="username"
label="Username"
value={username}
/>
)}
{password && (
<FormInputCopyToClipboard
id="password"
label="Password"
value={password}
type="password"
/>
)}
</Block>
);
};
/**
* Render the alias block.
*/
const AliasBlock: React.FC<{ credential: Credential; isValidDate: (date: string | null | undefined) => boolean }> = ({
credential,
isValidDate
}) => {
const hasFirstName = Boolean(credential.Alias?.FirstName?.trim());
const hasLastName = Boolean(credential.Alias?.LastName?.trim());
const hasNickName = Boolean(credential.Alias?.NickName?.trim());
const hasBirthDate = isValidDate(credential.Alias?.BirthDate);
if (!hasFirstName && !hasLastName && !hasNickName && !hasBirthDate) {
return null;
}
return (
<Block>
<h2 className="text-xl font-semibold text-gray-900 dark:text-white">Alias</h2>
{(hasFirstName || hasLastName) && (
<FormInputCopyToClipboard
id="fullName"
label="Full Name"
value={[credential.Alias?.FirstName, credential.Alias?.LastName].filter(Boolean).join(' ')}
/>
)}
{hasFirstName && (
<FormInputCopyToClipboard
id="firstName"
label="First Name"
value={credential.Alias?.FirstName}
/>
)}
{hasLastName && (
<FormInputCopyToClipboard
id="lastName"
label="Last Name"
value={credential.Alias?.LastName}
/>
)}
{hasBirthDate && (
<FormInputCopyToClipboard
id="birthDate"
label="Birth Date"
value={new Date(credential.Alias?.BirthDate).toISOString().split('T')[0]}
/>
)}
{hasNickName && (
<FormInputCopyToClipboard
id="nickName"
label="Nickname"
value={credential.Alias?.NickName ?? ''}
/>
)}
</Block>
);
};
/**
* Render the notes block.
*/
const NotesBlock: React.FC<{ notes: string | undefined }> = ({ notes }) => {
if (!notes) {
return null;
}
return (
<Block>
<h2 className="text-xl font-semibold text-gray-900 dark:text-white">Notes</h2>
<div className="p-4 bg-gray-50 rounded-lg dark:bg-gray-700">
<p className="text-gray-900 dark:text-gray-100 whitespace-pre-wrap">
{notes}
</p>
</div>
</Block>
);
};
/**
* Credential details page.
*/
const CredentialDetails: React.FC = () => {
const { id } = useParams();
const navigate = useNavigate();
const dbContext = useDb();
const [credential, setCredential] = useState<Credential | null>(null);
const { setIsInitialLoading } = useLoading();
/**
* Check if the current page is an expanded popup.
*/
const isPopup = (): boolean => {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get('expanded') === 'true';
};
/**
* Open the credential details in a new expanded popup.
*/
const openInNewPopup = (): void => {
const width = 380;
const height = 600;
const left = window.screen.width / 2 - width / 2;
const top = window.screen.height / 2 - height / 2;
window.open(
`popup.html?expanded=true#/credentials/${id}`,
'CredentialDetails',
`width=${width},height=${height},left=${left},top=${top},popup=true`
);
window.close();
};
/**
* Check if the email domain is supported.
*/
const isEmailDomainSupported = (email: string): boolean => {
const domain = email.split('@')[1]?.toLowerCase();
if (!domain) {
return false;
}
const publicDomains = dbContext.publicEmailDomains ?? [];
const privateDomains = dbContext.privateEmailDomains ?? [];
return [...publicDomains, ...privateDomains].some(supportedDomain =>
domain === supportedDomain || domain.endsWith(`.${supportedDomain}`)
);
};
/**
* Check if a date is valid.
*/
const isValidDate = useCallback((date: string | null | undefined): boolean => {
if (!date || date === '0001-01-01 00:00:00') {
return false;
}
const dateObj = new Date(date);
return !isNaN(dateObj.getTime());
}, []);
useEffect(() => {
if (isPopup()) {
window.history.replaceState({}, '', `popup.html#/credentials`);
window.history.pushState({}, '', `popup.html#/credentials/${id}`);
}
if (!dbContext?.sqliteClient || !id) {
return;
}
try {
const result = dbContext.sqliteClient.getCredentialById(id);
if (result) {
setCredential(result);
setIsInitialLoading(false);
} else {
console.error('Credential not found');
navigate('/credentials');
}
} catch (err) {
console.error('Error loading credential:', err);
}
}, [dbContext.sqliteClient, id, navigate, setIsInitialLoading]);
if (!credential) {
return <div>Loading...</div>;
}
return (
<div className="space-y-6">
<HeaderBlock credential={credential} onOpenNewPopup={openInNewPopup} />
{credential.Alias?.Email && (
<EmailBlock
email={credential.Alias.Email}
isSupported={isEmailDomainSupported(credential.Alias.Email)}
/>
)}
<TotpBlock credentialId={credential.Id} />
<LoginCredentialsBlock credential={credential} />
<AliasBlock
credential={credential}
isValidDate={isValidDate}
/>
<NotesBlock notes={credential.Notes} />
</div>
);
};
export default CredentialDetails;

View File

@@ -1,15 +1,15 @@
import React, { useState, useEffect, useCallback } from 'react';
import { useDb } from '../context/DbContext';
import { Credential } from '../../shared/types/Credential';
import { Buffer } from 'buffer';
import { Credential } from '../../../utils/types/Credential';
import { useNavigate } from 'react-router-dom';
import { useLoading } from '../context/LoadingContext';
import { useWebApi } from '../context/WebApiContext';
import { VaultResponse } from '../../shared/types/webapi/VaultResponse';
import { VaultResponse } from '../../../utils/types/webapi/VaultResponse';
import ReloadButton from '../components/ReloadButton';
import LoadingSpinner from '../components/LoadingSpinner';
import { useMinDurationLoading } from '../hooks/useMinDurationLoading';
import { useMinDurationLoading } from '../../../hooks/useMinDurationLoading';
import { sendMessage } from 'webext-bridge/popup';
import SqliteClient from '../../../utils/SqliteClient';
/**
* Credentials list page.
*/
@@ -64,7 +64,7 @@ const CredentialsList: React.FC = () => {
}
// Get derived key from background worker
const passwordHashBase64 = await chrome.runtime.sendMessage({ type: 'GET_DERIVED_KEY' });
const passwordHashBase64 = await sendMessage('GET_DERIVED_KEY', {}, 'background') as string;
// Initialize the SQLite context again with the newly retrieved decrypted blob
await dbContext.initializeDatabase(vaultResponseJson, passwordHashBase64);
@@ -106,11 +106,12 @@ const CredentialsList: React.FC = () => {
// Add this function to filter credentials
const filteredCredentials = credentials.filter(cred => {
const searchLower = searchTerm.toLowerCase();
return (
cred.ServiceName.toLowerCase().includes(searchLower) ||
cred.Username.toLowerCase().includes(searchLower) ||
(cred.Email?.toLowerCase().includes(searchLower))
);
const searchableFields = [
cred.ServiceName?.toLowerCase(),
cred.Username?.toLowerCase(),
cred.Alias?.Email?.toLowerCase()
];
return searchableFields.some(field => field?.includes(searchLower));
});
if (isLoading) {
@@ -162,7 +163,7 @@ const CredentialsList: React.FC = () => {
className="w-full p-2 border dark:border-gray-600 rounded flex items-center bg-white dark:bg-gray-800 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500"
>
<img
src={cred.Logo ? `data:image/x-icon;base64,${Buffer.from(cred.Logo).toString('base64')}` : '/assets/images/service-placeholder.webp'}
src={SqliteClient.imgSrcFromBytes(cred.Logo)}
alt={cred.ServiceName}
className="w-8 h-8 mr-2 flex-shrink-0"
onError={(e) => {

View File

@@ -1,12 +1,12 @@
import React, { useEffect, useState } from 'react';
import { useParams, useNavigate } from 'react-router-dom';
import { Email } from '../../shared/types/webapi/Email';
import { Email } from '../../../utils/types/webapi/Email';
import { useDb } from '../context/DbContext';
import { useWebApi } from '../context/WebApiContext';
import LoadingSpinner from '../components/LoadingSpinner';
import { useMinDurationLoading } from '../hooks/useMinDurationLoading';
import EncryptionUtility from '../../shared/EncryptionUtility';
import { Attachment } from '../../shared/types/webapi/Attachment';
import { useMinDurationLoading } from '../../../hooks/useMinDurationLoading';
import EncryptionUtility from '../../../utils/EncryptionUtility';
import { Attachment } from '../../../utils/types/webapi/Attachment';
import { useLoading } from '../context/LoadingContext';
import ConversionUtility from '../utils/ConversionUtility';
@@ -36,8 +36,8 @@ const EmailDetails: React.FC = () => {
// For popup windows, ensure we have proper history state for navigation
if (isPopup()) {
// Clear existing history and create fresh entries
window.history.replaceState({}, '', `index.html#/emails`);
window.history.pushState({}, '', `index.html#/emails/${id}`);
window.history.replaceState({}, '', `popup.html#/emails`);
window.history.pushState({}, '', `popup.html#/emails/${id}`);
}
/**
@@ -81,15 +81,15 @@ const EmailDetails: React.FC = () => {
};
/**
* Check if the current page is a popup.
* Check if the current page is an expanded popup.
*/
const isPopup = () : boolean => {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get('popup') === 'true';
return urlParams.get('expanded') === 'true';
};
/**
* Open the credential details in a new popup.
* Open the credential details in a new expanded popup.
*/
const openInNewPopup = () : void => {
const width = 800;
@@ -98,7 +98,7 @@ const EmailDetails: React.FC = () => {
const top = window.screen.height / 2 - height / 2;
window.open(
`index.html?popup=true#/emails/${id}`,
`popup.html?expanded=true#/emails/${id}`,
'EmailDetails',
`width=${width},height=${height},left=${left},top=${top},popup=true`
);

View File

@@ -1,11 +1,11 @@
import React, { useEffect, useState, useCallback } from 'react';
import { MailboxBulkRequest, MailboxBulkResponse } from '../../shared/types/webapi/MailboxBulk';
import { MailboxEmail } from '../../shared/types/webapi/MailboxEmail';
import { MailboxBulkRequest, MailboxBulkResponse } from '../../../utils/types/webapi/MailboxBulk';
import { MailboxEmail } from '../../../utils/types/webapi/MailboxEmail';
import { useDb } from '../context/DbContext';
import { useWebApi } from '../context/WebApiContext';
import LoadingSpinner from '../components/LoadingSpinner';
import { useMinDurationLoading } from '../hooks/useMinDurationLoading';
import EncryptionUtility from '../../shared/EncryptionUtility';
import { useMinDurationLoading } from '../../../hooks/useMinDurationLoading';
import EncryptionUtility from '../../../utils/EncryptionUtility';
import ReloadButton from '../components/ReloadButton';
import { Link } from 'react-router-dom';
/**

View File

@@ -4,13 +4,15 @@ import { useDb } from '../context/DbContext';
import { useWebApi } from '../context/WebApiContext';
import { Buffer } from 'buffer';
import Button from '../components/Button';
import EncryptionUtility from '../../shared/EncryptionUtility';
import EncryptionUtility from '../../../utils/EncryptionUtility';
import SrpUtility from '../utils/SrpUtility';
import { useLoading } from '../context/LoadingContext';
import { VaultResponse } from '../../shared/types/webapi/VaultResponse';
import { LoginResponse } from '../../shared/types/webapi/Login';
import { VaultResponse } from '../../../utils/types/webapi/VaultResponse';
import { LoginResponse } from '../../../utils/types/webapi/Login';
import LoginServerInfo from '../components/LoginServerInfo';
import { AppInfo } from '../../shared/AppInfo';
import { AppInfo } from '../../../utils/AppInfo';
import { storage } from 'wxt/storage';
import { ApiAuthError } from '../../../utils/types/errors/ApiAuthError';
/**
* Login page
@@ -39,10 +41,10 @@ const Login: React.FC = () => {
* Load the client URL from the storage.
*/
const loadClientUrl = async () : Promise<void> => {
const setting = await chrome.storage.local.get(['clientUrl']);
const settingClientUrl = await storage.getItem('local:clientUrl') as string;
let clientUrl = AppInfo.DEFAULT_CLIENT_URL;
if (setting.clientUrl && setting.clientUrl.length > 0) {
clientUrl = setting.clientUrl;
if (settingClientUrl && settingClientUrl.length > 0) {
clientUrl = settingClientUrl;
}
setClientUrl(clientUrl);
@@ -108,7 +110,7 @@ const Login: React.FC = () => {
}
// Try to get latest vault manually providing auth token.
const vaultResponseJson = await webApi.fetch<VaultResponse>('Vault', { method: 'GET', headers: {
const vaultResponseJson = await webApi.authFetch<VaultResponse>('Vault', { method: 'GET', headers: {
'Authorization': `Bearer ${validationResponse.token.token}`
} });
@@ -130,8 +132,13 @@ const Login: React.FC = () => {
// Show app.
hideLoading();
} catch {
setError('Could not reach AliasVault server. Please try again later or contact support if the problem persists.');
} catch (err) {
// Show API authentication errors as-is.
if (err instanceof ApiAuthError) {
setError(err.message);
} else {
setError('Could not reach AliasVault server. Please try again later or contact support if the problem persists.');
}
hideLoading();
}
};
@@ -143,13 +150,19 @@ const Login: React.FC = () => {
e.preventDefault();
setError(null);
if (!passwordHashString || !passwordHashBase64 || !loginResponse) {
throw new Error('Required login data not found');
}
try {
showLoading();
if (!passwordHashString || !passwordHashBase64 || !loginResponse) {
throw new Error('Required login data not found');
}
// Validate that 2FA code is a 6-digit number
const code = twoFactorCode.trim();
if (!/^\d{6}$/.test(code)) {
throw new ApiAuthError('Please enter a valid 6-digit authentication code.');
}
const validationResponse = await srpUtil.validateLogin2Fa(
credentials.username,
passwordHashString,
@@ -164,7 +177,7 @@ const Login: React.FC = () => {
}
// Try to get latest vault manually providing auth token.
const vaultResponseJson = await webApi.fetch<VaultResponse>('Vault', { method: 'GET', headers: {
const vaultResponseJson = await webApi.authFetch<VaultResponse>('Vault', { method: 'GET', headers: {
'Authorization': `Bearer ${validationResponse.token.token}`
} });
@@ -192,8 +205,13 @@ const Login: React.FC = () => {
setLoginResponse(null);
hideLoading();
} catch (err) {
setError('Invalid authentication code. Please try again.');
// Show API authentication errors as-is.
console.error('2FA error:', err);
if (err instanceof ApiAuthError) {
setError(err.message);
} else {
setError('Could not reach AliasVault server. Please try again later or contact support if the problem persists.');
}
hideLoading();
}
};

View File

@@ -1,5 +1,9 @@
import React, { useEffect, useState, useCallback } from 'react';
import { DISABLED_SITES_KEY, GLOBAL_POPUP_ENABLED_KEY } from '../../contentScript/Popup';
import { AppInfo } from '../../../utils/AppInfo';
import { storage } from "wxt/storage";
import { browser } from 'wxt/browser';
import { useTheme } from '../context/ThemeContext';
/**
* Popup settings type.
@@ -15,6 +19,7 @@ type PopupSettings = {
* Settings page component.
*/
const Settings: React.FC = () => {
const { theme, setTheme } = useTheme();
const [settings, setSettings] = useState<PopupSettings>({
disabledUrls: [],
currentUrl: '',
@@ -25,9 +30,9 @@ const Settings: React.FC = () => {
/**
* Get current tab in browser.
*/
const getCurrentTab = async () : Promise<chrome.tabs.Tab> => {
const getCurrentTab = async (): Promise<browser.tabs.Tab> => {
const queryOptions = { active: true, currentWindow: true };
const [tab] = await chrome.tabs.query(queryOptions);
const [tab] = await browser.tabs.query(queryOptions);
return tab;
};
@@ -38,17 +43,15 @@ const Settings: React.FC = () => {
const tab = await getCurrentTab();
const currentUrl = new URL(tab.url ?? '').hostname;
// Load settings from chrome.storage.local
chrome.storage.local.get([DISABLED_SITES_KEY, GLOBAL_POPUP_ENABLED_KEY], (result) => {
const disabledUrls = result[DISABLED_SITES_KEY] ?? [];
const isGloballyEnabled = result[GLOBAL_POPUP_ENABLED_KEY] !== false; // Default to true if not set
// Load settings local storage.
const disabledUrls = await storage.getItem(DISABLED_SITES_KEY) as string[] ?? [];
const isGloballyEnabled = await storage.getItem(GLOBAL_POPUP_ENABLED_KEY) !== false; // Default to true if not set
setSettings({
disabledUrls,
currentUrl,
isEnabled: !disabledUrls.includes(currentUrl),
isGloballyEnabled
});
setSettings({
disabledUrls,
currentUrl,
isEnabled: !disabledUrls.includes(currentUrl),
isGloballyEnabled,
});
}, []);
@@ -69,8 +72,7 @@ const Settings: React.FC = () => {
newDisabledUrls = newDisabledUrls.filter(url => url !== currentUrl);
}
const storageData = { [DISABLED_SITES_KEY]: newDisabledUrls };
await chrome.storage.local.set(storageData);
await storage.setItem(DISABLED_SITES_KEY, newDisabledUrls);
setSettings(prev => ({
...prev,
@@ -83,8 +85,7 @@ const Settings: React.FC = () => {
* Reset settings.
*/
const resetSettings = async () : Promise<void> => {
const storageData = { [DISABLED_SITES_KEY]: [] };
await chrome.storage.local.set(storageData);
await storage.setItem(DISABLED_SITES_KEY, []);
setSettings(prev => ({
...prev,
@@ -99,9 +100,7 @@ const Settings: React.FC = () => {
const toggleGlobalPopup = async () : Promise<void> => {
const newGloballyEnabled = !settings.isGloballyEnabled;
await chrome.storage.local.set({
[GLOBAL_POPUP_ENABLED_KEY]: newGloballyEnabled
});
await storage.setItem(GLOBAL_POPUP_ENABLED_KEY, newGloballyEnabled);
setSettings(prev => ({
...prev,
@@ -109,6 +108,20 @@ const Settings: React.FC = () => {
}));
};
/**
* Set theme preference.
*/
const setThemePreference = async (newTheme: 'system' | 'light' | 'dark') : Promise<void> => {
// Use the ThemeContext to apply the theme
setTheme(newTheme);
// Update local state
setSettings(prev => ({
...prev,
theme: newTheme
}));
};
return (
<div className="space-y-6">
<div className="flex justify-between items-center mb-4">
@@ -131,11 +144,11 @@ const Settings: React.FC = () => {
onClick={toggleGlobalPopup}
className={`px-4 py-2 rounded-md transition-colors ${
settings.isGloballyEnabled
? 'bg-red-500 hover:bg-red-600 text-white'
: 'bg-green-500 hover:bg-green-600 text-white'
? 'bg-green-500 hover:bg-green-600 text-white'
: 'bg-red-500 hover:bg-red-600 text-white'
}`}
>
{settings.isGloballyEnabled ? 'Disable' : 'Enable'}
{settings.isGloballyEnabled ? 'Enabled' : 'Disabled'}
</button>
</div>
</div>
@@ -151,18 +164,18 @@ const Settings: React.FC = () => {
<div>
<p className="text-sm font-medium text-gray-900 dark:text-white">Open popup on: {settings.currentUrl}</p>
<p className={`text-sm mt-1 ${settings.isEnabled ? 'text-gray-600 dark:text-gray-400' : 'text-red-600 dark:text-red-400'}`}>
{settings.isEnabled ? 'Popup is active' : 'Popup is disabled'}
{settings.isEnabled ? 'Enabled for this site' : 'Disabled for this site'}
</p>
</div>
<button
onClick={toggleCurrentSite}
className={`px-4 py-2 rounded-md transition-colors ${
settings.isEnabled
? 'bg-red-500 hover:bg-red-600 text-white'
: 'bg-green-500 hover:bg-green-600 text-white'
? 'bg-green-500 hover:bg-green-600 text-white'
: 'bg-red-500 hover:bg-red-600 text-white'
}`}
>
{settings.isEnabled ? 'Disable' : 'Enable'}
{settings.isEnabled ? 'Enabled' : 'Disabled'}
</button>
</div>
@@ -177,6 +190,57 @@ const Settings: React.FC = () => {
</div>
</div>
</section>
{/* Appearance Settings Section */}
<section>
<h3 className="text-md font-semibold text-gray-900 dark:text-white mb-3">Appearance</h3>
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
<div className="p-4">
<div>
<p className="text-sm font-medium text-gray-900 dark:text-white mb-2">Theme</p>
<div className="flex flex-col space-y-2">
<label className="flex items-center">
<input
type="radio"
name="theme"
value="system"
checked={theme === 'system'}
onChange={() => setThemePreference('system')}
className="mr-2"
/>
<span className="text-sm text-gray-700 dark:text-gray-300">Use default</span>
</label>
<label className="flex items-center">
<input
type="radio"
name="theme"
value="light"
checked={theme === 'light'}
onChange={() => setThemePreference('light')}
className="mr-2"
/>
<span className="text-sm text-gray-700 dark:text-gray-300">Light</span>
</label>
<label className="flex items-center">
<input
type="radio"
name="theme"
value="dark"
checked={theme === 'dark'}
onChange={() => setThemePreference('dark')}
className="mr-2"
/>
<span className="text-sm text-gray-700 dark:text-gray-300">Dark</span>
</label>
</div>
</div>
</div>
</div>
</section>
<div className="text-center text-gray-400 dark:text-gray-600">
Version: {AppInfo.VERSION}
</div>
</div>
);
};

View File

@@ -4,10 +4,13 @@ import { useAuth } from '../context/AuthContext';
import { useWebApi } from '../context/WebApiContext';
import { Buffer } from 'buffer';
import Button from '../components/Button';
import EncryptionUtility from '../../shared/EncryptionUtility';
import EncryptionUtility from '../../../utils/EncryptionUtility';
import SrpUtility from '../utils/SrpUtility';
import { VaultResponse } from '../../shared/types/webapi/VaultResponse';
import { VaultResponse } from '../../../utils/types/webapi/VaultResponse';
import { useLoading } from '../context/LoadingContext';
import { useNavigate } from 'react-router-dom';
import { VAULT_LOCKED_DISMISS_UNTIL_KEY } from '@/entrypoints/contentScript/Popup';
import { storage } from 'wxt/storage';
/**
* Unlock page
@@ -15,6 +18,7 @@ import { useLoading } from '../context/LoadingContext';
const Unlock: React.FC = () => {
const authContext = useAuth();
const dbContext = useDb();
const navigate = useNavigate();
const webApi = useWebApi();
const srpUtil = new SrpUtility(webApi);
@@ -73,6 +77,9 @@ const Unlock: React.FC = () => {
// Initialize the SQLite context with the new vault data.
await dbContext.initializeDatabase(vaultResponseJson, passwordHashBase64);
// Clear dismiss until (which can be enabled after user has dimissed vault is locked popup) to ensure popup is shown.
await storage.setItem(VAULT_LOCKED_DISMISS_UNTIL_KEY, 0);
} catch (err) {
setError('Failed to unlock vault. Please check your password and try again.');
console.error('Unlock error:', err);
@@ -81,6 +88,13 @@ const Unlock: React.FC = () => {
}
};
/**
* Handle logout
*/
const handleLogout = () : void => {
navigate('/logout', { replace: true });
};
return (
<div className="max-w-md">
<form onSubmit={handleSubmit} className="bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4">
@@ -116,7 +130,7 @@ const Unlock: React.FC = () => {
</Button>
<div className="text-sm font-medium text-gray-500 dark:text-gray-200 mt-6">
Switch accounts? <a href="/logout" className="text-primary-700 hover:underline dark:text-primary-500">Log out</a>
Switch accounts? <button onClick={handleLogout} className="text-primary-700 hover:underline dark:text-primary-500">Log out</button>
</div>
</form>
</div>

View File

@@ -0,0 +1,3 @@
body {
font-size: 75%;
}

View File

@@ -21,9 +21,7 @@ class ConversionUtility {
if (anchors.length > 0) {
anchors.forEach((anchor: Element) => {
// Handle target attribute
if (!anchor.hasAttribute('target')) {
anchor.setAttribute('target', '_blank');
} else if (anchor.getAttribute('target') !== '_blank') {
if (!anchor.hasAttribute('target') || anchor.getAttribute('target') !== '_blank') {
anchor.setAttribute('target', '_blank');
}

View File

@@ -1,7 +1,9 @@
import srp from 'secure-remote-password/client'
import { WebApiService } from '../../shared/WebApiService';
import { LoginRequest, LoginResponse } from '../../shared/types/webapi/Login';
import { ValidateLoginRequest, ValidateLoginRequest2Fa, ValidateLoginResponse } from '../../shared/types/webapi/ValidateLogin';
import { WebApiService } from '../../../utils/WebApiService';
import { LoginRequest, LoginResponse } from '../../../utils/types/webapi/Login';
import { ValidateLoginRequest, ValidateLoginRequest2Fa, ValidateLoginResponse } from '../../../utils/types/webapi/ValidateLogin';
import BadRequestResponse from '@/utils/types/webapi/BadRequestResponse';
import { ApiAuthError } from '../../../utils/types/errors/ApiAuthError';
/**
* Utility class for SRP authentication operations.
@@ -22,9 +24,27 @@ class SrpUtility {
* Initiate login with server.
*/
public async initiateLogin(username: string): Promise<LoginResponse> {
return this.webApiService.post<LoginRequest, LoginResponse>('Auth/login', {
username: username.toLowerCase().trim()
const model: LoginRequest = {
username: username.toLowerCase().trim(),
};
const response = await this.webApiService.rawFetch('Auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(model),
});
// Check if response is a bad request (400)
if (response.status === 400) {
const badRequestResponse = await response.json() as BadRequestResponse;
throw new ApiAuthError(badRequestResponse.title);
}
// For other responses, try to parse as LoginResponse
const loginResponse = await response.json() as LoginResponse;
return loginResponse;
}
/**
@@ -51,12 +71,30 @@ class SrpUtility {
privateKey
);
return this.webApiService.post<ValidateLoginRequest, ValidateLoginResponse>('Auth/validate', {
const model: ValidateLoginRequest = {
username: username.toLowerCase().trim(),
rememberMe: rememberMe,
clientPublicEphemeral: clientEphemeral.public,
clientSessionProof: sessionProof.proof,
};
const response = await this.webApiService.rawFetch('Auth/validate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(model),
});
// Check if response is a bad request (400)
if (response.status === 400) {
const badRequestResponse = await response.json() as BadRequestResponse;
throw new ApiAuthError(badRequestResponse.title);
}
// For other responses, try to parse as ValidateLoginResponse
const validateLoginResponse = await response.json() as ValidateLoginResponse;
return validateLoginResponse;
}
/**
@@ -83,14 +121,31 @@ class SrpUtility {
username,
privateKey
);
return this.webApiService.post<ValidateLoginRequest2Fa, ValidateLoginResponse>('Auth/validate-2fa', {
const model: ValidateLoginRequest2Fa = {
username: username.toLowerCase().trim(),
rememberMe: rememberMe,
rememberMe,
clientPublicEphemeral: clientEphemeral.public,
clientSessionProof: sessionProof.proof,
code2Fa: code2Fa,
code2Fa,
};
const response = await this.webApiService.rawFetch('Auth/validate-2fa', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(model),
});
// Check if response is a bad request (400)
if (response.status === 400) {
const badRequestResponse = await response.json() as BadRequestResponse;
throw new ApiAuthError(badRequestResponse.title);
}
// For other responses, try to parse as ValidateLoginResponse
const validateLoginResponse = await response.json() as ValidateLoginResponse;
return validateLoginResponse;
}
}

Some files were not shown because too many files have changed in this diff Show More