Skip to content

Commit 6e8de91

Browse files
macosmacos
authored andcommitted
fix: 桌面端登录兼容 Web 端 PBKDF2-SHA256 + 图标修复
- auth.go: bcrypt → PBKDF2-SHA256,与 Python Web 端密码哈希兼容 - .gitignore: build/ → /build/,避免误忽略 desktop/build/ - 新增 desktop/build 图标资源文件(appicon.png, icon.ico, icns 等) - bump version to 1.0.9
1 parent 8b6bcfd commit 6e8de91

13 files changed

Lines changed: 658 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ __pycache__/
33
*.py[cod]
44
*.egg-info/
55
dist/
6-
build/
6+
/build/
77
*.egg
88

99
# Virtual environment

desktop/build/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Build Directory
2+
3+
The build directory is used to house all the build files and assets for your application.
4+
5+
The structure is:
6+
7+
* bin - Output directory
8+
* darwin - macOS specific files
9+
* windows - Windows specific files
10+
11+
## Mac
12+
13+
The `darwin` directory holds files specific to Mac builds.
14+
These may be customised and used as part of the build. To return these files to the default state, simply delete them
15+
and
16+
build with `wails build`.
17+
18+
The directory contains the following files:
19+
20+
- `Info.plist` - the main plist file used for Mac builds. It is used when building using `wails build`.
21+
- `Info.dev.plist` - same as the main plist file but used when building using `wails dev`.
22+
23+
## Windows
24+
25+
The `windows` directory contains the manifest and rc files used when building with `wails build`.
26+
These may be customised for your application. To return these files to the default state, simply delete them and
27+
build with `wails build`.
28+
29+
- `icon.ico` - The icon used for the application. This is used when building using `wails build`. If you wish to
30+
use a different icon, simply replace this file with your own. If it is missing, a new `icon.ico` file
31+
will be created using the `appicon.png` file in the build directory.
32+
- `installer/*` - The files used to create the Windows installer. These are used when building using `wails build`.
33+
- `info.json` - Application details used for Windows builds. The data here will be used by the Windows installer,
34+
as well as the application itself (right click the exe -> properties -> details)
35+
- `wails.exe.manifest` - The main application manifest file.

desktop/build/appicon.png

83.2 KB
Loading
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2+
<plist version="1.0">
3+
<dict>
4+
<key>CFBundlePackageType</key>
5+
<string>APPL</string>
6+
<key>CFBundleName</key>
7+
<string>{{.Info.ProductName}}</string>
8+
<key>CFBundleExecutable</key>
9+
<string>{{.OutputFilename}}</string>
10+
<key>CFBundleIdentifier</key>
11+
<string>com.wails.{{.Name}}</string>
12+
<key>CFBundleVersion</key>
13+
<string>{{.Info.ProductVersion}}</string>
14+
<key>CFBundleGetInfoString</key>
15+
<string>{{.Info.Comments}}</string>
16+
<key>CFBundleShortVersionString</key>
17+
<string>{{.Info.ProductVersion}}</string>
18+
<key>CFBundleIconFile</key>
19+
<string>iconfile</string>
20+
<key>LSMinimumSystemVersion</key>
21+
<string>10.13.0</string>
22+
<key>NSHighResolutionCapable</key>
23+
<string>true</string>
24+
<key>NSHumanReadableCopyright</key>
25+
<string>{{.Info.Copyright}}</string>
26+
{{if .Info.FileAssociations}}
27+
<key>CFBundleDocumentTypes</key>
28+
<array>
29+
{{range .Info.FileAssociations}}
30+
<dict>
31+
<key>CFBundleTypeExtensions</key>
32+
<array>
33+
<string>{{.Ext}}</string>
34+
</array>
35+
<key>CFBundleTypeName</key>
36+
<string>{{.Name}}</string>
37+
<key>CFBundleTypeRole</key>
38+
<string>{{.Role}}</string>
39+
<key>CFBundleTypeIconFile</key>
40+
<string>{{.IconName}}</string>
41+
</dict>
42+
{{end}}
43+
</array>
44+
{{end}}
45+
{{if .Info.Protocols}}
46+
<key>CFBundleURLTypes</key>
47+
<array>
48+
{{range .Info.Protocols}}
49+
<dict>
50+
<key>CFBundleURLName</key>
51+
<string>com.wails.{{.Scheme}}</string>
52+
<key>CFBundleURLSchemes</key>
53+
<array>
54+
<string>{{.Scheme}}</string>
55+
</array>
56+
<key>CFBundleTypeRole</key>
57+
<string>{{.Role}}</string>
58+
</dict>
59+
{{end}}
60+
</array>
61+
{{end}}
62+
<key>NSAppTransportSecurity</key>
63+
<dict>
64+
<key>NSAllowsLocalNetworking</key>
65+
<true/>
66+
</dict>
67+
</dict>
68+
</plist>

