Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
cb7e85a
Translated using Weblate (Turkish)
Jan 8, 2016
447f067
Translated using Weblate (French)
Jan 9, 2016
70d85cb
monkeysphere: New module for verifying SSH servers
jvalleroy Dec 22, 2015
6afe350
monkeysphere: Proper domain handling
SunilMohanAdapa Jan 14, 2016
1a17819
letsencrypt: New basic module for SSL certficates
SunilMohanAdapa Jan 8, 2016
429d26d
letsencrypt: Don't fail if live dir does not exist
Jan 9, 2016
a564297
New locale file for Swedish (sv)
SunilMohanAdapa Jan 15, 2016
d3f104c
Translated using Weblate (Norwegian Bokmål)
Calyp Jan 16, 2016
7a06802
Translated using Transifex (Norwegian Bokmål)
SunilMohanAdapa Jan 16, 2016
e58a661
Translated using Weblate (French)
Calyp Jan 15, 2016
fd43cef
Translated using Weblate (Swedish)
Calyp Jan 16, 2016
13f8407
Translated using Weblate (Telugu)
Calyp Jan 16, 2016
b548881
Translated using Weblate (Turkish)
Calyp Jan 15, 2016
f800cd8
get a page up in preparation to display snapper things
cat-git Jan 17, 2016
a0d7b4c
some backups listed on a page, with much spurious code
cat-git Jan 17, 2016
afb00f9
upgrades: Make manual upgrade a background process
SunilMohanAdapa Jan 17, 2016
cda3863
Translated using Weblate (Swedish)
Calyp Jan 20, 2016
a48068f
Ability to localize brand name in templates
SunilMohanAdapa Jan 23, 2016
8ccffcf
Add utility method to lazy format lazy string
SunilMohanAdapa Jan 23, 2016
4602c5b
Use translated brand name in templates
SunilMohanAdapa Jan 23, 2016
572e68d
Make remaining uses of brand name customizable
SunilMohanAdapa Jan 23, 2016
15312fe
Update messages for simplicity/consistency/grammer
Calyp Jan 23, 2016
d32bfa1
Update fake translations
SunilMohanAdapa Jan 23, 2016
f7d3f7c
Update POT file with message changes
SunilMohanAdapa Jan 23, 2016
1260fbb
Translated using Weblate (Swedish)
Calyp Jan 21, 2016
f83f0aa
action utils is not what we need to list backups
cat-git Jan 25, 2016
b7d6c0f
better table layout, more accurate description texts and placeholders…
cat-git Jan 25, 2016
049fd4f
handle the condition where there are no backups
cat-git Jan 25, 2016
863a187
Merge branch 'text-updates'
jvalleroy Jan 26, 2016
b7e44eb
Add repro SIP proxy module.
jvalleroy Jan 9, 2016
5805351
repro: Split firewall service as sip and sips
SunilMohanAdapa Jan 27, 2016
57fd2a2
repro: Minor styling and message changes
SunilMohanAdapa Jan 27, 2016
81b3f95
Create locale zh_CN
SunilMohanAdapa Jan 28, 2016
ad7d6db
users: Add field to set user's SSH key.
jvalleroy Nov 26, 2015
506bff5
users: Multiple SSH keys and better home creation
SunilMohanAdapa Jan 30, 2016
376b5c6
tor: Refactor into separate files for forms/views
jvalleroy Dec 14, 2015
315c7f1
tor: Notify firewall about socks service status
jvalleroy Dec 14, 2015
a3845e2
tor: Add service for bridge relay ports
jvalleroy Dec 16, 2015
0844151
tor: Combine all configuration actions
jvalleroy Dec 17, 2015
a22595a
tor: Avoid unneeded service restarts
jvalleroy Dec 17, 2015
07130b6
tor: Run configuration update as background task
jvalleroy Dec 17, 2015
1e67fcb
tor: After enabling hidden service, wait for info
jvalleroy Dec 17, 2015
e401a5a
tor: Get fresh status after config completes
jvalleroy Dec 17, 2015
65a1985
tor: Minor fixes and styling
SunilMohanAdapa Jan 30, 2016
bb7d912
Update all translations with latest messages
SunilMohanAdapa Jan 31, 2016
aa71221
Translated using Weblate (Swedish)
Calyp Jan 31, 2016
506d34f
Merge remote-tracking branch 'weblate/master'
SunilMohanAdapa Jan 31, 2016
a5584fb
Translated using Weblate (Swedish)
Calyp Jan 31, 2016
2197da5
Merge remote-tracking branch 'weblate/master'
SunilMohanAdapa Jan 31, 2016
a900398
dynamicdns: Fix passing password via stdin
steglicd Nov 28, 2015
ffbe1f0
Translated using Weblate (Chinese (China))
tonghuix Feb 1, 2016
dd65cb7
Translated using Weblate (Swedish)
Calyp Jan 31, 2016
2a030f9
dynamicdns: Fix reading configuration file
SunilMohanAdapa Feb 1, 2016
aa5efd4
dynamicdns: Fix computing update times
SunilMohanAdapa Feb 1, 2016
ea1e9b6
dynamicdns: Fix writing configuration for no NAT
SunilMohanAdapa Feb 1, 2016
51dd1bb
dynamicdns: Fix an invalid syntax
SunilMohanAdapa Feb 1, 2016
83ec574
dynamicdns: Fix starting daemon for no NAT
SunilMohanAdapa Feb 1, 2016
a23a40d
Removed default password warning. Fixes #386.
joelvalleroy Feb 2, 2016
e4c0e86
Translated using Weblate (Chinese (China))
tonghuix Feb 2, 2016
7858845
Translated using Weblate (Turkish)
Feb 2, 2016
0b19327
Translated using Weblate (German)
Feb 5, 2016
12b3abc
Translated using Weblate (Chinese (China))
tonghuix Feb 4, 2016
9646274
New locale file for Russian (ru)
SunilMohanAdapa Feb 6, 2016
7477289
Translated using Weblate (German)
Feb 5, 2016
0177754
Added packagekit to dependency list per issue-369
joelvalleroy Feb 6, 2016
04c0969
Translated using Weblate (Russian)
the29a Feb 6, 2016
73c125f
Remove Plinth.egg-info/ during clean. Fixes #335.
jvalleroy Feb 6, 2016
41db74d
Translated using Transifex (Norwegian Bokmål)
SunilMohanAdapa Feb 7, 2016
1851b15
networks: Fix tests, move settings to a dict
jvalleroy Feb 8, 2016
082c5ee
networks: Minor trimming to tests
SunilMohanAdapa Feb 9, 2016
de802f3
Translated using Weblate (Swedish)
Calyp Feb 7, 2016
3e2c84d
Merge branch 'dynamicdns-nonat'
jvalleroy Feb 11, 2016
7f4c5f7
Make app names as module identifiers
SunilMohanAdapa Feb 11, 2016
1e8cc6f
Cleanup final use of urls.patterns() method
SunilMohanAdapa Feb 11, 2016
20a9748
package: Proper string casting of PackageException
SunilMohanAdapa Feb 12, 2016
716ba5f
package: Expose starting install without thread
SunilMohanAdapa Feb 12, 2016
2bba8b0
models: New model to store module setup versions
SunilMohanAdapa Feb 12, 2016
be6ccab
setup: New module to handle application setup
SunilMohanAdapa Feb 12, 2016
80d9f0d
module_loader: Add setup helper to every module
SunilMohanAdapa Feb 12, 2016
7a4a8fb
views: New view to show setup need and progress
SunilMohanAdapa Feb 12, 2016
8dcafe3
middleware: New middleware to check need for setup
SunilMohanAdapa Feb 12, 2016
2c83604
main: Add command argument to setup essential apps
SunilMohanAdapa Feb 12, 2016
45a1bff
templates: Base template for all applications
SunilMohanAdapa Feb 12, 2016
b112c82
privoxy: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
83a56bb
apps: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
ad8fea5
avahi: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
9d1a940
config: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
0e0b831
datetime: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
68881f7
deluge: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
28a889c
diagnostics: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
1842db4
dynamicdns: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
38bf4d4
firewall: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
cceddf5
ikiwiki: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
cef8f5c
letsencrypt: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
608d19d
monkeysphere: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
1f8ccb6
monkeysphere: Fix error with no host keys
SunilMohanAdapa Feb 12, 2016
41e730d
mumble: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
0568bf2
names: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
335eecc
networks: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
b916d95
openvpn: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
166ff9b
owncloud: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
5e09493
pagekite: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
a33f68f
power: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
528fe47
quassel: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
f78a558
repro: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
c2cb1f3
restore: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
bdfd20d
roundcube: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
4066a2f
shaarli: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
ecad252
system: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
ac55856
tor: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
065d6c4
transmission: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
b5ccada
upgrades: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
bee0260
users: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
30f0876
xmpp: Use new setup mechanism
SunilMohanAdapa Feb 12, 2016
60c4c17
firstboot: Use new setup mechanism
SunilMohanAdapa Feb 13, 2016
1f5fa31
package: Remove old package installation methods
SunilMohanAdapa Feb 12, 2016
55cabda
package: Better error handling
SunilMohanAdapa Feb 13, 2016
e0c06e3
Translated using Weblate (German)
Feb 12, 2016
b788358
Translated using Weblate (Norwegian Bokmål)
Feb 13, 2016
531ec96
owncloud: Add packages for external storage
SunilMohanAdapa Feb 15, 2016
aff5e10
Translated using Weblate (Russian)
the29a Feb 14, 2016
ec687bc
Use docbook2html for html manual.
jvalleroy Feb 15, 2016
6d28e22
fetch latest manual
jvalleroy Feb 15, 2016
2fb25e1
Release 0.8
jvalleroy Feb 15, 2016
9c85184
help: Specify encoding when opening manual file
jvalleroy Feb 16, 2016
ccc7310
monkeysphere: Fix error with no host keys
SunilMohanAdapa Feb 12, 2016
eaa2a20
Release 0.8.1
jvalleroy Feb 16, 2016
16de3e1
travis: Require a specific version of pgi for fix
SunilMohanAdapa Feb 17, 2016
b0b67db
letsencrypt: Force text mode
saghul Feb 19, 2016
cec3ced
letsencrypt: Skip hidden service domains on index
saghul Feb 19, 2016
77134cd
Merge branch 'better-setup'
jvalleroy Feb 20, 2016
992d2ea
help: Use new setup mechanism
jvalleroy Feb 20, 2016
080c891
Be consistent with type of is_essential.
jvalleroy Feb 20, 2016
19d8e2f
Rename locale zh_CN to zh_hans.
jvalleroy Feb 24, 2016
88c649d
Handle _ in language codes.
jvalleroy Feb 24, 2016
d72abb8
config: Don't restrict supported languages
SunilMohanAdapa Feb 25, 2016
7a139b7
Release 0.8.2
jvalleroy Feb 25, 2016
363e071
minetest: New module for minetest server
jvalleroy Feb 7, 2016
6c67a50
minetest: Use new setup mechanism
SunilMohanAdapa Feb 26, 2016
9d85084
radicale: New module for a CalDAV/CardDAV server
jvalleroy Jan 9, 2016
34a6bd0
radicale: Use new setup mechanism
SunilMohanAdapa Feb 26, 2016
7e87f03
radicale: Listen only on internal addresses
SunilMohanAdapa Feb 26, 2016
aba2b03
transmission: Remove unused import
SunilMohanAdapa Feb 26, 2016
4f31ad6
travis: Use trusty and pygobject instead of pgi
SunilMohanAdapa Feb 18, 2016
fa8c2cf
views: Add a common view for enabling applications
SunilMohanAdapa Feb 28, 2016
96ca09d
deluge: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
9422f43
minetest: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
f205612
owncloud: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
5c7eb69
radicale: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
fb19fed
shaarli: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
40a9507
xmpp: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
1f6935c
roundcube: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
1eae781
quassel: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
07df628
restore: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
75d35b3
mumble: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
6a462ce
privoxy: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
ab96bc7
repro: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
73c7d8e
avahi: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
7385beb
transmission: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
d31de69
datetime: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
a0e676c
ikiwiki: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
7118924
upgrades: Use common view for configuration
SunilMohanAdapa Feb 28, 2016
f04e1c1
Minor PEP8 & spelling fixes in various modules
SunilMohanAdapa Feb 28, 2016
2078e20
views: Minor adjustment to module load order
SunilMohanAdapa Feb 28, 2016
49e59ce
Translated using Weblate (Spanish)
Mar 2, 2016
22ca61e
Translated using Weblate (French)
Mar 4, 2016
176f032
Avahi should now display {box_name}. Fixes #414
joelvalleroy Mar 5, 2016
84c752d
Translated using Weblate (French)
Mar 4, 2016
b38859b
Merge branch 'common-view'
jvalleroy Mar 5, 2016
3b7b788
networks: Fix issue when looking up AP details
SunilMohanAdapa Mar 1, 2016
fbbd70a
Remove #! sequence from ikiwiki setup automators.
jvalleroy Mar 5, 2016
18db380
monkeysphere: Consistently use the term OpenPGP
jvalleroy Feb 14, 2016
8c96d38
monkeysphere: Add key detail view
jvalleroy Feb 14, 2016
79edbd6
monkeysphere: Add self-signed certificate section
jvalleroy Feb 17, 2016
cc6f44d
monkeysphere: Clarify arguments for import actions
jvalleroy Feb 17, 2016
5c810ed
monkeysphere: Add Let's Encrypt certificates
jvalleroy Feb 18, 2016
7a7d957
monkeysphere: Untabify, HTML message styling
SunilMohanAdapa Mar 8, 2016
28856d9
monkeysphere: Move more description to module
SunilMohanAdapa Mar 8, 2016
f4601e7
monkeysphere: Reorganize around keys instead
SunilMohanAdapa Mar 8, 2016
cc35fc2
monkeysphere: Remove key ID field from detail view.
jvalleroy Mar 8, 2016
bb15807
Translated using Weblate (Russian)
the29a Mar 7, 2016
2f3deb1
Translated using Weblate (Spanish)
Mar 10, 2016
80bab09
ttrss: New module for Tiny Tiny RSS feed reader
ashokjallepalli Sep 23, 2015
15591b7
ttrss: Update to use ConfigurationView
jvalleroy Mar 10, 2016
47a54fa
ttrss: Add basic configuration
jvalleroy Mar 10, 2016
368e64c
ttrss: Use LDAP authentication
jvalleroy Mar 11, 2016
4c6d572
ttrss: Ensure database used is PostgreSQL
SunilMohanAdapa Mar 12, 2016
529e6ae
Run Plinth setup during FreedomBox setup
SunilMohanAdapa Mar 12, 2016
767e3c4
dynamicdns: Make corrections to source strings.
jvalleroy Mar 12, 2016
9b44972
Merge pull request #427 from jvalleroy/dynamicdns-string-updates
steglicd Mar 13, 2016
29d48a2
Merge remote-tracking branch 'upstream/master'
cat-git Mar 13, 2016
c9b942e
get a page up in preparation to display snapper things
cat-git Jan 17, 2016
4bf5dbe
some backups listed on a page, with much spurious code
cat-git Jan 17, 2016
15fa538
action utils is not what we need to list backups
cat-git Jan 25, 2016
5df78ee
better table layout, more accurate description texts and placeholders…
cat-git Jan 25, 2016
e23c6bd
handle the condition where there are no backups
cat-git Jan 25, 2016
89da484
Merge branch '386-snapper' of https://github.com/cat-git/Plinth into …
cat-git Mar 13, 2016
cba91d9
part of converting to new install mech, nothing works
cat-git Mar 13, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Travis-CI configuration file for Plinth

