digital_heroes_startkit 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +37 -0
  4. data/Rakefile +36 -0
  5. data/app/assets/config/digital_heroes_startkit_manifest.js +0 -0
  6. data/app/assets/javascripts/authorization.coffee +79 -0
  7. data/app/assets/javascripts/avatar.coffee +16 -0
  8. data/app/assets/javascripts/datepicker.js +2 -0
  9. data/app/assets/javascripts/digital_heroes_startkit/cable.js +13 -0
  10. data/app/assets/javascripts/digital_heroes_startkit/channels/pills.coffee +23 -0
  11. data/app/assets/javascripts/digital_heroes_startkit/input.coffee +5 -0
  12. data/app/assets/javascripts/digital_heroes_startkit/pills.coffee +2 -0
  13. data/app/assets/javascripts/digital_heroes_startkit/snap.svg-min.js +21 -0
  14. data/app/assets/javascripts/digital_heroes_startkit.js +26 -0
  15. data/app/assets/javascripts/profile.coffee +53 -0
  16. data/app/assets/javascripts/profile_geodata.coffee +68 -0
  17. data/app/assets/javascripts/reg_fields_checkup.coffee +96 -0
  18. data/app/assets/javascripts/registration.coffee +35 -0
  19. data/app/assets/javascripts/resurrection.coffee +20 -0
  20. data/app/channels/application_cable/channel.rb +4 -0
  21. data/app/channels/application_cable/connection.rb +4 -0
  22. data/app/channels/pills_channel.rb +10 -0
  23. data/app/controllers/avatars_controller.rb +11 -0
  24. data/app/controllers/clients_controller.rb +62 -0
  25. data/app/controllers/email_access_cards_controller.rb +28 -0
  26. data/app/controllers/geodata_controller.rb +84 -0
  27. data/app/controllers/nickname_access_cards_controller.rb +30 -0
  28. data/app/controllers/oauth_controller.rb +178 -0
  29. data/app/controllers/openid_controller.rb +124 -0
  30. data/app/controllers/phone_access_cards_controller.rb +28 -0
  31. data/app/controllers/profile_controller.rb +114 -0
  32. data/app/controllers/response_controller.rb +17 -0
  33. data/app/controllers/start_kit_controller.rb +86 -0
  34. data/app/controllers/user_cards_controller.rb +305 -0
  35. data/app/jobs/log_analyzer_job.rb +50 -0
  36. data/app/jobs/password_resurrection_kill_job.rb +9 -0
  37. data/app/mailers/admin_mailer.rb +9 -0
  38. data/app/mailers/client_mailer.rb +3 -0
  39. data/app/mailers/kreator_mailer.rb +9 -0
  40. data/app/mailers/manager_mailer.rb +9 -0
  41. data/app/mailers/prometeus_mailer.rb +16 -0
  42. data/app/mailers/user_cards_mailer.rb +9 -0
  43. data/app/models/admin.rb +3 -0
  44. data/app/models/avatar.rb +23 -0
  45. data/app/models/city.rb +7 -0
  46. data/app/models/client.rb +31 -0
  47. data/app/models/country.rb +7 -0
  48. data/app/models/delayed_job.rb +20 -0
  49. data/app/models/email_access_card.rb +30 -0
  50. data/app/models/kreator.rb +3 -0
  51. data/app/models/log_error.rb +56 -0
  52. data/app/models/log_error_type.rb +3 -0
  53. data/app/models/manager.rb +3 -0
  54. data/app/models/nickname_access_card.rb +18 -0
  55. data/app/models/oauth_access_card.rb +38 -0
  56. data/app/models/phone_access_card.rb +19 -0
  57. data/app/models/prometeus.rb +50 -0
  58. data/app/models/user_card.rb +158 -0
  59. data/app/views/admin_mailer/greetings_email.html.erb +191 -0
  60. data/app/views/client_mailer/greetings_email.html.erb +191 -0
  61. data/app/views/kreator_mailer/greetings_email.html.erb +191 -0
  62. data/app/views/manager_mailer/greetings_email.html.erb +191 -0
  63. data/app/views/oauth/verify.slim +1 -0
  64. data/app/views/profile/_add_avatar.slim +12 -0
  65. data/app/views/profile/_user_profile.slim +95 -0
  66. data/app/views/profile/index.slim +12 -0
  67. data/app/views/user_cards/authorization.slim +72 -0
  68. data/app/views/user_cards/confirmation_but_access_code.slim +7 -0
  69. data/app/views/user_cards/confirmation_complete.slim +7 -0
  70. data/app/views/user_cards/registration.slim +86 -0
  71. data/app/views/user_cards/resurrection.slim +19 -0
  72. data/app/views/user_cards/resurrection_but_access_code.slim +7 -0
  73. data/app/views/user_cards/resurrection_no_access_code.slim +7 -0
  74. data/app/views/user_cards_mailer/email.html.erb +191 -0
  75. data/app/views/user_cards_mailer/resurrection.html.erb +191 -0
  76. data/config/initializers/session_manager.rb +2 -0
  77. data/config/routes.rb +53 -0
  78. data/lib/access_control.rb +3 -0
  79. data/lib/digital_heroes_startkit/engine.rb +25 -0
  80. data/lib/digital_heroes_startkit/version.rb +3 -0
  81. data/lib/digital_heroes_startkit.rb +5 -0
  82. data/lib/generators/digital_heroes_startkit/install_generator.rb +61 -0
  83. data/lib/generators/project/Capfile +36 -0
  84. data/lib/generators/project/Procfile +3 -0
  85. data/lib/generators/project/app/assets/stylesheets/application.scss +16 -0
  86. data/lib/generators/project/app/assets/stylesheets/base/_auth.scss +37 -0
  87. data/lib/generators/project/app/assets/stylesheets/base/_buttons.scss +62 -0
  88. data/lib/generators/project/app/assets/stylesheets/base/_checkbox.scss +71 -0
  89. data/lib/generators/project/app/assets/stylesheets/base/_datepicker.scss +620 -0
  90. data/lib/generators/project/app/assets/stylesheets/base/_form.scss +81 -0
  91. data/lib/generators/project/app/assets/stylesheets/base/_notice.scss +14 -0
  92. data/lib/generators/project/app/assets/stylesheets/base/_pills.scss +39 -0
  93. data/lib/generators/project/app/assets/stylesheets/base/_profile.scss +67 -0
  94. data/lib/generators/project/app/assets/stylesheets/base/_reset.scss +49 -0
  95. data/lib/generators/project/app/assets/stylesheets/base/_social.scss +52 -0
  96. data/lib/generators/project/app/assets/stylesheets/base/_user.scss +0 -0
  97. data/lib/generators/project/app/assets/stylesheets/base/_user_avatar.scss +18 -0
  98. data/lib/generators/project/app/assets/stylesheets/base/styles.scss.txt +35 -0
  99. data/lib/generators/project/app/assets/stylesheets/plugins/sumoselect.scss +296 -0
  100. data/lib/generators/project/app/controllers/application_controller.rb +3 -0
  101. data/lib/generators/project/app/views/layouts/_counts.html.erb +29 -0
  102. data/lib/generators/project/app/views/layouts/_footer.slim +6 -0
  103. data/lib/generators/project/app/views/layouts/_head.slim +7 -0
  104. data/lib/generators/project/app/views/layouts/_header.slim +47 -0
  105. data/lib/generators/project/app/views/layouts/_mobile_menu.slim +11 -0
  106. data/lib/generators/project/app/views/layouts/application.slim +26 -0
  107. data/lib/generators/project/app/views/layouts/mailer.html.erb +13 -0
  108. data/lib/generators/project/app/views/layouts/mailer.text.erb +1 -0
  109. data/lib/generators/project/config/application.access.yml +66 -0
  110. data/lib/generators/project/config/application.db.yml +5 -0
  111. data/lib/generators/project/config/application.google.yml +3 -0
  112. data/lib/generators/project/config/application.oauth.yml +135 -0
  113. data/lib/generators/project/config/application.robokassa.yml +10 -0
  114. data/lib/generators/project/config/application.sendgrid.yml +3 -0
  115. data/lib/generators/project/config/application.telegram.yml +22 -0
  116. data/lib/generators/project/config/application.yml +28 -0
  117. data/lib/generators/project/config/cable.yml +6 -0
  118. data/lib/generators/project/config/capistrano.yml +78 -0
  119. data/lib/generators/project/config/database.yml +52 -0
  120. data/lib/generators/project/config/deploy/application.secrets.yml +4 -0
  121. data/lib/generators/project/config/deploy/domain.crt +92 -0
  122. data/lib/generators/project/config/deploy/domain.key +51 -0
  123. data/lib/generators/project/config/deploy/nginx.conf +50 -0
  124. data/lib/generators/project/config/deploy/production.rb +67 -0
  125. data/lib/generators/project/config/deploy/secrets.yml +32 -0
  126. data/lib/generators/project/config/deploy/secrets.yml.enc +1 -0
  127. data/lib/generators/project/config/deploy/secrets.yml.key +1 -0
  128. data/lib/generators/project/config/deploy/staging.rb +61 -0
  129. data/lib/generators/project/config/deploy/virgin_conf/database.yml +42 -0
  130. data/lib/generators/project/config/deploy/virgin_conf/nginx_site.conf +47 -0
  131. data/lib/generators/project/config/deploy/virgin_conf/nginx_site_ssl.conf +57 -0
  132. data/lib/generators/project/config/deploy/virgin_conf/postfix.cf +685 -0
  133. data/lib/generators/project/config/deploy/virgin_conf/production.rb +67 -0
  134. data/lib/generators/project/config/deploy/virgin_conf/puma.rb +66 -0
  135. data/lib/generators/project/config/deploy/virgin_sh/capistrano.sh +18 -0
  136. data/lib/generators/project/config/deploy/virgin_sh/foreman.sh +19 -0
  137. data/lib/generators/project/config/deploy/virgin_sh/rvm_install.sh +10 -0
  138. data/lib/generators/project/config/deploy.rb +377 -0
  139. data/lib/generators/project/config/environments/development.rb +91 -0
  140. data/lib/generators/project/config/environments/production.rb +142 -0
  141. data/lib/generators/project/config/initializers/session_store.rb +3 -0
  142. data/lib/generators/project/config/locales/ru.yml +444 -0
  143. data/lib/generators/project/db/migrate/10_create_user_cards.rb +19 -0
  144. data/lib/generators/project/db/migrate/12_create_email_access_cards.rb +15 -0
  145. data/lib/generators/project/db/migrate/13_create_nickname_access_cards.rb +15 -0
  146. data/lib/generators/project/db/migrate/14_create_phone_access_cards.rb +16 -0
  147. data/lib/generators/project/db/migrate/15_create_oauth_access_cards.rb +19 -0
  148. data/lib/generators/project/db/migrate/1_create_kreators.rb +9 -0
  149. data/lib/generators/project/db/migrate/21_create_avatars.rb +12 -0
  150. data/lib/generators/project/db/migrate/30_create_countries.rb +12 -0
  151. data/lib/generators/project/db/migrate/32_create_cities.rb +12 -0
  152. data/lib/generators/project/db/migrate/3_create_admins.rb +9 -0
  153. data/lib/generators/project/db/migrate/44_add_sessions_table.rb +12 -0
  154. data/lib/generators/project/db/migrate/4_create_managers.rb +10 -0
  155. data/lib/generators/project/db/migrate/5_create_clients.rb +17 -0
  156. data/lib/generators/project/db/migrate/60_create_log_error_types.rb +9 -0
  157. data/lib/generators/project/db/migrate/61_create_log_errors.rb +12 -0
  158. data/lib/generators/project/db/migrate/78_create_delayed_jobs.rb +22 -0
  159. data/lib/generators/project/db/seeds.rb +27 -0
  160. data/lib/generators/project/geodata/cities.csv +25305 -0
  161. data/lib/generators/project/geodata/countries.csv +250 -0
  162. data/lib/generators/project/public/401.html +75 -0
  163. data/lib/generators/project/public/404.html +67 -0
  164. data/lib/generators/project/public/422.html +67 -0
  165. data/lib/generators/project/public/500.html +66 -0
  166. data/lib/generators/project/public/_receiver.html +10 -0
  167. data/lib/generators/project/public/apple-touch-icon-precomposed.png +0 -0
  168. data/lib/generators/project/public/apple-touch-icon.png +0 -0
  169. data/lib/generators/project/public/favicon.ico +0 -0
  170. data/lib/generators/project/public/robots.txt +1 -0
  171. data/lib/happy_birthday.rb +5 -0
  172. data/lib/link.rb +16 -0
  173. data/lib/oauth/oauth.rb +72 -0
  174. data/lib/oauth/oauth_fb.rb +48 -0
  175. data/lib/oauth/oauth_gg.rb +50 -0
  176. data/lib/oauth/oauth_im.rb +51 -0
  177. data/lib/oauth/oauth_mr.rb +53 -0
  178. data/lib/oauth/oauth_vk.rb +3 -0
  179. data/lib/oauth/oauth_yx.rb +51 -0
  180. data/lib/openid/openid.rb +46 -0
  181. data/lib/openid/openid_st.rb +2 -0
  182. data/lib/phone_cutter.rb +9 -0
  183. data/lib/response.rb +51 -0
  184. data/lib/session_manager.rb +47 -0
  185. data/lib/sms_lib.rb +30 -0
  186. data/lib/social_networks.rb +328 -0
  187. data/lib/tasks/digital_heroes_startkit_tasks.rake +83 -0
  188. data/lib/telegram.rb +33 -0
  189. metadata +497 -0
@@ -0,0 +1,250 @@
1
+ 1,RW,Руанда,0
2
+ 2,SO,Сомали,0
3
+ 3,YE,Йемен,0
4
+ 4,IQ,Ирак,0
5
+ 5,SA,Саудовская Аравия,0
6
+ 6,IR,Иран,0
7
+ 7,CY,Кипр,1
8
+ 8,TZ,Танзания,0
9
+ 9,SY,Сирийская Арабская Республика,0
10
+ 10,AM,Армения,0
11
+ 11,KE,Кения,0
12
+ 12,CD,Заир,0
13
+ 13,DJ,Джибути,0
14
+ 14,UG,Уганда,0
15
+ 15,CF,ЦАР,0
16
+ 16,SC,Сейшельские о-ва,0
17
+ 17,JO,Иордания,0
18
+ 18,LB,Ливан,0
19
+ 19,KW,Кувейт,0
20
+ 20,OM,Оман,0
21
+ 21,QA,Катар,0
22
+ 22,BH,Бахрейн,0
23
+ 23,AE,ОАЭ,0
24
+ 24,IL,Израиль,0
25
+ 25,TR,Турция,0
26
+ 26,ET,Эфиопия,0
27
+ 27,ER,Эритрея,0
28
+ 28,EG,Египет,0
29
+ 29,SD,Судан,0
30
+ 30,GR,Греция,1
31
+ 31,BI,Бурунди,0
32
+ 32,EE,Эстония,1
33
+ 33,LV,Латвия,1
34
+ 34,AZ,Азербайджан,0
35
+ 35,LT,Литва,1
36
+ 36,SJ,Свальбард и Ян-Майен,0
37
+ 37,GE,Грузия,0
38
+ 38,MD,Молдова,0
39
+ 39,BY,Беларусь,0
40
+ 40,FI,Финляндия,1
41
+ 41,AX,Аланды,0
42
+ 42,UA,Украина,0
43
+ 43,MK,Македония,0
44
+ 44,HU,Венгрия,1
45
+ 45,BG,Болгария,1
46
+ 46,AL,Албания,0
47
+ 47,PL,Польша,1
48
+ 48,RO,Румыния,1
49
+ 49,XK,Косово,0
50
+ 50,ZW,Зимбабве,0
51
+ 51,ZM,Замбия,0
52
+ 52,KM,Коморские о-ва,0
53
+ 53,MW,Малави,0
54
+ 54,LS,Лесото,0
55
+ 55,BW,Ботсвана,0
56
+ 56,MU,Маврикий,0
57
+ 57,SZ,Свазиленд,0
58
+ 58,RE,Реюньон,0
59
+ 59,ZA,ЮАР,0
60
+ 60,YT,Майотта,0
61
+ 61,MZ,Мозамбик,0
62
+ 62,MG,Мадагаскар,0
63
+ 63,AF,Афганистан,0
64
+ 64,PK,Пакистан,0
65
+ 65,BD,Бангладеш,0
66
+ 66,TM,Туркменистан,0
67
+ 67,TJ,Таджикистан,0
68
+ 68,LK,Шри-Ланка,0
69
+ 69,BT,Бутан,0
70
+ 70,IN,Индия,0
71
+ 71,MV,Мальдивские о-ва,0
72
+ 72,IO,Британская территория в Индийском океане,0
73
+ 73,NP,Непал,0
74
+ 74,MM,Мьянма,0
75
+ 75,UZ,Узбекистан,0
76
+ 76,KZ,Казахстан,0
77
+ 77,KG,Кыргызстан,0
78
+ 78,TF,Французские Южные Территории,0
79
+ 79,HM,Острова Херд и Макдональд,0
80
+ 80,CC,Кокосовые о-ва,0
81
+ 81,PW,Палау,0
82
+ 82,VN,Вьетнам,0
83
+ 83,TH,Тайланд,0
84
+ 84,ID,Индонезия,0
85
+ 85,LA,Лаос,0
86
+ 86,TW,Тайвань,0
87
+ 87,PH,Филиппины,0
88
+ 88,MY,Малайзия,0
89
+ 89,CN,Китай,0
90
+ 90,HK,Гонконг,0
91
+ 91,BN,Бруней Даруссалам,0
92
+ 92,MO,Макао,0
93
+ 93,KH,Камбоджа,0
94
+ 94,KR,Южная Корея,0
95
+ 95,JP,Япония,0
96
+ 96,KP,Северная Корея,0
97
+ 97,SG,Сингапур,0
98
+ 98,CK,Острова Кука,0
99
+ 99,TL,Восточный Тимор,0
100
+ 100,MN,Монголия,0
101
+ 101,AU,Австралия,0
102
+ 102,CX,Остров Рождества,0
103
+ 103,MH,Маршалловы о-ва,0
104
+ 104,FM,Микронезия,0
105
+ 105,PG,Папуа – Новая Гвинея,0
106
+ 106,SB,Соломонские острова,0
107
+ 107,TV,Тувалу,0
108
+ 108,NR,Науру,0
109
+ 109,VU,Вануату,0
110
+ 110,NC,Новая Каледония,0
111
+ 111,NF,Остров Норфолк,0
112
+ 112,NZ,Новая Зеландия,0
113
+ 113,FJ,Фиджи,0
114
+ 114,LY,Ливия,0
115
+ 115,CM,Камерун,0
116
+ 116,SN,Сенегал,0
117
+ 117,CG,Конго,0
118
+ 118,PT,Португалия,1
119
+ 119,LR,Либерия,0
120
+ 120,CI,Кот-д'Ивуар,0
121
+ 121,GH,Гана,0
122
+ 122,GQ,Экваториальная Гвинея,0
123
+ 123,NG,Нигерия,0
124
+ 124,BF,Буркина Фасо,0
125
+ 125,TG,Того,0
126
+ 126,GW,Гвинея-Биссау,0
127
+ 127,MR,Мавритания,0
128
+ 128,BJ,Бенин,0
129
+ 129,GA,Габон,0
130
+ 130,SL,Сьерра-Леоне,0
131
+ 131,ST,Сан-Томе и Принсипе,0
132
+ 132,GI,Гибралтар,0
133
+ 133,GM,Гамбия,0
134
+ 134,GN,Гвинея,0
135
+ 135,TD,Чад,0
136
+ 136,NE,Нигер,0
137
+ 137,ML,Мали,0
138
+ 138,EH,Западная Сахара,0
139
+ 139,TN,Тунис,0
140
+ 140,ES,Испания,1
141
+ 141,MA,Марокко,0
142
+ 142,MT,Мальта,1
143
+ 143,DZ,Алжир,0
144
+ 144,FO,Фарерские о-ва,0
145
+ 145,DK,Дания,1
146
+ 146,IS,Исландия,0
147
+ 147,GB,Великобритания,1
148
+ 148,CH,Швейцария,0
149
+ 149,SE,Швеция,1
150
+ 150,NL,Нидерланды,1
151
+ 151,AT,Австрия,1
152
+ 152,BE,Бельгия,1
153
+ 153,DE,Германия,1
154
+ 154,LU,Люксембург,1
155
+ 155,IE,Ирландия,1
156
+ 156,MC,Монако,0
157
+ 157,FR,Франция,1
158
+ 158,AD,Андорра,0
159
+ 159,LI,Лихтенштейн,0
160
+ 160,JE,Джерси,0
161
+ 161,IM,"Мэн, о-в",0
162
+ 162,GG,Гернси,0
163
+ 163,SK,Словакия,1
164
+ 164,CZ,Чешская Республика,1
165
+ 165,NO,Норвегия,0
166
+ 166,VA,Ватикан,0
167
+ 167,SM,Сан-Марино,0
168
+ 168,IT,Италия,1
169
+ 169,SI,Словения,1
170
+ 170,ME,Черногория,0
171
+ 171,HR,Хорватия,1
172
+ 172,BA,Босния,0
173
+ 173,AO,Ангола,0
174
+ 174,NA,Намибия,0
175
+ 175,SH,Остров Святой Елены,0
176
+ 176,BV,Остров Буве,0
177
+ 177,BB,Барбадос,0
178
+ 178,CV,Острова Зеленого Мыса,0
179
+ 179,GY,Гайана,0
180
+ 180,GF,Французская Гвиана,0
181
+ 181,SR,Суринам,0
182
+ 182,PM,Сен-Пьер и Микелон,0
183
+ 183,GL,Гренландия,0
184
+ 184,PY,Парагвай,0
185
+ 185,UY,Уругвай,0
186
+ 186,BR,Бразилия,0
187
+ 187,FK,Фолклендские о-ва,0
188
+ 188,GS,Южная Джорджия и Южные Сандвичевы Острова,0
189
+ 189,JM,Ямайка,0
190
+ 190,DO,Доминиканская Республика,0
191
+ 191,CU,Куба,0
192
+ 192,MQ,Мартиника,0
193
+ 193,BS,Багамы,0
194
+ 194,BM,Бермудские о-ва,0
195
+ 195,AI,Ангилья,0
196
+ 196,TT,Тринидад и Тобаго,0
197
+ 197,KN,Сент-Киттс и Невис,0
198
+ 198,DM,Остров Доминика,0
199
+ 199,AG,Антигуа и Барбуда,0
200
+ 200,LC,Сент-Люсия,0
201
+ 201,TC,Острова Тёркс и Кайкос,0
202
+ 202,AW,Аруба,0
203
+ 203,VG,Британские Виргинские о-ва,0
204
+ 204,VC,Сент-Винсент и Гренадины,0
205
+ 205,MS,Монсеррат,0
206
+ 206,MF,Остров Святого Мартина,0
207
+ 207,BL,Остров Святого Бартоломея,0
208
+ 208,GP,Гваделупа,0
209
+ 209,GD,Гренада,0
210
+ 210,KY,Каймановы Острова,0
211
+ 211,BZ,Белиз,0
212
+ 212,SV,Сальвадор,0
213
+ 213,GT,Гватемала,0
214
+ 214,HN,Гондурас,0
215
+ 215,NI,Никарагуа,0
216
+ 216,CR,Коста-Рика,0
217
+ 217,VE,Венесуэла,0
218
+ 218,EC,Эквадор,0
219
+ 219,CO,Колумбия,0
220
+ 220,PA,Панама,0
221
+ 221,HT,Гаити,0
222
+ 222,AR,Аргентина,0
223
+ 223,CL,Чили,0
224
+ 224,BO,Боливия,0
225
+ 225,PE,Перу,0
226
+ 226,MX,Мексика,0
227
+ 227,PF,Французская Полинезия,0
228
+ 228,PN,Питкэрн,0
229
+ 229,KI,Кирибати,0
230
+ 230,TK,Токелау,0
231
+ 231,TO,Тонга,0
232
+ 232,WF,Уоллис и Футуна,0
233
+ 233,WS,Самоа,0
234
+ 234,NU,Ниуе,0
235
+ 235,MP,Северные Марианские о-ва,0
236
+ 236,GU,Гуам,0
237
+ 237,PR,Пуэрто-Рико,0
238
+ 238,VI,Виргинские о-ва (США),0
239
+ 239,UM,Внешние малые острова (США),0
240
+ 240,AS,Американское Самоа,0
241
+ 241,CA,Канада,0
242
+ 242,US,США,0
243
+ 243,PS,Палестинские территории,0
244
+ 244,RS,Сербия,0
245
+ 245,AQ,Антарктида,0
246
+ 246,SX,Синт-Мартен,0
247
+ 247,CW,Кюрасао,0
248
+ 248,BQ,"Бонайре, Синт-Эстатиус и Саба",0
249
+ 249,SS,Южный Судан,0
250
+ 250,RU,Россия,0
@@ -0,0 +1,75 @@
1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+ <head>
4
+ <title>401 Нет доступа</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <meta charset="utf-8" />
7
+ <link rel="icon" href="/favicon.ico" type="image/x-icon" />
8
+ <style>
9
+ .rails-default-error-page {
10
+ background-color: #EFEFEF;
11
+ color: #2E2F30;
12
+ text-align: center;
13
+ font-family: arial, sans-serif;
14
+ margin: 0;
15
+ }
16
+
17
+ .rails-default-error-page div.dialog {
18
+ width: 95%;
19
+ max-width: 40vw;
20
+ margin: 4em auto 0;
21
+ }
22
+
23
+ .rails-default-error-page div.dialog > div {
24
+ border: 5px solid #0070ba;
25
+ padding: 1em 12% 0;
26
+ }
27
+
28
+ .rails-default-error-page h1 {
29
+ font-size: 12vw;
30
+ font-weight: 400;
31
+ color: #0070ba;
32
+ margin: 5vw 0 0 0;
33
+ }
34
+
35
+ .rails-default-error-page div.dialog > p {
36
+ margin: 0 0 1em;
37
+ padding: 1em;
38
+ background-color: #F7F7F7;
39
+ border: 1px solid #CCC;
40
+ border-right-color: #999;
41
+ border-left-color: #999;
42
+ border-bottom-color: #999;
43
+ border-bottom-left-radius: 4px;
44
+ border-bottom-right-radius: 4px;
45
+ border-top-color: #DADADA;
46
+ color: #666;
47
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
48
+ }
49
+ .rails-default-error-page div.dialog p.text {
50
+ font-size: 2vw;
51
+ text-transform: uppercase;
52
+ color: #0070ba;
53
+ }
54
+ .rails-default-error-page div.dialog a {
55
+ display: inline-block;
56
+ color: #0070ba;
57
+ margin-bottom: 2em;
58
+ font-weight: bold;
59
+ }
60
+ .rails-default-error-page div.dialog a:hover {
61
+ text-decoration: none;
62
+ }
63
+ </style>
64
+ </head>
65
+
66
+ <body class="rails-default-error-page">
67
+ <div class="dialog">
68
+ <div>
69
+ <h1>401</h1>
70
+ <p class="text">Нет доступа</p>
71
+ <p><a href="/" title="Вернуться на главную">Вернуться на главную</a></p>
72
+ </div>
73
+ </div>
74
+ </body>
75
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
@@ -0,0 +1,10 @@
1
+ <html>
2
+ <body>
3
+ <script src="//connect.mail.ru/js/loader.js"></script>
4
+ <script>
5
+ mailru.loader.require('receiver', function(){
6
+ mailru.receiver.init();
7
+ })
8
+ </script>
9
+ </body>
10
+ </html>
File without changes
@@ -0,0 +1 @@
1
+ # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
@@ -0,0 +1,5 @@
1
+ class DateTime
2
+ def happy_birthday?
3
+ self.strftime('%m%d') == DateTime.now.strftime('%m%d')
4
+ end
5
+ end
data/lib/link.rb ADDED
@@ -0,0 +1,16 @@
1
+ class Link
2
+ # сексуальный линк собственного производства
3
+ def initialize(id)
4
+
5
+ a = id.to_s.split('')
6
+ @link = a.fill(0, a.length, 8 - a.length).join.to_i.to_s(36)
7
+
8
+ end
9
+
10
+ def get
11
+
12
+ @link
13
+
14
+ end
15
+
16
+ end
@@ -0,0 +1,72 @@
1
+ class Oauth
2
+
3
+ require 'uri'
4
+ require 'net/http'
5
+
6
+ def initialize verify_url, state
7
+ @verify_url = verify_url
8
+ @key = state.keys.first
9
+ @name = state.values.first[:name].to_sym
10
+ end
11
+
12
+ def auth_request step = :step1, add_params = nil
13
+ uri = URI CONFIG[:oauth][@name][:auth][step][:uri]
14
+ params = CONFIG[:oauth][@name][:auth][:united_params].merge(CONFIG[:oauth][@name][:auth][step].except(:uri)).merge({redirect_uri: @verify_url, state: @key})
15
+ # для второго шага
16
+ params.merge!(add_params) unless add_params.nil?
17
+ uri.query = URI.encode_www_form params
18
+
19
+ case step
20
+ when :step1
21
+ uri.to_s
22
+ when :step2
23
+ oauth_access_card_params Net::HTTP.get_response(uri)
24
+ end
25
+
26
+ end
27
+
28
+ def oauth_access_card_params result
29
+ begin
30
+ params = ActiveSupport::JSON.decode(result.body)
31
+ unless params['error'].present?
32
+ add_info = get_user_info({access_token: params['access_token']})
33
+ {
34
+ state: :ok,
35
+ oauth_name: @name,
36
+ oauth_uid: params['user_id'],
37
+ access_token: params['access_token'],
38
+ token_expired: (DateTime.now + params['expires_in'].second).to_s(:db),
39
+ photourl: add_info['photo_100']
40
+ }
41
+ else
42
+ {
43
+ state: :shit,
44
+ error: "#{params['error']}:#{params['error_description']}"
45
+ }
46
+ end
47
+ rescue Exception => error
48
+ {
49
+ state: :shit,
50
+ error: error.message
51
+ }
52
+ end
53
+ end
54
+
55
+ def get_user_info access_params
56
+ uri = URI "#{CONFIG[:oauth][@name][:api][:uri]}#{CONFIG[:oauth][@name][:api][:users_get][:prefix]}"
57
+ params = CONFIG[:oauth][@name][:api][:united_params].merge!(CONFIG[:oauth][@name][:api][:users_get][:params])
58
+ params.merge!(access_params) unless access_params.nil?
59
+ uri.query = URI.encode_www_form params
60
+ result = Net::HTTP.get_response uri
61
+
62
+ ActiveSupport::JSON.decode(result.body)['response'][0]
63
+ end
64
+
65
+ def error_response error_message
66
+ {
67
+ state: :shit,
68
+ error: error_message
69
+ }
70
+ end
71
+
72
+ end
@@ -0,0 +1,48 @@
1
+ # у Цукерберга всё оригинально, нужен дополнительный запрос для получения user_id и token expired
2
+
3
+ class OauthFb < Oauth
4
+
5
+ def oauth_access_card_params result
6
+ begin
7
+ base_access_token = ActiveSupport::JSON.decode(result.body)
8
+ unless base_access_token['error'].present?
9
+
10
+ uri = URI CONFIG[:oauth][:fb][:auth][:debug_token][:uri]
11
+ params = ({input_token: base_access_token['access_token'], access_token: "#{CONFIG[:oauth][:fb][:auth][:united_params][:client_id]}|#{CONFIG[:oauth][:fb][:auth][:debug_token][:client_secret]}"})
12
+ uri.query = URI.encode_www_form params
13
+
14
+ result = Net::HTTP.get_response uri
15
+ access_token_details = ActiveSupport::JSON.decode(result.body)
16
+
17
+ unless access_token_details['error'].present?
18
+ user_picture = user_picture({access_token: base_access_token['access_token']})
19
+ {
20
+ state: :ok,
21
+ oauth_name: @name,
22
+ oauth_uid: access_token_details['data']['user_id'],
23
+ access_token: base_access_token['access_token'],
24
+ token_expired: Time.at(access_token_details['data']['expires_at']).to_datetime.to_s(:db),
25
+ photourl: user_picture['data']['url']
26
+ }
27
+ else
28
+ error_response access_token_details['error']['message']
29
+ end
30
+ else
31
+ error_response base_access_token['error']['message']
32
+ end
33
+ rescue Exception => error
34
+ error_response error.message
35
+ end
36
+ end
37
+
38
+ def user_picture access_params
39
+ uri = URI "#{CONFIG[:oauth][@name][:api][:uri]}#{CONFIG[:oauth][@name][:api][:get_picture][:prefix]}"
40
+ params = {width: 200, height: 200, redirect: false}
41
+ params.merge!(access_params) unless access_params.nil?
42
+ uri.query = URI.encode_www_form params
43
+ result = Net::HTTP.get_response uri
44
+
45
+ ActiveSupport::JSON.decode(result.body)
46
+ end
47
+
48
+ end