This commit is contained in:
clokep 2023-02-23 18:15:06 +00:00
parent f87c322606
commit 74fc47b19e
4 changed files with 110 additions and 34 deletions

View file

@ -15185,13 +15185,51 @@ a temporary directory (which starts with &quot;synapse-exfiltrate&quot;) in <cod
│ ├───state │ ├───state
│ ├───invite_state │ ├───invite_state
│ └───knock_state │ └───knock_state
└───user_data ├───user_data
├───account_data │ ├───account_data
│ ├───global │ │ ├───global
│ └───&lt;room_id&gt; │ │ └───&lt;room_id&gt;
├───connections │ ├───connections
├───devices │ ├───devices
└───profile │ └───profile
└───media_ids
└───&lt;media_id&gt;
</code></pre>
<p>The <code>media_ids</code> folder contains only the metadata of the media uploaded by the user.
It does not contain the media itself.
Furthermore, only the <code>media_ids</code> that Synapse manages itself are exported.
If another media repository (e.g. <a href="https://github.com/turt2live/matrix-media-repo">matrix-media-repo</a>)
is used, the data must be exported separately.</p>
<p>With the <code>media_ids</code> the media files can be downloaded.
Media that have been sent in encrypted rooms are only retrieved in encrypted form.
The following script can help with download the media files:</p>
<pre><code class="language-bash">#!/usr/bin/env bash
# Parameters
#
# source_directory: Directory which contains the export with the media_ids.
# target_directory: Directory into which all files are to be downloaded.
# repository_url: Address of the media repository resp. media worker.
# serverName: Name of the server (`server_name` from homeserver.yaml).
#
# Example:
# ./download_media.sh /tmp/export_data/media_ids/ /tmp/export_data/media_files/ http://localhost:8008 matrix.example.com
source_directory=$1
target_directory=$2
repository_url=$3
serverName=$4
mkdir -p $target_directory
for file in $source_directory/*; do
filename=$(basename ${file})
url=$repository_url/_matrix/media/v3/download/$serverName/$filename
echo &quot;Downloading $filename - $url&quot;
if ! wget -o /dev/null -P $target_directory $url; then
echo &quot;Could not download $filename&quot;
fi
done
</code></pre> </code></pre>
<h2 id="manually-resetting-passwords"><a class="header" href="#manually-resetting-passwords">Manually resetting passwords</a></h2> <h2 id="manually-resetting-passwords"><a class="header" href="#manually-resetting-passwords">Manually resetting passwords</a></h2>
<p>Users can reset their password through their client. Alternatively, a server admin <p>Users can reset their password through their client. Alternatively, a server admin

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -193,13 +193,51 @@ a temporary directory (which starts with &quot;synapse-exfiltrate&quot;) in <cod
│ ├───state │ ├───state
│ ├───invite_state │ ├───invite_state
│ └───knock_state │ └───knock_state
└───user_data ├───user_data
├───account_data │ ├───account_data
│ ├───global │ │ ├───global
│ └───&lt;room_id&gt; │ │ └───&lt;room_id&gt;
├───connections │ ├───connections
├───devices │ ├───devices
└───profile │ └───profile
└───media_ids
└───&lt;media_id&gt;
</code></pre>
<p>The <code>media_ids</code> folder contains only the metadata of the media uploaded by the user.
It does not contain the media itself.
Furthermore, only the <code>media_ids</code> that Synapse manages itself are exported.
If another media repository (e.g. <a href="https://github.com/turt2live/matrix-media-repo">matrix-media-repo</a>)
is used, the data must be exported separately.</p>
<p>With the <code>media_ids</code> the media files can be downloaded.
Media that have been sent in encrypted rooms are only retrieved in encrypted form.
The following script can help with download the media files:</p>
<pre><code class="language-bash">#!/usr/bin/env bash
# Parameters
#
# source_directory: Directory which contains the export with the media_ids.
# target_directory: Directory into which all files are to be downloaded.
# repository_url: Address of the media repository resp. media worker.
# serverName: Name of the server (`server_name` from homeserver.yaml).
#
# Example:
# ./download_media.sh /tmp/export_data/media_ids/ /tmp/export_data/media_files/ http://localhost:8008 matrix.example.com
source_directory=$1
target_directory=$2
repository_url=$3
serverName=$4
mkdir -p $target_directory
for file in $source_directory/*; do
filename=$(basename ${file})
url=$repository_url/_matrix/media/v3/download/$serverName/$filename
echo &quot;Downloading $filename - $url&quot;
if ! wget -o /dev/null -P $target_directory $url; then
echo &quot;Could not download $filename&quot;
fi
done
</code></pre> </code></pre>
<h2 id="manually-resetting-passwords"><a class="header" href="#manually-resetting-passwords">Manually resetting passwords</a></h2> <h2 id="manually-resetting-passwords"><a class="header" href="#manually-resetting-passwords">Manually resetting passwords</a></h2>
<p>Users can reset their password through their client. Alternatively, a server admin <p>Users can reset their password through their client. Alternatively, a server admin