language: python
python:
- "3.4"
dist: trusty
sudo: required
language: generic

env:
- DJANGO_VERSION=">=1.7.0,<1.8.0"
Expand All @@ -12,13 +12,14 @@ env:
# Debian packages required
before_install:
- sudo apt-get update -qq
- sudo apt-get install augeas-tools gir1.2-packagekitglib-1.0
- sudo apt-get -y install augeas-tools gir1.2-packagekitglib-1.0 python3-dev python3-gi

# Command to install dependencies
install:
- virtualenv --python=python3 --system-site-packages _venv
- source _venv/bin/activate
- pip install Django$DJANGO_VERSION
- pip install coverage==3.7
- pip install "pgi>=0.0.10.1"
- pip install -r requirements.txt

# Command to run tests
Expand Down
1 change: 1 addition & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
libjs-modernizr \
make \
network-manager \
packagekit \
ppp \
pppoe \
python3 \
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ personal servers running free software for private, personal
communications. It is a networking appliance designed to allow
interfacing with the rest of the Internet under conditions of
protected privacy and data security. It hosts applications such as
blog, wiki, website, social network, email, web proxy and a Tor relay
on a device that can replace your Wi-Fi router so that your data stays
with you.
blog, wiki, website, social network, email, web proxy and a Tor relay,
on a device that can replace your Wi-Fi router, so that your data
stays with you.

