added nginx
This commit is contained in:
1 parent
92e35a72e6
commit
0d2e840d0c
10 files changed
+94
-7
No files matched your search
+1
-1
Submodule auth_service_cpp updated: fb961af71c...8abb0a901a.
@@ -51,6 +51,6 @@ int main() {
|
||||
<< "0.0.0.0" << RESET << ":" << CYAN << "43244" << RESET << " ]" << std::endl;
|
||||
|
||||
syslog(LOG_INFO, "openrouter administration software started.");
|
||||
srv.listen("0.0.0.0", 80);
|
||||
srv.listen("127.0.0.1", 43244);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const authhost = 'http://172.20.10.2:43243'
|
||||
const authhost = window.location.origin
|
||||
const host = window.location.origin
|
||||
const prefix = 'api'
|
||||
|
||||
|
||||
@@ -65,7 +65,6 @@ const get_ssh_keys = () => {
|
||||
method: 'POST',
|
||||
body: `{"token":"${localStorage.getItem("token")}"}`
|
||||
}).then(data => data.json()).then(jsondata => {
|
||||
console.log(jsondata.keys)
|
||||
sshkeys = jsondata.keys
|
||||
sshkeystablebody.innerHTML = ""
|
||||
for (const key in sshkeys) {
|
||||
|
||||
@@ -7,7 +7,6 @@ let openrouterfilterenable = false
|
||||
let authservicefilerenable = false
|
||||
|
||||
const get_syslog_data = () => {
|
||||
console.log("get_syslog_data")
|
||||
fetch(routes.syslog(), {
|
||||
method: 'GET',
|
||||
// body: `{"token":"${localStorage.getItem("token")}"}`
|
||||
@@ -49,7 +48,6 @@ const openrouterfilterfunc = (textdata) => {
|
||||
syslogalldata = syslogalldata.filter(data => {
|
||||
return data.includes("openrouter:")
|
||||
})
|
||||
console.log(syslogalldata)
|
||||
syslogdata.innerHTML = ""
|
||||
for (const data in syslogalldata) {
|
||||
syslogdata.innerHTML += syslogalldata[data] + "<br>"
|
||||
@@ -63,7 +61,6 @@ const authservicefilterfunc = (textdata) => {
|
||||
syslogalldata = syslogalldata.filter(data => {
|
||||
return data.includes("auth_service:")
|
||||
})
|
||||
console.log(syslogalldata)
|
||||
syslogdata.innerHTML = ""
|
||||
for (const data in syslogalldata) {
|
||||
syslogdata.innerHTML += syslogalldata[data] + "<br>"
|
||||
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
Green='\033[0;32m'
|
||||
Color_off='\033[0m'
|
||||
Red='\033[0;31m'
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting nginx "
|
||||
nginx
|
||||
if [[ "$?" == "0" ]]; then
|
||||
printf "[$Green OK $Color_off]\n"
|
||||
else
|
||||
printf "[$Red ERR $Color_off]\n"
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping nginx "
|
||||
nginx -s stop
|
||||
if [[ "$?" == "0" ]]; then
|
||||
printf "[$Green OK $Color_off]\n"
|
||||
else
|
||||
printf "[$Red ERR $Color_off]\n"
|
||||
fi
|
||||
;;
|
||||
restart|reload)
|
||||
"$0" stop
|
||||
"$0" start
|
||||
;;
|
||||
*)
|
||||
echo "nginx init script usage: $0 {start|stop|restart}"
|
||||
return 1
|
||||
esac
|
||||
return $?
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../init.d/telnet
|
||||
File renamed without changes.
Symlink
+1
@@ -0,0 +1 @@
|
||||
../init.d/nginx
|
||||
@@ -0,0 +1,56 @@
|
||||
|
||||
#user nobody;
|
||||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
gzip on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:43244;
|
||||
}
|
||||
|
||||
location /api/settings {
|
||||
proxy_pass http://127.0.0.1:43244/api/settings;
|
||||
}
|
||||
|
||||
location /api/syslog {
|
||||
proxy_pass http://127.0.0.1:43244/api/syslog;
|
||||
}
|
||||
|
||||
location /api/reboot {
|
||||
proxy_pass http://127.0.0.1:43244/api/reboot;
|
||||
}
|
||||
|
||||
location /auth/admin {
|
||||
proxy_pass http://127.0.0.1:43243/auth/admin;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://127.0.0.1:43243/api;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user