diff options
Diffstat (limited to 'net/gotify-server/files')
-rw-r--r-- | net/gotify-server/files/gotify_server.in | 50 | ||||
-rw-r--r-- | net/gotify-server/files/patch-config.example.yml | 36 | ||||
-rw-r--r-- | net/gotify-server/files/patch-config_config.go | 11 | ||||
-rw-r--r-- | net/gotify-server/files/patch-ui_tsconfig.json | 12 |
4 files changed, 109 insertions, 0 deletions
diff --git a/net/gotify-server/files/gotify_server.in b/net/gotify-server/files/gotify_server.in new file mode 100644 index 000000000000..6ee69e44dab3 --- /dev/null +++ b/net/gotify-server/files/gotify_server.in @@ -0,0 +1,50 @@ +#!/bin/sh +# PROVIDE: gotify_server +# REQUIRE: DAEMON NETWORKING +# KEYWORD: shutdown + +# +# Add these lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# gotify_server_enable (bool): Set to NO by default. +# Set it to YES to enable mailpit. +# gotify_server_dir (str): Set to "/var/db/gotify" by default +# Set it to directory to run gotify in +# gotify_server_user (str): Set to "gotify" by default. +# Set it to user to run gotify-server under +# gotify_server_group (str): Set to "gotify" by default. +# Set it to group to run gotify-server under +# gotify_server_args (string): Custom extra arguments for gotify-server + +. /etc/rc.subr + +name="gotify_server" +rcvar="gotify_server_enable" +desc="Run Gotify notification server" + +load_rc_config ${name} + +: ${gotify_server_enable:="NO"} +: ${gotify_server_dir:="/var/db/gotify"} +: ${gotify_server_user:="gotify"} +: ${gotify_server_group:="gotify"} +: ${gotify_server_args:=""} + +export HOME=${gotify_server_dir} +export PATH=${PATH}:%%PREFIX%%/bin + +pidfile="/var/run/${name}.pid" +command="/usr/sbin/daemon" +command_args="-f -P ${pidfile} %%PREFIX%%/bin/gotify-server ${gotify_server_args}" + +start_precmd="gotify_server_precmd" + +gotify_server_precmd() +{ + if [ ! -e "${pidfile}" ]; then + install -g ${gotify_server_group} -o ${gotify_server_user} -- /dev/null "${pidfile}"; + fi +} + +run_rc_command $1 diff --git a/net/gotify-server/files/patch-config.example.yml b/net/gotify-server/files/patch-config.example.yml new file mode 100644 index 000000000000..ccfd46addd3d --- /dev/null +++ b/net/gotify-server/files/patch-config.example.yml @@ -0,0 +1,36 @@ +--- config.example.yml.orig 1979-11-29 22:00:00 UTC ++++ config.example.yml +@@ -4,7 +4,7 @@ server: + server: + keepaliveperiodseconds: 0 # 0 = use Go default (15s); -1 = disable keepalive; set the interval in which keepalive packets will be sent. Only change this value if you know what you are doing. + listenaddr: "" # the address to bind on, leave empty to bind on all addresses. Prefix with "unix:" to create a unix socket. Example: "unix:/tmp/gotify.sock". +- port: 80 # the port the HTTP server will listen on ++ port: 9071 # the port the HTTP server will listen on + + ssl: + enabled: false # if https should be enabled +@@ -16,7 +16,7 @@ server: + letsencrypt: + enabled: false # if the certificate should be requested from letsencrypt + accepttos: false # if you accept the tos from letsencrypt +- cache: data/certs # the directory of the cache from letsencrypt ++ cache: /var/db/gotify/certs # the directory of the cache from letsencrypt + hosts: # the hosts for which letsencrypt should request certificates + # - mydomain.tld + # - myotherdomain.tld +@@ -46,12 +46,12 @@ database: # for database see (configure database secti + + database: # for database see (configure database section) + dialect: sqlite3 +- connection: data/gotify.db ++ connection: /var/db/gotify/gotify.db + + defaultuser: # on database creation, gotify creates an admin user + name: admin # the username of the default user + pass: admin # the password of the default user + passstrength: 10 # the bcrypt password strength (higher = better but also slower) +-uploadedimagesdir: data/images # the directory for storing uploaded images +-pluginsdir: data/plugins # the directory where plugin resides ++uploadedimagesdir: /var/db/gotify/data/images # the directory for storing uploaded images ++pluginsdir: /var/db/gotify/data/plugins # the directory where plugin resides + registration: false # enable registrations diff --git a/net/gotify-server/files/patch-config_config.go b/net/gotify-server/files/patch-config_config.go new file mode 100644 index 000000000000..dce728c6700b --- /dev/null +++ b/net/gotify-server/files/patch-config_config.go @@ -0,0 +1,11 @@ +--- config/config.go.orig 2024-10-11 14:37:05 UTC ++++ config/config.go +@@ -60,7 +60,7 @@ func configFiles() []string { + if mode.Get() == mode.TestDev { + return []string{"config.yml"} + } +- return []string{"config.yml", "/etc/gotify/config.yml"} ++ return []string{"config.yml", "/usr/local/etc/gotify-server/config.yml"} + } + + // Get returns the configuration extracted from env variables or config file. diff --git a/net/gotify-server/files/patch-ui_tsconfig.json b/net/gotify-server/files/patch-ui_tsconfig.json new file mode 100644 index 000000000000..065235c0f35f --- /dev/null +++ b/net/gotify-server/files/patch-ui_tsconfig.json @@ -0,0 +1,12 @@ +--- ui/tsconfig.json.orig 2024-10-11 13:53:39 UTC ++++ ui/tsconfig.json +@@ -38,7 +38,8 @@ + "acceptance-tests", + "webpack", + "jest", +- "src/setupTests.ts" ++ "src/setupTests.ts", ++ "**/test/*.ts" + ], + "include": [ + "src" |