self.blacklist = Blacklist(fn)
def init_nodemaker(self):
- default = self.get_config("client", "mutable.format", default="SDMF")
+ default = self.get_config("client", "mutable.format", default="MDMF")
if default.upper() == "MDMF":
self.mutable_file_default = MDMF_VERSION
else:
MAX_MUTABLE_SHARE_SIZE = 69105*1000*1000*1000*1000 # 69105 TB, kind of arbitrary
-# These are still used for some tests of SDMF files.
+# These are still used for some tests.
def unpack_header(data):
o = {}
(version,
f = open(fn, "rb")
f.seek(m.DATA_OFFSET)
data = f.read(2000)
- # make sure this slot contains an SMDF share
- assert data[0] == "\x00", "non-SDMF mutable shares not supported"
f.close()
(version, ig_seqnum, ig_roothash, ig_IV, ig_k, ig_N, ig_segsize,
ig_datalen, offsets) = unpack_header(data)
- assert version == 0, "we only handle v0 SDMF files"
start = m.DATA_OFFSET + offsets["share_data"]
end = m.DATA_OFFSET + offsets["enc_privkey"]
flip_bit(start, end)
from allmydata.uri import from_string_dirnode
from allmydata.interfaces import IDirectoryNode, IFileNode, IFilesystemNode, \
IImmutableFileNode, IMutableFileNode, ExistingChildError, \
- NoSuchChildError, EmptyPathnameComponentError, SDMF_VERSION, MDMF_VERSION
+ NoSuchChildError, EmptyPathnameComponentError, MDMF_VERSION, SDMF_VERSION
from allmydata.blacklist import ProhibitedNode
from allmydata.monitor import Monitor, OperationCancelledError
from allmydata import dirnode
if self.dirnode_children is None:
return T.div["No upload forms: directory is unreadable"]
+ mkdir_mdmf = T.input(type='radio', name='format',
+ value='mdmf', id='mkdir-mdmf')
mkdir_sdmf = T.input(type='radio', name='format',
value='sdmf', id='mkdir-sdmf',
checked='checked')
- mkdir_mdmf = T.input(type='radio', name='format',
- value='mdmf', id='mkdir-mdmf')
mkdir_form = T.form(action=".", method="post",
enctype="multipart/form-data")[
"New directory name:"+SPACE, T.br,
T.input(type="text", name="name"), SPACE,
T.div(class_="form-inline")[
- mkdir_sdmf, T.label(for_='mutable-directory-sdmf')[SPACE, "SDMF"], SPACE*2,
- mkdir_mdmf, T.label(for_='mutable-directory-mdmf')[SPACE, "MDMF (experimental)"]
+ mkdir_mdmf, T.label(for_='mutable-directory-mdmf')[SPACE, "MDMF"], SPACE*2,
+ mkdir_sdmf, T.label(for_='mutable-directory-sdmf')[SPACE, "SDMF"]
],
T.input(type="submit", class_="btn", value="Create")
]]
upload_chk = T.input(type='radio', name='format',
value='chk', id='upload-chk',
checked='checked')
- upload_sdmf = T.input(type='radio', name='format',
- value='sdmf', id='upload-sdmf')
upload_mdmf = T.input(type='radio', name='format',
value='mdmf', id='upload-mdmf')
+ upload_sdmf = T.input(type='radio', name='format',
+ value='sdmf', id='upload-sdmf')
upload_form = T.form(action=".", method="post",
enctype="multipart/form-data")[
T.input(type="file", name="file", class_="freeform-input-file"), SPACE,
T.div(class_="form-inline")[
upload_chk, T.label(for_="upload-chk") [SPACE, "Immutable"], SPACE*2,
- upload_sdmf, T.label(for_="upload-sdmf")[SPACE, "SDMF"], SPACE*2,
- upload_mdmf, T.label(for_="upload-mdmf")[SPACE, "MDMF (experimental)"]
+ upload_mdmf, T.label(for_="upload-mdmf")[SPACE, "MDMF"], SPACE*2,
+ upload_sdmf, T.label(for_="upload-sdmf")[SPACE, "SDMF"]
],
T.input(type="submit", class_="btn", value="Upload"), SPACE*2,
]]
def render_upload_form(self, ctx, data):
# This is a form where users can upload unlinked files.
- # Users can choose immutable, SDMF, or MDMF from a radio button.
+ # Users can choose immutable, MDMF, or SDMF from a radio button.
upload_chk = T.input(type='radio', name='format',
value='chk', id='upload-chk',
checked='checked')
- upload_sdmf = T.input(type='radio', name='format',
- value='sdmf', id='upload-sdmf')
upload_mdmf = T.input(type='radio', name='format',
value='mdmf', id='upload-mdmf')
+ upload_sdmf = T.input(type='radio', name='format',
+ value='sdmf', id='upload-sdmf')
form = T.form(action="uri", method="post",
enctype="multipart/form-data")[
T.div["Choose a file:"+SPACE,
T.input(type="file", name="file", class_="freeform-input-file")],
T.input(type="hidden", name="t", value="upload"),
- T.div[upload_chk, T.label(for_="upload-chk") [" Immutable"], SPACE,
- upload_sdmf, T.label(for_="upload-sdmf")[" SDMF"], SPACE,
- upload_mdmf, T.label(for_="upload-mdmf")[" MDMF (experimental)"], SPACE*2,
+ T.div[upload_chk, T.label(for_="upload-chk") [" Immutable"], SPACE,
+ upload_mdmf, T.label(for_="upload-mdmf")[" MDMF"], SPACE,
+ upload_sdmf, T.label(for_="upload-sdmf")[" SDMF"], SPACE*2,
T.input(type="submit", value="Upload!")],
]]
return T.div[form]
# This is a form where users can create new directories.
# Users can choose SDMF or MDMF from a radio button.
- mkdir_sdmf = T.input(type='radio', name='format',
- value='sdmf', id='mkdir-sdmf',
- checked='checked')
mkdir_mdmf = T.input(type='radio', name='format',
- value='mdmf', id='mkdir-mdmf')
+ value='mdmf', id='mkdir-mdmf',
+ checked='checked')
+ mkdir_sdmf = T.input(type='radio', name='format',
+ value='sdmf', id='mkdir-sdmf')
form = T.form(action="uri", method="post",
enctype="multipart/form-data")[
T.fieldset[
T.legend(class_="freeform-form-label")["Create a directory"],
- mkdir_sdmf, T.label(for_='mkdir-sdmf')[" SDMF"], SPACE,
- mkdir_mdmf, T.label(for_='mkdir-mdmf')[" MDMF (experimental)"], SPACE*2,
+ mkdir_mdmf, T.label(for_='mkdir-mdmf')[" MDMF"], SPACE,
+ mkdir_sdmf, T.label(for_='mkdir-sdmf')[" SDMF"], SPACE*2,
T.input(type="hidden", name="t", value="mkdir"),
T.input(type="hidden", name="redirect_to_result", value="true"),
T.input(type="submit", value="Create a directory"),
Immutable
</label>
+ <label for="upload-mdmf" class="radio">
+ <input type="radio" id="upload-mdmf" value="mdmf" name="format" />
+ <acronym title="Medium Distributed Mutable File">MDMF</acronym>
+ </label>
+
<label for="upload-sdmf" class="radio">
<input type="radio" id="upload-sdmf" value="sdmf" name="format" />
<acronym title="Small Distributed Mutable File">SDMF</acronym>
</label>
- <label for="upload-mdmf" class="radio">
- <input type="radio" id="upload-mdmf" value="mdmf" name="format" />
- <acronym title="Medium Distributed Mutable File">MDMF</acronym> (experimental)
- </label>
-
<p><input type="submit" class="btn" value="Upload File »" /></p>
</form>
</div>
<div class="nav-header">Create Directory</div>
<div class="nav-form">
<form action="uri" method="post" enctype="multipart/form-data">
+ <label for="mkdir-mdmf" class="radio">
+ <input type="radio" id="mkdir-mdmf" value="mdmf" name="format" />
+ <acronym title="Medium Distributed Mutable File">MDMF</acronym>
+ </label>
+
<label for="mkdir-sdmf" class="radio">
<input type="radio" checked="checked" id="mkdir-sdmf" value="sdmf" name="format" />
<acronym title="Small Distributed Mutable File">SDMF</acronym>
</label>
- <label for="mkdir-mdmf" class="radio">
- <input type="radio" id="mkdir-mdmf" value="mdmf" name="format" />
- <acronym title="Medium Distributed Mutable File">MDMF</acronym> (experimental)
- </label>
-
<input type="hidden" name="t" value="mkdir" />
<input type="hidden" name="redirect_to_result" value="true" />
<input type="submit" class="btn" value="Create a directory »" />