diff --git a/TODO.org b/TODO.org new file mode 100644 index 0000000..31ebcd8 --- /dev/null +++ b/TODO.org @@ -0,0 +1,21 @@ +* TODO some sort of append logic? e.g. don't dump immediately and add as subitems? +* ??? +npm install --save-dev @babel/core @babel/preset-env +npm install babel-preset-stage-0 +npm install babel-preset-env -- wtf is that shit?? + +npm run build + +npm run flow + +* DONE [#A] move server to a separate folder, systemd install script + CLOSED: [2019-01-05 Sat 14:38] + +* TODO [#A] release somewhere? not sure if necessary + +* TODO [#B] docs on using + +* TODO [#B] circleci? +* TODO [#D] nicer manifest? +* TODO [#D] do not minfy for dev +* TODO [#C] motivation diff --git a/server/config.py b/server/config.py new file mode 100644 index 0000000..c21ace7 --- /dev/null +++ b/server/config.py @@ -0,0 +1,3 @@ +from pathlib import Path + +CAPTURE_PATH = Path('/L/Dropbox/mobile/notes/links.org') diff --git a/server b/server/run similarity index 50% rename from server rename to server/run index c2adf5d..987e517 100755 --- a/server +++ b/server/run @@ -5,4 +5,4 @@ cd "$(dirname "$0")" PORT=8090 -hug -p "$PORT" -f server.py >server.log 2>server.err +hug -p "$PORT" -f server.py diff --git a/server.py b/server/server.py similarity index 100% rename from server.py rename to server/server.py diff --git a/server/setup b/server/setup new file mode 100755 index 0000000..45b2d9b --- /dev/null +++ b/server/setup @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 +from pathlib import Path +from subprocess import check_call + +run_script = Path(__file__).parent.joinpath('run').absolute() + +CONFIG = f""" +[Unit] +Description=Grasp extension server conterpart + +[Install] +WantedBy=default.target + +[Service] +ExecStart={run_script} +Type=simple +Restart=always +""" + +SNAME = 'grasp.service' + +out = Path(f'~/.config/systemd/user/{SNAME}').expanduser() + +print(f"Writing systemd config to {out}:") +with out.open('w') as fo: + fo.write(CONFIG) + + + +def systemd(*args): + check_call([ + 'systemctl', '--user', *args, + ]) + +systemd('daemon-reload') +systemd('enable', SNAME) +systemd('start' , SNAME) +systemd('status', SNAME) + +# TODO journalctl --user -u grasp.service to debug