Compare commits
590 commits
1.0.1
...
tcef-maste
| Author | SHA1 | Date | |
|---|---|---|---|
| 39415808bf | |||
| 9d92ec4f88 | |||
| 2a31435135 | |||
| 8281fa3427 | |||
|
|
ee7af168d6 | ||
|
|
4cbbe65fa3 | ||
|
|
b9457fe141 | ||
|
|
c4cb52abaf | ||
|
|
423dbc5ed9 | ||
|
|
1fdf86dd47 | ||
|
|
5f9a84dfd7 | ||
|
|
564b9e8ead | ||
|
|
df51368d50 | ||
|
|
0f6dd21541 | ||
|
|
8903c765e3 | ||
|
|
266707052c | ||
|
|
3f8bc3666b | ||
|
|
6abe668740 | ||
|
|
7b5f17fbe8 | ||
|
|
8b598fab7c | ||
|
|
cb7aeda4b8 | ||
|
|
181f488263 | ||
|
|
e96e6ee8f7 | ||
|
|
df47bef794 | ||
|
|
3ea653552e | ||
|
|
6063437df0 | ||
|
|
cdc3bbdd5b | ||
|
|
33c68001c2 | ||
|
|
53a7c3be21 | ||
|
|
3d059287ae | ||
|
|
a208eb7ea1 | ||
|
|
c4b2f8cd73 | ||
|
|
f9febb4415 | ||
|
|
f5665a56a8 | ||
|
|
4d7938220b | ||
|
|
829fae4f07 | ||
|
|
e223ddb643 | ||
|
|
dc5e38f8d5 | ||
|
|
ed08563cad | ||
|
|
9a31ab2457 | ||
|
|
f608fc4d28 | ||
|
|
6f683ebaa2 | ||
|
|
8e729a6939 | ||
|
|
ffef42d19a | ||
|
|
3defbb01a2 | ||
|
|
bbdc53bda1 | ||
|
|
8a741dc729 | ||
|
|
15ed7e917a | ||
|
|
759797e412 | ||
|
|
5e6271bb88 | ||
|
|
5429dfbc04 | ||
|
|
9556bf4e60 | ||
|
|
d4be8c7c46 | ||
|
|
cfe6c2f570 | ||
|
|
20359a79e3 | ||
|
|
8780edc832 | ||
|
|
dc0df7cf32 | ||
|
|
bf926514c9 | ||
|
|
47e9c18607 | ||
|
|
5642b106d4 | ||
|
|
5b3d86e6a5 | ||
|
|
b8ab47e867 | ||
|
|
d980a31c05 | ||
|
|
714cc8610a | ||
|
|
a48da85ebe | ||
|
|
1de7e4a7b3 | ||
|
|
eebbdda064 | ||
|
|
d551dea425 | ||
|
|
9dbd97009b | ||
|
|
ec0edf4475 | ||
|
|
5e5ecb69b8 | ||
|
|
e28886e031 | ||
|
|
eefa586007 | ||
|
|
3e5700f648 | ||
|
|
37e42b70f1 | ||
|
|
12bf1ef09d | ||
|
|
783967c0e1 | ||
|
|
b54707f2dc | ||
|
|
b53e5d0e36 | ||
|
|
245619f4e4 | ||
|
|
391b8935be | ||
|
|
d30385b49e | ||
|
|
bea2703f2f | ||
|
|
e36dda74db | ||
|
|
f144c986b7 | ||
|
|
9502ea3604 | ||
|
|
22534ddb7e | ||
|
|
0f0983bcf5 | ||
|
|
b7ebb9a28c | ||
|
|
f65c1ee614 | ||
|
|
37a24d288a | ||
|
|
b7930eeb0e | ||
|
|
2d19778553 | ||
|
|
0a8d59bc53 | ||
|
|
9d68b1e6c1 | ||
|
|
53c81e4f15 | ||
|
|
b4afa820ab | ||
|
|
6e82e2813b | ||
|
|
03acf8ba65 | ||
|
|
88a3eb9639 | ||
|
|
032f6939f6 | ||
|
|
984ce8531d | ||
|
|
2d0c8f664b | ||
|
|
430ec1fbaa | ||
|
|
b35ac6d461 | ||
|
|
56eccab054 | ||
|
|
8cabf9b32b | ||
|
|
2d4f4f4d6e | ||
|
|
08abdffd69 | ||
|
|
2d083d52ba | ||
|
|
b5fc6b396c | ||
|
|
9961e56ddc | ||
|
|
a118b91b79 | ||
|
|
9f63552b81 | ||
|
|
3eb2e4ff28 | ||
|
|
7bb004cdd2 | ||
|
|
eddf89013c | ||
|
|
cd63f88e72 | ||
|
|
4d0911d529 | ||
|
|
4ca553ff92 | ||
|
|
1d0ad9c41b | ||
|
|
395ee855dd | ||
|
|
a1c7e0d6e9 | ||
|
|
e60adc574b | ||
|
|
a4053e6dcd | ||
|
|
4bdebc0af4 | ||
|
|
ed42d3d5ac | ||
|
|
7b056ae754 | ||
|
|
1360f742f3 | ||
|
|
8941d6e54e | ||
|
|
eddc97fe98 | ||
|
|
ebb3fd2796 | ||
|
|
aa91984afb | ||
|
|
ec5969b898 | ||
|
|
8dc1ec63f2 | ||
|
|
903375a102 | ||
|
|
e9248c72a1 | ||
|
|
09e78a0b8f | ||
|
|
2c7dc8e737 | ||
|
|
61339f4eb2 | ||
|
|
1570ef7d44 | ||
|
|
e6a84852fa | ||
|
|
dcab7912c2 | ||
|
|
a511d7192a | ||
|
|
3311637c28 | ||
|
|
a6bd1095bf | ||
|
|
f042beceb1 | ||
|
|
ea50b17df3 | ||
|
|
0026b498eb | ||
|
|
ce23ae58e6 | ||
|
|
40f79c6aa3 | ||
|
|
4dfdd48e6a | ||
|
|
21531d1fd2 | ||
|
|
d538f8cd8e | ||
|
|
1504fc1ab1 | ||
|
|
b6accbadef | ||
|
|
7886c1227e | ||
|
|
1eb6e45dfe | ||
|
|
452f6baf45 | ||
|
|
b794538ed2 | ||
|
|
9ee01a6ef8 | ||
|
|
de7c56d99b | ||
|
|
681c70f80c | ||
|
|
a326000474 | ||
|
|
0c56bcf7e0 | ||
|
|
c99559d442 | ||
|
|
b69202c789 | ||
|
|
77f0f159ab | ||
|
|
4d036939f0 | ||
|
|
37928238df | ||
|
|
29a9b328a0 | ||
|
|
a83e2de12f | ||
|
|
5febb231be | ||
|
|
20d5c2b74f | ||
|
|
bf757a7f84 | ||
|
|
6e3d23e740 | ||
|
|
b92e3c9b30 | ||
|
|
886af7b824 | ||
|
|
47838fb0a7 | ||
|
|
8b58e8fc7d | ||
|
|
219dc6763f | ||
|
|
23a9049abb | ||
|
|
d2d9b2cf05 | ||
|
|
72f4ee7fd2 | ||
|
|
182dc4d878 | ||
|
|
4954b907de | ||
|
|
4fafaf8ed5 | ||
|
|
f7d118de27 | ||
|
|
6e0282d679 | ||
|
|
c025ec5ce8 | ||
|
|
edfdbee6d4 | ||
|
|
af6676cd8c | ||
|
|
8c91011dc7 | ||
|
|
a8a1c43f2c | ||
|
|
90f1e5ba9c | ||
|
|
24e8351ba5 | ||
|
|
23ee271d64 | ||
|
|
db964d247f | ||
|
|
f85771f05a | ||
|
|
2e09100bdc | ||
|
|
815bbb48fe | ||
|
|
965a80fb3f | ||
|
|
dfd31e69ca | ||
|
|
e175762c4e | ||
|
|
cbc3d07f4a | ||
|
|
337931b6c2 | ||
|
|
83f5048ff8 | ||
|
|
8b0577b46f | ||
|
|
64b2affee4 | ||
|
|
5996f3a74a | ||
|
|
fa4af5e5fe | ||
|
|
71c6cf20d7 | ||
|
|
48dab4bb0d | ||
|
|
38b4769806 | ||
|
|
f17fd13c2a | ||
|
|
ea8f6fbf5b | ||
|
|
ac33bfa158 | ||
|
|
8deaafb96b | ||
|
|
9062012d18 | ||
|
|
3ce7d65bb8 | ||
|
|
ceebb5d5ad | ||
|
|
91c67f0b5f | ||
|
|
e703057377 | ||
|
|
621cf4e2ad | ||
|
|
a83495deea | ||
|
|
e972419b3e | ||
|
|
ae2695ea1f | ||
|
|
b546106066 | ||
|
|
7d5fe8f0ee | ||
|
|
58c557ecb2 | ||
|
|
2bad9d4083 | ||
|
|
0342bdf33f | ||
|
|
c2270a860e | ||
|
|
5d216d81d4 | ||
|
|
d106fff245 | ||
|
|
a3bdcb3982 | ||
|
|
dc92574bc3 | ||
|
|
b5620cea46 | ||
|
|
73588a67d2 | ||
|
|
f5d43dba76 | ||
|
|
2fe2412e73 | ||
|
|
1cf2a6883a | ||
|
|
1df41f1e5a | ||
|
|
ccbfe642a8 | ||
|
|
1ad6bf17cb | ||
|
|
a8dc8a6b58 | ||
|
|
5e9e6896c0 | ||
|
|
28c0d091a9 | ||
|
|
c90ed5f1d8 | ||
|
|
1e9e870df8 | ||
|
|
ae3b9e5faf | ||
|
|
a296fc6051 | ||
|
|
ed16fe69b5 | ||
|
|
f46aabb4d3 | ||
|
|
d865ac8e06 | ||
|
|
8b1d7f7602 | ||
|
|
7ce9317876 | ||
|
|
7df050a2b1 | ||
|
|
0a7f6b8e40 | ||
|
|
84ab9f9cdc | ||
|
|
e980bbdb24 | ||
|
|
4d52b6c8e0 | ||
|
|
f0bf995584 | ||
|
|
c962d12374 | ||
|
|
34e0132c46 | ||
|
|
8af9bec79c | ||
|
|
8b26accb78 | ||
|
|
d65ae4693c | ||
|
|
4b9d742b9b | ||
|
|
151c792fc6 | ||
|
|
719ea435d4 | ||
|
|
458627f520 | ||
|
|
2c53428f8d | ||
|
|
9115063cdd | ||
|
|
169a955b0b | ||
|
|
ba32c4fd0d | ||
|
|
5c7380a199 | ||
|
|
308ad08e74 | ||
|
|
79222eb978 | ||
|
|
f5d105fbc0 | ||
|
|
53ab69555e | ||
|
|
237269f761 | ||
|
|
824f66df03 | ||
|
|
2a6d8bea78 | ||
|
|
eee1abf3ed | ||
|
|
ee427758c2 | ||
|
|
79eed373d4 | ||
|
|
c35349670a | ||
|
|
45a63548c7 | ||
|
|
44428be8aa | ||
|
|
2477c985d6 | ||
|
|
aec4c2a0b0 | ||
|
|
79bdc18934 | ||
|
|
dbfbba1067 | ||
|
|
4f9e0cc63d | ||
|
|
ac4331edbd | ||
|
|
ed7c89476f | ||
|
|
9ebbe5482a | ||
|
|
078931b4f9 | ||
|
|
8809a3e3c8 | ||
|
|
fc4155ea49 | ||
|
|
b5e9e301b9 | ||
|
|
3fc0fca23b | ||
|
|
7d8034e600 | ||
|
|
0bb1df3584 | ||
|
|
26d668b68c | ||
|
|
9e4815d8b8 | ||
|
|
add5dedcb1 | ||
|
|
dfed8d3a74 | ||
|
|
981e8e798e | ||
|
|
bc4201ffe6 | ||
|
|
a7f9e51b5f | ||
|
|
08b3289f4d | ||
|
|
47b55267df | ||
|
|
5f329f5210 | ||
|
|
8e924d1de4 | ||
|
|
8a6584acb9 | ||
|
|
bbe9b1b40e | ||
|
|
fde04bb77f | ||
|
|
b6963ff290 | ||
|
|
966b2d56b9 | ||
|
|
cd80d72e32 | ||
|
|
28d8f695c1 | ||
|
|
ac0fa6cebd | ||
|
|
31e8a7dfdd | ||
|
|
e46ae3a000 | ||
|
|
6a9f3e4df6 | ||
|
|
97eb8c91f5 | ||
|
|
346016b5c4 | ||
|
|
c3bc4e604a | ||
|
|
35ba215834 | ||
|
|
735dd55531 | ||
|
|
eca58df6c2 | ||
|
|
6870de4c7b | ||
|
|
5dd6a477c0 | ||
|
|
be10650150 | ||
|
|
311b4ee1f3 | ||
|
|
86a94e37e4 | ||
|
|
2e3430fa85 | ||
|
|
d4b7f8e9f8 | ||
|
|
464af6b9d1 | ||
|
|
a1138c8c43 | ||
|
|
323c77322b | ||
|
|
edfb4e250c | ||
|
|
236d06308d | ||
|
|
fb3511b264 | ||
|
|
d798aa2cdf | ||
|
|
a02cccb400 | ||
|
|
650a30a244 | ||
|
|
7423502a01 | ||
|
|
61c0a65009 | ||
|
|
a732daebc5 | ||
|
|
656cc283fe | ||
|
|
57ea015c03 | ||
|
|
eafebf9d2a | ||
|
|
68aba3b9c1 | ||
|
|
67ab0186b5 | ||
|
|
81acc255d7 | ||
|
|
3f26dcbef9 | ||
|
|
2fec833aef | ||
|
|
96595b3aa4 | ||
|
|
698b3e36cb | ||
|
|
9325de45fe | ||
|
|
3083415d6c | ||
|
|
68056fe781 | ||
|
|
e27657be6b | ||
|
|
52e7e71a5c | ||
|
|
40bc9e2f24 | ||
|
|
521507e425 | ||
|
|
674c07460b | ||
|
|
379e72a9e7 | ||
|
|
e4b0135953 | ||
|
|
58c54e5b94 | ||
|
|
5fe60d20d3 | ||
|
|
98e967833a | ||
|
|
1154330096 | ||
|
|
9fafc17749 | ||
|
|
31e7810d5f | ||
|
|
96bb7e6a3b | ||
|
|
d39fcd7a14 | ||
|
|
5cf985aada | ||
|
|
ce18aab493 | ||
|
|
f76abc7c89 | ||
|
|
1e02fb6bcd | ||
|
|
ed3f8ca560 | ||
|
|
be33520673 | ||
|
|
3a85cfacf2 | ||
|
|
4674b48069 | ||
|
|
8f73025215 | ||
|
|
149a650342 | ||
|
|
3eeb14e30e | ||
|
|
b5d984de6f | ||
|
|
c260363248 | ||
|
|
2e39c4eb52 | ||
|
|
edb3d20fca | ||
|
|
84a0d0729f | ||
|
|
26cfadb8da | ||
|
|
96c524a90c | ||
|
|
fc9f3f1aa7 | ||
|
|
c67609b417 | ||
|
|
af042b8722 | ||
|
|
d7b32dece8 | ||
|
|
3e3e31be43 | ||
|
|
a62e18d071 | ||
|
|
de7871e79f | ||
|
|
502c59049b | ||
|
|
2c15533404 | ||
|
|
3d246baabf | ||
|
|
51b97f751e | ||
|
|
9295f2a3b4 | ||
|
|
a355784edd | ||
|
|
7addf7cc6f | ||
|
|
9e87ca327a | ||
|
|
7152d0b058 | ||
|
|
f3f74460a8 | ||
|
|
5522603b00 | ||
|
|
be022c79f2 | ||
|
|
604be429ab | ||
|
|
9d3c0d9f29 | ||
|
|
68d3c60d70 | ||
|
|
b11ef7d04b | ||
|
|
7eaf9c155f | ||
|
|
1aca230939 | ||
|
|
af4a92cd2a | ||
|
|
6c8fa91f64 | ||
|
|
952431d296 | ||
|
|
cd16f45d8e | ||
|
|
c79f8b5f8b | ||
|
|
40aedbfdfb | ||
|
|
3bf21c8caf | ||
|
|
df05b33e82 | ||
|
|
67a2dfbd42 | ||
|
|
ba09269456 | ||
|
|
97c47c5d1d | ||
|
|
fc56bd3273 | ||
|
|
4227389a67 | ||
|
|
91b4197b04 | ||
|
|
e3eddd6b85 | ||
|
|
7a672bca87 | ||
|
|
9e5fc1baba | ||
|
|
05966afd65 | ||
|
|
62c0ba4f01 | ||
|
|
8fbb6716fc | ||
|
|
1742cd4913 | ||
|
|
497724443f | ||
|
|
918103a17b | ||
|
|
316e14f0ea | ||
|
|
6123977974 | ||
|
|
56a7468ae3 | ||
|
|
4c5aef6e4f | ||
|
|
eef1fd85f0 | ||
|
|
c5f2c63579 | ||
|
|
597925eece | ||
|
|
3d32e95150 | ||
|
|
e0f55a02cf | ||
|
|
45c6727bec | ||
|
|
ccf0716d3e | ||
|
|
c7b78e76ad | ||
|
|
633e552b31 | ||
|
|
8b8b145360 | ||
|
|
c73e99a8dc | ||
|
|
d0fe62a66a | ||
|
|
81a0a4a61c | ||
|
|
136177410f | ||
|
|
9c45e0d593 | ||
|
|
c7a2b9aab3 | ||
|
|
5e5724e535 | ||
|
|
f6453c77d7 | ||
|
|
77b56e4169 | ||
|
|
5bed310153 | ||
|
|
29f9a2d476 | ||
|
|
2ef2fee802 | ||
|
|
bdcb9a6de9 | ||
|
|
b1c9aad0ea | ||
|
|
9fd889f77f | ||
|
|
441dfa4c62 | ||
|
|
b6b8f893e3 | ||
|
|
6497278755 | ||
|
|
e6fbac66ec | ||
|
|
a0e5dc4723 | ||
|
|
23ec2b8f55 | ||
|
|
ecb0d7961b | ||
|
|
f1786541cd | ||
|
|
3dc8edb4a8 | ||
|
|
93d9ca43f1 | ||
|
|
b40309e80b | ||
|
|
df96b6e51e | ||
|
|
3d86418d22 | ||
|
|
ecc3e33ad7 | ||
|
|
5bc9b0b040 | ||
|
|
aced217a7d | ||
|
|
f9d60a1685 | ||
|
|
8ecf0a08f3 | ||
|
|
1472987e21 | ||
|
|
dcc88c09a3 | ||
|
|
2e36c9cd17 | ||
|
|
fe7a314d92 | ||
|
|
0b4f895506 | ||
|
|
f87cf02c2d | ||
|
|
144b14225c | ||
|
|
8eb5f0cd4c | ||
|
|
6f5f094082 | ||
|
|
287a7529a6 | ||
|
|
ac3a157a76 | ||
|
|
96ce5d278f | ||
|
|
055469055c | ||
|
|
08824a1e4e | ||
|
|
fef4c99189 | ||
|
|
5a5d2b945f | ||
|
|
a56c827924 | ||
|
|
7cd3e40abf | ||
|
|
a31f26f32b | ||
|
|
5ab88f7a39 | ||
|
|
e83be9c69f | ||
|
|
56775d645d | ||
|
|
e9029cd8b9 | ||
|
|
fffeb2a17a | ||
|
|
2ad4972115 | ||
|
|
3ef6f3c80b | ||
|
|
33e8a9f384 | ||
|
|
e51e08f72a | ||
|
|
8847ab989b | ||
|
|
859dddbc46 | ||
|
|
d7664cbf84 | ||
|
|
2b3c9a5868 | ||
|
|
440f6c610d | ||
|
|
0065ed770a | ||
|
|
bdad1d5930 | ||
|
|
eb9c85fca1 | ||
|
|
9049f6635d | ||
|
|
6a6015ae4d | ||
|
|
60fcd48140 | ||
|
|
460d0a0b5e | ||
|
|
df263eb1c7 | ||
|
|
403a108dba | ||
|
|
5b311446dc | ||
|
|
fa59c87ec3 | ||
|
|
99eb986af4 | ||
|
|
33813ddeda | ||
|
|
b017135a3b | ||
|
|
87a35c6524 | ||
|
|
8b2349a35b | ||
|
|
6bc9de66bc | ||
|
|
541b7075f9 | ||
|
|
62f769c805 | ||
|
|
6640da895d | ||
|
|
b4165ed5ca | ||
|
|
9116780d3a | ||
|
|
7bae207319 | ||
|
|
2b45fd5842 | ||
|
|
379f7dcd76 | ||
|
|
aa14a26bba | ||
|
|
1803ca06d3 | ||
|
|
b114732727 | ||
|
|
7830ec2048 | ||
|
|
310de903e4 | ||
|
|
518fb7d9de | ||
|
|
f308d32739 | ||
|
|
39fc7f09b4 | ||
|
|
4da14550e7 | ||
|
|
20a35850a6 | ||
|
|
eff0e18299 | ||
|
|
a459258005 | ||
|
|
efd7e23fae | ||
|
|
3c7edb039e | ||
|
|
4185b12941 | ||
|
|
69f6aabeb5 | ||
|
|
2acbc0262a | ||
|
|
815717ea0b | ||
|
|
f83d2d21c4 | ||
|
|
b690675bd9 | ||
|
|
8300bffaa3 | ||
|
|
03e6974a22 | ||
|
|
2774d94624 | ||
|
|
6b9d557896 | ||
|
|
75b470907b | ||
|
|
54d7acb2a6 | ||
|
|
3a9c28b8bc | ||
|
|
a29343d4fe | ||
|
|
e8c221a8c0 | ||
|
|
242ea4914b | ||
|
|
5fb4e77448 | ||
|
|
38fd490b21 | ||
|
|
11ba0bafaa | ||
|
|
7e3116677a | ||
|
|
031f36759f | ||
|
|
6bfe6a3947 | ||
|
|
e763aebb11 | ||
|
|
90e3a823c8 | ||
|
|
1351a26c24 |
338 changed files with 39866 additions and 687 deletions
15
.gitignore
vendored
15
.gitignore
vendored
|
|
@ -2,3 +2,18 @@ node_modules
|
|||
settings-demo.json
|
||||
settings-staging.json
|
||||
settings-production.json
|
||||
settings-development.json
|
||||
private/GeoLite2-City.mmdb*
|
||||
npm-debug.log
|
||||
**/.sass-cache
|
||||
.deploy/
|
||||
public/locales/undefined/
|
||||
.deploy-staging
|
||||
.screenshots
|
||||
.vscode
|
||||
output.json
|
||||
|
||||
# fase-0 higiene: variantes de settings con secretos (no versionar)
|
||||
settings-production-*.json
|
||||
settings-tests.json
|
||||
*.json~
|
||||
|
|
|
|||
|
|
@ -4,32 +4,66 @@
|
|||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
meteor-base@1.1.0 # Packages every Meteor app needs to have
|
||||
mobile-experience@1.0.4 # Packages for a great mobile UX
|
||||
mongo@1.1.18 # The database Meteor supports right now
|
||||
meteor-base@1.3.0 # Packages every Meteor app needs to have
|
||||
mobile-experience@1.0.5 # Packages for a great mobile UX
|
||||
mongo@1.4.7 # The database Meteor supports right now
|
||||
reactive-var@1.0.11 # Reactive variable for tracker
|
||||
tracker@1.1.3 # Meteor's client-side reactive programming library
|
||||
|
||||
standard-minifier-css@1.3.4 # CSS minifier run for production mode
|
||||
standard-minifier-js@2.1.0 # JS minifier run for production mode
|
||||
es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers.
|
||||
ecmascript@0.8.0 # Enable ECMAScript2015+ syntax in app code
|
||||
shell-server@0.2.3 # Server-side component of the `meteor shell` command
|
||||
standard-minifier-css@1.4.0 # CSS minifier run for production mode
|
||||
standard-minifier-js@2.3.1 # JS minifier run for production mode
|
||||
es5-shim@4.7.0 # ECMAScript 5 compatibility for older browsers.
|
||||
ecmascript@0.10.6 # Enable ECMAScript2015+ syntax in app code
|
||||
shell-server@0.3.1 # Server-side component of the `meteor shell` command
|
||||
|
||||
react-meteor-data
|
||||
alanning:roles
|
||||
fourseven:scss
|
||||
twbs:bootstrap
|
||||
accounts-base@1.3.0
|
||||
accounts-password@1.3.6
|
||||
accounts-base@1.4.2
|
||||
accounts-password@1.5.0
|
||||
service-configuration@1.0.11
|
||||
accounts-facebook@1.2.0
|
||||
accounts-github@1.3.0
|
||||
accounts-google@1.2.0
|
||||
accounts-facebook@1.3.1
|
||||
accounts-github@1.4.1
|
||||
accounts-google@1.3.1
|
||||
themeteorchef:bert
|
||||
fortawesome:fontawesome
|
||||
aldeed:collection2-core@2.0.0
|
||||
aldeed:collection2-core@2.0.1
|
||||
audit-argument-checks@1.0.7
|
||||
ddp-rate-limiter@1.0.7
|
||||
dynamic-import
|
||||
dynamic-import@0.3.0
|
||||
static-html
|
||||
alexwine:bootstrap-4
|
||||
|
||||
selaias:cookie-consent # Cookie consent
|
||||
gadicc:blaze-react-component # Add braze to react
|
||||
255kb:meteor-status # Connect status
|
||||
# mixmax:smart-disconnect # Disconnect on lost focus (disabled to get notif)
|
||||
flowkey:raven # js errors
|
||||
vjrj:piwik # Stats
|
||||
mdg:geolocation
|
||||
natestrauser:publish-performant-counts
|
||||
maximum:server-transform
|
||||
mys:fonts # fonst in npm
|
||||
ostrio:mailer # mailer
|
||||
# babrahams:constellation # dev utility
|
||||
percolate:migrations # db migrations
|
||||
ostrio:meteor-root
|
||||
meteortesting:mocha
|
||||
practicalmeteor:chai
|
||||
aldeed:schema-deny
|
||||
aldeed:template-extension
|
||||
dburles:collection-helpers
|
||||
less@2.7.11
|
||||
markdown@1.0.12
|
||||
mongo-livedata@1.0.12
|
||||
reywood:publish-composite
|
||||
barbatus:stars-rating
|
||||
arkham:comments-ui
|
||||
facts@1.0.9
|
||||
gadicohen:sitemaps
|
||||
nspangler:autoreconnect
|
||||
saucecode:timezoned-synced-cron
|
||||
# lmachens:kadira
|
||||
meteorhacks:zones
|
||||
nimble:restivus
|
||||
xolvio:cleaner
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
METEOR@1.5
|
||||
METEOR@1.6.1.1
|
||||
|
|
|
|||
191
.meteor/versions
191
.meteor/versions
|
|
@ -1,104 +1,155 @@
|
|||
accounts-base@1.3.0
|
||||
accounts-facebook@1.2.0
|
||||
accounts-github@1.3.0
|
||||
accounts-google@1.2.0
|
||||
255kb:meteor-status@1.5.0
|
||||
accounts-base@1.4.2
|
||||
accounts-facebook@1.3.1
|
||||
accounts-github@1.4.1
|
||||
accounts-google@1.3.1
|
||||
accounts-oauth@1.1.15
|
||||
accounts-password@1.3.6
|
||||
accounts-password@1.5.1
|
||||
alanning:roles@1.2.16
|
||||
aldeed:collection2-core@2.0.1
|
||||
allow-deny@1.0.5
|
||||
aldeed:collection2-core@2.1.2
|
||||
aldeed:schema-deny@2.0.1
|
||||
aldeed:template-extension@4.1.0
|
||||
alexwine:bootstrap-4@4.1.0
|
||||
allow-deny@1.1.0
|
||||
arkham:comments-ui@1.4.4
|
||||
audit-argument-checks@1.0.7
|
||||
autoupdate@1.3.12
|
||||
babel-compiler@6.19.1
|
||||
babel-runtime@1.0.1
|
||||
base64@1.0.10
|
||||
autoupdate@1.4.0
|
||||
babel-compiler@7.0.7
|
||||
babel-runtime@1.2.2
|
||||
barbatus:stars-rating@1.1.1
|
||||
base64@1.0.11
|
||||
binary-heap@1.0.10
|
||||
blaze@2.3.2
|
||||
blaze-tools@1.0.10
|
||||
boilerplate-generator@1.1.0
|
||||
caching-compiler@1.1.9
|
||||
boilerplate-generator@1.4.0
|
||||
browser-policy@1.1.0
|
||||
browser-policy-common@1.0.11
|
||||
browser-policy-content@1.1.0
|
||||
browser-policy-framing@1.1.0
|
||||
caching-compiler@1.1.11
|
||||
caching-html-compiler@1.1.2
|
||||
callback-hook@1.0.10
|
||||
check@1.2.5
|
||||
ddp@1.2.5
|
||||
ddp-client@1.3.4
|
||||
ddp-common@1.2.8
|
||||
callback-hook@1.1.0
|
||||
check@1.3.1
|
||||
coffeescript@1.0.17
|
||||
dburles:collection-helpers@1.1.0
|
||||
dburles:mongo-collection-instances@0.3.5
|
||||
ddp@1.4.0
|
||||
ddp-client@2.3.2
|
||||
ddp-common@1.4.0
|
||||
ddp-rate-limiter@1.0.7
|
||||
ddp-server@1.3.14
|
||||
ddp-server@2.1.2
|
||||
deps@1.0.12
|
||||
diff-sequence@1.0.7
|
||||
dynamic-import@0.1.0
|
||||
ecmascript@0.8.0
|
||||
ecmascript-runtime@0.4.1
|
||||
ecmascript-runtime-client@0.4.1
|
||||
ecmascript-runtime-server@0.4.1
|
||||
ejson@1.0.13
|
||||
email@1.2.1
|
||||
es5-shim@4.6.15
|
||||
facebook-oauth@1.3.1
|
||||
fastclick@1.0.13
|
||||
diff-sequence@1.1.0
|
||||
dynamic-import@0.3.0
|
||||
ecmascript@0.10.7
|
||||
ecmascript-runtime@0.5.0
|
||||
ecmascript-runtime-client@0.6.2
|
||||
ecmascript-runtime-server@0.5.0
|
||||
ejson@1.1.0
|
||||
email@1.2.3
|
||||
es5-shim@4.7.3
|
||||
facebook-oauth@1.4.0
|
||||
facts@1.0.9
|
||||
flowkey:raven@1.1.0
|
||||
fortawesome:fontawesome@4.7.0
|
||||
fourseven:scss@4.5.0
|
||||
fourseven:scss@4.5.4
|
||||
gadicc:blaze-react-component@1.4.0
|
||||
gadicohen:robots-txt@0.0.10
|
||||
gadicohen:sitemaps@0.0.26
|
||||
geojson-utils@1.0.10
|
||||
github-oauth@1.2.0
|
||||
google-oauth@1.2.4
|
||||
google-oauth@1.2.5
|
||||
hot-code-push@1.0.4
|
||||
html-tools@1.0.11
|
||||
htmljs@1.0.11
|
||||
http@1.2.12
|
||||
id-map@1.0.9
|
||||
jquery@1.11.10
|
||||
http@1.4.0
|
||||
id-map@1.1.0
|
||||
jquery@1.11.11
|
||||
lai:collection-extensions@0.2.1_1
|
||||
launch-screen@1.1.1
|
||||
less@2.7.12
|
||||
livedata@1.0.18
|
||||
localstorage@1.1.0
|
||||
logging@1.1.17
|
||||
meteor@1.6.1
|
||||
meteor-base@1.1.0
|
||||
minifier-css@1.2.16
|
||||
minifier-js@2.1.0
|
||||
minimongo@1.2.0
|
||||
mobile-experience@1.0.4
|
||||
localstorage@1.2.0
|
||||
logging@1.1.20
|
||||
markdown@1.0.12
|
||||
maximum:package-base@1.1.2
|
||||
maximum:server-transform@0.5.0
|
||||
mdg:geolocation@1.3.0
|
||||
meteor@1.8.6
|
||||
meteor-base@1.3.0
|
||||
meteorhacks:inject-initial@1.0.4
|
||||
meteorhacks:zones@1.6.0
|
||||
meteortesting:browser-tests@0.2.0
|
||||
meteortesting:mocha@0.5.1
|
||||
minifier-css@1.3.1
|
||||
minifier-js@2.3.4
|
||||
minimongo@1.4.4
|
||||
mobile-experience@1.0.5
|
||||
mobile-status-bar@1.0.14
|
||||
modules@0.9.0
|
||||
modules-runtime@0.8.0
|
||||
mongo@1.1.18
|
||||
mongo-id@1.0.6
|
||||
npm-bcrypt@0.9.2
|
||||
npm-mongo@2.2.24
|
||||
oauth@1.1.13
|
||||
oauth2@1.1.11
|
||||
modules@0.11.6
|
||||
modules-runtime@0.9.2
|
||||
mongo@1.4.7
|
||||
mongo-dev-server@1.1.0
|
||||
mongo-id@1.0.7
|
||||
mongo-livedata@1.0.12
|
||||
mys:fonts@0.0.2
|
||||
natestrauser:publish-performant-counts@0.1.2
|
||||
nimble:restivus@0.8.12
|
||||
npm-bcrypt@0.9.3
|
||||
npm-mongo@2.2.34
|
||||
nspangler:autoreconnect@0.0.1
|
||||
oauth@1.2.3
|
||||
oauth2@1.2.0
|
||||
observe-sequence@1.0.16
|
||||
ordered-dict@1.0.9
|
||||
promise@0.8.9
|
||||
ordered-dict@1.1.0
|
||||
ostrio:cookies@2.1.3
|
||||
ostrio:mailer@2.1.0
|
||||
ostrio:meteor-root@1.0.7
|
||||
peerlibrary:assert@0.2.5
|
||||
peerlibrary:fiber-utils@0.6.0
|
||||
peerlibrary:reactive-mongo@0.1.1
|
||||
peerlibrary:server-autorun@0.5.2
|
||||
percolate:migrations@1.0.2
|
||||
practicalmeteor:chai@2.1.0_1
|
||||
practicalmeteor:mocha-core@1.0.1
|
||||
promise@0.10.2
|
||||
raix:eventemitter@0.1.3
|
||||
random@1.0.10
|
||||
rate-limit@1.0.8
|
||||
react-meteor-data@0.2.11
|
||||
reactive-dict@1.1.9
|
||||
random@1.1.0
|
||||
rate-limit@1.0.9
|
||||
react-meteor-data@0.2.16
|
||||
reactive-dict@1.2.0
|
||||
reactive-var@1.0.11
|
||||
reload@1.1.11
|
||||
retry@1.0.9
|
||||
routepolicy@1.0.12
|
||||
reload@1.2.0
|
||||
retry@1.1.0
|
||||
reywood:publish-composite@1.6.0
|
||||
routepolicy@1.0.13
|
||||
saucecode:timezoned-synced-cron@1.2.11
|
||||
selaias:cookie-consent@0.4.0
|
||||
server-render@0.3.0
|
||||
service-configuration@1.0.11
|
||||
session@1.1.7
|
||||
sha@1.0.9
|
||||
shell-server@0.2.3
|
||||
shell-server@0.3.1
|
||||
shim-common@0.1.0
|
||||
simple:json-routes@2.1.0
|
||||
socket-stream-client@0.1.0
|
||||
spacebars@1.0.15
|
||||
spacebars-compiler@1.1.2
|
||||
spacebars-compiler@1.1.3
|
||||
srp@1.0.10
|
||||
standard-minifier-css@1.3.4
|
||||
standard-minifier-js@2.1.0
|
||||
standard-minifier-css@1.4.1
|
||||
standard-minifier-js@2.3.3
|
||||
static-html@1.2.2
|
||||
templating@1.3.2
|
||||
templating-compiler@1.3.2
|
||||
templating-compiler@1.3.3
|
||||
templating-runtime@1.3.2
|
||||
templating-tools@1.1.2
|
||||
themeteorchef:bert@2.1.2
|
||||
tmeasday:check-npm-versions@0.3.1
|
||||
themeteorchef:bert@2.1.3
|
||||
tmeasday:check-npm-versions@0.3.2
|
||||
tracker@1.1.3
|
||||
twbs:bootstrap@3.3.6
|
||||
ui@1.0.13
|
||||
underscore@1.0.10
|
||||
url@1.1.0
|
||||
webapp@1.3.16
|
||||
url@1.2.0
|
||||
vjrj:piwik@0.3.1
|
||||
webapp@1.5.0
|
||||
webapp-hashing@1.0.9
|
||||
xolvio:cleaner@0.3.3
|
||||
|
|
|
|||
3
.meteorignore
Normal file
3
.meteorignore
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Don't reload meteor server when we modify or do test
|
||||
cucumber
|
||||
output.json
|
||||
7
API.md
Normal file
7
API.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
Basic API:
|
||||
|
||||
```bash
|
||||
curl -X GET http://localhost:3000/api/v1/status/last-fire-detected
|
||||
curl -X GET http://localhost:3000/api/v1/status/last-fire-check
|
||||
curl -X GET http://localhost:3000/api/v1/status/active-fires-count
|
||||
```
|
||||
36
COPYRIGHT.md
Normal file
36
COPYRIGHT.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
**Data**
|
||||
|
||||
We acknowledge the use of data and imagery from LANCE FIRMS operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.
|
||||
|
||||
**Images**
|
||||
|
||||
* Home slide 1: Sotres, Picos de Europa, Asturias, photo by Mick Stephenson, license CC-BY-SA 3.0, [source](https://es.wikipedia.org/wiki/Sotres#/media/File:SotresPanorama.jpg).
|
||||
* Home slide 2: Silverhorne, United States, photo by Nathan Anderson [source](https://unsplash.com/photos/ZLOZC1uUdns).
|
||||
* Home slide 3: Bitterroot National Forest, Montana, United States, photo by John McColgan, Public Domain, [source](https://commons.wikimedia.org/wiki/File:Deerfire_high_res.jpg).
|
||||
* Home slide 4: Cox Valley Fire, Olympic NP, United States, August 2016, [source](https://www.nps.gov/olym/learn/management/current-fire-status.htm).
|
||||
* Wildfire home photo: [California Wildfires, October 23th 2007](https://commons.wikimedia.org/wiki/File:California_Wildfires_October_23_2007.jpg), [fuente](http://www.nasa.gov/vision/earth/lookingatearth/socal_wildfires_oct07.html).
|
||||
* Default avatar: A colored Emoji from Noto project, released under Apache license, [source](https://commons.wikimedia.org/wiki/File:Emoji_u1f469_1f3fd_200d_1f692.svg).
|
||||
|
||||
**The rest**
|
||||
|
||||
Copyright
|
||||
|
||||
(c) 2017-2018 Licensed to the Comunes Association (CA) under one or
|
||||
more contributor license agreements. The CA licenses this software to
|
||||
you under the GNU Affero General Public License version 3, (the "License");
|
||||
you may not use this software except in compliance with the License.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
See our [LICENSE](https://github.com/comunes/todos-contra-el-fuego-web/blob/tcef-master/LICENSE.md), for a complete text.
|
||||
69
History.md
Normal file
69
History.md
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
## v.NEXT
|
||||
|
||||
- Improve [#96](https://github.com/cleverbeagle/pup/issues/96). Fix miscellaneous ESLint errors (h/t [@cdolek](https://github.com/cdolek) for sniffing these out).
|
||||
- Improve [#95](https://github.com/cleverbeagle/pup/issues/95). Migrate from `createContainer` method to `withTracker` for data containers (h/t [@cdolek](https://github.com/cdolek) for sniffing these out).
|
||||
- Improve [#94](https://github.com/cleverbeagle/pup/issues/94). Bump Meteor to v1.6 and bump Atmosphere and NPM deps.
|
||||
- Improve [#53](https://github.com/cleverbeagle/pup/issues/53). Move method imports to be on both the client and the server to leverage Meteor's latency compensation by default (h/t [@zodern](https://github.com/zodern) for refactoring this).
|
||||
- Improve [#78](https://github.com/cleverbeagle/pup/issues/78). Deprecate `@cleverbeagle/dates` package in favor of a local file of date helpers (h/t [@zodern](https://github.com/zodern) for refactoring this).
|
||||
- Improve [#79](https://github.com/cleverbeagle/pup/issues/79). Add `babel-plugin-lodash` to reduce footprint of Lodash to only methods that are used in the project (h/t [@ninjaPixel](https://github.com/ninjaPixel) for finding/implementing this).
|
||||
- Improve [#80](https://github.com/cleverbeagle/pup/issues/80). Add exception to disable `max-len` ESLint rule (h/t [@ninjaPixel](https://github.com/ninjaPixel) for implementing this).
|
||||
- Improve [#60](https://github.com/cleverbeagle/pup/issues/60). Move to `babel-preset-env` from `babel-preset-es2015` (h/t [@pilarArr](https://github.com/pilarArr) for implementing this).
|
||||
- Fix [#59](https://github.com/cleverbeagle/pup/issues/59). Fix ESLint throwing a tantrum about line endings on Windows (h/t [@pilarArr](https://github.com/pilarArr) for implementing this).
|
||||
- Improve [#47](https://github.com/cleverbeagle/pup/issues/47). Move `getUserName()` function in `/imports/ui/layouts/App/App.js` into its own file (h/t [@pilarArr](https://github.com/pilarArr) for implementing this).
|
||||
- Improve [#46](https://github.com/cleverbeagle/pup/issues/46). Move the resend verification email bar into its own component (h/t [@pilarArr](https://github.com/pilarArr) for implementing this).
|
||||
|
||||
## v1.2.2, September 30th, 2017
|
||||
|
||||
- Fix [#66](https://github.com/cleverbeagle/pup/issues/66). Remove unnecessary `callback` argument causing trouble in `/imports/modules/server/send-email.js`.
|
||||
|
||||
- Fix [#74](https://github.com/cleverbeagle/pup/issues/74). Fix typo in `/imports/ui/components/Public/Public.js`.
|
||||
|
||||
## v1.2.1, September 24th, 2017
|
||||
|
||||
- Fix [#68](https://github.com/cleverbeagle/pup/issues/68). Update Meteor to v1.5.2 and bump Atmosphere dependencies to latest versions.
|
||||
|
||||
## v1.2.0, September 7th, 2017
|
||||
|
||||
- Fix [#31](https://github.com/cleverbeagle/pup/issues/31). Fix name not rendering for users logged in via OAuth with Google.
|
||||
- Fix [#32](https://github.com/cleverbeagle/pup/issues/32). Fix route props not being passed to rendered component in `<Authenticated />` and `<Public />`. h/t @pilarArr for the fix.
|
||||
- Improve [#37](https://github.com/cleverbeagle/pup/issues/37). Bump Atmosphere and NPM dependencies to latest versions. h/t @pilarArr for the refactor.
|
||||
- Improve [#40](https://github.com/cleverbeagle/pup/issues/40). Move `Meteor.logout()` call to be triggered by visiting the `/logout` route.
|
||||
- Add [#44](https://github.com/cleverbeagle/pup/issues/44). Add support for transactional emails with HTML and text templates via Handlebars.
|
||||
- Improve [#45](https://github.com/cleverbeagle/pup/issues/45). Clean up the UI/UX of the "Edit Profile" view for users who are logged in via OAuth.
|
||||
|
||||
## v1.1.1, August 6th, 2017
|
||||
|
||||
- Fix [#27](https://github.com/cleverbeagle/pup/issues/27). Fix incorrect method name in rate limiter list in `/imports/api/Users/server/methods.js`.
|
||||
- Fix [#28](https://github.com/cleverbeagle/pup/issues/28). Fix verify email message displaying for users who log in via OAuth.
|
||||
- Fix [#29](https://github.com/cleverbeagle/pup/issues/29). Fix `@cleverbeagle/seeder` and `@cleverbeagle/dates` dependencies breaking initial startup. Also add `core-js` dependency as it was breaking some apps on startup.
|
||||
|
||||
## v1.1.0, August 1st, 2017
|
||||
|
||||
- Improve [#16](https://github.com/cleverbeagle/pup/issues/16). Adds missing import for `/imports/startup/server/accounts/on-create-user.js` in `/imports/startup/server/accounts/index.js`.
|
||||
[Add documentation on usage of `Accounts.onCreateUser()`](/pup/v1/accounts/on-create-user-hook).
|
||||
|
||||
- Improve [#17](https://github.com/cleverbeagle/pup/issues/17). Move setting of user password in editing profile to client to ensure the user's current password is actually checked (implements Meteor's `Accounts.changePassword()` method).
|
||||
|
||||
- Add [#20](https://github.com/cleverbeagle/pup/issues/20). Add support for `lodash` package via NPM and swap usage of `capitalize()` method from `@cleverbeagle/strings` package with lodash's `_.capitalize()` method. Remove `@cleverbeagle/strings` from NPM dependencies.
|
||||
|
||||
- Add [#21](https://github.com/cleverbeagle/pup/issues/21). Add support for (non-blocking) email verification on user signup. [Add documentation on email verification process](/pup/v1/accounts/email-verification).
|
||||
|
||||
- Fix [#23](https://github.com/cleverbeagle/pup/issues/23). Fixes a React PropTypes warning showing up when accessing a non-existing document on `/documents/:_id/edit`. Also improve 404 handling on `/documents/:_id/edit` and `/documents/:_id` when no document is passed.
|
||||
|
||||
- Fix [#24](https://github.com/cleverbeagle/pup/issues/24). Remove unnecessary `_.pluck()` call obscuring the method names passed to the `rateLimit()` options object.
|
||||
|
||||
## v1.0.3, July 9th, 2017
|
||||
|
||||
- Fix [#14](https://github.com/cleverbeagle/pup/issues/14). Remove unnecessary `loggingIn` check that was forcing the page to re-render.
|
||||
|
||||
## v1.0.2, June 27th, 2017
|
||||
|
||||
- Fix [#12](https://github.com/cleverbeagle/pup/issues/12). Fixes prop type warning being thrown when transitioning to the `ViewDocument` page component from the `NewDocument` page component.
|
||||
|
||||
## v1.0.1, June 14th, 2017
|
||||
|
||||
- Fix [#1](https://github.com/cleverbeagle/pup/issues/1). h/t to [@sczk](https://github.com/sczk) for pointing out the fix.
|
||||
|
||||
## v1.0.0, June 13th, 2017
|
||||
|
||||
- Initial release of Pup.
|
||||
660
LICENSE.md
Normal file
660
LICENSE.md
Normal file
|
|
@ -0,0 +1,660 @@
|
|||
### GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
<https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
### Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains
|
||||
free software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing
|
||||
under this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
### TERMS AND CONDITIONS
|
||||
|
||||
#### 0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds
|
||||
of works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of
|
||||
an exact copy. The resulting work is called a "modified version" of
|
||||
the earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user
|
||||
through a computer network, with no transfer of a copy, is not
|
||||
conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices" to
|
||||
the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
#### 1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work for
|
||||
making modifications to it. "Object code" means any non-source form of
|
||||
a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can
|
||||
regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same
|
||||
work.
|
||||
|
||||
#### 2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey,
|
||||
without conditions so long as your license otherwise remains in force.
|
||||
You may convey covered works to others for the sole purpose of having
|
||||
them make modifications exclusively for you, or provide you with
|
||||
facilities for running those works, provided that you comply with the
|
||||
terms of this License in conveying all material for which you do not
|
||||
control copyright. Those thus making or running the covered works for
|
||||
you must do so exclusively on your behalf, under your direction and
|
||||
control, on terms that prohibit them from making any copies of your
|
||||
copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the
|
||||
conditions stated below. Sublicensing is not allowed; section 10 makes
|
||||
it unnecessary.
|
||||
|
||||
#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such
|
||||
circumvention is effected by exercising rights under this License with
|
||||
respect to the covered work, and you disclaim any intention to limit
|
||||
operation or modification of the work as a means of enforcing, against
|
||||
the work's users, your or third parties' legal rights to forbid
|
||||
circumvention of technological measures.
|
||||
|
||||
#### 4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
#### 5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these
|
||||
conditions:
|
||||
|
||||
- a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
- b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under
|
||||
section 7. This requirement modifies the requirement in section 4
|
||||
to "keep intact all notices".
|
||||
- c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
- d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
#### 6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms of
|
||||
sections 4 and 5, provided that you also convey the machine-readable
|
||||
Corresponding Source under the terms of this License, in one of these
|
||||
ways:
|
||||
|
||||
- a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
- b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the Corresponding
|
||||
Source from a network server at no charge.
|
||||
- c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
- d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
- e) Convey the object code using peer-to-peer transmission,
|
||||
provided you inform other peers where the object code and
|
||||
Corresponding Source of the work are being offered to the general
|
||||
public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal,
|
||||
family, or household purposes, or (2) anything designed or sold for
|
||||
incorporation into a dwelling. In determining whether a product is a
|
||||
consumer product, doubtful cases shall be resolved in favor of
|
||||
coverage. For a particular product received by a particular user,
|
||||
"normally used" refers to a typical or common use of that class of
|
||||
product, regardless of the status of the particular user or of the way
|
||||
in which the particular user actually uses, or expects or is expected
|
||||
to use, the product. A product is a consumer product regardless of
|
||||
whether the product has substantial commercial, industrial or
|
||||
non-consumer uses, unless such uses represent the only significant
|
||||
mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to
|
||||
install and execute modified versions of a covered work in that User
|
||||
Product from a modified version of its Corresponding Source. The
|
||||
information must suffice to ensure that the continued functioning of
|
||||
the modified object code is in no case prevented or interfered with
|
||||
solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or
|
||||
updates for a work that has been modified or installed by the
|
||||
recipient, or for the User Product in which it has been modified or
|
||||
installed. Access to a network may be denied when the modification
|
||||
itself materially and adversely affects the operation of the network
|
||||
or violates the rules and protocols for communication across the
|
||||
network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
#### 7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders
|
||||
of that material) supplement the terms of this License with terms:
|
||||
|
||||
- a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
- b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
- c) Prohibiting misrepresentation of the origin of that material,
|
||||
or requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
- d) Limiting the use for publicity purposes of names of licensors
|
||||
or authors of the material; or
|
||||
- e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
- f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions
|
||||
of it) with contractual assumptions of liability to the recipient,
|
||||
for any liability that these contractual assumptions directly
|
||||
impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions; the
|
||||
above requirements apply either way.
|
||||
|
||||
#### 8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
#### 9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or run
|
||||
a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
#### 10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
#### 11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims owned
|
||||
or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within the
|
||||
scope of its coverage, prohibits the exercise of, or is conditioned on
|
||||
the non-exercise of one or more of the rights that are specifically
|
||||
granted under this License. You may not convey a covered work if you
|
||||
are a party to an arrangement with a third party that is in the
|
||||
business of distributing software, under which you make payment to the
|
||||
third party based on the extent of your activity of conveying the
|
||||
work, and under which the third party grants, to any of the parties
|
||||
who would receive the covered work from you, a discriminatory patent
|
||||
license (a) in connection with copies of the covered work conveyed by
|
||||
you (or copies made from those copies), or (b) primarily for and in
|
||||
connection with specific products or compilations that contain the
|
||||
covered work, unless you entered into that arrangement, or that patent
|
||||
license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
#### 12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under
|
||||
this License and any other pertinent obligations, then as a
|
||||
consequence you may not convey it at all. For example, if you agree to
|
||||
terms that obligate you to collect a royalty for further conveying
|
||||
from those to whom you convey the Program, the only way you could
|
||||
satisfy both those terms and this License would be to refrain entirely
|
||||
from conveying the Program.
|
||||
|
||||
#### 13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your
|
||||
version supports such interaction) an opportunity to receive the
|
||||
Corresponding Source of your version by providing access to the
|
||||
Corresponding Source from a network server at no charge, through some
|
||||
standard or customary means of facilitating copying of software. This
|
||||
Corresponding Source shall include the Corresponding Source for any
|
||||
work covered by version 3 of the GNU General Public License that is
|
||||
incorporated pursuant to the following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
#### 14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Affero General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever
|
||||
published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions
|
||||
of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
#### 15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION.
|
||||
|
||||
#### 16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
#### 17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
### How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these
|
||||
terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to
|
||||
attach them to the start of each source file to most effectively state
|
||||
the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper
|
||||
mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for
|
||||
the specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. For more information on this, and how to apply and follow
|
||||
the GNU AGPL, see <https://www.gnu.org/licenses/>.
|
||||
62
README.md
62
README.md
|
|
@ -1,8 +1,60 @@
|
|||
### Pup
|
||||
A boilerplate for products.
|
||||
# Tod@s contra el Fuego (All Against Fire)
|
||||
|
||||
[Read the Documentation](http://cleverbeagle.com/pup)
|
||||
[](http://ci.comunes.org/job/todos-contra-el-fuego-web/)
|
||||
|
||||
---
|
||||
This is web service that notifies about fires detected in an area of your interest. It helps the early detection of fires and facilitates local mobilization, while the professional extinction services arrive.
|
||||
|
||||
Need help and want to stay accountable building your product? [Check out Clever Beagle](http://cleverbeagle.com).
|
||||
## Install
|
||||
|
||||
Prerrequisites: a running meteor (we share the `fuegos` database with the telegram bot).
|
||||
|
||||
Install `meteor` and run `meteor npm install` and `npm start`
|
||||
|
||||
Some other development deps (in debian & ubuntu):
|
||||
```
|
||||
apt-get install libcairo2-dev libjpeg-dev libgif-dev pkg-config
|
||||
```
|
||||
|
||||
### GeoIP
|
||||
|
||||
Configure [mirror and cron](https://www.npmjs.com/package/maxmind-geolite2-mirror) of the [geoip database](http://dev.maxmind.com/geoip/geoip2/geolite2/).
|
||||
|
||||
## Telegram bot
|
||||
|
||||
See our [bot](https://github.com/comunes/todos-contra-el-fuego/tree/master/telegram-bot).
|
||||
|
||||
More platforms and services in the future...
|
||||
|
||||
### Tests
|
||||
|
||||
We do tests via:
|
||||
```
|
||||
TEST_PORT=3000 TEST_WATCH=1 TEST_CLIENT=0 MONGO_URL=mongodb://localhost:27017/fuegostest meteor --settings settings-development.json test --driver-package meteortesting:mocha --port 3010
|
||||
|
||||
# and
|
||||
|
||||
node_modules/.bin/chimp --watch --ddp=http://localhost:3000 --path=cucumber
|
||||
|
||||
# and
|
||||
|
||||
node_modules/.bin/chimp --ddp=http://localhost:3000 --path=cucumber
|
||||
|
||||
```
|
||||
|
||||
### FAQ & Troubleshooting
|
||||
|
||||
**Q** - I get something like `(...) /node_modules/fibers/future.js:280 (...) Error: Could not locate the bindings file.` What can I do?
|
||||
**A** - Try `meteor npm rebuild`
|
||||
|
||||
## Data source acknowledgements
|
||||
|
||||
*We acknowledge the use of data and imagery from LANCE FIRMS operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ*.
|
||||
|
||||
## License
|
||||
|
||||
GNU APLv3. See our [LICENSE](https://github.com/comunes/todos-contra-el-fuego-web/blob/tcef-master/LICENSE.md), for a complete text.
|
||||
|
||||
## Thanks & other acknowlegments
|
||||
|
||||
Thanks indeed to:
|
||||
- Lupe Bao Reixa for Galician translation
|
||||
|
|
|
|||
16
bin/au-dee-npi.awk
Executable file
16
bin/au-dee-npi.awk
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
# cat file.csv| ./au-dee-npi.awk | mongoimport -d "fuegos" -c "industries"
|
||||
|
||||
gawk -F',' 'NR>1 { \
|
||||
gsub(/"/,"",$5);
|
||||
gsub(/"/,"",$6);
|
||||
gsub(/\t/,"",$13);
|
||||
gsub(/\t/,"",$14);
|
||||
gsub(/\x1a/,"",$13);
|
||||
gsub(/\x1a/,"",$14);
|
||||
lon = $14+0;
|
||||
lat = $13+0;
|
||||
name= $5", "$6
|
||||
gsub(/^, /,"",name);
|
||||
if (lon != 0 && lat != 0 && lon > -180 && lon < 180 && lat >= -90 && lat <= 90)
|
||||
printf("{name:\"%s\",geo:{type:\"Point\",coordinates:[%s,%s]},registry:\"4\"}\n" \
|
||||
,name,lon,lat)}'
|
||||
19
bin/ca-godp-npri.awk
Executable file
19
bin/ca-godp-npri.awk
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
# cat file.csv| ./ca-godp-npri.awk | uniq | mongoimport -d "fuegos" -c "industries"
|
||||
|
||||
gawk -F',' 'NR>1 { \
|
||||
gsub(/"/,"",$3);
|
||||
gsub(/"/,"",$4);
|
||||
gsub(/\t/,"",$3);
|
||||
gsub(/\t/,"",$4);
|
||||
gsub(/\x1a/,"",$3);
|
||||
gsub(/\x1a/,"",$4);
|
||||
lon = $16+0;
|
||||
lat = $15+0;
|
||||
if ($3 != $4)
|
||||
name= $3", "$4
|
||||
else
|
||||
name=$3
|
||||
gsub(/^, /,"",name);
|
||||
# if (lon != 0 && lat != 0 && lon > -180 && lon < 180 && lat >= -90 && lat <= 90)
|
||||
printf("{name:\"%s\",geo:{type:\"Point\",coordinates:[%s,%s]},registry:\"3\"}\n" \
|
||||
,name,lon,lat)}'
|
||||
14
bin/eu-eea-e-prtr.awk
Executable file
14
bin/eu-eea-e-prtr.awk
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
# cat dbo.PUBLISH_FACILITYREPORT.csv| ./eu-eea-e-prtr.awk | mongoimport -d "fuegos" -c "industries"
|
||||
|
||||
gawk -F',' 'NR>1 { \
|
||||
gsub(/"/,"",$6);
|
||||
gsub(/"/,"",$5);
|
||||
gsub(/\t/,"",$6);
|
||||
gsub(/\t/,"",$5);
|
||||
gsub(/\x1a/,"",$5);
|
||||
gsub(/\x1a/,"",$6);
|
||||
lon = $14+0;
|
||||
lat = $13+0;
|
||||
if (lon != 0 && lat != 0 && lon > -180 && lon < 180 && lat >= -90 && lat <= 90)
|
||||
printf("{name:\"%s, %s\",geo:{type:\"Point\",coordinates:[%s,%s]},registry:\"1\"}\n" \
|
||||
,$6,$5,lon,lat)}'
|
||||
10
bin/us-epa-frs.awk
Executable file
10
bin/us-epa-frs.awk
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
# cat NATIONAL_SINGLE.CSV| ./us-epa-frs.awk | mongoimport -d "fuegos" -c "industries"
|
||||
|
||||
gawk -F',' 'NR>1{ \
|
||||
gsub(/"/,"",$33);
|
||||
gsub(/"/,"",$32);
|
||||
gsub(/"/,"",$3);
|
||||
gsub(/\t/,"",$3);
|
||||
lon = $33+0;
|
||||
lat = $32+0;
|
||||
if (lon != 0 && lat != 0 && lon > -180 && lon < 180 && lat >= -90 && lat <= 90) { printf("{name:\"%s\",geo:{type:\"Point\",coordinates:[%s,%s]},registry:\"2\"}\n",name,lon,lat)}}'
|
||||
|
|
@ -1,11 +1,17 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Pup</title>
|
||||
<meta name="description" content="A description for the application.">
|
||||
<meta name="fragment" content="!">
|
||||
<title>All Against the Fire | Tod@s contra el Fuego</title>
|
||||
<meta name="description" content="Crowdsourcing against wildfires | Colaboración masiva contra los incendios">
|
||||
<meta name="viewport" content="initial-scale=1, minimal-ui, maximum-scale=1, minimum-scale=1" />
|
||||
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
|
||||
<link rel="shortcut icon" type="image/png" href="/favicon.png?v1" sizes="16x16 32x32 64x64">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-precomposed.png">
|
||||
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons">
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="/favicon.ico?v4" sizes="16x16 32x32 64x64">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-precomposed.png?v1">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -1 +1,4 @@
|
|||
import '../imports/startup/client';
|
||||
|
||||
// https://github.com/GoogleChrome/rendertron#rendering-budget-timeout
|
||||
window.renderComplete = false;
|
||||
|
|
|
|||
29
cucumber/chimp-config.js
Normal file
29
cucumber/chimp-config.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
module.exports = {
|
||||
// - - - - CHIMP - - - -
|
||||
/* watch: false,
|
||||
* watchTags: '@watch',
|
||||
* offline: false,
|
||||
*/
|
||||
// - - - - CUCUMBER - - - -
|
||||
/* path: './features',
|
||||
* jsonOutput: 'output.json', */
|
||||
|
||||
// '- - - - DEBUGGING - - - -
|
||||
log: 'info',
|
||||
debug: false,
|
||||
seleniumDebug: false,
|
||||
webdriverLogLevel: false,
|
||||
// debugBrkCucumber: 5858,
|
||||
// - - - - WEBDRIVER-IO - - - -
|
||||
webdriverio: {
|
||||
waitforTimeout: 10000,
|
||||
waitforInterval: 250, // KEEP SMALL (!!!) this is the INTERVAL in which waitFor* is looped fo
|
||||
desiredCapabilities: {
|
||||
chromeOptions: {
|
||||
// args: ["headless", "disable-gpu"]
|
||||
args: ['--disable-gpu', '--no-sandbox', '--headless']
|
||||
},
|
||||
isHeadless: true
|
||||
}
|
||||
}
|
||||
};
|
||||
22
cucumber/features/feedback.feature
Normal file
22
cucumber/features/feedback.feature
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
Feature: Allow users to give feedback
|
||||
|
||||
As a user (authenticated or not)
|
||||
I want to give feedback about this site
|
||||
|
||||
Scenario: A user can login and give feedback
|
||||
Given I am on the zones page
|
||||
And I have an account and I logged in
|
||||
# Because is not verified
|
||||
Then I can send feedback with email
|
||||
When I sign out
|
||||
Given I'm not logged
|
||||
Then I can send feedback with email
|
||||
|
||||
Scenario: A anon user can give feedback
|
||||
Given I am on the fires page
|
||||
Given I'm not logged
|
||||
Then I can send feedback with email
|
||||
|
||||
Scenario: A user cannot give feedback in home
|
||||
Given I am on the home page
|
||||
Then I cannot send feedback
|
||||
12
cucumber/features/general.feature
Normal file
12
cucumber/features/general.feature
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
Feature: This app should generate a correct sitemap, etc
|
||||
|
||||
Scenario: I verify that a sitemap is generated correctly
|
||||
Given the page sitemap.xml
|
||||
Then I check that exist this list of pages in the sitemap
|
||||
| license | License |
|
||||
| terms | Terms of Service |
|
||||
| credits | Credits |
|
||||
| privacy | Privacy Policy |
|
||||
| fires | Active Fires |
|
||||
| login | Login |
|
||||
| signup | Signup |
|
||||
34
cucumber/features/login.feature
Normal file
34
cucumber/features/login.feature
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
Feature: Allow users to login and logout
|
||||
|
||||
As a user
|
||||
I want to login and logout
|
||||
So that I can prove my identity and see personalized data
|
||||
|
||||
Background:
|
||||
Given I am on the home page
|
||||
|
||||
Scenario: A user can login
|
||||
Given I have an account and I logged in
|
||||
When I sign out
|
||||
When I enter my email and password
|
||||
Then I should be logged in
|
||||
And I can edit my profile
|
||||
|
||||
Scenario: A user cannot login with bad information
|
||||
Given I have an account and I logged in
|
||||
When I sign out
|
||||
When I enter incorrect authentication information
|
||||
Then I should see a user not found error
|
||||
|
||||
Scenario: A user can register and login
|
||||
Given I register with some name, password and email
|
||||
Then I should be registered
|
||||
And I should be logged in
|
||||
When I sign out
|
||||
When I enter my email and password
|
||||
Then I should be logged in
|
||||
And I can edit my profile
|
||||
|
||||
Scenario: A user cannot register without accepting service conditions
|
||||
Given I register with some name, password and email but without accept conditions
|
||||
Then I shouldn't be registered
|
||||
51
cucumber/features/pages.feature
Normal file
51
cucumber/features/pages.feature
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
Feature: Test all secundary pages
|
||||
|
||||
Background:
|
||||
Given I am on the home page
|
||||
|
||||
Scenario: Check that all secondary pages work well
|
||||
Given a list of page ids and contents
|
||||
| license | License |
|
||||
| tos | Terms of Service |
|
||||
| credits | Credits |
|
||||
| privacy | Privacy Policy |
|
||||
| activeFires | Active Fires |
|
||||
| about | About |
|
||||
Then I check that all pages works properly
|
||||
|
||||
Scenario: Check that all secondary pages work well when not logged
|
||||
Given I logout if logged
|
||||
And a list of page urls and contents
|
||||
| login | Login | true |
|
||||
| signup | Sign Up | true |
|
||||
| fires | Fires | true |
|
||||
| zones | Monitored | true |
|
||||
| recover-password | Recover Password | true |
|
||||
| verify-email/something | Verify | true |
|
||||
| fire/inexistent | This page doesn't exist | false |
|
||||
| fire/Fe26.2**1a0361ed0384f741403682e26b4bbc3850bee24e775da13c9782b22365ea895f*r_3gmVad5vzkeyqPpo6UcA*1s5fFz3iDGKTYP2RCvXMshof00QCHf4ErDl9K2dxoX0u-J-t6scyOWG8pGp3ehg_FfEtyR_kYcEKU3rE0jaSlZbD09TIvhiIJeS3C6Uc8YD-rit0XBrgsVKfYSxKzTRoOYiYFJ8JYd298hMtfiASePjS05Z58hhicyCcJYYRlarqDScG3LiVY3lL5y2nfcdIMNuSjCiKOJWuMkxwd9nR1UHMudLl0hEoy56mPdnHpDYtP9IYUlIOk1LlWBxcmHKifbXeqHu94p8j13Kk20dh2R49Hw3KsSoE9UbWmGQA9wAZXT82301i3rGF5GPAKjlTlRYcWisQurnPwHSVmx3DhUdiYwKGxt4KeaM5QVI4BE9octvE41OOprB_-Il105diQEh2Y9vdvX51ZVWIRfCboICPM6rJb0Oin7U7F1iM-oD_5s3DGnelfM5LGBcKwiB5paMo5M5vdBMaO-zR216cW9yGVXw9IZqHx8xDQWnoHAZjt8NLHeiGF2QOmIGtEUH7qnwhGpkcvszajmAZzR8saZgoH1qfBfvpVA41YfV14gU**4d030f05e23ad75409cebc609107467fc60be5077d52cf041087cd024fc4dc45*GY97aGFc1MyAsoO3Qxqtgwk9j-MbAPdEGBmEHq6r8VU | Additional information | false |
|
||||
Then I check that all page urls works properly
|
||||
|
||||
# And they are spiderable
|
||||
|
||||
@watch
|
||||
Scenario: Check that all secondary pages work well when logged
|
||||
Given I have an account and I logged in
|
||||
And a list of page urls and contents
|
||||
| status | Status | false |
|
||||
| fires | Fires | true |
|
||||
| zones | Monitored | true |
|
||||
| verify-email/something | Verify | true |
|
||||
| fire/inexistent | This page doesn't exist | false |
|
||||
| fire/Fe26.2**1a0361ed0384f741403682e26b4bbc3850bee24e775da13c9782b22365ea895f*r_3gmVad5vzkeyqPpo6UcA*1s5fFz3iDGKTYP2RCvXMshof00QCHf4ErDl9K2dxoX0u-J-t6scyOWG8pGp3ehg_FfEtyR_kYcEKU3rE0jaSlZbD09TIvhiIJeS3C6Uc8YD-rit0XBrgsVKfYSxKzTRoOYiYFJ8JYd298hMtfiASePjS05Z58hhicyCcJYYRlarqDScG3LiVY3lL5y2nfcdIMNuSjCiKOJWuMkxwd9nR1UHMudLl0hEoy56mPdnHpDYtP9IYUlIOk1LlWBxcmHKifbXeqHu94p8j13Kk20dh2R49Hw3KsSoE9UbWmGQA9wAZXT82301i3rGF5GPAKjlTlRYcWisQurnPwHSVmx3DhUdiYwKGxt4KeaM5QVI4BE9octvE41OOprB_-Il105diQEh2Y9vdvX51ZVWIRfCboICPM6rJb0Oin7U7F1iM-oD_5s3DGnelfM5LGBcKwiB5paMo5M5vdBMaO-zR216cW9yGVXw9IZqHx8xDQWnoHAZjt8NLHeiGF2QOmIGtEUH7qnwhGpkcvszajmAZzR8saZgoH1qfBfvpVA41YfV14gU**4d030f05e23ad75409cebc609107467fc60be5077d52cf041087cd024fc4dc45*GY97aGFc1MyAsoO3Qxqtgwk9j-MbAPdEGBmEHq6r8VU | Additional information | false |
|
||||
Then I check that all page urls works properly
|
||||
|
||||
Scenario: Check that other non visible pages work well
|
||||
Given I logout if logged
|
||||
And a list of non visible pages ids and contents
|
||||
| error | Upppps | false |
|
||||
# FIXME: find a way to monitor json pages
|
||||
# | api/v1/status/last-fire-detected | updateAt |
|
||||
# | api/v1/status/last-fire-check | description |
|
||||
# | api/v1/status/active-fires-count | total |
|
||||
Then I check that all non visible pages works properly
|
||||
50
cucumber/features/steps_definitions/feedback.js
Normal file
50
cucumber/features/steps_definitions/feedback.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/* global module expect require process client */
|
||||
|
||||
const { randomText, randomEmail } = require('./helper.js');
|
||||
|
||||
module.exports = function doSteps() {
|
||||
this.Given(/^I am on the zones page$/, () => {
|
||||
client.url(`${process.env.ROOT_URL}/zones`);
|
||||
if (client.isVisible('#logout')) {
|
||||
client.click('#logout');
|
||||
}
|
||||
});
|
||||
|
||||
this.Then(/^I can send feedback without email$/, () => {
|
||||
client.waitForVisible('#feedback-tab', 10000);
|
||||
client.click('#feedback-tab');
|
||||
client.waitForVisible('#feedback-form', 10000);
|
||||
client.setValue('#feedbackTextarea', randomText(500));
|
||||
client.click('#sendFeedbackBtn');
|
||||
client.waitForVisible('.bert-alert', 10000, true);
|
||||
client.waitUntil(() => client.isVisible('.bert-alert') === false, 10000);
|
||||
});
|
||||
|
||||
this.Then(/^I can send feedback with email$/, () => {
|
||||
client.waitForVisible('#feedback-tab', 10000);
|
||||
client.click('#feedback-tab');
|
||||
client.waitForVisible('#feedback-form', 10000);
|
||||
client.waitForEnabled('input[name="email"]');
|
||||
client.setValue('input[name="email"]', randomEmail());
|
||||
client.setValue('#feedbackTextarea', randomText(500));
|
||||
client.click('#sendFeedbackBtn');
|
||||
client.waitForVisible('.bert-alert', 10000, true);
|
||||
client.waitUntil(() => client.isVisible('.bert-alert') === false, 10000);
|
||||
});
|
||||
|
||||
this.Given(/^I'm not logged$/, () => {
|
||||
client.waitForVisible('#react-root', 5000);
|
||||
if (client.isVisible('#logout')) {
|
||||
client.click('#logout');
|
||||
}
|
||||
});
|
||||
|
||||
this.Given(/^I am on the fires page$/, () => {
|
||||
client.url(`${process.env.ROOT_URL}/fires`);
|
||||
});
|
||||
|
||||
this.Then(/^I cannot send feedback$/, () => {
|
||||
client.waitForVisible('#react-root', 5000);
|
||||
client.waitUntil(() => client.isVisible('#feedback-tab') === false, 10000);
|
||||
});
|
||||
};
|
||||
20
cucumber/features/steps_definitions/general.js
Normal file
20
cucumber/features/steps_definitions/general.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* global module expect require process client */
|
||||
|
||||
module.exports = function doSteps() {
|
||||
let pages;
|
||||
|
||||
this.Then(/^I check that exist this list of pages in the sitemap$/, (table, callback) => {
|
||||
// Write code here that turns the phrase above into concrete actions
|
||||
pages = table.raw();
|
||||
for (let i = 0; i < pages.length; i += 1) {
|
||||
// TODO download sitemap and parse
|
||||
// client.waitForText('.text', pages[i][0]);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Given(/^the page sitemap\.xml$/, (callback) => {
|
||||
client.url(`${process.env.ROOT_URL}/sitemap.xml`);
|
||||
callback();
|
||||
});
|
||||
};
|
||||
32
cucumber/features/steps_definitions/helper.js
Normal file
32
cucumber/features/steps_definitions/helper.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// https://stackoverflow.com/questions/1349404/generate-random-string-characters-in-javascript
|
||||
function makeid(size) {
|
||||
let text = '';
|
||||
const possible = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
for (let i = 0; i < size; i += 1) {
|
||||
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
export const randomText = n => makeid(n);
|
||||
|
||||
export const randomUsername = () => makeid(7);
|
||||
|
||||
export const randomPassword = () => randomUsername();
|
||||
|
||||
export const randomEmail = () => `${randomUsername()}@example.com`;
|
||||
|
||||
export const goHome = (client) => {
|
||||
client.url(process.env.ROOT_URL);
|
||||
client.waitForVisible('#react-root', 10000);
|
||||
expect(client.isVisible('#react-root')).toBe(true);
|
||||
client.waitUntil(() => client.isVisible('.pg-loading-center-middle') === false, 5000);
|
||||
client.waitUntil(() => client.isVisible('.pg-loading-center-middle') === false, 5000);
|
||||
// Close alert
|
||||
if (client.isVisible('.bert-content')) {
|
||||
client.click('.bert-content');
|
||||
}
|
||||
if (client.isVisible('#acceptCookies')) {
|
||||
client.click('#acceptCookies');
|
||||
}
|
||||
};
|
||||
75
cucumber/features/steps_definitions/hooks.js
Normal file
75
cucumber/features/steps_definitions/hooks.js
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/* global client */
|
||||
|
||||
(function () {
|
||||
module.exports = function () {
|
||||
const printLog = (type) => {
|
||||
client.log(type).value.forEach((logItem) => {
|
||||
const { source, message } = logItem;
|
||||
if (type === 'browser' && source === 'console-api') {
|
||||
// Clean messages of type:
|
||||
// http://localhost:3000/app/app.js?hash=34da4258bd2caa4e14c7c0c20ba6396f309e7236 13325:18 "GMaps script just loaded"
|
||||
// to get the last part
|
||||
const cleanMessage = message.replace(/[^ ]{1,} [^ ]{1,} "(.*)"$/g, '$1');
|
||||
console.log(`${logItem.level}: ${cleanMessage}`);
|
||||
} else {
|
||||
// Right now we don't need logs like:
|
||||
// %cDownload the React DevTools for a better development experience: https://fb.me/react-devtools
|
||||
// console.log(`${logItem.level}: ${message}`);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.StepResult((stepResult) => {
|
||||
if (stepResult.getStatus() === 'failed') {
|
||||
// http://webdriver.io/api/protocol/log.html
|
||||
console.log(`Step result: ${stepResult.getStatus()}`);
|
||||
printLog('browser');
|
||||
}
|
||||
});
|
||||
|
||||
this.Before(() => {
|
||||
// global.expect = require('@xolvio/jasmine-expect').expect;
|
||||
|
||||
// https://github.com/webdriverio/webdriverio/issues/1145
|
||||
if (!this.initMyCmds) {
|
||||
client.addCommand('waitForClickable', function elementClickable(selector, timeout) {
|
||||
this.waitForVisible(selector, timeout);
|
||||
this.waitForEnabled(selector, timeout);
|
||||
});
|
||||
|
||||
client.addCommand('waitUntilText', function waitUntilText(selector, text, ms) {
|
||||
ms = ms || 5000;
|
||||
this.waitForVisible(selector);
|
||||
const self = this;
|
||||
this.waitUntil(() => self.getText(selector).includes(text), ms, `expected text in ${selector} be different after ${ms / 1000}s. Obtained: '${self.getText(selector)}' expected: '${text}'`);
|
||||
});
|
||||
|
||||
this.initMyCmds = true;
|
||||
}
|
||||
|
||||
client.windowHandleSize({ width: 1500, height: 1000 });
|
||||
|
||||
// server.call('fixtures/reset');
|
||||
// server.call('emailStub/reset');
|
||||
// server.call('emailStub/stub');
|
||||
// server.call('fixtures/stubCloudFrontClient');
|
||||
|
||||
// go to the page first so we have access to the Meteor object
|
||||
// console.log('Before all tests...');
|
||||
// client.url(process.env.ROOT_URL);
|
||||
/* client.executeAsync(function (done) {
|
||||
* var customer = {
|
||||
* id: 'randomId',
|
||||
* email: 'me@example.com',
|
||||
* subscriptions: {
|
||||
* data: [{
|
||||
* current_period_start: 1436716844,
|
||||
* current_period_end: 1436716844
|
||||
* }]
|
||||
* }
|
||||
* }; */
|
||||
// this call will stub stripe both on the client and server
|
||||
// Meteor.call('stripeStub/stub', customer, done);
|
||||
});
|
||||
};
|
||||
}());
|
||||
150
cucumber/features/steps_definitions/login.js
Normal file
150
cucumber/features/steps_definitions/login.js
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
/* global module expect require process client */
|
||||
|
||||
const {
|
||||
goHome, randomUsername, randomPassword, randomEmail
|
||||
} = require('./helper.js');
|
||||
|
||||
let firstName;
|
||||
let lastName;
|
||||
let pass;
|
||||
let email;
|
||||
|
||||
const setUserValues = (isEdit) => {
|
||||
client.waitForVisible('input[name="firstName"]', 10000);
|
||||
firstName = randomUsername();
|
||||
lastName = randomUsername();
|
||||
email = randomEmail();
|
||||
client.setValue('input[name="firstName"]', firstName);
|
||||
client.setValue('input[name="lastName"]', lastName);
|
||||
client.setValue('input[name="emailAddress"]', email);
|
||||
if (isEdit) {
|
||||
client.setValue('input[name="currentPassword"]', pass);
|
||||
pass = randomPassword();
|
||||
client.setValue('input[name="newPassword"]', pass);
|
||||
} else {
|
||||
pass = randomPassword();
|
||||
client.setValue('input[name="password"]', pass);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = function doSteps(notos) {
|
||||
this.Given(/^I am on the home page$/, () => {
|
||||
goHome(client);
|
||||
});
|
||||
|
||||
function waitNoBert() {
|
||||
client.pause(2000);
|
||||
if (client.isVisible('.bert-container')) {
|
||||
// console.log('Removing bert alert');
|
||||
client.click('.bert-container');
|
||||
client.waitForVisible('.bert-container', 10000, true);
|
||||
} else {
|
||||
// console.log('No bert alert');
|
||||
}
|
||||
}
|
||||
|
||||
function logoutIfLogged() {
|
||||
if (client.isVisible('#logout')) {
|
||||
client.click('#logout');
|
||||
}
|
||||
client.waitForVisible('#signup', 10000);
|
||||
}
|
||||
|
||||
function register() {
|
||||
logoutIfLogged();
|
||||
client.waitForVisible('#signup', 10000);
|
||||
client.click('#signup');
|
||||
setUserValues();
|
||||
if (!notos) {
|
||||
client.click('input[name="tos"]');
|
||||
}
|
||||
client.click('#signUpSubmit');
|
||||
client.waitForVisible('#logout', 10000);
|
||||
}
|
||||
|
||||
this.Given(/^I logout if logged$/, () => {
|
||||
waitNoBert();
|
||||
logoutIfLogged();
|
||||
});
|
||||
|
||||
this.Given(/^I have an account and I logged in$/, () => {
|
||||
register();
|
||||
});
|
||||
|
||||
function checkName() {
|
||||
client.waitForVisible('#profile', 5000);
|
||||
client.waitUntilText('#profile', firstName);
|
||||
client.waitUntilText('#profile', lastName);
|
||||
}
|
||||
|
||||
this.Then(/^I should be logged in$/, () => {
|
||||
client.waitUntil(() => client.isVisible('#logout') === true, 10000);
|
||||
client.waitUntil(() => client.isVisible('#profile') === true, 10000);
|
||||
});
|
||||
|
||||
/* this.Given(/^I am signed out$/, () => {
|
||||
* client.waitUntil(() => client.isVisible('#logout') === true, 10000);
|
||||
* });
|
||||
*/
|
||||
|
||||
|
||||
this.When(/^I sign out$/, () => {
|
||||
waitNoBert();
|
||||
client.waitForClickable('#logout', 10000);
|
||||
// client.waitForVisible('#logout', 10000);
|
||||
client.click('#logout');
|
||||
client.waitForVisible('#login', 10000);
|
||||
});
|
||||
|
||||
function login(badpass) {
|
||||
waitNoBert();
|
||||
client.waitForVisible('#login', 10000);
|
||||
client.click('#login');
|
||||
client.waitForVisible('#loginSubmit', 5000);
|
||||
client.setValue('input[name="emailAddress"]', email);
|
||||
client.setValue('input[name="password"]', badpass ? randomPassword() : pass);
|
||||
client.click('#loginSubmit');
|
||||
waitNoBert();
|
||||
}
|
||||
|
||||
this.When(/^I enter my email and password$/, () => {
|
||||
login();
|
||||
});
|
||||
|
||||
this.Then(/^I can edit my profile$/, () => {
|
||||
waitNoBert();
|
||||
client.waitForClickable('#profile', 10000);
|
||||
client.click('#profile');
|
||||
client.pause(2000);
|
||||
setUserValues(true);
|
||||
client.click('#profileSubmit');
|
||||
waitNoBert();
|
||||
checkName();
|
||||
});
|
||||
|
||||
this.When(/^I enter incorrect authentication information$/, () => {
|
||||
login(true);
|
||||
});
|
||||
|
||||
this.Then(/^I should see a user not found error$/, () => {
|
||||
client.waitForVisible('.alert-danger', 10000, true);
|
||||
});
|
||||
|
||||
this.Given(/^I register with some name, password and email$/, () => {
|
||||
register();
|
||||
});
|
||||
|
||||
this.Then(/^I should be registered$/, () => {
|
||||
client.waitForVisible('.bert-alert', 10000, true);
|
||||
waitNoBert();
|
||||
});
|
||||
|
||||
this.Given(/^I register with some name, password and email but without accept conditions$/, () => {
|
||||
register(true);
|
||||
});
|
||||
|
||||
this.Then(/^I shouldn't be registered$/, () => {
|
||||
client.waitForVisible('.bert-alert', 10000, true);
|
||||
client.waitForVisible('#login', 10000, true);
|
||||
});
|
||||
};
|
||||
81
cucumber/features/steps_definitions/pages.js
Normal file
81
cucumber/features/steps_definitions/pages.js
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/* global module expect require process client */
|
||||
|
||||
const { goHome } = require('./helper.js');
|
||||
|
||||
// Does no works with arrow func
|
||||
module.exports = function () {
|
||||
let pages;
|
||||
|
||||
this.Given(/^a list of page ids and contents$/, (table, callback) => {
|
||||
pages = table.raw();
|
||||
callback();
|
||||
});
|
||||
|
||||
function processPage(i) {
|
||||
const id = `#${pages[i][0]}`;
|
||||
const content = pages[i][1];
|
||||
client.waitForVisible(id, 10000);
|
||||
client.click(id);
|
||||
client.waitUntilText('#react-root', content);
|
||||
// https://jasmine.github.io/2.3/introduction.html#section-Expectations
|
||||
expect(client.getTitle()).toContain(pages[i][1]);
|
||||
}
|
||||
|
||||
function processPageUrl(i) {
|
||||
const url = `${pages[i][0]}`;
|
||||
const content = pages[i][1];
|
||||
client.url(`${process.env.ROOT_URL}/${url}`);
|
||||
client.waitForVisible('#react-root', 10000);
|
||||
client.waitUntilText('#react-root', content);
|
||||
const checkTitle = pages[i][2] === 'true';
|
||||
// https://jasmine.github.io/2.3/introduction.html#section-Expectations
|
||||
if (checkTitle) {
|
||||
expect(client.getTitle()).toContain(pages[i][1]);
|
||||
}
|
||||
}
|
||||
|
||||
this.Given(/^a list of non visible pages ids and contents$/, (table, callback) => {
|
||||
pages = table.raw();
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Then(/^I check that all non visible pages works properly$/, (callback) => {
|
||||
for (let i = 0; i < pages.length; i += 1) {
|
||||
processPageUrl(i);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Then(/^I check that all pages works properly$/, (callback) => {
|
||||
goHome(client);
|
||||
if (client.isVisible('#logout')) {
|
||||
client.click('#logout');
|
||||
}
|
||||
for (let i = 0; i < pages.length; i += 1) {
|
||||
processPage(i);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Given(/^a list of page urls and contents$/, (table, callback) => {
|
||||
pages = table.raw();
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Then(/^I check that all page urls works properly$/, (callback) => {
|
||||
goHome(client);
|
||||
for (let i = 0; i < pages.length; i += 1) {
|
||||
processPageUrl(i);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Then(/^they are spiderable$/, (callback) => {
|
||||
// Write code here that turns the phrase above into concrete actions
|
||||
for (let i = 0; i < pages.length; i += 1) {
|
||||
client.url(`${process.env.ROOT_URL}/${pages[i][0]}?_escaped_fragment_=`);
|
||||
client.waitUntilText('#react-root', pages[i][1]);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
};
|
||||
BIN
designs/California_Wildfires_October_23_2007.jpg
Normal file
BIN
designs/California_Wildfires_October_23_2007.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 304 KiB |
659
designs/icons-tcef.svg
Normal file
659
designs/icons-tcef.svg
Normal file
|
|
@ -0,0 +1,659 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="210mm"
|
||||
height="297mm"
|
||||
viewBox="0 0 210 297"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
sodipodi:docname="icons-tcef.svg"
|
||||
inkscape:version="0.92.1 r15371"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/fire-marker.png"
|
||||
inkscape:export-xdpi="6"
|
||||
inkscape:export-ydpi="6">
|
||||
<defs
|
||||
id="defs2">
|
||||
<inkscape:path-effect
|
||||
effect="spiro"
|
||||
id="path-effect8561"
|
||||
is_visible="true" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8559"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="spiro"
|
||||
id="path-effect8555"
|
||||
is_visible="true" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8553"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="spiro"
|
||||
id="path-effect8549"
|
||||
is_visible="true" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8547"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="spiro"
|
||||
id="path-effect8543"
|
||||
is_visible="true" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8541"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="spiro"
|
||||
id="path-effect8537"
|
||||
is_visible="true" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8535"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="spiro"
|
||||
id="path-effect8531"
|
||||
is_visible="true" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8529"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8525"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8521"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8517"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8513"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8509"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00885213"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8505"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00108696"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="powerstroke"
|
||||
id="path-effect8501"
|
||||
is_visible="true"
|
||||
offset_points="0,0.13229166"
|
||||
sort_points="true"
|
||||
interpolator_type="CubicBezierJohan"
|
||||
interpolator_beta="0.2"
|
||||
start_linecap_type="zerowidth"
|
||||
linejoin_type="extrp_arc"
|
||||
miter_limit="4"
|
||||
end_linecap_type="zerowidth" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8499"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00108696"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8495"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00108696"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
<inkscape:path-effect
|
||||
effect="simplify"
|
||||
id="path-effect8491"
|
||||
is_visible="true"
|
||||
steps="1"
|
||||
threshold="0.00108696"
|
||||
smooth_angles="360"
|
||||
helper_size="0"
|
||||
simplify_individual_paths="false"
|
||||
simplify_just_coalesce="false"
|
||||
simplifyindividualpaths="false"
|
||||
simplifyJustCoalesce="false" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.23559314"
|
||||
inkscape:cx="-2890.4884"
|
||||
inkscape:cy="-486.23766"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="983"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="438"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Capa 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
style="fill:#d45500;stroke-width:2.49893761"
|
||||
transform="matrix(0.15677218,0,0,0.1664724,230.41495,-36.603316)"
|
||||
id="g3415"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/your-position.png"
|
||||
inkscape:export-xdpi="24.116745"
|
||||
inkscape:export-ydpi="24.116745">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3417"
|
||||
d="m -1175.4664,736.62077 c -33.3138,-46.82732 -77.1492,-115.69563 -102.6366,-161.24879 -11.7453,-20.99204 -30.2969,-58.12091 -37.2515,-74.55449 -7.183,-16.97323 -15.1659,-40.43141 -18.3579,-53.94551 -3.2265,-13.66018 -3.2134,-40.78621 0.027,-56 13.0118,-61.09044 54.0725,-108.07064 111.0233,-127.02878 21.0744,-7.01539 29.7628,-8.3724 53.6051,-8.3724 18.0191,0 22.4905,0.32004 31.5,2.2546 69.2952,14.87936 118.3985,63.98934 133.1284,133.14658 3.2404,15.21379 3.2535,42.33982 0.027,56 -9.6695,40.93833 -34.9549,94.97325 -78.2137,167.1432 -22.584,37.67742 -55.6479,88.3297 -80.0323,122.60559 -5.6923,8.00126 -7.1265,8.00126 -12.8188,0 z m 17.7947,-267.80868 c 16.0798,-3.70704 31.3478,-18.97505 35.0548,-35.05477 1.2978,-5.6293 1.2978,-17.14138 0,-22.77068 -3.707,-16.07972 -18.975,-31.34773 -35.0548,-35.05477 -5.6293,-1.29778 -17.1413,-1.29778 -22.7706,0 -16.0798,3.70704 -31.3478,18.97505 -35.0548,35.05477 -1.2978,5.6293 -1.2978,17.14138 0,22.77068 3.6281,15.73725 17.9483,30.40113 33.9401,34.75463 5.5299,1.50543 17.9787,1.66186 23.8853,0.30014 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3419"
|
||||
d="m -1171.7343,740.159 c -0.8549,-0.98286 -6.7152,-9.21202 -13.0229,-18.28702 -57.6746,-82.97704 -106.6281,-166.52227 -130.6675,-223 -7.5823,-17.81379 -15.6335,-42.59765 -18.1919,-56 -1.9075,-9.99286 -2.1192,-13.59689 -1.615,-27.5 0.6601,-18.20107 2.7364,-29.95437 8.149,-46.12976 16.6315,-49.70266 56.2471,-88.97673 106.1932,-105.27769 18.8485,-6.15159 28.6855,-7.59255 51.8324,-7.59255 23.1469,0 32.9839,1.44096 51.8324,7.59255 49.946,16.30096 89.5617,55.57503 106.1932,105.27769 5.4126,16.17539 7.4889,27.92869 8.149,46.12976 0.5042,13.90311 0.2925,17.50714 -1.615,27.5 -9.8997,51.86069 -57.3486,143.38266 -131.1659,253 -21.9938,32.66028 -31.1985,45.43501 -32.9858,45.77921 -0.842,0.16216 -2.2304,-0.50932 -3.0852,-1.49219 z m 14.484,-270.77869 c 8.8507,-2.30531 15.5691,-6.19896 22.2859,-12.91574 15.3233,-15.32331 18.7123,-37.24354 8.7865,-56.83126 -3.3849,-6.67972 -13.4607,-16.75552 -20.1404,-20.14039 -19.5878,-9.92585 -41.508,-6.53684 -56.8313,8.78647 -19.3033,19.30326 -19.3033,48.88192 0,68.18518 12.3601,12.36013 29.5075,17.18527 45.8993,12.91574 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3421"
|
||||
d="m -1170.2383,741.02946 c -2.9702,-1.95299 -47.5638,-68.36498 -68.9314,-102.65748 -60.3859,-96.91256 -92.6314,-167.65863 -95.9441,-210.5 -0.71,-9.18142 0.7359,-26.96889 3.1702,-39 5.3885,-26.6314 19.6741,-55.21797 38.1803,-76.40168 33.7565,-38.64042 87.425,-60.38026 137.6514,-55.75937 16.142,1.48508 25.2032,3.34552 39.6542,8.14177 49.5805,16.45568 88.4643,55.33946 104.92,104.92 6.514,19.62659 9.7891,41.9139 8.5375,58.09928 -3.7383,48.34554 -45.5692,134.74542 -120.3123,248.5 -19.0693,29.02239 -43.4664,64.32456 -44.8352,64.87575 -0.5999,0.24157 -1.5406,0.14334 -2.0906,-0.21827 z m 14.3311,-271.55241 c 15.9065,-4.23527 29.72,-18.04873 33.9553,-33.95526 1.7594,-6.60785 1.7594,-19.69177 0,-26.29962 -2.0654,-7.7571 -6.4729,-15.22633 -12.6009,-21.35435 -6.1281,-6.12801 -13.5973,-10.53551 -21.3544,-12.60091 -6.6078,-1.75941 -19.6918,-1.75941 -26.2996,0 -15.9065,4.23527 -29.72,18.04873 -33.9553,33.95526 -1.7594,6.60785 -1.7594,19.69177 0,26.29962 4.169,15.65766 17.9617,29.61638 33.4976,33.90073 6.2073,1.71181 20.4242,1.74078 26.7573,0.0545 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3423"
|
||||
d="m -1182.2542,723.62198 c -16.7382,-23.96496 -42.0532,-62.31689 -57.2403,-86.71831 -49.2012,-79.05289 -78.8337,-139.03161 -90.7948,-183.77671 -3.6442,-13.63234 -3.6769,-13.92884 -3.6618,-33.25498 0.013,-16.40263 0.3725,-21.16781 2.2647,-30 14.2597,-66.56303 63.458,-115.76695 130.1294,-130.1443 9.1148,-1.96557 13.4023,-2.26427 32.5,-2.26427 19.0977,0 23.3852,0.2987 32.5,2.26427 66.6714,14.37735 115.8697,63.58127 130.1294,130.1443 1.8922,8.83219 2.2519,13.59737 2.2647,30 0.015,19.32614 -0.018,19.62264 -3.6618,33.25498 -11.9611,44.7451 -41.5936,104.72382 -90.7948,183.77671 -25.1343,40.38391 -68.2121,103.96831 -70.4375,103.96831 -0.632,0 -6.5707,-7.7625 -13.1972,-17.25 z m 25.1556,-253.28119 c 21.7615,-5.66814 37.5416,-25.8312 37.5416,-47.96881 0,-26.74861 -22.7514,-49.5 -49.5,-49.5 -22.1376,0 -42.3007,15.78009 -47.9688,37.54155 -7.9007,30.33286 15.8887,61.07445 47.5087,61.39264 3.5969,0.0362 9.1853,-0.62323 12.4185,-1.46538 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3425"
|
||||
d="m -1173.3221,735.64911 c -14.736,-20.10305 -47.0049,-68.57689 -66.4214,-99.77713 -62.4262,-100.31218 -94.8141,-173.76608 -94.7994,-215 0.019,-52.73909 28.6524,-105.90263 72.9978,-135.53357 69.4255,-46.38905 160.1263,-34.87659 216.3183,27.45683 17.8358,19.78504 32.8422,49.59683 38.0432,75.57674 2.0586,10.28307 3.6096,24.23637 3.6125,32.5 0.017,46.98038 -42.1573,135.99251 -121.7666,257 -16.9567,25.77445 -41.6783,61.54761 -43.1709,62.4701 -0.5199,0.32129 -2.6859,-1.79054 -4.8135,-4.69297 z m 16.6337,-265.22977 c 8.643,-2.30041 16.0792,-6.61994 22.569,-13.10973 19.5461,-19.54606 19.5461,-50.3292 0,-69.87526 -19.546,-19.54606 -50.3292,-19.54606 -69.8752,0 -19.5461,19.54606 -19.5461,50.3292 0,69.87526 6.3152,6.31524 13.9223,10.80572 22.1253,13.06068 6.468,1.778 18.5962,1.80163 25.1809,0.049 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3427"
|
||||
d="m -1182.3104,722.62198 c -17.5832,-25.21705 -46.9653,-70.02195 -62.463,-95.25 -53.9505,-87.82403 -84.0083,-153.91828 -88.8089,-195.28273 -2.8568,-24.61567 3.9195,-58.05424 17.0874,-84.31906 14.9367,-29.79285 43.0433,-57.89943 72.8361,-72.83609 46.9071,-23.51687 102.2965,-23.51687 149.2036,0 29.7928,14.93666 57.8994,43.04324 72.8361,72.83609 13.1678,26.26482 19.9443,59.70339 17.0874,84.31906 -4.8006,41.36445 -34.8584,107.4587 -88.8089,195.28273 -25.6831,41.80848 -73.2609,112.5 -75.7164,112.5 -0.6739,0 -6.638,-7.7625 -13.2534,-17.25 z m 28.8636,-252.78714 c 14.9934,-5.05091 26.7945,-16.83777 31.8332,-31.79475 2.84,-8.4305 2.849,-22.87899 0.019,-31.27836 -5.0509,-14.99339 -16.8378,-26.79448 -31.7948,-31.83312 -8.4589,-2.8496 -22.8773,-2.8496 -31.3362,0 -14.957,5.03864 -26.7438,16.83973 -31.7948,31.83312 -4.2232,12.53664 -2.2398,30.34688 4.615,41.43896 6.0015,9.71133 16.2078,17.88124 26.9565,21.57806 8.2521,2.83815 23.1644,2.8647 31.5017,0.0561 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3429"
|
||||
d="m -1177.0361,729.2292 c -12.0748,-17.04099 -42.0178,-61.97211 -55.2177,-82.85722 -54.0333,-85.49299 -89.0481,-156.54229 -98.3182,-199.5 -4.1682,-19.31544 -3.6385,-40.89984 1.5396,-62.72802 17.5765,-74.09457 83.6516,-126.23294 159.9754,-126.23294 76.3238,0 142.3989,52.13837 159.9754,126.23294 5.1781,21.82818 5.7078,43.41258 1.5396,62.72802 -9.2711,42.96238 -44.3741,114.18565 -98.325,199.5 -19.1931,30.35063 -57.9257,87.87564 -62.1857,92.35722 -1.07,1.12557 -2.6032,-0.49583 -8.9834,-9.5 z m 19.386,-257.897 c 18.3977,-4.33663 33.2167,-19.15566 37.5533,-37.55329 6.3215,-26.8182 -10.5958,-54.01281 -37.5533,-60.36715 -31.1031,-7.33152 -61.8773,17.01847 -61.8773,48.96022 0,31.94468 30.7714,56.29242 61.8773,48.96022 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3431"
|
||||
d="m -1180.3055,723.12198 c -39.6386,-56.78097 -80.8763,-123.18906 -105.5103,-169.91097 -22.6038,-42.87113 -35.6673,-73.90745 -42.9114,-101.94924 -3.2234,-12.47773 -3.3276,-13.49718 -3.2613,-31.88979 0.056,-15.57539 0.462,-20.83205 2.2515,-29.16436 7.1745,-33.40579 21.3734,-59.65036 45.1194,-83.39628 23.7312,-23.73126 49.8284,-37.85761 83.3962,-45.14216 8.7531,-1.89951 13.219,-2.20577 32.1644,-2.20577 18.9454,0 23.4113,0.30626 32.1644,2.20577 33.5678,7.28455 59.665,21.4109 83.3962,45.14216 23.746,23.74592 37.9449,49.99049 45.1194,83.39628 1.7895,8.33231 2.1954,13.58897 2.2515,29.16436 0.066,18.39261 -0.038,19.41206 -3.2614,31.88979 -13.5578,52.48201 -54.8103,131.45948 -120.1942,230.11021 -16.0695,24.24545 -38.9,57.5 -39.4759,57.5 -0.1395,0 -5.2013,-7.0875 -11.2485,-15.75 z m 22.6554,-251.78978 c 18.3977,-4.33663 33.2167,-19.15566 37.5533,-37.55329 6.3215,-26.8182 -10.5958,-54.01281 -37.5533,-60.36715 -31.1031,-7.33152 -61.8773,17.01847 -61.8773,48.96022 0,31.94468 30.7714,56.29242 61.8773,48.96022 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3433"
|
||||
d="m -1180.3055,723.12198 c -39.6386,-56.78097 -80.8763,-123.18906 -105.5103,-169.91097 -22.6038,-42.87113 -35.6673,-73.90745 -42.9114,-101.94924 -3.2234,-12.47773 -3.3276,-13.49718 -3.2613,-31.88979 0.056,-15.57539 0.462,-20.83205 2.2515,-29.16436 7.1745,-33.40579 21.3734,-59.65036 45.1194,-83.39628 23.7312,-23.73126 49.8284,-37.85761 83.3962,-45.14216 8.7531,-1.89951 13.219,-2.20577 32.1644,-2.20577 18.9454,0 23.4113,0.30626 32.1644,2.20577 33.5678,7.28455 59.665,21.4109 83.3962,45.14216 23.746,23.74592 37.9449,49.99049 45.1194,83.39628 1.7895,8.33231 2.1954,13.58897 2.2515,29.16436 0.066,18.39261 -0.038,19.41206 -3.2614,31.88979 -13.5578,52.48201 -54.8103,131.45948 -120.1942,230.11021 -16.0695,24.24545 -38.9,57.5 -39.4759,57.5 -0.1395,0 -5.2013,-7.0875 -11.2485,-15.75 z m 18.5351,-250.28529 c 13.9837,-2.26924 25.755,-9.26119 33.6522,-19.98875 16.7117,-22.70124 11.9971,-54.88064 -10.4628,-71.41474 -22.7013,-16.7117 -54.8807,-11.99716 -71.4148,10.46282 -22.6861,30.81689 -4.9477,74.57716 32.7855,80.8812 7.2167,1.20568 8.3498,1.21005 15.4399,0.0595 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3435"
|
||||
d="m -1182.057,512.8323 c -12.7719,-1.98971 -27.5723,-7.86265 -38.5,-15.27721 -6.7621,-4.58817 -18.715,-16.43678 -23.1795,-22.97738 -5.5725,-8.16373 -11.4255,-20.82211 -13.9666,-30.20573 -3.0901,-11.41104 -3.0901,-32.58896 0,-44 2.386,-8.81088 8.3129,-21.90823 13.2408,-29.25941 4.5234,-6.74778 16.4008,-18.72538 23.1996,-23.3953 8.1117,-5.57172 20.7757,-11.43775 30.2057,-13.99136 11.411,-3.09009 32.589,-3.09009 44,0 16.4827,4.46348 31.3856,13.21179 43.1137,25.30869 8.4566,8.72253 12.1221,14.00001 17.4177,25.07797 14.1075,29.51145 10.8829,63.98309 -8.5367,91.25941 -4.9505,6.95336 -15.862,17.66925 -22.8214,22.41216 -7.1793,4.89282 -20.5797,10.88896 -29.3895,13.1507 -9.0307,2.31843 -26.1035,3.24975 -34.7838,1.89746 z m 20.2866,-39.99561 c 13.9837,-2.26924 25.755,-9.26119 33.6522,-19.98875 16.7117,-22.70124 11.9971,-54.88064 -10.4628,-71.41474 -22.7013,-16.7117 -54.8807,-11.99716 -71.4148,10.46282 -22.6861,30.81689 -4.9477,74.57716 32.7855,80.8812 7.2167,1.20568 8.3498,1.21005 15.4399,0.0595 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3437"
|
||||
d="m -1185.1968,510.46379 c -9.5638,-1.82704 -13.4033,-3.1449 -22.8602,-7.84638 -15.9869,-7.94787 -27.9203,-18.61115 -36.7936,-32.8775 -18.0259,-28.98174 -18.2282,-63.68515 -0.5489,-94.19339 5.4971,-9.48599 20.031,-24.01998 29.517,-29.51703 35.9768,-20.84825 78.4966,-16.44436 108.0375,11.18973 11.4776,10.73666 21.2917,27.07499 25.5075,42.46417 3.0222,11.03221 3.0222,34.34497 0,45.37718 -5.4288,19.81723 -19.3068,39.61882 -35.5413,50.71161 -7.0384,4.80928 -22.265,11.78192 -29.7119,13.60586 -9.043,2.21486 -28.7216,2.78302 -37.6061,1.08575 z m 28.9955,-38.176 c 3.3793,-0.87131 8.7044,-2.9444 11.8334,-4.60688 6.9307,-3.68235 17.6134,-14.51236 21.0981,-21.38895 7.5207,-14.84137 7.5207,-32.99859 0,-47.83996 -3.4847,-6.87659 -14.1674,-17.7066 -21.0981,-21.38895 -15.0624,-8.00281 -33.404,-8.18326 -48.6091,-0.47825 -6.8766,3.48463 -17.7066,14.16736 -21.3889,21.09806 -8.0028,15.06242 -8.1833,33.40399 -0.4783,48.6091 3.362,6.63454 13.9756,17.54668 20.5596,21.13793 11.3138,6.17111 25.8154,8.02092 38.0833,4.8579 z"
|
||||
style="fill:#d45500;stroke-width:2.49893761" />
|
||||
</g>
|
||||
<g
|
||||
id="g22554"
|
||||
transform="translate(103.16604,61.471991)"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/fire-marker-s.png"
|
||||
inkscape:export-xdpi="2"
|
||||
inkscape:export-ydpi="2">
|
||||
<path
|
||||
style="fill:#d41300;fill-opacity:1;stroke:none;stroke-width:10.58333302;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m -25.638382,38.048346 c 11.566313,13.887908 17.1215844,22.244854 13.751242,33.868326 -2.465387,8.50265 -8.895424,18.626534 -18.100172,25.532106 -9.204776,6.905572 -20.549951,13.517692 -24.263404,17.728802 -3.71348,4.21108 -9.835779,11.6046 -10.976769,21.82688 -2.725208,24.7073 15.038044,45.63926 39.702238,48.35952 11.289242,1.2311 26.6324564,-5.2645 34.2331684,-10.31973 C 16.308659,169.98901 28.520768,152.76263 31.570884,138.81099 35.854436,119.21732 35.065926,96.385127 23.626002,79.16853 12.946123,63.095807 3.8673424,50.775037 -25.638382,38.048346 Z"
|
||||
id="path5329"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cszzcczasc" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:10.58333302;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m -7.5198746,101.09834 c 4.018254,8.70077 3.821166,14.69136 0.49964,20.18233 -2.429696,4.01667 -7.1125824,8.31964 -12.7749834,10.59336 -5.662401,2.27373 -12.38086,4.1034 -14.860826,5.75067 -2.479966,1.64727 -6.630512,4.59399 -8.617877,9.67322 -4.786736,12.28103 1.27127,26.11038 13.530846,30.8887 5.613373,2.17993 11.515354,2.13146 17.442629,-0.0849 5.9272234,-2.21636 14.0405914,-9.44377 18.0234704,-15.42084 6.3490206,-9.59829 8.9531296,-23.76395 5.4565016,-34.15229 -3.2643496,-9.69812 -4.6224286,-12.3603 -18.6994006,-27.43025 z"
|
||||
id="path5331"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cszzcczcsc" />
|
||||
</g>
|
||||
<g
|
||||
id="g22585"
|
||||
transform="translate(274.75307,-132.56569)"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/n-fire-marker.png"
|
||||
inkscape:export-xdpi="6"
|
||||
inkscape:export-ydpi="6">
|
||||
<path
|
||||
style="fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:10.58333302;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m -86.843103,109.40931 c 11.566313,13.88791 17.121584,22.24485 13.751242,33.86832 -2.465387,8.50265 -8.895424,18.62654 -18.100172,25.53211 -9.204777,6.90557 -20.549947,13.51769 -24.263407,17.7288 -3.71348,4.21108 -9.83578,11.6046 -10.97677,21.82688 -2.7252,24.7073 15.03805,45.63926 39.702242,48.35952 11.289242,1.2311 26.632456,-5.2645 34.233168,-10.31973 7.600738,-5.05524 19.812847,-22.28162 22.862963,-36.23326 4.283552,-19.59367 3.495042,-42.42586 -7.944882,-59.64246 -10.679879,-16.07272 -19.75866,-28.39349 -49.264384,-41.12018 z"
|
||||
id="path5329-0"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cszzcczasc" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:10.58333302;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m -68.724596,172.4593 c 4.018254,8.70077 3.821166,14.69136 0.49964,20.18233 -2.429696,4.01667 -7.112582,8.31964 -12.774983,10.59336 -5.662401,2.27373 -12.38086,4.1034 -14.860826,5.75067 -2.479966,1.64727 -6.630515,4.59399 -8.617875,9.67322 -4.78674,12.28103 1.27127,26.11038 13.530844,30.8887 5.613373,2.17993 11.515354,2.13146 17.442629,-0.0849 5.927223,-2.21636 14.040591,-9.44377 18.02347,-15.42084 6.349021,-9.59829 8.95313,-23.76395 5.456502,-34.15229 -3.26435,-9.69812 -4.622429,-12.3603 -18.699401,-27.43025 z"
|
||||
id="path5331-6"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cszzcczcsc" />
|
||||
</g>
|
||||
<g
|
||||
id="g4691"
|
||||
transform="translate(-189.69793,-44.436364)">
|
||||
<text
|
||||
id="text6339"
|
||||
y="191.32181"
|
||||
x="87.51506"
|
||||
style="font-style:normal;font-weight:normal;font-size:54.68289185px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#cccccc;fill-opacity:1;stroke:none;stroke-width:0.26458329"
|
||||
xml:space="preserve"><tspan
|
||||
style="fill:#cccccc;fill-opacity:1;stroke-width:0.26458329"
|
||||
y="191.32181"
|
||||
x="87.51506"
|
||||
id="tspan6337"
|
||||
sodipodi:role="line"> </tspan></text>
|
||||
<g
|
||||
id="g3415-6"
|
||||
transform="matrix(0.15677218,0,0,0.1664724,299.294,47.789492)"
|
||||
style="fill:#280b0b;stroke-width:2.49893761">
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1175.4664,736.62077 c -33.3138,-46.82732 -77.1492,-115.69563 -102.6366,-161.24879 -11.7453,-20.99204 -30.2969,-58.12091 -37.2515,-74.55449 -7.183,-16.97323 -15.1659,-40.43141 -18.3579,-53.94551 -3.2265,-13.66018 -3.2134,-40.78621 0.027,-56 13.0118,-61.09044 54.0725,-108.07064 111.0233,-127.02878 21.0744,-7.01539 29.7628,-8.3724 53.6051,-8.3724 18.0191,0 22.4905,0.32004 31.5,2.2546 69.2952,14.87936 118.3985,63.98934 133.1284,133.14658 3.2404,15.21379 3.2535,42.33982 0.027,56 -9.6695,40.93833 -34.9549,94.97325 -78.2137,167.1432 -22.584,37.67742 -55.6479,88.3297 -80.0323,122.60559 -5.6923,8.00126 -7.1265,8.00126 -12.8188,0 z m 17.7947,-267.80868 c 16.0798,-3.70704 31.3478,-18.97505 35.0548,-35.05477 1.2978,-5.6293 1.2978,-17.14138 0,-22.77068 -3.707,-16.07972 -18.975,-31.34773 -35.0548,-35.05477 -5.6293,-1.29778 -17.1413,-1.29778 -22.7706,0 -16.0798,3.70704 -31.3478,18.97505 -35.0548,35.05477 -1.2978,5.6293 -1.2978,17.14138 0,22.77068 3.6281,15.73725 17.9483,30.40113 33.9401,34.75463 5.5299,1.50543 17.9787,1.66186 23.8853,0.30014 z"
|
||||
id="path3417-2"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1171.7343,740.159 c -0.8549,-0.98286 -6.7152,-9.21202 -13.0229,-18.28702 -57.6746,-82.97704 -106.6281,-166.52227 -130.6675,-223 -7.5823,-17.81379 -15.6335,-42.59765 -18.1919,-56 -1.9075,-9.99286 -2.1192,-13.59689 -1.615,-27.5 0.6601,-18.20107 2.7364,-29.95437 8.149,-46.12976 16.6315,-49.70266 56.2471,-88.97673 106.1932,-105.27769 18.8485,-6.15159 28.6855,-7.59255 51.8324,-7.59255 23.1469,0 32.9839,1.44096 51.8324,7.59255 49.946,16.30096 89.5617,55.57503 106.1932,105.27769 5.4126,16.17539 7.4889,27.92869 8.149,46.12976 0.5042,13.90311 0.2925,17.50714 -1.615,27.5 -9.8997,51.86069 -57.3486,143.38266 -131.1659,253 -21.9938,32.66028 -31.1985,45.43501 -32.9858,45.77921 -0.842,0.16216 -2.2304,-0.50932 -3.0852,-1.49219 z m 14.484,-270.77869 c 8.8507,-2.30531 15.5691,-6.19896 22.2859,-12.91574 15.3233,-15.32331 18.7123,-37.24354 8.7865,-56.83126 -3.3849,-6.67972 -13.4607,-16.75552 -20.1404,-20.14039 -19.5878,-9.92585 -41.508,-6.53684 -56.8313,8.78647 -19.3033,19.30326 -19.3033,48.88192 0,68.18518 12.3601,12.36013 29.5075,17.18527 45.8993,12.91574 z"
|
||||
id="path3419-5"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1170.2383,741.02946 c -2.9702,-1.95299 -47.5638,-68.36498 -68.9314,-102.65748 -60.3859,-96.91256 -92.6314,-167.65863 -95.9441,-210.5 -0.71,-9.18142 0.7359,-26.96889 3.1702,-39 5.3885,-26.6314 19.6741,-55.21797 38.1803,-76.40168 33.7565,-38.64042 87.425,-60.38026 137.6514,-55.75937 16.142,1.48508 25.2032,3.34552 39.6542,8.14177 49.5805,16.45568 88.4643,55.33946 104.92,104.92 6.514,19.62659 9.7891,41.9139 8.5375,58.09928 -3.7383,48.34554 -45.5692,134.74542 -120.3123,248.5 -19.0693,29.02239 -43.4664,64.32456 -44.8352,64.87575 -0.5999,0.24157 -1.5406,0.14334 -2.0906,-0.21827 z m 14.3311,-271.55241 c 15.9065,-4.23527 29.72,-18.04873 33.9553,-33.95526 1.7594,-6.60785 1.7594,-19.69177 0,-26.29962 -2.0654,-7.7571 -6.4729,-15.22633 -12.6009,-21.35435 -6.1281,-6.12801 -13.5973,-10.53551 -21.3544,-12.60091 -6.6078,-1.75941 -19.6918,-1.75941 -26.2996,0 -15.9065,4.23527 -29.72,18.04873 -33.9553,33.95526 -1.7594,6.60785 -1.7594,19.69177 0,26.29962 4.169,15.65766 17.9617,29.61638 33.4976,33.90073 6.2073,1.71181 20.4242,1.74078 26.7573,0.0545 z"
|
||||
id="path3421-2"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1182.2542,723.62198 c -16.7382,-23.96496 -42.0532,-62.31689 -57.2403,-86.71831 -49.2012,-79.05289 -78.8337,-139.03161 -90.7948,-183.77671 -3.6442,-13.63234 -3.6769,-13.92884 -3.6618,-33.25498 0.013,-16.40263 0.3725,-21.16781 2.2647,-30 14.2597,-66.56303 63.458,-115.76695 130.1294,-130.1443 9.1148,-1.96557 13.4023,-2.26427 32.5,-2.26427 19.0977,0 23.3852,0.2987 32.5,2.26427 66.6714,14.37735 115.8697,63.58127 130.1294,130.1443 1.8922,8.83219 2.2519,13.59737 2.2647,30 0.015,19.32614 -0.018,19.62264 -3.6618,33.25498 -11.9611,44.7451 -41.5936,104.72382 -90.7948,183.77671 -25.1343,40.38391 -68.2121,103.96831 -70.4375,103.96831 -0.632,0 -6.5707,-7.7625 -13.1972,-17.25 z m 25.1556,-253.28119 c 21.7615,-5.66814 37.5416,-25.8312 37.5416,-47.96881 0,-26.74861 -22.7514,-49.5 -49.5,-49.5 -22.1376,0 -42.3007,15.78009 -47.9688,37.54155 -7.9007,30.33286 15.8887,61.07445 47.5087,61.39264 3.5969,0.0362 9.1853,-0.62323 12.4185,-1.46538 z"
|
||||
id="path3423-6"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1173.3221,735.64911 c -14.736,-20.10305 -47.0049,-68.57689 -66.4214,-99.77713 -62.4262,-100.31218 -94.8141,-173.76608 -94.7994,-215 0.019,-52.73909 28.6524,-105.90263 72.9978,-135.53357 69.4255,-46.38905 160.1263,-34.87659 216.3183,27.45683 17.8358,19.78504 32.8422,49.59683 38.0432,75.57674 2.0586,10.28307 3.6096,24.23637 3.6125,32.5 0.017,46.98038 -42.1573,135.99251 -121.7666,257 -16.9567,25.77445 -41.6783,61.54761 -43.1709,62.4701 -0.5199,0.32129 -2.6859,-1.79054 -4.8135,-4.69297 z m 16.6337,-265.22977 c 8.643,-2.30041 16.0792,-6.61994 22.569,-13.10973 19.5461,-19.54606 19.5461,-50.3292 0,-69.87526 -19.546,-19.54606 -50.3292,-19.54606 -69.8752,0 -19.5461,19.54606 -19.5461,50.3292 0,69.87526 6.3152,6.31524 13.9223,10.80572 22.1253,13.06068 6.468,1.778 18.5962,1.80163 25.1809,0.049 z"
|
||||
id="path3425-9"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1182.3104,722.62198 c -17.5832,-25.21705 -46.9653,-70.02195 -62.463,-95.25 -53.9505,-87.82403 -84.0083,-153.91828 -88.8089,-195.28273 -2.8568,-24.61567 3.9195,-58.05424 17.0874,-84.31906 14.9367,-29.79285 43.0433,-57.89943 72.8361,-72.83609 46.9071,-23.51687 102.2965,-23.51687 149.2036,0 29.7928,14.93666 57.8994,43.04324 72.8361,72.83609 13.1678,26.26482 19.9443,59.70339 17.0874,84.31906 -4.8006,41.36445 -34.8584,107.4587 -88.8089,195.28273 -25.6831,41.80848 -73.2609,112.5 -75.7164,112.5 -0.6739,0 -6.638,-7.7625 -13.2534,-17.25 z m 28.8636,-252.78714 c 14.9934,-5.05091 26.7945,-16.83777 31.8332,-31.79475 2.84,-8.4305 2.849,-22.87899 0.019,-31.27836 -5.0509,-14.99339 -16.8378,-26.79448 -31.7948,-31.83312 -8.4589,-2.8496 -22.8773,-2.8496 -31.3362,0 -14.957,5.03864 -26.7438,16.83973 -31.7948,31.83312 -4.2232,12.53664 -2.2398,30.34688 4.615,41.43896 6.0015,9.71133 16.2078,17.88124 26.9565,21.57806 8.2521,2.83815 23.1644,2.8647 31.5017,0.0561 z"
|
||||
id="path3427-1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1177.0361,729.2292 c -12.0748,-17.04099 -42.0178,-61.97211 -55.2177,-82.85722 -54.0333,-85.49299 -89.0481,-156.54229 -98.3182,-199.5 -4.1682,-19.31544 -3.6385,-40.89984 1.5396,-62.72802 17.5765,-74.09457 83.6516,-126.23294 159.9754,-126.23294 76.3238,0 142.3989,52.13837 159.9754,126.23294 5.1781,21.82818 5.7078,43.41258 1.5396,62.72802 -9.2711,42.96238 -44.3741,114.18565 -98.325,199.5 -19.1931,30.35063 -57.9257,87.87564 -62.1857,92.35722 -1.07,1.12557 -2.6032,-0.49583 -8.9834,-9.5 z m 19.386,-257.897 c 18.3977,-4.33663 33.2167,-19.15566 37.5533,-37.55329 6.3215,-26.8182 -10.5958,-54.01281 -37.5533,-60.36715 -31.1031,-7.33152 -61.8773,17.01847 -61.8773,48.96022 0,31.94468 30.7714,56.29242 61.8773,48.96022 z"
|
||||
id="path3429-3"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1180.3055,723.12198 c -39.6386,-56.78097 -80.8763,-123.18906 -105.5103,-169.91097 -22.6038,-42.87113 -35.6673,-73.90745 -42.9114,-101.94924 -3.2234,-12.47773 -3.3276,-13.49718 -3.2613,-31.88979 0.056,-15.57539 0.462,-20.83205 2.2515,-29.16436 7.1745,-33.40579 21.3734,-59.65036 45.1194,-83.39628 23.7312,-23.73126 49.8284,-37.85761 83.3962,-45.14216 8.7531,-1.89951 13.219,-2.20577 32.1644,-2.20577 18.9454,0 23.4113,0.30626 32.1644,2.20577 33.5678,7.28455 59.665,21.4109 83.3962,45.14216 23.746,23.74592 37.9449,49.99049 45.1194,83.39628 1.7895,8.33231 2.1954,13.58897 2.2515,29.16436 0.066,18.39261 -0.038,19.41206 -3.2614,31.88979 -13.5578,52.48201 -54.8103,131.45948 -120.1942,230.11021 -16.0695,24.24545 -38.9,57.5 -39.4759,57.5 -0.1395,0 -5.2013,-7.0875 -11.2485,-15.75 z m 22.6554,-251.78978 c 18.3977,-4.33663 33.2167,-19.15566 37.5533,-37.55329 6.3215,-26.8182 -10.5958,-54.01281 -37.5533,-60.36715 -31.1031,-7.33152 -61.8773,17.01847 -61.8773,48.96022 0,31.94468 30.7714,56.29242 61.8773,48.96022 z"
|
||||
id="path3431-3"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1180.3055,723.12198 c -39.6386,-56.78097 -80.8763,-123.18906 -105.5103,-169.91097 -22.6038,-42.87113 -35.6673,-73.90745 -42.9114,-101.94924 -3.2234,-12.47773 -3.3276,-13.49718 -3.2613,-31.88979 0.056,-15.57539 0.462,-20.83205 2.2515,-29.16436 7.1745,-33.40579 21.3734,-59.65036 45.1194,-83.39628 23.7312,-23.73126 49.8284,-37.85761 83.3962,-45.14216 8.7531,-1.89951 13.219,-2.20577 32.1644,-2.20577 18.9454,0 23.4113,0.30626 32.1644,2.20577 33.5678,7.28455 59.665,21.4109 83.3962,45.14216 23.746,23.74592 37.9449,49.99049 45.1194,83.39628 1.7895,8.33231 2.1954,13.58897 2.2515,29.16436 0.066,18.39261 -0.038,19.41206 -3.2614,31.88979 -13.5578,52.48201 -54.8103,131.45948 -120.1942,230.11021 -16.0695,24.24545 -38.9,57.5 -39.4759,57.5 -0.1395,0 -5.2013,-7.0875 -11.2485,-15.75 z m 18.5351,-250.28529 c 13.9837,-2.26924 25.755,-9.26119 33.6522,-19.98875 16.7117,-22.70124 11.9971,-54.88064 -10.4628,-71.41474 -22.7013,-16.7117 -54.8807,-11.99716 -71.4148,10.46282 -22.6861,30.81689 -4.9477,74.57716 32.7855,80.8812 7.2167,1.20568 8.3498,1.21005 15.4399,0.0595 z"
|
||||
id="path3433-1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1182.057,512.8323 c -12.7719,-1.98971 -27.5723,-7.86265 -38.5,-15.27721 -6.7621,-4.58817 -18.715,-16.43678 -23.1795,-22.97738 -5.5725,-8.16373 -11.4255,-20.82211 -13.9666,-30.20573 -3.0901,-11.41104 -3.0901,-32.58896 0,-44 2.386,-8.81088 8.3129,-21.90823 13.2408,-29.25941 4.5234,-6.74778 16.4008,-18.72538 23.1996,-23.3953 8.1117,-5.57172 20.7757,-11.43775 30.2057,-13.99136 11.411,-3.09009 32.589,-3.09009 44,0 16.4827,4.46348 31.3856,13.21179 43.1137,25.30869 8.4566,8.72253 12.1221,14.00001 17.4177,25.07797 14.1075,29.51145 10.8829,63.98309 -8.5367,91.25941 -4.9505,6.95336 -15.862,17.66925 -22.8214,22.41216 -7.1793,4.89282 -20.5797,10.88896 -29.3895,13.1507 -9.0307,2.31843 -26.1035,3.24975 -34.7838,1.89746 z m 20.2866,-39.99561 c 13.9837,-2.26924 25.755,-9.26119 33.6522,-19.98875 16.7117,-22.70124 11.9971,-54.88064 -10.4628,-71.41474 -22.7013,-16.7117 -54.8807,-11.99716 -71.4148,10.46282 -22.6861,30.81689 -4.9477,74.57716 32.7855,80.8812 7.2167,1.20568 8.3498,1.21005 15.4399,0.0595 z"
|
||||
id="path3435-5"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#280b0b;stroke-width:2.49893761"
|
||||
d="m -1185.1968,510.46379 c -9.5638,-1.82704 -13.4033,-3.1449 -22.8602,-7.84638 -15.9869,-7.94787 -27.9203,-18.61115 -36.7936,-32.8775 -18.0259,-28.98174 -18.2282,-63.68515 -0.5489,-94.19339 5.4971,-9.48599 20.031,-24.01998 29.517,-29.51703 35.9768,-20.84825 78.4966,-16.44436 108.0375,11.18973 11.4776,10.73666 21.2917,27.07499 25.5075,42.46417 3.0222,11.03221 3.0222,34.34497 0,45.37718 -5.4288,19.81723 -19.3068,39.61882 -35.5413,50.71161 -7.0384,4.80928 -22.265,11.78192 -29.7119,13.60586 -9.043,2.21486 -28.7216,2.78302 -37.6061,1.08575 z m 28.9955,-38.176 c 3.3793,-0.87131 8.7044,-2.9444 11.8334,-4.60688 6.9307,-3.68235 17.6134,-14.51236 21.0981,-21.38895 7.5207,-14.84137 7.5207,-32.99859 0,-47.83996 -3.4847,-6.87659 -14.1674,-17.7066 -21.0981,-21.38895 -15.0624,-8.00281 -33.404,-8.18326 -48.6091,-0.47825 -6.8766,3.48463 -17.7066,14.16736 -21.3889,21.09806 -8.0028,15.06242 -8.1833,33.40399 -0.4783,48.6091 3.362,6.63454 13.9756,17.54668 20.5596,21.13793 11.3138,6.17111 25.8154,8.02092 38.0833,4.8579 z"
|
||||
id="path3437-2"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
<rect
|
||||
style="opacity:1;vector-effect:none;fill:#c8b7b7;fill-opacity:1;stroke:#c8b7b7;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect8537"
|
||||
width="368.82184"
|
||||
height="657.66956"
|
||||
x="-971.73767"
|
||||
y="74.954208" />
|
||||
<g
|
||||
id="g8543"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/fire-marker-l.png"
|
||||
inkscape:export-xdpi="4"
|
||||
inkscape:export-ydpi="4">
|
||||
<rect
|
||||
y="108.84225"
|
||||
x="-419.07861"
|
||||
height="176.48029"
|
||||
width="176.48029"
|
||||
id="rect17701"
|
||||
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<g
|
||||
style="stroke-width:0.88457036"
|
||||
inkscape:export-ydpi="4.0856881"
|
||||
inkscape:export-xdpi="4.0856881"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/fire-marker.png"
|
||||
transform="matrix(1.1304923,0,0,1.1304923,-313.01185,70.713452)"
|
||||
id="g22554-4">
|
||||
<path
|
||||
sodipodi:nodetypes="cszzcczasc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5329-5"
|
||||
d="m -25.638382,38.048346 c 11.566313,13.887908 17.1215844,22.244854 13.751242,33.868326 -2.465387,8.50265 -8.895424,18.626534 -18.100172,25.532106 -9.204776,6.905572 -20.549951,13.517692 -24.263404,17.728802 -3.71348,4.21108 -9.835779,11.6046 -10.976769,21.82688 -2.725208,24.7073 15.038044,45.63926 39.702238,48.35952 11.289242,1.2311 26.6324564,-5.2645 34.2331684,-10.31973 C 16.308659,169.98901 28.520768,152.76263 31.570884,138.81099 35.854436,119.21732 35.065926,96.385127 23.626002,79.16853 12.946123,63.095807 3.8673424,50.775037 -25.638382,38.048346 Z"
|
||||
style="fill:#d41300;fill-opacity:1;stroke:none;stroke-width:9.36170292;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
sodipodi:nodetypes="cszzcczcsc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5331-3"
|
||||
d="m -7.5198746,101.09834 c 4.018254,8.70077 3.821166,14.69136 0.49964,20.18233 -2.429696,4.01667 -7.1125824,8.31964 -12.7749834,10.59336 -5.662401,2.27373 -12.38086,4.1034 -14.860826,5.75067 -2.479966,1.64727 -6.630512,4.59399 -8.617877,9.67322 -4.786736,12.28103 1.27127,26.11038 13.530846,30.8887 5.613373,2.17993 11.515354,2.13146 17.442629,-0.0849 5.9272234,-2.21636 14.0405914,-9.44377 18.0234704,-15.42084 6.3490206,-9.59829 8.9531296,-23.76395 5.4565016,-34.15229 -3.2643496,-9.69812 -4.6224286,-12.3603 -18.6994006,-27.43025 z"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:9.36170292;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot8482"
|
||||
style="font-style:normal;font-weight:normal;font-size:192px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff0000;fill-opacity:1;stroke:none"
|
||||
transform="matrix(0.26458333,0,0,0.26458333,433.29892,-64.826953)"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/remove-marker.png"
|
||||
inkscape:export-xdpi="14.000002"
|
||||
inkscape:export-ydpi="14.000002"><flowRegion
|
||||
id="flowRegion8484"
|
||||
style="font-size:192px;fill:#ff0000"><rect
|
||||
id="rect8486"
|
||||
width="476.79202"
|
||||
height="367.69553"
|
||||
x="-1499.0664"
|
||||
y="-142.19131"
|
||||
style="font-size:192px;fill:#ff0000" /></flowRegion><flowPara
|
||||
id="flowPara8488"></flowPara></flowRoot> <g
|
||||
id="g22554-45"
|
||||
transform="matrix(-0.04534342,-0.17182024,0.17182024,-0.04534342,-93.960693,-204.49561)"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/fire-marker.png"
|
||||
inkscape:export-xdpi="4.0856881"
|
||||
inkscape:export-ydpi="4.0856881"
|
||||
style="stroke-width:5.62737894">
|
||||
<g
|
||||
id="g8559"
|
||||
style="stroke-width:5.62737894">
|
||||
<g
|
||||
inkscape:export-ydpi="4.0856881"
|
||||
inkscape:export-xdpi="4.0856881"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/fire-marker.png"
|
||||
transform="rotate(-144.74008,-66.772616,119.34544)"
|
||||
id="g22554-2"
|
||||
style="stroke-width:5.62737894">
|
||||
<path
|
||||
sodipodi:nodetypes="cszzcczasc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5329-8"
|
||||
d="m -25.638382,38.048346 c 11.566313,13.887908 17.1215844,22.244854 13.751242,33.868326 -2.465387,8.50265 -8.895424,18.626534 -18.100172,25.532106 -9.204776,6.905572 -20.549951,13.517692 -24.263404,17.728802 -3.71348,4.21108 -9.835779,11.6046 -10.976769,21.82688 -2.725208,24.7073 15.038044,45.63926 39.702238,48.35952 11.289242,1.2311 26.6324564,-5.2645 34.2331684,-10.31973 C 16.308659,169.98901 28.520768,152.76263 31.570884,138.81099 35.854436,119.21732 35.065926,96.385127 23.626002,79.16853 12.946123,63.095807 3.8673424,50.775037 -25.638382,38.048346 Z"
|
||||
style="fill:#d41300;fill-opacity:1;stroke:none;stroke-width:59.556427;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
sodipodi:nodetypes="cszzcczcsc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5331-30"
|
||||
d="m -7.5198746,101.09834 c 4.018254,8.70077 3.821166,14.69136 0.49964,20.18233 -2.429696,4.01667 -7.1125824,8.31964 -12.7749834,10.59336 -5.662401,2.27373 -12.38086,4.1034 -14.860826,5.75067 -2.479966,1.64727 -6.630512,4.59399 -8.617877,9.67322 -4.786736,12.28103 1.27127,26.11038 13.530846,30.8887 5.613373,2.17993 11.515354,2.13146 17.442629,-0.0849 5.9272234,-2.21636 14.0405914,-9.44377 18.0234704,-15.42084 6.3490206,-9.59829 8.9531296,-23.76395 5.4565016,-34.15229 -3.2643496,-9.69812 -4.6224286,-12.3603 -18.6994006,-27.43025 z"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:59.556427;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:export-ydpi="4.0856881"
|
||||
inkscape:export-xdpi="4.0856881"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/fire-marker.png"
|
||||
transform="rotate(96.689458,-75.070103,121.00438)"
|
||||
id="g22554-5"
|
||||
style="stroke-width:5.62737894">
|
||||
<path
|
||||
sodipodi:nodetypes="cszzcczasc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5329-4"
|
||||
d="m -25.638382,38.048346 c 11.566313,13.887908 17.1215844,22.244854 13.751242,33.868326 -2.465387,8.50265 -8.895424,18.626534 -18.100172,25.532106 -9.204776,6.905572 -20.549951,13.517692 -24.263404,17.728802 -3.71348,4.21108 -9.835779,11.6046 -10.976769,21.82688 -2.725208,24.7073 15.038044,45.63926 39.702238,48.35952 11.289242,1.2311 26.6324564,-5.2645 34.2331684,-10.31973 C 16.308659,169.98901 28.520768,152.76263 31.570884,138.81099 35.854436,119.21732 35.065926,96.385127 23.626002,79.16853 12.946123,63.095807 3.8673424,50.775037 -25.638382,38.048346 Z"
|
||||
style="fill:#d41300;fill-opacity:1;stroke:none;stroke-width:59.556427;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
sodipodi:nodetypes="cszzcczcsc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5331-9"
|
||||
d="m -7.5198746,101.09834 c 4.018254,8.70077 3.821166,14.69136 0.49964,20.18233 -2.429696,4.01667 -7.1125824,8.31964 -12.7749834,10.59336 -5.662401,2.27373 -12.38086,4.1034 -14.860826,5.75067 -2.479966,1.64727 -6.630512,4.59399 -8.617877,9.67322 -4.786736,12.28103 1.27127,26.11038 13.530846,30.8887 5.613373,2.17993 11.515354,2.13146 17.442629,-0.0849 5.9272234,-2.21636 14.0405914,-9.44377 18.0234704,-15.42084 6.3490206,-9.59829 8.9531296,-23.76395 5.4565016,-34.15229 -3.2643496,-9.69812 -4.6224286,-12.3603 -18.6994006,-27.43025 z"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:59.556427;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
<g
|
||||
transform="rotate(-22.690691,-35.704234,120.074)"
|
||||
id="g8542"
|
||||
style="stroke-width:5.62737894">
|
||||
<path
|
||||
style="fill:#d41300;fill-opacity:1;stroke:none;stroke-width:59.556427;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m -25.638382,38.048346 c 11.566313,13.887908 17.1215844,22.244854 13.751242,33.868326 -2.465387,8.50265 -8.895424,18.626534 -18.100172,25.532106 -9.204776,6.905572 -20.549951,13.517692 -24.263404,17.728802 -3.71348,4.21108 -9.835779,11.6046 -10.976769,21.82688 -2.725208,24.7073 15.038044,45.63926 39.702238,48.35952 11.289242,1.2311 26.6324564,-5.2645 34.2331684,-10.31973 C 16.308659,169.98901 28.520768,152.76263 31.570884,138.81099 35.854436,119.21732 35.065926,96.385127 23.626002,79.16853 12.946123,63.095807 3.8673424,50.775037 -25.638382,38.048346 Z"
|
||||
id="path5329-9"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cszzcczasc" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:59.556427;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m -7.5198746,101.09834 c 4.018254,8.70077 3.821166,14.69136 0.49964,20.18233 -2.429696,4.01667 -7.1125824,8.31964 -12.7749834,10.59336 -5.662401,2.27373 -12.38086,4.1034 -14.860826,5.75067 -2.479966,1.64727 -6.630512,4.59399 -8.617877,9.67322 -4.786736,12.28103 1.27127,26.11038 13.530846,30.8887 5.613373,2.17993 11.515354,2.13146 17.442629,-0.0849 5.9272234,-2.21636 14.0405914,-9.44377 18.0234704,-15.42084 6.3490206,-9.59829 8.9531296,-23.76395 5.4565016,-34.15229 -3.2643496,-9.69812 -4.6224286,-12.3603 -18.6994006,-27.43025 z"
|
||||
id="path5331-35"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cszzcczcsc" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="g8551"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/fire-marker-s.png"
|
||||
inkscape:export-xdpi="4"
|
||||
inkscape:export-ydpi="4">
|
||||
<use
|
||||
transform="translate(0,404.8127)"
|
||||
height="100%"
|
||||
width="100%"
|
||||
id="use8529"
|
||||
xlink:href="#rect17701"
|
||||
y="0"
|
||||
x="0" />
|
||||
<use
|
||||
style="stroke-width:2"
|
||||
transform="matrix(0.5,0,0,0.5,-165.41924,545.68726)"
|
||||
height="100%"
|
||||
width="100%"
|
||||
id="use8531"
|
||||
xlink:href="#g22554-4"
|
||||
y="0"
|
||||
x="0" />
|
||||
</g>
|
||||
<g
|
||||
id="g8547"
|
||||
transform="translate(0,-14.019767)"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/fire-marker-m.png"
|
||||
inkscape:export-xdpi="4"
|
||||
inkscape:export-ydpi="4">
|
||||
<use
|
||||
transform="translate(0,190.50006)"
|
||||
height="100%"
|
||||
width="100%"
|
||||
id="use8533"
|
||||
xlink:href="#rect17701"
|
||||
y="0"
|
||||
x="0" />
|
||||
<use
|
||||
style="stroke-width:1.33333337"
|
||||
transform="matrix(0.75,0,0,0.75,-82.709618,260.93734)"
|
||||
height="100%"
|
||||
width="100%"
|
||||
id="use8535"
|
||||
xlink:href="#g22554-4"
|
||||
y="0"
|
||||
x="0" />
|
||||
</g>
|
||||
<g
|
||||
transform="translate(176.48029,228.33241)"
|
||||
id="g8543-0"
|
||||
inkscape:export-filename="/home/vjrj/proyectos/dev/fires_flutter/images/logo-1024.png"
|
||||
inkscape:export-xdpi="147.38"
|
||||
inkscape:export-ydpi="147.38">
|
||||
<rect
|
||||
y="108.84225"
|
||||
x="-419.07861"
|
||||
height="176.48029"
|
||||
width="176.48029"
|
||||
id="rect17701-2"
|
||||
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<g
|
||||
style="stroke-width:0.88457036"
|
||||
inkscape:export-ydpi="4.0856881"
|
||||
inkscape:export-xdpi="4.0856881"
|
||||
inkscape:export-filename="/mnt/md1/proyectos/dev/todos-contra-el-fuego-web/public/fire-marker.png"
|
||||
transform="matrix(1.1304923,0,0,1.1304923,-313.01185,70.713452)"
|
||||
id="g22554-4-3">
|
||||
<path
|
||||
sodipodi:nodetypes="cszzcczasc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5329-5-7"
|
||||
d="m -25.638382,38.048346 c 11.566313,13.887908 17.1215844,22.244854 13.751242,33.868326 -2.465387,8.50265 -8.895424,18.626534 -18.100172,25.532106 -9.204776,6.905572 -20.549951,13.517692 -24.263404,17.728802 -3.71348,4.21108 -9.835779,11.6046 -10.976769,21.82688 -2.725208,24.7073 15.038044,45.63926 39.702238,48.35952 11.289242,1.2311 26.6324564,-5.2645 34.2331684,-10.31973 C 16.308659,169.98901 28.520768,152.76263 31.570884,138.81099 35.854436,119.21732 35.065926,96.385127 23.626002,79.16853 12.946123,63.095807 3.8673424,50.775037 -25.638382,38.048346 Z"
|
||||
style="fill:#d41300;fill-opacity:1;stroke:none;stroke-width:9.36170292;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
sodipodi:nodetypes="cszzcczcsc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5331-3-5"
|
||||
d="m -7.5198746,101.09834 c 4.018254,8.70077 3.821166,14.69136 0.49964,20.18233 -2.429696,4.01667 -7.1125824,8.31964 -12.7749834,10.59336 -5.662401,2.27373 -12.38086,4.1034 -14.860826,5.75067 -2.479966,1.64727 -6.630512,4.59399 -8.617877,9.67322 -4.786736,12.28103 1.27127,26.11038 13.530846,30.8887 5.613373,2.17993 11.515354,2.13146 17.442629,-0.0849 5.9272234,-2.21636 14.0405914,-9.44377 18.0234704,-15.42084 6.3490206,-9.59829 8.9531296,-23.76395 5.4565016,-34.15229 -3.2643496,-9.69812 -4.6224286,-12.3603 -18.6994006,-27.43025 z"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:9.36170292;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 51 KiB |
BIN
designs/mobile.xcf
Normal file
BIN
designs/mobile.xcf
Normal file
Binary file not shown.
BIN
designs/telegram-capture-en.png
Normal file
BIN
designs/telegram-capture-en.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 530 KiB |
BIN
designs/web-tcef.png
Normal file
BIN
designs/web-tcef.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 MiB |
316
designs/web-tcef.svg
Normal file
316
designs/web-tcef.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 2.8 MiB |
9
fonts.json
Normal file
9
fonts.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"extensions": [ "ttf", "woff", "woff2" ],
|
||||
"map": {
|
||||
"node_modules/simple-line-icons/fonts/Simple-Line-Icons.woff": "/fonts/Simple-Line-Icons.woff?v=2.4.1",
|
||||
"node_modules/simple-line-icons/fonts/Simple-Line-Icons.woff2": "/fonts/Simple-Line-Icons.woff2?v=2.4.1",
|
||||
"node_modules/simple-line-icons/fonts/Simple-Line-Icons.ttf": "/fonts/Simple-Line-Icons.ttf?v=2.4.1"
|
||||
},
|
||||
"verbose": false
|
||||
}
|
||||
60
imports/api/ActiveFires/ActiveFires.js
Normal file
60
imports/api/ActiveFires/ActiveFires.js
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/* eslint-disable consistent-return */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import firesCommonSchema from '../Common/FiresSchema';
|
||||
|
||||
const ActiveFires = new Mongo.Collection('activefires', { idGeneration: 'MONGO' });
|
||||
|
||||
ActiveFires.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false
|
||||
});
|
||||
|
||||
ActiveFires.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true
|
||||
});
|
||||
|
||||
const activeFiresSchema = firesCommonSchema;
|
||||
|
||||
activeFiresSchema.fireUnion = { type: Meteor.Collection.ObjectID, optional: true, blackbox: true };
|
||||
|
||||
ActiveFires.schema = new SimpleSchema(activeFiresSchema);
|
||||
|
||||
ActiveFires.attachSchema(ActiveFires.schema);
|
||||
|
||||
export default ActiveFires;
|
||||
|
||||
/* Sample:
|
||||
* {
|
||||
* "_id" : ObjectId("5a208d7579095a1adba48191"),
|
||||
* "ourid" : {
|
||||
* "type" : "Point",
|
||||
* "coordinates" : [
|
||||
* -42.84192,
|
||||
* -25.54453
|
||||
* ]
|
||||
* },
|
||||
* "lat" : 9.743,
|
||||
* "lon" : -63.483,
|
||||
* "updatedAt" : ISODate("2017-11-30T22:02:39.644Z"),
|
||||
* "type" : "viirs",
|
||||
* "when" : ISODate("2017-11-30T05:30:00Z"),
|
||||
* "acq_date" : "2017-11-30",
|
||||
* "acq_time" : "04:12",
|
||||
* "scan" : 0.5,
|
||||
* "track" : 0.4,
|
||||
* "satellite" : "N",
|
||||
* "confidence" : "nominal",
|
||||
* "version" : "1.0NRT",
|
||||
* "frp" : 4.3,
|
||||
* "daynight" : "N",
|
||||
* "bright_ti4" : 330.2,
|
||||
* "bright_ti5" : 291,
|
||||
* "createdAt" : ISODate("2017-11-30T08:07:33.720Z")
|
||||
* }
|
||||
* */
|
||||
79
imports/api/ActiveFires/server/countFires.js
Normal file
79
imports/api/ActiveFires/server/countFires.js
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
import { whichAreFalsePositives, firesUnion } from '/imports/api/FalsePositives/server/publications';
|
||||
import FalsePositives from '/imports/api/FalsePositives/FalsePositives';
|
||||
import Industries from '/imports/api/Industries/Industries';
|
||||
import ravenLogger from '/imports/startup/server/ravenLogger';
|
||||
import ActiveFires from '../ActiveFires';
|
||||
|
||||
const debug = 0;
|
||||
|
||||
const cleanProv = (prov, stringsToRemove) => {
|
||||
let lprov = prov;
|
||||
stringsToRemove.forEach((st) => {
|
||||
lprov = lprov.replace(st[0], st[1]);
|
||||
});
|
||||
return lprov;
|
||||
};
|
||||
|
||||
const findFiresInRegion = (zone) => {
|
||||
const result = ActiveFires.find({
|
||||
ourid: {
|
||||
$geoWithin: {
|
||||
$geometry: zone.geometry
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/* console.log(`False positive total: ${falsePos.count()}`);
|
||||
console.log(`False positives: ${JSON.stringify(falsePos.fetch())}`); */
|
||||
return result;
|
||||
};
|
||||
|
||||
export const countRealFires = (firesCursor) => {
|
||||
const realFires = [];
|
||||
firesCursor.forEach((fire) => {
|
||||
if (debug) console.log(`${JSON.stringify(fire)} -----`);
|
||||
const union = firesUnion([fire]);
|
||||
if (debug) console.log(`${JSON.stringify(union)} -----`);
|
||||
const falsePos = whichAreFalsePositives(FalsePositives, union);
|
||||
const industries = whichAreFalsePositives(Industries, union);
|
||||
if (falsePos.count() === 0 && industries.count() === 0) {
|
||||
realFires.push(fire);
|
||||
}
|
||||
});
|
||||
// group fires
|
||||
const realUnion = firesUnion(realFires);
|
||||
const unionCount = realUnion[0] &&
|
||||
realUnion[0].geometry &&
|
||||
realUnion[0].geometry.coordinates ? realUnion[0].geometry.coordinates.length : 0;
|
||||
return unionCount;
|
||||
};
|
||||
|
||||
const countFiresInRegions = (regions, stringsToRemove) => {
|
||||
let total = 0;
|
||||
const fireStats = {};
|
||||
|
||||
regions.features.forEach((region) => {
|
||||
const regionName = cleanProv(region.properties.name, stringsToRemove);
|
||||
const regionCode = region.properties.iso_a2;
|
||||
if (debug) console.log(`${regionName} -----`);
|
||||
try {
|
||||
const fires = findFiresInRegion(region);
|
||||
// TODO Also check neighbour fires (when better implementation of that part)
|
||||
const initialCount = fires.count();
|
||||
if (initialCount > 0) {
|
||||
const unionCount = countRealFires(fires);
|
||||
if (debug) console.log(`${regionName} initial: ${initialCount}, union calc: ${unionCount}`);
|
||||
if (unionCount > 0) {
|
||||
total += unionCount;
|
||||
fireStats[regionName] = { count: unionCount, code: regionCode };
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
ravenLogger.log(e);
|
||||
}
|
||||
});
|
||||
return { total, fires: fireStats };
|
||||
};
|
||||
|
||||
export default countFiresInRegions;
|
||||
65
imports/api/ActiveFires/server/publications.js
Normal file
65
imports/api/ActiveFires/server/publications.js
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/* global Counter */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import { NumberBetween } from '/imports/modules/server/other-checks';
|
||||
import { whichAreFalsePositives, firesUnion } from '/imports/api/FalsePositives/server/publications';
|
||||
import FalsePositives from '/imports/api/FalsePositives/FalsePositives';
|
||||
import Industries from '/imports/api/Industries/Industries';
|
||||
import ActiveFires from '../ActiveFires';
|
||||
|
||||
const counter = new Counter('countActiveFires', ActiveFires.find({}));
|
||||
|
||||
Meteor.publish('activefirestotal', function total() {
|
||||
return counter;
|
||||
});
|
||||
|
||||
const activefires = (northEastLng, northEastLat, southWestLng, southWestLat, withMarks) => {
|
||||
const fires = ActiveFires.find({
|
||||
ourid: {
|
||||
$geoWithin: {
|
||||
$box: [
|
||||
[southWestLng, southWestLat],
|
||||
[northEastLng, northEastLat]
|
||||
]
|
||||
}
|
||||
}
|
||||
}, {
|
||||
fields: {
|
||||
lat: 1,
|
||||
lon: 1,
|
||||
when: 1,
|
||||
scan: 1,
|
||||
track: 1
|
||||
}
|
||||
});
|
||||
|
||||
if (Meteor.isDevelopment) console.log(`Active fires total: ${fires.count()}`);
|
||||
|
||||
if (withMarks && fires.fetch().length > 0) {
|
||||
const union = firesUnion(fires);
|
||||
const falsePos = whichAreFalsePositives(FalsePositives, union);
|
||||
const industries = whichAreFalsePositives(Industries, union);
|
||||
return [fires, falsePos, industries];
|
||||
}
|
||||
|
||||
return fires;
|
||||
};
|
||||
|
||||
Meteor.publish('activefiresmyloc', function activeInMyLoc(northEastLng, northEastLat, southWestLng, southWestLat, withMarks) {
|
||||
// latitude -90 and 90 and the longitude between -180 and 180
|
||||
check(northEastLng, NumberBetween(-180, 180));
|
||||
check(southWestLat, NumberBetween(-90, 90));
|
||||
check(southWestLng, NumberBetween(-180, 180));
|
||||
check(northEastLat, NumberBetween(-90, 90));
|
||||
check(withMarks, Boolean);
|
||||
|
||||
return activefires(northEastLng, northEastLat, southWestLng, southWestLat, withMarks);
|
||||
});
|
||||
|
||||
// Warning: this increase always by one the fire stats
|
||||
Meteor.publish('lastFireDetected', function lastFireDetected() {
|
||||
return ActiveFires.find({}, { limit: 1, sort: { when: -1 } });
|
||||
});
|
||||
155
imports/api/ActiveFires/server/tweetFiresInZone.js
Normal file
155
imports/api/ActiveFires/server/tweetFiresInZone.js
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
import getPrivateFile from '/imports/modules/server/get-private-file';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import tbuffer from '@turf/buffer';
|
||||
import emojiFlags from 'emoji-flags';
|
||||
import tweet from '/imports/modules/server/twitter';
|
||||
import countFiresInRegions from './countFires';
|
||||
|
||||
const debug = false;
|
||||
|
||||
const autonomies = tbuffer(JSON.parse(getPrivateFile('data/es-atlas-autonomies.json')), 0);
|
||||
const portugal = tbuffer(JSON.parse(getPrivateFile('data/pt-atlas.json')), 0);
|
||||
|
||||
const europe = tbuffer(JSON.parse(getPrivateFile('data/europe-atlas.json')), 0);
|
||||
|
||||
const stringsToRemoveIberia = [
|
||||
['Ciudad Autónoma de', ''],
|
||||
['País Vasco/', ''],
|
||||
['Pais Vasco', 'Euskadi'],
|
||||
['Comunidad Foral de', ''],
|
||||
['Región de', ''],
|
||||
['Valencia', 'CValenciana'],
|
||||
['Comunidad de Madrid', 'CMadrid'],
|
||||
['León', 'CyLeón'],
|
||||
['Leon', 'CyLeón'],
|
||||
['Castilla-', ''],
|
||||
['Cataluña/', ''],
|
||||
['Cataluña', 'Catalunya'],
|
||||
['La Mancha', 'CLMancha'],
|
||||
['Baleares', 'IllesBalears'],
|
||||
['Galicia', 'Galiza'],
|
||||
['Principado de', ''],
|
||||
[' ', '']
|
||||
];
|
||||
|
||||
const emoji = (key, name, fires) => {
|
||||
const emo = emojiFlags.countryCode(key.code);
|
||||
if (!emo) {
|
||||
if (Meteor.isDevelopment) console.log(`Cannot find flag for country ${name}: ${JSON.stringify(key)}`);
|
||||
return '';
|
||||
}
|
||||
return `${emo.emoji} ${fires}`;
|
||||
};
|
||||
|
||||
const composeEuropeTweet = (num, stats, abrev) => {
|
||||
if (num <= 0) {
|
||||
return '';
|
||||
}
|
||||
const keys = Object.keys(stats);
|
||||
const numZones = keys.length;
|
||||
let text = '';
|
||||
keys.map((key, index) => { // , index
|
||||
const zoneFires = stats[key].count;
|
||||
const zoneFiresText = zoneFires > 1 ? index === 0 ? zoneFires : `${zoneFires}` : index === 0 ? 'One' : '1';
|
||||
const what = index > 0 ? ' ' : zoneFires > 1 ? ' active #wildfires ' : ' active #wildfire ';
|
||||
const subText = abrev ? emoji(stats[key], key, zoneFires) :
|
||||
`${zoneFiresText}${what}in #{key}`;
|
||||
let delimiter;
|
||||
if (!abrev) {
|
||||
delimiter = index === numZones - 1 ? ' and' : ',';
|
||||
} else {
|
||||
delimiter = ',';
|
||||
}
|
||||
|
||||
const subTexts = index === 0 ? subText : `${delimiter} ${subText}`;
|
||||
text += subTexts;
|
||||
return '';
|
||||
});
|
||||
return `${text}`;
|
||||
};
|
||||
|
||||
const composeIberiaTweet = (num, stats) => {
|
||||
if (num <= 0) {
|
||||
return '';
|
||||
}
|
||||
const keys = Object.keys(stats);
|
||||
const numZones = keys.length;
|
||||
let text = '';
|
||||
keys.map((key, index) => { // , index
|
||||
const zoneFires = stats[key].count;
|
||||
const zoneFiresText = zoneFires > 1 ? index === 0 ? zoneFires : `otros ${zoneFires}` : index === 0 ? 'Un' : 'otro';
|
||||
const what = index > 0 ? ' ' : zoneFires > 1 ? ' #fuegos activos ' : ' #fuego activo ';
|
||||
const subText = `${zoneFiresText}${what}en #${key}`;
|
||||
const delimiter = index === numZones - 1 ? ' y' : ',';
|
||||
const subTexts = index === 0 ? subText : `${delimiter} ${subText}`;
|
||||
text += subTexts;
|
||||
return '';
|
||||
});
|
||||
return `${text}`;
|
||||
};
|
||||
|
||||
const tweetHeaders = ['🔥'];
|
||||
const tweetFooters = ['Más info en: https://fuegos.comunes.org/fires'];
|
||||
|
||||
|
||||
const correctTweetSize = (tweetText) => {
|
||||
const length = tweetText.length;
|
||||
if (length > 280) {
|
||||
if (Meteor.isDevelopment) console.log(`Tweet is too big (${length}): ${tweetText}`);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const tweetEuropeFires = () => {
|
||||
const resultEu = countFiresInRegions(europe, [[' ', '']]);
|
||||
|
||||
if (resultEu.total > 0) {
|
||||
let tweetText = `${tweetHeaders[0].trim()} ${composeEuropeTweet(resultEu.total, resultEu.fires, false)}. More info: https://fires.comunes.org/fires`;
|
||||
if (!correctTweetSize(tweetText)) {
|
||||
tweetText = `${tweetHeaders[0].trim()}Active #wildfires in #Europe:\n${composeEuropeTweet(resultEu.total, resultEu.fires, true)}. More info: https://fires.comunes.org/fires`;
|
||||
}
|
||||
if (!correctTweetSize(tweetText)) {
|
||||
tweetText = `${tweetHeaders[0].trim()}Active #wildfires in #Europe:\n${composeEuropeTweet(resultEu.total, resultEu.fires, true)}`;
|
||||
}
|
||||
if (!correctTweetSize(tweetText)) {
|
||||
tweetText = `${tweetHeaders[0].trim()} There are ${resultEu.total} active #wildfires in #Europe. More info: https://fires.comunes.org/fires`;
|
||||
}
|
||||
if (Meteor.isDevelopment) {
|
||||
console.log(tweetText);
|
||||
} else {
|
||||
tweet(tweetText, 'en');
|
||||
}
|
||||
return tweetText;
|
||||
}
|
||||
};
|
||||
|
||||
const tweetIberiaFires = () => {
|
||||
const resultEs = countFiresInRegions(autonomies, stringsToRemoveIberia);
|
||||
const resultPt = countFiresInRegions(portugal, stringsToRemoveIberia);
|
||||
|
||||
const fires = Object.assign(resultEs.fires, resultPt.fires);
|
||||
const total = resultEs.total + resultPt.total;
|
||||
|
||||
// console.log(`Total fires ${total}, ${JSON.stringify(fires)}`);
|
||||
if (total > 0) {
|
||||
const tweetText = `${tweetHeaders[0].trim()} ${composeIberiaTweet(total, fires)}. ${tweetFooters[0]}`;
|
||||
if (correctTweetSize(tweetText)) {
|
||||
if (Meteor.isDevelopment) {
|
||||
console.log(tweetText);
|
||||
} else {
|
||||
tweet(tweetText, 'es');
|
||||
}
|
||||
}
|
||||
return tweetText;
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
if (Meteor.isDevelopment && debug) {
|
||||
tweetIberiaFires();
|
||||
tweetEuropeFires();
|
||||
}
|
||||
|
||||
export { composeIberiaTweet, tweetHeaders, tweetFooters, tweetIberiaFires, tweetEuropeFires };
|
||||
71
imports/api/ActiveFiresUnion/ActiveFiresUnion.js
Normal file
71
imports/api/ActiveFiresUnion/ActiveFiresUnion.js
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/* eslint-disable consistent-return */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import LocationSchema from '/imports/api/Utility/LocationSchema.js';
|
||||
import { defaultCreatedAt, defaultUpdateAt } from '/imports/api/Utility/Utils.js';
|
||||
|
||||
const ActiveFiresUnion = new Mongo.Collection('activefiresunion', { idGeneration: 'MONGO' });
|
||||
|
||||
/* Sample:
|
||||
*
|
||||
* TODO
|
||||
*
|
||||
* */
|
||||
|
||||
// We have to store polygons and their centroids
|
||||
// {"type":"Polygon","coordinates":[[[-5.8645,43.5524],[-5.8621,43.5524],[-5.8621,43.5546],[-5.8645,43.5546],[-5.8645,43.5524]]]}
|
||||
|
||||
ActiveFiresUnion.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false
|
||||
});
|
||||
|
||||
ActiveFiresUnion.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true
|
||||
});
|
||||
|
||||
// https://www.npmjs.com/package/simpl-schema
|
||||
const GeoJsonSchema = new SimpleSchema({
|
||||
type: {
|
||||
type: String,
|
||||
allowedValues: ['Polygon']
|
||||
},
|
||||
coordinates: {
|
||||
type: Array
|
||||
},
|
||||
'coordinates.$': {
|
||||
type: Array
|
||||
},
|
||||
'coordinates.$.$': {
|
||||
type: Array
|
||||
},
|
||||
'coordinates.$.$.$': {
|
||||
type: Number
|
||||
}
|
||||
});
|
||||
|
||||
const firesUnionSchema = {
|
||||
centerid: LocationSchema,
|
||||
|
||||
// https://docs.mongodb.com/manual/reference/geojson/
|
||||
// <field>: { type: <GeoJSON type> , coordinates: <coordinates> }
|
||||
shape: GeoJsonSchema,
|
||||
history: { type: Array, optional: true },
|
||||
'history.$': GeoJsonSchema,
|
||||
|
||||
when: Date, // First date
|
||||
|
||||
createdAt: defaultCreatedAt,
|
||||
updatedAt: defaultUpdateAt
|
||||
};
|
||||
|
||||
ActiveFiresUnion.schema = new SimpleSchema(firesUnionSchema);
|
||||
|
||||
ActiveFiresUnion.attachSchema(ActiveFiresUnion.schema);
|
||||
|
||||
export default ActiveFiresUnion;
|
||||
80
imports/api/ActiveFiresUnion/server/publications.js
Normal file
80
imports/api/ActiveFiresUnion/server/publications.js
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
/* global Counter */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import { NumberBetween } from '/imports/modules/server/other-checks';
|
||||
// import { whichAreFalsePositives, firesUnion } from '/imports/api/FalsePositives/server/publications';
|
||||
// import FalsePositives from '/imports/api/FalsePositives/FalsePositives';
|
||||
// import Industries from '/imports/api/Industries/Industries';
|
||||
import ActiveFiresUnion from '../ActiveFiresUnion';
|
||||
|
||||
const counter = new Counter('countActiveFiresUnion', ActiveFiresUnion.find({}));
|
||||
|
||||
Meteor.publish('activefiresuniontotal', function total() {
|
||||
return counter;
|
||||
});
|
||||
|
||||
const activeFiresUnion = (b1, b2, c1, c2, withMarks) => {
|
||||
// a --- b
|
||||
// c --- d
|
||||
const geometry = {
|
||||
$geometry: {
|
||||
type: 'Polygon',
|
||||
coordinates: [[
|
||||
[c1, c2],
|
||||
[c1, b2],
|
||||
[b1, b2],
|
||||
[b1, c2],
|
||||
[c1, c2]
|
||||
]]
|
||||
}
|
||||
};
|
||||
// console.log(JSON.stringify(geometry));
|
||||
const fires = ActiveFiresUnion.find({
|
||||
shape: {
|
||||
$geoIntersects: geometry
|
||||
}
|
||||
}, {
|
||||
fields: {
|
||||
shape: 1,
|
||||
centerid: 1,
|
||||
when: 1,
|
||||
createdAt: 1,
|
||||
updatedAt: 1
|
||||
}
|
||||
});
|
||||
|
||||
if (Meteor.isDevelopment) console.log(`Active fires union total: ${fires.count()}`);
|
||||
|
||||
/*
|
||||
if (withMarks && fires.fetch().length > 0) {
|
||||
const union = firesUnion(fires);
|
||||
const falsePos = whichAreFalsePositives(FalsePositives, union);
|
||||
const industries = whichAreFalsePositives(Industries, union);
|
||||
return [fires, falsePos, industries];
|
||||
} */
|
||||
|
||||
return fires;
|
||||
};
|
||||
|
||||
Meteor.publish('activefiresunionmyloc', function activeInMyLoc(northEastLng, northEastLat, southWestLng, southWestLat, withMarks) {
|
||||
// latitude -90 and 90 and the longitude between -180 and 180
|
||||
check(northEastLng, NumberBetween(-180, 180));
|
||||
check(southWestLat, NumberBetween(-90, 90));
|
||||
check(southWestLng, NumberBetween(-180, 180));
|
||||
check(northEastLat, NumberBetween(-90, 90));
|
||||
check(withMarks, Boolean);
|
||||
|
||||
// I use this for fire stats
|
||||
// if (!Meteor.isDevelopment) return this.ready(); // empty
|
||||
return activeFiresUnion(northEastLng, northEastLat, southWestLng, southWestLat, withMarks);
|
||||
});
|
||||
|
||||
// Warning: this increase always by one the fire stats
|
||||
Meteor.publish('lastFireUnionDetected', function lastFireDetected() {
|
||||
// I use this for fire stats
|
||||
// if (!Meteor.isDevelopment) return this.ready(); // empty
|
||||
return ActiveFiresUnion.find({}, { limit: 1, sort: { when: -1 } });
|
||||
});
|
||||
40
imports/api/Common/FiresSchema.js
Normal file
40
imports/api/Common/FiresSchema.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { defaultCreatedAt, defaultUpdateAt } from '/imports/api/Utility/Utils.js';
|
||||
import LocationSchema from '/imports/api/Utility/LocationSchema.js';
|
||||
|
||||
const firesCommonSchema = {
|
||||
ourid: LocationSchema,
|
||||
lat: Number,
|
||||
lon: Number,
|
||||
type: String,
|
||||
when: Date,
|
||||
|
||||
// Neighbour notified fires
|
||||
|
||||
owner: { type: String, optional: true },
|
||||
dateformat: { type: String, optional: true },
|
||||
ourversion: { type: String, optional: true },
|
||||
|
||||
// NASA types
|
||||
address: { type: String, optional: true }, // reverse geo
|
||||
scan: { type: Number, optional: true },
|
||||
track: { type: Number, optional: true },
|
||||
acq_date: { type: String, optional: true },
|
||||
acq_time: { type: String, optional: true },
|
||||
satellite: { type: String, optional: true },
|
||||
confidence: { type: Number, optional: true },
|
||||
version: { type: String, optional: true },
|
||||
frp: { type: Number, optional: true },
|
||||
daynight: { type: String, optional: true },
|
||||
brightness: { type: Number, optional: true },
|
||||
bright_t31: { type: Number, optional: true },
|
||||
bright_ti4: { type: Number, optional: true },
|
||||
bright_ti5: { type: Number, optional: true },
|
||||
|
||||
// common
|
||||
createdAt: defaultCreatedAt,
|
||||
updatedAt: defaultUpdateAt
|
||||
};
|
||||
|
||||
export default firesCommonSchema;
|
||||
7
imports/api/Common/dates.js
Normal file
7
imports/api/Common/dates.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import moment from 'moment-timezone';
|
||||
|
||||
export const momentTz = date => moment.tz(date, moment.tz.guess());
|
||||
export const dateLongFormat = date => momentTz(date).format('LLLL (z)');
|
||||
export const dateParseShortFormat = date => moment(date, 'YYYY-MM-DD').format('LL');
|
||||
export const dateYYYYMMDD = date => moment(date).format('YYYY-MM-DD');
|
||||
export const dateFromNow = date => momentTz(date).fromNow();
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import Documents from '../Documents';
|
||||
|
|
|
|||
10
imports/api/FalsePositives/FalsePositiveTypes.js
Normal file
10
imports/api/FalsePositives/FalsePositiveTypes.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// FIXME Right now, only industry type should be a permanent 'false alarm', the rest are temporally
|
||||
|
||||
const types = {
|
||||
industry: 'Es una industria',
|
||||
// TODO volcano: 'Es un volcán',
|
||||
controled: 'Es una quema controlada',
|
||||
falsealarm: 'Parece una falsa alarma'
|
||||
};
|
||||
|
||||
export default types;
|
||||
48
imports/api/FalsePositives/FalsePositives.js
Normal file
48
imports/api/FalsePositives/FalsePositives.js
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/* eslint-disable consistent-return */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import { defaultCreatedAt, defaultUpdateAt } from '/imports/api/Utility/Utils.js';
|
||||
import LocationSchema from '/imports/api/Utility/LocationSchema.js';
|
||||
|
||||
const FalsePositives = new Mongo.Collection('falsePositives', { idGeneration: 'MONGO' });
|
||||
|
||||
FalsePositives.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false
|
||||
});
|
||||
|
||||
FalsePositives.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true
|
||||
});
|
||||
|
||||
FalsePositives.schema = new SimpleSchema({
|
||||
geo: LocationSchema,
|
||||
fireId: { type: Meteor.Collection.ObjectID, optional: true, blackbox: true },
|
||||
chatId: { type: Number, optional: true }, // only in 'telegram' type
|
||||
owner: String,
|
||||
type: String,
|
||||
when: Date,
|
||||
whendateformat: String,
|
||||
createdAt: defaultCreatedAt,
|
||||
updatedAt: defaultUpdateAt
|
||||
});
|
||||
|
||||
FalsePositives.attachSchema(FalsePositives.schema);
|
||||
|
||||
export const falsePositivesRemap = (odoc) => {
|
||||
const doc = odoc;
|
||||
const geo = doc.geo;
|
||||
doc.lat = geo.coordinates[1];
|
||||
doc.lon = geo.coordinates[0];
|
||||
doc._id = doc.fireId;
|
||||
doc.id = doc.fireId;
|
||||
delete doc.geo;
|
||||
return doc;
|
||||
};
|
||||
|
||||
export default FalsePositives;
|
||||
58
imports/api/FalsePositives/methods.js
Normal file
58
imports/api/FalsePositives/methods.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import moment from 'moment';
|
||||
import FalsePositives from './FalsePositives';
|
||||
import FalsePositiveTypes from './FalsePositiveTypes';
|
||||
import Fires from '../Fires/Fires';
|
||||
import rateLimit from '../../modules/rate-limit';
|
||||
|
||||
export function upsertFalsePositive(keyType, owner, fire) {
|
||||
const fireType = fire.type;
|
||||
if (fireType === 'vecinal') {
|
||||
throw new Meteor.Error('500', 'No se puede marcar este tipo de fuego');
|
||||
}
|
||||
const date = new Date();
|
||||
const formated = moment(date).format('YYYYMMDD');
|
||||
try {
|
||||
const set = {
|
||||
owner,
|
||||
type: keyType,
|
||||
when: date,
|
||||
whendateformat: formated,
|
||||
fireId: fire._id,
|
||||
geo: fire.ourid
|
||||
};
|
||||
return FalsePositives.upsert({ geo: fire.ourid, owner }, { $set: set }, { multi: false, upsert: true });
|
||||
} catch (exception) {
|
||||
console.log(exception);
|
||||
throw new Meteor.Error('500', exception);
|
||||
}
|
||||
}
|
||||
|
||||
Meteor.methods({
|
||||
'falsePositives.insert': function falsePositivesInsert(fireId, keyType) {
|
||||
check(fireId, Meteor.Collection.ObjectID);
|
||||
check(keyType, String);
|
||||
const type = FalsePositiveTypes[keyType];
|
||||
check(type, String);
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('500', 'Regístrate o inicia sesión para aportar información sobre este fuego');
|
||||
}
|
||||
check(this.userId, String);
|
||||
const fire = Fires.findOne(fireId);
|
||||
const owner = this.userId;
|
||||
if (fire) {
|
||||
upsertFalsePositive(keyType, owner, fire);
|
||||
} else {
|
||||
throw new Meteor.Error('500', 'Fuego no encontrado');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
rateLimit({
|
||||
methods: [
|
||||
'falsePositives.insert'
|
||||
],
|
||||
limit: 5,
|
||||
timeRange: 1000
|
||||
});
|
||||
105
imports/api/FalsePositives/server/publications.js
Normal file
105
imports/api/FalsePositives/server/publications.js
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
/* global Counter */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import { NumberBetween } from '/imports/modules/server/other-checks';
|
||||
import '/imports/startup/server/leaflet-workaround.js';
|
||||
import L from 'leaflet';
|
||||
import calcUnion from '/imports/ui/components/Maps/SubsUnion/Unify';
|
||||
import Industries from '/imports/api/Industries/Industries';
|
||||
import FalsePositives from '../FalsePositives';
|
||||
|
||||
const counter = new Counter('countFalsePositives', FalsePositives.find({}));
|
||||
|
||||
Meteor.publish('falsePositivesTotal', function total() {
|
||||
return counter;
|
||||
});
|
||||
|
||||
export const firesUnion = (fires) => {
|
||||
const firesArray = Array.isArray(fires) ? fires : fires.fetch(); // if not is a cursor
|
||||
const remap = firesArray.map(function remap(doc) {
|
||||
const isNASA = doc.type === 'modis' || doc.type === 'viirs';
|
||||
const pixelSize = doc.type === 'viirs' ? 0.375 : 1; // viirs has 375m pixel size, modis 1000m
|
||||
// default 1 km for neightbor alerts
|
||||
const map = {
|
||||
location: { lat: doc.lat, lon: doc.lon },
|
||||
distance: isNASA ? doc.scan * pixelSize : 1,
|
||||
distanceY: isNASA ? doc.track * pixelSize : 1
|
||||
};
|
||||
// console.log(map);
|
||||
return map;
|
||||
});
|
||||
const union = calcUnion(L, remap, sub => sub, false);
|
||||
return union;
|
||||
};
|
||||
|
||||
export const zoneToUnion = (lat, lon, distance) => {
|
||||
const remap = [{ location: { lat, lon }, distance }];
|
||||
const union = calcUnion(L, remap, sub => sub, true);
|
||||
return union;
|
||||
};
|
||||
|
||||
export const whichAreFalsePositives = (collection, union) => {
|
||||
const result = collection.find({
|
||||
geo: {
|
||||
$geoWithin: {
|
||||
$geometry: union[0].geometry
|
||||
}
|
||||
}
|
||||
}, {
|
||||
fields: {
|
||||
geo: 1,
|
||||
// type: 1,
|
||||
// when: 1,
|
||||
fireId: 1
|
||||
}
|
||||
});
|
||||
|
||||
/* console.log(`False positive total: ${falsePos.count()}`);
|
||||
console.log(`False positives: ${JSON.stringify(falsePos.fetch())}`); */
|
||||
return result;
|
||||
};
|
||||
|
||||
const find = (collection, northEastLng, northEastLat, southWestLng, southWestLat) => {
|
||||
const fires = collection.find({
|
||||
geo: {
|
||||
$geoWithin: {
|
||||
$box: [
|
||||
[southWestLng, southWestLat],
|
||||
[northEastLng, northEastLat]
|
||||
]
|
||||
}
|
||||
}
|
||||
}, {
|
||||
fields: {
|
||||
geo: 1,
|
||||
// type: 1,
|
||||
// when: 1,
|
||||
fireId: 1
|
||||
}
|
||||
});
|
||||
// console.log(`Fires total: ${fires.count()}`);
|
||||
return fires;
|
||||
};
|
||||
|
||||
Meteor.publishTransformed('falsePositivesMyloc', function falsePositivesInMyLoc(northEastLng, northEastLat, southWestLng, southWestLat) {
|
||||
// latitude -90 and 90 and the longitude between -180 and 180
|
||||
check(northEastLng, NumberBetween(-180, 180));
|
||||
check(southWestLat, NumberBetween(-90, 90));
|
||||
check(southWestLng, NumberBetween(-180, 180));
|
||||
check(northEastLat, NumberBetween(-90, 90));
|
||||
|
||||
return find(FalsePositives, northEastLng, northEastLat, southWestLng, southWestLat);
|
||||
});
|
||||
|
||||
Meteor.publishTransformed('industriesMyloc', function industriesInMyLoc(northEastLng, northEastLat, southWestLng, southWestLat) {
|
||||
// latitude -90 and 90 and the longitude between -180 and 180
|
||||
check(northEastLng, NumberBetween(-180, 180));
|
||||
check(southWestLat, NumberBetween(-90, 90));
|
||||
check(southWestLng, NumberBetween(-180, 180));
|
||||
check(northEastLat, NumberBetween(-90, 90));
|
||||
|
||||
return find(Industries, northEastLng, northEastLat, southWestLng, southWestLat);
|
||||
});
|
||||
25
imports/api/FireAlerts/FireAlerts.js
Normal file
25
imports/api/FireAlerts/FireAlerts.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/* eslint-disable consistent-return */
|
||||
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import firesCommonSchema from '../Common/FiresSchema';
|
||||
|
||||
const FireAlerts = new Mongo.Collection('avisosfuego', { idGeneration: 'MONGO' });
|
||||
|
||||
FireAlerts.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false
|
||||
});
|
||||
|
||||
FireAlerts.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true
|
||||
});
|
||||
|
||||
FireAlerts.schema = new SimpleSchema(firesCommonSchema);
|
||||
|
||||
FireAlerts.attachSchema(FireAlerts.schema);
|
||||
|
||||
export default FireAlerts;
|
||||
42
imports/api/FireAlerts/server/publications.js
Normal file
42
imports/api/FireAlerts/server/publications.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* eslint-disable prefer-arrow-callback */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import { NumberBetween } from '/imports/modules/server/other-checks';
|
||||
import FireAlerts from '../FireAlerts';
|
||||
|
||||
Meteor.publish('fireAlerts', function fireAlerts(northEastLng, northEastLat, southWestLng, southWestLat) {
|
||||
// latitude -90 and 90 and the longitude between -180 and 180
|
||||
check(northEastLng, NumberBetween(-180, 180));
|
||||
check(southWestLat, NumberBetween(-90, 90));
|
||||
check(southWestLng, NumberBetween(-180, 180));
|
||||
check(northEastLat, NumberBetween(-90, 90));
|
||||
|
||||
// https://stackoverflow.com/questions/29327222/mongodb-find-created-results-by-date-today/29327353
|
||||
const start = new Date();
|
||||
start.setHours(0, 0, 0, 0);
|
||||
const end = new Date();
|
||||
end.setHours(23, 59, 59, 999);
|
||||
|
||||
const fires = FireAlerts.find({
|
||||
ourid: {
|
||||
$geoWithin: {
|
||||
$box: [
|
||||
[southWestLng, southWestLat],
|
||||
[northEastLng, northEastLat]
|
||||
]
|
||||
}
|
||||
},
|
||||
createdAt: { $gte: start, $lt: end }
|
||||
}, {
|
||||
fields: {
|
||||
lat: 1,
|
||||
lon: 1,
|
||||
scan: 1,
|
||||
track: 1
|
||||
}
|
||||
});
|
||||
if (Meteor.isDevelopment) console.log(`Neighbour alerts total: ${fires.count()}`);
|
||||
return fires;
|
||||
});
|
||||
25
imports/api/Fires/Fires.js
Normal file
25
imports/api/Fires/Fires.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/* eslint-disable consistent-return */
|
||||
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import firesCommonSchema from '../Common/FiresSchema';
|
||||
|
||||
const Fires = new Mongo.Collection('fires', { idGeneration: 'MONGO' });
|
||||
|
||||
Fires.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false
|
||||
});
|
||||
|
||||
Fires.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true
|
||||
});
|
||||
|
||||
Fires.schema = new SimpleSchema(firesCommonSchema);
|
||||
|
||||
Fires.attachSchema(Fires.schema);
|
||||
|
||||
export default Fires;
|
||||
22
imports/api/Fires/methods.js
Normal file
22
imports/api/Fires/methods.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import rateLimit from '/imports/modules/rate-limit';
|
||||
import urlEnc from '/imports/modules/url-encode';
|
||||
|
||||
Meteor.methods({
|
||||
'fire.decrypt': async function fireDecode(fireEnc) {
|
||||
check(fireEnc, String);
|
||||
const unsealed = await urlEnc.decrypt(fireEnc);
|
||||
return unsealed;
|
||||
}
|
||||
});
|
||||
|
||||
rateLimit({
|
||||
methods: [
|
||||
'fire.decode'
|
||||
],
|
||||
limit: 5,
|
||||
timeRange: 1000
|
||||
});
|
||||
178
imports/api/Fires/server/publications.js
Normal file
178
imports/api/Fires/server/publications.js
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import urlEnc from '/imports/modules/url-encode';
|
||||
import { Promise } from 'meteor/promise';
|
||||
import NodeGeocoder from 'node-geocoder';
|
||||
import { gmapServerKey } from '/imports/startup/server/IPGeocoder';
|
||||
import ActiveFiresCollection from '/imports/api/ActiveFires/ActiveFires';
|
||||
import FireAlertsCollection from '/imports/api/FireAlerts/FireAlerts';
|
||||
import { whichAreFalsePositives, firesUnion } from '/imports/api/FalsePositives/server/publications';
|
||||
import FalsePositives from '/imports/api/FalsePositives/FalsePositives';
|
||||
import Industries from '/imports/api/Industries/Industries';
|
||||
import ravenLogger from '/imports/startup/server/ravenLogger';
|
||||
|
||||
import FiresCollection from '../Fires';
|
||||
|
||||
function findFire(unsealed) {
|
||||
const fire = FiresCollection.find({ ourid: { type: 'Point', coordinates: [unsealed.lon, unsealed.lat] }, when: unsealed.when, type: unsealed.type });
|
||||
return fire;
|
||||
}
|
||||
|
||||
const options = {
|
||||
provider: 'google',
|
||||
// Optional depending on the providers
|
||||
httpAdapter: 'https', // Default
|
||||
apiKey: gmapServerKey, // for Mapquest, OpenCage, Google Premier
|
||||
formatter: null // 'gpx', 'string', ...
|
||||
};
|
||||
|
||||
const geocoder = NodeGeocoder(options);
|
||||
|
||||
const unseal = async (obj) => {
|
||||
try {
|
||||
const unsealed = await urlEnc.decrypt(obj);
|
||||
return unsealed;
|
||||
} catch (error) {
|
||||
// console.warn(error);
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
const unsealW = obj => unseal(obj);
|
||||
|
||||
const fixConfidence = (obj) => {
|
||||
if (typeof obj.confidence === 'string') {
|
||||
obj.confidence = Number.parseInt(obj.confidence, 10);
|
||||
}
|
||||
if (typeof obj.confidence === 'undefined' || isNaN(obj.confidence)) {
|
||||
delete obj.confidence;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
const findOrCreateFire = (obj) => {
|
||||
const fire = findFire(obj);
|
||||
// console.log(`Found: ${fire.count()}`);
|
||||
if (!obj.address) {
|
||||
try {
|
||||
const rev = Promise.await(geocoder.reverse({ lat: obj.lat, lon: obj.lon }));
|
||||
if (rev[0]) {
|
||||
obj.address = rev[0].formattedAddress;
|
||||
}
|
||||
// console.log(obj.address);
|
||||
} catch (reve) {
|
||||
console.warn(reve);
|
||||
}
|
||||
}
|
||||
if (fire.count() === 0) {
|
||||
// const result =
|
||||
// console.log('Creating new fire');
|
||||
FiresCollection.upsert({ ourid: obj.ourid, when: obj.when, type: obj.type }, { $set: obj }, { multi: false, upsert: true });
|
||||
// console.log(JSON.stringify(result));
|
||||
}
|
||||
return findFire(obj);
|
||||
};
|
||||
|
||||
Meteor.publish('fireFromAlertId', function fireFromAlertId(_id) {
|
||||
try {
|
||||
check(_id, String);
|
||||
// console.log(`Looking for alert fire ${_id}`);
|
||||
const fire = FireAlertsCollection.findOne(new Meteor.Collection.ObjectID(_id));
|
||||
if (fire) {
|
||||
// console.info(`Active fire found: ${_id}`);
|
||||
return findOrCreateFire(fixConfidence(fire));
|
||||
}
|
||||
console.info(`Alert fire not found: ${_id}`);
|
||||
// Not found in active fires!
|
||||
return this.ready();
|
||||
} catch (e) {
|
||||
console.info(`Alert fire not found (with error): ${_id}`);
|
||||
return this.ready();
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.publish('fireFromActiveId', function fireFromActiveId(_id) {
|
||||
try {
|
||||
check(_id, String);
|
||||
// console.log(`Looking for active fire ${_id}`);
|
||||
const fire = ActiveFiresCollection.findOne(new Meteor.Collection.ObjectID(_id));
|
||||
if (fire) {
|
||||
// console.info(`Active fire found: ${_id}`);
|
||||
return findOrCreateFire(fixConfidence(fire));
|
||||
}
|
||||
console.info(`Active fire not found: ${_id}`);
|
||||
// Not found in active fires!
|
||||
return this.ready();
|
||||
} catch (e) {
|
||||
console.info(`Active fire not found (with error): ${_id}`);
|
||||
return this.ready();
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.publish('fireFromId', function fireFromId(_id) {
|
||||
try {
|
||||
check(_id, String);
|
||||
// console.log(`Looking for archive fire ${_id}`);
|
||||
const fire = FiresCollection.find(new Meteor.Collection.ObjectID(_id));
|
||||
if (fire.count() !== 0) {
|
||||
// console.info(`Archive fire found: ${_id}`);
|
||||
const union = firesUnion(fire);
|
||||
const falsePos = whichAreFalsePositives(FalsePositives, union);
|
||||
const industries = whichAreFalsePositives(Industries, union);
|
||||
return [fire, falsePos, industries];
|
||||
}
|
||||
console.info(`Fire not found: ${_id}`);
|
||||
// Not found in active fires!
|
||||
return this.ready();
|
||||
} catch (e) {
|
||||
console.info(`Archive fire not found (with error): ${_id}`);
|
||||
return this.ready();
|
||||
}
|
||||
});
|
||||
|
||||
function logUrl(fireEnc, params) {
|
||||
const message = `Wrong fire: ${fireEnc}. Params received in url: ${JSON.stringify(params)}`;
|
||||
console.log(message);
|
||||
ravenLogger.log(message);
|
||||
}
|
||||
|
||||
export function fireFromHash(fireEnc, params) {
|
||||
check(fireEnc, String);
|
||||
check(params, Object);
|
||||
|
||||
// console.log(fireEnc);
|
||||
// const unsealed = Promise.await(urlEnc.decrypt(fireEnc));
|
||||
const unsealed = Promise.await(unsealW(fireEnc));
|
||||
if (unsealed === undefined) {
|
||||
throw Error(`Fail to unseal '${fireEnc}'`);
|
||||
}
|
||||
const w = unsealed.when;
|
||||
unsealed.when = new Date(w);
|
||||
const c = unsealed.createdAt;
|
||||
unsealed.createdAt = !c ? new Date() : new Date(c);
|
||||
const u = unsealed.updatedAt;
|
||||
unsealed.updatedAt = !u ? new Date() : new Date(u);
|
||||
// console.log(unsealed);
|
||||
// FIXME:
|
||||
const unsealedFix = fixConfidence(unsealed);
|
||||
FiresCollection.schema.validate(unsealedFix);
|
||||
return findOrCreateFire(unsealedFix);
|
||||
/* console.log(`fires: ${fire.count()}`);
|
||||
* return fire; */
|
||||
}
|
||||
|
||||
Meteor.publish('fireFromHash', function fireFromHashFunc(fireEnc, params) {
|
||||
check(fireEnc, String);
|
||||
check(params, Object);
|
||||
try {
|
||||
return fireFromHash(fireEnc, params);
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
logUrl(fireEnc, params);
|
||||
// https://guide.meteor.com/data-loading.html
|
||||
return this.ready();
|
||||
}
|
||||
});
|
||||
58
imports/api/Industries/Industries.js
Normal file
58
imports/api/Industries/Industries.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/* eslint-disable consistent-return */
|
||||
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import LocationSchema from '/imports/api/Utility/LocationSchema.js';
|
||||
|
||||
const Industries = new Mongo.Collection('industries');
|
||||
|
||||
// https://prtr.unece.org/prtr-global-map
|
||||
// For now using:
|
||||
|
||||
// AUSTRALIA
|
||||
// https://data.gov.au/dataset/npi#
|
||||
//
|
||||
// EUROPE
|
||||
// https://www.eea.europa.eu/data-and-maps/data/member-states-reporting-art-7-under-the-european-pollutant-release-and-transfer-register-e-prtr-regulation-16
|
||||
//
|
||||
// CANADA
|
||||
// https://www.canada.ca/en/environment-climate-change/services/national-pollutant-release-inventory/tools-resources-data/access.html
|
||||
//
|
||||
// USA
|
||||
// https://www.epa.gov/enviro/epa-frs-facilities-state-single-file-csv-download
|
||||
|
||||
// TODO:
|
||||
// http://www.nite.go.jp/
|
||||
// http://www.retc.cl/datos-retc/
|
||||
|
||||
Industries.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false
|
||||
});
|
||||
|
||||
Industries.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true
|
||||
});
|
||||
|
||||
Industries.schema = new SimpleSchema({
|
||||
geo: LocationSchema,
|
||||
name: { type: String, optional: true },
|
||||
registry: String
|
||||
});
|
||||
|
||||
Industries.attachSchema(Industries.schema);
|
||||
|
||||
export const industriesRemap = (odoc) => {
|
||||
const doc = odoc;
|
||||
const geo = doc.geo;
|
||||
doc.lat = geo.coordinates[1];
|
||||
doc.lon = geo.coordinates[0];
|
||||
doc.id = doc._id;
|
||||
delete doc.geo;
|
||||
return doc;
|
||||
};
|
||||
|
||||
export default Industries;
|
||||
29
imports/api/Industries/IndustryRegistries.js
Normal file
29
imports/api/Industries/IndustryRegistries.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* eslint-disable consistent-return */
|
||||
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
|
||||
const IndustryRegistries = new Mongo.Collection('industryregistries', { idGeneration: 'MONGO' });
|
||||
|
||||
IndustryRegistries.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false
|
||||
});
|
||||
|
||||
IndustryRegistries.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true
|
||||
});
|
||||
|
||||
IndustryRegistries.schema = new SimpleSchema({
|
||||
name: String,
|
||||
agency: String,
|
||||
region: String
|
||||
|
||||
});
|
||||
|
||||
IndustryRegistries.attachSchema(IndustryRegistries.schema);
|
||||
|
||||
export default IndustryRegistries;
|
||||
42
imports/api/Notifications/Notifications.js
Normal file
42
imports/api/Notifications/Notifications.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* eslint-disable consistent-return */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import { defaultCreatedAt, defaultUpdateAt } from '/imports/api/Utility/Utils.js';
|
||||
import LocationSchema from '/imports/api/Utility/LocationSchema.js';
|
||||
|
||||
const Notifications = new Mongo.Collection('notifications', { idGeneration: 'MONGO' });
|
||||
|
||||
Notifications.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false
|
||||
});
|
||||
|
||||
Notifications.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true
|
||||
});
|
||||
|
||||
Notifications.schema = new SimpleSchema({
|
||||
userId: String,
|
||||
subsId: { type: Meteor.Collection.ObjectID, optional: true, blackbox: true },
|
||||
content: String,
|
||||
geo: LocationSchema,
|
||||
type: String,
|
||||
notified: { type: Boolean, optional: true },
|
||||
notifiedAt: { type: Date, optional: true },
|
||||
emailNotified: { type: Boolean, optional: true },
|
||||
emailNotifiedAt: { type: Date, optional: true },
|
||||
when: Date,
|
||||
sealed: String,
|
||||
createdAt: defaultCreatedAt,
|
||||
updatedAt: defaultUpdateAt
|
||||
});
|
||||
|
||||
Notifications.attachSchema(Notifications.schema);
|
||||
|
||||
export default Notifications;
|
||||
25
imports/api/Notifications/methods.js
Normal file
25
imports/api/Notifications/methods.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import Notifications from './Notifications';
|
||||
import rateLimit from '../../modules/rate-limit';
|
||||
|
||||
Meteor.methods({
|
||||
'notifications.sent': function notificationsUpdate(notifId) {
|
||||
check(notifId, Meteor.Collection.ObjectID);
|
||||
|
||||
try {
|
||||
Notifications.update(notifId, { $set: { notified: true, notifiedAt: new Date() } });
|
||||
return notifId;
|
||||
} catch (exception) {
|
||||
throw new Meteor.Error('500', exception);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
rateLimit({
|
||||
methods: [
|
||||
'notifications.sent'
|
||||
],
|
||||
limit: 5,
|
||||
timeRange: 1000
|
||||
});
|
||||
10
imports/api/Notifications/server/publications.js
Normal file
10
imports/api/Notifications/server/publications.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import Notifications from '../Notifications';
|
||||
|
||||
Meteor.publish('mynotifications', function notifications() {
|
||||
const notif = Notifications.find({ userId: this.userId, type: 'web', notified: null });
|
||||
// console.log(`Notifications for user ${this.userId}: ${notif.count()}`);
|
||||
return notif;
|
||||
});
|
||||
457
imports/api/Rest/Rest.js
Normal file
457
imports/api/Rest/Rest.js
Normal file
|
|
@ -0,0 +1,457 @@
|
|||
/* global Restivus */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { NumberBetween } from '/imports/modules/server/other-checks';
|
||||
import Fires from '/imports/api/Fires/Fires';
|
||||
import { check } from 'meteor/check';
|
||||
import SiteSettings from '/imports/api/SiteSettings/SiteSettings';
|
||||
import ActiveFiresCollection from '/imports/api/ActiveFires/ActiveFires';
|
||||
import { countRealFires } from '/imports/api/ActiveFires/server/countFires';
|
||||
import { whichAreFalsePositives, firesUnion, zoneToUnion } from '/imports/api/FalsePositives/server/publications';
|
||||
import { fireFromHash } from '/imports/api/Fires/server/publications.js';
|
||||
import FalsePositives from '/imports/api/FalsePositives/FalsePositives';
|
||||
import Industries from '/imports/api/Industries/Industries';
|
||||
import Subscriptions from '/imports/api/Subscriptions/Subscriptions';
|
||||
import jsend from 'jsend';
|
||||
import { Random } from 'meteor/random';
|
||||
import { subscriptionsInsert } from '/imports/api/Subscriptions/methods.js';
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import { upsertFalsePositive } from '/imports/api/FalsePositives/methods.js';
|
||||
|
||||
const debug = false;
|
||||
|
||||
const uptime = new Date();
|
||||
|
||||
const restivusError = (code, message) => ({ status: 'error', statusCode: code, body: message });
|
||||
|
||||
|
||||
function failMsg(msg) {
|
||||
return restivusError(500, `Unexpected error in REST call: ${msg}`);
|
||||
}
|
||||
|
||||
function fail(e) {
|
||||
return restivusError(500, `Unexpected error in REST call: ${e}`);
|
||||
}
|
||||
|
||||
function defaultFailParams(e) {
|
||||
return restivusError(400, `Wrong REST params: ${e}`);
|
||||
}
|
||||
|
||||
function checkAuthToken(token) {
|
||||
if (!Meteor.settings.private.internalApiToken || token !== Meteor.settings.private.internalApiToken) {
|
||||
const message = 'Unauthorized auth token in REST API';
|
||||
console.warn(message);
|
||||
return restivusError(401, message);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function checkLatLonDist(km, lat, lng) {
|
||||
check(lng, NumberBetween(-180, 180));
|
||||
check(lat, NumberBetween(-90, 90));
|
||||
check(km, NumberBetween(0, Meteor.isDevelopment ? 1000 : 100));
|
||||
}
|
||||
|
||||
if (!Meteor.settings.private.internalApiToken) {
|
||||
console.warn('Meteor.settings.private.internalApiToken is not configured so we don\'t enable our REST API');
|
||||
} else {
|
||||
// export
|
||||
const apiV1 = new Restivus({
|
||||
useDefaultAuth: true,
|
||||
apiPath: 'api',
|
||||
version: 'v1',
|
||||
prettyJson: true
|
||||
});
|
||||
|
||||
// Generates: POST on /api/users and GET, DELETE /api/users/:id for
|
||||
// Meteor.users collection
|
||||
/* apiV1.addCollection(Meteor.users, {
|
||||
* excludedEndpoints: ['getAll', 'put', 'delete', 'patch', 'get'],
|
||||
* routeOptions: {
|
||||
* authRequired: true
|
||||
* },
|
||||
* endpoints: {
|
||||
* post: {
|
||||
* authRequired: false
|
||||
* },
|
||||
* delete: {
|
||||
* roleRequired: 'admin'
|
||||
* }
|
||||
* }
|
||||
* }); */
|
||||
|
||||
apiV1.addCollection(Fires, {
|
||||
excludedEndpoints: ['put', 'post', 'patch', 'delete'],
|
||||
// excludedEndpoints: ['getAll', 'put', 'post', 'patch', 'delete'],
|
||||
routeOptions: {
|
||||
authRequired: false
|
||||
},
|
||||
endpoints: {
|
||||
get: {
|
||||
action: function getFire() {
|
||||
return Fires.findOne(new Meteor.Collection.ObjectID(this.urlParams.id));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Maps to: /api/v1/status/last-fire-check
|
||||
apiV1.addRoute('status/last-fire-check', { authRequired: false }, {
|
||||
get: function get() {
|
||||
return SiteSettings.findOne({ name: 'last-fire-check' });
|
||||
}
|
||||
});
|
||||
|
||||
// Maps to: /api/v1/status/last-fire-detected
|
||||
apiV1.addRoute('status/last-fire-detected', { authRequired: false }, {
|
||||
get: function get() {
|
||||
return ActiveFiresCollection.findOne({}, { sort: { when: -1 } });
|
||||
}
|
||||
});
|
||||
|
||||
// Maps to: /api/v1/status/active-fires-count
|
||||
apiV1.addRoute('status/active-fires-count', { authRequired: false }, {
|
||||
get: function get() {
|
||||
return { total: ActiveFiresCollection.find({}).count() };
|
||||
}
|
||||
});
|
||||
|
||||
// Maps to: /api/v1/status/uptime
|
||||
apiV1.addRoute('status/uptime', { authRequired: false }, {
|
||||
get: function get() {
|
||||
return { ms: new Date() - uptime };
|
||||
}
|
||||
});
|
||||
|
||||
function getFires(route, full) {
|
||||
const lat = Number(route.urlParams.lat);
|
||||
const lng = Number(route.urlParams.lng);
|
||||
const km = Number(route.urlParams.km);
|
||||
const { token } = route.urlParams;
|
||||
try {
|
||||
checkLatLonDist(km, lat, lng);
|
||||
check(token, String);
|
||||
} catch (e) {
|
||||
return defaultFailParams(e);
|
||||
}
|
||||
|
||||
const failed = checkAuthToken(token);
|
||||
if (failed) return failed;
|
||||
|
||||
if (debug) console.log(`Query for fires in ${lat}, ${lng} in ${km} km radius`);
|
||||
|
||||
const fires = ActiveFiresCollection.find({
|
||||
ourid: {
|
||||
$near: {
|
||||
$geometry: {
|
||||
type: 'Point',
|
||||
coordinates: [lng, lat]
|
||||
},
|
||||
$maxDistance: km * 1000,
|
||||
$minDistance: 0
|
||||
}
|
||||
}
|
||||
}, {
|
||||
fields: {
|
||||
lat: 1,
|
||||
lon: 1,
|
||||
when: 1,
|
||||
type: 1, // modis, viirs, vecinal
|
||||
scan: 1,
|
||||
track: 1
|
||||
}
|
||||
});
|
||||
|
||||
const result = { total: fires.count(), real: countRealFires(fires) };
|
||||
if (debug) console.log(`Query for fires in ${lat}, ${lng} in ${km} km radius ${result}`);
|
||||
|
||||
if (!full) {
|
||||
return result;
|
||||
}
|
||||
|
||||
let union;
|
||||
|
||||
// TODO only get real
|
||||
const firesA = fires.fetch();
|
||||
|
||||
if (firesA.length > 0) {
|
||||
union = firesUnion(fires);
|
||||
} else {
|
||||
union = zoneToUnion(lat, lng, km);
|
||||
}
|
||||
const falsePos = whichAreFalsePositives(FalsePositives, union);
|
||||
const industries = whichAreFalsePositives(Industries, union);
|
||||
result.fires = firesA;
|
||||
result.industries = industries.fetch();
|
||||
result.falsePos = falsePos.fetch();
|
||||
return result;
|
||||
}
|
||||
|
||||
// Maps to: /api/v1/fires-in/:lat/:lng/:km
|
||||
// 100 km max
|
||||
// Ex: http://127.0.0.1:3000/api/v1/fires-in/token/38.736946/-9.142685/100
|
||||
apiV1.addRoute('fires-in/:token/:lat/:lng/:km', { authRequired: false }, {
|
||||
get: function get() {
|
||||
return getFires(this, false);
|
||||
}
|
||||
});
|
||||
|
||||
apiV1.addRoute('fires-in-full/:token/:lat/:lng/:km', { authRequired: false }, {
|
||||
get: function get() {
|
||||
return getFires(this, true);
|
||||
}
|
||||
});
|
||||
|
||||
// Add mobile user:
|
||||
// curl -X POST http://localhost:3000/api/v1/users/mobile -d "token: thisAppAutToken" -d "mobileToken: user-mobile-firebase-token"
|
||||
// Response:
|
||||
//
|
||||
// https://docs.meteor.com/api/passwords.html#Accounts-createUser
|
||||
apiV1.addRoute('mobile/users', { authRequired: false }, {
|
||||
post: function post() {
|
||||
const { token, mobileToken, lang } = this.bodyParams;
|
||||
try {
|
||||
check(token, String);
|
||||
check(lang, String);
|
||||
check(mobileToken, String);
|
||||
} catch (e) {
|
||||
return defaultFailParams(e);
|
||||
}
|
||||
|
||||
const failed = checkAuthToken(token);
|
||||
if (failed) return failed;
|
||||
|
||||
let username;
|
||||
|
||||
const already = Meteor.users.find({ fireBaseToken: mobileToken });
|
||||
|
||||
if (already.count() > 1) {
|
||||
return restivusError(500, 'Unexpected error in REST call: several users with that mobile token?');
|
||||
} else if (already.count() === 1) {
|
||||
username = already.fetch()[0].username;
|
||||
} else {
|
||||
do {
|
||||
username = Random.id(15);
|
||||
} while (Meteor.users.find({ username }).count() !== 0);
|
||||
}
|
||||
|
||||
// FIXME check valid lang
|
||||
|
||||
const now = new Date();
|
||||
|
||||
const result = Meteor.users.upsert({
|
||||
fireBaseToken: mobileToken
|
||||
}, {
|
||||
$set: {
|
||||
username,
|
||||
fireBaseToken: mobileToken,
|
||||
lang,
|
||||
profile: { },
|
||||
createdAt: now,
|
||||
updatedAt: now
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (debug) {
|
||||
console.log(this.bodyParams);
|
||||
console.log(this.urlParams);
|
||||
console.log(this.queryParams);
|
||||
}
|
||||
|
||||
const upsertUser = Meteor.users.findOne({ username });
|
||||
|
||||
if (debug) console.log(upsertUser);
|
||||
|
||||
return jsend.success({
|
||||
upsertResult: result,
|
||||
username,
|
||||
userId: upsertUser._id,
|
||||
lang: upsertUser.lang,
|
||||
mobileToken: upsertUser.fireBaseToken
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// max sitance: 100km
|
||||
apiV1.addRoute('mobile/subscriptions', { authRequired: false }, {
|
||||
post: function post() {
|
||||
const {
|
||||
token,
|
||||
mobileToken,
|
||||
id,
|
||||
lat,
|
||||
lon,
|
||||
distance
|
||||
} = this.bodyParams;
|
||||
let oid;
|
||||
try {
|
||||
check(token, String);
|
||||
check(mobileToken, String);
|
||||
check(id, String);
|
||||
oid = new Mongo.ObjectID(id);
|
||||
check(oid, Meteor.Collection.ObjectID);
|
||||
check(lat, Number);
|
||||
check(lon, Number);
|
||||
check(distance, Number);
|
||||
checkLatLonDist(distance, lat, lon);
|
||||
} catch (e) {
|
||||
if (debug) console.log(e);
|
||||
return defaultFailParams(e);
|
||||
}
|
||||
|
||||
const failed = checkAuthToken(token);
|
||||
if (failed) return failed;
|
||||
|
||||
const user = Meteor.users.findOne({ fireBaseToken: mobileToken });
|
||||
if (!user) return failMsg('User not found');
|
||||
|
||||
const newSubs = {};
|
||||
newSubs._id = new Meteor.Collection.ObjectID(id);
|
||||
newSubs.location = {};
|
||||
newSubs.location.lat = lat;
|
||||
newSubs.location.lon = lon;
|
||||
newSubs.distance = distance;
|
||||
|
||||
let result;
|
||||
try {
|
||||
result = subscriptionsInsert(newSubs, user._id, 'mobile');
|
||||
} catch (e) {
|
||||
return fail(e);
|
||||
}
|
||||
return jsend.success({ subsId: result._str });
|
||||
}
|
||||
});
|
||||
|
||||
apiV1.addRoute('mobile/subscriptions/:token/:mobileToken/:subsId', { authRequired: false }, {
|
||||
delete: function del() {
|
||||
const {
|
||||
token,
|
||||
mobileToken,
|
||||
subsId
|
||||
} = this.urlParams;
|
||||
try {
|
||||
check(token, String);
|
||||
check(mobileToken, String);
|
||||
check(subsId, String);
|
||||
} catch (e) {
|
||||
return defaultFailParams(e);
|
||||
}
|
||||
|
||||
const failed = checkAuthToken(token);
|
||||
if (failed) return failed;
|
||||
|
||||
const user = Meteor.users.findOne({ fireBaseToken: mobileToken });
|
||||
if (!user) return failMsg('User not found');
|
||||
|
||||
try {
|
||||
Subscriptions.remove({ owner: user._id, _id: new Meteor.Collection.ObjectID(subsId) });
|
||||
} catch (e) {
|
||||
return fail(e);
|
||||
}
|
||||
|
||||
return jsend.success({});
|
||||
}
|
||||
});
|
||||
|
||||
apiV1.addRoute('mobile/subscriptions/all/:token/:mobileToken', { authRequired: false }, {
|
||||
get: function get() {
|
||||
const { token, mobileToken } = this.urlParams;
|
||||
try {
|
||||
check(token, String);
|
||||
check(mobileToken, String);
|
||||
} catch (e) {
|
||||
return defaultFailParams(e);
|
||||
}
|
||||
|
||||
const failed = checkAuthToken(token);
|
||||
if (failed) return failed;
|
||||
|
||||
const user = Meteor.users.findOne({ fireBaseToken: mobileToken });
|
||||
if (!user) return failMsg('User not found');
|
||||
|
||||
const result = Subscriptions.find({ owner: user._id });
|
||||
|
||||
return jsend.success({ subscriptions: result.fetch(), count: result.count() });
|
||||
},
|
||||
delete: function delAll() {
|
||||
const { token, mobileToken } = this.urlParams;
|
||||
try {
|
||||
check(token, String);
|
||||
check(mobileToken, String);
|
||||
} catch (e) {
|
||||
return defaultFailParams(e);
|
||||
}
|
||||
|
||||
const failed = checkAuthToken(token);
|
||||
if (failed) return failed('Auth api check failed');
|
||||
|
||||
if (Meteor.users.find({ fireBaseToken: mobileToken }).count() !== 1) return fail;
|
||||
|
||||
const user = Meteor.users.findOne({ fireBaseToken: mobileToken });
|
||||
if (!user) return failMsg('User not found');
|
||||
|
||||
const toRemove = Subscriptions.find({ owner: user._id }).count();
|
||||
Subscriptions.remove({ owner: user._id });
|
||||
|
||||
return jsend.success({ count: toRemove });
|
||||
}
|
||||
});
|
||||
|
||||
apiV1.addRoute('status/subs-public-union/:token', { authRequired: false }, {
|
||||
get: function get() {
|
||||
const { token } = this.urlParams;
|
||||
try {
|
||||
check(token, String);
|
||||
} catch (e) {
|
||||
return defaultFailParams(e);
|
||||
}
|
||||
|
||||
const failed = checkAuthToken(token);
|
||||
if (failed) return failed;
|
||||
|
||||
const currentUnion = SiteSettings.findOne({ name: 'subs-public-union' });
|
||||
const userSubsBounds = SiteSettings.findOne({ name: 'subs-public-union-bounds' });
|
||||
|
||||
return jsend.success({ union: currentUnion, bounds: userSubsBounds });
|
||||
}
|
||||
});
|
||||
|
||||
apiV1.addRoute('mobile/falsepositive', { authRequired: false }, {
|
||||
post: function post() {
|
||||
const {
|
||||
token,
|
||||
mobileToken,
|
||||
sealed,
|
||||
type
|
||||
} = this.bodyParams;
|
||||
try {
|
||||
check(token, String);
|
||||
check(mobileToken, String);
|
||||
check(sealed, String);
|
||||
check(type, String);
|
||||
} catch (e) {
|
||||
if (debug) console.log(e);
|
||||
return defaultFailParams(e);
|
||||
}
|
||||
|
||||
const failed = checkAuthToken(token);
|
||||
if (failed) return failed;
|
||||
|
||||
const user = Meteor.users.findOne({ fireBaseToken: mobileToken });
|
||||
if (!user) return failMsg('User not found');
|
||||
|
||||
console.log(`Marking hash fire as '${type}' false positive: ${sealed}`);
|
||||
const fireC = fireFromHash(sealed, { id: sealed });
|
||||
if (fireC && typeof fireC === 'object') {
|
||||
const fire = fireC.fetch()[0];
|
||||
console.log(`Marking fire as false positive: ${fire._id}`);
|
||||
const result = upsertFalsePositive(type, user._id, fire);
|
||||
return jsend.success({ upsert: result });
|
||||
}
|
||||
return failMsg('Cannot mark fire as false positive');
|
||||
}
|
||||
});
|
||||
}
|
||||
50
imports/api/SiteSettings/SiteSettings.js
Normal file
50
imports/api/SiteSettings/SiteSettings.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/* eslint-disable consistent-return */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import { defaultCreatedAt, defaultUpdateAt } from '/imports/api/Utility/Utils.js';
|
||||
import SiteSettingsTypes from './SiteSettingsTypes';
|
||||
|
||||
const SiteSettings = new Mongo.Collection('siteSettings', { idGeneration: 'MONGO' });
|
||||
|
||||
SiteSettings.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false
|
||||
});
|
||||
|
||||
SiteSettings.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true
|
||||
});
|
||||
|
||||
SiteSettings.get = (name) => {
|
||||
const setting = SiteSettings.findOne({
|
||||
name
|
||||
});
|
||||
return typeof setting === 'object' ? setting.value : undefined;
|
||||
};
|
||||
|
||||
SiteSettings.observe = (name, callback) => {
|
||||
SiteSettings.find({ name }).observe({
|
||||
added: (document) => {
|
||||
callback(document.value);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
SiteSettings.getSchema = type => new SimpleSchema({
|
||||
name: String,
|
||||
type: String,
|
||||
description: String,
|
||||
value: SiteSettingsTypes[type].value,
|
||||
isPublic: Boolean,
|
||||
createdAt: defaultCreatedAt,
|
||||
updatedAt: defaultUpdateAt
|
||||
});
|
||||
|
||||
// SiteSettings.attachSchema(SiteSettings.schema);
|
||||
|
||||
export default SiteSettings;
|
||||
66
imports/api/SiteSettings/SiteSettingsTypes.js
Normal file
66
imports/api/SiteSettings/SiteSettingsTypes.js
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
// Adapted from: https://github.com/yogiben/meteor-admin-settings
|
||||
|
||||
const SiteSettingsTypes = {
|
||||
string: {
|
||||
value: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
textarea: {
|
||||
value: {
|
||||
type: String
|
||||
/* autoform: {
|
||||
* afFieldInput: {
|
||||
* rows: 5
|
||||
* }
|
||||
* } */
|
||||
}
|
||||
},
|
||||
number: {
|
||||
value: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
boolean: {
|
||||
value: {
|
||||
type: Boolean
|
||||
/* autoform: {
|
||||
* afFieldInput: {
|
||||
* type: 'boolean-select'
|
||||
* }
|
||||
* } */
|
||||
}
|
||||
},
|
||||
date: {
|
||||
value: {
|
||||
type: Date
|
||||
/* autoform: {
|
||||
* afFieldInput: {
|
||||
* type: 'date'
|
||||
* }
|
||||
* } */
|
||||
}
|
||||
},
|
||||
color: {
|
||||
value: {
|
||||
type: String
|
||||
/* autoform: {
|
||||
* afFieldInput: {
|
||||
* type: 'color'
|
||||
* }
|
||||
* } */
|
||||
}
|
||||
},
|
||||
password: {
|
||||
value: {
|
||||
type: String
|
||||
/* autoform: {
|
||||
* afFieldInput: {
|
||||
* type: 'password'
|
||||
* }
|
||||
* } */
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default SiteSettingsTypes;
|
||||
60
imports/api/SiteSettings/methods.js
Normal file
60
imports/api/SiteSettings/methods.js
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
/* import { check } from 'meteor/check';
|
||||
import SiteSettings from './SiteSettings';
|
||||
import SiteSettingsTypes from './SiteSettingsTypes'; */
|
||||
import rateLimit from '../../modules/rate-limit';
|
||||
|
||||
Meteor.methods({
|
||||
/* 'siteSettings.insert': function siteSettingsInsert(setting) {
|
||||
check(setting, {
|
||||
name: String,
|
||||
type: String,
|
||||
description: String,
|
||||
value: SiteSettingsTypes[self.type].value
|
||||
});
|
||||
|
||||
SiteSettings.getSchema.validate(setting);
|
||||
|
||||
try {
|
||||
return SiteSettings.insert({ owner: this.userId, ...setting });
|
||||
} catch (exception) {
|
||||
throw new Meteor.Error('500', exception);
|
||||
}
|
||||
},
|
||||
'siteSettings.update': function siteSettingsUpdate(setting) {
|
||||
check(setting, {
|
||||
_id: String,
|
||||
name: String,
|
||||
type: String,
|
||||
description: String,
|
||||
value: SiteSettingsTypes[self.type].value
|
||||
});
|
||||
|
||||
try {
|
||||
const siteSettingId = setting._id;
|
||||
SiteSettings.update(siteSettingId, { $set: setting });
|
||||
return siteSettingId; // Return _id so we can redirect to siteSetting after update.
|
||||
} catch (exception) {
|
||||
throw new Meteor.Error('500', exception);
|
||||
}
|
||||
},
|
||||
'siteSettings.remove': function siteSettingsRemove(siteSettingId) {
|
||||
check(siteSettingId, String);
|
||||
|
||||
try {
|
||||
return SiteSettings.remove(siteSettingId);
|
||||
} catch (exception) {
|
||||
throw new Meteor.Error('500', exception);
|
||||
}
|
||||
} */
|
||||
});
|
||||
|
||||
rateLimit({
|
||||
methods: [
|
||||
/* 'siteSettings.insert',
|
||||
'siteSettings.update',
|
||||
'siteSettings.remove' */
|
||||
],
|
||||
limit: 5,
|
||||
timeRange: 1000
|
||||
});
|
||||
6
imports/api/SiteSettings/server/publications.js
Normal file
6
imports/api/SiteSettings/server/publications.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import SiteSettings from '../SiteSettings';
|
||||
|
||||
Meteor.publish('settings', () => SiteSettings.find({ isPublic: true }));
|
||||
62
imports/api/Subscriptions/Subscriptions.js
Normal file
62
imports/api/Subscriptions/Subscriptions.js
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/* eslint-disable consistent-return */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import { defaultCreatedAt, defaultUpdateAt } from '/imports/api/Utility/Utils.js';
|
||||
import LocationSchema from '/imports/api/Utility/LocationSchema.js';
|
||||
|
||||
const Subscriptions = new Mongo.Collection('subscriptions', { idGeneration: 'MONGO' });
|
||||
|
||||
Subscriptions.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false
|
||||
});
|
||||
|
||||
Subscriptions.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true
|
||||
});
|
||||
|
||||
|
||||
/* Sample:
|
||||
* {
|
||||
* "_id" : ObjectId("5a0bfb5a79095a1adba47513"),
|
||||
* "chatId" : -253600015,
|
||||
* "location" : {
|
||||
* "lat" : 40.234503,
|
||||
* "lon" : -3.350386
|
||||
* },
|
||||
* "geo" : {
|
||||
* "type" : "Point",
|
||||
* "coordinates" : [
|
||||
* -3.350386,
|
||||
* 40.234503
|
||||
* ]
|
||||
* },
|
||||
* "distance" : 40
|
||||
* }
|
||||
* */
|
||||
|
||||
|
||||
Subscriptions.schema = new SimpleSchema({
|
||||
_id: { type: Meteor.Collection.ObjectID, optional: true, blackbox: true },
|
||||
location: Object,
|
||||
'location.lat': Number,
|
||||
'location.lon': Number,
|
||||
geo: LocationSchema,
|
||||
distance: Number,
|
||||
chatId: { type: Number, optional: true }, // only in 'telegram' type
|
||||
telegramBot: { type: String, optional: true }, // only in 'telegram' type
|
||||
owner: String,
|
||||
type: String,
|
||||
createdAt: defaultCreatedAt,
|
||||
updatedAt: defaultUpdateAt
|
||||
});
|
||||
|
||||
Subscriptions.attachSchema(Subscriptions.schema);
|
||||
|
||||
export default Subscriptions;
|
||||
88
imports/api/Subscriptions/methods.js
Normal file
88
imports/api/Subscriptions/methods.js
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { check, Match } from 'meteor/check';
|
||||
import Subscriptions from './Subscriptions';
|
||||
import rateLimit from '../../modules/rate-limit';
|
||||
|
||||
function geo(doc) {
|
||||
return {
|
||||
type: 'Point',
|
||||
coordinates: [doc.location.lon, doc.location.lat]
|
||||
};
|
||||
}
|
||||
|
||||
export function subscriptionsInsert(doc, userId, type) {
|
||||
check(doc, {
|
||||
_id: Match.Maybe(Meteor.Collection.ObjectID),
|
||||
location: Match.ObjectIncluding({ lat: Number, lon: Number }),
|
||||
distance: Number
|
||||
});
|
||||
const newDoc = {
|
||||
owner: userId,
|
||||
type,
|
||||
geo: geo(doc),
|
||||
...doc
|
||||
};
|
||||
// console.log(newDoc);
|
||||
const already = Subscriptions.findOne(newDoc);
|
||||
if (already) {
|
||||
throw new Meteor.Error('on-already-subscribed', 'The user is already subscribed to this area');
|
||||
}
|
||||
try {
|
||||
return Subscriptions.insert(newDoc);
|
||||
} catch (exception) {
|
||||
// console.error(exception);
|
||||
throw new Meteor.Error('500', exception);
|
||||
}
|
||||
}
|
||||
|
||||
export function subscriptionsRemove(subscriptionId) {
|
||||
check(subscriptionId, Meteor.Collection.ObjectID);
|
||||
|
||||
try {
|
||||
return Subscriptions.remove(subscriptionId);
|
||||
} catch (exception) {
|
||||
console.error(exception);
|
||||
throw new Meteor.Error('500', exception);
|
||||
}
|
||||
}
|
||||
|
||||
Meteor.methods({
|
||||
'subscriptions.insert': function subscriptionInsertMethod(doc) {
|
||||
check(doc, {
|
||||
location: Match.ObjectIncluding({ lat: Number, lon: Number }),
|
||||
distance: Number
|
||||
});
|
||||
return subscriptionsInsert(doc, this.userId, 'web');
|
||||
},
|
||||
'subscriptions.update': function subscriptionsUpdate(doc) {
|
||||
check(doc, {
|
||||
_id: Meteor.Collection.ObjectID,
|
||||
location: Match.ObjectIncluding({ lat: Number, lon: Number }),
|
||||
distance: Number
|
||||
});
|
||||
|
||||
try {
|
||||
const dup = doc;
|
||||
const subscriptionId = doc._id;
|
||||
dup.geo = geo(doc);
|
||||
Subscriptions.update(subscriptionId, { $set: dup });
|
||||
return subscriptionId; // Return _id so we can redirect to subscription after update.
|
||||
} catch (exception) {
|
||||
throw new Meteor.Error('500', exception);
|
||||
}
|
||||
},
|
||||
'subscriptions.remove': function subscriptionsRemoveMethod(subscriptionId) {
|
||||
check(subscriptionId, Meteor.Collection.ObjectID);
|
||||
return subscriptionsRemove(subscriptionId);
|
||||
}
|
||||
});
|
||||
|
||||
rateLimit({
|
||||
methods: [
|
||||
'subscriptions.insert',
|
||||
'subscriptions.update',
|
||||
'subscriptions.remove'
|
||||
],
|
||||
limit: 5,
|
||||
timeRange: 1000
|
||||
});
|
||||
18
imports/api/Subscriptions/server/publications.js
Normal file
18
imports/api/Subscriptions/server/publications.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import { check } from 'meteor/check';
|
||||
import Subscriptions from '../Subscriptions';
|
||||
|
||||
Meteor.publish('mysubscriptions', function subscriptions() {
|
||||
return Subscriptions.find({ owner: this.userId }); // type: 'web'
|
||||
});
|
||||
|
||||
// Note: subscriptions.view is also used when editing an existing subscription.
|
||||
Meteor.publish('subscriptions.view', function subscriptionsView(subscriptionId) {
|
||||
check(subscriptionId, String);
|
||||
const id = new Mongo.ObjectID(subscriptionId);
|
||||
check(id, Meteor.Collection.ObjectID);
|
||||
return Subscriptions.find({ _id: id, owner: this.userId, type: 'web' });
|
||||
});
|
||||
115
imports/api/Users/Users.js
Normal file
115
imports/api/Users/Users.js
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
/* eslint-disable consistent-return */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import { defaultCreatedAt, defaultUpdateAt } from '/imports/api/Utility/Utils.js';
|
||||
|
||||
const schemaUserProfile = new SimpleSchema({
|
||||
/* Our users has a name of type Object while Google Service, for instance, String, so blackbox in true in profile */
|
||||
/* name: { type: String, optional: true }, */
|
||||
name: { type: Object, optional: true },
|
||||
'name.first': String,
|
||||
'name.last': String
|
||||
});
|
||||
|
||||
const schemaUser = new SimpleSchema({
|
||||
username: {
|
||||
type: String,
|
||||
// i18nLabel: 'Usuario/a',
|
||||
regEx: /^[a-z0-9A-Z_]{3,15}$/,
|
||||
// For accounts-password, either emails or username is required,
|
||||
// but not both.
|
||||
// It is OK to make this optional here because the accounts-password
|
||||
// package
|
||||
// does its own validation.
|
||||
// Third-party login packages may not require either.
|
||||
// Adjust this schema as necessary for your usage.
|
||||
optional: true
|
||||
},
|
||||
emails: {
|
||||
type: Array,
|
||||
min: 1,
|
||||
// label() { return i18n.t('Lista de emails de contacto'); },
|
||||
// For accounts-password, either emails or username is required,
|
||||
// but not both.
|
||||
// It is OK to make this optional here because the accounts-password
|
||||
// package
|
||||
// does its own validation.
|
||||
// Third-party login packages may not require either.
|
||||
// Adjust this schema as necessary for your usage.
|
||||
optional: true
|
||||
},
|
||||
'emails.$': {
|
||||
label: false,
|
||||
type: Object
|
||||
},
|
||||
'emails.$.address': {
|
||||
type: String,
|
||||
label: '',
|
||||
regEx: SimpleSchema.RegEx.Email
|
||||
},
|
||||
'emails.$.verified': {
|
||||
type: Boolean,
|
||||
optional: true // if not present === notVerified
|
||||
},
|
||||
// Make sure this services field is in your schema
|
||||
// if you're using any of the accounts packages
|
||||
services: {
|
||||
type: Object,
|
||||
optional: true,
|
||||
// autoform: { type: 'hidden' },
|
||||
blackbox: true
|
||||
},
|
||||
// Add `roles` to your schema if you use the meteor-roles package.
|
||||
// Option 1: Object type
|
||||
// If you specify that type as Object, you must also specify the
|
||||
// `Roles.GLOBAL_GROUP` group whenever you add a user to a role.
|
||||
// Example:
|
||||
// Roles.addUsersToRoles(userId, ['admin'], Roles.GLOBAL_GROUP);
|
||||
// You can't mix and match adding with and without a group since
|
||||
// you will fail validation in some cases.
|
||||
// roles: {
|
||||
// type: Object,
|
||||
// optional: true,
|
||||
// autoform: { type: 'hidden' },
|
||||
// blackbox: true
|
||||
// }
|
||||
// Option 2: [String] type
|
||||
// If you are sure you will never need to use role groups, then
|
||||
// you can specify [String] as the type
|
||||
roles: { type: Array, optional: true },
|
||||
'roles.$': { type: String, optional: true },
|
||||
// https://github.com/todda00/meteor-friendly-slugs/issues/1
|
||||
friendlySlugs: {
|
||||
type: Object,
|
||||
optional: true,
|
||||
blackbox: true
|
||||
},
|
||||
slug: {
|
||||
type: String,
|
||||
optional: true
|
||||
},
|
||||
profile: {
|
||||
type: schemaUserProfile,
|
||||
optional: true,
|
||||
blackbox: true
|
||||
},
|
||||
// https://guide.meteor.com/accounts.html#custom-user-data
|
||||
|
||||
/* Our users has a name of type Object while Google Service, for instance, not */
|
||||
/* name: { type: String, optional: true }, */
|
||||
/* name: Object,
|
||||
'name.first': String,
|
||||
'name.last': String, */
|
||||
lang: { type: String, optional: true },
|
||||
telegramChatId: { type: SimpleSchema.Integer, optional: true },
|
||||
telegramUsername: { type: String, optional: true },
|
||||
telegramFirstName: { type: String, optional: true },
|
||||
telegramLanguageCode: { type: String, optional: true },
|
||||
fireBaseToken: { type: String, optional: true },
|
||||
createdAt: defaultCreatedAt,
|
||||
updatedAt: defaultUpdateAt
|
||||
});
|
||||
|
||||
Meteor.users.attachSchema(schemaUser);
|
||||
|
|
@ -1,17 +1,9 @@
|
|||
/* eslint-disable consistent-return */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Accounts } from 'meteor/accounts-base';
|
||||
|
||||
let action;
|
||||
|
||||
const updatePassword = (userId, newPassword) => {
|
||||
try {
|
||||
Accounts.setPassword(userId, newPassword, { logout: false });
|
||||
} catch (exception) {
|
||||
action.reject(`[editProfile.updatePassword] ${exception}`);
|
||||
}
|
||||
};
|
||||
|
||||
const updateUser = (userId, { emailAddress, profile }) => {
|
||||
try {
|
||||
Meteor.users.update(userId, {
|
||||
|
|
@ -28,10 +20,7 @@ const updateUser = (userId, { emailAddress, profile }) => {
|
|||
const editProfile = ({ userId, profile }, promise) => {
|
||||
try {
|
||||
action = promise;
|
||||
|
||||
updateUser(userId, profile);
|
||||
if (profile.password) updatePassword(userId, profile.password);
|
||||
|
||||
action.resolve();
|
||||
} catch (exception) {
|
||||
action.reject(`[editProfile.handler] ${exception}`);
|
||||
|
|
|
|||
|
|
@ -1,33 +1,56 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { check, Match } from 'meteor/check';
|
||||
import { Accounts } from 'meteor/accounts-base';
|
||||
import urlEnc from '/imports/modules/url-encode';
|
||||
import editProfile from './edit-profile';
|
||||
import rateLimit from '../../../modules/rate-limit';
|
||||
|
||||
const validLangCode = Match.Where((lang) => {
|
||||
check(lang, String);
|
||||
const regexp = /^[a-z]{2,3}(?:-[A-Z]{2,3}(?:-[a-zA-Z]{4})?)?$/;
|
||||
return regexp.test(lang);
|
||||
});
|
||||
|
||||
Meteor.methods({
|
||||
'users.sendVerificationEmail': function usersSendVerificationEmail() {
|
||||
return Accounts.sendVerificationEmail(this.userId);
|
||||
},
|
||||
'users.editProfile': function usersEditProfile(profile) {
|
||||
check(profile, {
|
||||
emailAddress: String,
|
||||
password: Match.Optional(Object),
|
||||
profile: {
|
||||
name: {
|
||||
first: String,
|
||||
last: String,
|
||||
},
|
||||
},
|
||||
last: String
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return editProfile({ userId: this.userId, profile })
|
||||
.then(response => response)
|
||||
.catch((exception) => {
|
||||
throw new Meteor.Error('500', exception);
|
||||
});
|
||||
.then(response => response)
|
||||
.catch((exception) => {
|
||||
throw new Meteor.Error('500', exception);
|
||||
});
|
||||
},
|
||||
'users.setLang': function userLang(lang) {
|
||||
check(lang, validLangCode);
|
||||
Meteor.users.update({ _id: this.userId }, { $set: { lang } });
|
||||
},
|
||||
'auth.getHash': async function getHash() {
|
||||
const token = Accounts._generateStampedLoginToken();
|
||||
const obj = Accounts._hashStampedToken(token);
|
||||
// console.log(obj);
|
||||
const sealed = await urlEnc.encrypt(obj);
|
||||
return sealed;
|
||||
}
|
||||
});
|
||||
|
||||
rateLimit({
|
||||
methods: [
|
||||
'users.editProfile',
|
||||
'users.sendVerificationEmail',
|
||||
'users.editProfile'
|
||||
],
|
||||
limit: 5,
|
||||
timeRange: 1000,
|
||||
timeRange: 1000
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import '../Users';
|
||||
|
||||
Meteor.publish('users.editProfile', function usersProfile() {
|
||||
return Meteor.users.find(this.userId, {
|
||||
|
|
@ -6,6 +9,16 @@ Meteor.publish('users.editProfile', function usersProfile() {
|
|||
emails: 1,
|
||||
profile: 1,
|
||||
services: 1,
|
||||
},
|
||||
lang: 1
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Meteor.publish('userData', function userData() {
|
||||
if (this.userId) {
|
||||
return Meteor.users.find({ _id: this.userId }, {
|
||||
fields: { lang: 1 }
|
||||
});
|
||||
}
|
||||
this.ready();
|
||||
});
|
||||
|
|
|
|||
30
imports/api/Users/server/send-welcome-email.js
Normal file
30
imports/api/Users/server/send-welcome-email.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import i18n from 'i18next';
|
||||
import sendEmail from '../../../modules/server/send-email';
|
||||
import getOAuthProfile from '../../../modules/get-oauth-profile';
|
||||
|
||||
export default (options, user, lang) => {
|
||||
const OAuthProfile = getOAuthProfile(options, user);
|
||||
|
||||
i18n.changeLanguage(lang);
|
||||
const applicationName = i18n.t('AppName');
|
||||
const firstName = OAuthProfile ? OAuthProfile.name.first : options.profile.name.first;
|
||||
const emailAddress = OAuthProfile ? OAuthProfile.email : options.email;
|
||||
const welcome = i18n.t('welcome');
|
||||
if (emailAddress) {
|
||||
sendEmail({
|
||||
to: emailAddress,
|
||||
from: `${applicationName} <noreply@comunes.org>`,
|
||||
subject: `[${applicationName}] ${welcome} ${firstName}!`,
|
||||
lang,
|
||||
template: 'welcome',
|
||||
templateVars: {
|
||||
applicationName,
|
||||
firstName,
|
||||
welcomeUrl: Meteor.absoluteUrl('subscriptions') // e.g., returns http://localhost:3000/documents
|
||||
}
|
||||
}).catch((error) => {
|
||||
throw new Meteor.Error('500', `${error}`);
|
||||
});
|
||||
}
|
||||
};
|
||||
34
imports/api/Utility/LocationSchema.js
Normal file
34
imports/api/Utility/LocationSchema.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import SimpleSchema from 'simpl-schema';
|
||||
|
||||
// https://stackoverflow.com/questions/24492333/meteor-simple-schema-for-mongo-geo-location-data
|
||||
// https://github.com/aldeed/meteor-simple-schema/issues/606
|
||||
const LocationSchema = new SimpleSchema({
|
||||
type: {
|
||||
type: String,
|
||||
allowedValues: ['Point']
|
||||
},
|
||||
coordinates: {
|
||||
type: Array,
|
||||
minCount: 2,
|
||||
maxCount: 2,
|
||||
custom: function custom() {
|
||||
if (!(this.value[0] >= -180 && this.value[0] <= 180)) {
|
||||
return 'lngOutOfRange';
|
||||
}
|
||||
if (!(this.value[1] >= -90 && this.value[1] <= 90)) {
|
||||
return 'latOutOfRange';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
'coordinates.$': {
|
||||
type: Number
|
||||
}
|
||||
});
|
||||
|
||||
LocationSchema.messageBox.messages({
|
||||
latOutOfRange: '[label] latitude should be between -90 and 90',
|
||||
lngOutOfRange: '[label] longitude should be between -180 and 180'
|
||||
});
|
||||
|
||||
export default LocationSchema;
|
||||
29
imports/api/Utility/Utils.js
Normal file
29
imports/api/Utility/Utils.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* eslint-disable consistent-return */
|
||||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
export const defaultCreatedAt = {
|
||||
type: Date,
|
||||
// autoform: { type: 'hidden' },
|
||||
// Prefer normal function: https://github.com/aldeed/meteor-simple-schema/issues/562
|
||||
autoValue: function autovalue() {
|
||||
if (this.isInsert) {
|
||||
return new Date();
|
||||
}
|
||||
// Prevent user from supplying their own value
|
||||
this.unset();
|
||||
},
|
||||
optional: true // TODO: Use migration for users
|
||||
};
|
||||
|
||||
export const defaultUpdateAt = {
|
||||
type: Date,
|
||||
// autoform: { type: 'hidden' },
|
||||
autoValue: function autovalue() {
|
||||
if (this.isUpdate || this.isInsert) {
|
||||
return new Date();
|
||||
}
|
||||
},
|
||||
// Commented because we want to have updateAt = createAt initialy
|
||||
// denyInsert: true,
|
||||
optional: true
|
||||
};
|
||||
21
imports/api/Utility/server/files.js
Normal file
21
imports/api/Utility/server/files.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import fs from 'fs';
|
||||
import getFallbackLang from '/imports/modules/lang-fallback';
|
||||
|
||||
const as = f => `assets/app/${f}`;
|
||||
|
||||
export const getFileNameOfLang = (dir, fileName, ext, lang) => {
|
||||
const base = `${dir}/${fileName}`;
|
||||
const fallback = getFallbackLang(lang);
|
||||
let file = `${base}-${lang}.${ext}`;
|
||||
if (!fs.existsSync(as(file))) {
|
||||
// console.log(`Page '${fileName}' not found for '${lang}' lang`);
|
||||
file = `${base}-${fallback}.${ext}`;
|
||||
if (!fs.existsSync(as(file))) {
|
||||
// console.log(`Page '${fileName}' not found for '${fallback}' lang`);
|
||||
file = `${base}.${ext}`;
|
||||
}
|
||||
}
|
||||
return file;
|
||||
};
|
||||
|
|
@ -1,11 +1,21 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import i18n from 'i18next';
|
||||
import { getFileNameOfLang } from '/imports/api/Utility/server/files.js';
|
||||
import getPrivateFile from '../../../modules/server/get-private-file';
|
||||
import parseMarkdown from '../../../modules/parse-markdown';
|
||||
|
||||
Meteor.methods({
|
||||
'utility.getPage': function utilityGetPage(fileName) {
|
||||
'utility.getPage': function utilityGetPage(fileName, lang) {
|
||||
check(fileName, String);
|
||||
return parseMarkdown(getPrivateFile(`pages/${fileName}.md`));
|
||||
check(lang, String);
|
||||
return parseMarkdown(getPrivateFile(getFileNameOfLang('pages', fileName, 'md', lang)));
|
||||
},
|
||||
'utility.saveMissingI18n': function saveMissing(key, value) {
|
||||
check(key, String);
|
||||
check(value, String);
|
||||
if (!Meteor.isProduction) {
|
||||
i18n.t(key, value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
19
imports/modules/get-email-of-user.js
Normal file
19
imports/modules/get-email-of-user.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import getOAuthProfile from '/imports/modules/get-oauth-profile';
|
||||
|
||||
const getEmailOf = (user) => {
|
||||
const hasPassword = user.services && user.services.password && user.services.password.bcrypt;
|
||||
|
||||
// console.log(`Has password: ${hasPassword}`);
|
||||
const OAuthProfile = getOAuthProfile({
|
||||
password: hasPassword,
|
||||
profile: user.profile
|
||||
}, user);
|
||||
const firstName = OAuthProfile ? OAuthProfile.name.first : user.profile.name.first;
|
||||
const emailAddress = OAuthProfile ? OAuthProfile.email :
|
||||
user && user.emails[0] && user.emails[0].verified ? user.emails[0].address : null;
|
||||
return { emailAddress, firstName };
|
||||
};
|
||||
|
||||
export default getEmailOf;
|
||||
39
imports/modules/get-oauth-profile.js
Normal file
39
imports/modules/get-oauth-profile.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
const parseGoogleData = service => ({
|
||||
email: service.email,
|
||||
name: {
|
||||
first: service.given_name,
|
||||
last: service.family_name
|
||||
},
|
||||
lang: service.locale
|
||||
});
|
||||
|
||||
const parseGithubData = (profile, service) => {
|
||||
const name = profile.name.split(' ');
|
||||
return {
|
||||
email: service.email,
|
||||
name: {
|
||||
first: name[0],
|
||||
last: name[1]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const parseFacebookData = service => ({
|
||||
email: service.email,
|
||||
name: {
|
||||
first: service.first_name,
|
||||
last: service.last_name
|
||||
}
|
||||
});
|
||||
|
||||
const getDataForService = (profile, services) => {
|
||||
if (services.facebook) return parseFacebookData(services.facebook);
|
||||
if (services.github) return parseGithubData(profile, services.github);
|
||||
if (services.google) return parseGoogleData(services.google);
|
||||
};
|
||||
|
||||
export default (options, user) => {
|
||||
const isOAuth = !options.password;
|
||||
const serviceData = isOAuth ? getDataForService(options.profile, user.services) : null;
|
||||
return isOAuth ? serviceData : null;
|
||||
};
|
||||
9
imports/modules/lang-fallback.js
Normal file
9
imports/modules/lang-fallback.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const getFallbackLang = (lang) => {
|
||||
if (lang && (lang === 'ast' || lang === 'gl' || lang === 'eu' ||
|
||||
lang === 'es' || lang === 'ca' || lang.match(/^es-/))) {
|
||||
return 'es';
|
||||
}
|
||||
return 'en';
|
||||
};
|
||||
|
||||
export default getFallbackLang;
|
||||
|
|
@ -1,18 +1,11 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
|
||||
import { _ } from 'meteor/underscore';
|
||||
|
||||
const fetchMethodNames = methods => _.pluck(methods, 'name');
|
||||
|
||||
const assignLimits = ({ methods, limit, timeRange }) => {
|
||||
const methodNames = fetchMethodNames(methods);
|
||||
|
||||
export default ({ methods, limit, timeRange }) => {
|
||||
if (Meteor.isServer) {
|
||||
DDPRateLimiter.addRule({
|
||||
name(name) { return _.contains(methodNames, name); },
|
||||
name(name) { return methods.indexOf(name) > -1; },
|
||||
connectionId() { return true; },
|
||||
}, limit, timeRange);
|
||||
}
|
||||
};
|
||||
|
||||
export default function rateLimit(options) { return assignLimits(options); }
|
||||
|
|
|
|||
11
imports/modules/server/handlebars-email-to-html.js
Normal file
11
imports/modules/server/handlebars-email-to-html.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import handlebars from 'handlebars';
|
||||
import juice from 'juice';
|
||||
|
||||
export default (handlebarsMarkup, context, options) => {
|
||||
if (handlebarsMarkup && context) {
|
||||
const template = handlebars.compile(handlebarsMarkup);
|
||||
return options && !options.inlineCss ? template(context) : juice(template(context)); // Use juice to inline CSS <style></style> styles from <head> unless disabled.
|
||||
}
|
||||
|
||||
throw new Error('Please pass Handlebars markup to compile and a context object with data mapping to the Handlebars expressions used in your template.');
|
||||
};
|
||||
10
imports/modules/server/handlebars-email-to-text.js
Normal file
10
imports/modules/server/handlebars-email-to-text.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import handlebars from 'handlebars';
|
||||
|
||||
export default (handlebarsMarkup, context) => {
|
||||
if (handlebarsMarkup && context) {
|
||||
const template = handlebars.compile(handlebarsMarkup);
|
||||
return template(context);
|
||||
}
|
||||
|
||||
throw new Error('Please pass Handlebars markup to compile and a context object with data mapping to the Handlebars expressions used in your template.');
|
||||
};
|
||||
153
imports/modules/server/notificationsProcess.js
Normal file
153
imports/modules/server/notificationsProcess.js
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import Notifications from '/imports/api/Notifications/Notifications';
|
||||
import i18n from 'i18next';
|
||||
import moment from 'moment';
|
||||
import { dateLongFormat } from '/imports/api/Common/dates';
|
||||
// import sendMail from '/imports/startup/server/email';
|
||||
import sendEmail, { subjectTruncate } from '/imports/modules/server/send-email';
|
||||
import { isMailServerMaster } from '/imports/startup/server/email';
|
||||
// import { hr } from '/imports/startup/server/email';
|
||||
import getEmailOf from '/imports/modules/get-email-of-user';
|
||||
import image from 'google-maps-image-api-url';
|
||||
import gcm from 'node-gcm';
|
||||
import { trim } from '/imports/ui/components/NotificationsObserver/util.js';
|
||||
import ravenLogger from '/imports/startup/server/ravenLogger';
|
||||
|
||||
let validFcmSender = true;
|
||||
|
||||
if (!(Meteor.settings.private.fcmApiToken && Meteor.settings.private.fcmApiToken.length > 0)) {
|
||||
console.warn('Missing settings.private.fcmApiToken key, mobile notifications will not work');
|
||||
validFcmSender = false;
|
||||
}
|
||||
|
||||
// https://www.npmjs.com/package/google-maps-image-api-url
|
||||
// https://stackoverflow.com/questions/24355007/is-there-no-way-to-embed-a-google-map-into-an-html-email
|
||||
// https://developers.google.com/maps/documentation/static-maps/intro
|
||||
function imgUrl(lat, lng) {
|
||||
return image({
|
||||
key: Meteor.settings.gmaps.key,
|
||||
type: 'staticmap',
|
||||
center: `${lat},${lng}`,
|
||||
size: '640x480',
|
||||
zoom: 16,
|
||||
maptype: 'hybrid',
|
||||
language: 'es',
|
||||
markers: `icon: ${Meteor.settings.private.fireIconUrl}|${lat},${lng}`
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
function imgEl(lat, lng) {
|
||||
return `<img src="${imgUrl(lat, lng)}" width="640" height="480"/>`;
|
||||
} */
|
||||
|
||||
// Cutover flag (fase 1a): channels listed in
|
||||
// Meteor.settings.private.notifDisabledChannels (e.g. ['mobile','web']) are
|
||||
// handled by the tcef-notifications microservice, so the old observer/cron must
|
||||
// NOT send them. Mutual exclusion per channel — reversible by editing settings,
|
||||
// no code deploy needed. ES5-compatible on purpose (Meteor 1.6 / Node 8).
|
||||
const notifDisabledChannels = (Meteor.settings.private && Meteor.settings.private.notifDisabledChannels) || [];
|
||||
|
||||
const processNotif = (notif) => {
|
||||
if (notifDisabledChannels.indexOf(notif.type) !== -1) {
|
||||
// This channel was migrated to tcef-notifications; do nothing here.
|
||||
return;
|
||||
}
|
||||
if (isMailServerMaster && validFcmSender && notif.type === 'mobile' && notif.notified !== true) {
|
||||
const fcmSender = new gcm.Sender(Meteor.settings.private.fcmApiToken);
|
||||
const user = Meteor.users.findOne({ _id: notif.userId });
|
||||
moment.locale(user.lang);
|
||||
// duplicate code below
|
||||
const body = `${trim(notif.content)}`;
|
||||
|
||||
// https://firebase.google.com/docs/cloud-messaging/concept-options
|
||||
const msg = new gcm.Message();
|
||||
|
||||
msg.addNotification({
|
||||
title: i18n.t('Alerta de fuego'),
|
||||
body,
|
||||
click_action: 'FLUTTER_NOTIFICATION_CLICK',
|
||||
tag: notif._id, // prevent duplication of fire notifications
|
||||
sound: 'default', // Indicates sound to be played. Supports only default currently.
|
||||
icon: 'launch_image' // 'ic_launcher'
|
||||
});
|
||||
|
||||
msg.addData('id', notif._id._str);
|
||||
msg.addData('description', body);
|
||||
msg.addData('lat', notif.geo.coordinates[1]);
|
||||
msg.addData('lon', notif.geo.coordinates[0]);
|
||||
msg.addData('when', notif.when);
|
||||
msg.addData('subsId', notif.subsId._str);
|
||||
msg.addData('sealed', notif.sealed);
|
||||
|
||||
const registrationTokens = [];
|
||||
if (!user.fireBaseToken) {
|
||||
console.warn('This mobile user doesn\'t have a firebase registration token');
|
||||
} else {
|
||||
registrationTokens.push(user.fireBaseToken);
|
||||
// FIXME: better join users
|
||||
if (validFcmSender) {
|
||||
fcmSender.send(msg, { registrationTokens }, Meteor.bindEnvironment(function processResult(err, response) {
|
||||
if (err) {
|
||||
console.error(`FCM error: ${err}`);
|
||||
// FIXME send to sentry
|
||||
ravenLogger.log(err);
|
||||
} else {
|
||||
// console.log(`FCM response: ${response}`);
|
||||
Notifications.update(notif._id, { $set: { notified: true, notifiedAt: new Date() } });
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isMailServerMaster && notif.type === 'web' && notif.emailNotified !== true) {
|
||||
const user = Meteor.users.findOne({ _id: notif.userId });
|
||||
const { firstName, emailAddress } = getEmailOf(user);
|
||||
|
||||
if (emailAddress) {
|
||||
const img = imgUrl(notif.geo.coordinates[1], notif.geo.coordinates[0]);
|
||||
// const url = imgUrl(notif.geo.coordinates[1], notif.geo.coordinates[0]);
|
||||
const fireUrl = `${Meteor.absoluteUrl('fire/')}${notif.sealed}`;
|
||||
// const fireHtmlUrl = `<a href="${fireUrl}">${i18n.t('Más información sobre este fuego')}</a>`;
|
||||
// TODO get _id of fire
|
||||
// const fireTextUrl = `${i18n.t('Más información sobre este fuego')}:\n${fireUrl}`;
|
||||
// FIXME use our map as url and static map as img
|
||||
moment.locale(user.lang);
|
||||
// moment user tz ?
|
||||
const message = `${trim(notif.content)} (${i18n.t('fireDetectedAt', { when: dateLongFormat(notif.when) })}).`;
|
||||
|
||||
// TODO Comunes Address
|
||||
|
||||
const emailOpts = {
|
||||
to: emailAddress,
|
||||
// userName: firstName,
|
||||
// sendAt: new Date(),
|
||||
subject: subjectTruncate.apply(message),
|
||||
// text: `${message}\n\n${fireTextUrl}\n\n`,
|
||||
// template: '<body><h2>{{appName}}</h2>{{{html}}}</body>',
|
||||
lang: user.lang,
|
||||
template: 'new-fire',
|
||||
templateVars: {
|
||||
applicationName: i18n.t('AppName'),
|
||||
firstName,
|
||||
message,
|
||||
fireUrl,
|
||||
img,
|
||||
subsUrl: Meteor.absoluteUrl('subscriptions')
|
||||
}
|
||||
};
|
||||
sendEmail(emailOpts).catch((error) => {
|
||||
throw new Meteor.Error('500', `${error}`);
|
||||
});
|
||||
// sendMail(emailOpts, true);
|
||||
Notifications.update(notif._id, { $set: { emailNotified: true, emailNotifiedAt: new Date() } });
|
||||
} else {
|
||||
// Not email or not verified -> remove notif so we don't retry to send it
|
||||
Notifications.remove({ _id: notif._id });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default processNotif;
|
||||
25
imports/modules/server/other-checks.js
Normal file
25
imports/modules/server/other-checks.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { check, Match } from 'meteor/check';
|
||||
|
||||
export const validZoom = Match.Where((zoom) => {
|
||||
// http://wiki.openstreetmap.org/wiki/Zoom_levels
|
||||
check(zoom, Number);
|
||||
return zoom >= 0 && zoom <= 19;
|
||||
});
|
||||
|
||||
// https://github.com/3stack-software/meteor-match-library
|
||||
export function NumberBetween(min, max) {
|
||||
return Match.Where((x) => {
|
||||
check(x, Number);
|
||||
return min <= x && x <= max;
|
||||
});
|
||||
}
|
||||
|
||||
export function NullOr(type) {
|
||||
return Match.Where((x) => {
|
||||
if (x === null) {
|
||||
return true;
|
||||
}
|
||||
check(x, type);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
56
imports/modules/server/send-email.js
Normal file
56
imports/modules/server/send-email.js
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import i18n from 'i18next';
|
||||
import { getFileNameOfLang } from '/imports/api/Utility/server/files.js';
|
||||
import sendMail from '/imports/startup/server/email';
|
||||
import getPrivateFile from './get-private-file';
|
||||
import templateToText from './handlebars-email-to-text';
|
||||
import templateToHTML from './handlebars-email-to-html';
|
||||
|
||||
export function subjectTruncate(n = 70, useWordBoundary = true) {
|
||||
// https://stackoverflow.com/questions/1199352/smart-way-to-shorten-long-strings-with-javascript
|
||||
if (this.length <= n) {
|
||||
return `${this}`;
|
||||
}
|
||||
const subString = this.substr(0, n - 1);
|
||||
return `${useWordBoundary ? subString.substr(0, subString.lastIndexOf(' ')) : subString}...`;
|
||||
}
|
||||
|
||||
const sendEmail = (options, { resolve, reject }) => {
|
||||
try {
|
||||
Meteor.defer(() => {
|
||||
// console.log(`Current user lang ${options.lang}`);
|
||||
i18n.changeLanguage(options.lang);
|
||||
// Meteor email options:
|
||||
// basic: from, to/cc/bcc/replyTo, subject, html, text,
|
||||
// others: watchHtml, icalEvent, headers, attachments, mailComposer, inReplyTo, references, messageId
|
||||
const opts = options;
|
||||
// opts.template = '<body><h2>{{appName}}</h2>{{{html}}}</body>';
|
||||
opts.template = '<body>{{{html}}}</body>';
|
||||
opts.appName = i18n.t('AppName');
|
||||
// console.log(`Email options: ${JSON.stringify(opts)}`);
|
||||
sendMail(opts, true);
|
||||
// Email.send(options);
|
||||
resolve();
|
||||
});
|
||||
} catch (exception) {
|
||||
reject(exception);
|
||||
}
|
||||
};
|
||||
|
||||
export default ({
|
||||
text, html, lang, template, templateVars, ...rest
|
||||
}) => {
|
||||
if (text || html || template) {
|
||||
return new Promise((resolve, reject) => {
|
||||
sendEmail({
|
||||
lang,
|
||||
...rest,
|
||||
text: template ? templateToText(getPrivateFile(getFileNameOfLang('email-templates', template, 'txt', lang)), (templateVars || {})) : text,
|
||||
html: template ? templateToHTML(getPrivateFile(getFileNameOfLang('email-templates', template, 'html', lang)), (templateVars || {})) : html
|
||||
}, { resolve, reject });
|
||||
});
|
||||
}
|
||||
throw new Error('Please pass an HTML string, text, or template name to compile for your message\'s body.');
|
||||
};
|
||||
27
imports/modules/server/twitter.js
Normal file
27
imports/modules/server/twitter.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import Twit from 'twit';
|
||||
|
||||
// https://www.npmjs.com/package/twit
|
||||
const confTwitter = (lang) => {
|
||||
const tConf = Meteor.settings.private.twitter[lang];
|
||||
|
||||
const T = new Twit({
|
||||
consumer_key: tConf.consumer_key,
|
||||
consumer_secret: tConf.consumer_secret,
|
||||
access_token: tConf.access_token,
|
||||
access_token_secret: tConf.access_token_secret
|
||||
// timeout_ms: 60*1000, // optional HTTP request timeout to apply to all requests.
|
||||
});
|
||||
|
||||
return T;
|
||||
};
|
||||
|
||||
const tweet = (message, lang) => {
|
||||
const T = confTwitter(lang);
|
||||
T.post('statuses/update', { status: message }, (err, data, response) => {
|
||||
// console.log(data);
|
||||
// console.log(response);
|
||||
});
|
||||
};
|
||||
|
||||
export default tweet;
|
||||
6
imports/modules/url-encode.js
Normal file
6
imports/modules/url-encode.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import Iron from 'iron';
|
||||
|
||||
exports.encrypt = obj => Iron.seal(obj, Meteor.settings.private.ironPassword, Iron.defaults);
|
||||
|
||||
exports.decrypt = obj => Iron.unseal(obj, Meteor.settings.private.ironPassword, Iron.defaults);
|
||||
50
imports/startup/client/Gkeys.js
Normal file
50
imports/startup/client/Gkeys.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { Tracker } from 'meteor/tracker';
|
||||
import GoogleMapsLoader from 'google-maps';
|
||||
|
||||
class GkeysC {
|
||||
constructor() {
|
||||
this.gmapkey = new ReactiveVar(null);
|
||||
const self = this;
|
||||
this.callbacks = [];
|
||||
Meteor.startup(() => {
|
||||
Meteor.call('getMapKey', (error, key) => {
|
||||
// console.log(google.maps);
|
||||
GoogleMapsLoader.KEY = key;
|
||||
GoogleMapsLoader.LIBRARIES = ['places'];
|
||||
GoogleMapsLoader.load(() => {
|
||||
self.gmapkey.set(key);
|
||||
console.log('GMaps script just loaded');
|
||||
self.doCallbacks(key);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
doCallbacks(key) {
|
||||
for (let i = 0; i < this.callbacks.length; i += 1) {
|
||||
this.callbacks[i](null, key);
|
||||
}
|
||||
this.callbacks = [];
|
||||
}
|
||||
|
||||
load(callback) {
|
||||
this.callbacks.push(callback);
|
||||
Tracker.autorun((computation) => {
|
||||
const key = this.gmapkey.get();
|
||||
if (key) {
|
||||
// already loaded
|
||||
// console.log('GMaps already loaded');
|
||||
this.doCallbacks(key);
|
||||
computation.stop();
|
||||
} else {
|
||||
console.log('Waiting for the gkey');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const Gkeys = new GkeysC();
|
||||
|
||||
export default Gkeys;
|
||||
42
imports/startup/client/comments.js
Normal file
42
imports/startup/client/comments.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* global Comments */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import i18n from '/imports/startup/client/i18n';
|
||||
import '/imports/startup/common/comments';
|
||||
|
||||
import './comments.scss';
|
||||
|
||||
i18n.init((err, t) => {
|
||||
Comments.ui.setContent({
|
||||
title: ' ', // i18n.t('Comentarios'),
|
||||
save: t('Guardar'),
|
||||
reply: t('Responder'),
|
||||
edit: t('Editar'),
|
||||
remove: t('Borrar'),
|
||||
'placeholder-textarea': t('Añadir un comentario'),
|
||||
'add-button-reply': t('Añadir una respuesta'),
|
||||
'add-button': t('Añadir comentario'),
|
||||
'you-need-to-login': t('Necesitas iniciar sesión para'),
|
||||
'add comments': t('añadir comentarios'),
|
||||
'like comments': t('puntuar comentarios'),
|
||||
'rate comments': t('puntuar comentarios'),
|
||||
'add replies': t('responder'),
|
||||
'load-more': t('Más comentarios')
|
||||
});
|
||||
|
||||
/* This in client side */
|
||||
Comments.ui.config({
|
||||
limit: 20, // default 10
|
||||
loadMoreCount: 20, // default 20
|
||||
/* generateAvatar: function genAvatar(user, isAnonymous) {
|
||||
if (isAnonymous) {
|
||||
return i18n.t('Anónimo');
|
||||
}
|
||||
return user.profile && user.profile.name && user.profile.name.first ? user.profile.name.first : null;
|
||||
}, */
|
||||
template: 'bootstrap', // default 'semantic-ui'
|
||||
// default 'http://s3.amazonaws.com/37assets/svn/765-default-avatar.png'
|
||||
defaultAvatar: '/default-avatar.png',
|
||||
markdown: true
|
||||
});
|
||||
});
|
||||
29
imports/startup/client/comments.scss
Normal file
29
imports/startup/client/comments.scss
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
.comments-section {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.comments-box {
|
||||
max-width: inherit;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
p.comment-content {
|
||||
/* white-space: pre-line; */
|
||||
}
|
||||
|
||||
/* remove comment btn danger style */
|
||||
|
||||
div.media-body.comment> div> div> div.btn.btn-danger.remove-action {
|
||||
background-color: white;
|
||||
border: 1px solid rgb(204, 204, 204);
|
||||
color: rgb(51, 51, 51);
|
||||
}
|
||||
|
||||
/* text-area height */
|
||||
.form-control .create-comment {
|
||||
height: 9em;
|
||||
}
|
||||
|
||||
.img-avatar {
|
||||
margin-right: 5px;
|
||||
}
|
||||
20
imports/startup/client/geolocation.js
Normal file
20
imports/startup/client/geolocation.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
|
||||
const geolocation = new ReactiveVar();
|
||||
|
||||
Meteor.startup(() => {
|
||||
Meteor.call('geo', (error, response) => {
|
||||
if (error) {
|
||||
console.warn(error);
|
||||
} else {
|
||||
const pos = [
|
||||
response.location.latitude,
|
||||
response.location.longitude
|
||||
];
|
||||
geolocation.set(pos);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
export default geolocation;
|
||||
137
imports/startup/client/i18n.js
Normal file
137
imports/startup/client/i18n.js
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
/* global CookieConsent Intl */
|
||||
import i18n from 'i18next';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Tracker } from 'meteor/tracker';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import backend from 'i18next-xhr-backend';
|
||||
import LngDetector from 'i18next-browser-languagedetector';
|
||||
import Cache from 'i18next-localstorage-cache';
|
||||
import { T9n } from 'meteor-accounts-t9n';
|
||||
import moment from 'moment';
|
||||
import 'moment/locale/es';
|
||||
import 'moment/locale/pt';
|
||||
import 'moment/locale/gl';
|
||||
import i18nOpts from '../common/i18n';
|
||||
|
||||
// Adapted from: https://github.com/appigram/ryfma-boilerplate/blob/44c1eabfb9928b5623afab36a23997969e5beb02/imports/startup/client/i18n.js
|
||||
|
||||
const detectorOptions = {
|
||||
// order and from where user language should be detected
|
||||
order: ['querystring', 'navigator', 'cookie', 'localStorage', 'htmlTag'],
|
||||
|
||||
// keys or params to lookup language from
|
||||
lookupQuerystring: 'lng',
|
||||
lookupCookie: 'i18next',
|
||||
lookupLocalStorage: 'i18nextLng',
|
||||
|
||||
// cache user language on
|
||||
caches: ['localStorage', 'cookie'],
|
||||
excludeCacheFor: ['cimode'] // languages to not persist (cookie, localStorage)
|
||||
};
|
||||
|
||||
export const i18nReady = new ReactiveVar(false);
|
||||
|
||||
const cacheOptions = {
|
||||
// turn on or off
|
||||
enabled: false,
|
||||
// prefix for stored languages
|
||||
prefix: 'i18next_res_',
|
||||
// expiration
|
||||
expirationTime: 7 * 24 * 60 * 60 * 1000,
|
||||
// language versions
|
||||
versions: {}
|
||||
};
|
||||
|
||||
i18nOpts.cache = cacheOptions;
|
||||
i18nOpts.detection = detectorOptions;
|
||||
i18nOpts.react = {
|
||||
wait: true,
|
||||
defaultTransParent: 'span'
|
||||
// https://react.i18next.com/components/i18next-instance.ht
|
||||
/* bindI18n: 'languageChanged loaded',
|
||||
bindStore: 'added removed',
|
||||
nsMode: 'default' */
|
||||
};
|
||||
|
||||
const sendMissing = true; // Meteor.isDevelopment;
|
||||
if (sendMissing && Meteor.isDevelopment) {
|
||||
i18nOpts.sendMissing = true;
|
||||
i18nOpts.missingKeyHandler = function miss(lng, ns, key, defaultValue) {
|
||||
Meteor.call('utility.saveMissingI18n', key, defaultValue);
|
||||
};
|
||||
}
|
||||
|
||||
function setT9(lang) {
|
||||
if (lang === 'gl') {
|
||||
T9n.setLanguage('es');
|
||||
} else {
|
||||
T9n.setLanguage(lang);
|
||||
}
|
||||
}
|
||||
|
||||
i18n.use(backend)
|
||||
.use(LngDetector)
|
||||
.use(Cache)
|
||||
.init(i18nOpts, (err, t) => {
|
||||
// initialized and ready to
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
console.log(`Language initialized: ${i18n.language}`);
|
||||
|
||||
// document.title = t('AppName');
|
||||
// Accounts translation
|
||||
// https://github.com/softwarerero/meteor-accounts-t9n
|
||||
setT9(i18n.language);
|
||||
// console.log(T9n.get('error.accounts.User not found'));
|
||||
moment.locale(i18n.language);
|
||||
|
||||
i18nReady.set(true);
|
||||
|
||||
// cookies eu consent
|
||||
const cookiesOpt = {
|
||||
cookieTitle: t('Uso de Cookies'),
|
||||
cookieMessage: t('Utilizamos cookies para asegurar un mejor uso de nuestra web. Si continúas navegando, consideramos que aceptas su uso'),
|
||||
/* cookieMessage: t('Uso de Cookies'),
|
||||
cookieMessageImply: t('Utilizamos cookies para asegurar un mejor uso de nuestra web. Si continúas navegando, consideramos que aceptas su uso'), */
|
||||
showLink: false,
|
||||
position: 'bottom',
|
||||
linkText: 'Lee más',
|
||||
linkRouteName: '/privacy',
|
||||
acceptButtonText: t('Aceptar'),
|
||||
html: false,
|
||||
expirationInDays: 70,
|
||||
forceShow: false
|
||||
};
|
||||
|
||||
CookieConsent.init(cookiesOpt);
|
||||
});
|
||||
|
||||
Meteor.subscribe('userData'); // lang is there
|
||||
|
||||
i18n.on('languageChanged', (lng) => {
|
||||
moment.locale(lng);
|
||||
// TODO fix this when gl is translated
|
||||
setT9(lng);
|
||||
Tracker.autorun((computation) => {
|
||||
if (Meteor.userId()) {
|
||||
// logged
|
||||
if (Meteor.user() && (typeof Meteor.user().lang === 'undefined' ||
|
||||
Meteor.user().lang !== lng)
|
||||
) {
|
||||
// Set the autodetected/changed lang
|
||||
console.log(`Setting the autodetected lang ${lng}, from previous ${Meteor.user().lang}`);
|
||||
// console.log(Meteor.user());
|
||||
Meteor.call('users.setLang', lng, (error) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
computation.stop(); // not need it again til new lang change
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
|
|
@ -1,8 +1,19 @@
|
|||
/* global */
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import '/imports/startup/client/modernizr';
|
||||
import App from '../../ui/layouts/App/App';
|
||||
|
||||
import '../../ui/stylesheets/app.scss';
|
||||
|
||||
Meteor.startup(() => render(<App />, document.getElementById('react-root')));
|
||||
// https://stackoverflow.com/questions/19562207/jquery-detect-browser-ie9-and-below-and-throw-up-a-modal-to-upgrade
|
||||
const isIE9OrBelow = () => /MSIE\s/.test(navigator.userAgent) && parseFloat(navigator.appVersion.split('MSIE')[1]) < 10;
|
||||
|
||||
if (isIE9OrBelow()) window.alert('You are using an outdated browser. Please use Chrome or Firefox to display this site.');
|
||||
else {
|
||||
Modernizr.on('webp', (result) => {
|
||||
if (Meteor.isDevelopment) console.log(`webp ${result ? '' : 'not '}supported`);
|
||||
});
|
||||
Meteor.startup(() => render(<App />, document.getElementById('react-root')));
|
||||
}
|
||||
|
|
|
|||
4
imports/startup/client/meta.js
Normal file
4
imports/startup/client/meta.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
/* eslint-env jquery */
|
||||
|
||||
// remove static description so it's not duplicated
|
||||
$('meta[name=description]').remove();
|
||||
3
imports/startup/client/modernizr.js
Normal file
3
imports/startup/client/modernizr.js
Normal file
File diff suppressed because one or more lines are too long
7
imports/startup/client/piwik-start.js
Normal file
7
imports/startup/client/piwik-start.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { Tracker } from 'meteor/tracker';
|
||||
|
||||
Meteor.startup(() => Tracker.autorun(() => {
|
||||
const userId = Meteor.userId();
|
||||
Meteor.Piwik.setUserInfo(userId);
|
||||
}));
|
||||
16
imports/startup/client/ravenLogger.js
Normal file
16
imports/startup/client/ravenLogger.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import RavenLogger from 'meteor/flowkey:raven';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
const ravenOptions = {};
|
||||
const publicDSN = Meteor.settings.public.sentryPublicDSN;
|
||||
const enabled = !!publicDSN;
|
||||
|
||||
const ravenLogger = enabled ? new RavenLogger({
|
||||
publicDSN, // will be used on the client
|
||||
shouldCatchConsoleError: true, // default
|
||||
trackUser: true // default
|
||||
}, ravenOptions) : { log: (error) => { console.log(error); } };
|
||||
|
||||
console.log(`ravenLogger ${enabled ? 'enabled' : 'disabled'}`);
|
||||
|
||||
export default ravenLogger;
|
||||
8
imports/startup/client/reconnect.js
Normal file
8
imports/startup/client/reconnect.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/* global reconnecToServer */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
Meteor.startup(() => {
|
||||
// Reconnect Function
|
||||
reconnectToServer(5000, true);
|
||||
});
|
||||
21
imports/startup/common/comments.js
Normal file
21
imports/startup/common/comments.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* global Comments */
|
||||
|
||||
// Client and Server
|
||||
Comments.config({
|
||||
rating: 'likes-and-dislikes',
|
||||
allowAnonymous: () => false,
|
||||
allowReplies: () => false, // disabled right now: I don't know hot to get referenceId of replies
|
||||
anonymousSalt: 'klasddl3lala0l3lasdlas0ol3lasdlao3lasdoaslaldal3lasdclasdlal3lasdladlaq',
|
||||
publishUserFields: {
|
||||
profile: 1
|
||||
},
|
||||
mediaAnalyzers: [
|
||||
Comments.analyzers.image,
|
||||
Comments.analyzers.youtube
|
||||
],
|
||||
generateUsername: function genUser(user) {
|
||||
// console.log(JSON.stringify(user));
|
||||
// FIXME
|
||||
return user.profile && user.profile.name && user.profile.name.first ? user.profile.name.first : '';
|
||||
}
|
||||
});
|
||||
55
imports/startup/common/i18n.js
Normal file
55
imports/startup/common/i18n.js
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import moment from 'moment';
|
||||
// Load the js langs
|
||||
import es from 'meteor-accounts-t9n/build/es';
|
||||
import en from 'meteor-accounts-t9n/build/en';
|
||||
// TODO ask for translation of this
|
||||
// import gl from 'meteor-accounts-t9n/build/gl';
|
||||
|
||||
const backOpts = {
|
||||
// path where resources get loaded from
|
||||
loadPath: '/locales/{{lng}}/{{ns}}.json',
|
||||
|
||||
// path to post missing resources
|
||||
addPath: '/locales/{{lng}}/{{ns}}.missing.json',
|
||||
|
||||
// jsonIndent to use when storing json files
|
||||
jsonIndent: 2
|
||||
};
|
||||
|
||||
const forceDebug = true;
|
||||
const shouldDebug = (forceDebug && !Meteor.isProduction);
|
||||
|
||||
const i18nOpts = {
|
||||
backend: backOpts,
|
||||
// lng: 'es',
|
||||
fallbackLng: {
|
||||
gl: ['es'],
|
||||
default: ['en']
|
||||
},
|
||||
sendMissingTo: 'fallback',
|
||||
interpolation: {
|
||||
escapeValue: false, // not needed for react!!
|
||||
formatSeparator: ',',
|
||||
format: function f(value, format, lng) {
|
||||
// https://www.i18next.com/formatting.html
|
||||
// console.log(`Value: ${value} with format: ${format} to lang: ${lng}`);
|
||||
if (format === 'uppercase') return value.toUpperCase();
|
||||
if (value instanceof Date) return moment(value).format(format);
|
||||
if (format === 'number') return Intl.NumberFormat(lng).format(value);
|
||||
return value;
|
||||
}
|
||||
},
|
||||
whitelist: ['es', 'en', 'gl'], // allowed languages
|
||||
load: 'languageOnly', // 'es' o 'en', previously: 'all', // es-ES -> es, en-US -> en
|
||||
debug: shouldDebug,
|
||||
ns: 'common',
|
||||
defaultNS: 'common',
|
||||
saveMissing: shouldDebug, // if true seems it's fails to getResourceBundle
|
||||
saveMissingTo: 'es',
|
||||
keySeparator: 'ß',
|
||||
nsSeparator: 'ð',
|
||||
pluralSeparator: 'đ'
|
||||
};
|
||||
|
||||
export default i18nOpts;
|
||||
69
imports/startup/server/IPGeocoder.js
Normal file
69
imports/startup/server/IPGeocoder.js
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import maxmind from 'maxmind';
|
||||
import fs from 'fs';
|
||||
|
||||
process.env.HTTP_FORWARDED_COUNT = Meteor.settings.private.proxies_count;
|
||||
if (!Meteor.isDevelopment) {
|
||||
console.log(`Number or proxies (needed for client IP lookup): ${process.env.HTTP_FORWARDED_COUNT}`);
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/questions/13969655/how-do-you-check-whether-the-given-ip-is-internal-or-not
|
||||
function isPrivateIP(ip) {
|
||||
const parts = ip.split('.');
|
||||
return parts[0] === '10' ||
|
||||
parts[0] === '127' ||
|
||||
(parts[0] === '172' && (parseInt(parts[1], 10) >= 16 && parseInt(parts[1], 10) <= 31)) ||
|
||||
(parts[0] === '192' && parts[1] === '168');
|
||||
}
|
||||
|
||||
const dbpath = '/usr/local/share/maxmind-geolite2/GeoLite2-City.mmdb';
|
||||
// const dbpath = `${process.env.PWD}/private/GeoLite2-City.mmdb`;
|
||||
|
||||
if (!fs.existsSync(dbpath)) {
|
||||
console.error(`Maxmind db not found ${dbpath}, download via cron with https://www.npmjs.com/package/maxmind-geolite2-mirror`);
|
||||
}
|
||||
|
||||
const IPGeocoder = maxmind.openSync(dbpath);
|
||||
export default IPGeocoder;
|
||||
|
||||
// Warning: Meteor cannot access to this.connection with arrow functions
|
||||
export function localize() {
|
||||
// https://stackoverflow.com/questions/14843232/how-to-get-the-user-ip-address-in-meteor-server/22657421#22657421
|
||||
let clientIP;
|
||||
if (this.connection && this.connection.clientAddress) {
|
||||
clientIP = this.connection.clientAddress;
|
||||
} else {
|
||||
console.warn(`We cannot get this meteor connection IP for this connection (${this.connection})`);
|
||||
clientIP = '80.58.61.250';
|
||||
}
|
||||
if (isPrivateIP(clientIP)) {
|
||||
clientIP = '80.58.61.250'; // Some Spain IP address
|
||||
}
|
||||
// console.log(`Geolocating ${clientIP}`);
|
||||
|
||||
// TODO: cron download GeoLite-City
|
||||
// http://dev.maxmind.com/geoip/geoip2/geolite2/
|
||||
const geo = IPGeocoder.get(clientIP);
|
||||
// console.warn(geo);
|
||||
if (geo.location && geo.location.latitude && geo.location.longitude) {
|
||||
return geo;
|
||||
}
|
||||
// geoIP fallback, Madrid
|
||||
return { location: { latitude: 40.4146500, longitude: -3.7004000 } };
|
||||
}
|
||||
|
||||
export const gmapKey = process.env.GMAPS_KEY || Meteor.settings.gmaps.key;
|
||||
export const gmapServerKey = Meteor.settings.gmaps.serverKey;
|
||||
|
||||
Meteor.methods({
|
||||
geo: localize,
|
||||
getMapKey() {
|
||||
// http://meteorpedia.com/read/Environment_Variables
|
||||
// https://developers.google.com/maps/documentation/javascript/get-api-key
|
||||
// https://console.developers.google.com/
|
||||
// export GMAPS_KEY=SomeGMapsKey
|
||||
return gmapKey;
|
||||
}
|
||||
});
|
||||
|
|
@ -1,28 +1,69 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { Accounts } from 'meteor/accounts-base';
|
||||
import i18n from 'i18next';
|
||||
import { getFileNameOfLang } from '/imports/api/Utility/server/files.js';
|
||||
import getPrivateFile from '../../../modules/server/get-private-file';
|
||||
import templateToHTML from '../../../modules/server/handlebars-email-to-html';
|
||||
import templateToText from '../../../modules/server/handlebars-email-to-text';
|
||||
|
||||
const name = 'Application Name';
|
||||
const email = '<support@application.com>';
|
||||
const from = `${name} ${email}`;
|
||||
const name = (lang) => {
|
||||
i18n.changeLanguage(lang);
|
||||
return i18n.t('AppName');
|
||||
};
|
||||
const email = '<noreply@comunes.org>';
|
||||
const from = `${name('en')} ${email}`;
|
||||
// const from = 'noreply@comunes.org';
|
||||
const emailTemplates = Accounts.emailTemplates;
|
||||
|
||||
emailTemplates.siteName = name;
|
||||
emailTemplates.from = from;
|
||||
|
||||
emailTemplates.resetPassword = {
|
||||
subject() {
|
||||
return `[${name}] Reset Your Password`;
|
||||
emailTemplates.verifyEmail = {
|
||||
subject(user) {
|
||||
i18n.changeLanguage(user.lang);
|
||||
const msg = i18n.t('Verifica tu dirección de correo');
|
||||
return `[${name(user.lang)}] ${msg}`;
|
||||
},
|
||||
html(user, url) {
|
||||
return templateToHTML(getPrivateFile(getFileNameOfLang('email-templates', 'verify-email', 'html', user.lang)), {
|
||||
applicationName: name(user.lang),
|
||||
firstName: user.profile.name.first,
|
||||
verifyUrl: url.replace('#/', '')
|
||||
});
|
||||
},
|
||||
text(user, url) {
|
||||
const userEmail = user.emails[0].address;
|
||||
const urlWithoutHash = url.replace('#/', '');
|
||||
|
||||
if (Meteor.isDevelopment) console.info(`Reset Password Link: ${urlWithoutHash}`);
|
||||
|
||||
return `A password reset has been requested for the account related to this
|
||||
address (${userEmail}). To reset the password, visit the following link:
|
||||
\n\n${urlWithoutHash}\n\n If you did not request this reset, please ignore
|
||||
this email. If you feel something is wrong, please contact our support team:
|
||||
${email}.`;
|
||||
},
|
||||
if (Meteor.isDevelopment) console.info(`Verify Email Link: ${urlWithoutHash}`); // eslint-disable-line
|
||||
return templateToText(getPrivateFile(getFileNameOfLang('email-templates', 'verify-email', 'txt', user.lang)), {
|
||||
applicationName: name(user.lang),
|
||||
firstName: user.profile.name.first,
|
||||
verifyUrl: urlWithoutHash
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
emailTemplates.resetPassword = {
|
||||
subject(user) {
|
||||
i18n.changeLanguage(user.lang);
|
||||
const msg = i18n.t('Resetea tu contraseña');
|
||||
return `[${name(user.lang)}] ${msg}`;
|
||||
},
|
||||
html(user, url) {
|
||||
return templateToHTML(getPrivateFile(getFileNameOfLang('email-templates', 'reset-password', 'html', user.lang)), {
|
||||
firstName: user.profile.name.first,
|
||||
applicationName: name(user.lang),
|
||||
emailAddress: user.emails[0].address,
|
||||
resetUrl: url.replace('#/', '')
|
||||
});
|
||||
},
|
||||
text(user, url) {
|
||||
const urlWithoutHash = url.replace('#/', '');
|
||||
if (Meteor.isDevelopment) console.info(`Reset Password Link: ${urlWithoutHash}`); // eslint-disable-line
|
||||
return templateToText(getPrivateFile(getFileNameOfLang('email-templates', 'reset-password', 'txt', user.lang)), {
|
||||
firstName: user.profile.name.first,
|
||||
applicationName: name(user.lang),
|
||||
emailAddress: user.emails[0].address,
|
||||
resetUrl: urlWithoutHash
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue