Skip to content

Commit

Permalink
Add v1.3.4 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Feb 9, 2024
1 parent d789e6d commit bf0d036
Show file tree
Hide file tree
Showing 19 changed files with 522 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/matrix-media-repo/header.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<meta http-equiv="refresh" content="0; URL=v1.3.3">
<link rel="canonical" href="v1.3.3">
<meta http-equiv="refresh" content="0; URL=v1.3.4">
<link rel="canonical" href="v1.3.4">
11 changes: 11 additions & 0 deletions old_versions/matrix-media-repo/v1.3.4/assets/css/_vars.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:root {
--bg-color: #000;
--fg-color: #fff;
--bg-start-color: #2A1640;
--accent-color: #a254f5;
--accent-border-color: rgb(105, 105, 105, 0.9);
--fg-link-color: rgba(255, 255, 255, 0.75);
--fg-link-hover-color: #a254f5;
--fg-footer-color: rgba(255, 255, 255, 0.75);
--container-bg-color: #19191c;
}
96 changes: 96 additions & 0 deletions old_versions/matrix-media-repo/v1.3.4/assets/css/desktop.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
html {
height: 100%;
}

body {
margin: 0;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
line-height: 1.5;
font-family: 'Roboto', sans-serif;
color: var(--fg-color);

display: grid;
min-height: 100%;
grid-template-rows: 1fr auto;
}

h1, h2, h3, h4, h5, h6 {
font-family: 'Archivo Black', 'Roboto', sans-serif;
line-height: 1.4;
}

html,body {
background-color: var(--container-bg-color);
/* background: radial-gradient(84.9% 52.16% at 31.56% 3.43%, var(--bg-start-color) 0%, var(--bg-color) 100%); */
}

main {
width: 80%;
max-width: 1200px;
min-width: 300px;
margin-left: 32px;
margin-top: 32px;
margin-bottom: 64px;
}

header {
position: sticky;
top: 0;
left: 0;
right: 0;
padding: 32px 40px;
background: linear-gradient(135deg, var(--bg-start-color), var(--bg-color));
}

header .header-int {
display: flex;
flex-direction: row;
}

.header-int > p {
padding: 0;
margin: 0;
}

.header-int > p:first-child {
width: 203px; /* logo width */
}

.header-int > p:nth-child(2) {
width: 100%;
align-self: center;
text-align: right;
}

.header-int > p:nth-child(2) > a {
margin-left: 24px;
}

a {
text-decoration: none;
color: var(--fg-link-color);
transition: color 0.2s ease-in-out;
}

a:hover {
color: var(--fg-link-hover-color);
text-decoration: underline;
}

footer {
color: var(--fg-footer-color);
font-size: 14px;
text-align: center;
opacity: 0.5;
}

pre {
white-space: pre-wrap;
word-wrap: break-word;
display: inline-block;
}

