aboutsummaryrefslogtreecommitdiff
path: root/store/works/Crupest.SecretTool/tools
diff options
context:
space:
mode:
Diffstat (limited to 'store/works/Crupest.SecretTool/tools')
-rwxr-xr-xstore/works/Crupest.SecretTool/tools/cru-proxy-edit12
-rwxr-xr-xstore/works/Crupest.SecretTool/tools/cru-proxy-log13
-rw-r--r--store/works/Crupest.SecretTool/tools/crupest-secret-tool.service8
-rw-r--r--store/works/Crupest.SecretTool/tools/crupest-secret-tool.xml49
-rw-r--r--store/works/Crupest.SecretTool/tools/life.crupest.secret-tool.plist18
5 files changed, 100 insertions, 0 deletions
diff --git a/store/works/Crupest.SecretTool/tools/cru-proxy-edit b/store/works/Crupest.SecretTool/tools/cru-proxy-edit
new file mode 100755
index 0000000..51a33e1
--- /dev/null
+++ b/store/works/Crupest.SecretTool/tools/cru-proxy-edit
@@ -0,0 +1,12 @@
+#! /usr/bin/env bash
+
+set -e
+
+p="$HOME/codes/crupest/tools/Crupest.SecretTool/publish/proxy.txt"
+
+if [[ ! -f "$p" ]]; then
+ echo "File $p does not exist!" >&2
+ exit 1
+fi
+
+exec vim "$p"
diff --git a/store/works/Crupest.SecretTool/tools/cru-proxy-log b/store/works/Crupest.SecretTool/tools/cru-proxy-log
new file mode 100755
index 0000000..6ec6ee1
--- /dev/null
+++ b/store/works/Crupest.SecretTool/tools/cru-proxy-log
@@ -0,0 +1,13 @@
+#! /usr/bin/env bash
+
+set -e
+
+if [[ -e /proc ]]; then
+ # I don't believe your system is Linux but there is no /proc.
+ exec journalctl --user -u crupest-secret-tool "$@"
+elif [[ "$(uname)" == "Darwin" ]]; then
+ exec less "$HOME/.local/state/Crupest.SecretTool/log"
+else
+ echo "Not supported on systems other than macOS and Linux now." >&2
+ exit 1
+fi
diff --git a/store/works/Crupest.SecretTool/tools/crupest-secret-tool.service b/store/works/Crupest.SecretTool/tools/crupest-secret-tool.service
new file mode 100644
index 0000000..df6d172
--- /dev/null
+++ b/store/works/Crupest.SecretTool/tools/crupest-secret-tool.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=crupest v2ray service
+
+[Service]
+ExecStart=%h/.local/bin/Crupest.SecretTool
+
+[Install]
+WantedBy=default.target
diff --git a/store/works/Crupest.SecretTool/tools/crupest-secret-tool.xml b/store/works/Crupest.SecretTool/tools/crupest-secret-tool.xml
new file mode 100644
index 0000000..9b85f13
--- /dev/null
+++ b/store/works/Crupest.SecretTool/tools/crupest-secret-tool.xml
@@ -0,0 +1,49 @@
+<!--
+ MIT License
+
+ Copyright (c) 2008-2020 Kohsuke Kawaguchi, Sun Microsystems, Inc., CloudBees,
+ Inc., Oleg Nenashev and other contributors
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+-->
+
+<!--
+ This is a sample configuration of the Windows Service Wrapper.
+ This configuration file should be placed near the WinSW executable, the name should be the same.
+ E.g. for myapp.exe the configuration file name should be myapp.xml
+
+ You can find more information about configuration options here:
+https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md
+-->
+<service>
+ <id>crupest-secret-tool</id>
+ <name>Crupest Secret Tool</name>
+ <description>Crupest Secret Tool (powered by WinSW)</description>
+
+ <!-- Path to the executable, which should be started -->
+ <executable>%BASE%\Crupest.SecretTool.exe</executable>
+
+ <onfailure action="restart" delay="10 sec" />
+ <onfailure action="restart" delay="30 sec" />
+ <onfailure action="restart" delay="50 sec" />
+
+ <workingdirectory>%BASE%</workingdirectory>
+
+ <startmode>Automatic</startmode>
+</service> \ No newline at end of file
diff --git a/store/works/Crupest.SecretTool/tools/life.crupest.secret-tool.plist b/store/works/Crupest.SecretTool/tools/life.crupest.secret-tool.plist
new file mode 100644
index 0000000..bdfe490
--- /dev/null
+++ b/store/works/Crupest.SecretTool/tools/life.crupest.secret-tool.plist
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>life.crupest.secret-tool</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>/Users/crupest/.local/bin/Crupest.SecretTool</string>
+ </array>
+ <key>KeepAlive</key>
+ <true/>
+ <key>StandardOutPath</key>
+ <string>/Users/crupest/.local/state/Crupest.SecretTool/log</string>
+ <key>StandardErrorPath</key>
+ <string>/Users/crupest/.local/state/Crupest.SecretTool/error</string>
+</dict>
+</plist>