1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00
joplin/packages/server
2021-01-13 12:19:12 +00:00
..
assets/tests Server: Add Joplin Server package (#1872) 2020-12-28 11:48:47 +00:00
public Server: Add basic file manager 2020-12-29 18:04:57 +00:00
src Server: Started moving controller tests to routes 2021-01-12 22:03:31 +00:00
.gitignore Server: Add Joplin Server package (#1872) 2020-12-28 11:48:47 +00:00
jest.config.js Tools: Setup server tests 2021-01-07 22:15:41 +00:00
jest.setup.js Tools: Setup server tests 2021-01-07 22:15:41 +00:00
nodemon.json Server: Add Joplin Server package (#1872) 2020-12-28 11:48:47 +00:00
package-lock.json Server: Add test units for sessions route 2021-01-12 18:08:14 +00:00
package.json Setup new release version 1.7 2021-01-13 12:19:12 +00:00
README.md Doc: Fixed server doc 2021-01-04 16:16:09 +00:00
tsconfig.json Server: Add Joplin Server package (#1872) 2020-12-28 11:48:47 +00:00

Installing

Configuration

First copy .env-sample to .env and edit the values in there:

  • JOPLIN_BASE_URL: This is the base public URL where the service will be running. For example, if you want it to run from https://example.com/joplin, this is what you should set the URL to. The base URL can include the port.
  • JOPLIN_PORT: The local port on which the Docker container will listen. You would typically map this port to 443 (TLS) with a reverse proxy.

Install application

wget https://github.com/laurent22/joplin/archive/server-v1.6.4.tar.gz
tar xzvf server-v1.6.4.tar.gz
mv joplin-server-v1.6.4 joplin-server
cd joplin-server
docker-compose --file docker-compose.server.yml up --detach

This will start the server, which will listen on port 22300 on localhost.

Due to the restart policy defined in the docker-compose file, the server will be restarted automatically whenever the host reboots.

Setup reverse proxy

You will then need to expose this server to the internet by setting up a reverse proxy, and that will depend on how your server is currently configured, and whether you already have Nginx or Apache running:

Setup admin user

For the following instructions, we'll assume that the Joplin server is running on https://example.com/joplin.

By default, the instance will be setup with an admin user with email admin@localhost and password admin and you should change this by opening the admin UI. To do so, open https://example.com/joplin/login. From there, go to Profile and change the admin password.

Setup a user for sync

While the admin user can be used for synchronisation, it is recommended to create a separate non-admin user for it. To do, open the admin UI and navigate to the Users page - from there you can create a new user.

Once this is done, you can use the email and password you specified to sync this user account with your Joplin clients.

Checking the logs

Checking the log can be done the standard Docker way:

docker-compose --file docker-compose.server.yml logs

Set up for development

Setting up the database

SQLite

The server supports SQLite for development and test units. To use it, open src/config-dev.ts and uncomment the sqlite3 config.

PostgreSQL

It's best to use PostgreSQL as this is what is used in production, however it requires Docker.

To use it, from the monorepo root, run docker-compose --file docker-compose.server-dev.yml up, which will start the PostgreSQL database.

Starting the server

From packages/server, run npm run start-dev