pre, code {
font-family: 'Inconsolata', monospace;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.docs-page {
display: flex;
flex-direction: row;
}

.docs-page .toc {
width: 192px;
min-width: 192px;
border-right: 1px solid var(--accent-border-color);
padding: 8px 0;
}

.docs-page .toc .toc-link {
display: block;
padding: 4px 6px;
margin: 2px 4px;
border-left: 2px solid transparent;
}

.docs-page .toc .toc-link.current {
border-left: 2px solid var(--accent-color);
}

.docs-page .toc .toc-link.indent {
margin-left: 24px;
}

.docs-page .content {
padding: 8px 32px;
}

.docs-page .content > h1:first-child {
padding-top: 0;
margin-top: 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@media (max-width: 800px) {
.docs-page {
flex-direction: column;
}

.docs-page .toc {
width: 100%;
border-bottom: 1px solid var(--accent-border-color);
border-right: none;
padding-left: 16px;
padding-right: 16px;
margin-bottom: 16px;
}

.docs-page .content {
padding: 0;
}
}
24 changes: 24 additions & 0 deletions old_versions/matrix-media-repo/v1.3.4/assets/css/mobile.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@media (max-width: 800px) {
header .header-int {
flex-direction: column;
}

.header-int > p:nth-child(2) {
display: flex;
flex-direction: column;
margin-top: 8px;
}

.header-int > p:nth-child(2) > a {
display: flex;
flex-direction: column;
text-align: left;
margin: 0;
}

main {
margin-left: 40px;
margin-right: 40px;
margin-top: 0;
}
}
1 change: 1 addition & 0 deletions old_versions/matrix-media-repo/v1.3.4/assets/css/site.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html><html><head><title>docs.t2bot.io - matrix-media-repo - High Availability</title><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../.././assets/css/site.css"/></head><body><div class="top"><header role="banner"><div class="header-int"><p><a href="/"><img src="/assets/img/logo.png" alt="t2bot.io"></a></p>
<p><a href="https://matrix.to/#/#community:t2bot.io">#community:t2bot.io</a>
<a href="https://status.t2bot.io">status.t2bot.io</a>
<a href="https://matrix.to/#/#help:t2bot.io">#help:t2bot.io</a></p>
</div></header><main><div class="docs-page"><div class="toc"><a href="/matrix-media-repo/v1.3.4" class="toc-link">Introduction</a><a href="/matrix-media-repo/v1.3.4/developers" class="toc-link"> Developers</a><a href="/matrix-media-repo/v1.3.4/installation" class="toc-link">Installation</a><a href="/matrix-media-repo/v1.3.4/installation/config" class="toc-link indent"> Configuration</a><a href="/matrix-media-repo/v1.3.4/installation/server-names" class="toc-link indent"> Server Names</a><a href="/matrix-media-repo/v1.3.4/installation/methods" class="toc-link indent"> Methods</a><a href="/matrix-media-repo/v1.3.4/deployment" class="toc-link"> Deployment</a><a href="/matrix-media-repo/v1.3.4/deployment/horizontal-scaling" class="toc-link indent"> Horizontal Scaling</a><a href="/matrix-media-repo/v1.3.4/deployment/high-availability" class="toc-link current indent"> High Availability</a><a href="/matrix-media-repo/v1.3.4/upgrading" class="toc-link"> Upgrading</a><a href="/matrix-media-repo/v1.3.4/upgrading/to-130" class="toc-link indent"> Upgrading to v1.3.0</a></div><div class="content"><h1 id="high-availability">High Availability</h1>
<p>MMR supports horizontal scaling and by consequence high availability capabilities as well. Near-zero
downtime can be achieved by employing rolling upgrades of a horizontally-scaled cluster.</p>
<p>In all cases, machine ID <code>0</code> <em>must</em> be updated first, however all other processes can be updated in
any order.</p>
<p>For a given version number <code>vX.Y.Z</code>:</p>
<ul>
<li>A change in <code>X</code> indicates a <em>breaking change</em> to MMR. The entire cluster should be brought offline
to perform the upgrade. Check the upgrade notes for further guidance on zero-downtime upgrades to
this version.</li>
<li>A change in <code>Y</code> indicates a <em>large but backwards compatible change</em> to MMR. The cluster should be
upgraded quickly, but does not need to be taken offline first. A higher volume of errors may happen
while the cluster is upgraded.</li>
<li>A change in <code>Z</code> indicates a <em>patch or otherwise small backwards compatible change</em> to MMR. The
cluster can be upgraded more slowly, and does not need to be taken offline first.</li>
</ul>
</div></div></main></div><footer><p>Copyright ©️ 2024 - t2bot.io / Travis Ralston</p>
</footer></body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html><html><head><title>docs.t2bot.io - matrix-media-repo - Horizontal Scaling</title><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../.././assets/css/site.css"/></head><body><div class="top"><header role="banner"><div class="header-int"><p><a href="/"><img src="/assets/img/logo.png" alt="t2bot.io"></a></p>
<p><a href="https://matrix.to/#/#community:t2bot.io">#community:t2bot.io</a>
<a href="https://status.t2bot.io">status.t2bot.io</a>
<a href="https://matrix.to/#/#help:t2bot.io">#help:t2bot.io</a></p>
</div></header><main><div class="docs-page"><div class="toc"><a href="/matrix-media-repo/v1.3.4" class="toc-link">Introduction</a><a href="/matrix-media-repo/v1.3.4/developers" class="toc-link"> Developers</a><a href="/matrix-media-repo/v1.3.4/installation" class="toc-link">Installation</a><a href="/matrix-media-repo/v1.3.4/installation/config" class="toc-link indent"> Configuration</a><a href="/matrix-media-repo/v1.3.4/installation/server-names" class="toc-link indent"> Server Names</a><a href="/matrix-media-repo/v1.3.4/installation/methods" class="toc-link indent"> Methods</a><a href="/matrix-media-repo/v1.3.4/deployment" class="toc-link"> Deployment</a><a href="/matrix-media-repo/v1.3.4/deployment/horizontal-scaling" class="toc-link current indent"> Horizontal Scaling</a><a href="/matrix-media-repo/v1.3.4/deployment/high-availability" class="toc-link indent"> High Availability</a><a href="/matrix-media-repo/v1.3.4/upgrading" class="toc-link"> Upgrading</a><a href="/matrix-media-repo/v1.3.4/upgrading/to-130" class="toc-link indent"> Upgrading to v1.3.0</a></div><div class="content"><h1 id="horizontal-scaling">Horizontal Scaling</h1>
<p>MMR&#39;s horizontal scaling is achieved through the <code>MACHINE_ID</code> environment variable. The default machine
ID is <code>0</code>, and is responsible for all background tasks. Each deployed process <em>must</em> have a distinct
machine ID in order to function. The machine ID <em>must</em> be between <code>0</code> and <code>1023</code>, allowing for a
total of 1024 &quot;workers&quot;.</p>
<p>All MMR processes <em>must</em> additionally share the same config files, database, and Redis backend. The
Redis server is used for inter-process communication. Once set up, any MMR process in the cluster can
handle any request for load balancing.</p>
<p>Typically, it is expected that there be roughly aligned &quot;sub-clusters&quot;: a set of processes dedicated
to handling each of downloads, uploads, URL previews, etc. At a minimum, it is best to at least split
URL previews off to a dedicated process to avoid network request congestion. Admin APIs are best routed
to machine ID <code>0</code>.</p>
<p>Thumbnails are recommended to be moved to high-memory machines where possible in high-traffic environments.</p>
<p>The number of machines/processes needed largely depends on the number of homeservers being hosted by
a single cluster. For approximately every 500 homeservers there should be 1 additional MMR process,
rounded up (assuming each process doesn&#39;t have a dedicated purpose).</p>
<p>Horizontal scaling is <em>possible</em> with file-backed datastores, however all processes need to have access
to the directory at the exact same path. It is instead suggested to use exclusively S3 datastores, where
all processes can more easily fetch contents.</p>
</div></div></main></div><footer><p>Copyright ©️ 2024 - t2bot.io / Travis Ralston</p>
</footer></body></html>
45 changes: 45 additions & 0 deletions old_versions/matrix-media-repo/v1.3.4/deployment/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html><html><head><title>docs.t2bot.io - matrix-media-repo - Deployment</title><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href=".././assets/css/site.css"/></head><body><div class="top"><header role="banner"><div class="header-int"><p><a href="/"><img src="/assets/img/logo.png" alt="t2bot.io"></a></p>
<p><a href="https://matrix.to/#/#community:t2bot.io">#community:t2bot.io</a>
<a href="https://status.t2bot.io">status.t2bot.io</a>
<a href="https://matrix.to/#/#help:t2bot.io">#help:t2bot.io</a></p>
</div></header><main><div class="docs-page"><div class="toc"><a href="/matrix-media-repo/v1.3.4" class="toc-link">Introduction</a><a href="/matrix-media-repo/v1.3.4/developers" class="toc-link"> Developers</a><a href="/matrix-media-repo/v1.3.4/installation" class="toc-link">Installation</a><a href="/matrix-media-repo/v1.3.4/installation/config" class="toc-link indent"> Configuration</a><a href="/matrix-media-repo/v1.3.4/installation/server-names" class="toc-link indent"> Server Names</a><a href="/matrix-media-repo/v1.3.4/installation/methods" class="toc-link indent"> Methods</a><a href="/matrix-media-repo/v1.3.4/deployment" class="toc-link current"> Deployment</a><a href="/matrix-media-repo/v1.3.4/deployment/horizontal-scaling" class="toc-link indent"> Horizontal Scaling</a><a href="/matrix-media-repo/v1.3.4/deployment/high-availability" class="toc-link indent"> High Availability</a><a href="/matrix-media-repo/v1.3.4/upgrading" class="toc-link"> Upgrading</a><a href="/matrix-media-repo/v1.3.4/upgrading/to-130" class="toc-link indent"> Upgrading to v1.3.0</a></div><div class="content"><h1 id="deployment">Deployment</h1>
<p>MMR sits between your reverse proxy and underlying homeserver software, such as Synapse or Dendrite.
This allows clients to continue making requests to the server without needing to know of an alternative
media handling setup.</p>
<p>The easiest way to deploy MMR is to route all <code>/_matrix/media</code> endpoints to the MMR process. Note that
with <a href="https://github.com/matrix-org/matrix-spec-proposals/pull/3911">MSC3911</a> and <a href="https://github.com/matrix-org/matrix-spec-proposals/pull/3916">MSC3916</a>,
the specific set of endpoints may change.</p>
<p>An example NGINX config would be:</p>
<pre><code>server {
listen 443 ssl;
listen [::]:443 ssl;

# SSL options not shown - ensure the certificates are valid for your
# homeserver deployment.

# Redirect all traffic by default to the homeserver
location /_matrix {
proxy_read_timeout 60s;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8008; # Point this towards your homeserver
}

# Redirect all media endpoints to MMR
location /_matrix/media {
proxy_read_timeout 60s;

# Make sure this matches your homeserver in your MMR config
# You may have to manually specify it if using delegation or the
# incoming `Host` doesn&#39;t match.
proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8000; # Point this towards media-repo
}
}
</code></pre>
</div></div></main></div><footer><p>Copyright ©️ 2024 - t2bot.io / Travis Ralston</p>
</footer></body></html>
Loading

0 comments on commit bf0d036

Please sign in to comment.