Commit c1395991 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Remove <import> configuration directive

parent b1fe0fc1
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
<auth name="local"><password db="demo/password_db.csv"/></auth> <auth name="local"><password db="demo/password_db.csv"/></auth>
<source file="../belenios.tar.gz"/> <source file="../belenios.tar.gz"/>
<log file="_RUNDIR_/log/security.log"/> <log file="_RUNDIR_/log/security.log"/>
<import dir="demo/data"/>
<spool dir="_RUNDIR_/spool"/> <spool dir="_RUNDIR_/spool"/>
</eliom> </eliom>
</host> </host>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
open Lwt open Lwt
open Common open Common
open Web_serializable_j open Web_serializable_j
open Web_signatures
open Web_common open Web_common
(** Global initialization *) (** Global initialization *)
...@@ -36,7 +35,6 @@ let () = CalendarLib.Time_Zone.(change Local) ...@@ -36,7 +35,6 @@ let () = CalendarLib.Time_Zone.(change Local)
(** Parse configuration from <eliom> *) (** Parse configuration from <eliom> *)
let spool_dir = ref None let spool_dir = ref None
let import_dirs = ref []
let source_file = ref None let source_file = ref None
let auth_instances = ref [] let auth_instances = ref []
...@@ -50,8 +48,6 @@ let () = ...@@ -50,8 +48,6 @@ let () =
Lwt_main.run (open_security_log file) Lwt_main.run (open_security_log file)
| Element ("source", ["file", file], []) -> | Element ("source", ["file", file], []) ->
source_file := Some file source_file := Some file
| Element ("import", ["dir", dir], []) ->
import_dirs := dir :: !import_dirs
| Element ("spool", ["dir", dir], []) -> | Element ("spool", ["dir", dir], []) ->
spool_dir := Some dir spool_dir := Some dir
| Element ("rewrite-prefix", ["src", src; "dst", dst], []) -> | Element ("rewrite-prefix", ["src", src; "dst", dst], []) ->
...@@ -67,8 +63,6 @@ let () = ...@@ -67,8 +63,6 @@ let () =
(** Parse configuration from other sources *) (** Parse configuration from other sources *)
let ( / ) = Filename.concat
let file_exists x = let file_exists x =
try_lwt try_lwt
Lwt_unix.(access x [R_OK]) >> Lwt_unix.(access x [R_OK]) >>
...@@ -76,21 +70,6 @@ let file_exists x = ...@@ -76,21 +70,6 @@ let file_exists x =
with _ -> with _ ->
return false return false
let read_election_dir dir =
Lwt_io.chars_of_file (dir/"index.json") |>
Lwt_stream.to_string >>=
wrap1 datadir_index_of_string >>=
Lwt_list.map_p (fun item ->
let path = dir/item.datadir_dir in
return {
f_election = path/"election.json";
f_metadata = path/"metadata.json";
f_public_keys = path/"public_keys.jsons";
f_public_creds = path/"public_creds.txt";
f_voters = path/"voters.txt";
}
)
lwt source_file = lwt source_file =
match !source_file with match !source_file with
| Some f -> | Some f ->
...@@ -112,19 +91,3 @@ let spool_dir = ...@@ -112,19 +91,3 @@ let spool_dir =
let () = Web_site.source_file := source_file let () = Web_site.source_file := source_file
let () = Web_common.spool_dir := spool_dir let () = Web_common.spool_dir := spool_dir
let () = Web_site_auth.configure (List.rev !auth_instances) let () = Web_site_auth.configure (List.rev !auth_instances)
lwt () =
Lwt_list.iter_s (fun dir ->
read_election_dir dir >>=
Lwt_list.iter_s (fun f ->
match_lwt Web_site.import_election f [] with
| None ->
Ocsigen_messages.console (fun () ->
Printf.sprintf "Ignored: %s" f.f_election
); return ()
| Some w ->
let module W = (val w : REGISTRABLE_ELECTION) in
lwt _ = W.register () in
return ()
)
) !import_dirs
...@@ -19,11 +19,4 @@ ...@@ -19,11 +19,4 @@
(* <http://www.gnu.org/licenses/>. *) (* <http://www.gnu.org/licenses/>. *)
(**************************************************************************) (**************************************************************************)
open Web_signatures
open Web_common
val source_file : string ref val source_file : string ref
val import_election :
election_files -> setup_voter list ->
(module REGISTRABLE_ELECTION) option Lwt.t
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment