small fixes:
* --unsafe by default if not --rw
* fix inspector
s-ol
3 years ago
35 | 35 |
@flags.rw = opts.host == 'localhost' or opts.host == '127.0.0.1'
|
36 | 36 |
|
37 | 37 |
if @flags.unsafe == nil
|
38 | |
@flags.unsafe = opts.host == 'localhost' or opts.host == '127.0.0.1'
|
|
38 |
@flags.unsafe = not @flags.rw or opts.host == 'localhost' or opts.host == '127.0.0.1'
|
39 | 39 |
|
40 | 40 |
export UNSAFE
|
41 | 41 |
UNSAFE = @flags.unsafe
|
|
172 | 172 |
-- moon server.moon [FLAGS] [STORE] [host] [port]
|
173 | 173 |
-- * FLAGS - any of the following:
|
174 | 174 |
-- --[no-]rw - enable/disable POST?PUT/DELETE operations (default: on if local)
|
175 | |
-- --[no-]unsafe - enable/disable server-side code execution when writable is on (default: on if local)
|
|
175 |
-- --[no-]unsafe - enable/disable server-side code execution when writable is on (default: on if local or --no-rw)
|
176 | 176 |
-- * STORE - see mmm/mmmfs/stores/init.moon:get_store
|
177 | 177 |
-- * host - interface to bind to (default localhost, set to 0.0.0.0 for public hosting)
|
178 | 178 |
-- * port - port to serve from, default 8000
|
237 | 237 |
value, key = @get prop
|
238 | 238 |
assert key, "couldn't @get #{prop}"
|
239 | 239 |
|
240 | |
conversions = get_conversions 'mmm/dom', key.type, get_casts
|
|
240 |
conversions = get_conversions 'mmm/dom', key.type, get_casts!
|
241 | 241 |
assert conversions, "cannot cast '#{key.type}'"
|
242 | 242 |
apply_conversions conversions, value, @, prop
|
243 | 243 |
|
1 | 1 |
|
2 | 2 |
export ^
|
3 | 3 |
PLUGINS = require '.plugins'
|
|
4 |
print "PLUGINS = ", PLUGINS
|