For a Python backend, see here: https://github.com/tannercollin/sharenote-py Thanks to @tannercollin!
The API backend is provided without any warranties and has not received extensive security testing.
I recommend that you secure the /api/
folder against public access.
If you're not confident in how to do this, please just use the normal Share Note service.
The backend uses Fat-Free Framework.
This Docker setup was created with thanks by @tristandb. I don't have the skill to spot if there are any issues with it, so please use at your own risk.
-
Copy
.env.example
to.env
and update the values. -
Run the following command to start the services:
docker-compose up -d
- Access the application at
http://localhost:8080
(or the port you specified).
The code is setup to use MySQL. Import the schema.sql file into your database.
/api/
is the API backend./public/
will be the location of uploaded files.
- Copy
./api/env.cfg.example
to./api/env.cfg
, and update with your specific configuration as below. - Point your API web root to the
./api/
folder in this repo. - Point your shared notes location web root to the
./public/
folder in this repo.
You will need to generate a random 32 character alphanumeric string for each of
these, and set them in both env.cfg
on the server, and in the data.json
file
for Share Note plugin in your Obsidian plugins folder.
A quick way to generate these would be to use an MD5 hash of a string. Here's an online tool to do that.
You will need to set these the server env.cfg
,
uid=8a307375635b44003b1f249ce4381f10
private_key=e28616cde774ed5199764d0b9b27768a
This is the public HTML directory where your shared notes should be saved, example:
upload_folder=/var/www/public
The public URL to reach the above upload_folder
, example:
file_url_base=http://localhost/public
The public URL to reach the assets folder, usually this will be an /assets
subfolder
of the above location. Example:
assets_webroot=http://localhost/public/assets
If you're receiving API errors, try opening the URL http://localhost/api/v1/account/get-key
. If you can't load that endpoint in your browser then your .htaccess
is probably not set up correctly.
Edit the data.json
file in your Obsidian Share Note plugin folder.
Update uid
and apiKey
to match the uid
and private_key
values from your server's env.cfg
.
"uid": "8a307375635b44003b1f249ce4381f10",
"apiKey": "e28616cde774ed5199764d0b9b27768a",
Set this to be the URL for your server's ./api/
folder:
"server": "http://localhost/api",