Skip to content

Commit 650d226

Browse files
committed
Merge #109: Udpate article: deploy to production
e825165 feat: udpate article: deploy to prod (Jose Celano) Pull request description: Some minor changes to the article. ACKs for top commit: josecelano: ACK e825165 Tree-SHA512: 01e0cabbc2a2d184885c0933e88aed917479e751a639cd50ba34b1529b2bc78bd6793f5c6e0124efb85c415bb9476c81214d101f50af04f9589162b72d613faa
2 parents 6c78abc + e825165 commit 650d226

File tree

1 file changed

+128
-88
lines changed

1 file changed

+128
-88
lines changed

src/routes/blog/deploying-torrust-to-production.md

Lines changed: 128 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,10 @@ First, we need to get the docker compose configuration. You can download it dire
387387
```bash
388388
cd \\
389389
&& mkdir -p github/torrust \\
390-
&& cd torrust/ \\
391-
&& git clone --single-branch --branch main https://github.com/torrust/torrust-compose.git \\
392-
&& cd torrust-compose/ \\
393-
&& git status \\
390+
&& cd github/torrust/ \\
391+
&& git clone --single-branch --branch main https://github.com/torrust/torrust-compose.git \\
392+
&& cd torrust-compose/ \\
393+
&& git status \\
394394
&& cd droplet/
395395
```
396396

@@ -422,23 +422,23 @@ The script will create some needed directories and empty SQLite databases:
422422
$ tree storage/
423423
storage/
424424
├── certbot
425-
   ├── etc
426-
   └── lib
425+
├── etc
426+
└── lib
427427
├── dhparam
428428
├── index
429-
   ├── etc
430-
   │   └── index.toml
431-
   └── lib
432-
   └── database
433-
   └── sqlite3.db
429+
├── etc
430+
└── index.toml
431+
└── lib
432+
└── database
433+
└── sqlite3.db
434434
├── proxy
435-
   ├── etc
436-
   │   └── nginx-conf
437-
   │   └── nginx.conf
438-
   └── webroot
435+
├── etc
436+
└── nginx-conf
437+
└── nginx.conf
438+
└── webroot
439439
└── tracker
440440
├── etc
441-
   └── tracker.toml
441+
└── tracker.toml
442442
└── lib
443443
└── database
444444
└── sqlite3.db
@@ -465,15 +465,39 @@ Replace the value for `TORRUST_INDEX_GUI_API_BASE_URL` with your domain:
465465
TORRUST_INDEX_GUI_API_BASE_URL='http://index.your-domain.com/api/v1'
466466
```
467467

468+
In `storage/index/etc/index.toml` replace the default tracker URL to be included in torrents with yours:
469+
470+
<CodeBlock lang="bash">
471+
472+
```bash
473+
[tracker]
474+
url = "udp://tracker.torrust-demo.com:6969"
475+
476+
```
477+
478+
</CodeBlock>
479+
480+
<CodeBlock lang="bash">
481+
482+
```bash
483+
[tracker]
484+
url = "udp://tracker.your-domain.com:6969"
485+
486+
```
487+
488+
</CodeBlock>
489+
468490
You can generate the Tracker API token and the Auth Secret Key with:
469491

470492
<CodeBlock lang="bash">
471493

472494
```bash
473-
gpg --armor --gen-random 1 40
495+
gpg --armor --gen-random 1 40
474496
jcrmbzlGyeP7z53TUQtXmtltMb5TubsIE9e0DPLnS4Ih29JddQw5JA==
475497
```
476498

499+
You also need to change Nginx configuration `share/container/default/config/nginx.conf` to set your domain.
500+
477501
</CodeBlock>
478502

479503
<Callout type="info">
@@ -564,6 +588,12 @@ sudo openssl dhparam -out /home/torrust/github/torrust/torrust-compose/droplet/s
564588

565589
Edit the file `./storage/proxy/etc/nginx-conf/nginx.conf` and uncomment all the commented lines for HTTPs servers:
566590

591+
<Callout type="warning">
592+
593+
Notice: you have to edit the file `./storage/proxy/etc/nginx-conf/nginx.conf` not the file `share/container/default/config/nginx.conf`.
594+
595+
</Callout>
596+
567597
<CodeBlock lang="nginx">
568598

569599
```nginx
@@ -716,7 +746,17 @@ TORRUST_INDEX_GUI_API_BASE_URL=https://index.torrust-demo.com/api/v1
716746

