git.s-ol.nu mmm / 2525b6c
small fixes: * --unsafe by default if not --rw * fix inspector s-ol 2 years ago
3 changed file(s) with 4 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
3535 @flags.rw = opts.host == 'localhost' or opts.host == '127.0.0.1'
3636
3737 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'
3939
4040 export UNSAFE
4141 UNSAFE = @flags.unsafe
172172 -- moon server.moon [FLAGS] [STORE] [host] [port]
173173 -- * FLAGS - any of the following:
174174 -- --[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)
176176 -- * STORE - see mmm/mmmfs/stores/init.moon:get_store
177177 -- * host - interface to bind to (default localhost, set to 0.0.0.0 for public hosting)
178178 -- * port - port to serve from, default 8000
237237 value, key = @get prop
238238 assert key, "couldn't @get #{prop}"
239239
240 conversions = get_conversions 'mmm/dom', key.type, get_casts
240 conversions = get_conversions 'mmm/dom', key.type, get_casts!
241241 assert conversions, "cannot cast '#{key.type}'"
242242 apply_conversions conversions, value, @, prop
243243
11
22 export ^
33 PLUGINS = require '.plugins'
4 print "PLUGINS = ", PLUGINS