-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure package to use UI from macOS client
- Loading branch information
NAStools
committed
Nov 30, 2016
1 parent
dff338a
commit 1a24759
Showing
7 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
debian/patches/0002-Allow-automatic-retrieval-of-authtoken-from-CGI.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From: NAStools <[email protected]> | ||
Date: Tue, 29 Nov 2016 17:41:16 -0800 | ||
Subject: Allow automatic retrieval of authtoken from CGI | ||
|
||
--- | ||
ext/installfiles/mac/ui/main.js | 8 +++++++- | ||
1 file changed, 7 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/ext/installfiles/mac/ui/main.js b/ext/installfiles/mac/ui/main.js | ||
index a164712..08d716f 100644 | ||
--- a/ext/installfiles/mac/ui/main.js | ||
+++ b/ext/installfiles/mac/ui/main.js | ||
@@ -42,7 +42,13 @@ function getUrlParameter(parameter) | ||
|
||
var ztAuthToken = getUrlParameter('authToken'); | ||
if ((!ztAuthToken)||(ztAuthToken.length <= 0)) { | ||
- ztAuthToken = prompt('No authToken specified in URL. Enter token from\nauthtoken.secret to authorize.'); | ||
+ xmlhttp = new XMLHttpRequest(); | ||
+ xmlhttp.open("GET", "/apps/nastools-zerotier-one/cgi/authtoken", false); | ||
+ xmlhttp.send(); | ||
+ ztAuthToken = xmlhttp.responseText; | ||
+ if ((!ztAuthToken)||(ztAuthToken.length <= 0)) { | ||
+ ztAuthToken = prompt('No authToken specified in URL. Enter token from\nauthtoken.secret to authorize.'); | ||
+ } | ||
} | ||
|
||
React.render( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
0001-Update-platformDefaultHomePath-for-ReadyNAS-OS.patch | ||
0002-Allow-automatic-retrieval-of-authtoken-from-CGI.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int main() { | ||
FILE *f; | ||
char c; | ||
|
||
f=fopen("/apps/nastools-zerotier-one/var/authtoken.secret","rt"); | ||
|
||
printf("Content-Type: text/plain\n\n"); | ||
|
||
while ((c=fgetc(f))!=EOF) | ||
printf("%c", c); | ||
|
||
fclose(f); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<IfModule !mod_proxy.c> | ||
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so | ||
</IfModule> | ||
<IfModule !mod_proxy_http.c> | ||
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so | ||
</IfModule> | ||
|
||
ScriptAlias /apps/nastools-zerotier-one/cgi /apps/nastools-zerotier-one/cgi | ||
|
||
<Location /apps/nastools-zerotier-one> | ||
Include "/etc/frontview/apache/Admin_Auth.conf" | ||
</Location> | ||
|
||
<IfModule mod_proxy.c> | ||
<IfModule mod_proxy_http.c> | ||
<Location /apps/nastools-zerotier-one/ui/> | ||
ProxyPass http://localhost:9993/ | ||
ProxyPassReverse http://localhost:9993/ | ||
</Location> | ||
</IfModule> | ||
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters