Revert "Slight improvements for admin docs (#856)" (#861)

This reverts commit 9beb501bac.
This commit is contained in:
Eugen Rochko 2021-03-04 04:16:02 +01:00 committed by GitHub
parent 063feeaf3b
commit dbfc97e682
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 33 deletions

View File

@ -85,9 +85,7 @@ Generate with `rake mastodon:webpush:generate_vapid_key`. Changing it will break
#### `RAILS_ENV` #### `RAILS_ENV`
Which Rails environment is loaded from `config/environments`. Can be `production`, `development`, or `test`. Environment. Can be `production`, `development`, or `test`. If you are running Mastodon on your personal computer for development purposes, use `development`. That is also the default. If you are running Mastodon online, use `production`. Mastodon will load different configuration defaults based on the environment.
If you are running Mastodon on your personal computer for development purposes, use `development`, which will disable caching. This is also the default.
If you are running Mastodon online, use `production`.
{{< hint style="warning" >}} {{< hint style="warning" >}}
This variable cannot be defined in dotenv (`.env`) files as it's used before they are loaded. This variable cannot be defined in dotenv (`.env`) files as it's used before they are loaded.

View File

@ -13,16 +13,31 @@ menu:
* A **domain name** \(or a subdomain\) for the Mastodon server, e.g. `example.com` * A **domain name** \(or a subdomain\) for the Mastodon server, e.g. `example.com`
* An e-mail delivery service or other **SMTP server** * An e-mail delivery service or other **SMTP server**
The following commands should be run as root. If you arent already root, switch via `su`. You will be running the commands as root. If you arent already root, switch to root:
### System repositories {#system-repositories} ### System repositories {#system-repositories}
Make sure curl is installed first:
#### Node.js {#node-js}
```bash
curl -sL https://deb.nodesource.com/setup_12.x | bash -
```
#### Yarn {#yarn}
```bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
```
### System packages {#system-packages} ### System packages {#system-packages}
```sh ```bash
apt update apt update
apt install -y \ apt install -y \
curl imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core \ imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core \
g++ libprotobuf-dev protobuf-compiler pkg-config nodejs gcc autoconf \ g++ libprotobuf-dev protobuf-compiler pkg-config nodejs gcc autoconf \
bison build-essential libssl-dev libyaml-dev libreadline6-dev \ bison build-essential libssl-dev libyaml-dev libreadline6-dev \
zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev \ zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev \
@ -30,36 +45,23 @@ apt install -y \
certbot python-certbot-nginx yarn libidn11-dev libicu-dev libjemalloc-dev certbot python-certbot-nginx yarn libidn11-dev libicu-dev libjemalloc-dev
``` ```
#### Node.js {#node-js}
```sh
curl -sL https://deb.nodesource.com/setup_12.x | bash -
```
#### Yarn {#yarn}
```sh
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
```
### Installing Ruby {#installing-ruby} ### Installing Ruby {#installing-ruby}
We will be using rbenv to manage Ruby versions, because its easier to get the right versions and to update once a newer release comes out. rbenv must be installed for a single Linux user, therefore, first we must create the user Mastodon will be running as: We will be using rbenv to manage Ruby versions, because its easier to get the right versions and to update once a newer release comes out. rbenv must be installed for a single Linux user, therefore, first we must create the user Mastodon will be running as:
```sh ```bash
adduser --disabled-login mastodon adduser --disabled-login mastodon
``` ```
We can then switch to the user: We can then switch to the user:
```sh ```bash
su - mastodon su - mastodon
``` ```
And proceed to install rbenv and rbenv-build: And proceed to install rbenv and rbenv-build:
```sh ```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
@ -70,20 +72,20 @@ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
Once this is done, we can install the correct Ruby version: Once this is done, we can install the correct Ruby version:
```sh ```bash
RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 2.7.2 RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 2.7.2
rbenv global 2.7.2 rbenv global 2.7.2
``` ```
Well also need to install bundler: Well also need to install bundler:
```sh ```bash
gem install bundler --no-document gem install bundler --no-document
``` ```
Return to the root user: Return to the root user:
```sh ```bash
exit exit
``` ```
@ -101,7 +103,7 @@ You will need to create a PostgreSQL user that Mastodon could use. It is easiest
Open the prompt: Open the prompt:
```sh ```bash
sudo -u postgres psql sudo -u postgres psql
``` ```
@ -118,7 +120,7 @@ Done!
It is time to download the Mastodon code. Switch to the mastodon user: It is time to download the Mastodon code. Switch to the mastodon user:
```sh ```bash
su - mastodon su - mastodon
``` ```
@ -126,7 +128,7 @@ su - mastodon
Use git to download the latest stable release of Mastodon: Use git to download the latest stable release of Mastodon:
```sh ```bash
git clone https://github.com/tootsuite/mastodon.git live && cd live git clone https://github.com/tootsuite/mastodon.git live && cd live
git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1) git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)
``` ```
@ -135,7 +137,7 @@ git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)
Now to install Ruby and JavaScript dependencies: Now to install Ruby and JavaScript dependencies:
```sh ```bash
bundle config deployment 'true' bundle config deployment 'true'
bundle config without 'development test' bundle config without 'development test'
bundle install -j$(getconf _NPROCESSORS_ONLN) bundle install -j$(getconf _NPROCESSORS_ONLN)
@ -150,7 +152,7 @@ The two `bundle config` commands are only needed the first time you're installin
Run the interactive setup wizard: Run the interactive setup wizard:
```sh ```bash
RAILS_ENV=production bundle exec rake mastodon:setup RAILS_ENV=production bundle exec rake mastodon:setup
``` ```
@ -164,7 +166,7 @@ The configuration file is saved as `.env.production`. You can review and edit it
Youre done with the mastodon user for now, so switch back to root: Youre done with the mastodon user for now, so switch back to root:
```sh ```bash
exit exit
``` ```
@ -172,7 +174,7 @@ exit
Copy the configuration template for nginx from the Mastodon directory: Copy the configuration template for nginx from the Mastodon directory:
```sh ```bash
cp /home/mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon cp /home/mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon
ln -s /etc/nginx/sites-available/mastodon /etc/nginx/sites-enabled/mastodon ln -s /etc/nginx/sites-available/mastodon /etc/nginx/sites-enabled/mastodon
``` ```
@ -185,7 +187,7 @@ Reload nginx for the changes to take effect:
Well use Lets Encrypt to get a free SSL certificate: Well use Lets Encrypt to get a free SSL certificate:
```sh ```bash
certbot --nginx -d example.com certbot --nginx -d example.com
``` ```