2019-02-04 14:21:41 +00:00
< p align = "center" >
< img width = "120" src = "icon.svg" / >
< h1 align = "center" > EteSync - Secure Data Sync< / h1 >
< / p >
2017-11-19 18:01:34 +00:00
A skeleton app for running your own [EteSync ](https://www.etesync.com ) server
# Installation
2019-05-21 11:00:13 +00:00
## Using pre-built packages
* Arch Linux : [AUR ](https://aur.archlinux.org/packages/etesync-server )
* Fedora : [COPR ](https://copr.fedorainfracloud.org/coprs/daftaupe/etesync )
2019-09-17 09:14:00 +00:00
## From source
2019-05-21 11:00:13 +00:00
2019-03-15 08:39:14 +00:00
Before installing the EteSync server make sure you install `virtualenv` (for **Python 3** ):
* Arch Linux: `pacman -S python-virtualenv`
* Debian/Ubuntu: `apt-get install python3-virtualenv`
2019-09-17 09:14:00 +00:00
* Mac/Windows/Other Linux: install virtualenv or just skip the instructions mentioning virtualenv.
2019-03-15 08:39:14 +00:00
Then just clone the git repo and set up this app:
2017-11-19 18:01:34 +00:00
```
git clone https://github.com/etesync/server-skeleton.git
cd server-skeleton
# Set up the environment and deps
2019-03-15 08:39:14 +00:00
virtualenv -p python3 venv # If doesn't work, try: virtualenv3 venv
source venv/bin/activate
2017-11-19 18:01:34 +00:00
pip install -r requirements.txt
```
2019-05-21 11:00:13 +00:00
# Configuration
2019-05-01 10:40:48 +00:00
If you are familiar with Django you can just edit the [settings file ](etesync_server/settings.py )
2019-08-04 15:11:47 +00:00
according to the [Django deployment checklist ](https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ )
if you are not, we also provide a simple [configuration file ](etesync-server.ini.example )
for easy deployment which you can use.
2019-10-07 19:09:09 +00:00
To use the easy configuration file rename it to `etesync-server.ini` and place it either at the root of this repository or in `/etc/etesync-server` .
2019-05-01 10:40:48 +00:00
Some particular settings that should be edited are:
2018-02-18 04:20:29 +00:00
* [`ALLOWED_HOSTS` ](https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-ALLOWED_HOSTS )
-- this is the list of host/domain names or addresses on which the app
will be served
* [`DEBUG` ](https://docs.djangoproject.com/en/1.11/ref/settings/#debug )
-- handy for debugging, set to `False` for production
* [`SECRET_KEY` ](https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-SECRET_KEY )
-- an ephemeral secret used for various cryptographic signing and token
generation purposes. See below for how default configuration of
`SECRET_KEY` works for this project.
2017-11-19 18:01:34 +00:00
Now you can initialise our django app
```
./manage.py migrate
```
2019-04-29 14:42:13 +00:00
And you are done! You can now run the debug server just to see everything works as expected by running:
2017-11-19 18:01:34 +00:00
```
./manage.py runserver 0.0.0.0:8000
```
2019-04-29 14:42:13 +00:00
Using the debug server in production is not recommended, so please read the following section for a proper deployment.
2017-11-19 18:01:34 +00:00
2019-04-29 14:42:13 +00:00
# Production deployment
2019-08-02 18:39:59 +00:00
EteSync is based on Django so you should refer to one of the following
* The instructions of the Django project [here ](https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ ).
2019-10-22 21:42:13 +00:00
* Instructions from uwsgi [here ](http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html ).
2019-08-02 18:39:59 +00:00
* The [example configurations ](example-configs ) in this repo.
2019-04-29 14:42:13 +00:00
2020-02-03 19:11:16 +00:00
There are more details about a proper production setup using uWSGI and Nginx in the [wiki ](https://github.com/etesync/server/wiki/Production-setup-using-uWSGI-and-Nginx ).
2019-04-29 14:42:13 +00:00
2020-02-03 19:11:16 +00:00
The webserver should also be configured to serve EteSync using TLS.
A guide for doing so can be found in the [wiki ](https://github.com/etesync/server/wiki/Setup-HTTPS-for-EteSync ) as well.
2019-04-29 14:42:13 +00:00
2017-11-19 18:01:34 +00:00
# Usage
Create yourself an admin user:
```
./manage.py createsuperuser
```
At this stage you can either just use the admin user, or better yet, go to: ```www.your-etesync-install.com/admin```
and create a non-privileged user that you can use.
That's it!
Now all that's left is to open the EteSync app, add an account, and set your custom server address under the "advance" section.
2017-11-29 17:59:59 +00:00
2018-02-18 04:20:29 +00:00
# `SECRET_KEY` and `secret.txt`
The default configuration creates a file “`secret.txt`” in the project’ s
base directory, which is used as the value of the Django `SECRET_KEY`
setting. You can revoke this key by deleting the `secret.txt` file and the
next time the app is run, a new one will be generated. Make sure you keep
the `secret.txt` file secret (don’ t accidentally commit it to version
control, exclude it from your backups, etc.). If you want to change to a
more secure system for storing secrets, edit `etesync_server/settings.py`
and implement your own method for setting `SECRET_KEY` (remove the line
where it uses the `get_secret_from_file` function). Read the Django docs
for more information about the `SECRET_KEY` and its uses.
# Updating
2019-03-08 16:41:37 +00:00
First, run `git pull --rebase` to update this repository.
Then, inside the virtualenv:
1. Run `pip install -U -r requirements.txt` to update the dependencies.
2. Run `python manage.py migrate` to perform database migrations.
You can now restart the server.
2018-02-18 04:20:29 +00:00
2017-11-29 17:59:59 +00:00
# Supporting EteSync
2020-09-11 13:01:44 +00:00
Please consider registering an account even if you self-host in order to support the development of EteSync, or visit the [contribution ](https://www.etesync.com/contribute/ ) for more information on how to support the service.