diff options
-rw-r--r-- | .github/CONTRIBUTING.md | 10 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | support/doc/dependencies.md | 14 | ||||
-rw-r--r-- | support/doc/development/client/code.md | 4 | ||||
-rw-r--r-- | support/doc/development/server/code.md | 12 | ||||
-rw-r--r-- | support/doc/production.md | 26 |
6 files changed, 34 insertions, 36 deletions
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index dec6a5cd0..2b90d94a2 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md | |||
@@ -35,7 +35,7 @@ to install the dependencies. | |||
35 | 35 | ||
36 | Then clone the sources and install node modules: | 36 | Then clone the sources and install node modules: |
37 | 37 | ||
38 | ```bash | 38 | ``` |
39 | $ git clone -b master https://github.com/Chocobozzz/PeerTube | 39 | $ git clone -b master https://github.com/Chocobozzz/PeerTube |
40 | $ cd PeerTube | 40 | $ cd PeerTube |
41 | $ yarn install --pure-lockfile | 41 | $ yarn install --pure-lockfile |
@@ -46,7 +46,7 @@ Then, create a postgres database and user with the values set in the | |||
46 | there, the following commands would create a new database called `peertube_dev` | 46 | there, the following commands would create a new database called `peertube_dev` |
47 | and a postgres user called `peertube` with password `peertube`: | 47 | and a postgres user called `peertube` with password `peertube`: |
48 | 48 | ||
49 | ```bash | 49 | ``` |
50 | # sudo -u postgres createuser -P peertube | 50 | # sudo -u postgres createuser -P peertube |
51 | Enter password for new role: peertube | 51 | Enter password for new role: peertube |
52 | # sudo -u postgres createdb -O peertube peertube_dev | 52 | # sudo -u postgres createdb -O peertube peertube_dev |
@@ -60,7 +60,7 @@ You can find a documentation of the server code/architecture [here](/support/doc | |||
60 | 60 | ||
61 | To develop on the server-side: | 61 | To develop on the server-side: |
62 | 62 | ||
63 | ```bash | 63 | ``` |
64 | $ npm run dev:server | 64 | $ npm run dev:server |
65 | ``` | 65 | ``` |
66 | 66 | ||
@@ -76,7 +76,7 @@ You can find a documentation of the server code/architecture | |||
76 | 76 | ||
77 | To develop on the client side: | 77 | To develop on the client side: |
78 | 78 | ||
79 | ```bash | 79 | ``` |
80 | $ npm run dev:client | 80 | $ npm run dev:client |
81 | ``` | 81 | ``` |
82 | 82 | ||
@@ -88,7 +88,7 @@ reload them automatically thanks to hot module replacement. | |||
88 | 88 | ||
89 | This will run 3 nodes: | 89 | This will run 3 nodes: |
90 | 90 | ||
91 | ```bash | 91 | ``` |
92 | $ npm run clean:server:test | 92 | $ npm run clean:server:test |
93 | $ npm run play | 93 | $ npm run play |
94 | ``` | 94 | ``` |
@@ -143,13 +143,13 @@ See the [production guide](support/doc/production.md). | |||
143 | ## Contributing | 143 | ## Contributing |
144 | 144 | ||
145 | See the [contributing | 145 | See the [contributing |
146 | guide](https://github.com/Chocobozzz/PeerTube/blob/master/.github/CONTRIBUTING.md) | 146 | guide](/.github/CONTRIBUTING.md) |
147 | to see how to contribute to PeerTube. Spoiler alert: you don't need to be a | 147 | to see how to contribute to PeerTube. Spoiler alert: you don't need to be a |
148 | coder to help! | 148 | coder to help! |
149 | 149 | ||
150 | ## Architecture | 150 | ## Architecture |
151 | 151 | ||
152 | See [ARCHITECTURE.md](https://github.com/Chocobozzz/PeerTube/blob/master/ARCHITECTURE.md) for a more detailed explanation. | 152 | See [ARCHITECTURE.md](/ARCHITECTURE.md) for a more detailed explanation. |
153 | 153 | ||
154 | ### Backend | 154 | ### Backend |
155 | 155 | ||
diff --git a/support/doc/dependencies.md b/support/doc/dependencies.md index d77724b5a..2f2d4f49d 100644 --- a/support/doc/dependencies.md +++ b/support/doc/dependencies.md | |||
@@ -1,8 +1,6 @@ | |||
1 | # Installation | 1 | # Dependencies |
2 | 2 | ||
3 | ## Dependencies | 3 | ## Debian / Ubuntu |
4 | |||
5 | ### Debian / Ubuntu | ||
6 | 4 | ||
7 | 1. Install NodeJS 8.x (current LTS): | 5 | 1. Install NodeJS 8.x (current LTS): |
8 | [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) | 6 | [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) |
@@ -10,20 +8,20 @@ | |||
10 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) | 8 | [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) |
11 | 4. Run: | 9 | 4. Run: |
12 | 10 | ||
13 | ```bash | 11 | ``` |
14 | $ apt-get update | 12 | $ apt-get update |
15 | $ apt-get install nginx ffmpeg postgresql openssl g++ make | 13 | $ apt-get install nginx ffmpeg postgresql openssl g++ make |
16 | ``` | 14 | ``` |
17 | 15 | ||
18 | ### Arch Linux | 16 | ## Arch Linux |
19 | 17 | ||
20 | 1. Run: | 18 | 1. Run: |
21 | 19 | ||
22 | ```bash | 20 | ``` |
23 | $ pacman -S nodejs yarn ffmpeg postgresql openssl | 21 | $ pacman -S nodejs yarn ffmpeg postgresql openssl |
24 | ``` | 22 | ``` |
25 | 23 | ||
26 | ### Other distributions | 24 | ## Other distributions |
27 | 25 | ||
28 | Feel free to update this file in a pull request! | 26 | Feel free to update this file in a pull request! |
29 | 27 | ||
diff --git a/support/doc/development/client/code.md b/support/doc/development/client/code.md index 749783c29..f84c7b998 100644 --- a/support/doc/development/client/code.md +++ b/support/doc/development/client/code.md | |||
@@ -17,7 +17,7 @@ The client is a HTML/CSS/JavaScript web application (single page application -> | |||
17 | ## Files | 17 | ## Files |
18 | 18 | ||
19 | The client files are in the `client` directory. The Webpack 2 configurations files are in `client/config` and the source files in `client/src`. | 19 | The client files are in the `client` directory. The Webpack 2 configurations files are in `client/config` and the source files in `client/src`. |
20 | The client modules description are in the [client/package.json](https://github.com/Chocobozzz/PeerTube/blob/master/client/package.json). There are many modules that are used to compile the web application in development or production mode. | 20 | The client modules description are in the [client/package.json](/client/package.json). There are many modules that are used to compile the web application in development or production mode. |
21 | Here is the description of the useful `client` files directory: | 21 | Here is the description of the useful `client` files directory: |
22 | 22 | ||
23 | tslint.json -> TypeScript linter rules | 23 | tslint.json -> TypeScript linter rules |
@@ -60,7 +60,7 @@ If you are not familiar with Angular I recommend you to read the [quickstart gui | |||
60 | 60 | ||
61 | ## Components tree | 61 | ## Components tree |
62 | 62 | ||
63 | ![Components tree](https://github.com/Chocobozzz/PeerTube/blob/master/support/doc/client/components-tree.png) | 63 | ![Components tree](/support/doc/client/development/components-tree.png) |
64 | 64 | ||
65 | ## Newcomers | 65 | ## Newcomers |
66 | 66 | ||
diff --git a/support/doc/development/server/code.md b/support/doc/development/server/code.md index ddb93119b..a8793e807 100644 --- a/support/doc/development/server/code.md +++ b/support/doc/development/server/code.md | |||
@@ -15,9 +15,9 @@ The server is a web server developed with [TypeScript](https://www.typescriptlan | |||
15 | 15 | ||
16 | ## Files | 16 | ## Files |
17 | 17 | ||
18 | The server main file is [server.ts](https://github.com/Chocobozzz/PeerTube/blob/master/server.ts). | 18 | The server main file is [server.ts](/server.ts). |
19 | The server modules description are in the [package.json](https://github.com/Chocobozzz/PeerTube/blob/master/package.json) at the project root. | 19 | The server modules description are in the [package.json](/package.json) at the project root. |
20 | All other server files are in the [server](https://github.com/Chocobozzz/PeerTube/tree/master/server) directory: | 20 | All other server files are in the [server](/server) directory: |
21 | 21 | ||
22 | server.ts -> app initilization, main routes configuration (static routes...) | 22 | server.ts -> app initilization, main routes configuration (static routes...) |
23 | config -> server YAML configurations (for tests, production...) | 23 | config -> server YAML configurations (for tests, production...) |
@@ -45,7 +45,7 @@ The server is composed by: | |||
45 | 45 | ||
46 | A video is seeded by the server with the [WebSeed](http://www.bittorrent.org/beps/bep_0019.html) protocol (HTTP). | 46 | A video is seeded by the server with the [WebSeed](http://www.bittorrent.org/beps/bep_0019.html) protocol (HTTP). |
47 | 47 | ||
48 | ![Architecture scheme](https://github.com/Chocobozzz/PeerTube/blob/master/support/doc/server/upload-video.png) | 48 | ![Architecture scheme](/support/doc/development/server/upload-video.png) |
49 | 49 | ||
50 | When a user uploads a video, the rest API create the torrent file and then adds it to its database. | 50 | When a user uploads a video, the rest API create the torrent file and then adds it to its database. |
51 | 51 | ||
@@ -53,5 +53,5 @@ If a user wants to watch the video, the tracker will indicate all other users th | |||
53 | 53 | ||
54 | ## Newcomers | 54 | ## Newcomers |
55 | 55 | ||
56 | The server entrypoint is [server.ts](https://github.com/Chocobozzz/PeerTube/blob/master/server.ts). You can begin to look at this file. | 56 | The server entrypoint is [server.ts](/server.ts). You can begin to look at this file. |
57 | Then you can try to understand the [controllers](https://github.com/Chocobozzz/PeerTube/tree/master/server/controllers): they are the entrypoint of each API request. | 57 | Then you can try to understand the [controllers](/server/controllers): they are the entrypoint of each API request. |
diff --git a/support/doc/production.md b/support/doc/production.md index 4d7c14f2b..118704da3 100644 --- a/support/doc/production.md +++ b/support/doc/production.md | |||
@@ -10,7 +10,7 @@ Follow the steps of the [dependencies guide](dependencies.md). | |||
10 | 10 | ||
11 | Create a `peertube` user with `/home/peertube` home: | 11 | Create a `peertube` user with `/home/peertube` home: |
12 | 12 | ||
13 | ```bash | 13 | ``` |
14 | sudo useradd -m -d /home/peertube -s /bin/bash -p peertube peertube | 14 | sudo useradd -m -d /home/peertube -s /bin/bash -p peertube peertube |
15 | sudo passwd peertube | 15 | sudo passwd peertube |
16 | ``` | 16 | ``` |
@@ -19,7 +19,7 @@ sudo passwd peertube | |||
19 | 19 | ||
20 | Create production database and peertube user: | 20 | Create production database and peertube user: |
21 | 21 | ||
22 | ```bash | 22 | ``` |
23 | sudo -u postgres createuser -P peertube | 23 | sudo -u postgres createuser -P peertube |
24 | sudo -u postgres createdb -O peertube peertube_prod | 24 | sudo -u postgres createdb -O peertube peertube_prod |
25 | ``` | 25 | ``` |
@@ -28,7 +28,7 @@ sudo -u postgres createdb -O peertube peertube_prod | |||
28 | 28 | ||
29 | Clone, install node dependencies and build application: | 29 | Clone, install node dependencies and build application: |
30 | 30 | ||
31 | ```bash | 31 | ``` |
32 | $ cd /home/peertube | 32 | $ cd /home/peertube |
33 | $ sudo -u peertube git clone -b master https://github.com/Chocobozzz/PeerTube | 33 | $ sudo -u peertube git clone -b master https://github.com/Chocobozzz/PeerTube |
34 | $ cd PeerTube | 34 | $ cd PeerTube |
@@ -40,7 +40,7 @@ $ sudo -u peertube npm run build | |||
40 | 40 | ||
41 | Copy example configuration: | 41 | Copy example configuration: |
42 | 42 | ||
43 | ```bash | 43 | ``` |
44 | $ sudo -u peertube cp config/production.yaml.example config/production.yaml | 44 | $ sudo -u peertube cp config/production.yaml.example config/production.yaml |
45 | ``` | 45 | ``` |
46 | 46 | ||
@@ -52,14 +52,14 @@ configuration. Keys set in this file will override those of | |||
52 | 52 | ||
53 | Copy the nginx configuration template: | 53 | Copy the nginx configuration template: |
54 | 54 | ||
55 | ```bash | 55 | ``` |
56 | $ sudo cp /home/peertube/PeerTube/support/nginx/peertube-https /etc/nginx/sites-available/peertube | 56 | $ sudo cp /home/peertube/PeerTube/support/nginx/peertube-https /etc/nginx/sites-available/peertube |
57 | ``` | 57 | ``` |
58 | 58 | ||
59 | Then modify the webserver configuration file. Please pay attention to the `alias` key of `/static/webseed` location. | 59 | Then modify the webserver configuration file. Please pay attention to the `alias` key of `/static/webseed` location. |
60 | It should correspond to the path of your videos directory (set in the configuration file as `storage->videos` key). | 60 | It should correspond to the path of your videos directory (set in the configuration file as `storage->videos` key). |
61 | 61 | ||
62 | ```bash | 62 | ``` |
63 | $ sudo vim /etc/nginx/sites-available/peertube | 63 | $ sudo vim /etc/nginx/sites-available/peertube |
64 | ``` | 64 | ``` |
65 | 65 | ||
@@ -150,7 +150,7 @@ server { | |||
150 | 150 | ||
151 | Activate the configuration file: | 151 | Activate the configuration file: |
152 | 152 | ||
153 | ```bash | 153 | ``` |
154 | $ sudo ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube | 154 | $ sudo ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube |
155 | $ sudo systemctl reload nginx | 155 | $ sudo systemctl reload nginx |
156 | ``` | 156 | ``` |
@@ -159,13 +159,13 @@ $ sudo systemctl reload nginx | |||
159 | 159 | ||
160 | Copy the nginx configuration template: | 160 | Copy the nginx configuration template: |
161 | 161 | ||
162 | ```bash | 162 | ``` |
163 | sudo cp /home/peertube/PeerTube/support/systemd/peertube.service /etc/systemd/system/ | 163 | sudo cp /home/peertube/PeerTube/support/systemd/peertube.service /etc/systemd/system/ |
164 | ``` | 164 | ``` |
165 | 165 | ||
166 | Update the service file: | 166 | Update the service file: |
167 | 167 | ||
168 | ```bash | 168 | ``` |
169 | sudo vim /etc/systemd/system/peertube.service | 169 | sudo vim /etc/systemd/system/peertube.service |
170 | ``` | 170 | ``` |
171 | 171 | ||
@@ -195,13 +195,13 @@ WantedBy=multi-user.target | |||
195 | 195 | ||
196 | Tell systemd to reload its config: | 196 | Tell systemd to reload its config: |
197 | 197 | ||
198 | ```bash | 198 | ``` |
199 | sudo systemctl daemon-reload | 199 | sudo systemctl daemon-reload |
200 | ``` | 200 | ``` |
201 | 201 | ||
202 | ### Run | 202 | ### Run |
203 | 203 | ||
204 | ```bash | 204 | ``` |
205 | sudo systemctl start peertube | 205 | sudo systemctl start peertube |
206 | sudo journalctl -feu peertube | 206 | sudo journalctl -feu peertube |
207 | ``` | 207 | ``` |
@@ -211,7 +211,7 @@ sudo journalctl -feu peertube | |||
211 | The administrator password is automatically generated and can be found in the | 211 | The administrator password is automatically generated and can be found in the |
212 | logs. You can set another password with: | 212 | logs. You can set another password with: |
213 | 213 | ||
214 | ```bash | 214 | ``` |
215 | $ NODE_ENV=production npm run reset-password -- -u root | 215 | $ NODE_ENV=production npm run reset-password -- -u root |
216 | ``` | 216 | ``` |
217 | 217 | ||
@@ -220,7 +220,7 @@ $ NODE_ENV=production npm run reset-password -- -u root | |||
220 | The following commands will upgrade the source (according to your current | 220 | The following commands will upgrade the source (according to your current |
221 | branch), upgrade node modules and rebuild client application: | 221 | branch), upgrade node modules and rebuild client application: |
222 | 222 | ||
223 | ```bash | 223 | ``` |
224 | # systemctl stop peertube | 224 | # systemctl stop peertube |
225 | $ npm run upgrade-peertube | 225 | $ npm run upgrade-peertube |
226 | # systemctl start peertube | 226 | # systemctl start peertube |