Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Debian 10 (Buster) #99

Merged
merged 15 commits into from
Nov 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 5 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
include babel.cfg LICENSE README.md setup.cfg
include src/hades/logging.ini
include babel.cfg
include LICENSE
include README.md
include setup.cfg
include src/hades/deputy/interface.xml
include src/hades/logging.ini
recursive-include src/hades/portal/assets *
recursive-include src/hades/portal/templates *
15 changes: 9 additions & 6 deletions configure.mk
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ $(call require_program,KEEPALIVED,keepalived)
$(call require_program,KILL,kill)
$(call require_program,MOUNT,mount)
$(call require_program,NGINX,nginx)
$(call require_program,PG_CONFIG,pg_config)
$(call require_program,PSQL,psql)
$(call require_program,PYTHON3,python3)
$(call require_program,RADIUSD,radiusd freeradius)
Expand All @@ -171,12 +170,16 @@ $(call require_program,UNBOUND_CHECKCONF,unbound-checkconf)
$(call require_program,UNBOUND_CONTROL,unbound-control)
$(call require_program,UWSGI,uwsgi)

pgbindir := $(shell $(PG_CONFIG) --bindir)
get_pg_version := perl -MPgCommon -e 'print get_newest_version();'

$(call require_program,CREATEDB,createdb,$(pgbindir))
$(call require_program,CREATEUSER,createuser,$(pgbindir))
$(call require_program,PG_CTL,pg_ctl,$(pgbindir))
$(call require_program,POSTGRES,postgres,$(pgbindir))
$(call add_substitution, PG_VERSION, $(shell $(get_pg_version)))

get_pg_path := perl -MPgCommon -e 'print get_program_path($$ARGV[0], "$(PG_VERSION)");'

$(call add_substitution, CREATEDB, $(shell $(get_pg_path) createdb))
$(call add_substitution, CREATEUSER, $(shell $(get_pg_path) createuser))
$(call add_substitution, PG_CTL, $(shell $(get_pg_path) pg_ctl))
$(call add_substitution, POSTGRES, $(shell $(get_pg_path) postgres))

# User and group settings
$(call add_substitution, SYSTEM_GROUP, hades)
Expand Down
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Build-Depends:
iptables,
keepalived,
nginx,
postgresql-9.6,
postgresql (>= 9.6),
python3-all,
python3-arpreq,
python3-babel,
Expand Down Expand Up @@ -63,7 +63,7 @@ Depends:
iptables,
keepalived,
nginx,
postgresql-9.6,
postgresql (>= 9.6),
python3-arpreq,
python3-babel,
python3-celery,
Expand Down
15 changes: 7 additions & 8 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:stretch
FROM debian:buster
MAINTAINER Sebastian Schrader <[email protected]>
ARG BUILDER_UID=1000
ARG BUILDER_GID=1000
Expand Down Expand Up @@ -39,9 +39,8 @@ RUN export DEBIAN_FRONTEND="noninteractive" && \
nginx \
packaging-dev \
policykit-1 \
postgresql-9.6 \
postgresql-contrib-9.6 \
postgresql-server-dev-9.6 \
postgresql \
postgresql-contrib \
pypy \
pypy-dev \
pypy-ipaddress \
Expand Down Expand Up @@ -77,6 +76,7 @@ RUN export DEBIAN_FRONTEND="noninteractive" && \
python3-pytest-runner \
python3-sqlalchemy \
python3-setuptools \
python3-systemd \
python3-venv \
rabbitmq-server \
strace \
Expand All @@ -92,17 +92,16 @@ RUN export DEBIAN_FRONTEND="noninteractive" && \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN pg_lsclusters --no-header | cut -d ' ' -f 1-2 | xargs --no-run-if-empty --max-args=2 pg_dropcluster \
&& find -L /etc/systemd/system /lib/systemd/system -type f -path '*.wants/*' \
RUN find -L /etc/systemd/system /lib/systemd/system -type f -path '*.wants/*' \
! -name '*dbus*' \
! -name '*journal*' \
! -name '*tmpfiles*' \
! -name rabbitmq-server.service \
! -name remount-proc-sys.service \
! -name remount-sys.service \
! -name systemd-logind.service \
-printf '%f\0' | sort --unique --zero-terminated | xargs --null --no-run-if-empty systemctl mask \
&& find -L /etc/init.d -type f -perm /u+x,g+x,o+x ! -name rc ! -name rcS -printf '%f\0' | xargs --null --no-run-if-empty --max-args=1 sh -c 'update-rc.d -f "$1" remove' sh \
-printf '%f\0' | sort --unique --zero-terminated | xargs --null --no-run-if-empty --verbose systemctl mask \
&& find -L /etc/init.d -type f -perm /u+x,g+x,o+x ! -name rc ! -name rcS -printf '%f\0' | xargs --null --no-run-if-empty --max-args=1 -I'{}' --verbose update-rc.d -f '{}' remove \
&& { addgroup --system --gid $BUILDER_GID builder || true; } \
&& adduser --system --home /build --shell /bin/bash --uid $BUILDER_UID --gid $BUILDER_GID builder \
&& sed -i -re 's/^#?(ForwardTo[^=]+)=.*$/\1=no/' /etc/systemd/journald.conf
Expand Down
52 changes: 0 additions & 52 deletions docker/etc/apt/nodesource.gpg.key

