Example #1
0
class Node_version_5(Model):
    __storm_table__ = 'node'

    name = Unicode()
    public_site = Unicode()
    hidden_service = Unicode()
    email = Unicode()
    receipt_salt = Unicode()
    last_update = DateTime()
    database_version = Int()
    languages_supported = Pickle()
    languages_enabled = Pickle()
    default_language = Unicode()
    description = Pickle()
    presentation = Pickle()
    stats_update_time = Int()
    maximum_namesize = Int()
    maximum_descsize = Int()
    maximum_textsize = Int()
    maximum_filesize = Int()
    tor2web_admin = Bool()
    tor2web_submission = Bool()
    tor2web_tip = Bool()
    tor2web_receiver = Bool()
    tor2web_unauth = Bool()
    exception_email = Unicode()
Example #2
0
class Node_version_9(Model):
    __storm_table__ = 'node'

    name = Unicode()
    public_site = Unicode()
    hidden_service = Unicode()
    email = Unicode()
    receipt_salt = Unicode()
    last_update = DateTime()
    languages_enabled = Pickle()
    default_language = Unicode()
    description = Pickle()
    presentation = Pickle()
    footer = Pickle()
    subtitle = Pickle()
    stats_update_time = Int()
    maximum_namesize = Int()
    maximum_textsize = Int()
    maximum_filesize = Int()
    tor2web_admin = Bool()
    tor2web_submission = Bool()
    tor2web_receiver = Bool()
    tor2web_unauth = Bool()
    postpone_superpower = Bool()
    can_delete_submission = Bool()
    ahmia = Bool()
    exception_email = Unicode()
Example #3
0
class Receiver_version_7(Model):
    __storm_table__ = 'receiver'

    user_id = Unicode()
    name = Unicode()
    description = Pickle()
    gpg_key_info = Unicode()
    gpg_key_fingerprint = Unicode()
    gpg_key_status = Unicode()
    gpg_key_armor = Unicode()
    gpg_enable_notification = Bool()
    gpg_enable_files = Bool()
    receiver_level = Int()
    last_update = DateTime()
    tags = Pickle()
    tip_notification = Bool()
    file_notification = Bool()
    comment_notification = Bool()
    # + is added
    # message_notification = Bool()

    # this is going to be removed
    notification_fields = Pickle()
    # + and substituted without being a dict
    # mail_address = Unicode()

    can_delete_submission = Bool()
Example #4
0
class Receiver(Model):
    """
    name, description, password and notification_fields, can be changed
    by Receiver itself
    """
    __storm_table__ = 'receiver'

    user_id = Unicode()
    # Receiver.user = Reference(Receiver.user_id, User.id)

    name = Unicode(validator=shorttext_v)

    # localization string
    description = Pickle(validator=longlocal_v)

    # of GPG key fields
    gpg_key_info = Unicode()
    gpg_key_fingerprint = Unicode()
    gpg_key_status = Unicode()
    gpg_key_armor = Unicode()
    gpg_enable_notification = Bool()

    _gpg_types = [u'Disabled', u'Enabled']

    # Can be changed and can be different from username!
    mail_address = Unicode()

    # Admin chosen options
    can_delete_submission = Bool()
    postpone_superpower = Bool()

    # receiver_tier = 1 or 2. Mean being part of the first or second level
    # of receivers body. if threshold is configured in the context. default 1
    receiver_level = Int()

    last_update = DateTime()

    # Group which the Receiver is part of
    tags = Pickle()

    # personal advanced settings
    tip_notification = Bool()
    comment_notification = Bool()
    file_notification = Bool()
    message_notification = Bool()

    # contexts = ReferenceSet("Context.id",
    #                         "ReceiverContext.context_id",
    #                         "ReceiverContext.receiver_id",
    #                         "Receiver.id")

    presentation_order = Int()

    unicode_keys = ['name', 'mail_address']
    localized_strings = ['description']
    int_keys = ['receiver_level', 'presentation_order']
    bool_keys = [
        'can_delete_submission', 'tip_notification', 'comment_notification',
        'file_notification', 'message_notification', 'postpone_superpower'
    ]
Example #5
0
class Stats(Model):
    """
    Stats collection!
    """
    __storm_table__ = 'stats'

    content = Pickle()
Example #6
0
class InternalTip(Model):
    """
    This is the internal representation of a Tip that has been submitted to the
    GlobaLeaks node.

    It has a not associated map for keep track of Receivers, Tips,
    Comments and WhistleblowerTip.
    All of those element has a Storm Reference with the InternalTip.id,
    never vice-versa
    """
    __storm_table__ = 'internaltip'

    context_id = Unicode()
    #context = Reference(InternalTip.context_id, Context.id)
    #comments = ReferenceSet(InternalTip.id, Comment.internaltip_id)
    #receivertips = ReferenceSet(InternalTip.id, ReceiverTip.internaltip_id)
    #internalfiles = ReferenceSet(InternalTip.id, InternalFile.internaltip_id)
    #receivers = ReferenceSet(InternalTip.id, Receiver.id)

    wb_fields = Pickle(validator=dict_v)
    pertinence_counter = Int()
    expiration_date = DateTime()
    last_activity = DateTime()

    # the LIMITS are stored in InternalTip because and admin may
    # need change them. These values are copied by Context
    escalation_threshold = Int()
    access_limit = Int()
    download_limit = Int()

    mark = Unicode()

    _marker = [u'submission', u'finalize', u'first', u'second']
Example #7
0
class Comment_v_14(Model):
    __storm_table__ = 'comment'
    internaltip_id = Unicode()
    author = Unicode()
    content = Unicode()
    system_content = Pickle()
    type = Unicode()
    mark = Unicode()
Example #8
0
class Context_v_13(Model):
    __storm_table__ = 'context'
    unique_fields = Pickle()
    localized_fields = Pickle()
    selectable_receiver = Bool()
    escalation_threshold = Int()
    tip_max_access = Int()
    file_max_download = Int()
    file_required = Bool()
    tip_timetolive = Int()
    submission_timetolive = Int()
    last_update = DateTime()
    tags = Pickle()
    name = Pickle()
    description = Pickle()
    receiver_introduction = Pickle()
    fields_introduction = Pickle()
    select_all_receivers = Bool()
    postpone_superpower = Bool()
    can_delete_submission = Bool()
    maximum_selectable_receivers = Int()
    require_file_description = Bool()
    delete_consensus_percentage = Int()
    require_pgp = Bool()
    show_small_cards = Bool()
    show_receivers = Bool()
    presentation_order = Int()
Example #9
0
class Context_v_8(Model):
    """
    This model keeps track of specific contexts settings
    """
    __storm_table__ = 'context'
    unique_fields = Pickle()
    localized_fields = Pickle()
    selectable_receiver = Bool()
    escalation_threshold = Int()
    tip_max_access = Int()
    file_max_download = Int()
    file_required = Bool()
    tip_timetolive = Int()
    submission_timetolive = Int()
    receipt_regexp = Unicode()
    last_update = DateTime()
    tags = Pickle()
    name = Pickle()
    description = Pickle()
    receiver_introduction = Pickle()
    fields_introduction = Pickle()
    select_all_receivers = Bool()
    postpone_superpower = Bool()
    can_delete_submission = Bool()
    maximum_selectable_receivers = Int()
    require_file_description = Bool()
    delete_consensus_percentage = Int()
    require_pgp = Bool()
    show_small_cards = Bool()
Example #10
0
class ApplicationData(Model):
    """
    Exists only one instance of this class, because the ApplicationData
    had only one big updated blob.
    """
    __storm_table__ = 'applicationdata'

    version = Int()
    fields = Pickle()
Example #11
0
class SessionPkgData(Storm):
    """Data storage for a Session."""

    __storm_table__ = 'SessionPkgData'
    __storm_primary__ = 'client_id', 'product_id', 'key'

    client_id = Unicode()
    product_id = Unicode()
    key = Unicode()
    pickle = Pickle()
Example #12
0
class InternalTip_v_10(Model):  # no change at all!
    __storm_table__ = 'internaltip'
    context_id = Unicode()
    wb_fields = Pickle()
    pertinence_counter = Int()
    expiration_date = DateTime()
    last_activity = DateTime()
    escalation_threshold = Int()
    access_limit = Int()
    download_limit = Int()
    mark = Unicode()
Example #13
0
class Receiver_v_14(Model):
    __storm_table__ = 'receiver'
    user_id = Unicode()
    name = Unicode()
    description = Pickle()
    gpg_key_info = Unicode()
    gpg_key_fingerprint = Unicode()
    gpg_key_status = Unicode()
    gpg_key_armor = Unicode()
    gpg_enable_notification = Bool()
    mail_address = Unicode()
    can_delete_submission = Bool()
    postpone_superpower = Bool()
    receiver_level = Int()
    last_update = DateTime()
    tags = Pickle()
    tip_notification = Bool()
    comment_notification = Bool()
    file_notification = Bool()
    message_notification = Bool()
    presentation_order = Int()
Example #14
0
class Node_v_13(Model):
    __storm_table__ = 'node'
    name = Unicode()
    public_site = Unicode()
    hidden_service = Unicode()
    email = Unicode()
    receipt_salt = Unicode()
    last_update = DateTime()
    receipt_regexp = Unicode()
    languages_enabled = Pickle()
    default_language = Unicode()
    description = Pickle()
    presentation = Pickle()
    footer = Pickle()
    subtitle = Pickle()
    terms_and_conditions = Pickle()
    stats_update_time = Int()
    maximum_namesize = Int()
    maximum_textsize = Int()
    maximum_filesize = Int()
    tor2web_admin = Bool()
    tor2web_submission = Bool()
    tor2web_receiver = Bool()
    tor2web_unauth = Bool()
    allow_unencrypted = Bool()
    postpone_superpower = Bool()
    can_delete_submission = Bool()
    ahmia = Bool()
    wizard_done = Bool()
    anomaly_checks = Bool()
    exception_email = Unicode()
Example #15
0
class SessionPkgData(Storm):
    """Data storage for a Session."""

    classProvides(IUseSessionStore)
    implements(IUseSessionStore)

    __storm_table__ = 'SessionPkgData'
    __storm_primary__ = 'client_id', 'product_id', 'key'

    client_id = Unicode()
    product_id = Unicode()
    key = Unicode()
    pickle = Pickle()
Example #16
0
class Notification_version_7(Model):
    __storm_table__ = 'notification'
    server = Unicode()
    port = Int()
    username = Unicode()
    password = Unicode()
    source_name = Unicode()
    source_email = Unicode()
    security = Unicode()
    file_template = Pickle()
    comment_template = Pickle()
    file_mail_title = Pickle()
    comment_mail_title = Pickle()

    # those four template are removed
    tip_template = Pickle()
    tip_mail_title = Pickle()
    activation_template = Pickle()
    activation_mail_title = Pickle()
Example #17
0
class Context_version_7(Model):
    __storm_table__ = 'context'
    unique_fields = Pickle()
    localized_fields = Pickle()
    escalation_threshold = Int()
    tip_max_access = Int()
    file_max_download = Int()
    file_required = Bool()
    tip_timetolive = Int()
    submission_timetolive = Int()
    receipt_regexp = Unicode()
    last_update = DateTime()
    tags = Pickle()
    name = Pickle()
    description = Pickle()
    selectable_receiver = Bool()
    select_all_receivers = Bool()

    # these three fields are now removed
    receipt_description = Pickle()
    submission_introduction = Pickle()
    submission_disclaimer = Pickle()
Example #18
0
class Comment(Model):
    """
    This table handle the comment collection, has an InternalTip referenced
    """
    __storm_table__ = 'comment'

    internaltip_id = Unicode()

    author = Unicode()
    content = Unicode(validator=longtext_v)

    # In case of system_content usage, content has repr() equiv
    system_content = Pickle()

    type = Unicode()
    _types = [u'receiver', u'whistleblower', u'system']
    mark = Unicode()
    _marker = [
        u'not notified', u'notified', u'unable to notify', u'disabled',
        u'skipped'
    ]
Example #19
0
class Context_version_6(Model):
    __storm_table__ = 'context'

    # that's the change, from fields split in
    # localized_fields and unique_fields
    fields = Pickle()

    selectable_receiver = Bool()
    escalation_threshold = Int()
    tip_max_access = Int()
    file_max_download = Int()
    file_required = Bool()
    tip_timetolive = Int()
    submission_timetolive = Int()
    receipt_regexp = Unicode()
    last_update = DateTime()
    tags = Pickle()
    name = Pickle()
    description = Pickle()
    receipt_description = Pickle()
    submission_introduction = Pickle()
    submission_disclaimer = Pickle()
    select_all_receivers = Bool()
Example #20
0
class ApplicationData_version_10(Model):
    __storm_table__ = 'applicationdata'
    fields_version = Int()
    fields = Pickle()
Example #21
0
class Node(Model):
    """
    This table has only one instance, has the "id", but would not exists a second element
    of this table. This table acts, more or less, like the configuration file of the previous
    GlobaLeaks release (and some of the GL 0.1 details are specified in Context)

    This table represent the System-wide settings
    """
    __storm_table__ = 'node'

    name = Unicode(validator=shorttext_v)
    public_site = Unicode()
    hidden_service = Unicode()
    email = Unicode()
    receipt_salt = Unicode()
    last_update = DateTime()
    # this has a dedicated validator in update_node()
    receipt_regexp = Unicode()

    languages_enabled = Pickle()
    default_language = Unicode()

    # localized string
    description = Pickle(validator=longlocal_v)
    presentation = Pickle(validator=longlocal_v)
    footer = Pickle(validator=longlocal_v)
    subtitle = Pickle(validator=longlocal_v)

    # Here is set the time frame for the stats publicly exported by the node.
    # Expressed in hours
    stats_update_time = Int()

    # Advanced settings
    maximum_namesize = Int()
    maximum_textsize = Int()
    maximum_filesize = Int()
    tor2web_admin = Bool()
    tor2web_submission = Bool()
    tor2web_receiver = Bool()
    tor2web_unauth = Bool()
    allow_unencrypted = Bool()

    # privileges configurable in node/context/receiver
    postpone_superpower = Bool()
    can_delete_submission = Bool()
    ahmia = Bool()
    wizard_done = Bool(default=False)
    anomaly_checks = Bool(default=False)

    exception_email = Unicode()

    unicode_keys = [
        'name', 'public_site', 'email', 'hidden_service', 'exception_email',
        'default_language', 'receipt_regexp'
    ]
    int_keys = [
        'stats_update_time', 'maximum_namesize', 'maximum_textsize',
        'maximum_filesize'
    ]
    bool_keys = [
        'tor2web_admin', 'tor2web_receiver', 'tor2web_submission',
        'tor2web_unauth', 'postpone_superpower', 'anomaly_checks',
        'can_delete_submission', 'ahmia', 'allow_unencrypted'
    ]
    # wizard_done is not checked because it's set by the backend
    localized_strings = ['description', 'presentation', 'footer', 'subtitle']
Example #22
0
class Notification(Model):
    """
    This table has only one instance, and contain all the notification information
    for the node
    templates are imported in the handler, but settings are expected all at once
    """
    __storm_table__ = 'notification'

    server = Unicode()
    port = Int()
    username = Unicode()
    password = Unicode()

    source_name = Unicode(validator=shorttext_v)
    source_email = Unicode(validator=shorttext_v)

    security = Unicode()
    _security_types = [u'TLS', u'SSL']

    encrypted_tip_template = Pickle(validator=longlocal_v)
    encrypted_tip_mail_title = Pickle(validator=longlocal_v)
    plaintext_tip_template = Pickle(validator=longlocal_v)
    plaintext_tip_mail_title = Pickle(validator=longlocal_v)

    encrypted_file_template = Pickle(validator=longlocal_v)
    encrypted_file_mail_title = Pickle(validator=longlocal_v)
    plaintext_file_template = Pickle(validator=longlocal_v)
    plaintext_file_mail_title = Pickle(validator=longlocal_v)

    encrypted_comment_template = Pickle(validator=longlocal_v)
    encrypted_comment_mail_title = Pickle(validator=longlocal_v)
    plaintext_comment_template = Pickle(validator=longlocal_v)
    plaintext_comment_mail_title = Pickle(validator=longlocal_v)

    encrypted_message_template = Pickle(validator=longlocal_v)
    encrypted_message_mail_title = Pickle(validator=longlocal_v)
    plaintext_message_template = Pickle(validator=longlocal_v)
    plaintext_message_mail_title = Pickle(validator=longlocal_v)

    zip_description = Pickle(validator=longlocal_v)

    unicode_keys = [
        'server', 'username', 'password', 'source_name', 'source_email'
    ]
    localized_strings = [
        'encrypted_tip_template', 'encrypted_tip_mail_title',
        'plaintext_tip_template', 'plaintext_tip_mail_title',
        'encrypted_file_template', 'encrypted_file_mail_title',
        'plaintext_file_template', 'plaintext_file_mail_title',
        'encrypted_comment_template', 'encrypted_comment_mail_title',
        'plaintext_comment_template', 'plaintext_comment_mail_title',
        'encrypted_message_template', 'encrypted_message_mail_title',
        'plaintext_message_template', 'plaintext_message_mail_title',
        'zip_description'
    ]
    int_keys = ['port']
