diff options
author | onefang | 2020-09-08 21:34:54 +1000 |
---|---|---|
committer | onefang | 2020-09-08 21:34:54 +1000 |
commit | bd58d3012c26d16150f650c389d1136741d3939d (patch) | |
tree | 3d2aec8bfe0a0c9061ddb4814e71aff33b9b8dc8 /src/sledjchisl/README | |
parent | Add the old bash scripts. (diff) | |
download | opensim-SC-bd58d3012c26d16150f650c389d1136741d3939d.zip opensim-SC-bd58d3012c26d16150f650c389d1136741d3939d.tar.gz opensim-SC-bd58d3012c26d16150f650c389d1136741d3939d.tar.bz2 opensim-SC-bd58d3012c26d16150f650c389d1136741d3939d.tar.xz |
Add the SledjChisl stuff.
Diffstat (limited to '')
-rw-r--r-- | src/sledjchisl/README | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/src/sledjchisl/README b/src/sledjchisl/README new file mode 100644 index 0000000..31a4b30 --- /dev/null +++ b/src/sledjchisl/README | |||
@@ -0,0 +1,118 @@ | |||
1 | I'm re-purposing this for SledjHamr https://sledjhamr.org/git/docs/index.html | ||
2 | |||
3 | The general structure of SledjHamr is a bunch of servers talking to each | ||
4 | other via Internet (or just local) connections. One of them is a web | ||
5 | server for assets, world data, and inventory. Actually most of OpenSim | ||
6 | is just a collection of web servers. | ||
7 | |||
8 | Originally I didn't think using a web based world client was a good idea, | ||
9 | however it might be better to have one, for reasons. Now I need a web | ||
10 | management console that can do all the things the current tmux console | ||
11 | can, including OpenSim console and commands. Plus account management for | ||
12 | users. I can also use a web based Jabber / XMPP front end to chat, IM, | ||
13 | and group chatter, which would run in the normal viewers web browser. | ||
14 | This provides a doorway into putting SledjHamr stuff in existing viewers | ||
15 | without needing them to support it. So a web based viewer now makes more | ||
16 | sense, and also means we can get away with not needing a viewer at all. | ||
17 | |||
18 | Toybox itself doesn't include a web server, and I don't think there is | ||
19 | one on the roadmap. So we have to use an external web server, which was | ||
20 | a design goal of SledjHamr in the first place, using existing mature | ||
21 | HTTP infrastructure, coz that's already solved problems for a bunch of | ||
22 | things that plague OS/SL to this day. Clear your cache! Pffft. | ||
23 | |||
24 | So sledjchisl.c will be the "love world server", though initially it just | ||
25 | drives OpenSim_SC in tmux via tmux commands to send keys and read output. | ||
26 | Later it might run opensim_SC directly and use STDIN and STDOUT to do | ||
27 | everything. It'll also provide the text management front end that runs | ||
28 | in the left tmux panel of the first window, which is why it's based on | ||
29 | boxes in the first place. Later still it can take over opensim_SC | ||
30 | functions as I move them out of mono. | ||
31 | |||
32 | We will need a text, web, and GUI version of this management front end. | ||
33 | Hmmm, maybe don't need a GUI version, GUI users can just run a terminal. | ||
34 | |||
35 | After much research, FastCGI / FCGI seems to be the most portable way of | ||
36 | interfacing with existing web servers. FCGI protocol closes STDERR and | ||
37 | STDOUT, and uses STDIN as it's two way communications channel to the web | ||
38 | server, so our FCGI module can't be used as the text management front | ||
39 | end. This is probably a good idea to keep them seperate anyway, for | ||
40 | security, coz the web server is exposed to the world, the console isn't. | ||
41 | |||
42 | Currently sledjchisl.c tests to see if it's running in tmux already, if | ||
43 | it isn't it starts up tmux runs itself into this new tmux, then exits. | ||
44 | So it could also test if it's running from FCGI, and switch to web mode, | ||
45 | then it'll need to find the tmuxed instance to send commands to it. | ||
46 | Either via nails connection, or sending tmux commands via shell. | ||
47 | |||
48 | FCGI has methods of dealing with auth and templates. B-) | ||
49 | |||
50 | So for now I think I'll have the text and web management front ends in | ||
51 | sledjchisl.c, and the love world server as well. I can split them up | ||
52 | later if I need to. | ||
53 | |||
54 | |||
55 | -------------------------------------------------------------------- | ||
56 | |||
57 | How to install it. | ||
58 | ------------------ | ||
59 | |||
60 | It's all still partly written, un-released, and experimental at the | ||
61 | moment. So thes are just rough notes about what is needed. | ||
62 | |||
63 | There are two parts, the OpenSim runner part and the web pages part. The | ||
64 | OpenSim runner part requjires the rest of opensim-SC to be installed, | ||
65 | which is covered by other documents in this source code repo. SO the | ||
66 | below only talks about the web pages part. | ||
67 | |||
68 | So far I have only tried this with Apache 2, but it should work fine with | ||
69 | other web servers that support FCGI. I'm using spawn-fcgi which was | ||
70 | written for lighttpd, and seems to be the proper way to support FCGI in | ||
71 | Nginx as well. | ||
72 | |||
73 | Until I have actually released this, it'll be source code only. So you | ||
74 | need a C development environment to compile all the C source code. | ||
75 | |||
76 | Some of the dependencies are included, like LuaJIT, qLibc, the FCGI SDK, | ||
77 | and toybox. Or at least their source code git ropes are cloned during | ||
78 | the build stage. The other dependencies are the development environments | ||
79 | for MariaDB or MySQL (only tested with MariaDB), OpenSSL, and UUID. And | ||
80 | spawn-fcgi. In a Debian based Linux distro, that could be installed by | ||
81 | something like - | ||
82 | |||
83 | apt install libmariadbclient-dev libssl1.0-dev uuid-dev spawn-fcgi | ||
84 | |||
85 | Once you have all of that, you can run the src/BuildIt.sh script to put | ||
86 | it all together. That script will also actually run the web side of | ||
87 | things. Often during this early development process, that script will | ||
88 | run things under a test tool like valgrind, so you'll probably need that | ||
89 | to. | ||
90 | |||
91 | You'll need to configure your web server to pass web requests onto | ||
92 | sledjchisl. I'll add instructions for other popular web servers later, | ||
93 | but for now, this is what to do with Apache 2. | ||
94 | |||
95 | Load the mod_proxy_fcgi module. Include something like this in your | ||
96 | virtual host definition - | ||
97 | |||
98 | <FilesMatch "\.fcgi$"> | ||
99 | SetHandler "proxy:unix:///opt/opensim_SC/var/cache/sledjchisl.socket|fcgi://localhost/" | ||
100 | </FilesMatch> | ||
101 | |||
102 | Adjust that unix:// path to match if you have installed things elsewhere. | ||
103 | Also make that directory readable by the web server group. | ||
104 | |||
105 | Copy the files in example/www to where eveqer your web servers document | ||
106 | root is. | ||
107 | |||
108 | Note that the account.html dynamic web page redirects to a HTTPS version | ||
109 | of itself, so you'll need HTTPS to be working. | ||
110 | |||
111 | The current web pages will then be available at something like - | ||
112 | |||
113 | http://localhost/sledjchisl.fcgi/loginpage.html | ||
114 | |||
115 | http://localhost/sledjchisl.fcgi/stats.html | ||
116 | |||
117 | https://localhost/sledjchisl.fcgi/account.html | ||
118 | |||