Skip to content

Commit bfa8f92

Browse files
committed
Fixed internal link in hosting.md
1 parent 93e14c5 commit bfa8f92

File tree

1 file changed

+70
-68
lines changed

1 file changed

+70
-68
lines changed

DisCatSharp.Docs/articles/misc/hosting.md

Lines changed: 70 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,30 @@ Depending on how complex your bot is, you may even consider purchasing a Raspber
2626

2727
If you don't have a PC or other gear sitting around, you may use your phone instead. Using [Termux](https://termux.dev/en/) and a program called [proot-distro](https://github.com/termux/proot-distro), you create a Debian virtual machine and configure .NET to run the bot.
2828

29-
> [!NOTE] > **Time required:** 30-45 minutes
29+
> [!NOTE]
30+
> **Time required:** 30-45 minutes
3031
> **Difficulty:** Intermediate
3132
> **Prerequisites:** Basic command line knowledge
3233
33-
> [!TIP] > **Performance:** This solution works well for small to medium bots. Resource-intensive bots may drain your battery or experience performance issues. For high-traffic production bots, consider traditional hosting.
34+
> [!TIP]
35+
> **Performance:** This solution works well for small to medium bots. Resource-intensive bots may drain your battery or experience performance issues. For high-traffic production bots, consider traditional hosting.
3436
3537
For anyone interested, the instructions are detailed below:
3638

3739
#### Requirements
3840

