mirror of
https://github.com/etesync/server
synced 2024-11-26 10:48:21 +00:00
Update to Etebase and Daphne
parent
21f372b5be
commit
b7d4e95a39
@ -1,30 +1,33 @@
|
|||||||
Having to run uWSGI manually is annoying and not maintainable.
|
Having to run Daphne manually is annoying and not maintainable.
|
||||||
Instead, you should have `systemd` automatically start it at boot for you.
|
Instead, you should have `systemd` automatically start it at boot for you.
|
||||||
|
|
||||||
We can have `systemd` handle lauching uWSGI by creating a unit file for it.
|
We can have `systemd` handle lauching Daphne by creating a unit file for it.
|
||||||
Create a new file called `etesync_server.service` and paste in the following.
|
Create a new file called `etebase_server.service` and paste in the following.
|
||||||
Don't forget to set the correct path to your installation.
|
Don't forget to set the correct path to your installation and to your venv.
|
||||||
If you don't use a `.ini` file, pass flags here to your uWSGI.
|
|
||||||
|
Note that we directly run the Daphne which is located in our virtual environment (at `/path/to/etebase/venv`).
|
||||||
|
If your virtual environment is located elsewhere, be sure to update this.
|
||||||
|
|
||||||
```
|
```
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Execute the etesync server.
|
Description=Execute the etebase server.
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/uwsgi --ini /path/to/server-skeleton/uwsgi.ini
|
WorkingDirectory=/path/to/etebase
|
||||||
|
ExecStart=/path/to/etebase/venv/bin/daphne -u /tmp/etebase_server.sock etebase_server.asgi:application
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
```
|
```
|
||||||
|
|
||||||
Next, copy this to `/etc/systemd/system`.
|
Next, copy this to `/etc/systemd/system/`.
|
||||||
`systemd` should now be able to start it.
|
`systemd` should now be able to start it.
|
||||||
By also enabling it, it will launch at boot.
|
By also enabling it, it will launch at boot.
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo cp etesync_server.service /etc/systemd/system
|
$ sudo cp etesync_server.service /etc/systemd/system
|
||||||
sudo systemctl start etesync_server
|
$ sudo systemctl start etesync_server
|
||||||
sudo systemctl enable etesync_server
|
$ sudo systemctl enable etesync_server
|
||||||
```
|
```
|
||||||
|
|
||||||
Check to see if it worked!
|
Check to see if it worked!
|
||||||
|
Loading…
Reference in New Issue
Block a user