mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-09-03 17:27:06 +00:00
5.2 KiB
5.2 KiB
In [ ]:
# Install prerequesties
!curl -L https://fly.io/install.sh | sh
!curl -fsSL https://deno.land/x/install/install.sh | sh
!apt update && apt -y install jq
import os
%env PATH=/root/.fly/bin:/root/.deno/bin/:{os.environ["PATH"]}
!git clone --recursive https://github.com/vrtmrz/obsidian-livesyncIn [ ]:
# Login up sign up
!flyctl auth signupIn [ ]:
# see https://fly.io/docs/reference/regions/
region = "nrt/Tokyo, Japan" #@param ["ams/Amsterdam, Netherlands","arn/Stockholm, Sweden","atl/Atlanta, Georgia (US)","bog/Bogotá, Colombia","bos/Boston, Massachusetts (US)","cdg/Paris, France","den/Denver, Colorado (US)","dfw/Dallas, Texas (US)","ewr/Secaucus, NJ (US)","eze/Ezeiza, Argentina","gdl/Guadalajara, Mexico","gig/Rio de Janeiro, Brazil","gru/Sao Paulo, Brazil","hkg/Hong Kong, Hong Kong","iad/Ashburn, Virginia (US)","jnb/Johannesburg, South Africa","lax/Los Angeles, California (US)","lhr/London, United Kingdom","mad/Madrid, Spain","mia/Miami, Florida (US)","nrt/Tokyo, Japan","ord/Chicago, Illinois (US)","otp/Bucharest, Romania","phx/Phoenix, Arizona (US)","qro/Querétaro, Mexico","scl/Santiago, Chile","sea/Seattle, Washington (US)","sin/Singapore, Singapore","sjc/San Jose, California (US)","syd/Sydney, Australia","waw/Warsaw, Poland","yul/Montreal, Canada","yyz/Toronto, Canada" ] {allow-input: true}
%env region={region.split("/")[0]}
#%env appame=
#%env username=
#%env password=
#%env database=
#%env passphrase=
# automatic setup leave it -->
%cd obsidian-livesync/utils/flyio
!./deploy-server.sh | tee deploy-result.txt
## Show result button
from IPython.display import HTML
last_line=""
with open('deploy-result.txt', 'r') as f:
last_line = f.readlines()[-1]
last_line = str.strip(last_line)
if last_line.startswith("obsidian://"):
result = HTML(f"Copy your setup-URI with this button! -> <button onclick=\"navigator.clipboard.writeText('{last_line}')\">Copy setup uri</button><br>Importing passphrase is displayed one. <br>If you want to synchronise in live mode, please apply a preset after ensuring the imported configuration works.")
else:
result = "Failed to encrypt the setup URI"
resultIn [ ]:
!./delete-server.sh