desktop/build/darwin/Info.plist

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2+
<plist version="1.0">
3+
<dict>
4+
<key>CFBundlePackageType</key>
5+
<string>APPL</string>
6+
<key>CFBundleName</key>
7+
<string>{{.Info.ProductName}}</string>
8+
<key>CFBundleExecutable</key>
9+
<string>{{.OutputFilename}}</string>
10+
<key>CFBundleIdentifier</key>
11+
<string>com.wails.{{.Name}}</string>
12+
<key>CFBundleVersion</key>
13+
<string>{{.Info.ProductVersion}}</string>
14+
<key>CFBundleGetInfoString</key>
15+
<string>{{.Info.Comments}}</string>
16+
<key>CFBundleShortVersionString</key>
17+
<string>{{.Info.ProductVersion}}</string>
18+
<key>CFBundleIconFile</key>
19+
<string>iconfile</string>
20+
<key>LSMinimumSystemVersion</key>
21+
<string>10.13.0</string>
22+
<key>NSHighResolutionCapable</key>
23+
<string>true</string>
24+
<key>NSHumanReadableCopyright</key>
25+
<string>{{.Info.Copyright}}</string>
26+
{{if .Info.FileAssociations}}
27+
<key>CFBundleDocumentTypes</key>
28+
<array>
29+
{{range .Info.FileAssociations}}
30+
<dict>
31+
<key>CFBundleTypeExtensions</key>
32+
<array>
33+
<string>{{.Ext}}</string>
34+
</array>
35+
<key>CFBundleTypeName</key>
36+
<string>{{.Name}}</string>
37+
<key>CFBundleTypeRole</key>
38+
<string>{{.Role}}</string>
39+
<key>CFBundleTypeIconFile</key>
40+
<string>{{.IconName}}</string>
41+
</dict>
42+
{{end}}
43+
</array>
44+
{{end}}
45+
{{if .Info.Protocols}}
46+
<key>CFBundleURLTypes</key>
47+
<array>
48+
{{range .Info.Protocols}}
49+
<dict>
50+
<key>CFBundleURLName</key>
51+
<string>com.wails.{{.Scheme}}</string>
52+
<key>CFBundleURLSchemes</key>
53+
<array>
54+
<string>{{.Scheme}}</string>
55+
</array>
56+
<key>CFBundleTypeRole</key>
57+
<string>{{.Role}}</string>
58+
</dict>
59+
{{end}}
60+
</array>
61+
{{end}}
62+
</dict>
63+
</plist>

desktop/build/prepare_vec.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
# Prepare sqlite-vec extension for bundling with desktop app
3+
# Copies vec0 library from Python package to ~/.aivectormemory/
4+
5+
set -e
6+
7+
DEST="$HOME/.aivectormemory"
8+
mkdir -p "$DEST"
9+
10+
VEC_PATH=$(python3 -c "import sqlite_vec; print(sqlite_vec.loadable_path())" 2>/dev/null || true)
11+
12+
if [ -z "$VEC_PATH" ]; then
13+
echo "sqlite-vec not found. Install it: pip install sqlite-vec"
14+
exit 1
15+
fi
16+
17+
# Find the actual file (with platform extension)
18+
if [ -f "${VEC_PATH}.dylib" ]; then
19+
cp "${VEC_PATH}.dylib" "$DEST/vec0.dylib"
20+
echo "Copied vec0.dylib to $DEST/"
21+
elif [ -f "${VEC_PATH}.so" ]; then
22+
cp "${VEC_PATH}.so" "$DEST/vec0.so"
23+
echo "Copied vec0.so to $DEST/"
24+
elif [ -f "${VEC_PATH}.dll" ]; then
25+
cp "${VEC_PATH}.dll" "$DEST/vec0.dll"
26+
echo "Copied vec0.dll to $DEST/"
27+
elif [ -f "$VEC_PATH" ]; then
28+
cp "$VEC_PATH" "$DEST/vec0"
29+
echo "Copied vec0 to $DEST/"
30+
else
31+
echo "vec0 extension file not found at $VEC_PATH"
32+
exit 1
33+
fi
34+
35+
echo "sqlite-vec ready for desktop app"

desktop/build/windows/icon.ico

60.7 KB
Binary file not shown.