This file was deleted.

12 changes: 6 additions & 6 deletions docker/etc/apt/sources.list
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
deb http://ftp.agdsn.de/debian stretch main
deb-src http://ftp.agdsn.de/debian stretch main
deb http://ftp.agdsn.de/debian buster main
deb-src http://ftp.agdsn.de/debian buster main

deb http://ftp.agdsn.de/debian stretch-backports main
deb-src http://ftp.agdsn.de/debian stretch-backports main
deb http://ftp.agdsn.de/debian buster-backports main
deb-src http://ftp.agdsn.de/debian buster-backports main

deb http://ftp.agdsn.de/debian-security stretch/updates main
deb-src http://ftp.agdsn.de/debian-security stretch/updates main
deb http://ftp.agdsn.de/debian-security buster/updates main
deb-src http://ftp.agdsn.de/debian-security buster/updates main
41 changes: 41 additions & 0 deletions docker/etc/postgresql-common/createcluster.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Default values for pg_createcluster(8)
# Occurrences of '%v' are replaced by the major version number,
# and '%c' by the cluster name. Use '%%' for a literal '%'.

# Create a "main" cluster when a new postgresql-x.y server package is installed
create_main_cluster = false

# Default start.conf value, must be one of "auto", "manual", and "disabled".
# See pg_createcluster(8) for more documentation.
#start_conf = 'auto'

# Default data directory.
#data_directory = '/var/lib/postgresql/%v/%c'

# Default directory for transaction logs
# Unset by default, i.e. transaction logs remain in the data directory.
#waldir = '/var/lib/postgresql/wal/%v/%c/pg_wal'

# Options to pass to initdb.
#initdb_options = ''

# The following options are copied into the new cluster's postgresql.conf:

# Enable SSL by default (using the "snakeoil" certificates installed by the
# ssl-cert package, unless configured otherwise here)
ssl = on

# Show cluster name in process title
cluster_name = '%v/%c'

# Put stats_temp_directory on tmpfs
stats_temp_directory = '/var/run/postgresql/%v-%c.pg_stat_tmp'

# Add prefix to log lines
log_line_prefix = '%%m [%%p] %%q%%u@%%d '

# Add "include_dir" in postgresql.conf
add_include_dir = 'conf.d'

