Add addon smb_config

This commit is contained in:
Pascal Vizeli
2017-04-14 01:12:13 +02:00
parent cfec7bd8b7
commit ce6fe52ede
5 changed files with 61 additions and 2 deletions

View File

@@ -8,11 +8,17 @@ Docker addons for HassIO
``` ```
addon_name: addon_name:
README.md
Dockerfile Dockerfile
config.json 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 ## 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 ## 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/).

16
smb_config/Dockerfile Normal file
View File

@@ -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" ]

19
smb_config/config.json Normal file
View File

@@ -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"
},
}

4
smb_config/run.sh Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -e
smbd -F -S -s /etc/smb.conf

14
smb_config/smb.conf Normal file
View File

@@ -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