Skip to content

Commit a6d8d2c

Browse files
docs: update README to link to new documentation site
1 parent 8741665 commit a6d8d2c

1 file changed

Lines changed: 9 additions & 299 deletions

File tree

README.md

Lines changed: 9 additions & 299 deletions
Original file line numberDiff line numberDiff line change
@@ -1,310 +1,20 @@
11
# Linkora Sync-Server
22

3-
A self-hosted sync server designed for individual use and built for single-user setups, keeping your Linkora apps in
4-
sync. Now with built-in HTTPS support and compatibility with the Linkora browser extension for comprehensive syncing.
3+
A self-hosted sync server designed for individual use, keeping your Linkora apps in sync.
54

6-
-----
5+
---
76

8-
## Key Features
7+
## Documentation
98

10-
- **Delta-Sync**: Only transfers changed data for efficiency.
11-
- **Two-Way Sync**: Changes flow in both directions between the server and clients.
12-
- **Real-Time Updates**: Live updates via WebSocket connections.
13-
- **Last-Write-Wins**: If multiple devices update the same data, the latest write wins the conflict.
14-
- **Secure HTTPS**: Secure connections are supported by automatically generating self-signed certificates and keystore
15-
files.
16-
- **Browser Extension Support**: Works with the Linkora browser extension for seamless web activity synchronization.
17-
- **Multi-Database Support**: Works with MySQL, PostgreSQL, SQLite, and other SQL databases supported
18-
by [JetBrains Exposed](https://github.com/JetBrains/Exposed).
19-
- **Flexible Deployment**: Local JAR, Docker containers, or cloud hosting.
9+
For a complete guide on installation, configuration, deployment, and troubleshooting, please see the **[Official Linkora Sync-Server Documentation](https://linkora-sync-server-docs.netlify.app/)**.
2010

21-
-----
11+
The documentation site is built with [Genesis](https://github.com/sakethpathike/genesis).
2212

23-
## Quick Start
24-
25-
### Prerequisites
26-
27-
For JAR deployment:
28-
29-
- **Java 11 or later**
30-
31-
For Docker deployment:
32-
33-
- **Docker** (handles all dependencies, no Java installation required)
34-
35-
Supported Databases:
36-
37-
- **Tested**: MySQL, PostgreSQL, SQLite
38-
- **Untested**: Other databases supported by [JetBrains Exposed](https://github.com/JetBrains/Exposed)
39-
40-
**Warning**: Untested databases may have compatibility issues. Sticking to MySQL, PostgreSQL, or SQLite is recommended
41-
for the best experience.
42-
43-
### Getting Started with HTTPS
44-
45-
The server automatically handles HTTPS setup by generating self-signed certificates and keystore files on its first run.
46-
This means you get secure connections out-of-the-box without manual certificate configuration. These server-signed
47-
certificates have a validity period of 365 days. To use these certificates, you may need to import them into your
48-
system's trust store or directly into your browser, as the browser extension requires the certificate to be recognized.
49-
Some browsers, like Firefox, may reject self-signed certificates, requiring you to manually add an exception for the
50-
IPv4 address and port used by HTTPS.
51-
52-
To generate new certificates and keystore files, you have two options:
53-
54-
1. **Restart the server**: If the existing certificate and keystore files are removed from the server's directory,
55-
restarting the server will trigger the automatic generation of new ones.
56-
2. **Use the server's API endpoint**: Navigate to `/generate/certs-and-keystore` in your browser. You will be prompted
57-
to enter your `serverAuthToken`. Once entered, you will have two options: to *only generate* new certificates and
58-
keystore files (which will be saved in the same directory where the server JAR is located), or to *generate and
59-
download* them. If you choose to generate and download, the server will respond with a ZIP file containing all the
60-
newly generated files. If an incorrect authentication token is provided, the server will reject the request.
61-
62-
### Browser Extension
63-
64-
Get the **Linkora browser extension** to sync your web-based data. Find detailed setup instructions on
65-
the [Linkora Browser Extension GitHub repository](https://github.com/LinkoraApp/browser-extension).
66-
67-
-----
68-
69-
## Configuration
70-
71-
You can configure the server using either a configuration file or environment variables.
72-
73-
### Option 1: Configuration File (`linkoraConfig.json`)
74-
75-
This file is auto-generated on the first run; the server will prompt you for required values. The `hostAddress` and
76-
`serverPort` fields are automatically detected and set by the server.
77-
78-
```json
79-
{
80-
"databaseUrl": "mysql://localhost:3306/linkora",
81-
"databaseUser": "your_username",
82-
"databasePassword": "your_password",
83-
"hostAddress": "xxx.xxx.xxx.xxx",
84-
"serverPort": 45454,
85-
"httpsPort": 54545,
86-
"keyStorePassword": "your_keystore_password",
87-
"serverAuthToken": "your_secure_token"
88-
}
89-
```
90-
91-
**HTTPS Configuration Details**:
92-
93-
- `httpsPort`: This optional field sets the port for HTTPS connections (default: `54545`).
94-
- `keyStorePassword`: This password for your keystore is **auto-generated by the server**.
95-
- For HTTPS connections, the server always uses the machine's IPv4 address. The `hostAddress` field in the configuration
96-
file primarily applies to HTTP connections.
97-
98-
### Option 2: Environment Variables
99-
100-
Use these for containerized deployments, cloud hosting, or any scenario where you prefer environment variables over
101-
configuration files. `LINKORA_HOST_ADDRESS`, `LINKORA_SERVER_PORT`, `LINKORA_HTTPS_PORT`, and
102-
`LINKORA_KEY_STORE_PASSWORD` are all optional, as the server can auto-detect/set them.
103-
104-
```bash
105-
LINKORA_SERVER_USE_ENV_VAL=true
106-
LINKORA_DATABASE_URL=mysql://localhost:3306/linkora
107-
LINKORA_DATABASE_USER=your_username
108-
LINKORA_DATABASE_PASSWORD=your_password
109-
LINKORA_HOST_ADDRESS=xxx.xxx.xxx.xxx
110-
LINKORA_SERVER_PORT=45454
111-
LINKORA_HTTPS_PORT=54545
112-
LINKORA_KEY_STORE_PASSWORD=your_keystore_password
113-
LINKORA_SERVER_AUTH_TOKEN=your_secure_token
114-
```
115-
116-
### Database URL Formats
117-
118-
| Database | URL Format |
119-
|------------|--------------------------------------------|
120-
| MySQL | `mysql://hostname:port/database_name` |
121-
| PostgreSQL | `postgresql://hostname:port/database_name` |
122-
| SQLite | `sqlite:/path/to/database/file.db` |
123-
124-
**Important**: For SQLite, leave `databaseUser` and `databasePassword` empty.
125-
126-
-----
127-
128-
## Deployment Options
129-
130-
### Local Deployment
131-
132-
#### Using JAR File
133-
134-
1. Download the latest release JAR file.
135-
136-
2. Create a dedicated folder for the server.
137-
138-
3. **Critical**: Run from your terminal (never double-click the JAR):
139-
140-
```bash
141-
java -jar linkoraSyncServer.jar
142-
```
143-
144-
**Recommendation**: Place the JAR file in a separate folder since `linkoraConfig.json`, as well as the server's
145-
certificates and keystore files, are generated in the same directory.
146-
147-
#### Using Docker
148-
149-
```bash
150-
# Pull the latest version of the image
151-
docker pull sakethpathike/linkora-sync-server:latest
152-
153-
# Run the server with environment variables
154-
# LINKORA_HOST_ADDRESS, LINKORA_SERVER_PORT, LINKORA_HTTPS_PORT, and LINKORA_KEY_STORE_PASSWORD are optional
155-
docker run -d \
156-
-e LINKORA_SERVER_USE_ENV_VAL=true \
157-
-e LINKORA_DATABASE_URL=mysql://your-db-url \
158-
-e LINKORA_DATABASE_USER=your-username \
159-
-e LINKORA_DATABASE_PASSWORD=your-password \
160-
-e LINKORA_HOST_ADDRESS=xxx.xxx.xxx.xxx \
161-
-e LINKORA_SERVER_PORT=45454 \
162-
-e LINKORA_HTTPS_PORT=54545 \
163-
-e LINKORA_KEY_STORE_PASSWORD=your_keystore_password \
164-
-e LINKORA_SERVER_AUTH_TOKEN=your-secure-token \
165-
-p 45454:45454 \
166-
-p 54545:54545 \
167-
--name linkora-sync-server \
168-
sakethpathike/linkora-sync-server:latest
169-
```
170-
171-
### Cloud Deployment
172-
173-
For cloud hosting platforms:
174-
175-
1. Set `LINKORA_SERVER_USE_ENV_VAL=true` in your environment variables.
176-
2. Configure all required environment variables through your platform's interface.
177-
3. Ensure your database is accessible.
178-
179-
-----
180-
181-
## Systemd Setup
182-
183-
Create a service file in `/etc/systemd/system` and enable it to run at startup.
184-
Config & JAR files are in the same folder path.
185-
Add the below to your file (change values as per your setup) and name the file as `linkora.service`.
186-
187-
```bash
188-
[Unit]
189-
Description=linkora service
190-
After=network.target
191-
192-
[Service]
193-
SuccessExitStatus=143
194-
User=root
195-
Group=root
196-
Type=simple
197-
EnvironmentFile=PATH_TO_CONFIG/linkoraConfig.json
198-
WorkingDirectory=PATH_TO_JAR_FILE
199-
ExecStart=/usr/bin/java -jar linkoraSyncServer.jar
200-
ExecStop=/bin/kill -15 $MAINPID
201-
202-
[Install]
203-
WantedBy=multi-user.target
204-
```
205-
206-
Once saved, reload the daemon & start the service:
207-
208-
```bash
209-
systemctl daemon-reload
210-
systemctl start linkora.service
211-
systemctl enable linkora.service
212-
```
213-
214-
-----
215-
216-
## Firewall Configuration
217-
218-
If you can't connect to the server, ensure the necessary ports are allowed through your firewall:
219-
220-
```bash
221-
# Allow the HTTP port (default: 45454)
222-
sudo firewall-cmd --add-port=45454/tcp --permanent
223-
224-
# Allow the HTTPS port (default: 54545)
225-
sudo firewall-cmd --add-port=54545/tcp --permanent
226-
227-
sudo firewall-cmd --reload
228-
229-
# Verify the ports are open
230-
sudo firewall-cmd --list-ports
231-
```
232-
233-
-----
234-
235-
## Critical Security & Connection Notes
236-
237-
- **Authentication Token**: Treat `serverAuthToken` as a password—never share it publicly.
238-
- **Network Access**: When connecting from other devices, use the server machine's IPv4 address (or the one detected and
239-
used by the server) instead of `localhost`. For HTTPS connections, the server exclusively uses IPv4.
240-
- **Client-Server Compatibility**: Always verify client-server version compatibility. Mismatched versions may cause sync
241-
failures.
242-
243-
-----
244-
245-
## Troubleshooting
246-
247-
### Common Issues
248-
249-
**Cannot connect to server from Linkora app**
250-
251-
- Check if the server port(s) (HTTP: 45454, HTTPS: 54545) are allowed through your firewall.
252-
- Ensure you're using the server machine's IPv4 address (or the one detected and used by the server) instead of
253-
`localhost` when connecting from other devices.
254-
- Verify the `serverAuthToken` matches between the server and client.
255-
256-
**Server fails to start**
257-
258-
- Ensure Java 11+ is installed and accessible.
259-
- Check database connectivity and credentials.
260-
- Verify the database URL format is correct for your database type.
261-
- For JAR deployment, ensure you're running from the terminal, not double-clicking.
262-
263-
**Database connection errors**
264-
265-
- Confirm your database server is running and accessible.
266-
- Verify database URL, username, and password are correct.
267-
- For SQLite, ensure the file path is accessible and the directory exists.
268-
269-
**Configuration issues**
270-
271-
- Ensure `LINKORA_SERVER_USE_ENV_VAL=true` when using environment variables.
272-
- Verify all required fields are properly set in your chosen configuration method.
273-
274-
-----
275-
276-
## How It Works
277-
278-
For detailed technical information about the synchronization mechanism, read
279-
the [technical blog post](https://sakethpathike.github.io/blog/synchronization-in-linkora).
280-
281-
Beyond the core sync logic, the Linkora Sync-Server also handles rendering user interfaces for specific functions. For
282-
example, the Linkora browser extension's UI is built and served directly by this sync server. The interface for the
283-
certificate generation endpoint is also handled this way. These UIs are generated using my Kotlin Multiplatform library,
284-
[Kapsule](https://github.com/sakethpathike/kapsule). Kapsule helps simplify creating static HTML by using a familiar Jetpack Compose-style approach with
285-
`kotlinx.html`.
286-
287-
-----
288-
289-
## Important Notes
290-
291-
- **Single User Design**: Designed exclusively for individual use, not multi-user environments.
292-
- **Configuration File Location**: For JAR deployments, `linkoraConfig.json` is created in the same directory as the JAR
293-
file when you first run the server.
294-
- **Database Compatibility**: Linkora supports multiple databases through Exposed. The server has been tested with
295-
MySQL, SQLite, and PostgreSQL.
296-
- **Environment Variables**: For local JAR hosting, `linkoraConfig.json` is recommended. For Docker and cloud hosting,
297-
use environment variables.
298-
- **Host Address**: The `hostAddress` field automatically defaults to the machine's current network IPv4 address. The
299-
server detects this automatically, so no manual configuration is needed for HTTP connections. When connecting from
300-
Linkora apps, use this address instead of `localhost`.
301-
- **HTTPS Certificates & Keystore**: The server automatically generates required certificates and keystore files.
302-
303-
-----
13+
---
30414

30515
## Support
30616

307-
**Star the repo** if you find Linkora useful
17+
**Star the repo** if you find Linkora useful.
30818

30919
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/sakethpathike)
31020

@@ -321,8 +31,8 @@ Contributions are welcome! You can help by:
32131
- Submitting pull requests
32232
- Improving documentation
32333

324-
-----
34+
---
32535

32636
## License
32737

328-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
38+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)