Skip to content

Commit 4c8d4ad

Browse files
authored
Update Dockerfiles. Change log file defaults. (#1210)
2 parents c92ec4e + 7484a54 commit 4c8d4ad

8 files changed

Lines changed: 117 additions & 48 deletions

File tree

examples/notifiarr.conf.example

Lines changed: 84 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
###############################################
22
# Notifiarr Client Example Configuration File #
3-
# Created by Notifiarr v0.4.4 @ 232801T0734 #
3+
# Created by Notifiarr v0.9.3rc1@ 262402T0654 #
44
###############################################
55

66
## This API key must be copied from your notifiarr.com account.
77
api_key = "api-key-from-notifiarr.com"
88

9-
## Setting a UI password enables the human accessible web GUI. Must be at least 9 characters.
9+
## Setting a UI password properly secures the Web UI. Must be at least 9 characters.
1010
## The default username is admin; change it by setting ui_password to "username:password"
1111
## Set to "webauth" to disable the login form and use only proxy authentication. See upstreams, below.
1212
## Your auth proxy must pass the x-webauth-user header if you set this to "webauth".
1313
## You may also set a custom auth header by setting to "webauth:<header>" e.g. "webauth:remote-user"
14-
## Disable auth by setting this to "noauth". Not recommended. Requires "upstreams" being set.
15-
ui_password = ""
14+
## Disable auth by setting this to "noauth". Not recommended and requires "upstreams" being set.
15+
## If you leave this unset the password will be set to the API key defined at the top of this file.
16+
## Changing the password in the Web UI encrypts it, and that is recommended.
17+
ui_password = ''''''
1618

1719
## The ip:port to listen on for incoming HTTP requests. 0.0.0.0 means all/any IP and is recommended!
1820
## You may use "127.0.0.1:5454" to listen only on localhost; good if using a local proxy.
1921
## This is used to receive Plex webhooks and Media Request commands.
2022
##
21-
bind_addr = "0.0.0.0:5454"
23+
bind_addr = '''0.0.0.0:5454'''
2224

2325
## This application can update itself on Windows systems.
2426
## Set this to "daily" to check GitHub every day for updates.
@@ -35,16 +37,20 @@ quiet = false
3537

3638
## Debug prints more data and json payloads. This increases application memory usage.
3739
debug = false
38-
40+
##
3941
## Trace logs function entry/exit with request IDs. Use for debugging request flow.
4042
trace = false
41-
42-
max_body = 0 # maximum body size for debug logs. 0 = no limit.
43+
##
44+
max_body = 102400 # maximum body size for debug logs. 0 = no limit.
4345

4446
## All API paths start with /api. This does not affect incoming /plex webhooks.
4547
## Change it to /somethingelse/api by setting urlbase to "/somethingelse"
4648
##
47-
urlbase = "/"
49+
urlbase = '''/'''
50+
51+
## Disable compression of payloads sent to the website.
52+
##
53+
no_compress = false
4854

4955
## Allowed upstream networks. Networks here are allowed to send two special headers:
5056
## (1) x-forwarded-for (2) x-webauth-user
@@ -68,15 +74,19 @@ urlbase = "/"
6874
#http_log = '~/.notifiarr/notifiarr.http.log'
6975
##
7076
## Set this to the number of megabytes to rotate files.
71-
log_file_mb = 100
77+
log_file_mb = 5
7278
##
7379
## How many files to keep? 0 = all.
74-
log_files = 0
80+
log_files = 10
7581
##
7682
## Unix file mode for new log files. Umask also affects this.
7783
## Missing, blank or 0 uses default of 0600. Permissive is 0644. Ignored by Windows.
7884
file_mode = "0600"
7985

86+
## Disallow the website from triggering (log file) uploads. Sometimes an admin needs to see client
87+
## logs while diagnosing problems. You can disable this ability by setting no_uploads to true.
88+
no_uploads = false
89+
8090
## Web server and website timeout.
8191
##
8292
timeout = "1m"
@@ -96,6 +106,11 @@ serial = false
96106
## Setting this to 0 will take the default of 4. Use 1 to disable retrying.
97107
retries = 4
98108

109+
## The version of the config file. The app uses this to verify the config
110+
## version the front-end updates is not older than the back-end version.
111+
version = 1
112+
113+
99114
##################
100115
# Starr Settings #
101116
##################
@@ -160,6 +175,13 @@ retries = 4
160175
#pass = ""
161176

162177

178+
#[[transmission]]
179+
#name = "" # Set a name to enable checks of your service.
180+
#url = "http://transmission:9091/transmission/rpc"
181+
#user = ""
182+
#pass = ""
183+
184+
163185
#[[nzbget]]
164186
#name = "" # Set a name to enable checks of your service.
165187
#url = "http://nzbget:6789/"
@@ -219,9 +241,9 @@ retries = 4
219241
# SMI Path is found automatically if left blank. Set it to path to nvidia-smi (nvidia-smi.exe on Windows).
220242

221243
[snapshot.nvidia]
222-
disabled = false
223-
smi_path = ''''''
224-
bus_ids = []
244+
disabled = false
245+
smi_path = ''''''
246+
bus_ids = []
225247

226248
##################
227249
# Service Checks #
@@ -235,7 +257,6 @@ bus_ids = []
235257

236258
[services]
237259
disabled = false # Setting this to true disables all service checking routines.
238-
interval = "10m" # How often to send service states to Notifiarr.com. Minimum = 5m.
239260
log_file = '' # Service Check logs go to the app log by default. Change that by setting a services.log file here.
240261

241262
## Uncomment the following section to create a service check on a URL or IP:port.
@@ -276,7 +297,7 @@ bus_ids = []
276297
# pipe = false
277298
# must_exist = false
278299
# log_match = true
279-
300+
# disabled = false
280301

281302

282303
###################
@@ -298,3 +319,50 @@ bus_ids = []
298319
# log = true
299320
# notify = true
300321
# timeout = "10s"
322+
323+
324+
############################
325+
# Endpoint URL Passthrough #
326+
############################
327+
328+
## The Endpoint URL Passthrough feature allows you to configure the client to poll
329+
## any URL and send the response to the Notifiarr website for notification processing.
330+
## @name - Defaults to URL. Name is used in logs and to identify this endpoint remotely.
331+
## @url - Required URL to poll. Query is optional here, can be added in query param.
332+
## @method - defaults to GET. Can use POST, PUT, etc.
333+
## @timeout - How long to wait for the http request to complete. Default is no timeout.
334+
## @template - Helps the website identify which template to parse this data into.
335+
## Setting this to "false" will skip sending the response to the website.
336+
## @body - For POST and PUT this is the body payload that is sent.
337+
## @follow - Follow redirects? Default is false, do not follow 301/302s.
338+
## @frequency - 0: no schedule, 1: minutely, 2: hourly, 3: daily, 4: weekly, 5: monthly
339+
## @interval - How often to schedule when frequency is 3, 4 or 5.
340+
## @days_of_week - List of days. Used when frequency is 4. Allowed values 0-6, 0 = Sunday.
341+
## @days_of_month - List of days. Used when frequency is 5. Allowed values 1-31 and -31 to -1.
342+
## @months - List of months. Currently not used. Allowed values: 1-12, 1 = January.
343+
## @at_times - List of tuples [hours,minutes,seconds] to schedule when frequency is 3, 4 or 5.
344+
## Only seconds are used when frequency is 1, only minutes when frequency is 2.
345+
## @header - Map of header names to values sent with the http request to the URL.
346+
## @query - Map of query names to values appended to the url in the request.
347+
##
348+
## Full Example Follows (remove the leading # hashes to use it):
349+
##
350+
#[[endpoint]]
351+
# name = "My Example"
352+
# url = "http://example.com"
353+
# valid_ssl = true
354+
# method = "GET"
355+
# timeout = "0s"
356+
# template = "pihole"
357+
# body = ''
358+
# follow = false
359+
# frequency = 1
360+
# interval = 1
361+
# days_of_week = [0]
362+
# days_of_month = [1]
363+
# months = [1]
364+
# at_times = [[0,0,0]]
365+
# [endpoint.header]
366+
# x-api-key = ["abc123"]
367+
# [endpoint.query]
368+
# apiKey = ["abc123"]

init/docker/Dockerfile.alpine

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
FROM golang:1.26.0-alpine AS builder
22

3-
# Build speed magic!
4-
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
53
WORKDIR /src
64
COPY main.go go.mod go.sum ./
75

86
# Cache all the needed tools.
97
RUN go mod download \
108
&& go run github.com/swaggo/swag/cmd/swag@latest -v
119

10+
# Install Node.js to build the frontend.
1211
RUN apk add nodejs npm
12+
13+
# Copy the source code.
1314
COPY pkg pkg
1415
COPY frontend frontend
16+
# Build the frontend.
1517
RUN --mount=type=secret,id=FONTAWESOME_PACKAGE_TOKEN,env=FONTAWESOME_PACKAGE_TOKEN \
1618
mkdir -p ./frontend/dist \
1719
&& echo "Fake frontend build." > ./frontend/dist/index.html \
@@ -36,19 +38,20 @@ RUN GOFLAGS="-trimpath -mod=readonly -modcacherw" \
3638
-X \"golift.io/version.Version=${VERSION}\""
3739

3840
FROM alpine
39-
41+
# Copy the binary.
4042
COPY --from=builder /tmp/notifiarr /
41-
# Other tools.
42-
RUN apk add ipmitool smartmontools zfs sysstat && \
43+
# Other tools. (iostat is the wrong version on Alpine.)
44+
RUN apk add ipmitool smartmontools zfs sysstat libncurses6 && \
4345
rm -f /bin/iostat
44-
46+
# Defaults.
4547
ENV TZ=UTC
4648
ENV PATH=/bin:/usr/bin:/sbin:/usr/sbin
4749
ENV USER=root
4850

4951
EXPOSE 5454
5052
ENTRYPOINT [ "/notifiarr" ]
5153

54+
# Label inputs.
5255
ARG TARGETOS
5356
ARG TARGETARCH
5457
ARG BUILD_DATE

init/docker/Dockerfile.cuda

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
FROM golang:1.26.0-bookworm AS builder
22

3-
# Build speed magic!
4-
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
53
WORKDIR /src
64
COPY main.go go.mod go.sum ./
75

86
# Cache all the needed tools.
97
RUN go mod download \
108
&& go run github.com/swaggo/swag/cmd/swag@latest -v
119

10+
# Install Node.js to build the frontend.
11+
ENV DEBIAN_FRONTEND=noninteractive
1212
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash \
1313
&& apt install -y nodejs
1414

15+
# Copy the source code.
1516
COPY pkg pkg
1617
COPY frontend frontend
18+
# Build the frontend.
1719
RUN --mount=type=secret,id=FONTAWESOME_PACKAGE_TOKEN,env=FONTAWESOME_PACKAGE_TOKEN \
1820
mkdir -p ./frontend/dist \
1921
&& echo "Fake frontend build." > ./frontend/dist/index.html \
@@ -43,27 +45,26 @@ RUN GOFLAGS="-trimpath -mod=readonly -modcacherw" \
4345
-X \"golift.io/version.Revision=${ITERATION}\" \
4446
-X \"golift.io/version.Version=${VERSION}\""
4547

46-
FROM nvidia/cuda:13.1.1-base-ubuntu22.04
47-
48+
FROM nvidia/cuda:13.1.1-base-ubuntu24.04
49+
# Copy the binary.
4850
COPY --from=builder /tmp/notifiarr /
4951
# Other tools.
50-
RUN apt update \
51-
&& apt install -y smartmontools ipmitool zfsutils-linux sysstat \
52+
RUN DEBIAN_FRONTEND=noninteractive apt update \
53+
&& apt install -y smartmontools ipmitool zfsutils-linux sysstat libncurses6 \
5254
&& apt clean \
5355
&& rm -rf /var/lib/apt/lists/*
54-
# For megacli.
56+
# For LSI Avago Broadcom MegaCli.
5557
COPY --from=builder /MegaCli* /libstorelibir-2.so.14.07-0 /
56-
RUN mkdir -p /usr/lib/x86_64-linux-gnu && \
57-
ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/x86_64-linux-gnu/libncurses.so.5
58-
58+
# Defaults.
59+
ENV DN_SNAPSHOT_NVIDIA_SMI_PATH=/usr/bin/nvidia-smi
5960
ENV TZ=UTC
6061
ENV PATH=/bin:/usr/bin:/sbin:/usr/sbin
6162
ENV USER=root
62-
ENV DN_SNAPSHOT_NVIDIA_SMI_PATH=/usr/bin/nvidia-smi
6363

6464
EXPOSE 5454
6565
ENTRYPOINT [ "/notifiarr" ]
6666

67+
# Label inputs.
6768
ARG TARGETOS
6869
ARG TARGETARCH
6970
ARG BUILD_DATE

init/docker/Dockerfile.ubuntu

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
FROM golang:1.26.0-trixie AS builder
22

3-
# Build speed magic!
4-
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
53
WORKDIR /src
64
COPY main.go go.mod go.sum ./
75

86
# Cache all the needed tools.
97
RUN go mod download \
108
&& go run github.com/swaggo/swag/cmd/swag@latest -v
119

10+
ENV DEBIAN_FRONTEND=noninteractive
1211
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash \
1312
&& apt install -y nodejs
1413

@@ -44,26 +43,24 @@ RUN GOFLAGS="-trimpath -mod=readonly -modcacherw" \
4443
-X \"golift.io/version.Version=${VERSION}\""
4544

4645
FROM ubuntu:24.04
47-
46+
# Copy the binary.
4847
COPY --from=builder /tmp/notifiarr /
4948
# Other tools.
50-
RUN apt update \
51-
&& apt install -y smartmontools ipmitool zfsutils-linux sysstat \
49+
RUN DEBIAN_FRONTEND=noninteractive apt update \
50+
&& apt install -y smartmontools ipmitool zfsutils-linux sysstat libncurses6 \
5251
&& apt clean \
5352
&& rm -rf /var/lib/apt/lists/*
54-
# For megacli.
53+
# For LSI Avago Broadcom MegaCli.
5554
COPY --from=builder /MegaCli* /libstorelibir-2.so.14.07-0 /
56-
RUN mkdir -p /usr/lib/x86_64-linux-gnu && \
57-
ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/x86_64-linux-gnu/libncurses.so.5
58-
55+
# Defaults.
5956
ENV TZ=UTC
6057
ENV PATH=/bin:/usr/bin:/sbin:/usr/sbin
6158
ENV USER=root
62-
ENV DN_SNAPSHOT_NVIDIA_SMI_PATH=/usr/bin/nvidia-smi
6359

6460
EXPOSE 5454
6561
ENTRYPOINT [ "/notifiarr" ]
6662

63+
# Label inputs.
6764
ARG TARGETOS
6865
ARG TARGETARCH
6966
ARG BUILD_DATE

pkg/configfile/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ func NewConfig() *Config {
7878
AppsConfig: apps.AppsConfig{
7979
BaseConfig: apps.BaseConfig{
8080
URLBase: "/",
81+
MaxBody: mnd.KB100,
8182
},
8283
},
8384
Services: services.Config{},

pkg/configfile/template.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ version = {{.Version}}
566566
disabled = true{{end}}{{end}}
567567
{{end}}{{end}}
568568
569-
570569
###################
571570
# Custom Commands #
572571
###################

pkg/logs/logs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ type Logger struct {
4646
//
4747
//nolint:gochecknoglobals
4848
var (
49-
logFiles = 1
50-
logFileMb = 100
49+
logFiles = 10
50+
logFileMb = 5
5151
customLog = make(map[string]*rotatorr.Logger)
5252
)
5353

pkg/mnd/constants.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ const (
4747
const (
4848
Title = "Notifiarr"
4949
DefaultName = "notifiarr"
50-
DefaultLogFileMb = 100
51-
DefaultLogFiles = 0 // delete none
50+
DefaultLogFileMb = 5
51+
DefaultLogFiles = 10
5252
DefaultEnvPrefix = "DN"
5353
DefaultTimeout = time.Minute
5454
DefaultBindAddr = "0.0.0.0:5454"

0 commit comments

Comments
 (0)