*/
#include "config.h"
-#include "server.h"
#include "filter.h"
#include "ratio.h"
#include "types.h"
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/foreach.hpp>
+#include <boost/thread.hpp>
#include <cstdlib>
#include <fstream>
#include <iostream>
_mail_port = 25;
_mail_user = "";
_mail_password = "";
- _kdm_subject = _("KDM delivery");
_kdm_from = "";
_kdm_cc = "";
_kdm_bcc = "";
_check_for_updates = false;
_check_for_test_updates = false;
_maximum_j2k_bandwidth = 250000000;
- _log_types = Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR;
+ _log_types = LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR;
_automatic_audio_analysis = false;
#ifdef DCPOMATIC_WINDOWS
_win32_console = false;
Config::instance()->changed ();
}
+shared_ptr<dcp::CertificateChain>
+Config::create_certificate_chain ()
+{
+ return shared_ptr<dcp::CertificateChain> (
+ new dcp::CertificateChain (
+ openssl_path(),
+ "dcpomatic.com",
+ "dcpomatic.com",
+ ".dcpomatic.smpte-430-2.ROOT",
+ ".dcpomatic.smpte-430-2.INTERMEDIATE",
+ "CS.dcpomatic.smpte-430-2.LEAF"
+ )
+ );
+}
+
void
Config::read ()
{
if (!have_existing ()) {
/* Make a new set of signing certificates and key */
- _signer_chain.reset (new dcp::CertificateChain (openssl_path ()));
+ _signer_chain = create_certificate_chain ();
/* And similar for decryption of KDMs */
- _decryption_chain.reset (new dcp::CertificateChain (openssl_path ()));
+ _decryption_chain = create_certificate_chain ();
write ();
return;
}
_check_for_test_updates = f.optional_bool_child("CheckForTestUpdates").get_value_or (false);
_maximum_j2k_bandwidth = f.optional_number_child<int> ("MaximumJ2KBandwidth").get_value_or (250000000);
- _allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate");
+ _allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate").get_value_or (false);
- _log_types = f.optional_number_child<int> ("LogTypes").get_value_or (Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR);
+ _log_types = f.optional_number_child<int> ("LogTypes").get_value_or (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
_automatic_audio_analysis = f.optional_bool_child ("AutomaticAudioAnalysis").get_value_or (false);
#ifdef DCPOMATIC_WINDOWS
_win32_console = f.optional_bool_child ("Win32Console").get_value_or (false);
_signer_chain = c;
} else {
/* Make a new set of signing certificates and key */
- _signer_chain.reset (new dcp::CertificateChain (openssl_path ()));
+ _signer_chain = create_certificate_chain ();
}
cxml::NodePtr decryption = f.optional_node_child ("Decryption");
c->set_key (decryption->string_child ("PrivateKey"));
_decryption_chain = c;
} else {
- _decryption_chain.reset (new dcp::CertificateChain (openssl_path ()));
+ _decryption_chain = create_certificate_chain ();
+ }
+
+ list<cxml::NodePtr> dkdm = f.node_children ("DKDM");
+ BOOST_FOREACH (cxml::NodePtr i, f.node_children ("DKDM")) {
+ _dkdms.push_back (dcp::EncryptedKDM (i->content ()));
}
+
}
/** @return Filename to write configuration to */
root->add_child("History")->add_child_text (i->string ());
}
+ BOOST_FOREACH (dcp::EncryptedKDM i, _dkdms) {
+ root->add_child("DKDM")->add_child_text (i.as_xml ());
+ }
+
try {
doc.write_to_file_formatted (file().string ());
} catch (xmlpp::exception& e) {
void
Config::set_kdm_email_to_default ()
{
+ _kdm_subject = _("KDM delivery: $CPL_NAME");
+
_kdm_email = _(
"Dear Projectionist\n\n"
"Please find attached KDMs for $CPL_NAME.\n\n"