2018-12-25 21:35:04 +00:00
|
|
|
#![feature(proc_macro_hygiene, plugin, decl_macro)]
|
2018-08-16 18:35:19 +00:00
|
|
|
#![recursion_limit = "1024"]
|
|
|
|
|
2019-02-22 20:29:53 +00:00
|
|
|
use failure::Fallible as Result;
|
|
|
|
|
2019-02-07 19:58:31 +00:00
|
|
|
#[macro_use]
|
|
|
|
extern crate serde_derive;
|
2018-09-19 20:24:38 +00:00
|
|
|
|
2019-02-07 19:58:31 +00:00
|
|
|
#[macro_use]
|
|
|
|
extern crate rocket;
|
2019-05-23 23:01:24 +00:00
|
|
|
#[macro_use]
|
2019-02-07 19:58:31 +00:00
|
|
|
extern crate rocket_contrib;
|
2018-09-19 20:24:38 +00:00
|
|
|
|
2019-03-04 16:57:36 +00:00
|
|
|
#[cfg(test)]
|
|
|
|
extern crate regex;
|
2019-02-25 17:34:07 +00:00
|
|
|
|
2019-03-05 16:30:56 +00:00
|
|
|
extern crate hagrid_database as database;
|
2019-08-28 18:33:24 +00:00
|
|
|
|
|
|
|
use gettext_macros::init_i18n;
|
|
|
|
|
2019-09-28 02:54:30 +00:00
|
|
|
init_i18n!("hagrid", en, de);
|
2019-08-28 18:33:24 +00:00
|
|
|
|
2018-11-02 10:50:57 +00:00
|
|
|
mod mail;
|
2019-07-19 18:46:16 +00:00
|
|
|
mod anonymize_utils;
|
2019-04-02 12:54:40 +00:00
|
|
|
mod tokens;
|
|
|
|
mod sealed_state;
|
2019-05-05 11:29:10 +00:00
|
|
|
mod rate_limiter;
|
2019-06-23 13:47:13 +00:00
|
|
|
mod dump;
|
2019-07-19 18:46:16 +00:00
|
|
|
mod counters;
|
2019-09-27 14:21:10 +00:00
|
|
|
mod i18n;
|
2019-09-30 10:52:00 +00:00
|
|
|
mod template_helpers;
|
2019-09-27 14:21:10 +00:00
|
|
|
mod gettext_strings;
|
2019-08-28 18:33:24 +00:00
|
|
|
mod web;
|
2018-08-16 18:35:19 +00:00
|
|
|
|
|
|
|
fn main() {
|
2019-03-12 09:31:56 +00:00
|
|
|
if let Err(e) = web::serve() {
|
2019-03-06 14:47:52 +00:00
|
|
|
let mut cause = e.as_fail();
|
|
|
|
eprint!("{}", cause);
|
|
|
|
while let Some(c) = cause.cause() {
|
|
|
|
eprint!(":\n {}", c);
|
|
|
|
cause = c;
|
|
|
|
}
|
|
|
|
eprintln!();
|
2019-08-27 21:56:19 +00:00
|
|
|
|
2019-03-06 14:47:52 +00:00
|
|
|
::std::process::exit(2);
|
2018-09-19 20:24:38 +00:00
|
|
|
}
|
2019-03-06 14:47:52 +00:00
|
|
|
}
|