Example #23
0
class Notification_v_8(Model):
    __storm_table__ = 'notification'
    server = Unicode()
    port = Int()
    username = Unicode()
    password = Unicode()
    source_name = Unicode()
    source_email = Unicode()
    security = Unicode()
    encrypted_tip_template = Pickle()
    encrypted_tip_mail_title = Pickle()
    plaintext_tip_template = Pickle()
    plaintext_tip_mail_title = Pickle()
    zip_description = Pickle()

    # - these existent templates are renamed and duplicated
    file_template = Pickle()
    file_mail_title = Pickle()
    comment_template = Pickle()
    comment_mail_title = Pickle()
    message_template = Pickle()
    message_mail_title = Pickle()
Example #24
0
class Context(Model):
    """
    This model keeps track of specific contexts settings
    """
    __storm_table__ = 'context'

    # Unique fields is a dict with a unique ID as key,
    # and as value another dict, containing the field
    # descriptive values:
    # "presentation_order" : int
    # "preview" : bool
    # "required" : bool
    # "type" : unicode
    # "options" : dict (optional!)
    unique_fields = Pickle()

    # Localized fields is a dict having as keys, the same
    # keys of unique_fields, and as value a dict, containing:
    # 'name' : unicode
    # 'hint' : unicode
    localized_fields = Pickle()

    selectable_receiver = Bool()
    escalation_threshold = Int()

    tip_max_access = Int()
    file_max_download = Int()
    file_required = Bool()
    tip_timetolive = Int()
    submission_timetolive = Int()
    last_update = DateTime()
    tags = Pickle()

    # localized stuff
    name = Pickle(validator=shortlocal_v)
    description = Pickle(validator=longlocal_v)
    receiver_introduction = Pickle(validator=longlocal_v)
    fields_introduction = Pickle(validator=longlocal_v)

    #receivers = ReferenceSet(
    #                         Context.id,
    #                         ReceiverContext.context_id,
    #                         ReceiverContext.receiver_id,
    #                         Receiver.id)

    select_all_receivers = Bool()
    postpone_superpower = Bool()
    can_delete_submission = Bool()

    maximum_selectable_receivers = Int()
    require_file_description = Bool()
    delete_consensus_percentage = Int()
    require_pgp = Bool()
    show_small_cards = Bool()

    presentation_order = Int()

    unicode_keys = []
    localized_strings = [
        'name', 'description', 'receiver_introduction', 'fields_introduction'
    ]
    int_keys = [
        'escalation_threshold', 'tip_max_access', 'file_max_download',
        'maximum_selectable_receivers', 'delete_consensus_percentage',
        'presentation_order'
    ]
    bool_keys = [
        'selectable_receiver', 'file_required', 'select_all_receivers',
        'postpone_superpower', 'can_delete_submission',
        'require_file_description', 'require_pgp', 'show_small_cards'
    ]
Example #25
0
class Stats_v_14(Model):
    __storm_table__ = 'stats'
    content = Pickle()
Example #26
0
class Notification_v_14(Model):
    __storm_table__ = 'notification'
    server = Unicode()
    port = Int()
    username = Unicode()
    password = Unicode()
    source_name = Unicode()
    source_email = Unicode()
    security = Unicode()
    encrypted_tip_template = Pickle()
    encrypted_tip_mail_title = Pickle()
    plaintext_tip_template = Pickle()
    plaintext_tip_mail_title = Pickle()
    encrypted_file_template = Pickle()
    encrypted_file_mail_title = Pickle()
    plaintext_file_template = Pickle()
    plaintext_file_mail_title = Pickle()
    encrypted_comment_template = Pickle()
    encrypted_comment_mail_title = Pickle()
    plaintext_comment_template = Pickle()
    plaintext_comment_mail_title = Pickle()
    encrypted_message_template = Pickle()
    encrypted_message_mail_title = Pickle()
    plaintext_message_template = Pickle()
    plaintext_message_mail_title = Pickle()
    zip_description = Pickle()