This repository has been archived by the owner on Jan 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README.md * quickstart with docker
- Loading branch information
Antonio Cheong
authored
Aug 30, 2023
1 parent
2159aff
commit 9f0676d
Showing
1 changed file
with
20 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ Reverse engineered obsidian sync server (NOT OFFICIAL) | |
|
||
These features are not in the latest release but in the main branch. They might not be fully tested and are probably unstable. | ||
|
||
- Obsidian publish | ||
- N/A | ||
|
||
## To do | ||
|
||
|
@@ -29,6 +29,8 @@ These features are not in the latest release but in the main branch. They might | |
|
||
## Setup | ||
|
||
[Quickstart with Docker](https://github.com/acheong08/rev-obsidian-sync/wiki/Docker-Compose) | ||
|
||
### Environment variables | ||
#### Required: | ||
- `DOMAIN_NAME` - The domain name or IP address of your server. Include port if not on 80 or 433. The default is `localhost:3000` | ||
|
@@ -42,72 +44,26 @@ These features are not in the latest release but in the main branch. They might | |
- `git clone https://github.com/acheong08/obsidian-sync` | ||
- `cd obsidian-sync` | ||
- `go run cmd/obsidian-sync/main.go` | ||
Optional: | ||
- Configure [nginx](https://github.com/acheong08/rev-obsidian-sync/wiki/Nginx-Configuration) | ||
- HTTPS is recommended. | ||
|
||
HTTPS is not required. | ||
|
||
When you're done, configure the [plugin](#sync-override-plugin) | ||
|
||
<details> | ||
<summary> | ||
|
||
### Nginx configuration | ||
</summary> | ||
|
||
```nginx | ||
map $http_upgrade $connection_upgrade { | ||
default upgrade; | ||
'' close; | ||
} | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
location / { | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_pass http://127.0.0.1:3000/; | ||
} | ||
server_name <your domain name>; # e.g. api.obsidian.md | ||
} | ||
# This is for obsidian publish (Optional) | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
location / { | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_pass http://127.0.0.1:3000/published/; | ||
} | ||
server_name <another domain name>; # e.g. publish.obsidian.md | ||
} | ||
``` | ||
|
||
You can use `certbot` or cloudflare to handle HTTPS although it is not mandatory. | ||
|
||
</details> | ||
When you're done, install and configure the [plugin](https://github.com/acheong08/rev-obsidian-sync-plugin) | ||
|
||
## Adding a new user | ||
|
||
`go run cmd/signup/main.go` | ||
|
||
## Sync override plugin | ||
|
||
Tested on | ||
|
||
- IOS | ||
- Linux (Flatpak) | ||
|
||
### Usage | ||
|
||
> While we have no qualms with reverse engineering as a playground for experimentation, Obsidian Sync is a service we intend to keep first-party only for the foreseeable future. - https://github.com/obsidianmd/obsidian-releases/pull/2353 | ||
This plugin will not be part of the official community plugins list. | ||
|
||
- Install https://github.com/acheong08/rev-obsidian-sync-plugin | ||
- Go to settings | ||
- Set API endpoint | ||
- e.g. `https://obsidian.yourdomain.com` | ||
- For development: `http://127.0.0.1:3000` | ||
Alternatively: | ||
```bash | ||
curl --request POST \ | ||
--url https://yourdomain.com/user/signup \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"email": "[email protected]", | ||
"password": "example_password", | ||
"name": "Example User", | ||
"signup_key": "<SIGNUP_KEY>" | ||
}' | ||
``` | ||
You can set the signup key via the `SIGNUP_KEY` environment variable. If it has not been set, you can exclude it from the request. |