copious-mail 0.0.0-stage → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +504 -0
- package/README.md +143 -2
- package/bin/index.js +345 -0
- package/client/copiousLogo.svg +123 -0
- package/client/hosted.html +5259 -0
- package/client/mail_styles.css +40 -0
- package/client/mikado.bundle.debug.js +1406 -0
- package/client/mikado.bundle.min.js +68 -0
- package/client/mikado.bundle.module.debug.js +1401 -0
- package/client/mikado.bundle.module.min.js +67 -0
- package/client/mikado.bundle.profiler.debug.js +1490 -0
- package/client/mikado.es5.debug.js +1995 -0
- package/client/mikado.es5.min.js +85 -0
- package/client/mikado.light.debug.js +535 -0
- package/client/mikado.light.min.js +29 -0
- package/client/mikado.light.module.debug.js +530 -0
- package/data/user_list.db +14 -0
- package/index.html +7242 -0
- package/index.js +5 -0
- package/jsconfig.json +32 -0
- package/lib/mail_repo_bridge_ops.js +1177 -0
- package/lib/utils.js +70 -0
- package/lib/websocket_con.js +249 -0
- package/mail_bridge.conf +10 -0
- package/package.json +41 -5
- package/svelte-src/App.svelte +2513 -0
- package/svelte-src/ContactGrid.svelte +98 -0
- package/svelte-src/FloatWindow.svelte +181 -0
- package/svelte-src/MessageDisplay.svelte +230 -0
- package/svelte-src/MessageEditor.svelte +664 -0
- package/svelte-src/MessageListEditor.svelte +133 -0
- package/svelte-src/Thing.svelte +190 -0
- package/svelte-src/ThingFull.svelte +117 -0
- package/svelte-src/ipfs_profile_proxy.js +923 -0
- package/svelte-src/main.js +10 -0
- package/svelte-src/search_box.js +69 -0
- package/svelte-src/utilities.js +180 -0
- package/test/c +28 -0
- package/test/copiousLogo.svg +123 -0
- package/test/index.html +4408 -0
- package/test/index.js +244 -0
- package/test/mail_styles.css +40 -0
- package/test/mikado.bundle.debug.js +1406 -0
- package/test/mikado.bundle.min.js +68 -0
- package/test/mikado.bundle.module.debug.js +1401 -0
- package/test/mikado.bundle.module.min.js +67 -0
- package/test/mikado.bundle.profiler.debug.js +1490 -0
- package/test/mikado.es5.debug.js +1995 -0
- package/test/mikado.es5.min.js +85 -0
- package/test/mikado.light.debug.js +535 -0
- package/test/mikado.light.min.js +29 -0
- package/test/mikado.light.module.debug.js +530 -0
- package/test/tpl/partial/attachment_edit.es5.js +1 -0
- package/test/tpl/partial/attachment_edit.html +5 -0
- package/test/tpl/partial/attachment_edit.js +1 -0
- package/test/tpl/partial/attachment_view.es5.js +1 -0
- package/test/tpl/partial/attachment_view.html +1 -0
- package/test/tpl/partial/attachment_view.js +1 -0
- package/test/tpl/partial/contact_list.es5.js +1 -0
- package/test/tpl/partial/contact_list.html +9 -0
- package/test/tpl/partial/contact_list.js +1 -0
- package/test/tpl/partial/draft_list.es5.js +1 -0
- package/test/tpl/partial/draft_list.html +8 -0
- package/test/tpl/partial/draft_list.js +1 -0
- package/test/tpl/partial/inbox_list.es5.js +1 -0
- package/test/tpl/partial/inbox_list.html +7 -0
- package/test/tpl/partial/inbox_list.js +1 -0
- package/test/tpl/partial/notify_list.es5.js +1 -0
- package/test/tpl/partial/notify_list.html +8 -0
- package/test/tpl/partial/notify_list.js +1 -0
- package/test/tpl/partial/sent_list.es5.js +1 -0
- package/test/tpl/partial/sent_list.html +7 -0
- package/test/tpl/partial/sent_list.js +1 -0
- package/test/tpl/partial/spam_list.es5.js +1 -0
- package/test/tpl/partial/spam_list.html +8 -0
- package/test/tpl/partial/spam_list.js +1 -0
- package/test/tpl/partial/trash_list.es5.js +1 -0
- package/test/tpl/partial/trash_list.html +7 -0
- package/test/tpl/partial/trash_list.js +1 -0
- package/test/tpl/partial/user.es5.js +1 -0
- package/test/tpl/partial/user.html +18 -0
- package/test/tpl/partial/user.js +1 -0
- package/tools/jsdoc.conf +47 -0
- package/tools/templates/docdash/publish.js +843 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/tools/templates/docdash/static/scripts/collapse.js +67 -0
- package/tools/templates/docdash/static/scripts/commonNav.js +28 -0
- package/tools/templates/docdash/static/scripts/linenumber.js +25 -0
- package/tools/templates/docdash/static/scripts/nav.js +12 -0
- package/tools/templates/docdash/static/scripts/polyfill.js +4 -0
- package/tools/templates/docdash/static/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/tools/templates/docdash/static/scripts/prettify/lang-css.js +2 -0
- package/tools/templates/docdash/static/scripts/prettify/prettify.js +28 -0
- package/tools/templates/docdash/static/scripts/search.js +99 -0
- package/tools/templates/docdash/static/styles/jsdoc.css +803 -0
- package/tools/templates/docdash/static/styles/prettify.css +80 -0
- package/tools/templates/docdash/tmpl/augments.tmpl +10 -0
- package/tools/templates/docdash/tmpl/container.tmpl +203 -0
- package/tools/templates/docdash/tmpl/details.tmpl +152 -0
- package/tools/templates/docdash/tmpl/example.tmpl +2 -0
- package/tools/templates/docdash/tmpl/examples.tmpl +13 -0
- package/tools/templates/docdash/tmpl/exceptions.tmpl +32 -0
- package/tools/templates/docdash/tmpl/layout.tmpl +102 -0
- package/tools/templates/docdash/tmpl/mainpage.tmpl +15 -0
- package/tools/templates/docdash/tmpl/members.tmpl +38 -0
- package/tools/templates/docdash/tmpl/method.tmpl +132 -0
- package/tools/templates/docdash/tmpl/modifies.tmpl +14 -0
- package/tools/templates/docdash/tmpl/namespace.tmpl +133 -0
- package/tools/templates/docdash/tmpl/params.tmpl +132 -0
- package/tools/templates/docdash/tmpl/properties.tmpl +107 -0
- package/tools/templates/docdash/tmpl/returns.tmpl +19 -0
- package/tools/templates/docdash/tmpl/source.tmpl +8 -0
- package/tools/templates/docdash/tmpl/tutorial.tmpl +19 -0
- package/tools/templates/docdash/tmpl/type.tmpl +26 -0
- package/tools/templates/templates/docdash/publish.js +843 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/tools/templates/templates/docdash/static/scripts/collapse.js +67 -0
- package/tools/templates/templates/docdash/static/scripts/commonNav.js +28 -0
- package/tools/templates/templates/docdash/static/scripts/linenumber.js +25 -0
- package/tools/templates/templates/docdash/static/scripts/nav.js +12 -0
- package/tools/templates/templates/docdash/static/scripts/polyfill.js +4 -0
- package/tools/templates/templates/docdash/static/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/tools/templates/templates/docdash/static/scripts/prettify/lang-css.js +2 -0
- package/tools/templates/templates/docdash/static/scripts/prettify/prettify.js +28 -0
- package/tools/templates/templates/docdash/static/scripts/search.js +99 -0
- package/tools/templates/templates/docdash/static/styles/jsdoc.css +803 -0
- package/tools/templates/templates/docdash/static/styles/prettify.css +80 -0
- package/tools/templates/templates/docdash/tmpl/augments.tmpl +10 -0
- package/tools/templates/templates/docdash/tmpl/container.tmpl +203 -0
- package/tools/templates/templates/docdash/tmpl/details.tmpl +152 -0
- package/tools/templates/templates/docdash/tmpl/example.tmpl +2 -0
- package/tools/templates/templates/docdash/tmpl/examples.tmpl +13 -0
- package/tools/templates/templates/docdash/tmpl/exceptions.tmpl +32 -0
- package/tools/templates/templates/docdash/tmpl/layout.tmpl +102 -0
- package/tools/templates/templates/docdash/tmpl/mainpage.tmpl +15 -0
- package/tools/templates/templates/docdash/tmpl/members.tmpl +38 -0
- package/tools/templates/templates/docdash/tmpl/method.tmpl +132 -0
- package/tools/templates/templates/docdash/tmpl/modifies.tmpl +14 -0
- package/tools/templates/templates/docdash/tmpl/namespace.tmpl +133 -0
- package/tools/templates/templates/docdash/tmpl/params.tmpl +132 -0
- package/tools/templates/templates/docdash/tmpl/properties.tmpl +107 -0
- package/tools/templates/templates/docdash/tmpl/returns.tmpl +19 -0
- package/tools/templates/templates/docdash/tmpl/source.tmpl +8 -0
- package/tools/templates/templates/docdash/tmpl/tutorial.tmpl +19 -0
- package/tools/templates/templates/docdash/tmpl/type.tmpl +26 -0
- package/tpl/partial/user.es5.js +1 -0
- package/tpl/partial/user.html +10 -0
- package/tpl/partial/user.js +1 -0
package/bin/index.js
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const polka = require('polka');
|
|
3
|
+
const send = require('@polka/send-type');
|
|
4
|
+
const app = polka();
|
|
5
|
+
//
|
|
6
|
+
const { json } = require('body-parser');
|
|
7
|
+
const cors = require('cors')
|
|
8
|
+
|
|
9
|
+
app.use(json())
|
|
10
|
+
|
|
11
|
+
// let corsOptions = {
|
|
12
|
+
// origin: 'http://localhost:*',
|
|
13
|
+
// optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204
|
|
14
|
+
// }
|
|
15
|
+
app.use(cors())
|
|
16
|
+
//
|
|
17
|
+
const fs = require('fs')
|
|
18
|
+
const http = require('http')
|
|
19
|
+
|
|
20
|
+
const WebSocket = require('ws')
|
|
21
|
+
const WebSocketServer = WebSocket.Server;
|
|
22
|
+
|
|
23
|
+
const RepoBridgeOps = require('../lib/mail_repo_bridge_ops')
|
|
24
|
+
const WebSocketActions = require('../lib/websocket_con')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// g_repo_bridge_ops
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
TERMINAL ... set it up...
|
|
31
|
+
|
|
32
|
+
// need frame for : ssh richard@76.229.181.242 -L 8080:localhost:8080 -N
|
|
33
|
+
// goes to ttyd ... pick a good port (consider using some keys, etc.)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
// This process becomes the forever process manager for processes launched off of a very private web service.
|
|
39
|
+
//
|
|
40
|
+
|
|
41
|
+
// For each type of shared table launched, this process maintains a list of interface types that may be configured
|
|
42
|
+
// for processes that it launches. Also, can launch other DB management processes.
|
|
43
|
+
// When this launches a processes, it can check that the configuration of the process has an interface conforming
|
|
44
|
+
// to the types of DB managers that this has launched.
|
|
45
|
+
|
|
46
|
+
// Principle going forward: Every single application process can attach to a DB/Shared Mem table, while every DB or table
|
|
47
|
+
// is a standalone manager that provides lifecycle for the shared object.
|
|
48
|
+
|
|
49
|
+
// This proces, the copious-transions-manager, manages the DB lifecycle processes and spawns applications configured to attach
|
|
50
|
+
// to the share objects.
|
|
51
|
+
|
|
52
|
+
//
|
|
53
|
+
class WSConsole extends console.Console {
|
|
54
|
+
constructor(fn,out,err) {
|
|
55
|
+
super(out,err)
|
|
56
|
+
this.log_custom = fn
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
log(...args) {
|
|
60
|
+
super.log(...args)
|
|
61
|
+
this.log_custom(args)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let save_console = false
|
|
66
|
+
function setup_console(fn) {
|
|
67
|
+
save_console = console
|
|
68
|
+
//
|
|
69
|
+
let custom_console = new WSConsole(fn,process.stdout,process.stderr)
|
|
70
|
+
console = custom_console
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
let g_ws_socks = false
|
|
75
|
+
let g_config = false
|
|
76
|
+
let g_user_list = false
|
|
77
|
+
//
|
|
78
|
+
// let g_descriptions = false
|
|
79
|
+
|
|
80
|
+
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
// LOAD CONFIGURATION ... if this crashes, that's fine
|
|
84
|
+
try {
|
|
85
|
+
let conf_str = fs.readFileSync("mail_bridge.conf").toString()
|
|
86
|
+
g_config = JSON.parse(conf_str)
|
|
87
|
+
} catch (e) {
|
|
88
|
+
console.log("THERE NEEDS TO BE A PROPERLY JSON-FORMATTED CONFIGURATION FILE, mail_bridge.conf IN YOUR WORKING DIRECTORY")
|
|
89
|
+
process.exit(0)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// LOAD CONFIGURATION ... if this crashes, that's fine
|
|
93
|
+
try {
|
|
94
|
+
let user_list_str = fs.readFileSync("data/user_list.db").toString()
|
|
95
|
+
g_user_list = JSON.parse(user_list_str)
|
|
96
|
+
} catch (e) {
|
|
97
|
+
console.log("THERE NEEDS TO BE A PROPERLY JSON-FORMATTED USER DB FILE, data/user_list.db IN YOUR DATA DIRECTORY")
|
|
98
|
+
process.exit(0)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* write_out_config
|
|
105
|
+
* update the configuration file with operational changes...
|
|
106
|
+
* for example, this method is added to handle the case of ignoring directories, which in turn have .gitignore inside them.
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
109
|
+
function write_out_config() {
|
|
110
|
+
if ( typeof g_config === 'object' ) {
|
|
111
|
+
try {
|
|
112
|
+
console.log("write_out_config")
|
|
113
|
+
let conf_output_str = JSON.stringify(g_config,null,2)
|
|
114
|
+
fs.writeFileSync("manager.conf",conf_output_str)
|
|
115
|
+
} catch (e) {}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
console.dir(g_config)
|
|
120
|
+
|
|
121
|
+
//
|
|
122
|
+
// -------- -------- -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
|
|
123
|
+
//
|
|
124
|
+
const MANAGER_PORT = g_config.web_page_port
|
|
125
|
+
|
|
126
|
+
let g_proc_managers = {}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
let g_system_coms = false
|
|
130
|
+
let g_all_procs = false
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
let g_repo_bridge_ops = new RepoBridgeOps(g_config.repo_bridge,g_user_list,g_system_coms)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
//g_repo_ops.test()
|
|
137
|
+
|
|
138
|
+
console.log(__dirname)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
app.get('/', async (req, res) => {
|
|
142
|
+
let obj = {
|
|
143
|
+
"file": "index.html"
|
|
144
|
+
}
|
|
145
|
+
let status = await g_repo_bridge_ops.get_app_file(obj)
|
|
146
|
+
//
|
|
147
|
+
if ( status ) {
|
|
148
|
+
let page = obj.data.toString()
|
|
149
|
+
res.end(page);
|
|
150
|
+
} else {
|
|
151
|
+
send(res,404,"root: could not load the requested file")
|
|
152
|
+
}
|
|
153
|
+
//
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
app.get('/:file', async (req, res) => {
|
|
159
|
+
let file = ""
|
|
160
|
+
let obj = {
|
|
161
|
+
"file": req.params.file
|
|
162
|
+
}
|
|
163
|
+
let status = await g_repo_bridge_ops.get_app_file(obj)
|
|
164
|
+
if ( status ) {
|
|
165
|
+
let page = obj.data.toString()
|
|
166
|
+
res.end(page);
|
|
167
|
+
} else {
|
|
168
|
+
send(res,404,"could not load the requested file: " + file)
|
|
169
|
+
}
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
// not accessible by nginx (i.e. must be on the machine in ssh ... use wget)
|
|
174
|
+
|
|
175
|
+
app.get('assets/:file', async (req, res) => {
|
|
176
|
+
let obj = {
|
|
177
|
+
"file": req.params.file
|
|
178
|
+
}
|
|
179
|
+
let status = await g_repo_bridge_ops.get_asset_file(obj)
|
|
180
|
+
if ( status ) {
|
|
181
|
+
let page = obj.data.toString()
|
|
182
|
+
res.end(page);
|
|
183
|
+
} else {
|
|
184
|
+
send(res,404,"could not load the requested file: " + obj.file)
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
//
|
|
190
|
+
let mail_proto = {
|
|
191
|
+
"id" : 1,
|
|
192
|
+
"sender" : "richard@myhost.local",
|
|
193
|
+
"subject" : "",
|
|
194
|
+
"date" : "", // date.toLocaleString(),
|
|
195
|
+
"timestamp" : 0, //date.getTime(),
|
|
196
|
+
"recipient" : "",
|
|
197
|
+
"cc" : "",
|
|
198
|
+
"bcc" : "",
|
|
199
|
+
"text" : "edit this message",
|
|
200
|
+
"_count_edits" : 0, "_saved_updates" : []
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
// {
|
|
205
|
+
// "jsonrpc": '2.0',
|
|
206
|
+
// "method": method,
|
|
207
|
+
// "params": params,
|
|
208
|
+
// "id": Date.now() // Unique ID to match responses to requests
|
|
209
|
+
// }
|
|
210
|
+
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
|
211
|
+
|
|
212
|
+
// {
|
|
213
|
+
// "jsonrpc": "2.0",
|
|
214
|
+
// "result": 19,
|
|
215
|
+
// "id": 1
|
|
216
|
+
// }
|
|
217
|
+
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
|
218
|
+
|
|
219
|
+
// {
|
|
220
|
+
// "jsonrpc": "2.0",
|
|
221
|
+
// "error": {
|
|
222
|
+
// "code": -32601,
|
|
223
|
+
// "message": "Method not found"
|
|
224
|
+
// },
|
|
225
|
+
// "id": 1
|
|
226
|
+
// }
|
|
227
|
+
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
//
|
|
231
|
+
app.post('json/email', async (req, res) => {
|
|
232
|
+
//
|
|
233
|
+
if ( g_repo_bridge_ops ) {
|
|
234
|
+
//
|
|
235
|
+
let message = req.body
|
|
236
|
+
if ( message.id !== undefined ) {
|
|
237
|
+
let results = await g_repo_bridge_ops.handle_rpc(message.method,message.params)
|
|
238
|
+
if ( !(results.error) ) {
|
|
239
|
+
send(res,200,{ "status" : "OK", "result" : results.result, "id": message.id, "jsonrpc": "2.0" })
|
|
240
|
+
} else {
|
|
241
|
+
send(res,200,{ "status" : "ERR", "error" : results.error, "id": message.id, "jsonrpc": "2.0" })
|
|
242
|
+
}
|
|
243
|
+
} else {
|
|
244
|
+
let op_ok = g_repo_bridge_ops.handle_rpc_notify(message.method,message.params)
|
|
245
|
+
if ( op_ok ) {
|
|
246
|
+
send(res,200,{ "status" : "OK" })
|
|
247
|
+
} else {
|
|
248
|
+
send(res,200,{ "status" : "ERR" , "error" : { "code" : "-2", "message" : "notify" } })
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
send(res,404,"system not intialized")
|
|
253
|
+
}
|
|
254
|
+
//
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
async function handler_ws_messages(ws,message_body) {
|
|
261
|
+
if ( g_repo_bridge_ops && g_ws_socks ) {
|
|
262
|
+
if ( message_body.op ) {
|
|
263
|
+
let update_message = await g_repo_bridge_ops.ws_handle_user_update_req(message_body)
|
|
264
|
+
if ( update_message ) {
|
|
265
|
+
g_ws_socks.send_ws_extract_id(ws,update_message)
|
|
266
|
+
}
|
|
267
|
+
} else {
|
|
268
|
+
console.dir(message_body)
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
function ws_proc_status() {
|
|
275
|
+
if ( g_repo_bridge_ops && g_ws_socks ) {
|
|
276
|
+
let sendable = g_repo_bridge_ops.sendable_proc_data()
|
|
277
|
+
if ( sendable ) {
|
|
278
|
+
let op_message = {
|
|
279
|
+
"op" : "proc-status",
|
|
280
|
+
"data" : sendable
|
|
281
|
+
}
|
|
282
|
+
g_ws_socks.send_to_going_sessions(op_message)
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
async function ws_data_updates() {
|
|
290
|
+
if ( g_repo_bridge_ops && g_ws_socks ) {
|
|
291
|
+
let op_message = await g_repo_bridge_ops.ws_data_updates()
|
|
292
|
+
if ( op_message ) {
|
|
293
|
+
let sent = g_ws_socks.send_to_going_sessions(op_message)
|
|
294
|
+
g_repo_bridge_ops.update_messages_sent(sent)
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
function ws_console_log(data) {
|
|
301
|
+
if ( g_repo_bridge_ops && g_ws_socks ) {
|
|
302
|
+
let op_message = {
|
|
303
|
+
"op" : "console-output",
|
|
304
|
+
"data" : data
|
|
305
|
+
}
|
|
306
|
+
g_ws_socks.send_to_going_sessions(op_message)
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
// ------------- ------------- ------------- ------------- ------------- ------------- ------------- -------------
|
|
312
|
+
if ( g_config.wss_app_port ) { // WEB APP SCOCKETS OPTION (START)
|
|
313
|
+
// ------------- ------------- ------------- ------------- ------------- ------------- ------------- -------------
|
|
314
|
+
|
|
315
|
+
g_ws_socks = new WebSocketActions()
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
let app_server = http.createServer(app);
|
|
319
|
+
const g_app_wss = new WebSocketServer({server: app_server});
|
|
320
|
+
g_ws_socks.set_socket_server(g_app_wss,handler_ws_messages)
|
|
321
|
+
//
|
|
322
|
+
|
|
323
|
+
app_server.listen(g_config.wss_app_port);
|
|
324
|
+
//
|
|
325
|
+
|
|
326
|
+
setInterval(() => { ws_proc_status() },5000)
|
|
327
|
+
|
|
328
|
+
setInterval(() => { ws_data_updates() },5000)
|
|
329
|
+
|
|
330
|
+
setup_console(ws_console_log)
|
|
331
|
+
|
|
332
|
+
// ------------- ------------- ------------- ------------- ------------- ------------- ------------- -------------
|
|
333
|
+
} // WEB APP SCOCKETS OPTION (END)
|
|
334
|
+
// ------------- ------------- ------------- ------------- ------------- ------------- ------------- -------------
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
//
|
|
338
|
+
//
|
|
339
|
+
//
|
|
340
|
+
|
|
341
|
+
// ---- ---- ---- ---- ----
|
|
342
|
+
//g_all_procs.initialize_children()
|
|
343
|
+
// ---- ---- ---- ---- ----
|
|
344
|
+
app.listen(MANAGER_PORT)
|
|
345
|
+
console.log(`listening on port ${MANAGER_PORT}`)
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
4
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
5
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
6
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
9
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
10
|
+
version="1.0"
|
|
11
|
+
width="60"
|
|
12
|
+
height="60"
|
|
13
|
+
viewBox="0 0 250 250"
|
|
14
|
+
preserveAspectRatio="xMidYMid meet"
|
|
15
|
+
id="logo"
|
|
16
|
+
sodipodi:docname="copiousLogo.svg"
|
|
17
|
+
inkscape:version="1.0 (4035a4f, 2020-05-01)">
|
|
18
|
+
<metadata
|
|
19
|
+
id="metadata22">
|
|
20
|
+
<rdf:RDF>
|
|
21
|
+
<cc:Work
|
|
22
|
+
rdf:about="">
|
|
23
|
+
<dc:format>image/svg+xml</dc:format>
|
|
24
|
+
<dc:type
|
|
25
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
26
|
+
</cc:Work>
|
|
27
|
+
</rdf:RDF>
|
|
28
|
+
</metadata>
|
|
29
|
+
<sodipodi:namedview
|
|
30
|
+
inkscape:document-rotation="0"
|
|
31
|
+
pagecolor="#ffffff"
|
|
32
|
+
bordercolor="#666666"
|
|
33
|
+
borderopacity="1"
|
|
34
|
+
objecttolerance="10"
|
|
35
|
+
gridtolerance="10"
|
|
36
|
+
guidetolerance="10"
|
|
37
|
+
inkscape:pageopacity="0"
|
|
38
|
+
inkscape:pageshadow="2"
|
|
39
|
+
inkscape:window-width="1438"
|
|
40
|
+
inkscape:window-height="789"
|
|
41
|
+
id="namedview20"
|
|
42
|
+
showgrid="false"
|
|
43
|
+
inkscape:zoom="2.9110629"
|
|
44
|
+
inkscape:cx="21.990779"
|
|
45
|
+
inkscape:cy="30.09836"
|
|
46
|
+
inkscape:window-x="0"
|
|
47
|
+
inkscape:window-y="25"
|
|
48
|
+
inkscape:window-maximized="0"
|
|
49
|
+
inkscape:current-layer="logo" />
|
|
50
|
+
<defs
|
|
51
|
+
id="defs10">
|
|
52
|
+
<filter
|
|
53
|
+
height="1.0367442"
|
|
54
|
+
y="-0.018372124"
|
|
55
|
+
width="1.009288"
|
|
56
|
+
x="-0.0046440168"
|
|
57
|
+
id="filter3670"
|
|
58
|
+
style="color-interpolation-filters:sRGB"
|
|
59
|
+
inkscape:collect="always">
|
|
60
|
+
<feGaussianBlur
|
|
61
|
+
id="feGaussianBlur3672"
|
|
62
|
+
stdDeviation="0.243814"
|
|
63
|
+
inkscape:collect="always" />
|
|
64
|
+
</filter>
|
|
65
|
+
</defs>
|
|
66
|
+
<path
|
|
67
|
+
class="PhIOtjDr_0"
|
|
68
|
+
id="path6"
|
|
69
|
+
d="m 30.107062,6.6325142 c 4.67725,2.6985208 8.37554,8.6930958 12.94402,20.5087688 7.17904,19.072767 24.58277,67.337762 29.69511,82.950637 l 5.32989,15.9502 -13.70543,-0.25058 -10.468161,2.57106 -8.132079,2.99946 -4.78602,5.90784 0.76141,-6.91979 c 0.65264,-6.50536 0.32632,-7.85462 -5.43866,-25.31791 C 27.822822,79.714275 20.535012,59.292246 12.703332,39.381008 5.4155222,20.896131 4.4365622,14.737717 7.8085322,9.668351 11.941922,3.596677 22.384152,2.1606775 30.107062,6.6325142 Z M 238.08162,21.908076 c 3.69828,2.110631 6.52639,6.669206 6.52639,10.379672 0,1.686578 -2.93688,12.740881 -6.63517,24.469814 -19.68797,64.138098 -30.34775,107.931248 -30.34775,124.806658 0,4.6453 -1.08775,7.68113 -18.60024,50.80931 l -4.35093,10.79409 H 116.90815 49.142392 l -14.35808,-35.35063 -14.35808,-35.3603 17.62128,-20.75934 17.5125,-20.75935 h 29.36879 c 32.631998,0 5.455822,5.28877 29.390108,7.16797 -3.81133,6.98972 7.16732,11.29772 7.16732,11.29772 l 2.51778,3.43975 c -1.74038,3.20932 -4.92039,6.69891 -9.3801,9.5709 l -3.2632,2.11064 -9.78959,-2.62144 c -8.593088,-2.27446 -11.312428,-2.61179 -22.080978,-2.61179 -13.0528,-0.0964 -14.35808,0.2506 -14.35808,4.29837 0,2.70817 3.15443,3.63336 12.72648,3.63336 21.42834,0 38.723308,8.01847 47.533928,22.10863 3.58951,5.73436 7.17904,15.86345 7.17904,20.50876 0,2.86236 4.45971,5.05973 7.50536,3.79721 2.82811,-1.09868 2.93687,-4.64531 0.65264,-14.01306 -2.28424,-9.36772 -7.83169,-17.88734 -15.77214,-24.29632 -5.32988,-4.30799 -6.30884,-5.49342 -5.11233,-6.24517 1.19649,-0.76135 2.06669,-0.51077 4.0246,1.08906 6.30885,5.23321 19.03534,7.00654 27.73719,3.88395 5.87377,-2.11064 11.85631,-7.17036 15.11951,-12.74088 1.52281,-2.53468 5.98253,-16.03694 9.89835,-29.9536 10.98611,-38.396114 22.08098,-72.320392 30.13021,-92.66532 5.54744,-14.176879 12.40016,-19.737762 23.16871,-18.812555 2.93688,0.250577 6.63517,1.175785 8.15801,2.023891 z m -126.72091,50.03831 c 2.28424,0.510792 5.76499,2.11063 7.72291,3.633367 5.87375,4.558576 6.20008,7.257098 3.80705,29.278957 -1.1965,10.71701 -1.94404,26.93071 -2.27035,27.1042 -0.32632,0.25057 -8.38942,-6.50868 -17.41761,-6.25812 l -16.533538,0.42407 0.65264,-6.66922 c 0.32632,-3.62372 1.19651,-13.83956 1.84915,-22.619388 0.65264,-9.19425 1.74037,-17.125977 2.50179,-18.561977 3.2632,-5.907835 10.550998,-8.269041 19.687958,-6.331889 z m 48.5129,9.454465 c 2.06668,1.011946 4.56848,3.209314 5.54744,4.89589 1.84914,2.871998 1.84914,4.22126 -0.8702,33.750819 -1.52282,17.04886 -3.37196,32.575 -4.24216,35.02295 -3.15442,8.51961 -9.13695,13.07819 -18.16513,13.67573 -4.78601,0.25056 -6.41762,0 -9.46327,-1.69622 -5.87376,-3.12256 -6.41764,-4.29838 -2.93689,-7.42094 6.20008,-5.744 4.00097,-11.09854 1.92352,-15.89687 0,0 -0.33391,-1.79223 -2.65798,-4.24016 l -2.01123,-1.92782 3.94219,-26.79768 c 1.95792,-22.86997 2.17547,-23.795177 5.11237,-26.667177 4.89478,-4.89589 16.96861,-6.24515 23.82134,-2.698522 z"
|
|
70
|
+
style="fill:none;stroke:#000000;stroke-width:4.58333;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
|
71
|
+
<rect
|
|
72
|
+
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
73
|
+
id="rect847"
|
|
74
|
+
width="120.08196"
|
|
75
|
+
height="26.195833"
|
|
76
|
+
x="59.836067"
|
|
77
|
+
y="173.42897" />
|
|
78
|
+
<rect
|
|
79
|
+
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4.8;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
80
|
+
id="rect4169"
|
|
81
|
+
width="68.005806"
|
|
82
|
+
height="55.413109"
|
|
83
|
+
x="62.964886"
|
|
84
|
+
y="156.54762" />
|
|
85
|
+
<rect
|
|
86
|
+
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.6;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
87
|
+
id="rect4170"
|
|
88
|
+
width="39.957146"
|
|
89
|
+
height="46.691494"
|
|
90
|
+
x="105.05587"
|
|
91
|
+
y="171.49573" />
|
|
92
|
+
<rect
|
|
93
|
+
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
94
|
+
id="rect4172"
|
|
95
|
+
width="134.35677"
|
|
96
|
+
height="7.9790406"
|
|
97
|
+
x="49.16119"
|
|
98
|
+
y="238.0975" />
|
|
99
|
+
<text
|
|
100
|
+
xml:space="preserve"
|
|
101
|
+
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:192.397px;line-height:125%;font-family:'Arial Rounded MT Bold';-inkscape-font-specification:'Arial Rounded MT Bold, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.04401px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
102
|
+
x="-0.5382762"
|
|
103
|
+
y="262.66705"
|
|
104
|
+
id="text4161"
|
|
105
|
+
transform="scale(1.0546662,0.94816729)"><tspan
|
|
106
|
+
id="tspan4163"
|
|
107
|
+
x="-0.5382762"
|
|
108
|
+
y="262.66705"
|
|
109
|
+
style="stroke-width:1.04401px">C</tspan></text>
|
|
110
|
+
<text
|
|
111
|
+
xml:space="preserve"
|
|
112
|
+
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:33.1448px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:1.16166px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter3670)"
|
|
113
|
+
x="65.766365"
|
|
114
|
+
y="182.00562"
|
|
115
|
+
id="text4165"
|
|
116
|
+
transform="matrix(0.94065762,0,0,1.0630861,3.2903225,1.2497213)"><tspan
|
|
117
|
+
id="tspan4167"
|
|
118
|
+
x="65.766365"
|
|
119
|
+
y="182.00562"
|
|
120
|
+
style="stroke-width:1.16166px"><tspan
|
|
121
|
+
id="tspan3628"
|
|
122
|
+
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:44.4444px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;letter-spacing:0.0416667px">O</tspan>pious</tspan></text>
|
|
123
|
+
</svg>
|