717747
Replace it from `http://index.torrust-demo.com/api/v1` to `https://index.torrust-demo.com/api/v1`.
718748

719-
After changing the Nginx configuration you need to restart the Nginx server:
749+
After changing the Nginx configuration and `.env` file you need to recreate containers:
750+
751+
<CodeBlock lang="bash">
752+
753+
```bash
754+
docker compose up -d --force-recreate
755+
```
756+
757+
</CodeBlock>
758+
759+
If you only change the Nginx configuration you can execute the following to reload Nginx configuration:
720760

721761
<CodeBlock lang="bash">
722762

@@ -769,75 +809,75 @@ $ sudo tree storage/certbot/
769809
[sudo] password for torrust:
770810
storage/certbot/
771811
├── etc
772-
   ├── accounts
773-
   │   ├── acme-staging-v02.api.letsencrypt.org
774-
   │   │   └── directory
775-
   │   │   └── b39c03e978*****df8366ab6539
776-
   │   │   ├── meta.json
777-
   │   │   ├── private_key.json
778-
   │   │   └── regr.json
779-
   │   └── acme-v02.api.letsencrypt.org
780-
   │   └── directory
781-
   │   └── 441a435b0f8*****cc6dd22f34468
782-
   │   ├── meta.json
783-
   │   ├── private_key.json
784-
   │   └── regr.json
785-
   ├── archive
786-
   │   ├── index.torrust-demo.com
787-
   │   │   ├── cert1.pem
788-
   │   │   ├── chain1.pem
789-
   │   │   ├── fullchain1.pem
790-
   │   │   └── privkey1.pem
791-
   │   ├── index.torrust-demo.com-0001
792-
   │   │   ├── cert1.pem
793-
   │   │   ├── cert2.pem
794-
   │   │   ├── chain1.pem
795-
   │   │   ├── chain2.pem
796-
   │   │   ├── fullchain1.pem
797-
   │   │   ├── fullchain2.pem
798-
   │   │   ├── privkey1.pem
799-
   │   │   └── privkey2.pem
800-
   │   └── tracker.torrust-demo.com
801-
   │   ├── cert1.pem
802-
   │   ├── cert2.pem
803-
   │   ├── cert3.pem
804-
   │   ├── chain1.pem
805-
   │   ├── chain2.pem
806-
   │   ├── chain3.pem
807-
   │   ├── fullchain1.pem
808-
   │   ├── fullchain2.pem
809-
   │   ├── fullchain3.pem
810-
   │   ├── privkey1.pem
811-
   │   ├── privkey2.pem
812-
   │   └── privkey3.pem
813-
   ├── live
814-
   │   ├── README
815-
   │   ├── index.torrust-demo.com
816-
   │   │   ├── README
817-
   │   │   ├── cert.pem -> ../../archive/index.torrust-demo.com/cert1.pem
818-
   │   │   ├── chain.pem -> ../../archive/index.torrust-demo.com/chain1.pem
819-
   │   │   ├── fullchain.pem -> ../../archive/index.torrust-demo.com/fullchain1.pem
820-
   │   │   └── privkey.pem -> ../../archive/index.torrust-demo.com/privkey1.pem
821-
   │   ├── index.torrust-demo.com-0001
822-
   │   │   ├── README
823-
   │   │   ├── cert.pem -> ../../archive/index.torrust-demo.com-0001/cert2.pem
824-
   │   │   ├── chain.pem -> ../../archive/index.torrust-demo.com-0001/chain2.pem
825-
   │   │   ├── fullchain.pem -> ../../archive/index.torrust-demo.com-0001/fullchain2.pem
826-
   │   │   └── privkey.pem -> ../../archive/index.torrust-demo.com-0001/privkey2.pem
827-
   │   └── tracker.torrust-demo.com
828-
   │   ├── README
829-
   │   ├── cert.pem -> ../../archive/tracker.torrust-demo.com/cert3.pem
830-
   │   ├── chain.pem -> ../../archive/tracker.torrust-demo.com/chain3.pem
831-
   │   ├── fullchain.pem -> ../../archive/tracker.torrust-demo.com/fullchain3.pem
832-
   │   └── privkey.pem -> ../../archive/tracker.torrust-demo.com/privkey3.pem
833-
   ├── renewal
834-
   │   ├── index.torrust-demo.com-0001.conf
835-
   │   ├── index.torrust-demo.com.conf
836-
   │   └── tracker.torrust-demo.com.conf
837-
   └── renewal-hooks
838-
   ├── deploy
839-
   ├── post
840-
   └── pre
812+
├── accounts
813+
├── acme-staging-v02.api.letsencrypt.org
814+
│ │ └── directory
815+
│ │ └── b39c03e978*****df8366ab6539
816+
│ │ ├── meta.json
817+
│ │ ├── private_key.json
818+
│ │ └── regr.json
819+
└── acme-v02.api.letsencrypt.org
820+
└── directory
821+
└── 441a435b0f8*****cc6dd22f34468
822+
├── meta.json
823+
├── private_key.json
824+
└── regr.json
825+
├── archive
826+
├── index.torrust-demo.com
827+
│ │ ├── cert1.pem
828+
│ │ ├── chain1.pem
829+
│ │ ├── fullchain1.pem
830+
│ │ └── privkey1.pem
831+
├── index.torrust-demo.com-0001
832+
│ │ ├── cert1.pem
833+
│ │ ├── cert2.pem
834+
│ │ ├── chain1.pem
835+
│ │ ├── chain2.pem
836+
│ │ ├── fullchain1.pem
837+
│ │ ├── fullchain2.pem
838+
│ │ ├── privkey1.pem
839+
│ │ └── privkey2.pem
840+
└── tracker.torrust-demo.com
841+
├── cert1.pem
842+
├── cert2.pem
843+
├── cert3.pem
844+
├── chain1.pem
845+
├── chain2.pem
846+
├── chain3.pem
847+
├── fullchain1.pem
848+
├── fullchain2.pem
849+
├── fullchain3.pem
850+
├── privkey1.pem
851+
├── privkey2.pem
852+
└── privkey3.pem
853+
├── live
854+
├── README
855+
├── index.torrust-demo.com
856+
│ │ ├── README
857+
│ │ ├── cert.pem -> ../../archive/index.torrust-demo.com/cert1.pem
858+
│ │ ├── chain.pem -> ../../archive/index.torrust-demo.com/chain1.pem
859+
│ │ ├── fullchain.pem -> ../../archive/index.torrust-demo.com/fullchain1.pem
860+
│ │ └── privkey.pem -> ../../archive/index.torrust-demo.com/privkey1.pem
861+
├── index.torrust-demo.com-0001
862+
│ │ ├── README
863+
│ │ ├── cert.pem -> ../../archive/index.torrust-demo.com-0001/cert2.pem
864+
│ │ ├── chain.pem -> ../../archive/index.torrust-demo.com-0001/chain2.pem
865+
│ │ ├── fullchain.pem -> ../../archive/index.torrust-demo.com-0001/fullchain2.pem
866+
│ │ └── privkey.pem -> ../../archive/index.torrust-demo.com-0001/privkey2.pem
867+
└── tracker.torrust-demo.com
868+
├── README
869+
├── cert.pem -> ../../archive/tracker.torrust-demo.com/cert3.pem
870+
├── chain.pem -> ../../archive/tracker.torrust-demo.com/chain3.pem
871+
├── fullchain.pem -> ../../archive/tracker.torrust-demo.com/fullchain3.pem
872+
└── privkey.pem -> ../../archive/tracker.torrust-demo.com/privkey3.pem
873+
├── renewal
874+
├── index.torrust-demo.com-0001.conf
875+
├── index.torrust-demo.com.conf
876+
└── tracker.torrust-demo.com.conf
877+
└── renewal-hooks
878+
├── deploy
879+
├── post
880+
└── pre
841881
└── lib
842882

843883
22 directories, 49 files
@@ -847,7 +887,7 @@ storage/certbot/
847887

848888
## Exposed services
849889

850-
After finishing the instalaltion the main available services are:
890+
After finishing the installation the main available services are:
851891

852892
- The Index: <http://index.torrust-demo.com/>
853893
- The HTTP Tracker: <https://tracker.torrust-demo.com/announce>

0 commit comments

Comments
 (0)