1
0
mirror of https://github.com/etesync/server synced 2024-11-17 22:38:29 +00:00
Go to file
Tom Hacohen f694f46fb4
Merge: A few commits to simplify the configuration
A few commits to make it easier to run your own instance.
2018-02-20 11:54:06 +00:00
etesync_server Refactor out the secret.txt file handling to a utils module 2018-02-18 14:19:29 +10:00
.gitignore Use secret.txt file auto-generated in project root as default SECRET_KEY 2018-02-18 13:43:29 +10:00
LICENSE Initial commit: add license. 2017-11-02 22:12:17 +00:00
manage.py Initial commit of the actual server code. 2017-11-19 21:36:48 +00:00
README.md README: update Django docs link version to 1.11 2018-02-18 14:30:50 +10:00
requirements.txt Change requirements.txt to allow updating to latest patch version 2018-02-18 13:35:23 +10:00

A skeleton app for running your own EteSync server

Installation

To setup your own EteSync server based on the git version just clone this git repository and set up the django app:

git clone https://github.com/etesync/server-skeleton.git

cd server-skeleton

# Set up the environment and deps
virtualenv .venv
source .venv/bin/activate

pip install -r requirements.txt

Edit the settings file. Please refer to the Django deployment checklist for full instructions on how to configure a Django app for production. Some particular settings that should be edited are:

  • ALLOWED_HOSTS -- this is the list of host/domain names or addresses on which the app will be served
  • DEBUG -- handy for debugging, set to False for production
  • 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.

Now you can initialise our django app

./manage.py migrate

And you are done! You can now either run the debug server just to see everything works as expected by running:

./manage.py runserver 0.0.0.0:8000

Using the debug server in production is not recommended, so you should configure your webserver to serve etesync (with TLS). An example on how to do so with nginx can be found here.

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.

SECRET_KEY and secret.txt

The default configuration creates a file “secret.txt” in the projects 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 (dont 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

Inside the virtualenv, run pip install -U -r requirements.txt to update dependencies to latest compatible versions of Django and djangorestframework (it will only update to latest patch level which should be API-compatible).

Supporting EteSync

Please consider registering an account even if you self-host in order to support the development of EteSync, or help by spreading the word.