desktop/build/windows/info.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"fixed": {
3+
"file_version": "{{.Info.ProductVersion}}"
4+
},
5+
"info": {
6+
"0000": {
7+
"ProductVersion": "{{.Info.ProductVersion}}",
8+
"CompanyName": "{{.Info.CompanyName}}",
9+
"FileDescription": "{{.Info.ProductName}}",
10+
"LegalCopyright": "{{.Info.Copyright}}",
11+
"ProductName": "{{.Info.ProductName}}",
12+
"Comments": "{{.Info.Comments}}"
13+
}
14+
}
15+
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
Unicode true
2+
3+
####
4+
## Please note: Template replacements don't work in this file. They are provided with default defines like
5+
## mentioned underneath.
6+
## If the keyword is not defined, "wails_tools.nsh" will populate them with the values from ProjectInfo.
7+
## If they are defined here, "wails_tools.nsh" will not touch them. This allows to use this project.nsi manually
8+
## from outside of Wails for debugging and development of the installer.
9+
##
10+
## For development first make a wails nsis build to populate the "wails_tools.nsh":
11+
## > wails build --target windows/amd64 --nsis
12+
## Then you can call makensis on this file with specifying the path to your binary:
13+
## For a AMD64 only installer:
14+
## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app.exe
15+
## For a ARM64 only installer:
16+
## > makensis -DARG_WAILS_ARM64_BINARY=..\..\bin\app.exe
17+
## For a installer with both architectures:
18+
## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app-amd64.exe -DARG_WAILS_ARM64_BINARY=..\..\bin\app-arm64.exe
19+
####
20+
## The following information is taken from the ProjectInfo file, but they can be overwritten here.
21+
####
22+
## !define INFO_PROJECTNAME "MyProject" # Default "{{.Name}}"
23+
## !define INFO_COMPANYNAME "MyCompany" # Default "{{.Info.CompanyName}}"
24+
## !define INFO_PRODUCTNAME "MyProduct" # Default "{{.Info.ProductName}}"
25+
## !define INFO_PRODUCTVERSION "1.0.0" # Default "{{.Info.ProductVersion}}"
26+
## !define INFO_COPYRIGHT "Copyright" # Default "{{.Info.Copyright}}"
27+
###
28+
## !define PRODUCT_EXECUTABLE "Application.exe" # Default "${INFO_PROJECTNAME}.exe"
29+
## !define UNINST_KEY_NAME "UninstKeyInRegistry" # Default "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}"
30+
####
31+
## !define REQUEST_EXECUTION_LEVEL "admin" # Default "admin" see also https://nsis.sourceforge.io/Docs/Chapter4.html
32+
####
33+
## Include the wails tools
34+
####
35+
!include "wails_tools.nsh"
36+
37+
# The version information for this two must consist of 4 parts
38+
VIProductVersion "${INFO_PRODUCTVERSION}.0"
39+
VIFileVersion "${INFO_PRODUCTVERSION}.0"
40+
41+
VIAddVersionKey "CompanyName" "${INFO_COMPANYNAME}"
42+
VIAddVersionKey "FileDescription" "${INFO_PRODUCTNAME} Installer"
43+
VIAddVersionKey "ProductVersion" "${INFO_PRODUCTVERSION}"
44+
VIAddVersionKey "FileVersion" "${INFO_PRODUCTVERSION}"
45+
VIAddVersionKey "LegalCopyright" "${INFO_COPYRIGHT}"
46+
VIAddVersionKey "ProductName" "${INFO_PRODUCTNAME}"
47+
48+
# Enable HiDPI support. https://nsis.sourceforge.io/Reference/ManifestDPIAware
49+
ManifestDPIAware true
50+
51+
!include "MUI.nsh"
52+
53+
!define MUI_ICON "..\icon.ico"
54+
!define MUI_UNICON "..\icon.ico"
55+
# !define MUI_WELCOMEFINISHPAGE_BITMAP "resources\leftimage.bmp" #Include this to add a bitmap on the left side of the Welcome Page. Must be a size of 164x314
56+
!define MUI_FINISHPAGE_NOAUTOCLOSE # Wait on the INSTFILES page so the user can take a look into the details of the installation steps
57+
!define MUI_ABORTWARNING # This will warn the user if they exit from the installer.
58+
59+
!insertmacro MUI_PAGE_WELCOME # Welcome to the installer page.
60+
# !insertmacro MUI_PAGE_LICENSE "resources\eula.txt" # Adds a EULA page to the installer
61+
!insertmacro MUI_PAGE_DIRECTORY # In which folder install page.
62+
!insertmacro MUI_PAGE_INSTFILES # Installing page.
63+
!insertmacro MUI_PAGE_FINISH # Finished installation page.
64+
65+
!insertmacro MUI_UNPAGE_INSTFILES # Uinstalling page
66+
67+
!insertmacro MUI_LANGUAGE "English" # Set the Language of the installer
68+
69+
## The following two statements can be used to sign the installer and the uninstaller. The path to the binaries are provided in %1
70+
#!uninstfinalize 'signtool --file "%1"'
71+
#!finalize 'signtool --file "%1"'
72+
73+
Name "${INFO_PRODUCTNAME}"
74+
OutFile "..\..\bin\${INFO_PROJECTNAME}-${ARCH}-installer.exe" # Name of the installer's file.
75+
InstallDir "$PROGRAMFILES64\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}" # Default installing folder ($PROGRAMFILES is Program Files folder).
76+
ShowInstDetails show # This will always show the installation details.
77+
78+
Function .onInit
79+
!insertmacro wails.checkArchitecture
80+
FunctionEnd
81+
82+
Section
83+
!insertmacro wails.setShellContext
84+
85+
!insertmacro wails.webview2runtime
86+
87+
SetOutPath $INSTDIR
88+
89+
!insertmacro wails.files
90+
91+
CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
92+
CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
93+
94+
!insertmacro wails.associateFiles
95+
!insertmacro wails.associateCustomProtocols
96+
97+
!insertmacro wails.writeUninstaller
98+
SectionEnd
99+
100+
Section "uninstall"
101+
!insertmacro wails.setShellContext
102+
103+
RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath
104+
105+
RMDir /r $INSTDIR
106+
107+
Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk"
108+
Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk"
109+
110+
!insertmacro wails.unassociateFiles
111+
!insertmacro wails.unassociateCustomProtocols
112+
113+
!insertmacro wails.deleteUninstaller
114+
SectionEnd

0 commit comments

Comments
 (0)