Plinth is a web interface to administer the functions of the
FreedomBox. It is extensible and provides various applications of
Expand Down
34 changes: 19 additions & 15 deletions actions/dynamicdns
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ doGetOpt()
basicauth=0
ignoreCertError=0

while getopts ":s:d:u:p:I:U:c:b:" opt; do
while getopts ":s:d:u:P:I:U:c:b:p" opt; do
case ${opt} in
s)
if [ "${OPTARG}" != "${EMPTYSTRING}" ];then
Expand All @@ -80,6 +80,9 @@ doGetOpt()
u)
user=${OPTARG}
;;
P)
pass=${OPTARG}
;;
p)
if read -t 0; then
IFS= read -r pass
Expand Down Expand Up @@ -164,11 +167,11 @@ doWriteCFG()
echo "NAT no" >> ${HELPERCFG}
# if this file is added ez-ipupdate will take ip form this interface
{
"interface=${default_interface}"
echo "interface=${default_interface}"
# if this line is added to config file, ez-ipupdate will be launched on startup via init.d
"daemon"
"execute=${0} success"
} > ${out_file}
echo "daemon"
echo "execute=${0} success"
} >> ${out_file}
fi
fi
}
Expand All @@ -186,10 +189,10 @@ doReadCFG()
ipurl=""