# Directory for additional createcluster config
include_dir '/etc/postgresql-common/createcluster.d'
25 changes: 13 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
arpreq~=0.3.1
Babel~=2.3.4
celery~=3.1.23
Flask-Babel~=0.11.1
Flask~=0.12.1
Jinja2~=2.8
netaddr~=0.7.18
psycopg2~=2.6.2
Babel~=2.6.0
celery~=4.2.1
Flask-Babel~=0.11.2
Flask~=1.0.2
Jinja2~=2.10
netaddr~=0.7.19
psycopg2~=2.7.7
pydbus~=0.6.0
pygobject~=3.22
pyrad~=2.0
pyroute2~=0.3.16
pysnmp~=4.3.2
SQLAlchemy~=1.0.14
pygobject~=3.30.4
pyrad~=2.1
pyroute2~=0.5.2
pysnmp~=4.4.6
python-systemd>=234
SQLAlchemy~=1.2.18
2 changes: 1 addition & 1 deletion scripts/control-database.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ do_init() {
msg "Creating local master database @LOCAL_MASTER_DATABASE_NAME@ for testing."
@CREATEDB@ @LOCAL_MASTER_DATABASE_NAME@
@PSQL@ --quiet --set=ON_ERROR_STOP=1 --no-psqlrc --single-transaction postgres <<-COMMAND
CREATE ROLE "@LOCAL_MASTER_DATABASE_USER@" WITH LOGIN INHERIT UNENCRYPTED PASSWORD '@LOCAL_MASTER_DATABASE_PASSWORD@';
CREATE ROLE "@LOCAL_MASTER_DATABASE_USER@" WITH LOGIN INHERIT PASSWORD '@LOCAL_MASTER_DATABASE_PASSWORD@';
COMMAND
msg "Loading local master database schema"
@bindir@/hades-generate-config schema_fdw.sql.j2 | @PSQL@ --quiet --set=ON_ERROR_STOP=1 --no-psqlrc --single-transaction --file=- @LOCAL_MASTER_DATABASE_NAME@
Expand Down
3 changes: 1 addition & 2 deletions src/hades/portal/session.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import collections
from flask.sessions import SessionInterface, SessionMixin


class NullSession(collections.MutableMapping, SessionMixin):
class NullSession(SessionMixin):
"""
A session similar to the Flask's :class:`flask.sessions.NullSession`, but
with a different error message.
Expand Down
6 changes: 3 additions & 3 deletions templates/freeradius/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ ordering when the modules are loaded.

Modules can be enabled by creating a soft link. For module ``foo``, do::

$ cd raddb
$ ln -s mods-available/foo mods-enabled/foo
$ cd raddb/mods-enabled
$ ln -s ../mods-available/foo

To create "local" versions of the modules, we suggest copying the file
instead. This leaves the original file (with documentation) in the
Expand Down Expand Up @@ -660,6 +660,6 @@ That configuration will never show the ``if (1)`` output in debugging mode.
Dialup_admin
------------

The dialip_admin directory has been removed. No one stepped forward
The dialup_admin directory has been removed. No one stepped forward
to maintain it, and the code had not been changed in many years.

4 changes: 2 additions & 2 deletions templates/freeradius/mods-available/cache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- text -*-
#
# $Id: 63f44b1c1bedf70e6fc7eb6e4120a18084408a41 $
# $Id: 8bd4730cf570fdfedc9c516dc6974eab39981600 $

#
# A module to cache attributes. The idea is that you can look
Expand Down Expand Up @@ -89,7 +89,7 @@ cache {
# <list>:<attribute> <op> <value>

# Cache all instances of Reply-Message in the reply list
&reply:Reply-Message += &reply:Reply-Message
&reply:Reply-Message += &reply:Reply-Message[*]

# Add our own to show when the cache was last updated
&reply:Reply-Message += "Cache last updated at %t"
Expand Down
2 changes: 1 addition & 1 deletion templates/freeradius/mods-available/couchbase
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ couchbase {
#
# Element names should be single quoted.
#
# Note: Atrributes not in this map will not be recorded.
# Note: Attributes not in this map will not be recorded.
#
update {
Acct-Session-Id = 'sessionId'
Expand Down
5 changes: 5 additions & 0 deletions templates/freeradius/mods-available/date
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@
#
date {
format = "%b %e %Y %H:%M:%S %Z"

# Use UTC instead of local time.
#
# default = no
# utc = yes
}
5 changes: 4 additions & 1 deletion templates/freeradius/mods-available/dhcp_sqlippool
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ sqlippool dhcp_sqlippool {
pool_key = "%{Calling-Station-Id}"

# For now, it works with MySQL.
$INCLUDE ${modconfdir}/sql/ippool-dhcp/mysql/queries.conf
# This line is commented by default to enable clean startup when you
# don't have freeradius-mysql installed. Uncomment this line if you
# use this module.
#$INCLUDE ${modconfdir}/sql/ippool-dhcp/mysql/queries.conf

# It may also work with sqlite - this is very experimental.
# Comment out the above line and add the following include.
Expand Down
Loading