39-
- A phone with Android 7 or higher (5+ is possible but not recommended as it poses security issues).
40-
- Termux installed from [F-Droid](https://f-droid.org/en/packages/com.termux/) (NOT from Google Play Store - the Play Store version is outdated).
41-
- At least 2GB of free storage space.
42-
- An internet connection.
43-
- Basic understanding of bash and nano.
41+
- A phone with Android 7 or higher (5+ is possible but not recommended as it poses security issues).
42+
- Termux installed from [F-Droid](https://f-droid.org/en/packages/com.termux/) (NOT from Google Play Store - the Play Store version is outdated).
43+
- At least 2GB of free storage space.
44+
- An internet connection.
45+
- Basic understanding of bash and nano.
4446

45-
> [!WARNING] > **Security:** Your bot token will be stored on your phone. Ensure your device is secured with a lock screen password.
47+
> [!WARNING]
48+
> **Security:** Your bot token will be stored on your phone. Ensure your device is secured with a lock screen password.
4649
4750
#### Setup
4851

49-
- Initialize Termux:
52+
- Initialize Termux:
5053

5154
```sh
5255
pkg update && pkg upgrade -y
@@ -55,7 +58,7 @@ pkg update && pkg upgrade -y
5558
> [!TIP]
5659
> It might ask you for input, just click enter and let the default option be executed.
5760
58-
- Install proot-distro package:
61+
- Install proot-distro package:
5962

6063
```sh
6164
pkg install proot-distro -y
@@ -69,7 +72,7 @@ proot-distro list
6972

7073
You should see available distributions including `debian`.
7174

72-
- Install a Debian Virtual Machine (VM):
75+
- Install a Debian Virtual Machine (VM):
7376

7477
```sh
7578
proot-distro install debian
@@ -78,31 +81,31 @@ proot-distro install debian
7881
> [!NOTE]
7982
> Installation time will depend on your internet speed.
8083
81-
- Login into Debian:
84+
- Login into Debian:
8285

8386
```sh
8487
proot-distro login debian
8588
```
8689

87-
- Initialize Debian:
90+
- Initialize Debian:
8891

8992
```sh
9093
apt update -y && apt upgrade -y
9194
```
9295

93-
- Install Git and Wget:
96+
- Install Git and Wget:
9497

9598
```sh
9699
apt install git wget -y
97100
```
98101

99-
- Install .NET via a script for simplicity:
102+
- Install .NET via a script for simplicity:
100103

101104
```sh
102105
wget https://dot.net/v1/dotnet-install.sh -O dotnet.sh && chmod +x ./dotnet.sh
103106
```
104107

105-
- Install .NET 9:
108+
- Install .NET 9:
106109

107110
```sh
108111
./dotnet.sh --channel 9.0
@@ -111,13 +114,14 @@ wget https://dot.net/v1/dotnet-install.sh -O dotnet.sh && chmod +x ./dotnet.sh
111114
> [!CAUTION]
112115
> The following steps are essential to get .NET working.
113116
114-
- Add .NET to path and mitigate GC heap error. Open your `.bashrc` file:
117+
- Add .NET to path and mitigate GC heap error. Open your `.bashrc` file:
115118

116119
```sh
117120
nano ~/.bashrc
118121
```
119122

120-
> [!TIP] > **Using nano:** Use arrow keys to navigate. To save and exit: press `Ctrl+X`, then `Y` to confirm, then `Enter`.
123+
> [!TIP]
124+
> **Using nano:** Use arrow keys to navigate. To save and exit: press `Ctrl+X`, then `Y` to confirm, then `Enter`.
121125
122126
Add these lines **at the end of the file**:
123127

@@ -129,13 +133,13 @@ export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
129133

130134
Save and exit the file.
131135

132-
- Apply the changes:
136+
- Apply the changes:
133137

134138
```sh
135139
source ~/.bashrc
136140
```
137141

138-
- Verify .NET is working:
142+
- Verify .NET is working:
139143

140144
```sh
141145
dotnet --version
@@ -145,67 +149,67 @@ You should see version 9.x.x displayed.
145149

146150
##### Cloud Hosted Code
147151

148-
- If you have your code hosted on platforms that use Git or are able to download it, get the source code and `cd` into the directory:
152+
- If you have your code hosted on platforms that use Git or are able to download it, get the source code and `cd` into the directory:
149153

150154
```sh
151155
git clone https://github.com/Aiko-IT-Systems/DisCatSharp.Examples/
152156
cd DisCatSharp.Examples
153157
```
154158

155-
- Add your configuration file, then build the project. To keep the bot online 24/7, check [here](#building-running).
159+
- Add your configuration file, then build the project. To keep the bot online 24/7, check [here](#building-and-running).
156160

157161
##### Local Source Code
158162

159-
- If your source code is not hosted on the cloud, you can move the source code inside the VM by following the given steps:
163+
- If your source code is not hosted on the cloud, you can move the source code inside the VM by following the given steps:
160164

161-
- Enable developer options on your phone ([find out how](https://developer.android.com/studio/debug/dev-options)), then enable USB debugging. You can find it by scrolling in "Developer Options".
165+
- Enable developer options on your phone ([find out how](https://developer.android.com/studio/debug/dev-options)), then enable USB debugging. You can find it by scrolling in "Developer Options".
162166

163-
- Connect your phone to your computer using USB. Open a file manager and drag your project files into your phone's home directory.
167+
- Connect your phone to your computer using USB. Open a file manager and drag your project files into your phone's home directory.
164168

165-
- To move the project files from your phone's storage into Termux, you'll need to set up storage permissions. Follow this [video guide](https://youtu.be/MMeM7szKt44), or use these steps:
169+
- To move the project files from your phone's storage into Termux, you'll need to set up storage permissions. Follow this [video guide](https://youtu.be/MMeM7szKt44), or use these steps:
166170

167-
1. In Termux, run: `termux-setup-storage`
168-
2. Grant storage permissions when prompted
169-
3. Verify access: `ls ~/storage/shared/`
170-
4. Your phone's files should now be accessible
171+
1. In Termux, run: `termux-setup-storage`
172+
2. Grant storage permissions when prompted
173+
3. Verify access: `ls ~/storage/shared/`
174+
4. Your phone's files should now be accessible
171175

172-
- Once you can see your files in `~/storage/shared/`, copy your project folder there using your phone's file manager.
176+
- Once you can see your files in `~/storage/shared/`, copy your project folder there using your phone's file manager.
173177

174-
- Now, exit out of Debian. Inside Termux, create an environment variable that points to the VM's root directory. This allows you to access the VM's files from Termux. Add the following to your `.bashrc` file and update your session:
178+
- Now, exit out of Debian. Inside Termux, create an environment variable that points to the VM's root directory. This allows you to access the VM's files from Termux. Add the following to your `.bashrc` file and update your session:
175179

176180
```sh
177181
nano ~/.bashrc
178182
export PROOTDISTROFS=/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs
179183
source ~/.bashrc
180184
```
181185

182-
- Now, move the source code from your phone to the VM. The files should be in `~/storage/shared/`. Replace `projectname` with your actual project folder name:
186+
- Now, move the source code from your phone to the VM. The files should be in `~/storage/shared/`. Replace `projectname` with your actual project folder name:
183187

184188
```sh
185189
mv ~/storage/shared/projectname/ $PROOTDISTROFS/debian/root/
186190
```
187191

188-
- Log back into Debian and verify the files are there:
192+
- Log back into Debian and verify the files are there:
189193

190194
```sh
191195
proot-distro login debian
192196
ls
193197
```
194198

195-
- Add your configuration file, then build the project.
199+
- Add your configuration file, then build the project.
196200

197-
#### Building and Running {#building-running}
201+
#### Building and Running
198202

199203
> [!WARNING]
200204
> If you have folders such as `bin/` and `obj/` from your prior builds, delete those by running `rm -rf bin/ obj/`. You might run into issues otherwise.
201205
202-
- Build your project:
206+
- Build your project:
203207

204208
```sh
205209
dotnet build
206210
```
207211

208-
- Run your bot:
212+
- Run your bot:
209213

210214
```sh
211215
dotnet run
@@ -252,7 +256,6 @@ cat ~/.bashrc | grep DOTNET
252256
```
253257

254258
Ensure these lines exist:
255-
256259
```sh
257260
export DOTNET_GCHeapHardLimit=1C0000000
258261
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
@@ -264,7 +267,7 @@ If missing, add them, save, and run `source ~/.bashrc`.
264267

265268
**Problem: Bot stops when I close Termux**
266269

267-
Solution: You need to use `screen` to keep the bot running in the background. See the [keeping bot running section](#building-running).
270+
Solution: You need to use `screen` to keep the bot running in the background. See the [keeping bot running section](#building-and-running).
268271

269272
---
270273

@@ -278,7 +281,6 @@ ls ~/
278281
```
279282

280283
If not there, check your source location:
281-
282284
```sh
283285
exit # Exit Debian back to Termux
284286
ls ~/storage/shared/
@@ -326,30 +328,30 @@ environment, particularly the shell (command line), and concepts such as SSH.
326328

327329
There are several well-known, trusted, and cheap providers:
328330

329-
- [Host Pls](https://host-pls.com/) - A hosting solution made by Discord bot developers. Based in America, starting from $2.49/mo.
330-
- [Vultr](https://www.vultr.com/products/cloud-compute/) - Based in the US with datacenters in many regions, including APAC. Starting at $2.50/mo.
331-
- [DigitalOcean](https://www.digitalocean.com/products/droplets/) - The gold standard, US based. Locations available world wide. Starting from $5.00/mo.
332-
- [Linode](https://www.linode.com/products/shared/) - US based host with many datacenters around the world. Starting at $5.00/mo.
333-
- [OVH](https://www.ovhcloud.com/en/vps/) - Very popular VPS host. Based in Canadian with French locations available. Starting from $6.00/mo.
334-
- [Contabo](https://contabo.com/?show=vps) - Based in Germany; extremely good value for the price. Starting from 4.99€/mo.
331+
- [Host Pls](https://host-pls.com/) - A hosting solution made by Discord bot developers. Based in America, starting from $2.49/mo.
332+
- [Vultr](https://www.vultr.com/products/cloud-compute/) - Based in the US with datacenters in many regions, including APAC. Starting at $2.50/mo.
333+
- [DigitalOcean](https://www.digitalocean.com/products/droplets/) - The gold standard, US based. Locations available world wide. Starting from $5.00/mo.
334+
- [Linode](https://www.linode.com/products/shared/) - US based host with many datacenters around the world. Starting at $5.00/mo.
335+
- [OVH](https://www.ovhcloud.com/en/vps/) - Very popular VPS host. Based in Canadian with French locations available. Starting from $6.00/mo.
336+
- [Contabo](https://contabo.com/?show=vps) - Based in Germany; extremely good value for the price. Starting from 4.99€/mo.
335337

336338
Things to keep in mind when looking for a VPS host:
337339

338-
- The majority of cheap VPS hosts will be running some variant of Linux, and not Windows.
339-
- The primary Discord API server is located in East US.
340-
- If latency matters for you application, choose a host that is closer to this location.
340+
- The majority of cheap VPS hosts will be running some variant of Linux, and not Windows.
341+
- The primary Discord API server is located in East US.
342+
- If latency matters for you application, choose a host that is closer to this location.
341343

342344
In addition to these, there are several hosting providers that offer free trials or in-service credit:
343345

344-
- [**Microsoft Azure**](https://azure.microsoft.com/en-us/free/?cdn=disable "Microsoft Azure"): $200 in-service credit,
345-
to be used within month of registration. Requires credit or debit card for validation. Azure isn't cheap, but it supports
346-
both Windows and GNU/Linux-based servers. If you're enrolled in Microsoft Imagine, it's possible to get these cheaper or
347-
free.
348-
- [**Amazon Web Services**](https://aws.amazon.com/free/ "AWS"): Free for 12 months (with 750 compute hours per month). Not
349-
cheap once the trial runs out, but it's also considered industry standard in cloud services.
350-
- [**Google Cloud Platform**](https://cloud.google.com/free/ "Google Cloud Platform"): $300 in-service credit, to be used
351-
within year of registration. GCP is based in the US, and offers very scalable products. Like the above, it's not the
352-
cheapest of offerings.
346+
- [**Microsoft Azure**](https://azure.microsoft.com/en-us/free/?cdn=disable "Microsoft Azure"): $200 in-service credit,
347+
to be used within month of registration. Requires credit or debit card for validation. Azure isn't cheap, but it supports
348+
both Windows and GNU/Linux-based servers. If you're enrolled in Microsoft Imagine, it's possible to get these cheaper or
349+
free.
350+
- [**Amazon Web Services**](https://aws.amazon.com/free/ "AWS"): Free for 12 months (with 750 compute hours per month). Not
351+
cheap once the trial runs out, but it's also considered industry standard in cloud services.
352+
- [**Google Cloud Platform**](https://cloud.google.com/free/ "Google Cloud Platform"): $300 in-service credit, to be used
353+
within year of registration. GCP is based in the US, and offers very scalable products. Like the above, it's not the
354+
cheapest of offerings.
353355

354356
## Hosting on Cloud Native Services
355357

@@ -358,19 +360,19 @@ where Docker and other cloud native hosting comes into play. There are many diff
358360
to chose which one will suit you best. Here are a few services that offer Docker or other cloud native solutions that are cheaper than running
359361
a whole VM.
360362

361-
- [**Azure App Service**](https://azure.microsoft.com/en-us/services/app-service/ "Azure App Service"): Allows for Hosting Website, Continuous Jobs,
362-
and Docker images on a Windows base or Linux base machine.
363-
- [**AWS Fargate**](https://aws.amazon.com/fargate/ "AWS Fargate"): Allows for hosting Docker images within Amazon Web Services
364-
- [**Jelastic**](https://jelastic.com/docker/ "Jelastic"): Allows for hosting Docker images.
363+
- [**Azure App Service**](https://azure.microsoft.com/en-us/services/app-service/ "Azure App Service"): Allows for Hosting Website, Continuous Jobs,
364+
and Docker images on a Windows base or Linux base machine.
365+
- [**AWS Fargate**](https://aws.amazon.com/fargate/ "AWS Fargate"): Allows for hosting Docker images within Amazon Web Services
366+
- [**Jelastic**](https://jelastic.com/docker/ "Jelastic"): Allows for hosting Docker images.
365367

366368
# Making your publishing life easier
367369

368370
Now that we have covered where you can possibly host your application, now lets cover how to make your life easier publishing it. Many different
369371
source control solutions out there are free and also offer some type of CI/CD integration (paid and free). Below are some of the
370372
solutions that we recommend:
371373

372-
- [**Azure Devops**](https://azure.microsoft.com/en-us/services/devops/?nav=min "Azure Devops"): Allows for GIT source control hosting along with integrated CI/CD
373-
pipelines to auto compile and publish your applications. You can also use their CI/CD service if your code is hosted in a different source control environment like Github.
374-
- [**Github**](https://github.com/ "GitHub") Allows for GIT source control hosting. From here you can leverage many different CI/CD options to compile and publish your
375-
applications.
376-
- [**Bitbucket**](https://bitbucket.org/ "Bitbucket"): Allows for GIT source control hosting along with integrated CI/CD pipelines to auto compile and publish your applications.
374+
- [**Azure Devops**](https://azure.microsoft.com/en-us/services/devops/?nav=min "Azure Devops"): Allows for GIT source control hosting along with integrated CI/CD
375+
pipelines to auto compile and publish your applications. You can also use their CI/CD service if your code is hosted in a different source control environment like Github.
376+
- [**Github**](https://github.com/ "GitHub") Allows for GIT source control hosting. From here you can leverage many different CI/CD options to compile and publish your
377+
applications.
378+
- [**Bitbucket**](https://bitbucket.org/ "Bitbucket"): Allows for GIT source control hosting along with integrated CI/CD pipelines to auto compile and publish your applications.

0 commit comments

Comments
 (0)