From ce6fe52edeb11da2c22eeff30a6d55e60e94a73f Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 14 Apr 2017 01:12:13 +0200 Subject: [PATCH] Add addon smb_config --- README.md | 10 ++++++++-- smb_config/Dockerfile | 16 ++++++++++++++++ smb_config/config.json | 19 +++++++++++++++++++ smb_config/run.sh | 4 ++++ smb_config/smb.conf | 14 ++++++++++++++ 5 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 smb_config/Dockerfile create mode 100644 smb_config/config.json create mode 100644 smb_config/run.sh create mode 100644 smb_config/smb.conf diff --git a/README.md b/README.md index e4b1e8d..46196d4 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,17 @@ Docker addons for HassIO ``` addon_name: + README.md Dockerfile config.json + run.sh ``` -Use `FROM %%BASE_IMAGE%%` inside your docker file. We use alpine linux 3.5 for addons. +Use `FROM %%BASE_IMAGE%%` inside your docker file. We use alpine linux 3.5 for addons. It need also a this line: + +```docker +ENV VERSION %%VERSION%% +``` ## Addon config @@ -37,4 +43,4 @@ Use `FROM %%BASE_IMAGE%%` inside your docker file. We use alpine linux 3.5 for a ``` ## Addon need to known -`/data` is a volume with a persistant store. `/data/options.json` have the user config inside. You can use `jq` inside shell script to parse this data. +`/data` is a volume with a persistant store. `/data/options.json` have the user config inside. You can use `jq` inside shell script to parse this data. A other nice tool for write plugin is [Supervisor](http://supervisord.org/). diff --git a/smb_config/Dockerfile b/smb_config/Dockerfile new file mode 100644 index 0000000..2ffe79e --- /dev/null +++ b/smb_config/Dockerfile @@ -0,0 +1,16 @@ +FROM %%BASE_IMAGE%% + +# Add version +ENV VERSION %%VERSION%% +ENV LANG C.UTF-8 + +# Setup base +RUN apk add --no-cache samba-server jq + +# Copy data +COPY run.sh / +COPY smb.conf /etc/ + +RUN chmod 775 /run.sh + +CMD [ "/run.sh" ] diff --git a/smb_config/config.json b/smb_config/config.json new file mode 100644 index 0000000..2f2abdf --- /dev/null +++ b/smb_config/config.json @@ -0,0 +1,19 @@ +{ + "name": "Samba Config", + "verson": "0.1", + "slug": "smb_config", + "description": "Expose config with samba", + "startup": "after", + "boot": "auto", + "ports": { + "445/tcp": 445 + }, + "map_config": true, + "map_ssl": false, + "options": { + "workgroup": "WORKGROUP", + }, + "schema": { + "workgroup": "str" + }, +} diff --git a/smb_config/run.sh b/smb_config/run.sh new file mode 100644 index 0000000..e2adfa8 --- /dev/null +++ b/smb_config/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +smbd -F -S -s /etc/smb.conf diff --git a/smb_config/smb.conf b/smb_config/smb.conf new file mode 100644 index 0000000..a6034c0 --- /dev/null +++ b/smb_config/smb.conf @@ -0,0 +1,14 @@ +[global] + workgroup = WORKGROUP + server string = Samba HomeAssistant config share + + load printers = no + disable spoolss = yes + +[config] + browseable = yes + writeable = yes + path = /config + + public = yes + guest ok = yes