Skip to content

Commit

Permalink
Merge pull request #139 from Psiphon-Inc/next-release
Browse files Browse the repository at this point in the history
Next release
  • Loading branch information
adamkruger authored Jan 14, 2025
2 parents 54fe953 + 552de9b commit 8279696
Show file tree
Hide file tree
Showing 15 changed files with 836 additions and 841 deletions.
Binary file modified src/3rdParty/psiphon-tunnel-core.exe
Binary file not shown.
6 changes: 2 additions & 4 deletions src/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ string CryptBinaryToStringWrapper(const unsigned char* input, size_t length, DWO
if (!CryptBinaryToStringA(
input,
length,
flags | CRYPT_STRING_NOCR,
flags | CRYPT_STRING_NOCRLF,
NULL,
&outsize))
{
Expand All @@ -1273,15 +1273,13 @@ string CryptBinaryToStringWrapper(const unsigned char* input, size_t length, DWO
if (!CryptBinaryToStringA(
input,
length,
flags | CRYPT_STRING_NOCR,
flags | CRYPT_STRING_NOCRLF,
(LPSTR)output.c_str(),
&outsize))
{
return "";
}

((LPSTR)output.c_str())[outsize] = '\0';

return output;
}

Expand Down
13 changes: 5 additions & 8 deletions src/webui/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

## PsiCash

## Design

Communication in both directions is enabled by the [`mctrl`](https://github.com/Psiphon-Inc/mctrl) HTML control that we are using (and some changes we have made to it).
Expand All @@ -22,8 +19,8 @@ $ npm ci

## Developing

This is what I use for quickly showing the UI in a browser. It just grabs the source from Bitbucket and returns it with appropriate Content-Types to display it.
https://bb.githack.com/psiphon/psiphon-circumvention-system/raw/default/Client/psiclient/webui/main.html
This is what I use for quickly showing the UI in a browser. It just grabs the source from GitHub and returns it with appropriate Content-Types to display it.
https://githubraw.com/Psiphon-Inc/psiphon-windows/master/src/webui/main-inline.html

You can serve it locally with:
```
Expand All @@ -38,17 +35,17 @@ $ python -m http.server
# then go to http://hostvmip:8000/main-inline.html
```

The UI "web site" is in the [webui](https://bitbucket.org/psiphon/psiphon-circumvention-system/src/default/Client/psiclient/webui/) directory. [main.html](https://bitbucket.org/psiphon/psiphon-circumvention-system/src/default/Client/psiclient/webui/main.html) is the... main HTML. You'll see main-inline.html as well; that's the file that's actually used in the app and is generated from main.html by the [Gruntfile](https://bitbucket.org/psiphon/psiphon-circumvention-system/src/default/Client/psiclient/webui/Gruntfile.js).
The UI "web site" is in the [webui](https://github.com/Psiphon-Inc/psiphon-windows/tree/master/src/webui) directory. [main.html](https://github.com/Psiphon-Inc/psiphon-windows/blob/master/src/webui/main.html) is the... main HTML. You'll see main-inline.html as well; that's the file that's actually used in the app and is generated from main.html by the [Gruntfile](https://github.com/Psiphon-Inc/psiphon-windows/blob/master/src/webui/Gruntfile.js).

The UI uses jQuery, lodash, Bootstrap, and a few other libs. App executable size is very important, so don't get crazy with new libs, but a tiny bit of bloat might be okay.

You'll notice that old versions of Bootstrap and jQuery are being used. We NEED TO SUPPORT INTERNET EXPLORER 7. Because we need to support Windows XP SP3 or whatever. MS Edge and new IE allow for mimicking old IE (F12 and then upper right of new pane), which is essential for testing. MS used to provide VMs with old OS and IE versions, but they're difficult to find now. Try out the existing UI githack link in pseudo-old IE, so you can get a feel for the still-usable degradation.

If we end up feeling that functional old IE support is untenable, then we may come to the decision to just hide the UI for them.

The UI logic is all in main.js. For example, [here's the code](https://bitbucket.org/psiphon/psiphon-circumvention-system/src/e36a48574442c739ea68e72f253c1eea73d5f559/Client/psiclient/webui/js/main.js?at=default&fileviewer=file-view-default#main.js-2456) that triggers the tunnel to stop (after the user clicks the button). It basically makes a request for `psi:stop`.
The UI logic is all in main.js. For example, [here's the code](https://github.com/Psiphon-Inc/psiphon-windows/blob/54fe95362be84ef7e169548712ee64dedf3c20c5/src/webui/js/main.js#L4666) that triggers the tunnel to stop (after the user clicks the button). It basically makes a request for `psi:stop`.

The other important part of this is the C++ code that talks to the UI. The [`HTMLUI_BeforeNavigateHandler`](https://bitbucket.org/psiphon/psiphon-circumvention-system/src/7b94cbff1644bf93edce4f7088f4b73d8d58e60e/Client/psiclient/psiclient.cpp?at=default&fileviewer=file-view-default#psiclient.cpp-769) function watches for our special command URLs and takes the appropriate action (like stopping the tunnel).
The other important part of this is the C++ code that talks to the UI. The [`HTMLUI_BeforeNavigateHandler`](https://github.com/Psiphon-Inc/psiphon-windows/blob/54fe95362be84ef7e169548712ee64dedf3c20c5/src/psiclient_ui.cpp#L647) function watches for our special command URLs and takes the appropriate action (like stopping the tunnel).

There are lots more UI communications helper functions here. In order to push info into the UI they call JS functions (via the HTML control).

Expand Down
4 changes: 2 additions & 2 deletions src/webui/_locales/bn/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -764,11 +764,11 @@
"description": "Label on a button. Clicking this button will buy 1 hour of Speed Boost."
},
"psicash#1-day": {
"message": "1 day",
"message": "১ দিন",
"description": "Label on a button. Clicking this button will buy 1 day (24 hours) of Speed Boost."
},
"psicash#1-week": {
"message": "1 week",
"message": "১ সপ্তাহ",
"description": "Label on a button. Clicking this button will buy 1 week (7 days) of Speed Boost."
},
"psicash#1-month": {
Expand Down
Loading

0 comments on commit 8279696

Please sign in to comment.