if [ ! -z "${cfgfile}" ];then
host=$(grep host "${cfgfile}" 2> /dev/null |cut -d = -f 2)
server=$(grep server "${cfgfile}" 2> /dev/null |cut -d = -f 2 |grep -v ^\'\')
user=$(grep user "${cfgfile}" 2> /dev/null |cut -d = -f 2 |cut -d : -f 1 )
pass=$(grep user "${cfgfile}" 2> /dev/null |cut -d = -f 2 |cut -d : -f 2)
host=$(grep ^host= "${cfgfile}" 2> /dev/null | cut -d = -f 2-)
server=$(grep ^server= "${cfgfile}" 2> /dev/null | cut -d = -f 2- | grep -v ^\'\')
user=$(grep ^user= "${cfgfile}" 2> /dev/null | cut -d = -f 2- | cut -d : -f 1 )
pass=$(grep ^user= "${cfgfile}" 2> /dev/null | cut -d = -f 2- | cut -d : -f 2-)
fi

if [ ! -z ${HELPERCFG} ];then
Expand Down Expand Up @@ -293,7 +296,7 @@ doGetWANIP()
doUpdate()
{
local dnsentry=$(nslookup "${host}"|tail -n2|grep A|sed s/[^0-9.]//g)
if [ "${dnsentry}" = "${wanip}" ];then
if [ "${dnsentry}" = "${wanip}" ];then
return
fi
if [ ! -z "${server}" ];then
Expand Down Expand Up @@ -335,8 +338,8 @@ case ${cmd} in
doGetWANIP
if [ "$(grep ^NAT ${HELPERCFG} | awk '{print $2}')" = "no" ];then
#if we are not behind a NAT device and we use gnudip, start the daemon tool
local gnudipServer=$(grep server ${cfgfile} 2> /dev/null |cut -d = -f 2 |grep -v ^\'\')
if [ -f ${CFG} -a ! -z "${gnudipServer}" ];then
gnudipServer=$(grep ^server= ${cfgfile} 2> /dev/null | cut -d = -f 2- |grep -v ^\'\')
if [ ! -f ${CFG} -a ! -z "${gnudipServer}" ];then
mv ${CFG_disabled} ${CFG}
/etc/init.d/${TOOLNAME} start
fi
Expand Down Expand Up @@ -371,10 +374,10 @@ case ${cmd} in
fi
# if we don't know our WAN IP do a blind update once a hour
if [ "${wanip}" = ${NOIP} ];then
uptime=$(cut -d . -f 1 /proc/uptime)
currenttime=$(date +%s)
LAST=0
[ -f ${LASTUPDATE} ] && LAST=$(cat ${LASTUPDATE})
diff=$((uptime - LAST))
diff=$((currenttime - LAST))
if [ ${diff} -gt ${UPDATEMINUTESUNKNOWN} ];then
doUpdate
fi
Expand All @@ -389,7 +392,7 @@ case ${cmd} in
success)
date=$(date)
echo "last update done (${date})" > ${STATUSFILE}
awk '{print $1}' /proc/uptime |cut -d . -f 1 > ${LASTUPDATE}
date +%s > ${LASTUPDATE}
# if called from cronjob, the current IP is given as parameter
if [ $# -eq 1 ];then
echo "${1}" > ${IPFILE}
Expand Down Expand Up @@ -428,6 +431,7 @@ case ${cmd} in
echo "-s <server> Gnudip Server address"
echo "-d <domain> Domain to be updated"
echo "-u <user> Account username"
echo "-P <password> Account password"
echo "-p Read Account Password from stdin"
echo "-I <IP check URL> A URL which returns the IP of the client who is requesting"
echo "-U <update URL> The update URL (a HTTP GET on this URL will be done)"
Expand Down
188 changes: 188 additions & 0 deletions actions/letsencrypt
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
#!/usr/bin/python3
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

"""
Configuration helper for Let's Encrypt.
"""

import argparse
import json
import os
import subprocess
import sys

from plinth import action_utils

TEST_MODE = False
LIVE_DIRECTORY = '/etc/letsencrypt/live/'
APACHE_PREFIX = '/etc/apache2/sites-available/'
APACHE_CONFIGURATION = '''
<IfModule mod_gnutls.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
ServerName {domain}
DocumentRoot /var/www/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${{APACHE_LOG_DIR}}/error.log
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
LogLevel warn
CustomLog ${{APACHE_LOG_DIR}}/ssl_access.log combined
# GnuTLS Switch: Enable/Disable SSL/TLS for this virtual host.
GnuTLSEnable On
# Automatically obtained certficates from Let's Encrypt
GnuTLSCertificateFile /etc/letsencrypt/live/{domain}/fullchain.pem
GnuTLSKeyFile /etc/letsencrypt/live/{domain}/privkey.pem
# See http://www.outoforder.cc/projects/apache/mod_gnutls/docs/#GnuTLSPriorities
GnuTLSPriorities NORMAL
</VirtualHost>
</IfModule>
'''


def parse_arguments():
"""Return parsed command line arguments as dictionary."""
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')

subparsers.add_parser(
'get-status', help='Return the status of configured domains.')
revoke_parser = subparsers.add_parser(
'revoke', help='Disable and domain and revoke its certificate.')
revoke_parser.add_argument(
'--domain', help='Domain name to revoke certificate for')
obtain_parser = subparsers.add_parser(
'obtain', help='Obtain certficate for a domain and setup website.')
obtain_parser.add_argument(
'--domain', help='Domain name to obtain certificate for')

return parser.parse_args()


def get_certficate_expiry(domain):
"""Return the expiry date of a certificate."""
certificate_file = os.path.join(LIVE_DIRECTORY, domain, 'cert.pem')
output = subprocess.check_output(['openssl', 'x509', '-enddate', '-noout',
'-in', certificate_file])
return output.decode().strip().split('=')[1]


def subcommand_get_status(_):
"""Return a JSON dictionary of currently configured domains."""
try:
domains = os.listdir(LIVE_DIRECTORY)
except OSError:
domains = []

domains = [domain for domain in domains
if os.path.isdir(os.path.join(LIVE_DIRECTORY, domain))]

domain_status = {}
for domain in domains:
domain_status[domain] = {
'certificate_available': True,
'expiry_date': get_certficate_expiry(domain),
'web_enabled':
action_utils.webserver_is_enabled(domain, kind='site')
}

print(json.dumps({'domains': domain_status}))


def subcommand_revoke(arguments):
"""Disable a domain and revoke the certificate."""
domain = arguments.domain

command = ['letsencrypt', 'revoke', '--domain', domain, '--cert-path',
os.path.join(LIVE_DIRECTORY, domain, 'cert.pem')]
if TEST_MODE:
command.append('--staging')

process = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
if process.returncode:
print(stderr.decode(), file=sys.stderr)
sys.exit(1)

action_utils.webserver_disable(domain, kind='site')


def subcommand_obtain(arguments):
"""Obtain a certificate for a domain and setup website."""
domain = arguments.domain

command = [
'letsencrypt', 'certonly', '--text', '--agree-tos',
'--register-unsafely-without-email', '--domain', arguments.domain,
'--authenticator', 'webroot', '--webroot-path', '/var/www/html/',
'--renew-by-default']
if TEST_MODE:
command.append('--staging')

process = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdin, stderr = process.communicate()
if process.returncode:
print(stderr.decode(), file=sys.stderr)
sys.exit(1)

setup_webserver_config(domain)

action_utils.webserver_enable(domain, kind='site')


def setup_webserver_config(domain):
"""Create SSL web server configuration for a domain.

Do so only if there is no configuration existing.
"""
file_name = os.path.join(APACHE_PREFIX, domain + '.conf')
if os.path.isfile(file_name):
return

with open(file_name, 'w') as file_handle:
file_handle.write(APACHE_CONFIGURATION.format(domain=domain))


def main():
"""Parse arguments and perform all duties."""
arguments = parse_arguments()

subcommand = arguments.subcommand.replace('-', '_')
subcommand_method = globals()['subcommand_' + subcommand]
subcommand_method(arguments)


if __name__ == '__main__':
main()
59 changes: 59 additions & 0 deletions actions/minetest
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/python3
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

"""
Configuration helper for Minetest server.
"""

import argparse

from plinth import action_utils


def parse_arguments():
"""Return parsed command line arguments as dictionary."""
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')

subparsers.add_parser('enable', help='Enable Minetest server')
subparsers.add_parser('disable', help='Disable Minetest server')

return parser.parse_args()


def subcommand_enable(_):
"""Enable and start server."""
action_utils.service_enable('minetest-server')


def subcommand_disable(_):
"""Disable and stop server."""
action_utils.service_disable('minetest-server')


def main():
"""Parse arguments and perform all duties."""
arguments = parse_arguments()

subcommand = arguments.subcommand.replace('-', '_')
subcommand_method = globals()['subcommand_' + subcommand]
subcommand_method(arguments)


if __name__ == '__main__':
main()
Loading