diff options
author | Chocobozzz <me@florianbigard.com> | 2021-01-11 10:09:24 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-01-11 10:09:24 +0100 |
commit | d8658f0f8131f1768697669b673290a2e25c2997 (patch) | |
tree | 8e02c59483271822eb85d458c68b784739a361df /support | |
parent | c2b823826db167594f8157b0b324b6fb1559caeb (diff) | |
download | PeerTube-d8658f0f8131f1768697669b673290a2e25c2997.tar.gz PeerTube-d8658f0f8131f1768697669b673290a2e25c2997.tar.zst PeerTube-d8658f0f8131f1768697669b673290a2e25c2997.zip |
Try to improve install doc
Diffstat (limited to 'support')
-rw-r--r-- | support/doc/dependencies.md | 13 | ||||
-rw-r--r-- | support/doc/production.md | 30 |
2 files changed, 26 insertions, 17 deletions
diff --git a/support/doc/dependencies.md b/support/doc/dependencies.md index 5f0c51170..61f8b7f36 100644 --- a/support/doc/dependencies.md +++ b/support/doc/dependencies.md | |||
@@ -28,18 +28,16 @@ Follow the below guides, and check their versions match [required external depen | |||
28 | 28 | ||
29 | 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access | 29 | 2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access |
30 | 30 | ||
31 | 3. Install certbot (choose instructions for nginx and your distribution) : | 31 | 3. Install NodeJS 10.x: |
32 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) | ||
33 | 4. Install NodeJS 10.x: | ||
34 | [https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions) | 32 | [https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions) |
35 | 5. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest): | 33 | 4. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest): |
36 | [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab) | 34 | [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab) |
37 | 35 | ||
38 | 6. Run: | 36 | 5. Run: |
39 | 37 | ||
40 | ``` | 38 | ``` |
41 | sudo apt update | 39 | sudo apt update |
42 | sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev | 40 | sudo apt install certbot nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev |
43 | ffmpeg -version # Should be >= 4.1 | 41 | ffmpeg -version # Should be >= 4.1 |
44 | g++ -v # Should be >= 5.x | 42 | g++ -v # Should be >= 5.x |
45 | ``` | 43 | ``` |
@@ -169,7 +167,7 @@ usermod my-peertube-user -a -G wheel # Add my-peertube-user to sudoers | |||
169 | su my-peertube-user | 167 | su my-peertube-user |
170 | ``` | 168 | ``` |
171 | 169 | ||
172 | 3. (Optional) Install certbot (choose instructions for nginx and your distribution): | 170 | 3. (Optional) Install certbot (choose instructions for your distribution): |
173 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) | 171 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) |
174 | 172 | ||
175 | 4. Install NodeJS 10.x: | 173 | 4. Install NodeJS 10.x: |
@@ -309,7 +307,6 @@ www-servers/nginx | |||
309 | 307 | ||
310 | # Optional, client for Let’s Encrypt: | 308 | # Optional, client for Let’s Encrypt: |
311 | # app-crypt/certbot | 309 | # app-crypt/certbot |
312 | # app-crypt/certbot-nginx | ||
313 | ``` | 310 | ``` |
314 | 311 | ||
315 | 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn: | 312 | 2. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn: |
diff --git a/support/doc/production.md b/support/doc/production.md index 59a1f7d5a..6b694c924 100644 --- a/support/doc/production.md +++ b/support/doc/production.md | |||
@@ -58,18 +58,21 @@ $ VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/la | |||
58 | 58 | ||
59 | Open the peertube directory, create a few required directories | 59 | Open the peertube directory, create a few required directories |
60 | ``` | 60 | ``` |
61 | $ cd /var/www/peertube && sudo -u peertube mkdir config storage versions && cd versions | 61 | $ cd /var/www/peertube |
62 | $ sudo -u peertube mkdir config storage versions | ||
62 | ``` | 63 | ``` |
63 | 64 | ||
64 | Download the latest version of the Peertube client, unzip it and remove the zip | 65 | Download the latest version of the Peertube client, unzip it and remove the zip |
65 | ``` | 66 | ``` |
67 | $ cd /var/www/peertube/versions | ||
66 | $ sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" | 68 | $ sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" |
67 | $ sudo -u peertube unzip peertube-${VERSION}.zip && sudo -u peertube rm peertube-${VERSION}.zip | 69 | $ sudo -u peertube unzip peertube-${VERSION}.zip && sudo -u peertube rm peertube-${VERSION}.zip |
68 | ``` | 70 | ``` |
69 | 71 | ||
70 | Install Peertube: | 72 | Install Peertube: |
71 | ``` | 73 | ``` |
72 | $ cd ../ && sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest | 74 | $ cd /var/www/peertube |
75 | $ sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest | ||
73 | $ cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile | 76 | $ cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile |
74 | ``` | 77 | ``` |
75 | 78 | ||
@@ -79,17 +82,20 @@ Copy the default configuration file that contains the default configuration prov | |||
79 | You **must not** update this file. | 82 | You **must not** update this file. |
80 | 83 | ||
81 | ``` | 84 | ``` |
82 | $ cd /var/www/peertube && sudo -u peertube cp peertube-latest/config/default.yaml.example config/default.yaml | 85 | $ cd /var/www/peertube |
86 | $ sudo -u peertube cp peertube-latest/config/default.yaml config/default.yaml | ||
83 | ``` | 87 | ``` |
84 | 88 | ||
85 | Now copy the production example configuration: | 89 | Now copy the production example configuration: |
86 | 90 | ||
87 | ``` | 91 | ``` |
88 | $ cd /var/www/peertube && sudo -u peertube cp peertube-latest/config/production.yaml.example config/production.yaml | 92 | $ cd /var/www/peertube |
93 | $ sudo -u peertube cp peertube-latest/config/production.yaml.example config/production.yaml | ||
89 | ``` | 94 | ``` |
90 | 95 | ||
91 | Then edit the `config/production.yaml` file according to your webserver | 96 | Then edit the `config/production.yaml` file according to your webserver |
92 | configuration. Keys defined in `config/production.yaml` will override keys defined in `config/default.yaml`. | 97 | and database configuration (`webserver`, `database`, `redis`, `smtp` and `admin.email` sections in particular). |
98 | Keys defined in `config/production.yaml` will override keys defined in `config/default.yaml`. | ||
93 | 99 | ||
94 | **PeerTube does not support webserver host change**. Even though [PeerTube CLI can help you to switch hostname](https://docs.joinpeertube.org/maintain-tools?id=update-hostjs) there's no official support for that since it is a risky operation that might result in unforeseen errors. | 100 | **PeerTube does not support webserver host change**. Even though [PeerTube CLI can help you to switch hostname](https://docs.joinpeertube.org/maintain-tools?id=update-hostjs) there's no official support for that since it is a risky operation that might result in unforeseen errors. |
95 | 101 | ||
@@ -132,14 +138,20 @@ $ sudo certbot certonly --standalone --post-hook "systemctl start nginx" | |||
132 | $ sudo systemctl reload nginx | 138 | $ sudo systemctl reload nginx |
133 | ``` | 139 | ``` |
134 | 140 | ||
135 | Remember your certificate will expire in 90 days, and thus needs renewal. | ||
136 | |||
137 | Now you have the certificates you can reload nginx: | 141 | Now you have the certificates you can reload nginx: |
138 | 142 | ||
139 | ``` | 143 | ``` |
140 | $ sudo systemctl reload nginx | 144 | $ sudo systemctl reload nginx |
141 | ``` | 145 | ``` |
142 | 146 | ||
147 | Certbot should have installed a cron to automatically renew your certificate. | ||
148 | Since our nginx template supports webroot renewal, we suggest you to update the renewal config file to use the `webroot` authenticator: | ||
149 | |||
150 | ``` | ||
151 | $ # Replace authenticator = standalone by authenticator = webroot | ||
152 | $ sudo vim /etc/letsencrypt/renewal/your-domain.com.conf | ||
153 | ``` | ||
154 | |||
143 | **FreeBSD** | 155 | **FreeBSD** |
144 | On FreeBSD you can use [Dehydrated](https://dehydrated.io/) `security/dehydrated` for [Let's Encrypt](https://letsencrypt.org/) | 156 | On FreeBSD you can use [Dehydrated](https://dehydrated.io/) `security/dehydrated` for [Let's Encrypt](https://letsencrypt.org/) |
145 | 157 | ||
@@ -233,8 +245,8 @@ $ tail -f /var/log/peertube/peertube.log | |||
233 | 245 | ||
234 | ### Administrator | 246 | ### Administrator |
235 | 247 | ||
236 | The administrator password is automatically generated and can be found in the | 248 | The administrator password is automatically generated and can be found in the PeerTube |
237 | logs. You can set another password with: | 249 | logs (path defined in `production.yaml`). You can also set another password with: |
238 | 250 | ||
239 | ``` | 251 | ``` |
240 | $ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root | 252 | $ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root |