setup: Move app data files into respective apps

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-03-17 16:20:57 -04:00
1 parent fdcbd46513
commit ff247fa5aa
51 files changed

No files matched your search

@@ -1,44 +0,0 @@
#!/bin/bash
#
# This file is part of FreedomBox.
#
# 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/>.
#
set -e # Exit with code on error
IFACE="$1"
ACTION="$2"
if [[ "$CONNECTION_ID" != *"BATMAN"* ]]; then
exit 0
fi
case ${ACTION} in
up)
logger "Setting up B.A.T.M.A.N. Advanced on interface $IFACE"
ip link set mtu 1560 dev ${IFACE}
modprobe batman-adv
echo "bat0" > /sys/class/net/${IFACE}/batman_adv/mesh_iface
ip link set up dev bat0
;;
down)
logger "Clearing B.A.T.M.A.N. Advanced on interface $IFACE"
ip link set down dev bat0
echo "none" > /sys/class/net/${IFACE}/batman_adv/mesh_iface
ip link set mtu 1500 dev ${IFACE}
;;
*)
;;
esac
@@ -1,16 +0,0 @@
##
## On all sites, provide cockpit on the path: /_cockpit/
##
## Requires the following Apache modules to be enabled:
## mod_headers
## mod_proxy
## mod_proxy_http
## mod_proxy_wstunnel
##
<Location /_cockpit/>
ProxyPass http://localhost:9090/_cockpit/
</Location>
<Location /_cockpit/cockpit/socket>
ProxyPass ws://localhost:9090/_cockpit/socket
</Location>
@@ -1,5 +0,0 @@
<Location /coquelicot>
ProxyPass http://127.0.0.1:51161/coquelicot
SetEnv proxy-sendchunks 1
RequestHeader set X-Forwarded-SSL "on"
</Location>
@@ -1,6 +0,0 @@
##
## On all sites, provide Deluge on a default path: /deluge
##
<Location /deluge>
ProxyPass http://localhost:8112
</Location>
@@ -1,15 +0,0 @@
Alias /ikiwiki /var/www/ikiwiki
Alias /ikiwiki-auth /var/www/ikiwiki
AddHandler cgi-script .cgi
<Location /ikiwiki>
Options +ExecCGI
</Location>
<Location /ikiwiki-auth>
Options +ExecCGI
Include includes/freedombox-auth-ldap.conf
Require ldap-group cn=admin,ou=groups,dc=thisbox
Require ldap-group cn=wiki,ou=groups,dc=thisbox
</Location>
@@ -1,6 +0,0 @@
# Proxy for BOSH server
ProxyPass /bosh/ http://localhost:5443/bosh/
ProxyPassReverse /bosh/ http://localhost:5443/bosh/
<Proxy http://localhost:5443/bosh/*>
Require all granted
</Proxy>
@@ -1,8 +0,0 @@
##
## On all sites, provide Matrix Synapse on a default path: /_matrix. This is
## only useful for clients to login without specifying a server port. This is
## not useful for federation which requires SRV record or listening on port
## 8448. Further, federation requires same TLS public key to be provided to
## Apache and Matrix Synapse server.
##
ProxyPass /_matrix http://localhost:8008/_matrix
@@ -1,21 +0,0 @@
<Directory /var/lib/mediawiki/>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/index.php/(.*)$ /$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
</IfModule>
</Directory>
<Directory /var/lib/mediawiki/images>
<IfModule mod_rewrite.c>
RewriteEngine Off
</IfModule>
</Directory>
<Directory /var/lib/mediawiki/uploads>
<IfModule mod_rewrite.c>
RewriteEngine Off
</IfModule>
</Directory>
@@ -1,21 +0,0 @@
##
## On all sites, provide mldonkey web interface on a path: /mldonkey
##
# Redirect /mldonkey to /mldonkey/ as the MLdonkey server web interface does not
# work without a slash at the end.
<Location ~ ^/mldonkey$>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/mldonkey$
RewriteRule .* /mldonkey/ [R=301,L]
</IfModule>
</Location>
<Location /mldonkey/>
Include includes/freedombox-single-sign-on.conf
ProxyPass http://localhost:4080/
<IfModule mod_auth_pubtkt.c>
TKTAuthToken "admin" "ed2k"
</IfModule>
</Location>
@@ -1,53 +0,0 @@
# Proxy all PHP file requests through PHP-FPM.
#
# Based on /etc/apache2/conf-available/php7.3-fpm.conf but modified to not break
# when PHP version upgrade happens due to php-fpm package depending on the
# latest version of PHP. Since PHP-FPM unix sockets have version number their
# path, to work with future version of PHP, hack assuming some future versions.
# Redirect to local php-fpm if mod_php is not available
<IfModule !mod_php7.c>
<IfModule proxy_fcgi_module>
# Enable http authorization headers
<IfModule setenvif_module>
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
</IfModule>
<FilesMatch ".+\.ph(ar|p|tml)$">
<IfFile /etc/php/7.3>
SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost"
</IfFile>
<IfFile /etc/php/7.4>
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
</IfFile>
<IfFile /etc/php/7.5>
SetHandler "proxy:unix:/run/php/php7.5-fpm.sock|fcgi://localhost"
</IfFile>
<IfFile /etc/php/7.6>
SetHandler "proxy:unix:/run/php/php7.6-fpm.sock|fcgi://localhost"
</IfFile>
<IfFile /etc/php/8.0>
SetHandler "proxy:unix:/run/php/php8.0-fpm.sock|fcgi://localhost"
</IfFile>
<IfFile /etc/php/8.1>
SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost"
</IfFile>
<IfFile /etc/php/8.2>
SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost"
</IfFile>
<IfFile /etc/php/8.3>
SetHandler "proxy:unix:/run/php/php8.3-fpm.sock|fcgi://localhost"
</IfFile>
</FilesMatch>
<FilesMatch ".+\.phps$">
# Deny access to raw php sources by default
# To re-enable it's recommended to enable access to the files
# only in specific virtual host or directory
Require all denied
</FilesMatch>
# Deny access to files without filename (e.g. '.php')
<FilesMatch "^\.ph(ar|p|ps|tml)$">
Require all denied
</FilesMatch>
</IfModule>
</IfModule>
@@ -1,13 +0,0 @@
##
## On all sites, provide Radicale on a path: /radicale
## Allow all valid users.
##
Redirect 301 /.well-known/carddav /radicale/.well-known/carddav
Redirect 301 /.well-known/caldav /radicale/.well-known/caldav
<Location /radicale>
ProxyPass http://localhost:5232
Include includes/freedombox-auth-ldap.conf
Require valid-user
</Location>
@@ -1,24 +0,0 @@
##
## On all sites, provide Radicale on a path: /radicale
## Allow all valid users.
##
Redirect 301 /.well-known/carddav /radicale/
Redirect 301 /.well-known/caldav /radicale/
<Location ~ ^/radicale$>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/radicale$
RewriteRule .* /radicale/ [R=301,L]
</IfModule>
</Location>
<Location /radicale/>
Include includes/freedombox-auth-ldap.conf
Require valid-user
ProxyPass unix:/run/uwsgi/app/radicale/socket|uwsgi://radicale/
ProxyPassReverse unix:/run/uwsgi/app/radicale/socket|uwsgi://radicale/
RequestHeader set X-Script-Name /radicale/
RequestHeader set X-Remote-User expr=%{REMOTE_USER}
</Location>
@@ -1,11 +0,0 @@
##
## On all sites, provide repro admin interface on a path: /repro
## Only allow users of admin LDAP group.
##
<Location /repro>
ProxyPass http://localhost:5080
Include includes/freedombox-single-sign-on.conf
<IfModule mod_auth_pubtkt.c>
TKTAuthToken "admin"
</IfModule>
</Location>
@@ -1,26 +0,0 @@
# Redirect /searx to /searx/
<Location ~ ^/searx$>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/searx$
RewriteRule .* /searx/ [R=301,L]
</IfModule>
</Location>
<Location /searx/>
Include includes/freedombox-single-sign-on.conf
<IfModule mod_auth_pubtkt.c>
TKTAuthToken "web-search" "admin"
</IfModule>
ProxyPass unix:/run/uwsgi/app/searx/socket|uwsgi://uwsgi-uds-searx/
</Location>
# This exclusion rule is to allow Searx to be added as a search engine in Firefox.
<LocationMatch "^/searx/(opensearch.xml|static/themes/oscar/img/favicon.png)$">
Require all granted
ProxyPassMatch "unix:/run/uwsgi/app/searx/socket|uwsgi://uwsgi-uds-searx/$1"
</LocationMatch>
@@ -1,24 +0,0 @@
##
## On all sites, provide syncthing web interface on a path: /syncthing
##
# Redirect /syncthing to /syncthing/ as the Syncthing server does not
# work without a slash at the end.
<Location ~ ^/syncthing$>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/syncthing$
RewriteRule .* /syncthing/ [R=301,L]
</IfModule>
</Location>
<Location /syncthing/>
Include includes/freedombox-single-sign-on.conf
ProxyPass http://localhost:8384/
<IfModule mod_auth_pubtkt.c>
TKTAuthToken "admin" "syncthing"
</IfModule>
</Location>
@@ -1,14 +0,0 @@
# Tahoe-LAFS Storage Node web interface
Listen 5678
# XXX: SSL is not configured?
# TODO: Use subdomain?
<VirtualHost *:5678>
<Location "/">
Include includes/freedombox-auth-ldap.conf
Require ldap-group cn=admin,ou=groups,dc=thisbox
ProxyPass http://localhost:1234/
</Location>
</VirtualHost>
@@ -1,19 +0,0 @@
##
## On all sites, provide Transmission on a default path: /transmission
##
## Requires the following Apache modules to be enabled:
## mod_headers
## mod_proxy
## mod_proxy_http
##
<Location /transmission>
ProxyPass http://localhost:9091/transmission
Include includes/freedombox-single-sign-on.conf
<IfModule mod_auth_pubtkt.c>
TKTAuthToken "admin" "bit-torrent"
</IfModule>
## Send the scheme from user's request to enable Transmission to
## redirect URLs, set cookies, set absolute URLs (if any)
## properly.
RequestHeader set X-Forwarded-Proto 'https' env=HTTPS
</Location>
@@ -1,19 +0,0 @@
##
## On all sites, provide Tiny Tiny RSS on a default path: /tt-rss
## Allow all valid LDAP users.
##
Alias /tt-rss /usr/share/tt-rss/www
Alias /tt-rss-app /usr/share/tt-rss/www
<Location /tt-rss>
Include includes/freedombox-single-sign-on.conf
<IfModule mod_auth_pubtkt.c>
TKTAuthToken "feed-reader" "admin"
</IfModule>
</Location>
<Location /tt-rss-app>
Include includes/freedombox-auth-ldap.conf
Require valid-user
# TODO Restrict access to `feed-reader` group
</Location>
@@ -1,6 +0,0 @@
AuthType basic
AuthName "FreedomBox Login"
AuthBasicProvider ldap
AuthLDAPUrl "ldap:///ou=users,dc=thisbox?uid"
AuthLDAPGroupAttribute memberUid
AuthLDAPGroupAttributeIsDN off
@@ -1,2 +0,0 @@
Options +Indexes -FollowSymLinks -ExecCGI -Includes -IncludesNOEXEC
AllowOverride None
@@ -1,15 +0,0 @@
<IfModule mod_auth_pubtkt.c>
TKTAuthPublicKey /etc/apache2/auth-pubtkt-keys/pubkey.pem
TKTAuthLoginURL /plinth/accounts/sso/login/
TKTAuthBackArgName next
TKTAuthDigest SHA512
TKTAuthRefreshURL /plinth/accounts/sso/refresh/
TKTAuthUnauthURL /plinth
AuthType mod_auth_pubtkt
AuthName "FreedomBox Single Sign On"
Require valid-user
</IfModule>
<IfModule !mod_auth_pubtkt.c>
Require all denied
</IfModule>
-8
View File
@@ -1,8 +0,0 @@
// This configuration is installed by FreedomBox.
//
// When Apt's cache is updated (i.e. apt-cache update) notify FreedomBox service
// via it's D-Bus API. FreedomBox may then handle upgrade of some packages.
//
APT::Update::Post-Invoke-Success {
"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call --system --dest org.freedombox.Service --object-path /org/freedombox/Service/PackageHandler --timeout 10 --method org.freedombox.Service.PackageHandler.CacheUpdated 2> /dev/null > /dev/null; /bin/echo > /dev/null";
};
@@ -1,16 +0,0 @@
// Remove unused automatically installed kernel-related packages
// (kernel images, kernel headers and kernel version locked tools).
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
Unattended-Upgrade::Remove-Unused-Dependencies "true";
// Allow upgrading from backports repository. This origin pattern is added to
// other configured patterns. This only works if the current distribution is a
// stable release. Also all backuports packages have a priority of 100 which is
// ignored. Only packages that have higher priority set explicitly will get
// upgraded. Only selected FreedomBox packages have high priority set on them.
Unattended-Upgrade::Origins-Pattern {
"o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports";
};
-14
View File
@@ -1,14 +0,0 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_sftp-ssh._tcp</type>
<port>22</port>
<txt-record>path=/home/fbx</txt-record>
<txt-record>u=fbx</txt-record>
</service>
</service-group>
-12
View File
@@ -1,12 +0,0 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>
@@ -1,12 +0,0 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_xmpp-server._tcp</type>
<port>5269</port>
</service>
</service-group>
@@ -1,2 +0,0 @@
[apache-auth]
enabled = true
@@ -1,2 +0,0 @@
[sshd]
enabled = true
-37
View File
@@ -1,37 +0,0 @@
# -*- mode: perl -*-
# Ikiwiki setup automator for Plinth (blog version).
require IkiWiki::Setup::Automator;
our $wikiname=$ARGV[0];
our $admin=$ARGV[1];
if (($wikiname eq "") || ($admin eq "")) {
print "Usage: ikiwiki -setup /etc/ikiwiki/plinth-blog.setup blog_name admin_name";
exit;
}
our $wikiname_short=IkiWiki::Setup::Automator::sanitize_wikiname($wikiname);
IkiWiki::Setup::Automator->import(
wikiname => $wikiname,
adminuser => [$admin],
rcs => "git",
srcdir => "/var/lib/ikiwiki/$wikiname_short",
destdir => "/var/www/ikiwiki/$wikiname_short",
repository => "/var/lib/ikiwiki/$wikiname_short.git",
dumpsetup => "/var/lib/ikiwiki/$wikiname_short.setup",
url => "/ikiwiki/$wikiname_short",
cgiurl => "/ikiwiki/$wikiname_short/ikiwiki.cgi",
cgiauthurl => "/ikiwiki-auth/$wikiname_short/ikiwiki.cgi",
cgi_wrapper => "/var/www/ikiwiki/$wikiname_short/ikiwiki.cgi",
add_plugins => [qw{goodstuff websetup comments calendar sidebar trail httpauth}],
rss => 1,
atom => 1,
syslog => 1,
example => "blog",
comments_pagespec => "posts/* and !*/Discussion",
archive_pagespec => "page(posts/*) and !*/Discussion",
global_sidebars => 0,
discussion => 0,
tagbase => "tags",
)
-31
View File
@@ -1,31 +0,0 @@
# -*- mode: perl -*-
# Ikiwiki setup automator for Plinth.
require IkiWiki::Setup::Automator;
our $wikiname=$ARGV[0];
our $admin=$ARGV[1];
if (($wikiname eq "") || ($admin eq "")) {
print "Usage: ikiwiki -setup /etc/ikiwiki/plinth-wiki.setup wiki_name admin_name";
exit;
}
our $wikiname_short=IkiWiki::Setup::Automator::sanitize_wikiname($wikiname);
IkiWiki::Setup::Automator->import(
wikiname => $wikiname,
adminuser => [$admin],
rcs => "git",
srcdir => "/var/lib/ikiwiki/$wikiname_short",
destdir => "/var/www/ikiwiki/$wikiname_short",
repository => "/var/lib/ikiwiki/$wikiname_short.git",
dumpsetup => "/var/lib/ikiwiki/$wikiname_short.setup",
url => "/ikiwiki/$wikiname_short",
cgiurl => "/ikiwiki/$wikiname_short/ikiwiki.cgi",
cgiauthurl => "/ikiwiki-auth/$wikiname_short/ikiwiki.cgi",
cgi_wrapper => "/var/www/ikiwiki/$wikiname_short/ikiwiki.cgi",
add_plugins => [qw{goodstuff websetup httpauth}],
rss => 1,
atom => 1,
syslog => 1,
)
-26
View File
@@ -1,26 +0,0 @@
<?php
# Default logo
$wgLogo = "$wgResourceBasePath/resources/assets/mediawiki.png";
# Enable file uploads
$wgEnableUploads = true;
# Public registrations
$wgGroupPermissions['*']['createaccount'] = false;
# Read/write permissions for anonymous users
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['read'] = true;
# Short urls
$wgArticlePath = "/mediawiki/$1";
$wgUsePathInfo = true;
# Instant Commons
$wgUseInstantCommons = true;
# SVG Enablement
$wgFileExtensions[] = 'svg';
$wgAllowTitlesInSVG = true;
$wgSVGConverter = 'ImageMagick';