Compare commits

...

51 Commits

Author SHA1 Message Date
ca502fd411 Remove schedule test buttons 2025-07-05 18:18:36 -07:00
c8a1128e11 Widen default help window size 2025-07-05 17:47:49 -07:00
b9a2202c68 Make version field full-width 2025-07-05 17:47:30 -07:00
671844723f Don't error if station doesn't have dir when deleted 2025-07-05 17:47:18 -07:00
7a0ce063f1 Add deletion of station schedule info when station is removed
Task scheduler entry for Windows, cron entry for *nix
2025-07-05 17:46:56 -07:00
62bfbb1923 Add log path to settings load error
Since they wouldn't be able to run the application to see the log path.

Also make no the default option
2025-07-05 17:44:49 -07:00
2992572651 Remove some unnecessary printlns 2025-07-05 13:47:51 -07:00
b25fea4549 Remove jitter todo from settings page 2025-06-08 12:28:57 -07:00
a45ffdd864 Remove todo on captureProcessOutput() 2025-06-07 21:44:42 -07:00
c918d98a3c Fix tab order 2025-06-07 21:20:55 -07:00
afb02dcb3d Add accessibility text for all fields 2025-06-07 20:50:49 -07:00
1c7069c737 Add linux schedule management functions 2025-05-29 00:45:41 -07:00
bf754c79d6 Update crontab call 2025-05-26 21:51:12 -07:00
d5e33d2a39 Add alert for unsupported OS 2025-05-26 21:51:11 -07:00
456348d520 Remove TODOs 2025-05-26 21:51:11 -07:00
769f80ec72 Remove testing statement 2025-05-26 21:41:42 -07:00
b6a6ec5e3a Add setting reinitialization if loading fails 2025-05-26 21:41:01 -07:00
392d10c587 Add git version to log and --version output 2025-05-25 23:37:01 -07:00
430b89bdda Remove some testing logs 2025-05-25 23:37:01 -07:00
2a7f9813a1 Fix log statement 2025-05-25 23:37:00 -07:00
553edc8b6c Add external program timeout as station setting
Leaving it without a UI implementation for now
2025-05-25 23:35:47 -07:00
645b1f2414 Fix bug when trying to remove station & none selected 2025-05-21 22:49:05 -07:00
306f169d08 Combine schedule start date/time fields into a single time-zoned field 2025-05-21 22:48:39 -07:00
4cd70e02c7 Set minimum dimensions for windows 2025-05-20 09:02:08 -07:00
44f5d51cb1 Add .gitignore 2025-05-19 20:08:48 -07:00
47d89cb32c Update overview image 2025-05-19 20:08:39 -07:00
961cdc897a Move divider between app controls and station controls 2025-05-19 20:08:29 -07:00
13ab7b82db Flesh out help 2025-05-19 19:28:55 -07:00
d138ea3ad6 Add about page 2025-05-19 19:28:34 -07:00
13355ce401 Factor out config path 2025-05-19 19:28:05 -07:00
e559508507 Change feed type to atom 2025-04-21 19:37:35 -07:00
e0a8a237a4 Fix some text alignment 2025-04-17 22:04:59 -07:00
8bd9e4c356 Add readme
Mostly project-tracking stuff right now
2025-04-17 21:33:50 -07:00
30456c7b7e Add UI mock-up
For posterity
2025-04-17 21:33:21 -07:00
a2fece0143 Add initial attempt at rss feed generation 2025-04-16 22:58:01 -07:00
897dcac243 Log station run complete 2025-04-15 22:41:29 -07:00
a7148e247c Implement external program call 2025-04-15 22:41:09 -07:00
c8aa18338a Down-size icon to 256x256 2025-04-15 21:24:05 -07:00
c55cfbef42 Fix Station Settings button anchor 2025-04-15 21:24:05 -07:00
183d9c9794 Implement next send time label 2025-04-15 21:24:05 -07:00
9f6d4171a5 Add icon to repo 2025-04-09 19:30:32 -07:00
3a1a6223bf Adjust GUI layout for linux rendering 2025-04-09 19:26:14 -07:00
ab48e726af Add basic help page
lsafej
2025-04-09 19:26:14 -07:00
af555112b2 Add icon to window 2025-03-23 15:50:04 -07:00
c480239636 Update schedulers to use process's executable path for invocation 2025-03-22 23:35:09 -07:00
670779a3aa Added check for argument parsing failure 2025-03-22 23:35:09 -07:00
947bccb6da Add missing MainRun.java 2025-03-10 22:55:13 -07:00
998357385e Minor WindowsScheduler updates 2025-03-10 22:54:56 -07:00
7e2d4ca1a4 Add Linux scheduler 2025-03-10 22:54:34 -07:00
0594a64812 Remove unused portions of pom.xml
They were different attempts to get it working, so might be useful to
reference in the future.
2025-03-09 15:18:14 -07:00
48790790b4 Add pom.xml and set up jar packaging
FXML loading needed to change when resources were packaged in jar.
2025-03-09 15:18:14 -07:00
31 changed files with 2322 additions and 143 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
target/

BIN
icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

573
icon.svg Normal file
View File

@ -0,0 +1,573 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100mm"
height="100mm"
viewBox="0 0 120.61599 120.61599"
version="1.1"
id="svg5"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="icon.svg"
inkscape:export-filename="icon.png"
inkscape:export-xdpi="300"
inkscape:export-ydpi="300"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.38440305"
inkscape:cx="411.02692"
inkscape:cy="811.6481"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
showborder="false" />
<defs
id="defs2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-7.9375088,-7.408341)">
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-2"
cx="193.98369"
cy="386.86728"
r="33.423893" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52182;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1-2"
cx="193.98369"
cy="386.86728"
r="57.547085" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="rect8264"
width="191.3741"
height="176.11113"
x="-26.110645"
y="-15.779624" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197"
cx="50.340813"
cy="35.43071"
r="21.362293" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4"
cx="50.340813"
cy="35.43071"
r="33.423893" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52182;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3"
cx="50.340813"
cy="35.43071"
r="45.485489" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52182;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1"
cx="50.340813"
cy="35.43071"
r="57.547085" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1-8"
cx="50.340813"
cy="35.43071"
r="69.608681" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="M 71.151636,105.72285 31.071711,90.879581 62.529625,75.226192 41.856598,60.164404"
id="path972" />
<path
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 4.1202833,139.94932 3.6002366,31.429567 28.401163,69.024276 40.229105,35.873141 c 7.327309,-2.217798 12.340034,-1.841604 19.784483,-1.495272 l 5.95116,19.120364 8.848187,-3.99902 h 59.920415 l 0.27744,91.818087 z"
id="path245-8"
sodipodi:nodetypes="cccccccccc" />
<path
id="rect1543-9"
style="fill:#c5b57e;fill-opacity:1;stroke:#000000;stroke-width:2.98886;stroke-linecap:square;stroke-dasharray:none;stop-color:#000000"
d="m 71.602087,69.248079 48.036433,-4.241388 1.79134,4.241388 -24.376175,52.861551 H 47.22591 l -3.411052,-3.29058 z"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 22.1863,116.1851 50.949735,34.267295 74.802333,118.63562"
id="path245" />
<ellipse
style="fill:#000000;fill-opacity:1;stroke-width:2.98886;stroke-linecap:square;stroke-dasharray:none;stop-color:#000000;stroke:#000000;stroke-opacity:1"
id="path853"
cx="50.476528"
cy="35.456188"
rx="7.7170177"
ry="7.7016726" />
<path
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.5218;stroke-linecap:square;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path853-6"
sodipodi:type="arc"
sodipodi:cx="-193.72717"
sodipodi:cy="188.47533"
sodipodi:rx="35.968002"
sodipodi:ry="35.896484"
sodipodi:start="2.2123045"
sodipodi:end="0.46632985"
sodipodi:open="true"
sodipodi:arc-type="arc"
d="m -215.25059,217.23538 a 35.968002,35.896484 0 0 1 -8.50092,-48.52563 35.968002,35.896484 0 0 1 48.04333,-11.3015 35.968002,35.896484 0 0 1 14.10851,47.20653" />
<path
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.5218;stroke-linecap:square;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path853-6-9"
sodipodi:type="arc"
sodipodi:cx="-192.98309"
sodipodi:cy="187.93011"
sodipodi:rx="23.261015"
sodipodi:ry="23.100607"
sodipodi:start="2.3033806"
sodipodi:end="0.71651673"
sodipodi:arc-type="arc"
d="m -208.5399,205.10423 a 23.261015,23.100607 0 0 1 -1.81963,-32.53144 23.261015,23.100607 0 0 1 32.74711,-1.98129 23.261015,23.100607 0 0 1 2.17041,32.51021"
sodipodi:open="true" />
<path
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.5218;stroke-linecap:square;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path853-6-5"
sodipodi:type="arc"
sodipodi:cx="-193.4792"
sodipodi:cy="190.24304"
sodipodi:rx="48.598015"
sodipodi:ry="48.614838"
sodipodi:start="4.1762494"
sodipodi:end="0.27695909"
sodipodi:open="true"
sodipodi:arc-type="arc"
d="m -218.30409,148.44949 a 48.598015,48.614838 0 0 1 54.45995,3.26359 48.598015,48.614838 0 0 1 17.11095,51.82281" />
<path
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.5218;stroke-linecap:square;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path853-6-5-7"
sodipodi:type="arc"
sodipodi:cx="-188.99826"
sodipodi:cy="187.44801"
sodipodi:rx="58.32296"
sodipodi:ry="58.406055"
sodipodi:start="4.1762494"
sodipodi:end="0.27695909"
sodipodi:open="true"
sodipodi:arc-type="arc"
d="m -218.79086,137.23708 a 58.32296,58.406055 0 0 1 65.35793,3.92089 58.32296,58.406055 0 0 1 20.53502,62.26012" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 41.856598,60.802664 H 58.271362"
id="path1483" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 36.568017,75.226192 H 62.529625"
id="path1485" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 31.071711,90.879581 H 66.955147"
id="path1487" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="M 71.151636,105.72285 H 25.85986 L 66.955147,90.879581 36.568017,75.226194 58.271362,60.164404"
id="path1489" />
<rect
style="fill:#ffeba4;fill-opacity:1;stroke:#000000;stroke-width:3.13646;stroke-linecap:square;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="rect1543"
width="49.827774"
height="58.211109"
x="98.453468"
y="71.399696"
transform="matrix(1,0,-0.41875465,0.90809941,0,0)" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 61.248006,92.370426 38.105048,0.175037"
id="path1870-9"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 57.363875,100.05021 38.105042,0.17504"
id="path1870-2"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 53.479743,107.73002 38.105041,0.17503"
id="path1870-8"
sodipodi:nodetypes="cc" />
<path
id="path1597"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 70.450097,69.118849 c -2.302994,-1.054345 -3.617601,-4.211752 -3.040314,-7.302189 0.577288,-3.090435 2.85846,-5.10743 5.275707,-4.664735 2.417251,0.442694 4.18334,3.200902 4.084469,6.378954"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 77.277919,69.118849 c -2.302999,-1.054345 -3.617595,-4.211752 -3.040316,-7.302189 0.577289,-3.090435 2.858458,-5.10743 5.275706,-4.664735 2.417255,0.442694 4.183347,3.200902 4.084468,6.378954"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-7"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 84.105737,69.118849 c -2.302996,-1.054345 -3.617594,-4.211752 -3.040316,-7.302189 0.577291,-3.090435 2.858461,-5.10743 5.275712,-4.664735 2.417253,0.442694 4.183345,3.200902 4.084468,6.378954"
sodipodi:nodetypes="cssc" />
<path
id="path1597-3-3"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 90.933559,69.118849 c -2.302995,-1.054345 -3.617605,-4.211752 -3.040315,-7.302189 0.577289,-3.090435 2.858457,-5.10743 5.275709,-4.664735 2.417243,0.442694 4.183336,3.200902 4.084471,6.378954"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-7-1"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 97.761377,69.118849 c -2.302998,-1.054345 -3.617594,-4.211752 -3.040315,-7.302189 0.57729,-3.090435 2.858453,-5.10743 5.275708,-4.664735 2.41725,0.442694 4.18336,3.200902 4.08447,6.378954"
sodipodi:nodetypes="cssc" />
<path
id="path1597-3-3-8"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 104.5892,69.118849 c -2.30299,-1.054345 -3.6176,-4.211752 -3.04031,-7.302189 0.57728,-3.090435 2.85845,-5.10743 5.27571,-4.664735 2.41725,0.442694 4.18334,3.200902 4.08446,6.378954"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-7-1-0"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 111.41703,69.118849 c -2.30301,-1.054345 -3.6176,-4.211752 -3.04033,-7.302189 0.5773,-3.090435 2.85848,-5.10743 5.27572,-4.664735 2.41726,0.442694 4.18334,3.200902 4.08447,6.378954"
sodipodi:nodetypes="cssc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 69.016271,77.01084 38.105039,0.175038"
id="path1870"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 65.132138,84.690634 103.23718,84.86567"
id="path1870-4"
sodipodi:nodetypes="cc" />
<path
id="rect3438"
style="fill:#ffffff;stroke:none;stroke-width:2.73195;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stop-color:#000000;fill-opacity:1"
d="M -48.100937 -65.648699 L -48.100937 190.05156 L 193.48656 190.05156 L 193.48656 -65.648699 L -48.100937 -65.648699 z M 10.843335 9.8990494 L 125.82543 9.8990494 L 125.82543 125.29626 L 10.843335 125.29626 L 10.843335 9.8990494 z " />
<circle
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path5194"
cx="8.8180647"
cy="11.224082"
r="8.5120382" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="rect8264-5"
width="191.3741"
height="176.11113"
x="315.93002"
y="-26.572329" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1-8-7-8"
cx="529.05237"
cy="19.290052"
r="69.608681" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1-8-7-8-8"
cx="516.25659"
cy="19.290052"
r="69.608681" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1-8-7-8-8-2"
cx="490.66495"
cy="19.290052"
r="69.608681" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1-8-7-8-8-2-5"
cx="477.86914"
cy="19.290052"
r="69.608681" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1-8-7-8-8-2-5-8"
cx="465.07333"
cy="19.290052"
r="69.608681" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1-8-7-8-8-2-5-2"
cx="452.27753"
cy="19.290052"
r="69.608681" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1-8-7-8-8-5"
cx="503.46075"
cy="19.290052"
r="69.608681" />
<path
id="rect12036"
style="fill:#ffffff;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stop-color:#000000"
d="m 382.76068,49.026981 h 22.7733 l -0.20405,-10.212154 h 67.24742 v 68.976853 h -89.81667 z"
sodipodi:nodetypes="ccccccc" />
<g
id="g13446"
transform="translate(-23.615614,-1.9147788)">
<rect
style="fill:#dddddd;fill-opacity:1;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="rect12307"
width="56.649075"
height="47.843525"
x="382.56964"
y="59.053787" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 394.42489,59.201904 V 20.27731"
id="path12465"
sodipodi:nodetypes="cc" />
<ellipse
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2.98886;stroke-linecap:square;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path853-4"
cx="394.31458"
cy="20.402958"
rx="4.62993"
ry="4.6197276" />
<rect
style="fill:#3f9000;fill-opacity:1;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="rect12489"
width="45.595596"
height="8.2185192"
x="388.32666"
y="66.685265" />
<circle
style="fill:#909090;fill-opacity:1;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path13427"
cx="396.65854"
cy="90.753792"
r="7.6314826" />
</g>
<g
id="g13462"
transform="translate(3.1912979)">
<path
id="rect1543-9-5"
style="fill:#c5b57e;fill-opacity:1;stroke:#000000;stroke-width:2.98886;stroke-linecap:square;stroke-dasharray:none;stop-color:#000000"
d="m 413.64274,58.455374 48.03643,-4.24139 1.79134,4.24139 -24.37618,52.861546 h -49.82777 l -3.41105,-3.29058 z"
sodipodi:nodetypes="ccccccc" />
<rect
style="fill:#ffeba4;fill-opacity:1;stroke:#000000;stroke-width:3.13646;stroke-linecap:square;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="rect1543-7"
width="49.827774"
height="58.211109"
x="435.51724"
y="59.514755"
transform="matrix(1,0,-0.41875465,0.90809941,0,0)" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 403.28866,81.577724 38.10504,0.17503"
id="path1870-9-2"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 399.40453,89.257504 38.10504,0.17504"
id="path1870-2-0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 395.52039,96.937314 38.10504,0.17503"
id="path1870-8-7"
sodipodi:nodetypes="cc" />
<path
id="path1597-59"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 412.49075,58.326144 c -2.303,-1.05435 -3.6176,-4.21175 -3.04032,-7.30219 0.57729,-3.09044 2.85846,-5.10743 5.27571,-4.66474 2.41725,0.4427 4.18334,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-9"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 419.31857,58.326144 c -2.303,-1.05435 -3.6176,-4.21175 -3.04032,-7.30219 0.57729,-3.09044 2.85846,-5.10743 5.27571,-4.66474 2.41725,0.4427 4.18335,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-7-7"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 426.14639,58.326144 c -2.303,-1.05435 -3.6176,-4.21175 -3.04032,-7.30219 0.57729,-3.09044 2.85846,-5.10743 5.27571,-4.66474 2.41726,0.4427 4.18335,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-3-3-2"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 432.97421,58.326144 c -2.303,-1.05435 -3.61761,-4.21175 -3.04032,-7.30219 0.57729,-3.09044 2.85846,-5.10743 5.27571,-4.66474 2.41725,0.4427 4.18334,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-7-1-7"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 439.80203,58.326144 c -2.303,-1.05435 -3.6176,-4.21175 -3.04032,-7.30219 0.57729,-3.09044 2.85846,-5.10743 5.27571,-4.66474 2.41725,0.4427 4.18336,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-3-3-8-4"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 446.62985,58.326144 c -2.30299,-1.05435 -3.6176,-4.21175 -3.04031,-7.30219 0.57728,-3.09044 2.85845,-5.10743 5.27571,-4.66474 2.41725,0.4427 4.18334,3.20091 4.08446,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-7-1-0-5"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 453.45768,58.326144 c -2.30301,-1.05435 -3.6176,-4.21175 -3.04033,-7.30219 0.5773,-3.09044 2.85848,-5.10743 5.27572,-4.66474 2.41726,0.4427 4.18334,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 411.05692,66.218134 38.10504,0.17504"
id="path1870-80"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 407.17279,73.897924 38.10504,0.17504"
id="path1870-4-5"
sodipodi:nodetypes="cc" />
</g>
<path
id="rect3438-0"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.73195;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stop-color:#000000"
d="M 293.93971,-76.441405 V 179.25885 h 241.5875 V -76.441405 Z m 58.94428,75.54774851 H 467.86608 V 114.50355 H 352.88399 Z" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5.5218;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="rect8264-9"
width="198.01566"
height="196.86601"
x="97.607521"
y="298.29813" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-5"
cx="193.98369"
cy="386.86728"
r="21.362293" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52182;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-2"
cx="193.98369"
cy="386.86728"
r="45.485489" />
<circle
style="fill:none;fill-opacity:1;stroke:#4f9ade;stroke-width:5.52181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path4197-4-3-1-8-3"
cx="193.98369"
cy="386.86728"
r="69.608681" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 214.79451,457.15943 -40.07993,-14.84327 31.45791,-15.65339 -20.67302,-15.06179"
id="path972-9" />
<path
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 147.76315,491.3859 24.28088,-70.92504 11.82794,-33.15114 c 7.32731,-2.2178 12.34004,-1.8416 19.78449,-1.49527 l 5.95116,19.12036 8.84818,-3.99902 h 59.92042 l 0.27744,91.81809 z"
id="path245-8-5"
sodipodi:nodetypes="ccccccccc" />
<path
id="rect1543-9-1"
style="fill:#c5b57e;fill-opacity:1;stroke:#000000;stroke-width:2.98886;stroke-linecap:square;stroke-dasharray:none;stop-color:#000000"
d="m 215.24496,420.68466 48.03643,-4.24139 1.79134,4.24139 -24.37618,52.86155 h -49.82777 l -3.41105,-3.29058 z"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 165.82917,467.62168 28.76343,-81.91781 23.8526,84.36833"
id="path245-1" />
<ellipse
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2.98886;stroke-linecap:square;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="path853-3"
cx="194.1194"
cy="386.89276"
rx="7.7170177"
ry="7.7016726" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 185.49947,412.23924 h 16.41476"
id="path1483-1" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 180.21089,426.66277 h 25.9616"
id="path1485-3" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 174.71458,442.31616 h 35.88344"
id="path1487-5" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 214.79451,457.15943 h -45.29178 l 41.09529,-14.84327 -30.38713,-15.65339 21.70334,-15.06179"
id="path1489-2" />
<rect
style="fill:#ffeba4;fill-opacity:1;stroke:#000000;stroke-width:3.13646;stroke-linecap:square;stroke-dasharray:none;stroke-opacity:1;stop-color:#000000"
id="rect1543-2"
width="49.827774"
height="58.211109"
x="404.15536"
y="458.40201"
transform="matrix(1,0,-0.41875465,0.90809941,0,0)" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 204.89088,443.80701 38.10504,0.17503"
id="path1870-9-8"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 201.00674,451.48679 38.10505,0.17504"
id="path1870-2-1"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 197.12261,459.1666 38.10504,0.17503"
id="path1870-8-0"
sodipodi:nodetypes="cc" />
<path
id="path1597-9"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 214.09297,420.55543 c -2.303,-1.05435 -3.6176,-4.21175 -3.04032,-7.30219 0.57729,-3.09044 2.85846,-5.10743 5.27571,-4.66474 2.41725,0.4427 4.18334,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-5"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 220.92079,420.55543 c -2.303,-1.05435 -3.6176,-4.21175 -3.04032,-7.30219 0.57729,-3.09044 2.85846,-5.10743 5.27571,-4.66474 2.41725,0.4427 4.18335,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-7-79"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 227.74861,420.55543 c -2.303,-1.05435 -3.6176,-4.21175 -3.04032,-7.30219 0.57729,-3.09044 2.85846,-5.10743 5.27571,-4.66474 2.41726,0.4427 4.18335,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-3-3-7"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 234.57643,420.55543 c -2.303,-1.05435 -3.61761,-4.21175 -3.04032,-7.30219 0.57729,-3.09044 2.85846,-5.10743 5.27571,-4.66474 2.41725,0.4427 4.18334,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-7-1-5"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 241.40425,420.55543 c -2.303,-1.05435 -3.6176,-4.21175 -3.04032,-7.30219 0.57729,-3.09044 2.85845,-5.10743 5.27571,-4.66474 2.41725,0.4427 4.18336,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-3-3-8-7"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 248.23207,420.55543 c -2.30299,-1.05435 -3.6176,-4.21175 -3.04031,-7.30219 0.57728,-3.09044 2.85845,-5.10743 5.27571,-4.66474 2.41725,0.4427 4.18334,3.20091 4.08446,6.37896"
sodipodi:nodetypes="cssc" />
<path
id="path1597-5-7-1-0-57"
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:round;stroke-dasharray:none;stop-color:#000000"
d="m 255.0599,420.55543 c -2.30301,-1.05435 -3.6176,-4.21175 -3.04033,-7.30219 0.5773,-3.09044 2.85848,-5.10743 5.27572,-4.66474 2.41726,0.4427 4.18334,3.20091 4.08447,6.37896"
sodipodi:nodetypes="cssc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 212.65914,428.44742 38.10504,0.17504"
id="path1870-5"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:2.98886;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 208.77501,436.12721 38.10504,0.17504"
id="path1870-4-7"
sodipodi:nodetypes="cc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 31 KiB

