mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-13 16:49:07 +00:00
adde char limit, updated changelog, removed duplicate setting and added index entry
This commit is contained in:
parent
da63d08e09
commit
e068da173f
4 changed files with 105 additions and 44 deletions
|
@ -12,13 +12,6 @@ DEBUG = False
|
|||
|
||||
ALLOWED_HOSTS = ['localhost', 'backend', 'sandbox']
|
||||
|
||||
# Add PUBLIC_BACKEND_DOMAIN to ALLOWED_HOSTS if it already exists
|
||||
PUBLIC_BACKEND_DOMAIN = os.getenv('PUBLIC_BACKEND_DOMAIN')
|
||||
|
||||
if PUBLIC_BACKEND_DOMAIN:
|
||||
ALLOWED_HOSTS.append(PUBLIC_BACKEND_DOMAIN)
|
||||
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
|
@ -190,3 +183,6 @@ PUBLIC_WEB_FRONTEND_URL = os.getenv('PUBLIC_WEB_FRONTEND_URL', 'http://localhost
|
|||
FROM_EMAIL = os.getenv('FROM_EMAIL', 'no-reply@localhost')
|
||||
|
||||
RESET_PASSWORD_TOKEN_MAX_AGE = 60 * 60 * 48 # 48 hours
|
||||
|
||||
if PUBLIC_BACKEND_DOMAIN:
|
||||
ALLOWED_HOSTS.append(PUBLIC_BACKEND_DOMAIN)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
## Unreleased
|
||||
|
||||
* Fixed error when there is no view.
|
||||
* Added Ubuntu installation guide documentation.
|
||||
|
||||
## Released (2020-10-06)
|
||||
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
# Installation on Ubuntu
|
||||
|
||||
This guide will walk you through a production installation of Baserow. Specifically this
|
||||
document aims to provide a walkthrough for servers running Ubuntu 18.04.03 LTS. These instructions
|
||||
have been tested with a clean install of Ubuntu 18.04.03 LTS and a user account with root access.
|
||||
Note that without root access, many of the instructions cannot be executed, so root access is necessary
|
||||
in almost all cases.
|
||||
This guide will walk you through a production installation of Baserow. Specifically
|
||||
this document aims to provide a walkthrough for servers running Ubuntu 18.04.03 LTS.
|
||||
These instructions have been tested with a clean install of Ubuntu 18.04.03 LTS and a
|
||||
user account with root access. Note that without root access, many of the instructions
|
||||
cannot be executed, so root access is necessary in almost all cases.
|
||||
|
||||
# Prerequisites
|
||||
|
||||
## Update & Upgrade Packages
|
||||
In order to make sure that we're getting the correct and new versions of any packages we install, we need to update and upgrade our packages.
|
||||
|
||||
In order to make sure that we're getting the correct and new versions of any packages
|
||||
we install, we need to update and upgrade our packages.
|
||||
|
||||
```bash
|
||||
$ sudo apt update
|
||||
|
@ -16,11 +19,17 @@ $ sudo apt upgrade -y
|
|||
```
|
||||
|
||||
## A quick note on firewalls
|
||||
In order to serve web content you will need to open up the HTTP (and HTTPS) ports 80 (and 443). You can do this with a firewall - `ufw` might be good place to start if you are new to firewalls.
|
||||
|
||||
In order to serve web content you will need to open up the HTTP (and HTTPS) ports 80
|
||||
(and 443). You can do this with a firewall - `ufw` might be good place to start if you
|
||||
are new to firewalls.
|
||||
|
||||
# Installation
|
||||
|
||||
## Install & Setup PostgreSQL
|
||||
Baserow uses PostgreSQL in order to store its user data. You can install PostgreSQL with the following commands:
|
||||
|
||||
Baserow uses PostgreSQL in order to store its user data. You can install PostgreSQL
|
||||
with the following commands:
|
||||
|
||||
```
|
||||
$ sudo apt install postgresql postgresql-contrib -y
|
||||
|
@ -34,12 +43,14 @@ GRANT
|
|||
postgres=# \q
|
||||
```
|
||||
|
||||
Make sure that you use a secure password instead of `yourpassword`! Also take care that you use the password
|
||||
you've chosen in any upcoming commands that need the PostgreSQL baserow user password.
|
||||
Make sure that you use a secure password instead of `yourpassword`! Also take care that
|
||||
you use the password you've chosen in any upcoming commands that need the PostgreSQL
|
||||
baserow user password.
|
||||
|
||||
## Install Baserow
|
||||
In this section, we will install Baserow itself. We will need a new user called `baserow`. Baserow uses the `/baserow` directory
|
||||
for storing the application itself.
|
||||
|
||||
In this section, we will install Baserow itself. We will need a new user called
|
||||
`baserow`. Baserow uses the `/baserow` directory for storing the application itself.
|
||||
|
||||
```bash
|
||||
# Create baserow user
|
||||
|
@ -57,11 +68,14 @@ $ cd /baserow
|
|||
$ git clone https://gitlab.com/bramw/baserow/ .
|
||||
```
|
||||
|
||||
The password used for the `baserow` user does not have to be the same as the one used with PostgreSQL. Just make sure
|
||||
that you use a secure password and that you remember it for when you need it later.
|
||||
The password used for the `baserow` user does not have to be the same as the one used
|
||||
with PostgreSQL. Just make sure that you use a secure password and that you remember
|
||||
it for when you need it later.
|
||||
|
||||
## Install dependencies for & setup Baserow
|
||||
In order to use the Baserow application, we will need to create a virtual environment and install some more dependencies like: NodeJS, Yarn, Python 3.
|
||||
|
||||
In order to use the Baserow application, we will need to create a virtual environment
|
||||
and install some more dependencies like: NodeJS, Yarn, Python 3.
|
||||
|
||||
```bash
|
||||
# Install python3, pip & virtualenv
|
||||
|
@ -99,8 +113,9 @@ $ ./node_modules/nuxt/bin/nuxt.js build --config-file config/nuxt.config.demo.js
|
|||
|
||||
|
||||
## Install NGINX
|
||||
Baserow uses NGINX as a reverse proxy for it's frontend and backend. Through that, you can easily add SSL Certificates and
|
||||
add more applications to your server if you want to.
|
||||
Baserow uses NGINX as a reverse proxy for it's frontend and backend. Through that, you
|
||||
can easily add SSL Certificates and add more applications to your server if you want
|
||||
to.
|
||||
|
||||
```bash
|
||||
# Go back to baserow root directory
|
||||
|
@ -112,9 +127,16 @@ $ service nginx start
|
|||
```
|
||||
|
||||
## Setup NGINX
|
||||
If you're unfamiliar with NGINX: NGINX uses so called "virtualhosts" to direct web traffic from outside of your network to the correct application on your server. These virtual hosts are defined in `.conf` files which are put into the `/etc/nginx/sites-enabled/` directory where NGINX will then process them on startup. Baserow comes with two configuration files for NGINX. After moving these over, change the `server_name` value in both of the files. The server name is the domain under which you want Baserow to be reachable.
|
||||
If you're unfamiliar with NGINX: NGINX uses so called "virtualhosts" to direct web
|
||||
traffic from outside of your network to the correct application on your server. These
|
||||
virtual hosts are defined in `.conf` files which are put into the
|
||||
`/etc/nginx/sites-enabled/` directory where NGINX will then process them on startup.
|
||||
Baserow comes with two configuration files for NGINX. After moving these over, change
|
||||
the `server_name` value in both of the files. The server name is the domain under
|
||||
which you want Baserow to be reachable.
|
||||
|
||||
Make sure that in the following commands you replace `api.domain.com` with your own backend domain and that you replace `baserow.domain.com` with your frontend domain.
|
||||
Make sure that in the following commands you replace `api.domain.com` with your own
|
||||
backend domain and that you replace `baserow.domain.com` with your frontend domain.
|
||||
|
||||
```bash
|
||||
# Move virtualhost files to /etc/nginx/sites-enabled/
|
||||
|
@ -131,10 +153,20 @@ $ service nginx restart
|
|||
```
|
||||
|
||||
## Baserow Configuration
|
||||
### Configuration
|
||||
Baserow needs a few environment variables to be set in order to work properly. Here is a list of the environment variables with explanations for them. This list is solely for reference, there is no need to set these variables because they will be set through `supervisor` later on. This list does not describe all environment variables that can be set. For a better understanding of the available environment variables, take a look at `/baserow/backend/src/config/settings/base.py`.
|
||||
|
||||
We discourage changing the content of the `base.py` file since it might be overridden through a future update with `git pull`. It is only mentioned in this guide so that you're able to modify your Baserow instance as easily as possible with environment variables.
|
||||
### Configuration
|
||||
|
||||
Baserow needs a few environment variables to be set in order to work properly. Here is
|
||||
a list of the environment variables with explanations for them. This list is solely
|
||||
for reference, there is no need to set these variables because they will be set
|
||||
through `supervisor` later on. This list does not describe all environment variables
|
||||
that can be set. For a better understanding of the available environment variables,
|
||||
take a look at `/baserow/backend/src/config/settings/base.py`.
|
||||
|
||||
We discourage changing the content of the `base.py` file since it might be overridden
|
||||
through a future update with `git pull`. It is only mentioned in this guide so that
|
||||
you're able to modify your Baserow instance as easily as possible with environment
|
||||
variables.
|
||||
|
||||
```
|
||||
# Backend Domain & URL
|
||||
|
@ -158,17 +190,25 @@ PYTHONPATH=/baserow:/baserow/plugins/saas/backend/src
|
|||
SECRET_KEY="Something_Secret"
|
||||
```
|
||||
|
||||
Baserow uses the secret key to generate a variety of tokens (e.g. password reset token, ...).
|
||||
In order to generate a unique secret key, you can simply run the following command.
|
||||
Baserow uses the secret key to generate a variety of tokens (e.g. password reset
|
||||
token, ...). In order to generate a unique secret key, you can simply run the following
|
||||
command.
|
||||
|
||||
```bash
|
||||
$ cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 80 | head -n 1
|
||||
```
|
||||
|
||||
The output will be a alphanumeric string with 80 characters. You can shorten or lengthen the string by changing the number value in `fold -w 80` to a length you're satisfied with.
|
||||
The output will be a alphanumeric string with 80 characters. You can shorten or
|
||||
lengthen the string by changing the number value in `fold -w 80` to a length you're
|
||||
satisfied with.
|
||||
|
||||
### Import relations into database
|
||||
In the "*Install & Setup PostgreSQL*" Section, we created a database called `baserow` for the application. Since we didn't do anything with that database it is still empty, which will result in a non-working application since Baserow expects certain tables and relations to exist in that database. You can create these with the following commands:
|
||||
In the "*Install & Setup PostgreSQL*" Section, we created a database called `baserow`
|
||||
for the application. Since we didn't do anything with that database it is still empty,
|
||||
which will result in a non-working application since Baserow expects certain tables
|
||||
and relations to exist in that database. You can create these with the following
|
||||
commands:
|
||||
|
||||
```bash
|
||||
# Prepare for creating the database schema
|
||||
$ source backend/env/bin/activate
|
||||
|
@ -183,7 +223,10 @@ $ deactivate
|
|||
```
|
||||
|
||||
## Install & Configure Supervisor
|
||||
Supervisor is an application that starts and keeps track of processes and will restart them if the process finishes. For Baserow this is used to reduce downtime and in order to restart the application in the unlikely event of an unforseen termination. You can install and configure it with these commands:
|
||||
Supervisor is an application that starts and keeps track of processes and will restart
|
||||
them if the process finishes. For Baserow this is used to reduce downtime and in order
|
||||
to restart the application in the unlikely event of an unforseen termination. You can
|
||||
install and configure it with these commands:
|
||||
|
||||
```bash
|
||||
# Install supervisor
|
||||
|
@ -196,20 +239,28 @@ $ mkdir /var/log/baserow/
|
|||
$ cd /baserow
|
||||
$ cp docs/guides/installation/configuration-files/supervisor/* /etc/supervisor/conf.d/
|
||||
```
|
||||
You will need to edit the `baserow-frontend.conf` and `baserow-backend.conf` files (located now at `/etc/supervisor/conf.d/`) in order to set the necessary environment variables. You will need to change at least the following variables which can be found in the `environment=` section.
|
||||
You will need to edit the `baserow-frontend.conf` and `baserow-backend.conf` files
|
||||
(located now at `/etc/supervisor/conf.d/`) in order to set the necessary environment
|
||||
variables. You will need to change at least the following variables which can be found
|
||||
in the `environment=` section.
|
||||
|
||||
**Frontend**
|
||||
- `PUBLIC_WEB_FRONTEND_URL`: The URL under which your frontend can be reached from the internet (HTTP or HTTPS)
|
||||
- `PUBLIC_BACKEND_URL`: The URL under which your backend can be reached from the internet (HTTP or HTTPS)
|
||||
- `PUBLIC_WEB_FRONTEND_DOMAIN`: The domain under which you frontend can be reached from the internet (same as URL but without `https://`)
|
||||
- `PUBLIC_BACKEND_DOMAIN`: The domain under which you backend can be reached from the internet (same as URL but without `https://`)
|
||||
- `PUBLIC_WEB_FRONTEND_URL`: The URL under which your frontend can be reached from the
|
||||
internet (HTTP or HTTPS)
|
||||
- `PUBLIC_BACKEND_URL`: The URL under which your backend can be reached from the
|
||||
internet (HTTP or HTTPS)
|
||||
- `PUBLIC_WEB_FRONTEND_DOMAIN`: The domain under which you frontend can be reached from
|
||||
the internet (same as URL but without `https://`)
|
||||
- `PUBLIC_BACKEND_DOMAIN`: The domain under which you backend can be reached from the
|
||||
internet (same as URL but without `https://`)
|
||||
|
||||
**Backend**
|
||||
- `SECRET_KEY`: The secret key that is used to generate tokens and other random strings
|
||||
- `DATABASE_PASSWORD`: The password of the `baserow` database user
|
||||
- `DATABASE_HOST`: The host computer that runs the database (usually `localhost`)
|
||||
|
||||
After modifying these files you need to make supervisor reread the files and apply the changes.
|
||||
After modifying these files you need to make supervisor reread the files and apply the
|
||||
changes.
|
||||
|
||||
```bash
|
||||
# Stop NGINX service so that supervisor can take over
|
||||
|
@ -225,12 +276,21 @@ $ supervisorctl update
|
|||
$ supervisorctl status
|
||||
```
|
||||
|
||||
If the `reread` oder the `update` command fail, try checking the logs at `/var/log/baserow/` - it is possible that another process is listening to one of the ports which would terminate NGINX, or parts of Baserow.
|
||||
If the `reread` oder the `update` command fail, try checking the logs at
|
||||
`/var/log/baserow/` - it is possible that another process is listening to one of the
|
||||
ports which would terminate NGINX, or parts of Baserow.
|
||||
|
||||
## HTTPS / SSL Support
|
||||
Since you're probably serving private data with Baserow, we strongly encourage to use a SSL certificate to encrypt the traffic between the browser and your server. You can do that with the following commands. We will do that with certbot, which retrieves a SSL certificate from the LetsEncrypt Certificate Authority.
|
||||
|
||||
If you're not installing Baserow on a completely new server, you might need to remove previously installed `certbot` binaries from your machine. Consult the [certbot installation instructions](https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx) for more information.
|
||||
Since you're probably serving private data with Baserow, we strongly encourage to use a
|
||||
SSL certificate to encrypt the traffic between the browser and your server. You can do
|
||||
that with the following commands. We will do that with certbot, which retrieves a SSL
|
||||
certificate from the LetsEncrypt Certificate Authority.
|
||||
|
||||
If you're not installing Baserow on a completely new server, you might need to remove
|
||||
previously installed `certbot` binaries from your machine. Consult the
|
||||
[certbot installation instructions](https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx)
|
||||
for more information.
|
||||
|
||||
```bash
|
||||
# Install certbot
|
||||
|
@ -248,4 +308,6 @@ $ supervisorctl restart nginx
|
|||
```
|
||||
|
||||
## Ending
|
||||
You now have a full installation of Baserow, which will keep the Front- & Backend running even if there is an unforeseen termination of them.
|
||||
|
||||
You now have a full installation of Baserow, which will keep the Front- & Backend
|
||||
running even if there is an unforeseen termination of them.
|
||||
|
|
|
@ -25,6 +25,8 @@ Need some help with setting things up?
|
|||
|
||||
* [Local demo](./guides/demo-environment.md): Run a local demo on your computer using
|
||||
`docker-compose`.
|
||||
* [Install on Ubuntu](./guides/installation/install-on-ubuntu.md): A step by step guide
|
||||
on how to install Baserow on a Ubuntu server.
|
||||
|
||||
## Development
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue