1
0
mirror of https://github.com/etesync/server synced 2024-11-22 00:38:07 +00:00
11 Basic Setup Etebase (EteSync v2)
Xiretza edited this page 2022-11-30 18:11:12 +01:00

This guide details an initial setup of an Etebase server. It is specifically written for Ubuntu/Debian, but you should be able to use it as a guide for different systems as well. Etebase is EteSync v2. For more information, read the blog post announcing it.

This guide assumes that you have basic knowledge of domains in order to set up your own domain.

Download Etebase server

First we install the Python virtual environment package, clone the repo, set up the virtual environment and install the Python dependencies. We use a virtual environment as this avoids having to install the dependencies system-wide.

$ apt-get install python3-virtualenv

$ cd ~  # To set up the server in your home dir
$ git clone https://github.com/etesync/server.git etebase
$ cd etebase

$ virtualenv -p python3 .venv  # If doesn't work, try: virtualenv3 .venv
$ source .venv/bin/activate

$ pip3 install -r requirements.txt

Configure Application

Since the Etebase server is a Django application, we will refer to it as "the application" from now on.

To configure the application, you need a Django .ini file. Luckily, the repo already contains a basic ini called etebase-server.ini.example which we can copy.

$ cp etebase-server.ini.example etebase-server.ini

Open the file, and set allowed hosts to *. (Note: this is just for testing purposes. Set this to your domain name later.)

It should now look like this:

[global]
secret_file = secret.txt
debug = false
;Set the paths where data will be stored at
static_root = /path/to/static
media_root = /path/to/media
;Advanced options, only uncomment if you know what you're doing:
;static_url = /static/
;media_url = /user-media/
;language_code = en-us
;time_zone = UTC

[allowed_hosts]
allowed_host1 = *

[database]
engine = django.db.backends.sqlite3
name = db.sqlite3

If you require a custom path for the media or the db, make sure that you have the correct permissions for the paths.

Set up ASGI server

Next, we set up an ASGI server, which will serve as a way to interface with our application. We advise using uvicorn, but other ASGI servers such as Daphne will also work. Please note that WSGI is no longer supported, so if you have an older setup using uWSGI you will have to change to ASGI.

Installing uvicorn is easily done via pip. Make sure to install it inside your virtual environment if you are using one.

pip3 install uvicorn[standard]

Test the application

After initializing the server and installing uvicorn, we can test the application by running it for the first time. We will do this by running the uvicorn server at port 8000.

$ ./manage.py migrate
$ uvicorn etebase_server.asgi:application --port 8000 --host 0.0.0.0

On the machine, you can now surf to 0.0.0.0:8000 and it should show a page saying "It works!" If you're on a different machine than the one running the server, surf to its (local) IP address followed by the port number, e.g. 192.168.x.x:8000.

If this works, congratulations! You now have a functioning Django application. This is not yet a production setup however.

Using this server in production is not recommended, so please continue to this page to set up a proper deployment.