Skip to content

Commit 25ae29a

Browse files
authored
Merge pull request #141 from TechnicJelle/master
2 parents 71b4d1f + f5d79fb commit 25ae29a

31 files changed

+174
-164
lines changed

.github/faq-updater/index.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Client } from "discord.js";
22
import { readFile } from "node:fs/promises";
3+
import path from "node:path";
34

45
const client = new Client({
56
intents: [],
@@ -107,25 +108,33 @@ function splitMessage(message) {
107108
}
108109

109110
async function getNewMessages() {
110-
const rawContent = await readFile("../../wiki/FAQ.md", "utf8");
111-
const [_frontmatter, rawQuestions] = rawContent.split("# FAQ", 2).map((section) => section.trim());
111+
const faqPath = "../../wiki/FAQ.md";
112+
const rawContent = await readFile(faqPath, "utf8");
113+
const [_frontmatter, rawQuestions] = rawContent
114+
.split("# FAQ", 2)
115+
.map((section) => section.trim());
116+
const baseUrl = "https://bluemap.bluecolored.de";
112117
return rawQuestions
113-
.replace(/{{site.baseurl}}/g, "https://bluemap.bluecolored.de")
118+
.replace(/{{site.baseurl}}/g, baseUrl)
114119
.split(/^###? /m)
115120
.slice(1)
116121
.flatMap((question) => {
117122
const [title, ...lines] = question.trim().split("\n");
118123
const content = lines
119124
.join("\n")
120125
.trimEnd()
121-
.replace(/\n{2,}/g, s => "<br>".repeat(s.length))
122-
.replace(/\s{2,}\n|\s*\\\n|\s*\n(?=\s*-)/g,"<br>")
123-
.replace(/\n\s*/g," ")
126+
.replace(/\n{2,}/g, (s) => "<br>".repeat(s.length))
127+
.replace(/\s{2,}\n|\s*\\\n|\s*\n(?=\s*-)/g, "<br>")
128+
.replace(/\n\s*/g, " ")
124129
.replace(/<br>/g, "\n")
125130
.replace(/\[([^\]]+)]\(([^)]+)\)/g, (_match, name, link) => {
126131
if (name === link) return `<${link}>`;
127132
if (link.startsWith("https://discord.com/channels/")) return link;
128-
if (link.startsWith("#")) return name;
133+
if (link.startsWith("#")) return `[${name}](<${baseUrl}/wiki/FAQ.html${link}>)`;
134+
if (link.startsWith("."))
135+
return `[${name}](<${baseUrl}/${path
136+
.relative("../../", path.join(path.dirname(faqPath), link))
137+
.replace(/\.md/, ".html")}>)`;
129138
return `[${name}](<${link}>)`;
130139
});
131140
const message = `## ${title}\n${content}`;

3rdPartySupport.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ Reasons for a removal of an addon include:
4646
- Malware, Spyware and other intentionally harmful software
4747

4848
If you feel like an addon on this list should be removed, please report it
49-
on [Github](https://github.com/BlueMap-Minecraft/BlueMapWiki/issues/new) or [Discord](https://discord.gg/zmkyJa3)!
49+
on [GitHub](https://github.com/BlueMap-Minecraft/BlueMapWiki/issues/new) or [Discord](https://discord.gg/zmkyJa3)!

community/BluemapLazyServer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ this work for `SQL`-type storage and uncompressed map data as well, but it will
4141
extra work not covered by this guide.
4242

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

community/CaveRendering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ nav_order: 3
1313

1414
## By default
1515

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

community/Chat.md

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

2424
## Requirements
2525

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

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

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

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

4848
## Proxying with nginx
4949

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

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

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

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

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

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

8182
## Domain and HTTPS
8283

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

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

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

9192
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
9293
a tool to acquire certificates, like `acme.sh`, which is really cool. To install `acme.sh` we want to change to root user
@@ -97,7 +98,7 @@ Run `acme.sh --issue --nginx -d your.domain` to acquire the certificates for you
9798
Though these certificates are not ready for use yet.
9899

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

102103
```sh
103104
addgroup certs
@@ -111,7 +112,7 @@ chmod 770 /etc/nginx/certs
111112
chmod 660 /etc/nginx/certs/*
112113
```
113114

114-
These will setup a `certs` groups and a `certs` folder which only the users in the group (root and NGINX) are allowed to access.
115+
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.
115116
Now we can install the certificates we acquired earlier:
116117

117118
```sh
@@ -121,7 +122,7 @@ acme.sh --install-cert -d your.domain \
121122
--reloadcmd "systemctl reload nginx"
122123
```
123124

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

127128
```nginx
@@ -148,7 +149,7 @@ server {
148149

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

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

153154
## Authentication
154155

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

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

260-
Your BlueMap should now have a log in button in the menu.
261+
Your BlueMap should now have a login button in the menu.
261262

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

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

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

268269
## Chat
269270

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

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

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

293294
## 🎉 You have successfully installed a fantastic web chat for BlueMap!!!
294295
{: .no_toc }

community/CloudflareR2.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ Cloudflare R2 is a service that allows you to host files on Cloudflare's network
3434
Go to Websites, click on “Add a site” then write your domain name.
3535

3636
1. “Select your plan”
37-
- You can choose Free plan at the bottom.
37+
- You can choose Free plan at the bottom.
3838

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

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

4545

4646
## Creating a bucket & uploading files with rclone
@@ -72,16 +72,16 @@ Go to Websites, click on “Add a site” then write your domain name.
7272
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`.
7373

7474
3. Run the following command to upload the files to your R2 bucket:
75-
```bash
76-
rclone sync . R2:bluemap/ --transfers=60 --checkers=120 -P
77-
```
78-
- `rclone` — the program you are calling.
79-
- `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.
80-
- `.` — the current directory.
81-
- `R2:bluemap/` — the remote you configured in the rclone configuration plus the name of your bucket.
82-
- `--transfers=60` — the number of parallel transfers — BlueMap consists of numerous small files, so a high number of transfers is beneficial.
83-
- `--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.
84-
- `-P` — shows you the progress.
75+
```bash
76+
rclone sync . R2:bluemap/ --transfers=60 --checkers=120 -P
77+
```
78+
- `rclone` — the program you are calling.
79+
- `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.
80+
- `.` — the current directory.
81+
- `R2:bluemap/` — the remote you configured in the rclone configuration plus the name of your bucket.
82+
- `--transfers=60` — the number of parallel transfers — BlueMap consists of numerous small files, so a high number of transfers is beneficial.
83+
- `--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.
84+
- `-P` — shows you the progress.
8585

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

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

102102
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.
@@ -110,7 +110,7 @@ Go to Websites, click on “Add a site” then write your domain name.
110110
      7. In the first field select `URI Path` and in the Operator field select `ends with`. In the value field, enter `.prbm`.
111111
   2. Further down under Path, select `Rewrite to...`.
112112
      1. In the first field select `Dynamic` and in the second field enter `concat(http.request.uri.path, ".gz")`.
113-
   3. It should look similar to this: ![Screenshot of the gzip rule in Cloudflare]({{site.baseurl}}/assets/r2/gzip_rule.png)
113+
   3. It should look similar to this: ![Screenshot of the gzip rule in Cloudflare](../assets/r2/gzip_rule.png)
114114
   4. Save the rule.
115115

116116
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.
@@ -123,7 +123,7 @@ Go to Websites, click on “Add a site” then write your domain name.
123123
      5.  In the first field, select `URI Path`. In the Operator field, select `ends with`. In the value field, enter `.prbm`.
124124
   3. Further down under `Modify response header`.
125125
      1. In the first field, select `Set static`. In the Header name field, enter `Content-Encoding`. In the Header value field, enter `gzip`.
126-
   4. It should look similar to this: ![Screenshot of the Content-Encoding rule in Cloudflare]({{site.baseurl}}/assets/r2/encoding_rule.png)
126+
   4. It should look similar to this: ![Screenshot of the Content-Encoding rule in Cloudflare](../assets/r2/encoding_rule.png)
127127
   5. Save the rule.
128128

129129
## Making optional configurations
@@ -139,7 +139,7 @@ Every time a file is requested from your bucket, that counts as an operation. Ev
139139
      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.
140140
   5. Further down under `Browser TTL` click on `Add Setting`.
141141
      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.
142-
   6. It should look similar to this: ![Screenshot of the Cache rule in Cloudflare]({{site.baseurl}}/assets/r2/cache_rule.png)
142+
   6. It should look similar to this: ![Screenshot of the Cache rule in Cloudflare](../assets/r2/cache_rule.png)
143143
   7. Save the rule.
144144

145-
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.
145+
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.

0 commit comments

Comments
 (0)