Initial commit

This commit is contained in:
Neil McPhail
2018-07-14 02:39:04 +01:00
commit 246c68ea99
7 changed files with 444 additions and 0 deletions

17
snap/hooks/configure vendored Executable file
View File

@ -0,0 +1,17 @@
#! /usr/bin/python3
import os
import configparser
CONFIG_FILE=os.environ['SNAP_DATA'] + '/config'
KEYS=['updateipv4', 'updateipv6', 'domain', 'password', 'ipv4hostname', 'ipv6hostname']
config = configparser.ConfigParser()
config.read(CONFIG_FILE)
for key in KEYS:
value = os.popen('snapctl get ' + key).read()
config.set('User', key, value)
with open(CONFIG_FILE, 'w') as configfile:
config.write(configfile)

8
snap/hooks/install Executable file
View File

@ -0,0 +1,8 @@
#! /bin/bash
set -e
cp $SNAP/default.conf $SNAP_DATA/config
# The config file should not be world readable, but the snap user can't read it
# either if it is chmodded. How to solve this?
#chmod 600 $SNAP_DATA/config

26
snap/snapcraft.yaml Normal file
View File

@ -0,0 +1,26 @@
name: mythicbeastsddns
version: 'git'
summary: Automatically update dynamic dns for your Mythic Beasts hosts
description: |
Mythic Beasts customers can use this snap to automatically update dynamic dns
entries for ipv4 and ipv6 hosts. Configure the domain, password,
ipv4hostname and ipv6hostname using the `snap set` command as detailed at
https://docs.snapcraft.io/reference/snap-command#set . Activate the updater by
setting the updateipv4 and/or updateipv6 keys to "yes".
.
BEWARE - passwords are stored in world-readable plain text. Until I can find a
way around this problem do not use this snap in production.
grade: stable
confinement: strict
architectures: [ all ]
apps:
mythicbeastsddns:
command: ddns_service.sh
daemon: simple
plugs: [ network ]
parts:
scripts:
plugin: dump
source: scripts