diff options
Diffstat (limited to '')
19 files changed, 192 insertions, 236 deletions
diff --git a/example/etc/apache2/sledjchisl.fcgi.conf b/example/etc/apache2/sledjchisl.fcgi.conf index 95458cd..06002bd 100644 --- a/example/etc/apache2/sledjchisl.fcgi.conf +++ b/example/etc/apache2/sledjchisl.fcgi.conf | |||
@@ -11,8 +11,11 @@ LoadModule proxy_fcgi_module /usr/lib/apache2/modules/mod_proxy_fcgi.so | |||
11 | AllowOverride All | 11 | AllowOverride All |
12 | </Directory> | 12 | </Directory> |
13 | 13 | ||
14 | |||
15 | # Any request ENDING in .fcgi gets passed to that unix:...socket, piped as FGCI protocol to localhost. | ||
16 | # That last bit isn't documented, this helped - https://www.linuxquestions.org/questions/linux-server-73/understanding-apache-proxy-unix-sockets-with-pipe-localhost-4175627589/ | ||
14 | <FilesMatch "\.fcgi$"> | 17 | <FilesMatch "\.fcgi$"> |
15 | SetHandler "proxy:unix:///opt/opensim_SC/caches/sledjchisl.socket|fcgi://localhost/" | 18 | SetHandler "proxy:unix:///opt/opensim_SC/var/run/sledjchisl.socket|fcgi://localhost/" |
16 | </FilesMatch> | 19 | </FilesMatch> |
17 | 20 | ||
18 | ErrorLog ${APACHE_LOG_DIR}/error.log | 21 | ErrorLog ${APACHE_LOG_DIR}/error.log |
@@ -31,7 +34,7 @@ LoadModule proxy_fcgi_module /usr/lib/apache2/modules/mod_proxy_fcgi.so | |||
31 | </Directory> | 34 | </Directory> |
32 | 35 | ||
33 | <FilesMatch "\.fcgi$"> | 36 | <FilesMatch "\.fcgi$"> |
34 | SetHandler "proxy:unix:///opt/opensim_SC/caches/sledjchisl.socket|fcgi://localhost/" | 37 | SetHandler "proxy:unix:///opt/opensim_SC/var/run/sledjchisl.socket|fcgi://localhost/" |
35 | </FilesMatch> | 38 | </FilesMatch> |
36 | </VirtualHost> | 39 | </VirtualHost> |
37 | </IfModule> | 40 | </IfModule> |
diff --git a/example/var/www/html/SledjChisl.css b/example/var/www/html/SledjChisl.css new file mode 100644 index 0000000..95b55cb --- /dev/null +++ b/example/var/www/html/SledjChisl.css | |||
@@ -0,0 +1,89 @@ | |||
1 | html, body | ||
2 | { | ||
3 | background-color: black; | ||
4 | color: white; | ||
5 | font-family: 'sans-serif'; | ||
6 | margin: 0; | ||
7 | padding: 0; | ||
8 | } | ||
9 | |||
10 | a {color: aqua;} | ||
11 | a:link {color: aqua;} | ||
12 | a:visited {color: fuchsia;} | ||
13 | a:hover {color: blue;} | ||
14 | a:active {color: red;} | ||
15 | |||
16 | button | ||
17 | { | ||
18 | background-color: darkgreen; | ||
19 | color: white; | ||
20 | font-family: 'sans-serif'; | ||
21 | } | ||
22 | button:hover {color: blue;} | ||
23 | button:active {color: red;} | ||
24 | |||
25 | label | ||
26 | { | ||
27 | background-color:darkgreen; | ||
28 | color: white; | ||
29 | font-family: 'sans-serif'; | ||
30 | font-size: 160%; | ||
31 | } | ||
32 | input | ||
33 | { | ||
34 | background-color:darkblue; | ||
35 | color: white; | ||
36 | font-family: 'sans-serif'; | ||
37 | font-size: 80%; | ||
38 | } | ||
39 | textarea | ||
40 | { | ||
41 | background-color:darkblue; | ||
42 | color: white; | ||
43 | font-family: 'sans-serif'; | ||
44 | font-size: 80%; | ||
45 | /* What idiot thought aligning the label with the bottom of textareas was a good default? */ | ||
46 | vertical-align: top; | ||
47 | } | ||
48 | |||
49 | .container | ||
50 | { | ||
51 | position: relative; | ||
52 | text-align: left; | ||
53 | } | ||
54 | .top-left | ||
55 | { | ||
56 | position: absolute; | ||
57 | top: 8px; | ||
58 | left: 16px; | ||
59 | width: 30%; | ||
60 | } | ||
61 | .top-right | ||
62 | { | ||
63 | position: absolute; | ||
64 | top: 8px; | ||
65 | right: 16px; | ||
66 | width: 30%; | ||
67 | } | ||
68 | .centre | ||
69 | { | ||
70 | position: absolute; | ||
71 | top: 50%; | ||
72 | left: 50%; | ||
73 | width: 30%; | ||
74 | transform: translate(-50%, -50%); | ||
75 | } | ||
76 | .bottom-left | ||
77 | { | ||
78 | position: absolute; | ||
79 | bottom: 8px; | ||
80 | left: 16px; | ||
81 | width: 30%; | ||
82 | } | ||
83 | .bottom-right | ||
84 | { | ||
85 | position: absolute; | ||
86 | bottom: 8px; | ||
87 | right: 16px; | ||
88 | width: 30%; | ||
89 | } | ||
diff --git a/example/www/SledjHamr.png b/example/var/www/html/SledjHamr.png index 9089573..9089573 100644 --- a/example/www/SledjHamr.png +++ b/example/var/www/html/SledjHamr.png | |||
Binary files differ | |||
diff --git a/example/www/SledjHamrIcon.png b/example/var/www/html/SledjHamrIcon.png index e3b50e1..e3b50e1 100644 --- a/example/www/SledjHamrIcon.png +++ b/example/var/www/html/SledjHamrIcon.png | |||
Binary files differ | |||
diff --git a/example/www/SledjHamrIconSmall.png b/example/var/www/html/SledjHamrIconSmall.png index a1a6d72..a1a6d72 100644 --- a/example/www/SledjHamrIconSmall.png +++ b/example/var/www/html/SledjHamrIconSmall.png | |||
Binary files differ | |||
diff --git a/example/var/www/html/about.html b/example/var/www/html/about.html new file mode 100644 index 0000000..7294c21 --- /dev/null +++ b/example/var/www/html/about.html | |||
@@ -0,0 +1,13 @@ | |||
1 | <html> | ||
2 | <title>About this grid</title> | ||
3 | <head> | ||
4 | <meta charset="UTF-8"> | ||
5 | <link rel="shortcut icon" href="SledjHamrIconSmall.png"> | ||
6 | <link type='text/css' rel='stylesheet' href='SledjChisl.css' media='all' /> | ||
7 | <meta http-equiv="refresh" content="120"> | ||
8 | </head> | ||
9 | <body bgcolor='black' text='white' link='aqua' vlink='fuchsia' alink='red'> | ||
10 | <p>This is a virtual world, usually called a grid, based on <a href="https://sledjhamr.org/cgit/opensim-SC/?h=SledjChisl">opensim-SC</a>.</p> | ||
11 | <p> </p> | ||
12 | </body> | ||
13 | </html> | ||
diff --git a/example/www/debugStyle.css b/example/var/www/html/debugStyle.css index 98645cc..98645cc 100644 --- a/example/www/debugStyle.css +++ b/example/var/www/html/debugStyle.css | |||
diff --git a/example/var/www/html/help.html b/example/var/www/html/help.html new file mode 100644 index 0000000..17022d8 --- /dev/null +++ b/example/var/www/html/help.html | |||
@@ -0,0 +1,13 @@ | |||
1 | <html> | ||
2 | <title>Help for this grid</title> | ||
3 | <head> | ||
4 | <meta charset="UTF-8"> | ||
5 | <link rel="shortcut icon" href="SledjHamrIconSmall.png"> | ||
6 | <link type='text/css' rel='stylesheet' href='SledjChisl.css' media='all' /> | ||
7 | <meta http-equiv="refresh" content="120"> | ||
8 | </head> | ||
9 | <body bgcolor='black' text='white' link='aqua' vlink='fuchsia' alink='red'> | ||
10 | <p>Include help for your grid here.</p> | ||
11 | <p> </p> | ||
12 | </body> | ||
13 | </html> | ||
diff --git a/example/www/loginpage.html b/example/var/www/html/loginpage.html index 7a221dc..38d5761 100644 --- a/example/www/loginpage.html +++ b/example/var/www/html/loginpage.html | |||
@@ -4,66 +4,7 @@ | |||
4 | <meta charset="UTF-8"> | 4 | <meta charset="UTF-8"> |
5 | <link rel="shortcut icon" href="/SledjHamrIconSmall.png"> | 5 | <link rel="shortcut icon" href="/SledjHamrIconSmall.png"> |
6 | <meta http-equiv="refresh" content="120"> | 6 | <meta http-equiv="refresh" content="120"> |
7 | <style> | 7 | <link type="text/css" rel="stylesheet" href="/SledjChisl.css" media="all" /> |
8 | html, body | ||
9 | { | ||
10 | margin: 0; | ||
11 | padding: 0; | ||
12 | color: white; | ||
13 | } | ||
14 | a {color: green;} | ||
15 | a:link {color: green;} | ||
16 | a:visited {color: purple;} | ||
17 | a:hover {color: red;} | ||
18 | a:active {color: blue;} | ||
19 | |||
20 | .container | ||
21 | { | ||
22 | position: relative; | ||
23 | text-align: left; | ||
24 | } | ||
25 | |||
26 | .top-left | ||
27 | { | ||
28 | position: absolute; | ||
29 | top: 8px; | ||
30 | left: 16px; | ||
31 | width: 30%; | ||
32 | } | ||
33 | |||
34 | .top-right | ||
35 | { | ||
36 | position: absolute; | ||
37 | top: 8px; | ||
38 | right: 16px; | ||
39 | width: 30%; | ||
40 | } | ||
41 | |||
42 | .centre | ||
43 | { | ||
44 | position: absolute; | ||
45 | top: 50%; | ||
46 | left: 50%; | ||
47 | width: 30%; | ||
48 | transform: translate(-50%, -50%); | ||
49 | } | ||
50 | |||
51 | .bottom-left | ||
52 | { | ||
53 | position: absolute; | ||
54 | bottom: 8px; | ||
55 | left: 16px; | ||
56 | width: 30%; | ||
57 | } | ||
58 | |||
59 | .bottom-right | ||
60 | { | ||
61 | position: absolute; | ||
62 | bottom: 8px; | ||
63 | right: 16px; | ||
64 | width: 30%; | ||
65 | } | ||
66 | </style> | ||
67 | <link type="text/css" rel="stylesheet" href="/debugStyle.css" media="all" /> | 8 | <link type="text/css" rel="stylesheet" href="/debugStyle.css" media="all" /> |
68 | </head> | 9 | </head> |
69 | <body> | 10 | <body> |
diff --git a/example/var/www/html/password_help.html b/example/var/www/html/password_help.html new file mode 100644 index 0000000..db6c659 --- /dev/null +++ b/example/var/www/html/password_help.html | |||
@@ -0,0 +1,13 @@ | |||
1 | <html> | ||
2 | <title>Password help for this grid</title> | ||
3 | <head> | ||
4 | <meta charset="UTF-8"> | ||
5 | <link rel="shortcut icon" href="SledjHamrIconSmall.png"> | ||
6 | <link type='text/css' rel='stylesheet' href='SledjChisl.css' media='all' /> | ||
7 | <meta http-equiv="refresh" content="120"> | ||
8 | </head> | ||
9 | <body bgcolor='black' text='white' link='aqua' vlink='fuchsia' alink='red'> | ||
10 | <p>Include password help for your grid here.</p> | ||
11 | <p> </p> | ||
12 | </body> | ||
13 | </html> | ||
diff --git a/example/var/www/html/register.html b/example/var/www/html/register.html new file mode 100644 index 0000000..e37d2b0 --- /dev/null +++ b/example/var/www/html/register.html | |||
@@ -0,0 +1,17 @@ | |||
1 | <html> | ||
2 | <title>Account for this grid</title> | ||
3 | <head> | ||
4 | <meta charset="UTF-8"> | ||
5 | <link rel="shortcut icon" href="SledjHamrIconSmall.png"> | ||
6 | <link type='text/css' rel='stylesheet' href='SledjChisl.css' media='all' /> | ||
7 | <meta http-equiv="refresh" content="120"> | ||
8 | </head> | ||
9 | <body bgcolor='black' text='white' link='aqua' vlink='fuchsia' alink='red'> | ||
10 | <p>Include account registration help for your grid here.</p> | ||
11 | <p> </p> | ||
12 | <p>If you want to register an account on this grid, ask the person that runs it to do that for you.</p> | ||
13 | <p> </p> | ||
14 | <p>If you want to register an account on this grid, <a href="/sledjchisl.fcgi/account.html"> click here</a> (when it's written).</p> | ||
15 | <p> </p> | ||
16 | </body> | ||
17 | </html> | ||
diff --git a/example/www/stats.html b/example/var/www/html/stats.html index 7b51b06..a48ee01 100644 --- a/example/www/stats.html +++ b/example/var/www/html/stats.html | |||
@@ -3,20 +3,8 @@ | |||
3 | <head> | 3 | <head> |
4 | <meta charset="UTF-8"> | 4 | <meta charset="UTF-8"> |
5 | <link rel="shortcut icon" href="/SledjHamrIconSmall.png"> | 5 | <link rel="shortcut icon" href="/SledjHamrIconSmall.png"> |
6 | <link type='text/css' rel='stylesheet' href='/SledjChisl.css' media='all' /> | ||
6 | <meta http-equiv="refresh" content="120"> | 7 | <meta http-equiv="refresh" content="120"> |
7 | <style> | ||
8 | html, body {background-color: black; color: white; font-family: 'sans-serif'; margin: 0; padding: 0;} | ||
9 | a:link {color: aqua;} | ||
10 | a:visited {color: fuchsia;} | ||
11 | a:hover {color: blue;} | ||
12 | a:active {color: red;} | ||
13 | button {background-color: darkgreen; color: white; font-family: 'sans-serif';} | ||
14 | button:hover {color: blue;} | ||
15 | button:active {color: red;} | ||
16 | label {background-color:darkgreen; color: white; font-family: 'sans-serif'; font-size: 160%;} | ||
17 | input {background-color:darkblue; color: white; font-family: 'sans-serif'; font-size: 80%;} | ||
18 | textarea {background-color:darkblue; color: white; font-family: 'sans-serif'; font-size: 80%; vertical-align: top;} | ||
19 | </style> | ||
20 | </head> | 8 | </head> |
21 | <body bgcolor='black' text='white' link='aqua' vlink='fuchsia' alink='red'> | 9 | <body bgcolor='black' text='white' link='aqua' vlink='fuchsia' alink='red'> |
22 | <font face='sans-serif'> | 10 | <font face='sans-serif'> |
diff --git a/example/www/SledjChisl.css b/example/www/SledjChisl.css deleted file mode 100644 index fb19f89..0000000 --- a/example/www/SledjChisl.css +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | html, body | ||
2 | { | ||
3 | margin: 0; | ||
4 | padding: 0; | ||
5 | color: white; | ||
6 | } | ||
7 | a {color: green;} | ||
8 | a:link {color: green;} | ||
9 | a:visited {color: purple;} | ||
10 | a:hover {color: red;} | ||
11 | a:active {color: blue;} | ||
12 | |||
13 | .container | ||
14 | { | ||
15 | position: relative; | ||
16 | text-align: left; | ||
17 | } | ||
18 | |||
19 | .top-left | ||
20 | { | ||
21 | position: absolute; | ||
22 | top: 8px; | ||
23 | left: 16px; | ||
24 | height: 30%; | ||
25 | width: 30%; | ||
26 | } | ||
27 | |||
28 | .top-right | ||
29 | { | ||
30 | position: absolute; | ||
31 | top: 8px; | ||
32 | right: 16px; | ||
33 | height: 30%; | ||
34 | width: 30%; | ||
35 | } | ||
36 | |||
37 | .centre | ||
38 | { | ||
39 | position: absolute; | ||
40 | top: 50%; | ||
41 | left: 50%; | ||
42 | height: 30%; | ||
43 | width: 30%; | ||
44 | transform: translate(-50%, -50%); | ||
45 | } | ||
46 | |||
47 | .bottom-left | ||
48 | { | ||
49 | position: absolute; | ||
50 | bottom: 8px; | ||
51 | left: 16px; | ||
52 | height: 30%; | ||
53 | width: 30%; | ||
54 | } | ||
55 | |||
56 | .bottom-right | ||
57 | { | ||
58 | position: absolute; | ||
59 | bottom: 8px; | ||
60 | right: 16px; | ||
61 | height: 30%; | ||
62 | width: 30%; | ||
63 | } | ||
diff --git a/example/www/about.html b/example/www/about.html deleted file mode 100644 index 3afc962..0000000 --- a/example/www/about.html +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | <html> | ||
2 | <title>About this grid</title> | ||
3 | <head> | ||
4 | <meta charset="UTF-8"> | ||
5 | <link rel="shortcut icon" href="SledjHamrIconSmall.png"> | ||
6 | </head> | ||
7 | <body bgcolor="black" text="white" alink="red" link="blue" vlink="purple"> | ||
8 | This is a virtual world, usually called a grid, based on <a href="https://sledjhamr.org/cgit/opensim-SC/?h=SledjChisl">opensim-SC</a>. | ||
9 | <p> </p> | ||
10 | </body> | ||
11 | </html> | ||
diff --git a/example/www/help.html b/example/www/help.html deleted file mode 100644 index 9a75aa6..0000000 --- a/example/www/help.html +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | <html> | ||
2 | <title>Help for this grid</title> | ||
3 | <head> | ||
4 | <meta charset="UTF-8"> | ||
5 | <link rel="shortcut icon" href="SledjHamrIconSmall.png"> | ||
6 | </head> | ||
7 | <body bgcolor="black" text="white" alink="red" link="blue" vlink="purple"> | ||
8 | Include help for your grid here. | ||
9 | <p> </p> | ||
10 | </body> | ||
11 | </html> | ||
diff --git a/example/www/password_help.html b/example/www/password_help.html deleted file mode 100644 index aef6bd5..0000000 --- a/example/www/password_help.html +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | <html> | ||
2 | <title>Password help for this grid</title> | ||
3 | <head> | ||
4 | <meta charset="UTF-8"> | ||
5 | <link rel="shortcut icon" href="SledjHamrIconSmall.png"> | ||
6 | </head> | ||
7 | <body bgcolor="black" text="white" alink="red" link="blue" vlink="purple"> | ||
8 | Include password help for your grid here. | ||
9 | <p> </p> | ||
10 | </body> | ||
11 | </html> | ||
diff --git a/example/www/register.html b/example/www/register.html deleted file mode 100644 index 46317e6..0000000 --- a/example/www/register.html +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | <html> | ||
2 | <title>Account for this grid</title> | ||
3 | <head> | ||
4 | <meta charset="UTF-8"> | ||
5 | <link rel="shortcut icon" href="SledjHamrIconSmall.png"> | ||
6 | </head> | ||
7 | <body bgcolor="black" text="white" alink="red" link="blue" vlink="purple"> | ||
8 | Include account registration help for your grid here. | ||
9 | <p> </p> | ||
10 | <p>If you want to register an account on this grid, ask the person that runs it to do that for you.</p> | ||
11 | <p> </p> | ||
12 | <p>If you want to register an account on this grid, <a href="account.html"> click here</a> (when it's written).</p> | ||
13 | <p> </p> | ||
14 | </body> | ||
15 | </html> | ||
diff --git a/src/.sledjChisl.conf.lua b/src/.sledjChisl.conf.lua index cede4e4..61d709d 100644 --- a/src/.sledjChisl.conf.lua +++ b/src/.sledjChisl.conf.lua | |||
@@ -14,7 +14,7 @@ config = | |||
14 | ["debug"] = false; | 14 | ["debug"] = false; |
15 | ["scUser"] = "opensimsc"; | 15 | ["scUser"] = "opensimsc"; |
16 | ["Tconsole"] = "SledjChisl"; | 16 | ["Tconsole"] = "SledjChisl"; |
17 | ["Tsocket"] = "opensim-tmux.socket"; | 17 | ["Tsocket"] = "opensim-tmux.socket"; -- Ends up in scRoot/var/run |
18 | ["Ttab"] = "SC"; | 18 | ["Ttab"] = "SC"; |
19 | ["loadAverageInc"] = 0.7; | 19 | ["loadAverageInc"] = 0.7; |
20 | ["simTimeOut"] = 45; -- seconds | 20 | ["simTimeOut"] = 45; -- seconds |
@@ -22,9 +22,8 @@ config = | |||
22 | ["backupIARsim"] = "Sandbox"; | 22 | ["backupIARsim"] = "Sandbox"; |
23 | ["rsync"] = ""; | 23 | ["rsync"] = ""; |
24 | ["rsyncPort"] = 0; | 24 | ["rsyncPort"] = 0; |
25 | ["webRoot"] = "/var/www/html"; | 25 | ["webRoot"] = "/var/www/html"; -- Relative to scRoot. |
26 | ["webHost"] = "localhost"; | 26 | ["webSocket"] = "sledjchisl.socket"; -- Ends up in scRoot/var/run |
27 | ["URL"] = "sledjchisl.fcgi"; | ||
28 | ["webIframers"] = ""; -- Space separated list of hosts allowed to iFrame us, coz someone asked. Include the "https://" bit. | 27 | ["webIframers"] = ""; -- Space separated list of hosts allowed to iFrame us, coz someone asked. Include the "https://" bit. |
29 | ["seshRenew"] = 10 * 60; -- seconds | 28 | ["seshRenew"] = 10 * 60; -- seconds |
30 | ["idleTimeOut"] = 30 * 60; -- seconds | 29 | ["idleTimeOut"] = 30 * 60; -- seconds |
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index b333357..e5e6460 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c | |||
@@ -535,7 +535,7 @@ char *backupIARsim = "Sandbox"; | |||
535 | char *rSync = ""; | 535 | char *rSync = ""; |
536 | int rSyncPort = 0; | 536 | int rSyncPort = 0; |
537 | char *webRoot = "/var/www/html"; | 537 | char *webRoot = "/var/www/html"; |
538 | char *URL = "fcgi-bin/sledjchisl.fcgi"; | 538 | char *webSocket = "sledjchisl.socket"; |
539 | char *ToS = "Be good."; | 539 | char *ToS = "Be good."; |
540 | char *webIframers = ""; | 540 | char *webIframers = ""; |
541 | int seshRenew = 10 * 60; | 541 | int seshRenew = 10 * 60; |
@@ -1428,7 +1428,6 @@ static void testOpenSim(simData *simd, char *sim, char *type, int count, int win | |||
1428 | 1428 | ||
1429 | 1429 | ||
1430 | 1430 | ||
1431 | |||
1432 | static int getIntFromIni(qlisttbl_t *ini, char *name) | 1431 | static int getIntFromIni(qlisttbl_t *ini, char *name) |
1433 | { | 1432 | { |
1434 | int ret; | 1433 | int ret; |
@@ -4151,6 +4150,7 @@ cookie *setCookie(reqData *Rd, char *cki, char *value) | |||
4151 | ret->httpOnly = TRUE; | 4150 | ret->httpOnly = TRUE; |
4152 | ret->site = CS_STRICT; | 4151 | ret->site = CS_STRICT; |
4153 | ret->secure = TRUE; | 4152 | ret->secure = TRUE; |
4153 | // TODO - can we use Rd->Script here? | ||
4154 | ret->path = getStrH(Rd->headers, "SCRIPT_NAME"); | 4154 | ret->path = getStrH(Rd->headers, "SCRIPT_NAME"); |
4155 | Rd->Rcookies->put(Rd->Rcookies, cook, ret, sizeof(cookie)); | 4155 | Rd->Rcookies->put(Rd->Rcookies, cook, ret, sizeof(cookie)); |
4156 | free(ret); | 4156 | free(ret); |
@@ -4259,27 +4259,13 @@ static void HTMLheader(qgrow_t *reply, char *title) | |||
4259 | " <title>%s</title>\n" | 4259 | " <title>%s</title>\n" |
4260 | " <meta charset=\"UTF-8\">\n" | 4260 | " <meta charset=\"UTF-8\">\n" |
4261 | " <link rel=\"shortcut icon\" href=\"/SledjHamrIconSmall.png\">\n" | 4261 | " <link rel=\"shortcut icon\" href=\"/SledjHamrIconSmall.png\">\n" |
4262 | " <link type='text/css' rel='stylesheet' href='/SledjChisl.css' media='all' />\n" | ||
4262 | , title); | 4263 | , title); |
4263 | reply->addstrf(reply, " <link type='text/css' rel='stylesheet' href='/SledjChisl.css' media='all' />\n"); | ||
4264 | 4264 | ||
4265 | if (DEBUG) | 4265 | if (DEBUG) |
4266 | reply->addstrf(reply, " <link type='text/css' rel='stylesheet' href='/debugStyle.css' media='all' />\n"); | 4266 | reply->addstrf(reply, " <link type='text/css' rel='stylesheet' href='/debugStyle.css' media='all' />\n"); |
4267 | 4267 | ||
4268 | reply->addstrf(reply, | 4268 | reply->addstrf(reply, |
4269 | " <style> \n" | ||
4270 | " html, body {background-color: black; color: white; font-family: 'sans-serif'; margin: 0; padding: 0;}\n" | ||
4271 | " a:link {color: aqua;}\n" | ||
4272 | " a:visited {color: fuchsia;}\n" | ||
4273 | " a:hover {color: blue;}\n" | ||
4274 | " a:active {color: red;}\n" | ||
4275 | " button {background-color: darkgreen; color: white; font-family: 'sans-serif';}\n" | ||
4276 | " button:hover {color: blue;}\n" | ||
4277 | " button:active {color: red;}\n" | ||
4278 | " label {background-color:darkgreen; color: white; font-family: 'sans-serif'; font-size: 160%;}\n" | ||
4279 | " input {background-color:darkblue; color: white; font-family: 'sans-serif'; font-size: 80%;}\n" | ||
4280 | // What idiot thought aligning the label with the bottom of textareas was a good default? | ||
4281 | " textarea {background-color:darkblue; color: white; font-family: 'sans-serif'; font-size: 80%; vertical-align: top;}\n" | ||
4282 | " </style>\n" | ||
4283 | " </head>\n" | 4269 | " </head>\n" |
4284 | " <body bgcolor='black' text='white' link='aqua' vlink='fuchsia' alink='red'>\n" | 4270 | " <body bgcolor='black' text='white' link='aqua' vlink='fuchsia' alink='red'>\n" |
4285 | " <font face='sans-serif'>\n" | 4271 | " <font face='sans-serif'>\n" |
@@ -5080,9 +5066,6 @@ t("checkSLOSpassword(%s, %s, %s, ", password, salt, passwordHash, fail); | |||
5080 | return ret; | 5066 | return ret; |
5081 | } | 5067 | } |
5082 | 5068 | ||
5083 | |||
5084 | |||
5085 | |||
5086 | char *checkLinky(reqData *Rd) | 5069 | char *checkLinky(reqData *Rd) |
5087 | { | 5070 | { |
5088 | // TODO - should be from Rd.shs->linky-hashish | 5071 | // TODO - should be from Rd.shs->linky-hashish |
@@ -5109,7 +5092,10 @@ char *checkLinky(reqData *Rd) | |||
5109 | // "<a href='https://%s%s?hashish=%s'>%s</a>" | 5092 | // "<a href='https://%s%s?hashish=%s'>%s</a>" |
5110 | "</b></font></p>\n", | 5093 | "</b></font></p>\n", |
5111 | "grid_no_reply", Rd->Host, | 5094 | "grid_no_reply", Rd->Host, |
5112 | Rd->Host, Rd->RUri | 5095 | "grid_no_reply", Rd->Host, |
5096 | "grid_no_reply", Rd->Host, | ||
5097 | "grid_no_reply", Rd->Host | ||
5098 | // Rd->Host, Rd->RUri | ||
5113 | // ,t1, t0 | 5099 | // ,t1, t0 |
5114 | ); | 5100 | ); |
5115 | free(t1); | 5101 | free(t1); |
@@ -8073,12 +8059,12 @@ static void cleanup(void) | |||
8073 | { | 8059 | { |
8074 | C("Caught signal, or quitting, cleaning up."); | 8060 | C("Caught signal, or quitting, cleaning up."); |
8075 | 8061 | ||
8076 | char *cmd = xmprintf("%s/sledjchisl.socket", scRun); | 8062 | char *cmd = xmprintf("%s/%s", scRun, webSocket); |
8077 | 8063 | ||
8078 | if (isWeb && qfile_exist(cmd)) | 8064 | if (isWeb && qfile_exist(cmd)) |
8079 | { | 8065 | { |
8080 | V("Deleting web socket."); | 8066 | V("Deleting web socket."); |
8081 | if (shellMeFail("rm %s/sledjchisl.socket", scRun)) | 8067 | if (shellMeFail("rm %s/%s", scRun, webSocket)) |
8082 | E("rm command failed!"); | 8068 | E("rm command failed!"); |
8083 | } | 8069 | } |
8084 | free(cmd); | 8070 | free(cmd); |
@@ -8191,7 +8177,7 @@ int scanForConfigs(char **cPaths) | |||
8191 | if ((tmp = configs->getstr(configs, "rsync", false)) != NULL) {rSync = tmp; V("Setting rsync = %s", rSync);} | 8177 | if ((tmp = configs->getstr(configs, "rsync", false)) != NULL) {rSync = tmp; V("Setting rsync = %s", rSync);} |
8192 | if ((vd = configs->getstr(configs, "rsyncPort", false)) != NULL) {rSyncPort = (int) *((float *) vd); V("Setting rsyncPort = %s", rSyncPort);} | 8178 | if ((vd = configs->getstr(configs, "rsyncPort", false)) != NULL) {rSyncPort = (int) *((float *) vd); V("Setting rsyncPort = %s", rSyncPort);} |
8193 | if ((tmp = configs->getstr(configs, "webRoot", false)) != NULL) {webRoot = tmp; V("Setting webRoot = %s", webRoot);} | 8179 | if ((tmp = configs->getstr(configs, "webRoot", false)) != NULL) {webRoot = tmp; V("Setting webRoot = %s", webRoot);} |
8194 | if ((tmp = configs->getstr(configs, "URL", false)) != NULL) {URL = tmp; V("Setting URL = %s", URL);} | 8180 | if ((tmp = configs->getstr(configs, "webSocket", false)) != NULL) {webSocket = tmp; V("Setting webSocket = %s", webSocket);} |
8195 | if ((vd = configs->get (configs, "seshRenew", NULL, false)) != NULL) {seshRenew = (int) *((float *) vd); V("Setting seshRenew = %d", seshRenew);} | 8181 | if ((vd = configs->get (configs, "seshRenew", NULL, false)) != NULL) {seshRenew = (int) *((float *) vd); V("Setting seshRenew = %d", seshRenew);} |
8196 | if ((vd = configs->get (configs, "idleTimeOut", NULL, false)) != NULL) {idleTimeOut = (int) *((float *) vd); V("Setting idleTimeOut = %d", idleTimeOut);} | 8182 | if ((vd = configs->get (configs, "idleTimeOut", NULL, false)) != NULL) {idleTimeOut = (int) *((float *) vd); V("Setting idleTimeOut = %d", idleTimeOut);} |
8197 | if ((vd = configs->get (configs, "seshTimeOut", NULL, false)) != NULL) {seshTimeOut = (int) *((float *) vd); V("Setting seshTimeOut = %d", seshTimeOut);} | 8183 | if ((vd = configs->get (configs, "seshTimeOut", NULL, false)) != NULL) {seshTimeOut = (int) *((float *) vd); V("Setting seshTimeOut = %d", seshTimeOut);} |
@@ -8483,7 +8469,7 @@ Copy correct config/config.ini to there. | |||
8483 | // A bit chicken and egg here. | 8469 | // A bit chicken and egg here. |
8484 | // We need to be the correct user to set the correct perms on the scRun directory | 8470 | // We need to be the correct user to set the correct perms on the scRun directory |
8485 | // But we wont be the correct user until we run tmux as that user. | 8471 | // But we wont be the correct user until we run tmux as that user. |
8486 | // The path to sledjchisl.socket needs to be readable by the www-data group. So the FCGI socket will work. | 8472 | // The path to the web socket needs to be readable by the www-data group. So the FCGI socket will work. |
8487 | // AND it needs to be group sticky on opensimsc group. So the tmux socket will work. | 8473 | // AND it needs to be group sticky on opensimsc group. So the tmux socket will work. |
8488 | // Put both in scRun, and make it other readable? | 8474 | // Put both in scRun, and make it other readable? |
8489 | // TODO - No idea of the SECURITY HOLE that might cause. | 8475 | // TODO - No idea of the SECURITY HOLE that might cause. |
@@ -8570,7 +8556,7 @@ Copy correct config/config.ini to there. | |||
8570 | // Make the FCGI socket world read / write, coz we can't set it to group www-data, since -G only works for root, and we ain't root. | 8556 | // Make the FCGI socket world read / write, coz we can't set it to group www-data, since -G only works for root, and we ain't root. |
8571 | // TODO - BIG SECURITY HOLE??? | 8557 | // TODO - BIG SECURITY HOLE??? |
8572 | "bash -c 'export PATH=%s:$PATH; printf \"\\033]0;FCGI web server\\007\"; sleep 2;" // The sleep is so that both are not creating the .shini files at the same time. | 8558 | "bash -c 'export PATH=%s:$PATH; printf \"\\033]0;FCGI web server\\007\"; sleep 2;" // The sleep is so that both are not creating the .shini files at the same time. |
8573 | "spawn-fcgi -n -u %s -s %s/sledjchisl.socket -M 0666 -G www-data -- /usr/bin/valgrind --leak-check=full %s/current/bin/sledjchisl %s; " | 8559 | "spawn-fcgi -n -u %s -s %s/%s -M 0666 -G www-data -- /usr/bin/valgrind --leak-check=full %s/current/bin/sledjchisl %s; " |
8574 | "cd %s; bash'" | 8560 | "cd %s; bash'" |
8575 | , | 8561 | , |
8576 | pre, Tcmd, scRun, Tsocket, scBin, | 8562 | pre, Tcmd, scRun, Tsocket, scBin, |
@@ -8580,7 +8566,7 @@ Copy correct config/config.ini to there. | |||
8580 | Tconsole, | 8566 | Tconsole, |
8581 | Tconsole, | 8567 | Tconsole, |
8582 | scBin, | 8568 | scBin, |
8583 | scUser, scRun, scRoot, FLAG(v) ? "-v" : "", | 8569 | scUser, scRun, webSocket, scRoot, FLAG(v) ? "-v" : "", |
8584 | scRoot | 8570 | scRoot |
8585 | ); | 8571 | ); |
8586 | free(pre); | 8572 | free(pre); |
@@ -8638,31 +8624,36 @@ Copy correct config/config.ini to there. | |||
8638 | and by a privileged process | 8624 | and by a privileged process |
8639 | */ | 8625 | */ |
8640 | V("Making directories in %s.", scRoot); | 8626 | V("Making directories in %s.", scRoot); |
8641 | if ((! qfile_exist(scBin)) && (! qfile_mkdir(scBin, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scBin); | 8627 | if ((! qfile_exist(scBin)) && (! qfile_mkdir(scBin, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scBin); |
8642 | if ((! qfile_exist(scEtc)) && (! qfile_mkdir(scEtc, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scEtc); | 8628 | if ((! qfile_exist(scEtc)) && (! qfile_mkdir(scEtc, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scEtc); |
8643 | if ((! qfile_exist(scLib)) && (! qfile_mkdir(scLib, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scLib); | 8629 | if ((! qfile_exist(scLib)) && (! qfile_mkdir(scLib, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scLib); |
8644 | if ((! qfile_exist(scBackup)) && (! qfile_mkdir(scBackup, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scBackup); | 8630 | if ((! qfile_exist(scBackup)) && (! qfile_mkdir(scBackup, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scBackup); |
8645 | if ((! qfile_exist(scCache)) && (! qfile_mkdir(scCache, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scCache); | 8631 | if ((! qfile_exist(scCache)) && (! qfile_mkdir(scCache, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scCache); |
8646 | if ((! qfile_exist(scData)) && (! qfile_mkdir(scData, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scData); | 8632 | if ((! qfile_exist(scData)) && (! qfile_mkdir(scData, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scData); |
8647 | if ((! qfile_exist(scLog)) && (! qfile_mkdir(scLog, S_IRWXU, true))) C("Unable to create path %s", scLog); | 8633 | if ((! qfile_exist(scLog)) && (! qfile_mkdir(scLog, S_IRWXU, true))) C("Unable to create path %s", scLog); |
8648 | if ((! qfile_exist(scTemp)) && (! qfile_mkdir(scTemp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scTemp); | 8634 | if ((! qfile_exist(scTemp)) && (! qfile_mkdir(scTemp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", scTemp); |
8649 | tmp = xmprintf("%s/sessions", scCache); | 8635 | tmp = xmprintf("%s/sessions", scCache); |
8650 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); | 8636 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); |
8651 | free(tmp); | 8637 | free(tmp); |
8652 | tmp = xmprintf("%s/users", scData); | 8638 | tmp = xmprintf("%s/users", scData); |
8653 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); | 8639 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); |
8654 | free(tmp); | 8640 | free(tmp); |
8655 | tmp = xmprintf("%s/db", scData); | 8641 | tmp = xmprintf("%s/db", scData); |
8656 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); | 8642 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); |
8657 | free(tmp); | 8643 | free(tmp); |
8658 | tmp = xmprintf("%s/config", scRoot); | 8644 | tmp = xmprintf("%s/config", scRoot); |
8659 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); | 8645 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); |
8660 | free(tmp); | 8646 | free(tmp); |
8661 | tmp = xmprintf("%s/AssetFiles/data", scRoot); | 8647 | tmp = xmprintf("%s/AssetFiles/data", scRoot); |
8662 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); | 8648 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); |
8663 | free(tmp); | 8649 | free(tmp); |
8664 | tmp = xmprintf("%s/web", scRoot); | 8650 | tmp = xmprintf("%s/var/www/html", scRoot); |
8665 | if ((! qfile_exist(tmp)) && (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", tmp); | 8651 | if (! qfile_exist(tmp)) |
8652 | { | ||
8653 | if (! qfile_mkdir(tmp, S_IRWXU | S_IRGRP | S_IXGRP, true)) C("Unable to create path %s", tmp); | ||
8654 | free(tmp); | ||
8655 | if (shellMeFail("cp %s/current/example/var/www/html/* %s/var/www/html", scRoot, scRoot)) C("Unable to copy files to %s/var/www/html", scRoot); | ||
8656 | } | ||
8666 | free(tmp); | 8657 | free(tmp); |
8667 | 8658 | ||
8668 | /* TODO - tighten up security. | 8659 | /* TODO - tighten up security. |
@@ -9004,7 +8995,7 @@ Create the /opt/opensim-SC directory structure. | |||
9004 | 8995 | ||
9005 | // FCGI_LISTENSOCK_FILENO is the socket to the web server. | 8996 | // FCGI_LISTENSOCK_FILENO is the socket to the web server. |
9006 | // STDOUT and STDERR go to the web servers error log, or at least it does in Apache 2 mod_fcgid. | 8997 | // STDOUT and STDERR go to the web servers error log, or at least it does in Apache 2 mod_fcgid. |
9007 | I("Running SledjChisl inside a web server, pid %d, socket %s/sledjchisl.socket.", getpid(), scRun); | 8998 | I("Running SledjChisl inside a web server, pid %d, socket %s/%s.", getpid(), scRun, webSocket); |
9008 | 8999 | ||
9009 | if (0 == toys.optc) | 9000 | if (0 == toys.optc) |
9010 | D("no args"); | 9001 | D("no args"); |
@@ -9144,7 +9135,7 @@ t("BODY"); | |||
9144 | free(Body); | 9135 | free(Body); |
9145 | santize(Rd->body); | 9136 | santize(Rd->body); |
9146 | 9137 | ||
9147 | D("%s %s://%s%s -> %s%s", Rd->Method, Rd->Scheme, Rd->Host, Rd->RUri, webRoot, Rd->Path); | 9138 | D("%s %s://%s%s -> %s%s%s", Rd->Method, Rd->Scheme, Rd->Host, Rd->RUri, scRoot, webRoot, Rd->Path); |
9148 | D("Started FCGI web request ROLE = %s, body is %s bytes, pid %d.", Role, Length, getpid()); | 9139 | D("Started FCGI web request ROLE = %s, body is %s bytes, pid %d.", Role, Length, getpid()); |
9149 | 9140 | ||
9150 | if (NULL == Rd->Path) | 9141 | if (NULL == Rd->Path) |
@@ -9208,7 +9199,7 @@ t("BODY"); | |||
9208 | } | 9199 | } |
9209 | 9200 | ||
9210 | memset(toybuf, 0, sizeof(toybuf)); | 9201 | memset(toybuf, 0, sizeof(toybuf)); |
9211 | snprintf(toybuf, sizeof(toybuf), "%s%s", webRoot, Rd->Path); | 9202 | snprintf(toybuf, sizeof(toybuf), "%s%s%s", scRoot, webRoot, Rd->Path); |
9212 | HTMLfile *thisFile = checkHTMLcache(toybuf); | 9203 | HTMLfile *thisFile = checkHTMLcache(toybuf); |
9213 | if (NULL == thisFile) | 9204 | if (NULL == thisFile) |
9214 | { | 9205 | { |
@@ -9335,7 +9326,7 @@ sendReply: | |||
9335 | 9326 | ||
9336 | fcgiDone: | 9327 | fcgiDone: |
9337 | FCGI_Finish(); | 9328 | FCGI_Finish(); |
9338 | snprintf(toybuf, sizeof(toybuf), " for %s %s://%s%s -> %s%s", Rd->Method, Rd->Scheme, Rd->Host, Rd->RUri, webRoot, Rd->Path); | 9329 | snprintf(toybuf, sizeof(toybuf), " for %s %s://%s%s -> %s%s%s", Rd->Method, Rd->Scheme, Rd->Host, Rd->RUri, scRoot, webRoot, Rd->Path); |
9339 | if (NULL != Rd->outQuery) free(Rd->outQuery); | 9330 | if (NULL != Rd->outQuery) free(Rd->outQuery); |
9340 | if (NULL != Rd->shs.name) free(Rd->shs.name); | 9331 | if (NULL != Rd->shs.name) free(Rd->shs.name); |
9341 | Rd->shs.name = NULL; | 9332 | Rd->shs.name = NULL; |