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

Repackage web UI using newer tools #1426

Merged
merged 2 commits into from
Jan 22, 2025
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
3 changes: 2 additions & 1 deletion Dockerfile.www
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@

FROM ubuntu:noble

MAINTAINER Lukas Garberg <[email protected]>

Check failure on line 28 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / docker

DL4000 info: MAINTAINER is deprecated

ENV DEBIAN_FRONTEND=noninteractive

ENV NIPAPD_HOST=nipapd NIPAPD_PORT=1337 WWW_USERNAME=guest WWW_PASSWORD=guest

# apt update, upgrade & install packages
RUN apt-get update -qy && apt-get upgrade -qy \

Check failure on line 35 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / docker

DL3008 info: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
&& apt-get install --no-install-recommends -qy apache2 \
build-essential \
libapache2-mod-wsgi-py3 \
Expand Down Expand Up @@ -63,9 +63,10 @@
COPY pynipap /pynipap
COPY nipap /nipap
COPY nipap-www /nipap-www
RUN cd /pynipap && pip3 --no-input install --break-system-packages --no-cache-dir . && \

Check failure on line 66 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / docker

DL3003 info: Use WORKDIR to switch to a directory
cd /nipap && pip3 --no-input install --break-system-packages --no-cache-dir . && \
cd /nipap-www && pip3 --no-input install --break-system-packages --no-cache-dir -r requirements.txt && python3 setup.py install && \
cd /nipap-www && pip3 --no-input install --break-system-packages --no-cache-dir . && \
mkdir -p /etc/nipap/ && cp nipap-www.wsgi /etc/nipap/ && \
cd ..

EXPOSE 80
Expand Down
4 changes: 2 additions & 2 deletions nipap-www/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ buildrpm:
builddeb:
# build the source package in the parent directory
# then rename it to project_version.orig.tar.gz
$(PYTHON) setup.py sdist --dist-dir=../
rename -f 's/$(PROJECT)-(\d.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*
$(PYTHON) -m build --sdist --outdir=../
rename -f 's/nipap_www-(\d.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*
# build the package
debuild -us -uc -sa

Expand Down
1 change: 0 additions & 1 deletion nipap-www/debian/compat

This file was deleted.

10 changes: 7 additions & 3 deletions nipap-www/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ Source: nipap-www
Section: web
Priority: optional
Maintainer: Lukas Garberg <[email protected]>
Build-Depends: debhelper (>= 10), python3 (>= 3.6), python3-setuptools (>= 0.6b3), dh-python
Standards-Version: 4.4.0
Build-Depends: debhelper-compat (= 13),
python3-all,
python3-setuptools,
dh-python
Standards-Version: 4.6.1

Package: nipap-www
Architecture: all
Depends: debconf, python3 (>= 3.6), ${misc:Depends}, python3-flask, python3-pynipap, nipap-common, python3-jinja2
Pre-Depends: debconf
Depends: ${misc:Depends}, ${python3:Depends}
XB-Python-Version: ${python:Versions}
Description: web frontend for NIPAP
A web UI for the NIPAP IP address planning service.
1 change: 1 addition & 0 deletions nipap-www/debian/install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nipap-www.wsgi etc/nipap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Jinja2 python3-jinja2
pynipap python3-pynipap
nipap nipap-common
Flask python3-flask (>= 2.0.0)
52 changes: 52 additions & 0 deletions nipap-www/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[project]
name = "nipap-www"
description = "Web frontend for NIPAP"
dynamic = ["version"]
license = {text = "MIT"}
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3'
]
keywords = ["nipap"]
dependencies = [
"Flask==3.0.3",
"Jinja2==3.1.5",
"nipap",
"pynipap",
]

[project.optional-dependencies]
instrumentation = [
"opentelemetry-api==1.29.0",
"opentelemetry-exporter-otlp==1.29.0",
"opentelemetry-exporter-otlp-proto-common==1.29.0",
"opentelemetry-exporter-otlp-proto-grpc==1.29.0",
"opentelemetry-exporter-otlp-proto-http==1.29.0",
"opentelemetry-instrumentation==0.50b0",
"opentelemetry-instrumentation-flask==0.50b0",
"opentelemetry-instrumentation-wsgi==0.50b0",
"opentelemetry-proto==1.29.0",
"opentelemetry-sdk==1.29.0",
"opentelemetry-semantic-conventions==0.50b0",
"opentelemetry-util-http==0.50b0"
]

[project.urls]
Homepage = "http://SpriteLink.github.io/NIPAP"

[tool.setuptools]
packages = ["nipapwww"]

[tool.setuptools.dynamic]
version = {attr = "nipapwww.__version__"}

[build-system]
requires = [
"setuptools"
]
build-backend = "setuptools.build_meta"
20 changes: 0 additions & 20 deletions nipap-www/requirements.txt

This file was deleted.

22 changes: 2 additions & 20 deletions nipap-www/setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
from setuptools import find_packages, setup

import nipapwww
from setuptools import setup

setup(
name='nipap-www',
version=nipapwww.__version__,
description='web frontend for NIPAP',
author=nipapwww.__author__,
author_email=nipapwww.__author_email__,
url=nipapwww.__url__,
install_requires=[
"Flask",
"pynipap",
"nipap"
],
license=nipapwww.__license__,
packages=find_packages(exclude=['ez_setup']),
include_package_data=True,
package_data={'nipapwww': ['i18n/*/LC_MESSAGES/*.mo']},
data_files=[
('/etc/nipap/www', ['nipap-www.wsgi', ]),
('share/nipap', ['nipap-www.wsgi', ]),
],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black would make changes.

zip_safe=False,
)
Loading