diff --git a/.gitignore b/.gitignore index 3689cc5..380ac06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules *.swp templates/ +*~ diff --git a/.gitignore b/.gitignore index 3689cc5..380ac06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules *.swp templates/ +*~ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..27c6bf0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:latest + +RUN mkdir -p /opt/wizarr-notify/templates +WORKDIR /opt/wizarr-notify + +EXPOSE 80 +VOLUME /opt/wizarr-notify/templates + +CMD node index.js + +COPY index.js default_templates package.json package-lock.json ./ +RUN npm i diff --git a/.gitignore b/.gitignore index 3689cc5..380ac06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules *.swp templates/ +*~ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..27c6bf0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:latest + +RUN mkdir -p /opt/wizarr-notify/templates +WORKDIR /opt/wizarr-notify + +EXPOSE 80 +VOLUME /opt/wizarr-notify/templates + +CMD node index.js + +COPY index.js default_templates package.json package-lock.json ./ +RUN npm i diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..817d24c --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker build -t wizarr-notify . \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3689cc5..380ac06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules *.swp templates/ +*~ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..27c6bf0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:latest + +RUN mkdir -p /opt/wizarr-notify/templates +WORKDIR /opt/wizarr-notify + +EXPOSE 80 +VOLUME /opt/wizarr-notify/templates + +CMD node index.js + +COPY index.js default_templates package.json package-lock.json ./ +RUN npm i diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..817d24c --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker build -t wizarr-notify . \ No newline at end of file diff --git a/index.js b/index.js index ad9ac94..b3064d8 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,7 @@ const notify_templates = new Map(); const templatesStat = fs.statSync("templates", {throwIfNoEntry: false}); -if (!templatesStat) +if (!templatesStat || fs.readdirSync("templates").length == 0) { fs.mkdirSync("templates"); for (let filename of fs.readdirSync("default_templates", {encoding:'utf8'})) @@ -77,4 +77,4 @@ app.use((req, res) => res.status(404).end()); -app.listen(80); \ No newline at end of file +app.listen(80); diff --git a/.gitignore b/.gitignore index 3689cc5..380ac06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules *.swp templates/ +*~ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..27c6bf0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:latest + +RUN mkdir -p /opt/wizarr-notify/templates +WORKDIR /opt/wizarr-notify + +EXPOSE 80 +VOLUME /opt/wizarr-notify/templates + +CMD node index.js + +COPY index.js default_templates package.json package-lock.json ./ +RUN npm i diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..817d24c --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker build -t wizarr-notify . \ No newline at end of file diff --git a/index.js b/index.js index ad9ac94..b3064d8 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,7 @@ const notify_templates = new Map(); const templatesStat = fs.statSync("templates", {throwIfNoEntry: false}); -if (!templatesStat) +if (!templatesStat || fs.readdirSync("templates").length == 0) { fs.mkdirSync("templates"); for (let filename of fs.readdirSync("default_templates", {encoding:'utf8'})) @@ -77,4 +77,4 @@ app.use((req, res) => res.status(404).end()); -app.listen(80); \ No newline at end of file +app.listen(80); diff --git a/wizarr-notify.png b/wizarr-notify.png new file mode 100644 index 0000000..19ced43 --- /dev/null +++ b/wizarr-notify.png Binary files differ