Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/faq-updater/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Client } from "discord.js";
import { readFile } from "node:fs/promises";
import path from "node:path";

const client = new Client({
intents: [],
Expand Down Expand Up @@ -107,25 +108,33 @@ function splitMessage(message) {
}

async function getNewMessages() {
const rawContent = await readFile("../../wiki/FAQ.md", "utf8");
const [_frontmatter, rawQuestions] = rawContent.split("# FAQ", 2).map((section) => section.trim());
const faqPath = "../../wiki/FAQ.md";
const rawContent = await readFile(faqPath, "utf8");
const [_frontmatter, rawQuestions] = rawContent
.split("# FAQ", 2)
.map((section) => section.trim());
const baseUrl = "https://bluemap.bluecolored.de";
return rawQuestions
.replace(/{{site.baseurl}}/g, "https://bluemap.bluecolored.de")
.replace(/{{site.baseurl}}/g, baseUrl)
.split(/^###? /m)
.slice(1)
.flatMap((question) => {
const [title, ...lines] = question.trim().split("\n");
const content = lines
.join("\n")
.trimEnd()
.replace(/\n{2,}/g, s => "<br>".repeat(s.length))
.replace(/\s{2,}\n|\s*\\\n|\s*\n(?=\s*-)/g,"<br>")
.replace(/\n\s*/g," ")
.replace(/\n{2,}/g, (s) => "<br>".repeat(s.length))
.replace(/\s{2,}\n|\s*\\\n|\s*\n(?=\s*-)/g, "<br>")
.replace(/\n\s*/g, " ")
.replace(/<br>/g, "\n")
.replace(/\[([^\]]+)]\(([^)]+)\)/g, (_match, name, link) => {
if (name === link) return `<${link}>`;
if (link.startsWith("https://discord.com/channels/")) return link;
if (link.startsWith("#")) return name;
if (link.startsWith("#")) return `[${name}](<${baseUrl}/wiki/FAQ.html${link}>)`;
if (link.startsWith("."))
return `[${name}](<${baseUrl}/${path
.relative("../../", path.join(path.dirname(faqPath), link))
.replace(/\.md/, ".html")}>)`;
return `[${name}](<${link}>)`;
});
const message = `## ${title}\n${content}`;
Expand Down
2 changes: 1 addition & 1 deletion 3rdPartySupport.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ Reasons for a removal of an addon include:
- Malware, Spyware and other intentionally harmful software

If you feel like an addon on this list should be removed, please report it
on [Github](https://github.com/BlueMap-Minecraft/BlueMapWiki/issues/new) or [Discord](https://discord.gg/zmkyJa3)!
on [GitHub](https://github.com/BlueMap-Minecraft/BlueMapWiki/issues/new) or [Discord](https://discord.gg/zmkyJa3)!
2 changes: 1 addition & 1 deletion community/BluemapLazyServer.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ this work for `SQL`-type storage and uncompressed map data as well, but it will
extra work not covered by this guide.

Since we're going to be using an external webserver there's no need to expose the BlueMap integrated
webserver to the world. To make the server local-only, in `webserver.conf`, add `ip: "127.0.0.1"`
webserver to the world. To make the server local-only, in [`webserver.conf`](../wiki/configs/Webserver.md), add `ip: "127.0.0.1"`
just above the existing `port: <some port>` setting. Make a note of what `<some port>` is in your
config since you'll need it later.

Expand Down
4 changes: 2 additions & 2 deletions community/CaveRendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ nav_order: 3

## By default

By default BlueMap defines a cave as a place where the sun light is zero.
By default, BlueMap defines a cave as a place where the sunlight is zero.
To avoid removing important places which are just... dark,
BlueMap also relies on the height information of blocks.
By default in an overworld, BlueMap will only consider such blocks as "cave"
By default, in an overworld, BlueMap will only consider such blocks as "cave"
if they are below the y-level of 55 AND 5 blocks below the ocean-floor heightmap
(highest block which blocks motion).

Expand Down
49 changes: 25 additions & 24 deletions community/Chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ nav_order: 14
In the world of BlueMap where we have to support all these platforms and server configurations it is impossible to
write guides and addons that cover everyone's needs. That's why this guide will just go through an example case of
turning a regular old boring BlueMap installation on a Paper server running on a Debian VPS to a fancy one with
a web chat. You will most likely need to adapt this guide to your specific situation or find a more tech savvy friend
a web chat. You will most likely need to adapt this guide to your specific situation or find a more tech-savvy friend
to help you. You can also hire the writer of this guide ([Antti.Codes](https://antti.codes/)) for consultation for 90€/h.
Though as he is way too kind hearted he will help as much as possible on the `#3rd-party-support` channel in the official
BlueMap Discord for free.
Though as he is way too kind-hearted he will help as much as possible on the [`#3rd-party-support`](https://discord.com/channels/665868367416131594/863844716047106068) channel
in [the official BlueMap Discord](https://bluecolo.red/map-discord) for free.

## Requirements

Expand All @@ -30,7 +30,7 @@ Requirement keywords as per [RFC 2119](https://datatracker.ietf.org/doc/html/rfc
- You **MUST NOT** run a server network with Bungeecord, Velocity or similar. The addon only supports one global chat.
- You **SHOULD** have a public IP address. If you don't you will need to figure out exposing ports to the internet yourself.
- You **SHOULD** know the basics of navigating around the command line, otherwise this will be painful.
- You **SHOULD** have a domain. Have fun figuring out self signed certificates without a domain.
- You **SHOULD** have a domain. Have fun figuring out self-signed certificates without a domain.
- You **SHOULD NOT** run any chat plugins. The addon does not support them and the behaviour is undefined.
- You **MAY** grab a sysadmin friend to help you.

Expand All @@ -39,11 +39,11 @@ The guide assumes all the recommendations are followed.
## The starting situation

We've got a VPS running Debian. The VPS has a public IP. There is a Paper Minecraft server running on port `25565` and
BlueMap installed as a plugin running on port `8100`. The BlueMap is accesible at `http://12.34.56.789:8100/`.
BlueMap installed as a plugin running on port `8100`. The BlueMap is accessible at `http://12.34.56.789:8100/`.
In my case the Minecraft server is run with a Docker container as seen below.

![Contents of compose.yml and files in the data directory]({{site.baseurl}}/assets/chat/starting-situation.png)
![BlueMap already working at http://12.34.56.789:8100/]({{site.baseurl}}/assets/chat/bluemap-already-working.png)
![Contents of compose.yml and files in the data directory](../assets/chat/starting-situation.png)
![BlueMap already working at http://12.34.56.789:8100/](../assets/chat/bluemap-already-working.png)

## Proxying with nginx

Expand All @@ -52,7 +52,7 @@ This is needed as we want HTTPS, NGINX auth request module and combine many serv
Install NGINX using `sudo apt install -y nginx`.
You should now be able to observe NGINX working at `http://12.34.56.789/`

![Welcome to nginx!]({{site.baseurl}}/assets/chat/nginx-installed.png)
![Welcome to nginx!](../assets/chat/nginx-installed.png)

Next we should navigate to `/etc/nginx` to start configuring our fresh installation
We shall start by removing the default configuration files with `sudo rm -rf ./sites-available/default ./sites-enabled/default /var/www/html`
Expand All @@ -69,24 +69,25 @@ server {
}
```

Next we have to enable the create configuration file with `sudo ln -s ../sites-available/bluemap.conf ./sites-enabled/bluemap.conf`.
Next we have to enable the created configuration file with `sudo ln -s ../sites-available/bluemap.conf ./sites-enabled/bluemap.conf`.
Then after reloading NGINX with `sudo nginx -s reload` we should see our BlueMap at the location which had NGINX welcome page earlier.

![BlueMap running through nginx proxy]({{site.baseurl}}/assets/chat/http-proxied-bluemap.png)
![BlueMap running through nginx proxy](../assets/chat/http-proxied-bluemap.png)

As we no longer use BlueMap's own port for accessing it. We should prevent it from being exposed.
In our `compose.yml` file we can do `"127.0.0.1:8100:8100/tcp"` instead of `"8100:8100/tcp"`.
If you don't use Docker, instead of changing Docker's port bindings, change the IP address BlueMap uses by editing `plugins/BlueMap/webserver.conf` and adding `ip: "127.0.0.1"`.
If you don't use Docker, instead of changing Docker's port bindings,
change the IP address BlueMap uses by editing [`webserver.conf`](../wiki/configs/Webserver.md) and adding `ip: "127.0.0.1"`.

## Domain and HTTPS

Proxying is cool and all but it's pretty much a no-op right now.
So open up your DNS management interface, in my case Cloudflare, and add an A record for the IP address of the server.

![DNS record at Cloudflare]({{site.baseurl}}/assets/chat/dns-cloudflare.png)
![DNS record at Cloudflare](../assets/chat/dns-cloudflare.png)

Change the server name in NGINX `sites-available/bluemap.conf` file to match your chosen domain like this `server_name your.domain;`
The BlueMap should be accesible at the domain, just without HTTPS still.
The BlueMap should be accessible at the domain, just without HTTPS still.

To get the most out of our domain we want to use free SSL certificates to secure the connection. And to do that we need
a tool to acquire certificates, like `acme.sh`, which is really cool. To install `acme.sh` we want to change to root user
Expand All @@ -97,7 +98,7 @@ Run `acme.sh --issue --nginx -d your.domain` to acquire the certificates for you
Though these certificates are not ready for use yet.

First we want to prepare a couple of files and permissions so everything goes smoothly with NGINX.
Run the following commmands:
Run the following commands:

```sh
addgroup certs
Expand All @@ -111,7 +112,7 @@ chmod 770 /etc/nginx/certs
chmod 660 /etc/nginx/certs/*
```

These will setup a `certs` groups and a `certs` folder which only the users in the group (root and NGINX) are allowed to access.
These will set up a `certs` groups and a `certs` folder which only the users in the group (root and NGINX) are allowed to access.
Now we can install the certificates we acquired earlier:

```sh
Expand All @@ -121,7 +122,7 @@ acme.sh --install-cert -d your.domain \
--reloadcmd "systemctl reload nginx"
```

We can now logout of the root user and get back to our normal user (unless you just do everything on root anyway...).
We can now log out of the root user and get back to our normal user (unless you just do everything on root anyway...).
Let's revise the NGINX `sites-available/bluemap.conf` to use them.

```nginx
Expand All @@ -148,7 +149,7 @@ server {

After reloading NGINX with `sudo nginx -s reload` we should have a working BlueMap website with HTTPS. Hurray!

![BlueMap with HTTPS]({{site.baseurl}}/assets/chat/bluemap-with-https.png)
![BlueMap with HTTPS](../assets/chat/bluemap-with-https.png)

## Authentication

Expand All @@ -158,7 +159,7 @@ Copy them to the server plugins folder. You can do this with scp for example
`scp ~/Downloads/{Authentication,BlueMap-Auth}*.jar 12.34.56.789:~/minecraft-server/data/plugins`.
Do notice the above links are for specific releases used at the time of writing (v0.4.0 and v0.2.1),
there may be newer versions available that you may want to use. If you do use newer releases,
keep in mind that some steps might differ and you should refer to the official up-to-date documentation.
keep in mind that some steps might differ, and you should refer to the official up-to-date documentation.

Now let's restart the server to generate configuration files.
Edit `plugins/Authentication/config.yml` to have `optional_authentication: true`.
Expand Down Expand Up @@ -257,13 +258,13 @@ server {
}
```

Your BlueMap should now have a log in button in the menu.
Your BlueMap should now have a login button in the menu.

![A wild Log in button appears]({{site.baseurl}}/assets/chat/login-button.png)
![A wild Log in button appears](../assets/chat/login-button.png)

![The authentication screen]({{site.baseurl}}/assets/chat/authentication-screen.png)
![The authentication screen](../assets/chat/authentication-screen.png)

![BlueMap menu has your Minecraft head now]({{site.baseurl}}/assets/chat/logged-in-bluemap.png)
![BlueMap menu has your Minecraft head now](../assets/chat/logged-in-bluemap.png)

## Chat

Expand All @@ -286,9 +287,9 @@ Next, in the NGINX config, add the following above the "Other addons go here" te
}
```

![The chat in the webapp]({{site.baseurl}}/assets/chat/chat-in-web.png)
![The chat in the webapp](../assets/chat/chat-in-web.png)

![The chat in Minecraft]({{site.baseurl}}/assets/chat/chat-in-mc.png)
![The chat in Minecraft](../assets/chat/chat-in-mc.png)

## 🎉 You have successfully installed a fantastic web chat for BlueMap!!!
{: .no_toc }
36 changes: 18 additions & 18 deletions community/CloudflareR2.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Cloudflare R2 is a service that allows you to host files on Cloudflare's network
Go to Websites, click on “Add a site” then write your domain name.

1. “Select your plan”
- You can choose Free plan at the bottom.
- You can choose Free plan at the bottom.

2. “Review DNS records”
- You can skip it because we don't need to set a DNS for this method.
- You can skip it because we don't need to set a DNS for this method.

3. “Change your nameservers”
- Go to the site where you bought your domain and change nameservers to Cloudflare's nameservers.
- Go to the site where you bought your domain and change nameservers to Cloudflare's nameservers.


## Creating a bucket & uploading files with rclone
Expand Down Expand Up @@ -72,16 +72,16 @@ Go to Websites, click on “Add a site” then write your domain name.
2. Navigate in the terminal to the directory where your BlueMap *web* files are located. You should be in the directory that contains the file `index.html`.

3. Run the following command to upload the files to your R2 bucket:
```bash
rclone sync . R2:bluemap/ --transfers=60 --checkers=120 -P
```
- `rclone` — the program you are calling.
- `sync` — the command to synchronize files — files which are not present in the destination will be copied there and files which are not present in the source will be deleted in the destination.
- `.` — the current directory.
- `R2:bluemap/` — the remote you configured in the rclone configuration plus the name of your bucket.
- `--transfers=60` — the number of parallel transfers — BlueMap consists of numerous small files, so a high number of transfers is beneficial.
- `--checkers=120` — the number of parallel checks — BlueMap consists of numerous small files, so a high number of checks is beneficial. Checkers compare your local files to those remote.
- `-P` — shows you the progress.
```bash
rclone sync . R2:bluemap/ --transfers=60 --checkers=120 -P
```
- `rclone` — the program you are calling.
- `sync` — the command to synchronize files — files which are not present in the destination will be copied there and files which are not present in the source will be deleted in the destination.
- `.` — the current directory.
- `R2:bluemap/` — the remote you configured in the rclone configuration plus the name of your bucket.
- `--transfers=60` — the number of parallel transfers — BlueMap consists of numerous small files, so a high number of transfers is beneficial.
- `--checkers=120` — the number of parallel checks — BlueMap consists of numerous small files, so a high number of checks is beneficial. Checkers compare your local files to those remote.
- `-P` — shows you the progress.

4. While the files are uploading, you can continue with the next step.

Expand All @@ -96,7 +96,7 @@ Go to Websites, click on “Add a site” then write your domain name.
      3. In the first field select `URI Path` and in the Operator field select `ends with`. In the value field, enter `/`.
   2. Further down under Path, select `Rewrite to...`.
      1. In the first field select `Dynamic` and in the second field enter `concat(http.request.uri.path, "index.html")`.
   3. It should look similar to this: ![Screenshot of the index rule in Cloudflare]({{site.baseurl}}/assets/r2/index_rule.png)
   3. It should look similar to this: ![Screenshot of the index rule in Cloudflare](../assets/r2/index_rule.png)
   4. Save the rule.

3. Create another Transform rule here and give it a name, e.g. `BlueMap: gzip`. This rule allows Cloudflare to serve the compressed files when the textures or the .prbm files are requested.
Expand All @@ -110,7 +110,7 @@ Go to Websites, click on “Add a site” then write your domain name.
      7. In the first field select `URI Path` and in the Operator field select `ends with`. In the value field, enter `.prbm`.
   2. Further down under Path, select `Rewrite to...`.
      1. In the first field select `Dynamic` and in the second field enter `concat(http.request.uri.path, ".gz")`.
   3. It should look similar to this: ![Screenshot of the gzip rule in Cloudflare]({{site.baseurl}}/assets/r2/gzip_rule.png)
   3. It should look similar to this: ![Screenshot of the gzip rule in Cloudflare](../assets/r2/gzip_rule.png)
   4. Save the rule.

4. Now click on the `Modify Response Header` tab and create a new rule. This rule marks the compressed files as compressed, so your browser knows how to handle them when it requests them.
Expand All @@ -123,7 +123,7 @@ Go to Websites, click on “Add a site” then write your domain name.
      5.  In the first field, select `URI Path`. In the Operator field, select `ends with`. In the value field, enter `.prbm`.
   3. Further down under `Modify response header`.
      1. In the first field, select `Set static`. In the Header name field, enter `Content-Encoding`. In the Header value field, enter `gzip`.
   4. It should look similar to this: ![Screenshot of the Content-Encoding rule in Cloudflare]({{site.baseurl}}/assets/r2/encoding_rule.png)
   4. It should look similar to this: ![Screenshot of the Content-Encoding rule in Cloudflare](../assets/r2/encoding_rule.png)
   5. Save the rule.

## Making optional configurations
Expand All @@ -139,7 +139,7 @@ Every time a file is requested from your bucket, that counts as an operation. Ev
      1. Now select `Ignore cache-control header and use this TTL` and set `Input time-to-live (TTL)` to a value you are comfortable with. I set it to 1 year, this will cache the files on Cloudflare's edge servers for up to 1 year.
   5. Further down under `Browser TTL` click on `Add Setting`.
      1. Now select `Override origin and use this TTL` and set `Input time-to-live (TTL)` to a value you are comfortable with. I set it to 1 year, this will cache the files in the browser for up to 1 year.
   6. It should look similar to this: ![Screenshot of the Cache rule in Cloudflare]({{site.baseurl}}/assets/r2/cache_rule.png)
   6. It should look similar to this: ![Screenshot of the Cache rule in Cloudflare](../assets/r2/cache_rule.png)
   7. Save the rule.

2. If you have a paid plan, you can potentially use “Custom error responses” to change 404 errors to 204 errors as suggested by the [External Web server documentation]({{site.baseurl}}/wiki/webserver/ExternalWebserversFile). This is however, not necessary for BlueMap to work. Since this documentation is about Cloudflare R2 and the free domain plan, I will not go into detail about this.
2. If you have a paid plan, you can potentially use “Custom error responses” to change 404 errors to 204 errors as suggested by the [External Web server documentation](../wiki/webserver/ExternalWebserversFile.md). This is however, not necessary for BlueMap to work. Since this documentation is about Cloudflare R2 and the free domain plan, I will not go into detail about this.
Loading