diff options
Diffstat (limited to 'support/doc/production.md')
-rw-r--r-- | support/doc/production.md | 30 |
1 files changed, 21 insertions, 9 deletions
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 |