3.0 KiB
3.0 KiB
Standard Notes Extensions - Self-Hosted Repository
Host Standard Notes extensions on your own server. This utility parses most of the open-source extensions available from original repository as well as other authors and builds a extensions repository which can be plugged directly into Standard Notes Web/Desktop Clients. (https://standardnotes.org/)
Extensions are listed as YAML in the \extensions sub-directory, pull a request if you'd like to add yours.
Requirements
- Python 3
- Python 3 - pyyaml module
Usage
- Fork this repository to the web-server:
$ git clone https://github.com/iganeshk/standardnotes-extensions.git
$ cd standardnotes-extensions
$ pip3 install -r requirements.txt
- Replace
your-domain.comat the end of thebuild-repo.pyfile with your domain name:
main(os.getenv('URL', 'https://your-domain.com/extensions'))
- [Optional] Make additions or appropriate changes in
/extensionsdirectory - Run the utility:
$ python3 build-repo.py
- Server the
/publicdirectory and verify if the endpoint is reachable
https://your-domain.com/extensions/index.json
- Import the above endpoint into the web/desktop client.
Setup with nginx as reverse-proxy
location ^~ /extensions {
autoindex off;
alias /path/to/standardnotes-extensions/public;
# CORS HEADERS
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
}
Acknowledgments
- This project was adapted from https://github.com/JokerQyou/snextensions to facilitate on-the-fly updating of extensions.
- Dracula Theme by https://github.com/cameronldn
ToDo
- Implement the usage of GitHub API for efficiency.