397
mockup.drawio Normal file
View File

@ -0,0 +1,397 @@
<mxfile host="Electron" modified="2025-01-11T07:22:18.441Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="-S0tjDxWuqk8ykO7LYgZ" version="22.0.3" type="device" pages="4">
<diagram id="KgfOMPHdpzIXCQJiCugH" name="number-station">
<mxGraphModel dx="1407" dy="818" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="400" pageHeight="400" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="KV5Y_ph4G12SrxRSiY-e-1" value="Select Station" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="175" y="10" width="95" height="30" as="geometry" />
</mxCell>
<mxCell id="2tEYRVNANGzc1R6FI9Mg-2" value="My Station" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="70" y="10" width="95" height="30" as="geometry" />
</mxCell>
<mxCell id="2tEYRVNANGzc1R6FI9Mg-3" value="Station:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="10" y="15" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="2tEYRVNANGzc1R6FI9Mg-5" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="10" y="50" as="sourcePoint" />
<mxPoint x="390" y="50" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="aKKJJGnMUioiqIyPZD_M-1" value="0000 0000 0000 0000&lt;br style=&quot;font-size: 27px;&quot;&gt;0000 0000 0000 0000&lt;br style=&quot;font-size: 27px;&quot;&gt;0000 0000 0000 0000&lt;br style=&quot;font-size: 27px;&quot;&gt;0000 0000 0000 0000&lt;br style=&quot;font-size: 27px;&quot;&gt;0000 0000 0000 0000" style="rounded=0;whiteSpace=wrap;html=1;align=left;verticalAlign=top;fontSize=27;" parent="1" vertex="1">
<mxGeometry x="10" y="100" width="380" height="250" as="geometry" />
</mxCell>
<mxCell id="OoXu6EN54UF7In_Oly40-1" value="⚙" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="360" y="59" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="fAEDDr1aK9oPJae2LnTb-1" value="Set as next message" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="270" y="360" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="F0W2USit5zVsF5LBhS4k-1" value="Next run time: 2024-12-24T14:17:28" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="10" y="59" width="220" height="30" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram id="k80YQdDor6Hn9XSC-wS4" name="number-station-config">
<mxGraphModel dx="366" dy="658" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="400" pageHeight="400" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="qGrX5IwpEfruhJfUPI0G-1" value="Select Station" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="175" y="10" width="95" height="30" as="geometry" />
</mxCell>
<mxCell id="m5zdCg8UaHyb6ajvu_Qv-2" value="My Station" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="70" y="10" width="95" height="30" as="geometry" />
</mxCell>
<mxCell id="m5zdCg8UaHyb6ajvu_Qv-3" value="Station:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="10" y="15" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="m5zdCg8UaHyb6ajvu_Qv-5" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="10" y="50" as="sourcePoint" />
<mxPoint x="390" y="50" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="b2T8TMgS7kride2Pq7S0-1" value="Digit group size:&lt;br&gt;(only for display)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="10" y="70" width="100" height="20" as="geometry" />
</mxCell>
<mxCell id="b2T8TMgS7kride2Pq7S0-2" value="4" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="110" y="65" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="b2T8TMgS7kride2Pq7S0-3" value="⬆" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="150" y="65" width="20" height="15" as="geometry" />
</mxCell>
<mxCell id="b2T8TMgS7kride2Pq7S0-4" value="⬇" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="150" y="80" width="20" height="15" as="geometry" />
</mxCell>
<mxCell id="O_Ejp8n0P8FWgRvxlbZu-1" value="Save" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="330" y="760" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="-kJYHnf-wgmOerafxR5x-1" value="Number station address:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="140" y="160" width="145" height="30" as="geometry" />
</mxCell>
<mxCell id="-kJYHnf-wgmOerafxR5x-2" value="https://my-number-station.com/blog.html" style="rounded=0;whiteSpace=wrap;html=1;align=left;" parent="1" vertex="1">
<mxGeometry x="150" y="190" width="241.25" height="30" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-1" value="Send messages via:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="10" y="160" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-2" value="FTP" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="50" y="190" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-3" value="SFTP" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="50" y="220" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-4" value="SCP" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="50" y="250" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-5" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;labelBackgroundColor=none;fillColor=#000000;" parent="1" vertex="1">
<mxGeometry x="30" y="200" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-6" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="30" y="230" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-7" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="30" y="260" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-8" value="Username:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="218.75" y="230" width="67.5" height="30" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-9" value="Password:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="218.75" y="260" width="67.5" height="30" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-10" value="user" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="296.25" y="235" width="95" height="20" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-11" value="pass" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="296.25" y="265" width="95" height="20" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-12" value="Message length:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="190" y="70" width="100" height="20" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-13" value="80" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="290" y="65" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-14" value="⬆" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="330" y="65" width="20" height="15" as="geometry" />
</mxCell>
<mxCell id="qLbXf6SKdaKwf-JNIX5Q-15" value="⬇" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="330" y="80" width="20" height="15" as="geometry" />
</mxCell>
<mxCell id="LwcL28te8jDykbwldkZH-1" value="Prefixes:&lt;br&gt;(dummy messages won&#39;t be sent with these prefixes)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="20" y="350" width="290" height="50" as="geometry" />
</mxCell>
<mxCell id="LwcL28te8jDykbwldkZH-2" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="20" y="395" width="260" height="170" as="geometry" />
</mxCell>
<mxCell id="LwcL28te8jDykbwldkZH-3" value="9293 8500" style="rounded=0;whiteSpace=wrap;html=1;align=left;" parent="1" vertex="1">
<mxGeometry x="30" y="405" width="240" height="30" as="geometry" />
</mxCell>
<mxCell id="LwcL28te8jDykbwldkZH-4" value="0032 9381" style="rounded=0;whiteSpace=wrap;html=1;align=left;" parent="1" vertex="1">
<mxGeometry x="30" y="435" width="240" height="30" as="geometry" />
</mxCell>
<mxCell id="LwcL28te8jDykbwldkZH-5" value="..." style="rounded=0;whiteSpace=wrap;html=1;align=left;" parent="1" vertex="1">
<mxGeometry x="30" y="465" width="240" height="30" as="geometry" />
</mxCell>
<mxCell id="LwcL28te8jDykbwldkZH-6" value="+" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="240" y="525" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="LwcL28te8jDykbwldkZH-7" value="-" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="240" y="405" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="LwcL28te8jDykbwldkZH-8" value="-" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="240" y="435" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-1" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="10" y="580" width="380" height="150" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-2" value="Schedule:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="10" y="580" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-3" value="" style="whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="20" y="610" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-4" value="Manage schedule externally" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="30" y="600" width="160" height="30" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-5" value="Daily" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="50" y="630" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-6" value="Weekly" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="50" y="660" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-7" value="Monthly" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="50" y="690" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-8" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;labelBackgroundColor=none;fillColor=#000000;" parent="1" vertex="1">
<mxGeometry x="30" y="640" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-9" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="30" y="670" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-10" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="30" y="700" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-11" value="Start date:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="120" y="630" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-12" value="2024-12-25 08:10:36" style="rounded=0;whiteSpace=wrap;html=1;align=left;" parent="1" vertex="1">
<mxGeometry x="120" y="660" width="170" height="30" as="geometry" />
</mxCell>
<mxCell id="enA9nok_1hsDVz6vXJ0Y-13" value="✍" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="300" y="660" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="yshJ9rjgNk4pQpEHdTG9-1" value="External program" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="50" y="280" width="100" height="30" as="geometry" />
</mxCell>
<mxCell id="yshJ9rjgNk4pQpEHdTG9-2" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="30" y="290" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="yshJ9rjgNk4pQpEHdTG9-4" value="program-to-execute" style="rounded=0;whiteSpace=wrap;html=1;align=left;" parent="1" vertex="1">
<mxGeometry x="50" y="310" width="340" height="30" as="geometry" />
</mxCell>
<mxCell id="lrg_OsaujHVCrS9Fx4xL-1" value="Groups in line:&lt;br&gt;(only for display)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="10" y="115" width="100" height="20" as="geometry" />
</mxCell>
<mxCell id="lrg_OsaujHVCrS9Fx4xL-2" value="4" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="110" y="110" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="lrg_OsaujHVCrS9Fx4xL-3" value="⬆" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="150" y="110" width="20" height="15" as="geometry" />
</mxCell>
<mxCell id="lrg_OsaujHVCrS9Fx4xL-4" value="⬇" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="150" y="125" width="20" height="15" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram name="listener" id="lENoe73DJEgTFmveM3ib">
<mxGraphModel dx="1235" dy="723" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="400" pageHeight="400" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="SujNhtosm1HRNQAcBG4O-1" value="Select Station" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="175" y="10" width="95" height="30" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-1" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="10" y="119" width="380" height="270" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-2" value="9293 8500 &lt;font color=&quot;#9c9c9c&quot;&gt;1823 2298 2301&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;align=left;" vertex="1" parent="1">
<mxGeometry x="20" y="129" width="360" height="30" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-3" value="..." style="rounded=0;whiteSpace=wrap;html=1;align=left;" vertex="1" parent="1">
<mxGeometry x="20" y="159" width="360" height="30" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-4" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="20" y="189" width="360" height="30" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-5" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="20" y="219" width="360" height="30" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-6" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="20" y="249" width="360" height="30" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-7" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="20" y="279" width="360" height="30" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-8" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="20" y="309" width="360" height="30" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-9" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="20" y="339" width="360" height="30" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-10" value="Retrieve Now" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="230" y="59" width="100" height="30" as="geometry" />
</mxCell>
<mxCell id="wbM6wd7tqMI0IAmKtTY0-17" value="My Station" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="70" y="10" width="95" height="30" as="geometry" />
</mxCell>
<mxCell id="4qhGAahRBXyE9qeNDtCE-1" value="Last retrieved: 2024-12-24T14:17:28" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="10" y="59" width="220" height="30" as="geometry" />
</mxCell>
<mxCell id="4qhGAahRBXyE9qeNDtCE-2" value="Messages:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="10" y="89" width="80" height="30" as="geometry" />
</mxCell>
<mxCell id="4qhGAahRBXyE9qeNDtCE-3" value="Station:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="10" y="15" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="gv7KOfe7MxGHTGDHY-RI-1" value="⚙" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="360" y="59" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="gv7KOfe7MxGHTGDHY-RI-2" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="10" y="50" as="sourcePoint" />
<mxPoint x="390" y="50" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="v50buFrmnss8UQ5S-Iks-1" value="2024-12-24" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="300" y="129" width="80" height="30" as="geometry" />
</mxCell>
<mxCell id="v50buFrmnss8UQ5S-Iks-2" value="2024-12-23" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="300" y="159" width="80" height="30" as="geometry" />
</mxCell>
<mxCell id="v50buFrmnss8UQ5S-Iks-3" value="2024-12-22" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="300" y="189" width="80" height="30" as="geometry" />
</mxCell>
<mxCell id="v50buFrmnss8UQ5S-Iks-4" value="2024-12-21" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="300" y="219" width="80" height="30" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram id="E8TrwcYXImFw0jUs4Aw0" name="listener-config">
<mxGraphModel dx="811" dy="475" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="400" pageHeight="400" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="rOGrzmU35Bv_lXtv-dQQ-1" value="Prefixes:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="20" y="220" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="rOGrzmU35Bv_lXtv-dQQ-2" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="10" y="250" width="260" height="170" as="geometry" />
</mxCell>
<mxCell id="rOGrzmU35Bv_lXtv-dQQ-3" value="9293 8500" style="rounded=0;whiteSpace=wrap;html=1;align=left;" vertex="1" parent="1">
<mxGeometry x="20" y="260" width="240" height="30" as="geometry" />
</mxCell>
<mxCell id="rOGrzmU35Bv_lXtv-dQQ-4" value="0032 9381" style="rounded=0;whiteSpace=wrap;html=1;align=left;" vertex="1" parent="1">
<mxGeometry x="20" y="290" width="240" height="30" as="geometry" />
</mxCell>
<mxCell id="rOGrzmU35Bv_lXtv-dQQ-5" value="..." style="rounded=0;whiteSpace=wrap;html=1;align=left;" vertex="1" parent="1">
<mxGeometry x="20" y="320" width="240" height="30" as="geometry" />
</mxCell>
<mxCell id="rOGrzmU35Bv_lXtv-dQQ-7" value="https://my-number-station.com/blog.html" style="rounded=0;whiteSpace=wrap;html=1;align=left;" vertex="1" parent="1">
<mxGeometry x="30" y="120" width="350" height="30" as="geometry" />
</mxCell>
<mxCell id="dexWjz7qNybDygiiIq_V-1" value="My Station" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="70" y="10" width="95" height="30" as="geometry" />
</mxCell>
<mxCell id="dexWjz7qNybDygiiIq_V-2" value="Station:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="10" y="15" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="dexWjz7qNybDygiiIq_V-3" value="Select Station" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="175" y="10" width="95" height="30" as="geometry" />
</mxCell>
<mxCell id="Gh-GtSVz8Y2JwdWB56_--1" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="10" y="50" as="sourcePoint" />
<mxPoint x="390" y="50" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="6y2arMDsUTsDNsxs1FtR-2" value="+" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="230" y="380" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="6y2arMDsUTsDNsxs1FtR-3" value="-" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="230" y="260" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="6y2arMDsUTsDNsxs1FtR-4" value="-" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="230" y="290" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="6y2arMDsUTsDNsxs1FtR-5" value="Save" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="330" y="760" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="skUOlehON0tLIMdoaJ7T-1" value="Retrieve messages from:" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="10" y="60" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="skUOlehON0tLIMdoaJ7T-2" value="Website" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="30" y="86" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="skUOlehON0tLIMdoaJ7T-3" value="External program" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="30" y="160" width="100" height="30" as="geometry" />
</mxCell>
<mxCell id="skUOlehON0tLIMdoaJ7T-4" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;labelBackgroundColor=none;fillColor=#000000;" vertex="1" parent="1">
<mxGeometry x="10" y="96" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="skUOlehON0tLIMdoaJ7T-5" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
<mxGeometry x="10" y="170" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="skUOlehON0tLIMdoaJ7T-6" value="program-to-execute" style="rounded=0;whiteSpace=wrap;html=1;align=left;" vertex="1" parent="1">
<mxGeometry x="30" y="190" width="350" height="30" as="geometry" />
</mxCell>
<mxCell id="skUOlehON0tLIMdoaJ7T-7" value="?" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="130" y="165" width="20" height="20" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-1" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="10" y="430" width="380" height="150" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-2" value="Schedule:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="10" y="430" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-3" value="" style="whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
<mxGeometry x="20" y="460" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-4" value="Manage schedule externally" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="30" y="450" width="160" height="30" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-5" value="Daily" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="50" y="480" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-6" value="Weekly" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="50" y="510" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-7" value="Monthly" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="50" y="540" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-8" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;labelBackgroundColor=none;fillColor=#000000;" vertex="1" parent="1">
<mxGeometry x="30" y="490" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-9" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
<mxGeometry x="30" y="520" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-10" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
<mxGeometry x="30" y="550" width="10" height="10" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-11" value="Start date:" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="120" y="480" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-12" value="2024-12-25 08:10:36" style="rounded=0;whiteSpace=wrap;html=1;align=left;" vertex="1" parent="1">
<mxGeometry x="120" y="510" width="170" height="30" as="geometry" />
</mxCell>
<mxCell id="6MllUsjUtkag9fbClZZq-13" value="✍" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="300" y="510" width="30" height="30" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

150
pom.xml Normal file
View File

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>name.nathanmcrae</groupId>
<artifactId>numbersstation</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<javafx.version>23.0.2</javafx.version>
</properties>
<repositories>
<repository>
<id>my-local-repo</id>
<url>file://${project.basedir}/mvn-repo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
<version>7.1.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.18.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.18.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.18.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.18.2</version>
</dependency>
<dependency>
<groupId>com.github.mwiede</groupId>
<artifactId>jsch</artifactId>
<version>0.2.23</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>wordpress</groupId>
<artifactId>xmlrpc-client</artifactId>
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>com.tearsofaunicorn.wordpress</groupId>
<artifactId>wordpress-xmlrpc-client</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-common</artifactId>
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>com.leakyabstractions</groupId>
<artifactId>result</artifactId>
<version>1.0.0.0</version>
</dependency>
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>name.nathanmcrae.numbersstation.MainRun</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>9.0.1</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<commitIdGenerationMode>full</commitIdGenerationMode>
</configuration>
</plugin>
</plugins>
</build>
</project>

144
readme.txt Normal file
View File

@ -0,0 +1,144 @@
For sending secret messages and dummy messages regularly. It is meant to be used in conjunction with one-time pads. One-time pads provide perfect security for the message itself (if they are handled properly), but adversaries can still tell that messages are being sent, and when they are being sent. To avoid this, dummy messages are uploaded to a website on a regular basis. The messages can also be hidden using steganography.
This application should not be considered secure, and no sensitive information should be entered into it.
Baseline is that the number station will generate a dummy random message, optionally obscure it via steganography, then upload it to an (s)ftp/scp server.
The random message generation actually happens last, so that, next time it is run, the existing message will be uploaded. This way a real message can be generated in the meantime and the next upload time the real message will be uploaded. Because the real message looks random to anyone without the corresponding one-time pad, it cannot be distinguished from the dummy messages.
# Number Station Listener
This application periodically checks a site for numbers and stores them so the user can check whether the message matches any pads.
# Notes
Should have sane defaults, but be built to be part of a more extensible system. Should be able to run other commands for message generation / upload.
Need to be able to support multiple profiles for each.
## Tech
- Installers: JPackage
- Notifications: https://github.com/sshtools/two-slices/blob/master/README.md
- Post to wordpress: https://github.com/ashri/java-wordpress-api/tree/master
## Security considerations
If someone were to take any part of the number station (this software, the server, or intercepting on the way to the recipient), then they could make sure no messages get through (though they couldn't spoof messages without access to the one-time pads).
This weakness is true of nearly all communication methods though. The only way to be certain a message was received is to receive an acknowledgement back.
# Settings/State Format
$XDG_CONFIG_HOME/numbers-station/main-settings.xml
$XDG_CONFIG_HOME/numbers-station/listener-settings.xml
$XDG_STATE_HOME/numbers-station/main.log
$XDG_STATE_HOME/numbers-station/listener.log
$XDG_STATE_HOME/numbers-station/<station-id>-main/next-message.txt
$XDG_STATE_HOME/numbers-station/<station-id>-main/20250114T091633.txt
$XDG_STATE_HOME/numbers-station/<station-id>-listener/20250114T091735.txt
$XDG_STATE_HOME/numbers-station/<station-id>-listener/20250114T091748-read.txt
XDG dirs:
https://superuser.com/a/1767882
On Windows:
https://stackoverflow.com/questions/43853548/xdg-basedir-directories-for-windows
Library to use:
https://github.com/dirs-dev/directories-jvm
# TODO
- [ ] Undo/Redo in message editing
- [ ] Disable/commandeer right-click menu items for message text (otherwise you can wreck the formatting).
- [ ] Make sure numpad works in message editing
And in prefix editing
- [x] Catch and log all exceptions
- [ ] Add a check that the way we set up the scheduler to run the application will actually work. (need a flag argument that will output something particular we can look for).
- [x] Be able to narrow message area so that columns can match whatever message format you're using (minimum window width would keep you from doing that).
- [x] When station is removed/renamed, need to also remove/rename the scheduled task and the corresponding state directory.
- [x] Check for duplicate station names when creating or renaming
- [ ] Test task scheduler task creation for a windows user not on a domain (author needs to include domain when on domain e.g. EI\nathanm)
- [x] Station names with quotes shouldn't be allowed (or we'll need to do escaping for the launch command)
- [ ] Need to be able to handle case where application is open and the scheduled task runs. There's at least contention for the log file (maybe? doesn't seem to mind if multiple instances of the application are running)
- [ ] In all controllers, error handling should be 1. log error 2. Pop up dialog to warn user
- [x] Settings external schedule management should remove the scheduled task
- [ ] Add tests for generateMessage()
- [x] Load message from next-message
- [x] When making changes to the message, show the changes as unsaved until saved.
- [ ] Ensure all GUI elements have accessibility text
- [ ] Embed versioning info
- [ ] Factor out scheduling into a wrapper class that handles all the os-specific stuff internally.
- [ ] If a station name is run which doesn't exist in settings, but has associated files, then prompt the user to delete the files.
- [ ] Fix behavior when settings file is empty
- [ ] Store schedule time with time zone
- [ ] Add tests for StationSettings.nextSendTime()
Note on jars and javafx: https://stackoverflow.com/a/23121897
# 2025-01-27 JAR packaging
```
$modulePath = "$Env:PATH_TO_FX;P:\personal_root\projects\number-station\lib"
$modules = $(
"com.fasterxml.jackson.annotation",
"com.fasterxml.jackson.core",
"com.fasterxml.jackson.dataformat.xml",
"com.fasterxml.jackson.datatype.jsr310",
"result",
"javafx.controls",
"javafx.fxml",
"org.apache.commons.cli"
)
$addModules = $modules -join ","
java/>jar --create --file numbers-station.jar --manifest .\manifest.txt -C out .
java/>java --module-path $modulePath --add-modules $addModules -jar .\numbers-station.jar
```
TODO: package lib jars with this jar
also:
```
jpackage --input . --name numbers-station --main-jar .\numbers-station.jar --main-class name.nathanmcrae.numbersstation.Main --module-path "$Env:PATH_TO_FX;P:\personal_root\projects\number-station\lib" --add-modules javafx.controls,javafx.fxml,com.fasterxml.jackson.annotation,com.fasterxml.jackson.core,com.fasterxml.jackson.dataformat.xml,com.fasterxml.jackson.datatype.jsr310 --type exe
```
# 2025-02-16
Tried to compile a jfx hello world using the openjdk and openjfx packaged in guix, but ran into issues. It looks like more up-to-date versions of openjfx are not available guix.
Might be the next best step is to depend on a binary release of openjfx and see if I can compile on linux like that. Could even have a custom guix package which depends on the openjfx binary release if needed.
# 2025-03-03
Tried some more packaging, but was getting a lot of "Error: automatic module cannot be used with jlink" issues. Not sure if I just wasn't getting those before or what, but the jpackage command above doesn't work now.
The issue seems to be with having non-modular dependencies. This page has some notes at the bottom about packaging non-modular applications: https://openjfx.io/openjfx-docs/#modular
# 2025-03-09
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=lib/wordpress-xmlrpc-client-1.1-SNAPSHOT.jar -DgroupId=com.tearsofaunicorn.wordpress -DartifactId=wordpress-xmlrpc-client -Dversion=1.1 -Dpackaging=jar -DlocalRepositoryPath=mvn-repo
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=lib/xmlrpc-client-3.1.3.jar -DgroupId=wordpress -DartifactId=xmlrpc-client -Dversion=3.1.3 -Dpackaging=jar -DlocalRepositoryPath=mvn-repo
# 2025-03-17
Appears to work. Launch is extremely slow
jpackage --input . --name numbers-station --main-jar .\target\numbersstation-1.0-SNAPSHOT.jar --main-class name.nathanmcrae.numbersstation.MainRun --type app-image --dest $HOME/temp/20250316T153044
Failed to generate msi this time :(
numbers-station/>jpackage --input . --name numbers-station --main-jar .\target\numbersstation-1.0-SNAPSHOT.jar --main-class name.nathanmcrae.numbersstation.MainRun --type exe --dest $HOME/temp/20250317T200941
java.io.IOException: Command [C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe, -nologo, C:\Users\nathanm\AppData\Local\Temp\jdk.jpackage911481192111528806\config\bundle.wxf, -ext, WixUtilExtension, -arch, x64, -out, C:\Users\nathanm\AppData\Local\Temp\jdk.jpackage911481192111528806\wixobj\bundle.wixobj] in C:\Users\nathanm\AppData\Local\Temp\jdk.jpackage911481192111528806\images\win-msi.image\numbers-station exited with 1 code
# 2025-03-22
Did a clean clone and build and it worked.
jpackage --input . --name numbers-station --main-jar .\target\numbersstation-1.0-SNAPSHOT.jar --main-class name.nathanmcrae.numbersstation.MainRun --type exe --win-menu --win-per-user-install --win-shortcut --win-shortcut-prompt --win-upgrade-uuid 956c711b-01f1-46a2-9355-4a6b63ec1ec9 --icon "P:\personal_root\projects\numbers-station\icon.ico" --description "Tool to periodically upload encrypted messages to a website/blog"
---
2025-03-22T20:50:38.212-07:00 INFO name.nathanmcrae.numbersstation.Main main Executable Path: C:\Users\nathanm\AppData\Local\numbers-station\numbers-station.exe

View File

@ -0,0 +1,71 @@
package name.nathanmcrae.numbersstation;
import java.awt.datatransfer.StringSelection;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.logging.Logger;
import java.util.logging.Level;
import java.util.Properties;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.TextField;
public class AboutController {
private static final Logger logger = Logger.getLogger(Main.class.getName());
@FXML
private TextField directoryTextField;
@FXML
private TextField executableTextField;
@FXML
private TextField homepageURLTextField;
@FXML
private TextField logPathTextField;
@FXML
private TextField versionTextField;
@FXML
private void initialize() {
directoryTextField.setText(Main.getConfigPath().toString());
String processName = ManagementFactory.getRuntimeMXBean().getName();
long pid = Long.parseLong(processName.split("@")[0]);
ProcessHandle currentProcess = ProcessHandle.of(pid).orElseThrow();
Path executablePath = currentProcess.info().command().map(Paths::get).orElseThrow();
executableTextField.setText(executablePath.toString());
Properties properties = new Properties();
try {
properties.load(getClass().getClassLoader().getResourceAsStream("git.properties"));
} catch (IOException e) {
logger.log(Level.SEVERE, "Failed to load git information", e);
}
versionTextField.setText(String.valueOf(properties.get("git.commit.id.full")));
homepageURLTextField.setText("https://git.nathanmcrae.name/nathanmcrae/numbers-station");
logPathTextField.setText(Main.getStatePath().resolve("main.log").toString());
}
public void handleAppExecutableButtonPress() {
}
public void handleConfigDirectoryButtonPress() {
}
public void handleLogFilePathButtonPress() {
}
}

View File

@ -0,0 +1,19 @@
package name.nathanmcrae.numbersstation;
import java.util.logging.Logger;
import javafx.fxml.FXML;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class HelpController {
private static final Logger logger = Logger.getLogger(Main.class.getName());
@FXML
WebView webView;
@FXML
public void initialize() throws Exception {
String url = HelpController.class.getResource("/help-index.html").toExternalForm();
webView.getEngine().load(url);
}
}

View File

@ -0,0 +1,246 @@
package name.nathanmcrae.numbersstation;
import com.leakyabstractions.result.api.Result;
import com.leakyabstractions.result.core.Results;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.lang.management.ManagementFactory;
import java.lang.ProcessHandle;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javafx.util.Pair;
public class LinuxScheduler {
private static final Logger logger = Logger.getLogger(Main.class.getName());
public static Result<Boolean, String> registerSchedule(StationSettings settings) {
try {
String taskName = "numbers-station-main_" + settings.getName();
Process listProcess = new ProcessBuilder("crontab", "-l").start();
if (!listProcess.waitFor(5, TimeUnit.SECONDS)) {
String message = "Failed to query " + taskName + " task: process timed out";
logger.log(Level.SEVERE, message);
return Results.failure(message);
}
Pair<String, String> output = WindowsScheduler.captureProcessOutput(listProcess);
if(listProcess.exitValue() != 0) {
String message = "Failed to get user id. Exit code: " + listProcess.exitValue() + ". stdout: " + output.getKey() + "\n\tstderr: " + output.getValue();
logger.log(Level.SEVERE, message);
return Results.failure(message);
}
String currentCrontab = output.getKey();
String cronEntry = "# " + taskName + "\n" + cronExpression(settings) + "\n\n";
Pattern pattern = Pattern.compile("# " + taskName + "\\n[^\\n]+\\n\\n");
Matcher matcher = pattern.matcher(currentCrontab);
StringBuilder sb = new StringBuilder();
if (matcher.find()) {
matcher.appendReplacement(sb, cronEntry);
boolean foundMultiple = false;
while (matcher.find()) {
foundMultiple = true;
matcher.appendReplacement(sb, "");
}
if (foundMultiple) {
logger.log(Level.WARNING, "Found multiple instances of '" + taskName + "' prior to replacement");
}
matcher.appendTail(sb);
} else {
sb.append(currentCrontab);
sb.append(cronEntry);
}
String newCrontab = sb.toString();
Process addProcess = new ProcessBuilder("crontab", "-").start();
Writer w = new OutputStreamWriter(addProcess.getOutputStream(), "UTF-8");
System.out.println(newCrontab);
w.write(newCrontab);
w.flush();
w.close();
if (!addProcess.waitFor(5, TimeUnit.SECONDS)) {
String message = "Failed to register " + taskName + " task: process timed out";
logger.log(Level.SEVERE, message);
return Results.failure(message);
}
if(addProcess.exitValue() != 0) {
Pair<String, String> addOutput = WindowsScheduler.captureProcessOutput(addProcess);
String message = "Failed to get user id. Exit code: " + addProcess.exitValue() + ". stdout: " + addOutput.getKey() + ". stderr: " + addOutput.getValue();
logger.log(Level.SEVERE, message);
return Results.failure(message);
}
} catch (CronExpressionException | IOException | InterruptedException e) {
String message = "Exception while registering schedule";
logger.log(Level.SEVERE, message, e);
return Results.failure(message);
}
return Results.success(true);
}
public static Result<Boolean, String> scheduleExists(StationSettings settings) {
try {
String taskName = "numbers-station-main_" + settings.getName();
Process listProcess = new ProcessBuilder("crontab", "-l").start();
if (!listProcess.waitFor(5, TimeUnit.SECONDS)) {
String message = "Failed to query " + taskName + " task: process timed out";
logger.log(Level.SEVERE, message);
return Results.failure(message);
}
Pair<String, String> output = WindowsScheduler.captureProcessOutput(listProcess);
if(listProcess.exitValue() != 0) {
String message = "Failed to get user id. Exit code: " + listProcess.exitValue() + ". stdout: " + output.getKey() + "\n\tstderr: " + output.getValue();
logger.log(Level.SEVERE, message);
return Results.failure(message);
}
String currentCrontab = output.getKey();
String cronEntry = "# " + taskName + "\n" + cronExpression(settings) + "\n\n";
Pattern pattern = Pattern.compile("# " + taskName + "\\n[^\\n]+\\n\\n");
Matcher matcher = pattern.matcher(currentCrontab);
if (matcher.find()) {
return Results.success(true);
} else {
return Results.success(true);
}
} catch (CronExpressionException | IOException | InterruptedException e) {
String message = "Exception while checking for schedule";
logger.log(Level.SEVERE, message, e);
return Results.failure(message);
}
}
public static Result<Boolean, String> removeSchedule(StationSettings settings) {
try {
String taskName = "numbers-station-main_" + settings.getName();
Process listProcess = new ProcessBuilder("crontab", "-l").start();
if (!listProcess.waitFor(5, TimeUnit.SECONDS)) {
String message = "Failed to query " + taskName + " task: process timed out";
logger.log(Level.SEVERE, message);
return Results.failure(message);
}
Pair<String, String> output = WindowsScheduler.captureProcessOutput(listProcess);
if(listProcess.exitValue() != 0) {
String message = "Failed to get user id. Exit code: " + listProcess.exitValue() + ". stdout: " + output.getKey() + "\n\tstderr: " + output.getValue();
logger.log(Level.SEVERE, message);
return Results.failure(message);
}
String currentCrontab = output.getKey();
String cronEntry = "# " + taskName + "\n" + cronExpression(settings) + "\n\n";
Pattern pattern = Pattern.compile("# " + taskName + "\\n[^\\n]+\\n\\n");
Matcher matcher = pattern.matcher(currentCrontab);
StringBuilder sb = new StringBuilder();
while (matcher.find()) {
matcher.appendReplacement(sb, "");
}
String newCrontab = sb.toString();
Process addProcess = new ProcessBuilder("crontab", "-").start();
Writer w = new OutputStreamWriter(addProcess.getOutputStream(), "UTF-8");
System.out.println(newCrontab);
w.write(newCrontab);
w.flush();
w.close();
if (!addProcess.waitFor(5, TimeUnit.SECONDS)) {
String message = "Failed to register " + taskName + " task: process timed out";
logger.log(Level.SEVERE, message);
return Results.failure(message);
}
if(addProcess.exitValue() != 0) {
Pair<String, String> addOutput = WindowsScheduler.captureProcessOutput(addProcess);
String message = "Failed to get user id. Exit code: " + addProcess.exitValue() + ". stdout: " + addOutput.getKey() + ". stderr: " + addOutput.getValue();
logger.log(Level.SEVERE, message);
return Results.failure(message);
}
} catch (CronExpressionException | IOException | InterruptedException e) {
String message = "Exception while removing schedule";
logger.log(Level.SEVERE, message, e);
return Results.failure(message);
}
return Results.success(true);
}
/**
* * * * * * {command to execute}
* | | | | |
* | | | | day of the week (06) (Sunday to Saturday;
* | | | month (112) 7 is also Sunday on some systems)
* | | day of the month (131)
* | hour (023)
* minute (059)
*/
public static String cronExpression(StationSettings settings) throws CronExpressionException {
LocalDateTime scheduleDateTime = settings.getScheduleStart().withZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime();
String minute = Integer.toString(scheduleDateTime.getMinute());
String hour = Integer.toString(scheduleDateTime.getHour());
String dayOfMonth = Integer.toString(scheduleDateTime.getDayOfMonth());
String dayOfWeek = Integer.toString(scheduleDateTime.getDayOfMonth());
String scheduleString = "";
switch(settings.getMessagePeriod()) {
case DAILY:
scheduleString = minute + " " + hour + " * * *";
break;
case WEEKLY:
scheduleString = minute + " " + hour + " * * " + dayOfWeek;
break;
case MONTHLY:
scheduleString = minute + " " + hour + " " + dayOfMonth + " * *";
break;
default:
throw new CronExpressionException("Message period not implemented: '" + settings.getMessagePeriod() + "'");
}
String processName = ManagementFactory.getRuntimeMXBean().getName();
long pid = Long.parseLong(processName.split("@")[0]);
ProcessHandle currentProcess = ProcessHandle.of(pid).orElseThrow();
Path executablePath = currentProcess.info().command().map(Paths::get).orElseThrow();
logger.info("Executable Path: " + executablePath);
return scheduleString + " " + executablePath.toString() + " --station \"" + settings.getName() + "\"";
}
public static class CronExpressionException extends Exception {
public CronExpressionException(String message) {
super(message);
}
}
}

View File

@ -7,9 +7,20 @@ import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpException; import com.jcraft.jsch.SftpException;
import com.leakyabstractions.result.api.Result; import com.leakyabstractions.result.api.Result;
import com.leakyabstractions.result.core.Results; import com.leakyabstractions.result.core.Results;
import com.rometools.rome.feed.synd.SyndContent;
import com.rometools.rome.feed.synd.SyndContentImpl;
import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.feed.synd.SyndEntryImpl;
import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.feed.synd.SyndFeedImpl;
import com.rometools.rome.io.SyndFeedInput;
import com.rometools.rome.io.SyndFeedOutput;
import com.tearsofaunicorn.wordpress.api.model.Post; import com.tearsofaunicorn.wordpress.api.model.Post;
import com.tearsofaunicorn.wordpress.api.WordpressClient; import com.tearsofaunicorn.wordpress.api.WordpressClient;
import java.io.IOException; import java.io.IOException;
import java.io.File;
import java.io.Writer;
import java.io.FileWriter;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
@ -17,27 +28,47 @@ import java.nio.file.Paths;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.time.ZoneOffset;
import java.util.concurrent.TimeUnit;
import java.util.Date; import java.util.Date;
import java.util.logging.FileHandler; import java.util.logging.FileHandler;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.Optional; import java.util.Optional;
import java.util.Properties;
import javafx.application.Application; import javafx.application.Application;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.image.Image;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.util.Pair;
import org.apache.commons.cli.*; import org.apache.commons.cli.*;
public class Main extends Application { public class Main extends Application {
public record StartParameters (Optional<NotificationController.NotificationParameters> notification) {} public record StartParameters (Optional<NotificationController.NotificationParameters> notification) {}
private static final Logger logger = Logger.getLogger(Main.class.getName()); private static final Logger logger = Logger.getLogger(Main.class.getName());
// TODO: get git info private static Path configPath = null;
private static final String VERSION = "0.0.1";
private static Path statePath = null; private static Path statePath = null;
public static Path getConfigPath() {
if (configPath == null) {
String configHome = System.getenv("XDG_CONFIG_HOME");
if (configHome != null && !configHome.isEmpty() && Paths.get(configHome).isAbsolute()) {
configPath = Paths.get(configHome, "numbers-station");
} else {
String userHome = System.getProperty("user.home");
configPath = Paths.get(userHome, ".config", "numbers-station");
}
}
return configPath;
}
public static Path getStatePath() { public static Path getStatePath() {
if (statePath == null) { if (statePath == null) {
String stateHome = System.getenv("XDG_STATE_HOME"); String stateHome = System.getenv("XDG_STATE_HOME");
@ -62,21 +93,28 @@ public class Main extends Application {
try { try {
if (startParams.notification().isPresent()){ if (startParams.notification().isPresent()){
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("NotificationView.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/NotificationView.fxml"));
Parent root = fxmlLoader.load(); Parent root = fxmlLoader.load();
NotificationController controller = fxmlLoader.getController(); NotificationController controller = fxmlLoader.getController();
controller.setNotification(startParams.notification().get()); controller.setNotification(startParams.notification().get());
primaryStage.setMinWidth(350);
primaryStage.setMinHeight(200);
primaryStage.setTitle("Numbers Station"); primaryStage.setTitle("Numbers Station");
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/icon.png")));
primaryStage.setScene(new Scene(root)); primaryStage.setScene(new Scene(root));
primaryStage.show(); primaryStage.show();
} else { } else {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MainView.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/MainView.fxml"));
Parent root = fxmlLoader.load(); Parent root = fxmlLoader.load();
MainController controller = fxmlLoader.getController(); MainController controller = fxmlLoader.getController();
primaryStage.setMinWidth(480);
primaryStage.setMinHeight(200);
primaryStage.setOnCloseRequest(e -> { primaryStage.setOnCloseRequest(e -> {
if (!controller.handleCloseRequest()) { if (!controller.handleCloseRequest()) {
e.consume(); e.consume();
@ -86,10 +124,19 @@ public class Main extends Application {
}); });
primaryStage.setTitle("Numbers Station"); primaryStage.setTitle("Numbers Station");
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/icon.png")));
primaryStage.setScene(new Scene(root)); primaryStage.setScene(new Scene(root));
primaryStage.titleProperty().bindBidirectional(controller.windowTitle); primaryStage.titleProperty().bindBidirectional(controller.windowTitle);
primaryStage.show(); primaryStage.show();
logger.info("Application started"); logger.info("Application started");
Properties properties = new Properties();
try {
properties.load(getClass().getClassLoader().getResourceAsStream("git.properties"));
logger.info("Application version: " + String.valueOf(properties.get("git.commit.id.full")));
} catch (IOException e) {
logger.log(Level.SEVERE, "Failed to load git information", e);
}
} }
} catch (IOException e) { } catch (IOException e) {
logger.log(Level.SEVERE, "Failed to load main view", e); logger.log(Level.SEVERE, "Failed to load main view", e);
@ -115,13 +162,25 @@ public class Main extends Application {
public static void main(String[] args) { public static void main(String[] args) {
MainParsedArguments parsedArgs = new MainParsedArguments(args); MainParsedArguments parsedArgs = new MainParsedArguments(args);
if (parsedArgs.getParseException() != null) {
logger.log(Level.SEVERE, "Failed when parsing arguments", parsedArgs.getParseException());
parsedArgs.printHelp();
System.exit(0);
}
if (parsedArgs.getHelpFlag()) { if (parsedArgs.getHelpFlag()) {
parsedArgs.printHelp(); parsedArgs.printHelp();
System.exit(0); System.exit(0);
} }
if (parsedArgs.getVersionFlag()) { if (parsedArgs.getVersionFlag()) {
System.out.println("Numbers Station version " + VERSION); Properties properties = new Properties();
try {
properties.load(Main.class.getClassLoader().getResourceAsStream("git.properties"));
System.out.println(String.valueOf(properties.get("git.commit.id.full")));
} catch (IOException e) {
System.out.println("Failed to get git information");
}
System.exit(0); System.exit(0);
} }
@ -165,6 +224,14 @@ public class Main extends Application {
public StationRunException(String message) { public StationRunException(String message) {
super(message); super(message);
} }
public StationRunException(Throwable cause) {
super(cause);
}
public StationRunException(String message, Throwable cause) {
super(message, cause);
}
} }
public static void runStation(MainParsedArguments parsedArgs) throws StationRunException { public static void runStation(MainParsedArguments parsedArgs) throws StationRunException {
@ -214,8 +281,56 @@ public class Main extends Application {
} }
switch (loadedStation.getMessageMethod()) { switch (loadedStation.getMessageMethod()) {
case StationSettings.MessageMethod.EXTERNAL_PROGRAM:
Process process = new ProcessBuilder(loadedStation.getExternalProgramCommand(), nextMessagePath.toString()).start();
if (!process.waitFor(loadedStation.getExternalProgramTimeout().getSeconds(), TimeUnit.SECONDS)) {
throw new StationRunException("Timeout while running external program " + loadedStation.getExternalProgramCommand());
}
Pair<String, String> output = WindowsScheduler.captureProcessOutput(process);
if(process.exitValue() != 0) {
String message = "External program non-zero exit code. Exit code: " + process.exitValue() + ". stdout: " + output.getKey() + "\n\tstderr: " + output.getValue();
logger.log(Level.SEVERE, message);
throw new StationRunException(message);
}
break;
case StationSettings.MessageMethod.SFTP: case StationSettings.MessageMethod.SFTP:
//loadedStation.uploadNextMessageToSFTP(); //loadedStation.uploadNextMessageToSFTP();
Path rssPath = stationDirPath.resolve("feed.xml");
SyndFeed feed;
if (Files.exists(rssPath)) {
SyndFeedInput input = new SyndFeedInput();
feed = input.build(new File(rssPath.toString()));
} else {
feed = new SyndFeedImpl();
feed.setFeedType("atom_1.0");
feed.setTitle("Blog");
feed.setLink(loadedStation.getAddress());
feed.setDescription("Sample blog");
}
SyndEntry entry = new SyndEntryImpl();
String timestamp = ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT);
entry.setTitle(timestamp);
entry.setLink(loadedStation.getAddress());
SyndContent description = new SyndContentImpl();
description.setType("text/html");
description.setValue(messageText);
entry.setDescription(description);
feed.getEntries().add(entry);
feed.setPublishedDate(new Date());
Writer writer = new FileWriter(rssPath.toString());
SyndFeedOutput syndFeedOutput = new SyndFeedOutput();
syndFeedOutput.output(feed, writer);
writer.close();
JSch jsch = new JSch(); JSch jsch = new JSch();
try { try {
Session session = jsch.getSession(loadedStation.getUsername(), loadedStation.getAddress(), 22); Session session = jsch.getSession(loadedStation.getUsername(), loadedStation.getAddress(), 22);
@ -229,6 +344,7 @@ public class Main extends Application {
String localFile = loadedStation.nextMessagePath().toString(); String localFile = loadedStation.nextMessagePath().toString();
channel.put(localFile, "www/message.txt"); channel.put(localFile, "www/message.txt");
channel.put(rssPath.toString(), "www/feed.xml");
channel.exit(); channel.exit();
session.disconnect(); session.disconnect();
} else { } else {
@ -262,6 +378,8 @@ public class Main extends Application {
throw new StationRunException(message); throw new StationRunException(message);
} }
logger.info("Completed station run");
System.exit(0); System.exit(0);
} }
} }

View File

@ -9,6 +9,7 @@ import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -24,10 +25,12 @@ import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType; import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.TextArea; import javafx.scene.control.TextArea;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.input.KeyEvent; import javafx.scene.input.KeyEvent;
import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCode;
import javafx.scene.Parent; import javafx.scene.Parent;
@ -39,11 +42,15 @@ import javafx.stage.Stage;
public class MainController implements Initializable { public class MainController implements Initializable {
private static final Logger logger = Logger.getLogger(Main.class.getName()); private static final Logger logger = Logger.getLogger(Main.class.getName());
private Stage aboutStage;
private Stage helpStage;
private Stage settingsStage; private Stage settingsStage;
private Stage selectStationStage; private Stage selectStationStage;
private MainSettings settings; private MainSettings settings;
private StationSettings selectedStation; private StationSettings selectedStation;
private StringProperty nextSendTime = new SimpleStringProperty();
private StringProperty selectedStationName = new SimpleStringProperty(); private StringProperty selectedStationName = new SimpleStringProperty();
private SimpleBooleanProperty unsavedChanges = new SimpleBooleanProperty(); private SimpleBooleanProperty unsavedChanges = new SimpleBooleanProperty();
@ -51,7 +58,7 @@ public class MainController implements Initializable {
public StringProperty windowTitle = new SimpleStringProperty("Numbers Station"); public StringProperty windowTitle = new SimpleStringProperty("Numbers Station");
@FXML @FXML
private Label lastRetrievedLabel; private Label nextSendTimeLabel;
@FXML @FXML
private TextArea messageTextArea; private TextArea messageTextArea;
@ -66,7 +73,7 @@ public class MainController implements Initializable {
private void handleStationSettingsButtonPress() { private void handleStationSettingsButtonPress() {
if (settingsStage == null || !settingsStage.isShowing()) { if (settingsStage == null || !settingsStage.isShowing()) {
try { try {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StationSettingsView.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/StationSettingsView.fxml"));
Parent root = fxmlLoader.load(); Parent root = fxmlLoader.load();
StationSettingsController controller = fxmlLoader.getController(); StationSettingsController controller = fxmlLoader.getController();
@ -82,8 +89,11 @@ public class MainController implements Initializable {
controller.setStationNameList(settings.getStations().stream().map(StationSettings::toString).toList()); controller.setStationNameList(settings.getStations().stream().map(StationSettings::toString).toList());
settingsStage = new Stage(); settingsStage = new Stage();
settingsStage.setMinWidth(600);
settingsStage.setMinHeight(300);
settingsStage.initModality(Modality.APPLICATION_MODAL); settingsStage.initModality(Modality.APPLICATION_MODAL);
settingsStage.setTitle("Numbers Station Settings"); settingsStage.setTitle("Numbers Station Settings");
settingsStage.getIcons().add(new Image(getClass().getResourceAsStream("/icon.png")));
settingsStage.setScene(new Scene(root)); settingsStage.setScene(new Scene(root));
settingsStage.show(); settingsStage.show();
settingsStage.setOnHiding(event -> { settingsStage.setOnHiding(event -> {
@ -101,16 +111,19 @@ public class MainController implements Initializable {
private void handleSelectStationButtonPress() throws Exception { private void handleSelectStationButtonPress() throws Exception {
if (selectStationStage == null || !selectStationStage.isShowing()) { if (selectStationStage == null || !selectStationStage.isShowing()) {
try { try {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StationSelectionView.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/StationSelectionView.fxml"));
Parent root = fxmlLoader.load(); Parent root = fxmlLoader.load();
StationSelectionController controller = fxmlLoader.getController(); StationSelectionController controller = fxmlLoader.getController();
controller.setSettings(settings); controller.setSettings(settings);
selectStationStage = new Stage(); selectStationStage = new Stage();
selectStationStage.setMinWidth(300);
selectStationStage.setMinHeight(200);
selectStationStage.initModality(Modality.APPLICATION_MODAL); selectStationStage.initModality(Modality.APPLICATION_MODAL);
selectStationStage.setUserData(null); selectStationStage.setUserData(null);
selectStationStage.setTitle("Numbers Station Selection"); selectStationStage.setTitle("Numbers Station Selection");
selectStationStage.getIcons().add(new Image(getClass().getResourceAsStream("/icon.png")));
Scene scene = new Scene(root); Scene scene = new Scene(root);
scene.addEventFilter(KeyEvent.KEY_PRESSED, (e) -> controller.handleKeyPressed(e)); scene.addEventFilter(KeyEvent.KEY_PRESSED, (e) -> controller.handleKeyPressed(e));
@ -167,21 +180,39 @@ public class MainController implements Initializable {
@Override @Override
public void initialize(URL location, ResourceBundle resources) { public void initialize(URL location, ResourceBundle resources) {
stationNameField.textProperty().bindBidirectional(selectedStationName); stationNameField.textProperty().bindBidirectional(selectedStationName);
nextSendTimeLabel.textProperty().bind(nextSendTime);
Result<MainSettings, Exception> result = MainSettings.load(); Result<MainSettings, Exception> result = MainSettings.load();
if (!result.hasSuccess()) { if (!result.hasSuccess()) {
// TODO: on failure, prompt user to re-initialize settings String logPath = Main.getStatePath().resolve("main.log").toString();
Alert alert = new Alert(Alert.AlertType.ERROR); String message = "Unable to load settings file. See log file at " + logPath + " for details. Reinitialize settings? This may overwrite existing settings.";
Alert alert = new Alert(Alert.AlertType.ERROR, message, ButtonType.NO, ButtonType.YES);
alert.setTitle("Settings load error"); alert.setTitle("Settings load error");
alert.setHeaderText(null); alert.setHeaderText(null);
alert.setContentText("Unable to load settings file");
alert.showAndWait();
return; //Deactivate Defaultbehavior for yes-Button:
Button yesButton = (Button) alert.getDialogPane().lookupButton( ButtonType.YES );
yesButton.setDefaultButton( false );
//Activate Defaultbehavior for no-Button:
Button noButton = (Button) alert.getDialogPane().lookupButton( ButtonType.NO );
noButton.setDefaultButton( true );
Optional<ButtonType> promptResult = alert.showAndWait();
if (!promptResult.isPresent()) {
System.exit(1);
}
if (promptResult.get() == ButtonType.NO) {
System.exit(1);
}
settings = new MainSettings();
} else {
settings = result.getSuccess().get();
} }
settings = result.getSuccess().get();
selectedStationName.set(settings.getSelectedStationName()); selectedStationName.set(settings.getSelectedStationName());
if (selectedStationName.get() == null || selectedStationName.get() == "") { if (selectedStationName.get() == null || selectedStationName.get() == "") {
@ -194,8 +225,6 @@ public class MainController implements Initializable {
.findFirst() .findFirst()
.orElse(null); .orElse(null);
// TODO: if there are no stations, then create a default station and select that
if (selectedStation == null) { if (selectedStation == null) {
logger.log(Level.SEVERE, "Selected station '" + selectedStationName.get() + "' not found"); logger.log(Level.SEVERE, "Selected station '" + selectedStationName.get() + "' not found");
selectedStation = settings.getStations().get(0); selectedStation = settings.getStations().get(0);
@ -279,14 +308,27 @@ public class MainController implements Initializable {
logger.info("Updating station settings: " + newStationSettings.getName()); logger.info("Updating station settings: " + newStationSettings.getName());
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
try {
nextSendTime.set(newStationSettings.nextSendTime().format(dateFormatter));
} catch (StationSettings.StationSettingsException e) {
String errMessage = "Failed to calculate next message time";
logger.log(Level.SEVERE, errMessage, e);
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Exception");
alert.setHeaderText(null);
alert.setContentText(errMessage + ": " + e.getMessage());
alert.showAndWait();
return;
}
selectedStation = newStationSettings; selectedStation = newStationSettings;
selectedStationName.set(newStationSettings.getName()); selectedStationName.set(newStationSettings.getName());
settings.setSelectedStationName(selectedStationName.get()); settings.setSelectedStationName(selectedStationName.get());
settings.save(); settings.save();
// TODO: Load message from file
// If the message we're overwriting is different from its file, then prompt to confirm
Path nextMessagePath = selectedStation.stationPath().resolve("next-message.txt"); Path nextMessagePath = selectedStation.stationPath().resolve("next-message.txt");
String messageText; String messageText;
@ -370,4 +412,54 @@ public class MainController implements Initializable {
return true; return true;
} }
public void handleAboutButtonPress() {
try {
if (aboutStage == null) {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/AboutView.fxml"));
Parent root = fxmlLoader.load();
aboutStage = new Stage();
aboutStage.setMinWidth(250);
aboutStage.setMinHeight(230);
aboutStage.setTitle("About Numbers Station");
aboutStage.getIcons().add(new Image(getClass().getResourceAsStream("/icon.png")));
aboutStage.setScene(new Scene(root));
}
if (aboutStage.isShowing()) {
aboutStage.toFront();
} else {
aboutStage.show();
}
} catch (IOException e) {
logger.log(Level.SEVERE, "Exception while opening application about screen", e);
}
}
public void handleHelpButtonPress() {
try {
if (helpStage == null) {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/HelpView.fxml"));
Parent root = fxmlLoader.load();
helpStage = new Stage();
helpStage.setMinWidth(400);
helpStage.setMinHeight(400);
helpStage.setTitle("Numbers Station Help");
helpStage.getIcons().add(new Image(getClass().getResourceAsStream("/icon.png")));
helpStage.setScene(new Scene(root));
}
if (helpStage.isShowing()) {
helpStage.toFront();
} else {
helpStage.show();
}
} catch (IOException e) {
logger.log(Level.SEVERE, "Exception while opening help", e);
}
}
} }

View File

@ -0,0 +1,7 @@
package name.nathanmcrae.numbersstation;
public class MainRun {
public static void main(String[] args) {
Main.main(args);
}
}

View File

@ -31,17 +31,7 @@ public class MainSettings {
} }
public static Path getSettingsFilePath() { public static Path getSettingsFilePath() {
String configHome = System.getenv("XDG_CONFIG_HOME"); return Main.getConfigPath().resolve("main-settings.xml");
Path directoryPath;
if (configHome != null && !configHome.isEmpty() && Paths.get(configHome).isAbsolute()) {
directoryPath = Paths.get(configHome, "numbers-station");
} else {
String userHome = System.getProperty("user.home");
directoryPath = Paths.get(userHome, ".config", "numbers-station");
}
return directoryPath.resolve("main-settings.xml");
} }
public ArrayList<StationSettings> getStations() { public ArrayList<StationSettings> getStations() {
@ -110,6 +100,7 @@ public class MainSettings {
XmlMapper xmlMapper = new XmlMapper(); XmlMapper xmlMapper = new XmlMapper();
xmlMapper.registerModule(new JavaTimeModule()); xmlMapper.registerModule(new JavaTimeModule());
xmlMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); xmlMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
xmlMapper.configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS, false);
xmlMapper.enable(SerializationFeature.INDENT_OUTPUT); xmlMapper.enable(SerializationFeature.INDENT_OUTPUT);
try { try {
Path filePath = getSettingsFilePath(); Path filePath = getSettingsFilePath();

View File

@ -112,6 +112,9 @@ public class StationSelectionController {
@FXML @FXML
private void handleRemoveButtonPress(ActionEvent event) { private void handleRemoveButtonPress(ActionEvent event) {
int selectedIndex = stationListView.getSelectionModel().getSelectedIndex(); int selectedIndex = stationListView.getSelectionModel().getSelectedIndex();
if (selectedIndex < 0) {
return;
}
StationSettings station = stationList.get(selectedIndex); StationSettings station = stationList.get(selectedIndex);
String stationName = station.toString(); String stationName = station.toString();
@ -135,14 +138,12 @@ public class StationSelectionController {
while (change.next()) { while (change.next()) {
if (change.wasAdded()) { if (change.wasAdded()) {
for (StationSettings addedStation : change.getAddedSubList()) { for (StationSettings addedStation : change.getAddedSubList()) {
System.out.println("Added: " + addedStation.getName());
} }
} }
if (change.wasRemoved()) { if (change.wasRemoved()) {
for (StationSettings removedStation : change.getRemoved()) { for (StationSettings removedStation : change.getRemoved()) {
System.out.println("Removed: " + removedStation.getName());
try { try {
StationSettings.deleteStationData(removedStation.getName());
removedStation.deleteDir(); removedStation.deleteDir();
} catch (IOException e) { } catch (IOException e) {
logger.log(Level.SEVERE, "Exception when removing station directory", e); logger.log(Level.SEVERE, "Exception when removing station directory", e);
@ -167,7 +168,6 @@ public class StationSelectionController {
if (selectedStation != null) { if (selectedStation != null) {
stage.setUserData(selectedStation.getName()); stage.setUserData(selectedStation.getName());
System.out.println("Selected Station: " + selectedStation.getName());
} }
stage.close(); stage.close();
} }

View File

@ -10,8 +10,13 @@ import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor; import java.nio.file.SimpleFileVisitor;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.time.Duration;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.time.ZoneId;
import java.time.LocalTime; import java.time.LocalTime;
import java.time.Period;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.logging.Level; import java.util.logging.Level;
@ -23,6 +28,7 @@ public class StationSettings {
private String address; private String address;
private int digitsPerGroup; private int digitsPerGroup;
private String externalProgramCommand; private String externalProgramCommand;
private Duration externalProgramTimeout;
private boolean manageScheduleExternally; private boolean manageScheduleExternally;
private int messageLength; private int messageLength;
private MessageMethod messageMethod; private MessageMethod messageMethod;
@ -30,8 +36,7 @@ public class StationSettings {
private String name; private String name;
private String password; private String password;
private ArrayList<String> prefixes; private ArrayList<String> prefixes;
private LocalDate scheduleStartDate; private ZonedDateTime scheduleStart;
private LocalTime scheduleStartTime;
private String username; private String username;
public enum MessageMethod { public enum MessageMethod {
@ -50,21 +55,21 @@ public class StationSettings {
prefixes = new ArrayList<String>(); prefixes = new ArrayList<String>();
digitsPerGroup = 4; digitsPerGroup = 4;
messageLength = 100; messageLength = 100;
externalProgramTimeout = Duration.ofSeconds(5);
messageMethod = MessageMethod.SFTP; messageMethod = MessageMethod.SFTP;
messagePeriod = MessagePeriod.DAILY; messagePeriod = MessagePeriod.DAILY;
scheduleStartDate = LocalDate.now(); scheduleStart = ZonedDateTime.now();
scheduleStartTime = LocalTime.now();
} }
public StationSettings(String newName) { public StationSettings(String newName) {
name = newName; name = newName;
prefixes = new ArrayList<String>(); prefixes = new ArrayList<String>();
digitsPerGroup = 4; digitsPerGroup = 4;
externalProgramTimeout = Duration.ofSeconds(5);
messageLength = 100; messageLength = 100;
messageMethod = MessageMethod.SFTP; messageMethod = MessageMethod.SFTP;
messagePeriod = MessagePeriod.DAILY; messagePeriod = MessagePeriod.DAILY;
scheduleStartDate = LocalDate.now(); scheduleStart = ZonedDateTime.now();
scheduleStartTime = LocalTime.now();
} }
public static void deleteStationData(String stationName) throws IOException { public static void deleteStationData(String stationName) throws IOException {
@ -76,8 +81,7 @@ public class StationSettings {
if (osName.contains("win")) { if (osName.contains("win")) {
WindowsScheduler.removeSchedule(temp); WindowsScheduler.removeSchedule(temp);
} else if (osName.contains("nix") || osName.contains("nux") || osName.contains("aix")) { } else if (osName.contains("nix") || osName.contains("nux") || osName.contains("aix")) {
// TODO: linux LinuxScheduler.removeSchedule(temp);
logger.log(Level.SEVERE, "Unsupported OS " + osName);
} else { } else {
logger.log(Level.SEVERE, "Unsupported OS " + osName); logger.log(Level.SEVERE, "Unsupported OS " + osName);
} }
@ -96,8 +100,10 @@ public class StationSettings {
return true; return true;
} }
} else if (osName.contains("nix") || osName.contains("nux") || osName.contains("aix")) { } else if (osName.contains("nix") || osName.contains("nux") || osName.contains("aix")) {
// TODO: linux Result<Boolean, String> result = LinuxScheduler.scheduleExists(temp);
logger.log(Level.SEVERE, "Unsupported OS " + osName); if (result.hasSuccess() && result.getSuccess().get()) {
return true;
}
} else { } else {
logger.log(Level.SEVERE, "Unsupported OS " + osName); logger.log(Level.SEVERE, "Unsupported OS " + osName);
} }
@ -106,6 +112,10 @@ public class StationSettings {
} }
public void deleteDir() throws IOException { public void deleteDir() throws IOException {
if (!Files.exists(stationPath())) {
return;
}
Files.walkFileTree(stationPath(), new SimpleFileVisitor<Path>() { Files.walkFileTree(stationPath(), new SimpleFileVisitor<Path>() {
@Override @Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
@ -126,22 +136,12 @@ public class StationSettings {
} }
public Path stationPath() { public Path stationPath() {
String configHome = System.getenv("XDG_CONFIG_HOME");
Path directoryPath;
if (configHome != null && !configHome.isEmpty() && Paths.get(configHome).isAbsolute()) {
directoryPath = Paths.get(configHome, "numbers-station");
} else {
String userHome = System.getProperty("user.home");
directoryPath = Paths.get(userHome, ".config", "numbers-station");
}
String stationDirName = null; String stationDirName = null;
try { try {
stationDirName = java.net.URLEncoder.encode(name, "UTF-8"); stationDirName = java.net.URLEncoder.encode(name, "UTF-8");
} catch(UnsupportedEncodingException e) {} // We know UTF-8 is supported } catch(UnsupportedEncodingException e) {} // We know UTF-8 is supported
return directoryPath.resolve(stationDirName); return Main.getConfigPath().resolve(stationDirName);
} }
public String generateMessage(int generationAttempts) throws MessageGenerationException { public String generateMessage(int generationAttempts) throws MessageGenerationException {
@ -191,6 +191,50 @@ public class StationSettings {
return messageFormattedBuilder.toString(); return messageFormattedBuilder.toString();
} }
public LocalDateTime nextSendTime() throws StationSettingsException {
LocalDate startDate = scheduleStart.withZoneSameInstant(ZoneId.systemDefault()).toLocalDate();
LocalTime startTime = scheduleStart.withZoneSameInstant(ZoneId.systemDefault()).toLocalTime();
Period sinceScheduleStart = Period.between(startDate, LocalDate.now());
// If this period's time has not yet passed, then show that time.
// Otherwise, show the next period's time.
switch (messagePeriod) {
case DAILY:
if (LocalTime.now().isBefore(startTime)) {
return LocalDate.now().atTime(startTime);
} else {
return LocalDate.now().plusDays(1).atTime(startTime);
}
case WEEKLY:
int weekdayDifference = startDate.getDayOfWeek().getValue() - LocalDate.now().getDayOfWeek().getValue();
if (weekdayDifference > 0) {
return LocalDate.now().plusDays(weekdayDifference).atTime(startTime);
} else if (weekdayDifference == 0){
if (LocalTime.now().isBefore(startTime)) {
return LocalDate.now().atTime(startTime);
} else {
return LocalDate.now().plusWeeks(1).atTime(startTime);
}
} else {
return LocalDate.now().plusDays(7 + weekdayDifference).atTime(startTime);
}
case MONTHLY:
int monthdayDifference = startDate.getDayOfMonth() - LocalDate.now().getDayOfMonth();
if (monthdayDifference > 0) {
return LocalDate.now().plusDays(monthdayDifference).atTime(startTime);
} else if (monthdayDifference == 0) {
if (LocalTime.now().isBefore(startTime)) {
return LocalDate.now().atTime(startTime);
} else {
return LocalDate.now().plusMonths(1).atTime(startTime);
}
} else {
return LocalDate.now().plusMonths(1).plusDays(monthdayDifference).atTime(startTime);
}
default:
throw new StationSettingsException("Invalid period value: " + messagePeriod);
}
}
public String getAddress() { public String getAddress() {
return address; return address;
} }
@ -215,6 +259,14 @@ public class StationSettings {
externalProgramCommand = newExternalProgramCommand; externalProgramCommand = newExternalProgramCommand;
} }
public Duration getExternalProgramTimeout() {
return externalProgramTimeout;
}
public void setExternalProgramTimeout(Duration newExternalProgramTimeout) {
externalProgramTimeout = newExternalProgramTimeout;
}
public boolean getManageScheduleExternally() { public boolean getManageScheduleExternally() {
return manageScheduleExternally; return manageScheduleExternally;
} }
@ -270,20 +322,12 @@ public class StationSettings {
return prefixes; return prefixes;
} }
public LocalDate getScheduleStartDate() { public ZonedDateTime getScheduleStart() {
return scheduleStartDate; return scheduleStart;
} }
public void setScheduleStartDate(LocalDate newScheduleStartDate) { public void setScheduleStart(ZonedDateTime newScheduleStart) {
scheduleStartDate = newScheduleStartDate; scheduleStart = newScheduleStart;
}
public LocalTime getScheduleStartTime() {
return scheduleStartTime;
}
public void setScheduleStartTime(LocalTime newScheduleStartTime) {
scheduleStartTime = newScheduleStartTime;
} }
public String getUsername() { public String getUsername() {
@ -304,4 +348,11 @@ public class StationSettings {
super(message); super(message);
} }
} }
public static class StationSettingsException extends Exception {
public StationSettingsException(String message) {
super(message);
}
}
} }

View File

@ -15,6 +15,9 @@ import java.nio.file.Path;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalTime; import java.time.LocalTime;
import java.time.ZonedDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
@ -47,6 +50,7 @@ import javafx.scene.control.SpinnerValueFactory;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.control.TextInputDialog; import javafx.scene.control.TextInputDialog;
import javafx.scene.control.ToggleGroup; import javafx.scene.control.ToggleGroup;
import javafx.scene.image.Image;
import javafx.scene.input.KeyEvent; import javafx.scene.input.KeyEvent;
import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCode;
import javafx.scene.Node; import javafx.scene.Node;
@ -357,7 +361,7 @@ public class StationSettingsController {
@FXML @FXML
private void handleAddPrefixButtonPress() { private void handleAddPrefixButtonPress() {
try { try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("AddPrefixView.fxml")); FXMLLoader loader = new FXMLLoader(getClass().getResource("/AddPrefixView.fxml"));
Parent root = loader.load(); Parent root = loader.load();
AddPrefixController controller = loader.getController(); AddPrefixController controller = loader.getController();
@ -366,6 +370,7 @@ public class StationSettingsController {
Stage stage = new Stage(); Stage stage = new Stage();
stage.setTitle("New prefix"); stage.setTitle("New prefix");
stage.getIcons().add(new Image(getClass().getResourceAsStream("/icon.png")));
stage.setScene(new Scene(root)); stage.setScene(new Scene(root));
stage.initModality(Modality.APPLICATION_MODAL); stage.initModality(Modality.APPLICATION_MODAL);
stage.showAndWait(); stage.showAndWait();
@ -431,7 +436,6 @@ public class StationSettingsController {
settings.setPassword(password.get()); settings.setPassword(password.get());
settings.getPrefixes().clear(); settings.getPrefixes().clear();
settings.getPrefixes().addAll(prefixListView.getItems()); settings.getPrefixes().addAll(prefixListView.getItems());
settings.setScheduleStartDate(scheduleStartDatePicker.getValue());
settings.setUsername(username.get()); settings.setUsername(username.get());
try { try {
@ -445,7 +449,9 @@ public class StationSettingsController {
try { try {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
LocalTime startTime = LocalTime.parse(scheduleStartTimeField.getText(), formatter); LocalTime startTime = LocalTime.parse(scheduleStartTimeField.getText(), formatter);
settings.setScheduleStartTime(startTime); ZonedDateTime scheduleStart = ZonedDateTime.of(scheduleStartDatePicker.getValue(), startTime, ZoneId.systemDefault());
settings.setScheduleStart(scheduleStart.withZoneSameInstant(ZoneOffset.UTC));
} catch (Exception ex) { } catch (Exception ex) {
logger.log(Level.SEVERE, "Error parsing schedule start time", ex); logger.log(Level.SEVERE, "Error parsing schedule start time", ex);
} }
@ -454,10 +460,16 @@ public class StationSettingsController {
if (osName.contains("win")) { if (osName.contains("win")) {
WindowsScheduler.registerSchedule(settings); WindowsScheduler.registerSchedule(settings);
} else if (osName.contains("nix") || osName.contains("nux") || osName.contains("aix")) { } else if (osName.contains("nix") || osName.contains("nux") || osName.contains("aix")) {
logger.log(Level.SEVERE, "Unsupported OS " + osName); LinuxScheduler.registerSchedule(settings);
} else { } else {
logger.log(Level.SEVERE, "Unsupported OS " + osName); String message = "Unsupported OS " + osName;
// TODO: Alert logger.log(Level.SEVERE, message);
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle(message);
alert.setHeaderText(null);
alert.setContentText(message);
alert.showAndWait();
} }
Node node = (Node) e.getSource(); Node node = (Node) e.getSource();
@ -521,16 +533,6 @@ public class StationSettingsController {
} }
} }
@FXML
private void handleTestRegisterScheduleButtonPress() {
WindowsScheduler.registerSchedule(settings);
}
@FXML
private void handleTestRunScheduleButtonPress() {
WindowsScheduler.runSchedule(settings);
}
public StringProperty stationAddressProperty() { public StringProperty stationAddressProperty() {
return stationAddress; return stationAddress;
} }
@ -553,11 +555,10 @@ public class StationSettingsController {
messagePeriod.set(settings.getMessagePeriod()); messagePeriod.set(settings.getMessagePeriod());
username.set(settings.getUsername()); username.set(settings.getUsername());
password.set(settings.getPassword()); password.set(settings.getPassword());
System.out.println(settings.getPrefixes());
prefixListView.getItems().addAll(settings.getPrefixes()); prefixListView.getItems().addAll(settings.getPrefixes());
scheduleStartDate.set(settings.getScheduleStartDate()); scheduleStartDate.set(settings.getScheduleStart().withZoneSameInstant(ZoneId.systemDefault()).toLocalDate());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
LocalTime startTime = settings.getScheduleStartTime(); LocalTime startTime = settings.getScheduleStart().withZoneSameInstant(ZoneId.systemDefault()).toLocalTime();
if (startTime == null) { if (startTime == null) {
startTime = LocalTime.now(); startTime = LocalTime.now();
} }

View File

@ -7,13 +7,18 @@ import java.io.BufferedWriter;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.lang.management.ManagementFactory;
import java.lang.ProcessHandle;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId;
import javafx.util.Pair; import javafx.util.Pair;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
@ -41,7 +46,7 @@ public class WindowsScheduler {
rootElement.setAttribute("xmlns", "http://schemas.microsoft.com/windows/2004/02/mit/task"); rootElement.setAttribute("xmlns", "http://schemas.microsoft.com/windows/2004/02/mit/task");
doc.appendChild(rootElement); doc.appendChild(rootElement);
LocalDateTime scheduleDateTime = station.getScheduleStartDate().atTime(station.getScheduleStartTime()); LocalDateTime scheduleDateTime = station.getScheduleStart().withZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime();
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"); DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
// RegistrationInfo element // RegistrationInfo element
@ -104,7 +109,8 @@ public class WindowsScheduler {
Element daysOfMonth = doc.createElement("DaysOfMonth"); Element daysOfMonth = doc.createElement("DaysOfMonth");
scheduleByMonth.appendChild(daysOfMonth); scheduleByMonth.appendChild(daysOfMonth);
Element day = doc.createElement("Day"); Element day = doc.createElement("Day");
day.appendChild(doc.createTextNode(String.valueOf(station.getScheduleStartDate().getDayOfMonth()))); LocalDate startDate = station.getScheduleStart().withZoneSameInstant(ZoneId.systemDefault()).toLocalDate();
day.appendChild(doc.createTextNode(String.valueOf(startDate.getDayOfMonth())));
daysOfMonth.appendChild(day); daysOfMonth.appendChild(day);
Element months = doc.createElement("Months"); Element months = doc.createElement("Months");
@ -215,13 +221,18 @@ public class WindowsScheduler {
Element exec = doc.createElement("Exec"); Element exec = doc.createElement("Exec");
actions.appendChild(exec); actions.appendChild(exec);
String processName = ManagementFactory.getRuntimeMXBean().getName();
long pid = Long.parseLong(processName.split("@")[0]);
ProcessHandle currentProcess = ProcessHandle.of(pid).orElseThrow();
Path executablePath = currentProcess.info().command().map(Paths::get).orElseThrow();
logger.info("Executable Path: " + executablePath);
Element command = doc.createElement("Command"); Element command = doc.createElement("Command");
// TODO: need to figure out the real invocation command.appendChild(doc.createTextNode(executablePath.toString()));
command.appendChild(doc.createTextNode("powershell"));
exec.appendChild(command); exec.appendChild(command);
Element arguments = doc.createElement("Arguments"); Element arguments = doc.createElement("Arguments");
arguments.appendChild(doc.createTextNode("-Version 5 -NoProfile -File P:/personal_root/projects/numbers-station/run.ps1 --station \"" + station.getName() + "\"")); arguments.appendChild(doc.createTextNode("--station \"" + station.getName() + "\""));
exec.appendChild(arguments); exec.appendChild(arguments);
return doc; return doc;
@ -426,6 +437,7 @@ public class WindowsScheduler {
/** /**
* @return (stdout contents, stderr contents) * @return (stdout contents, stderr contents)
* Note that caller should check that process has exited
*/ */
public static Pair<String, String> captureProcessOutput(Process process) throws IOException { public static Pair<String, String> captureProcessOutput(Process process) throws IOException {
StringBuilder output = new StringBuilder(); StringBuilder output = new StringBuilder();
@ -435,10 +447,10 @@ public class WindowsScheduler {
BufferedReader errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) { BufferedReader errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
String line; String line;
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
output.append(line); output.append(line + "\n");
} }
while ((line = errorReader.readLine()) != null) { while ((line = errorReader.readLine()) != null) {
error.append(line); error.append(line + "\n");
} }
} }

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="209.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="name.nathanmcrae.numbersstation.AboutController">
<children>
<Label layoutX="19.0" layoutY="10.0" text="Application Information">
<font>
<Font size="18.0" />
</font>
</Label>
<Label layoutX="20.0" layoutY="50.0" text="Homepage:" AnchorPane.leftAnchor="20.0" AnchorPane.topAnchor="50.0" />
<TextField fx:id="homepageURLTextField" accessibleText="Homepage URL field" editable="false" layoutX="89.0" layoutY="46.0" prefHeight="25.0" prefWidth="501.0" text="asefa" AnchorPane.leftAnchor="89.0" AnchorPane.rightAnchor="10.0" />
<Label layoutX="20.0" layoutY="80.0" text="Version:" AnchorPane.leftAnchor="20.0" AnchorPane.topAnchor="80.0" />
<TextField fx:id="versionTextField" accessibleText="Application version field" editable="false" layoutX="72.0" layoutY="76.0" text="asefa" AnchorPane.leftAnchor="89.0" AnchorPane.rightAnchor="10.0" />
<Label layoutX="20.0" layoutY="110.0" text="Application executable: " AnchorPane.leftAnchor="20.0" AnchorPane.topAnchor="110.0" />
<TextField fx:id="executableTextField" accessibleText="Application executable path field" editable="false" layoutX="153.0" layoutY="106.0" prefHeight="25.0" prefWidth="403.0" text="sflejk" AnchorPane.leftAnchor="153.0" AnchorPane.rightAnchor="10.0" />
<Label layoutX="20.0" layoutY="140.0" text="Config directory: " AnchorPane.leftAnchor="20.0" AnchorPane.topAnchor="140.0" />
<TextField fx:id="directoryTextField" accessibleText="Configuration directory path field" editable="false" layoutX="118.0" layoutY="136.0" prefHeight="25.0" prefWidth="437.0" text="afseijl" AnchorPane.leftAnchor="118.0" AnchorPane.rightAnchor="10.0" />
<Label layoutX="20.0" layoutY="168.0" text="Log file: " AnchorPane.leftAnchor="20.0" AnchorPane.topAnchor="170.0" />
<TextField fx:id="logPathTextField" accessibleText="Log file path field" editable="false" layoutX="70.0" layoutY="166.0" prefHeight="25.0" prefWidth="485.0" text="afseijl" AnchorPane.leftAnchor="70.0" AnchorPane.rightAnchor="10.0" />
</children>
</AnchorPane>

View File

@ -11,13 +11,13 @@
<children> <children>
<AnchorPane prefHeight="200.0" prefWidth="312.0"> <AnchorPane prefHeight="200.0" prefWidth="312.0">
<children> <children>
<Button fx:id="okButton" layoutX="89.0" layoutY="67.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="OK" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="89.0" />
<Button fx:id="cancelButton" layoutX="169.0" layoutY="67.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Cancel" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="9.0" />
<Label layoutX="14.0" layoutY="14.0" text="Enter a message prefix / identifier:"> <Label layoutX="14.0" layoutY="14.0" text="Enter a message prefix / identifier:">
<font> <font>
<Font name="Liberation Sans" size="13.0" /> <Font name="Liberation Sans" size="13.0" />
</font></Label> </font></Label>
<TextField fx:id="prefixField" layoutX="216.0" layoutY="10.0" prefHeight="25.0" prefWidth="86.0" AnchorPane.leftAnchor="216.0" AnchorPane.rightAnchor="10.0" /> <TextField fx:id="prefixField" accessibleText="Prefix field" layoutX="216.0" layoutY="10.0" prefHeight="25.0" prefWidth="86.0" AnchorPane.leftAnchor="216.0" AnchorPane.rightAnchor="10.0" />
<Button fx:id="okButton" layoutX="89.0" layoutY="67.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="OK" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="89.0" />
<Button fx:id="cancelButton" layoutX="169.0" layoutY="67.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Cancel" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="9.0" />
</children> </children>
</AnchorPane> </AnchorPane>
</children> </children>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.web.WebView?>
<WebView fx:id="webView" prefHeight="597.0" prefWidth="652.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="name.nathanmcrae.numbersstation.HelpController" />

View File

@ -55,42 +55,42 @@
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="26.5" vgrow="NEVER" /> <RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="26.5" vgrow="NEVER" />
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="15.0" vgrow="NEVER" />
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="42.0" vgrow="NEVER" /> <RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="42.0" vgrow="NEVER" />
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="13.5" vgrow="NEVER" />
<RowConstraints maxHeight="1.7976931348623157E308" minHeight="10.0" prefHeight="285.0" vgrow="ALWAYS" /> <RowConstraints maxHeight="1.7976931348623157E308" minHeight="10.0" prefHeight="285.0" vgrow="ALWAYS" />
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="37.0" vgrow="NEVER" /> <RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="37.0" vgrow="NEVER" />
</rowConstraints> </rowConstraints>
<children> <children>
<AnchorPane> <AnchorPane>
<children> <children>
<Button layoutX="209.0" layoutY="1.0" mnemonicParsing="false" onAction="#handleSelectStationButtonPress" text="Select Station" /> <Button layoutX="228.0" layoutY="1.0" mnemonicParsing="false" onAction="#handleSelectStationButtonPress" text="Select Station" />
<Label layoutY="5.0" prefHeight="17.0" prefWidth="49.0" text="Station: " /> <Label alignment="CENTER_RIGHT" layoutY="5.0" prefHeight="17.0" prefWidth="60.0" text="Station: " textAlignment="RIGHT" />
<TextField fx:id="stationNameField" editable="false" layoutX="49.0" prefHeight="25.0" prefWidth="153.0" style="-fx-background-color: #EEEEEE; -fx-border-color: #AAAAAA;" text="My Station" /> <TextField id="teststationnamefield" fx:id="stationNameField" accessibleText="Station name field" editable="false" layoutX="68.0" prefHeight="25.0" prefWidth="153.0" style="-fx-background-color: #EEEEEE; -fx-border-color: #AAAAAA;" text="My Station" />
<Button layoutX="602.0" layoutY="1.0" mnemonicParsing="false" text="Help" AnchorPane.rightAnchor="0.0" /> <Button layoutX="602.0" layoutY="1.0" mnemonicParsing="false" onAction="#handleHelpButtonPress" text="Help" AnchorPane.rightAnchor="0.0" />
<Button layoutX="532.0" layoutY="1.0" mnemonicParsing="false" text="Settings" AnchorPane.rightAnchor="49.0" /> <Button layoutX="516.0" layoutY="1.0" mnemonicParsing="false" onAction="#handleAboutButtonPress" text="About" AnchorPane.rightAnchor="52.0" />
</children> </children>
</AnchorPane> </AnchorPane>
<AnchorPane prefHeight="50.0" prefWidth="640.0" GridPane.rowIndex="1"> <AnchorPane prefHeight="50.0" prefWidth="640.0" GridPane.rowIndex="2">
<children> <children>
<Label layoutX="14.0" text="Next message will be sent:" AnchorPane.leftAnchor="10.0" AnchorPane.topAnchor="14.0"> <Label layoutX="10.0" layoutY="7.0" text="Next message will be sent:" AnchorPane.leftAnchor="10.0" AnchorPane.topAnchor="7.0">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label fx:id="lastRetrievedLabel" layoutX="183.0" layoutY="14.0" text="2024-12-25T12:59:47" AnchorPane.leftAnchor="183.0" AnchorPane.topAnchor="14.0"> <Label fx:id="nextSendTimeLabel" layoutX="202.0" layoutY="7.0" text="2024-12-25T12:59:47" AnchorPane.leftAnchor="202.0" AnchorPane.topAnchor="7.0">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Button layoutX="534.0" layoutY="13.0" mnemonicParsing="false" onAction="#handleStationSettingsButtonPress" text="Station Settings" AnchorPane.rightAnchor="6.5" AnchorPane.topAnchor="13.0" /> <Button layoutX="540.5" layoutY="3.0" mnemonicParsing="false" onAction="#handleStationSettingsButtonPress" text="Station Settings" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="3.0" />
</children> </children>
</AnchorPane> </AnchorPane>
<Separator prefWidth="200.0" GridPane.rowIndex="2" /> <Separator prefHeight="10.0" prefWidth="640.0" GridPane.rowIndex="1" />
<SplitPane fx:id="splitPane" dividerPositions="1.0" prefHeight="272.0" prefWidth="640.0" GridPane.rowIndex="3"> <SplitPane fx:id="splitPane" dividerPositions="1.0" prefHeight="272.0" prefWidth="640.0" GridPane.rowIndex="3">
<items> <items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children> <children>
<TextArea fx:id="messageTextArea" prefHeight="270.0" text="0239 0480 2938 0928&#10;3093 2298 3923 8933" wrapText="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <TextArea fx:id="messageTextArea" accessibleText="Next message editor" prefHeight="270.0" text="0239 0480 2938 0928&#10;3093 2298 3923 8933" wrapText="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<font> <font>
<Font name="Liberation Mono" size="30.0" /> <Font name="Liberation Mono" size="30.0" />
</font> </font>

View File

@ -40,18 +40,18 @@
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="250.0" prefWidth="395.0" stylesheets="@css/application.css" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="name.nathanmcrae.numbersstation.NotificationController"> <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="250.0" prefWidth="395.0" stylesheets="@css/application.css" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="name.nathanmcrae.numbersstation.NotificationController">
<children> <children>
<Label fx:id="titleLabel" layoutX="86.0" layoutY="24.0" text="Notification title (this sure is a title)">
<font>
<Font name="Liberation Sans Bold" size="16.0" />
</font>
</Label>
<Button fx:id="dismissButton" layoutX="325.0" layoutY="139.0" mnemonicParsing="false" onAction="#handleDismissButtonPressed" text="Dismiss" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="14.0" />
<Button fx:id="openButton" layoutX="270.0" layoutY="139.0" mnemonicParsing="false" onAction="#handleOpenButtonPressed" text="Open" visible="false" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="79.5" />
<Label fx:id="iconLabel" alignment="CENTER" contentDisplay="CENTER" layoutX="14.0" layoutY="5.0" prefHeight="60.0" prefWidth="65.0" text="⚠" textAlignment="CENTER" textFill="RED"> <Label fx:id="iconLabel" alignment="CENTER" contentDisplay="CENTER" layoutX="14.0" layoutY="5.0" prefHeight="60.0" prefWidth="65.0" text="⚠" textAlignment="CENTER" textFill="RED">
<font> <font>
<Font size="42.0" /> <Font size="42.0" />
</font> </font>
</Label> </Label>
<TextArea fx:id="descriptionTextArea" editable="false" layoutX="14.0" layoutY="67.0" prefHeight="62.0" prefWidth="367.0" style="-fx-background-color: EEEEEE;" text="Quidem repellendus perferendis quos ipsum. Nihil nobis esse aperiam. Modi optio quia repudiandae quaerat fugit accusamus. Qui sint qui cupiditate rerum quisquam aspernatur illum. Deleniti voluptatum nam alias fugiat.Ab in iste dolores. Ad nostrum quia quisquam deleniti dolorum sequi. Est ut id et enim.Repellat nemo velit modi sunt provident neque neque. Est consequatur est beatae voluptates tempore commodi voluptas. Dicta asperiores deserunt veritatis quia officia. Reiciendis et qui placeat est minus." wrapText="true" AnchorPane.bottomAnchor="49.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="67.0" /> <Label fx:id="titleLabel" layoutX="86.0" layoutY="24.0" text="Notification title (this sure is a title)">
<font>
<Font name="Liberation Sans Bold" size="16.0" />
</font>
</Label>
<TextArea fx:id="descriptionTextArea" accessibleText="Notification text field" editable="false" layoutX="14.0" layoutY="67.0" prefHeight="62.0" prefWidth="367.0" style="-fx-background-color: EEEEEE;" text="Quidem repellendus perferendis quos ipsum. Nihil nobis esse aperiam. Modi optio quia repudiandae quaerat fugit accusamus. Qui sint qui cupiditate rerum quisquam aspernatur illum. Deleniti voluptatum nam alias fugiat.Ab in iste dolores. Ad nostrum quia quisquam deleniti dolorum sequi. Est ut id et enim.Repellat nemo velit modi sunt provident neque neque. Est consequatur est beatae voluptates tempore commodi voluptas. Dicta asperiores deserunt veritatis quia officia. Reiciendis et qui placeat est minus." wrapText="true" AnchorPane.bottomAnchor="49.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="67.0" />
<Button fx:id="openButton" layoutX="270.0" layoutY="139.0" mnemonicParsing="false" onAction="#handleOpenButtonPressed" text="Open" visible="false" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="79.5" />
<Button fx:id="dismissButton" layoutX="325.0" layoutY="139.0" mnemonicParsing="false" onAction="#handleDismissButtonPressed" text="Dismiss" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="14.0" />
</children> </children>
</AnchorPane> </AnchorPane>

View File

@ -13,10 +13,10 @@
<Font size="20.0" /> <Font size="20.0" />
</font> </font>
</Label> </Label>
<Button layoutX="358.0" layoutY="17.0" mnemonicParsing="false" onAction="#handleAddButtonPress" prefHeight="25.0" prefWidth="26.0" text="+" AnchorPane.rightAnchor="55.0" AnchorPane.topAnchor="17.0" /> <Button accessibleText="Add new station button" layoutX="358.0" layoutY="17.0" mnemonicParsing="false" onAction="#handleAddButtonPress" prefHeight="25.0" prefWidth="26.0" text="+" AnchorPane.rightAnchor="55.0" AnchorPane.topAnchor="17.0" />
<Button layoutX="391.0" layoutY="17.0" mnemonicParsing="false" onAction="#handleRemoveButtonPress" prefHeight="25.0" prefWidth="25.0" text="-" AnchorPane.rightAnchor="21.0" AnchorPane.topAnchor="17.0" /> <Button accessibleText="Remove selected station button" layoutX="391.0" layoutY="17.0" mnemonicParsing="false" onAction="#handleRemoveButtonPress" prefHeight="25.0" prefWidth="25.0" text="-" AnchorPane.rightAnchor="21.0" AnchorPane.topAnchor="17.0" />
<ListView fx:id="stationListView" layoutX="14.0" layoutY="57.0" prefHeight="301.0" prefWidth="409.0" AnchorPane.bottomAnchor="42.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="57.0" /> <ListView fx:id="stationListView" accessibleText="Station selection list" layoutX="14.0" layoutY="57.0" prefHeight="301.0" prefWidth="409.0" AnchorPane.bottomAnchor="42.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="57.0" />
<Button layoutX="313.0" layoutY="365.0" mnemonicParsing="false" onAction="#handleSelectButtonPress" text="Select" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="76.5" /> <Button layoutX="293.0" layoutY="366.0" mnemonicParsing="false" onAction="#handleSelectButtonPress" text="Select" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="85.0" />
<Button layoutX="370.0" layoutY="365.0" mnemonicParsing="false" onAction="#handleCancelButtonPress" text="Cancel" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="15.5" /> <Button layoutX="370.0" layoutY="365.0" mnemonicParsing="false" onAction="#handleCancelButtonPress" text="Cancel" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="15.5" />
</children> </children>
</AnchorPane> </AnchorPane>

View File

@ -26,8 +26,8 @@
<children> <children>
<FlowPane alignment="CENTER_LEFT" prefHeight="41.0" prefWidth="640.0"> <FlowPane alignment="CENTER_LEFT" prefHeight="41.0" prefWidth="640.0">
<children> <children>
<Label prefHeight="17.0" prefWidth="49.0" text="Station: " /> <Label alignment="CENTER_RIGHT" prefHeight="17.0" prefWidth="58.0" text="Station: " />
<TextField fx:id="stationNameField" style="-fx-border-color: #AAAAAA;" text="My Station"> <TextField fx:id="stationNameField" accessibleText="Station name field" style="-fx-border-color: #AAAAAA;" text="My Station">
<FlowPane.margin> <FlowPane.margin>
<Insets right="10.0" /> <Insets right="10.0" />
</FlowPane.margin> </FlowPane.margin>
@ -40,24 +40,24 @@
<Separator prefWidth="200.0" /> <Separator prefWidth="200.0" />
<AnchorPane prefHeight="77.0" prefWidth="578.0"> <AnchorPane prefHeight="77.0" prefWidth="578.0">
<children> <children>
<FlowPane alignment="CENTER_LEFT" layoutX="8.0" layoutY="7.0" prefHeight="63.0" prefWidth="216.0"> <FlowPane alignment="CENTER_LEFT" layoutX="8.0" layoutY="7.0" prefHeight="63.0" prefWidth="229.0">
<children> <children>
<Label prefHeight="38.0" prefWidth="103.0" text="Digit group size: (only for display)" textAlignment="RIGHT" textOverrun="CLIP" wrapText="true"> <Label prefHeight="38.0" prefWidth="116.0" text="Digit group size: (only for display)" textAlignment="RIGHT" textOverrun="CLIP" wrapText="true">
<FlowPane.margin> <FlowPane.margin>
<Insets right="10.0" /> <Insets right="10.0" />
</FlowPane.margin> </FlowPane.margin>
</Label> </Label>
<Spinner fx:id="digitsPerGroupSpinner" editable="true" prefHeight="25.0" prefWidth="96.0" /> <Spinner fx:id="digitsPerGroupSpinner" accessibleText="Digit group size field" editable="true" prefHeight="25.0" prefWidth="96.0" />
</children> </children>
</FlowPane> </FlowPane>
<FlowPane alignment="CENTER_LEFT" layoutX="233.0" layoutY="7.0" prefHeight="63.0" prefWidth="216.0"> <FlowPane alignment="CENTER_LEFT" layoutX="244.0" layoutY="7.0" prefHeight="63.0" prefWidth="216.0">
<children> <children>
<Label prefHeight="38.0" prefWidth="109.0" text="Message length:" textAlignment="RIGHT" textOverrun="CLIP"> <Label alignment="CENTER_RIGHT" prefHeight="38.0" prefWidth="109.0" text="Message length:" textAlignment="RIGHT" textOverrun="CLIP">
<FlowPane.margin> <FlowPane.margin>
<Insets right="10.0" /> <Insets right="10.0" />
</FlowPane.margin> </FlowPane.margin>
</Label> </Label>
<Spinner fx:id="messageLengthSpinner" editable="true" prefHeight="25.0" prefWidth="96.0" /> <Spinner fx:id="messageLengthSpinner" accessibleText="Message length field" editable="true" prefHeight="25.0" prefWidth="96.0" />
</children> </children>
</FlowPane> </FlowPane>
</children> </children>
@ -70,8 +70,8 @@
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="170.0" layoutY="39.0" text="Numbers station address:" /> <Label fx:id="connectionTestStatusLabel" accessibleText="Test connection result" alignment="CENTER_RIGHT" layoutX="136.0" layoutY="11.0" prefHeight="17.0" prefWidth="317.0" textAlignment="RIGHT" AnchorPane.leftAnchor="136.0" AnchorPane.rightAnchor="125.0" />
<TextField fx:id="stationAddressField" layoutX="188.0" layoutY="63.0" prefHeight="25.0" prefWidth="390.0" AnchorPane.leftAnchor="188.0" AnchorPane.rightAnchor="0.0" /> <Button fx:id="testConnectionButton" layoutX="464.0" layoutY="7.0" mnemonicParsing="false" onAction="#handleTestConnectionButtonPress" text="Test connection" AnchorPane.rightAnchor="0.0" />
<RadioButton fx:id="sftpRadioButton" layoutX="16.0" layoutY="42.0" mnemonicParsing="false" text="SFTP"> <RadioButton fx:id="sftpRadioButton" layoutX="16.0" layoutY="42.0" mnemonicParsing="false" text="SFTP">
<toggleGroup> <toggleGroup>
<ToggleGroup fx:id="messageMethodGroup" /> <ToggleGroup fx:id="messageMethodGroup" />
@ -87,13 +87,13 @@
<fx:reference source="messageMethodGroup" /> <fx:reference source="messageMethodGroup" />
</toggleGroup> </toggleGroup>
</RadioButton> </RadioButton>
<Label layoutX="170.0" layoutY="39.0" text="Numbers station address:" />
<TextField fx:id="stationAddressField" accessibleText="Number station address field" layoutX="189.0" layoutY="63.0" prefHeight="25.0" prefWidth="390.0" AnchorPane.leftAnchor="189.0" AnchorPane.rightAnchor="-1.0" />
<Label layoutX="182.0" layoutY="99.0" text="Username:" AnchorPane.rightAnchor="340.0" /> <Label layoutX="182.0" layoutY="99.0" text="Username:" AnchorPane.rightAnchor="340.0" />
<TextField fx:id="usernameField" accessibleText="Numbers station username field" layoutX="245.0" layoutY="95.0" prefHeight="25.0" prefWidth="124.0" AnchorPane.rightAnchor="209.0" />
<Label layoutX="380.0" layoutY="99.0" text="Password:" AnchorPane.rightAnchor="142.0" /> <Label layoutX="380.0" layoutY="99.0" text="Password:" AnchorPane.rightAnchor="142.0" />
<TextField fx:id="usernameField" layoutX="245.0" layoutY="95.0" prefHeight="25.0" prefWidth="124.0" AnchorPane.rightAnchor="209.0" /> <PasswordField fx:id="passwordField" accessibleText="Numbers station password field" layoutX="444.0" layoutY="95.0" prefHeight="25.0" prefWidth="135.0" AnchorPane.rightAnchor="0.0" />
<PasswordField fx:id="passwordField" layoutX="444.0" layoutY="95.0" prefHeight="25.0" prefWidth="135.0" AnchorPane.rightAnchor="0.0" /> <TextField fx:id="externalProgramCommandField" accessibleText="Numbers station external program field" layoutX="-2.0" layoutY="131.0" prefHeight="25.0" prefWidth="580.0" AnchorPane.leftAnchor="-2.0" AnchorPane.rightAnchor="0.0" />
<TextField fx:id="externalProgramCommandField" layoutX="-2.0" layoutY="131.0" prefHeight="25.0" prefWidth="580.0" AnchorPane.leftAnchor="-2.0" AnchorPane.rightAnchor="0.0" />
<Button fx:id="testConnectionButton" layoutX="464.0" layoutY="7.0" mnemonicParsing="false" onAction="#handleTestConnectionButtonPress" text="Test connection" />
<Label fx:id="connectionTestStatusLabel" alignment="CENTER_RIGHT" layoutX="136.0" layoutY="11.0" prefHeight="17.0" prefWidth="317.0" textAlignment="RIGHT" AnchorPane.leftAnchor="136.0" AnchorPane.rightAnchor="125.0" />
</children> </children>
<VBox.margin> <VBox.margin>
@ -108,14 +108,14 @@
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Button layoutX="520.5" layoutY="4.0" mnemonicParsing="false" onAction="#handleAddPrefixButtonPress" text="+" AnchorPane.rightAnchor="33.0" /> <Button accessibleText="Add prefix field" layoutX="520.5" layoutY="4.0" mnemonicParsing="false" onAction="#handleAddPrefixButtonPress" text="+" AnchorPane.rightAnchor="33.0" />
<Button layoutX="552.0" layoutY="4.0" mnemonicParsing="false" onAction="#handleRemovePrefixButtonPress" prefHeight="25.0" prefWidth="25.0" text="-" AnchorPane.rightAnchor="1.0" /> <Button accessibleText="Remove selected prefix button" layoutX="552.0" layoutY="4.0" mnemonicParsing="false" onAction="#handleRemovePrefixButtonPress" prefHeight="25.0" prefWidth="25.0" text="-" AnchorPane.rightAnchor="1.0" />
</children> </children>
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets bottom="10.0" />
</VBox.margin> </VBox.margin>
</AnchorPane> </AnchorPane>
<ListView fx:id="prefixListView" prefHeight="103.0" prefWidth="578.0" /> <ListView fx:id="prefixListView" accessibleText="Prefix list" prefHeight="103.0" prefWidth="578.0" />
<Separator prefWidth="200.0"> <Separator prefWidth="200.0">
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" top="10.0" /> <Insets bottom="10.0" top="10.0" />
@ -144,12 +144,9 @@
<fx:reference source="messagePeriodGroup" /> <fx:reference source="messagePeriodGroup" />
</toggleGroup> </toggleGroup>
</RadioButton> </RadioButton>
<DatePicker fx:id="scheduleStartDatePicker" disable="${manageScheduleExternallyCheckBox.selected}" layoutX="115.0" layoutY="34.0" />
<Label layoutX="115.0" layoutY="8.0" text="Starting from:" /> <Label layoutX="115.0" layoutY="8.0" text="Starting from:" />
<TextField fx:id="scheduleStartTimeField" disable="${manageScheduleExternallyCheckBox.selected}" layoutX="115.0" layoutY="64.0" text="23:24:49" /> <DatePicker fx:id="scheduleStartDatePicker" accessibleText="Message schedule start date" disable="${manageScheduleExternallyCheckBox.selected}" layoutX="115.0" layoutY="34.0" />
<Label layoutX="48.0" layoutY="102.0" text="TODO: Jitter" /> <TextField fx:id="scheduleStartTimeField" accessibleText="Message schedule start time" disable="${manageScheduleExternallyCheckBox.selected}" layoutX="115.0" layoutY="64.0" text="23:24:49" />
<Button layoutX="377.0" layoutY="73.0" mnemonicParsing="false" onAction="#handleTestRegisterScheduleButtonPress" text="Test register scheduled task" />
<Button layoutX="377.0" layoutY="107.0" mnemonicParsing="false" onAction="#handleTestRunScheduleButtonPress" text="Test running scheduled task" />
</children> </children>
</AnchorPane> </AnchorPane>

View File

@ -0,0 +1,231 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Numbers Station Help</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Numbers Station Help</h1>
<p>
The Numbers Station application is a tool to upload messages to a website/blog on a regular schedule. For why you would want this, see <a href="#motivation">Motivation</a>. To get started, see <a href="#quick-start">Quick Start</a>.
</p>
<img src="overview.png"/>
<h2 class="caution">Caution</h2>
<p>
This application assumes you will be using your own encryption scheme where the encrypted messages are made up of digits 0-9. Typically these will be one-time pad messages such as described <a href="https://nathanmcrae.name/blog/practical-one-time-pad.html">here</a>. This application performs no encryption of it's own and should not be trusted with unencrypted messages.
</p>
<h2>Quick Start</h2>
<p>
Before you start, you'll need to have a method of encrypting messages. Unencrypted messages should never be entered into the application. For a method to securely encrypt messages, see <a href="https://nathanmcrae.name/blog/practical-one-time-pad.html">here</a>.
</p>
<p>
For the sake of example, this will walk you through setting up a wordpress blog and creating a numbers station which will periodically post to it. There are also other options for uploading posts.
</p>
<h3>Start a Wordpress.com Blog</h3>
<p>
Wordpress is free blogging software, and one of the most popular at that. Many web hosts provide wordpress blogs for free and Wordpress.com is just one of those hosts, but that's the one we're going to use for this example since it's fairly straightforward.
</p>
<ol>
<li>
Go to <a href="https://wordpress.com/start/free">wordpress.com</a>
</li>
<li>
Create an account using whatever method you prefer
<ul>
<li>It will prompt you to search for a domain to rent, but you don't need one. To skip that, start a domain search and at the bottom select the 'Choose my domain later'</li>
</ul>
</li>
<li>
For 'What would you like to create?' at the bottom, press 'Skip to dashboard'
<ul>
<li>You should now have a basic wordpress site</li>
</ul>
</li>
<li>
You will need a password in order to allow the Numbers Station application to post for you. Go you your Wordpress.com account settings and under Security, set a password.
<ul>
<li>You may need to verify you email in order to post</li>
</ul>
</li>
</ol>
<h3>Set up a Numbers Station</h3>
<img src="station-settings.png"/>
<p>
Now that you have a blog to post to, you will need to set up your numbers station settings.
</p>
<ol>
<li>
<a href="https://git.nathanmcrae.name/nathanmcrae/numbers-station">Download</a>, install, and run the Numbers Station application
</li>
<li>
Select or create your desired station in the 'Select Station' dialog
</li>
<li>Open 'Station Settings'</li>
<li>Set connection information
<ol>
<li>
Choose the 'Wordpress option'
</li>
<li>
Enter your blog address (which can be found by selecting 'Visit Site' from the Wordpress.com dashboard) ending with <code>/xmlrpc.php</code>
<ul>
<li>So if your Wordpress.com site is <code>example.wordpress.com</code>, then the address to enter would be <code>https://example.wordpress.com/xmlrpc.php</code></li>
<li>Note that other wordpress instances may need XML-RPC to be enabled for this to work. Please see documentation for your instance.</li>
</ul>
</li>
<li>
Enter your Wordpress.com username (your email address if you registered with email) and password
<p class="caution">Your password is stored in your user files. Anyone with access to your user files would also be able to post to the blog</p>
</li>
<li>
Press the 'Test connection' button
</li>
</ol>
</li>
<li>
Set schedule
<ul>
<li>Your schedule will start at the given date and time, and will publish a message to the station on the given period (daily, weekly, monthly)</li>
</ul>
</li>
<li>
Set other options (See application reference for details)
</li>
</ol>
<h3>
Set a message for delivery
</h3>
<p>
Once you save your station settings, the application should now run on the given schedule and upload messages. Each time it runs it will generate a random message to be sent next time. Whenever you would like to send a real message, all you need to do is replace the stored one with the real message.
</p>
<ol>
<li>
Open the application and select the station you want to send a message via
</li>
<li>
The main window will show the current message which will be sent next. To replace it, simply type in the real message (which should already be encrypted).
</li>
<li>
Press 'Set as next message'
</li>
</ol>
<p>
Now the real message is saved and will be sent at the next appointed time.
</p>
<h2>Motivation</h2>
<p>
Suppose you have secret messages you are sending. Even if you are able to encrypt your messages perfectly, an adversary will still be able to tell <i>when</i> messages are sent which can reveal important information.
</p>
<p>
Suppose you are planning a protest and send many messages in the days leading up to the protest. For someone monitoring your communication, even if they don't know the content of the messages they can guess that you were somehow involved in the protest.
</p>
<p>
The solution to this problem is to send messages regularly. The messages can just be dummies most of the time, but then when you need to send a real message, an adversary won't be able to tell that anything is different.
</p>
<p>
This is the technique used by <a href="https://en.wikipedia.org/wiki/Numbers_station">numbers stations</a>, which are radio stations suspected to be run by governments to send messages to their spies abroad. The reason they are so mysterious is also the reason they are so effective: you have no idea if or when they are sending a real message.
</p>
<p>
--
The main requirement is that the messages which you do send are indistinguishable from random messages because otherwise an adversary could tell the real and fake messages apart.
</p>
<h2>Application Reference</h2>
<h3>Main Window</h3>
<img src="main-window-labelled.png"/>
<p>
The main window shows a label for the current station name (1) and a button to open the station selection window (2). The 'Settings' button (3) opens application settings, while the 'Station Settings' (5) button opens settings specific to the current selected station. The 'Help' button (4) should open this help document.
</p>
<p>
The message display area (6) shows the contents of the message which will be sent at the next scheduled time. This message can be edited, and then saved via (7).
</p>
<h3>Station Selection Window</h3>
<img src="station-selection-window.png"/>
<h3>Station Settings Window</h3>
The station name can be edited as well as group size used to break up messages for display.
Choosing the message length is important. You should aim to use a message length longer than the longest message you will send via the station. Ideally you should never have to adjust the message length after a station has started regular usage.
<h4>Upload Settings</h4>
<p class="caution">
The username an password entered here are stored unencrypted. Anyone with access to your computer account would be able to access the resources accessible via the credentials.
</p>
<p>
Currently two method of upload are supported: SFTP and wordpress.
</p>
<p>
SFTP uploads the file to the specified server as <code>www/message.txt</code>. It also generates an atom feed file and uploads it as <code>www/feed.xml</code> (subsequent runs will add to the feed file instead of overwriting it).
</p>
<p>
Wordpress will upload the message directly to the specified wordpress blog using XML-RPC. XML-RPC should be available on most wordpress installations, though it may need to be enabled.
</p>
<p>
Alternatively you can opt to run an external program to handle the message. The external program/script will recieve the path to message file as an argument. You could use this to run the message through a blog generator such as Pelican (Note that the external program will have to handle uploading the message as well).
</p>
<h4>Prefixes</h4>
<p>
Prefixes provide a way for the randomly generated messages to avoid using valid message identifiers. To do this, simply add message identifiers to the prefix list, dummy messages will subsequently be generated ensuring they don't start with the listed prefixes.
</p>
<p>
For background, one-time pad cypers typically use a message identifier as the first part of the message. This allows the recipient to determine which one-time pad to use for decryption. If a dummy message generated randomly accidentally starts with a valid message identifier, then the recipient might try to decrypt a nonsense message resulting in confusion.
</p>
<p>
The downside of storing the prefixes on the computer is that anyone with access to the computer (e.g. via malware) would be able to tell when a real message was sent (vs. otherwise they might only know <b>that</b> secret messages are likely being sent).
</p>
<p>
The alternative to providing prefixes is to use one-time pads with long enough message identifiers that the odds of a random message colliding with them is negligible.
</p>
<h4>Message Schedule</h4>
<p>
From the given start date and time, each station is run on the specified period. This means that it will upload the stored message according to the upload settings, then a new dummy message will be generated for the next time the station is run.
</p>
<p>
If the "Manage schedule externally" checkbox is ticked, then the Numbers Station application won't schedule the station to run. Instead, an external scheduler (e.g. Windows Task Scheduler, or cron for *nix systems) can be used. The station can be triggered by running <code>{numbers station executable} --station "{station name}"</code>. The application executable path can be found in the about screen.
</p>
</body>
</html>

BIN
src/main/resources/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -0,0 +1,46 @@
.caution {
background-color: #fff3cd;
border-color: #ffeeba;
color: #856404;
border: 1px solid transparent;
border-radius: 4px;
padding: 1rem;
margin: 20px 0;
}
.caution::before {
content: "⚠ ";
Cautio
margin-right: 8px;
}
body {
font-family: system-ui, -apple-system, sans-serif;
line-height: 1.6;
color: #333;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
code {
background-color: #f5f5f5;
border-radius: 4px;
overflow-x: auto;
font-family: monospace;
margin: 20px 0;
}
h1, h2, h3 {
color: #222;
margin-bottom: 1rem;
}
img {
width: 100%;
max-width: 30em;
}
p {
margin-bottom: 1rem;
}