<commit_before>(*
 * Accretio is an API, a sandbox and a runtime for social playbooks
 *
 * Copyright (C) 2015 <NAME>
 *
 * 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/>.
 *)


open Lwt
open Ys_authentication

let run () =
  (* setup the logger *)
  let template = "$(date): $(level) $(section) $(loc-file): $(message)"in
  lwt _ = Ys_config.if_prod
    (fun () ->
       lwt logger = Lwt_log.file ~template ~file_name:(Ys_config.get_string "log-file") () in
       Lwt_log.default := logger ;
       return_unit)
    (fun () ->
       let logger = Lwt_log.channel ~template ~close_mode:`Keep ~channel:Lwt_io.stdout () in
       Lwt_log.default := logger ;
       return_unit) in


  Lwt_log.append_rule "main" Lwt_log.Info ;
  (* Lwt_log.append_rule "*" Lwt_log.Info ; *)

  lwt _ = Migration.run () in

  lwt _ = Registry.start () in
  let _ = ignore_result (Imap_endpoint.start ()) in

  (* starting notify *)
  Notify.dequeue_batches () ;

  (* initializing some objects *)
  lwt _ =
    let email = "<EMAIL>" and password = "<PASSWORD>" in

    lwt salt = fresh_salt () in
    Object_member.Store.create
      ~preferred_email:email
      ~name:"William"
        ~emails:[ email ; "<EMAIL>" ]
        ~rights:Object_member.Admin
        ~authentication:(Password (salt, hash salt password))
        ()
    >>= (function
        | `Object_already_exists _ ->
          Lwt_log.ign_info "looks like the root member already exists" ;
          return_unit<commit_msg>removing the imap endpoint<commit_after>(*
 * Accretio is an API, a sandbox and a runtime for social playbooks
 *
 * Copyright (C) 2015 <NAME>
 *
 * 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/>.
 *)


open Lwt
open Ys_authentication

let run () =
  (* setup the logger *)
  let template = "$(date): $(level) $(section) $(loc-file): $(message)"in
  lwt _ = Ys_config.if_prod
    (fun () ->
       lwt logger = Lwt_log.file ~template ~file_name:(Ys_config.get_string "log-file") () in
       Lwt_log.default := logger ;
       return_unit)
    (fun () ->
       let logger = Lwt_log.channel ~template ~close_mode:`Keep ~channel:Lwt_io.stdout () in
       Lwt_log.default := logger ;
       return_unit) in


  Lwt_log.append_rule "main" Lwt_log.Info ;
  (* Lwt_log.append_rule "*" Lwt_log.Info ; *)

  lwt _ = Migration.run () in

  lwt _ = Registry.start () in
(*
   commenting that one out for now, it is causing some kind of fd leak
  let _ = ignore_result (Imap_endpoint.start ()) in
*)

  (* starting notify *)
  Notify.dequeue_batches () ;

  (* initializing some objects *)
  lwt _ =
    let email = "<EMAIL>" and password = "<PASSWORD>" in

    lwt salt = fresh_salt () in
    Object_member.Store.create
      ~preferred_email:email
      ~name:"William"
        ~emails:[ email ; "<EMAIL>" ]
        ~rights:Object_member.Admin
        ~authentication:(Password (salt, hash salt password))
        ()
    >>= (function
        | `Object_already_exists _ ->
          Lwt_log.ign_info "looks like the root member already exists" ;
          return_unit
{'fraction_non_alphanumeric': 0.10488033786954482, 'fraction_numerical': 0.002346316283435007, 'mean_word_length': 3.0716332378223496, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '81087', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1267, 'n_words': 448}