Skip to content
Open
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
.env
.env.example
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PACKET_IP=0.0.0.0
PACKET_SERVER_NAME=localhost.localdomain:8000
PACKET_SERVER_NAME=localhost:8000
PACKET_DATABASE_URI=postgresql://postgres:mysecretpassword@postgres:5432/postgres
PACKET_OIDC_CLIENT_ID=develop
PACKET_OIDC_CLIENT_SECRET=
PACKET_LDAP_BIND_PASS=
PACKET_LDAP_BIND_DN=
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: [3.14]

steps:
- name: Install ldap dependencies
Expand All @@ -38,7 +38,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: [3.14]

steps:
- name: Install ldap dependencies
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/python:3.9-slim-trixie
FROM docker.io/python:3.14-slim-trixie

RUN ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
RUN apt-get -yq update && \
Expand Down Expand Up @@ -32,4 +32,4 @@ RUN gulp production && \
# Set version for apm
RUN echo "export DD_VERSION=\"$(python3 packet/git.py)\"" >> /tmp/version

CMD ["/bin/bash", "-c", "source /tmp/version && ddtrace-run gunicorn packet:app --bind=0.0.0.0:8080 --access-logfile=- --timeout=600"]
CMD ["/bin/bash", "-c", "source /tmp/version && gunicorn packet:app --bind=0.0.0.0:8080 --access-logfile=- --timeout=600"]
34 changes: 0 additions & 34 deletions Dockerfile.dev

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ the second major iteration of packet on the web. The first version was
2. Build the dev environment with `docker compose build`
3. Start the dev environment with `docker compose up`
4. Run the database migrations with `docker exec -it packet-packet-1 flask db upgrade`
5. Go check out the app at http://localhost.localdomain:8000
5. Go check out the app at http://localhost:8080

> Useful Tip: use `docker compose up --watch` so that you don't need to rebuild the container every time you want to test a change

Expand Down
2 changes: 1 addition & 1 deletion config.env.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
OIDC_CLIENT_SECRET = environ.get("PACKET_OIDC_CLIENT_SECRET", "PLEASE_REPLACE_ME")

# SQLAlchemy config
SQLALCHEMY_DATABASE_URI = environ.get("PACKET_DATABASE_URI", "postgresql://postgres:mysecretpassword@localhost:5432/postgres")
SQLALCHEMY_DATABASE_URI = environ.get("PACKET_DATABASE_URI", "postgresql://postgres:mysecretpassword@postgres:5432/postgres")
SQLALCHEMY_TRACK_MODIFICATIONS = False

# LDAP config
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ services:
packet:
build:
context: .
dockerfile: ./Dockerfile.dev
env_file:
- path: ".env"
required: true
ports:
- "8000:8000"
- "8080:8080"
develop:
watch:
- action: sync+restart
Expand All @@ -23,14 +22,15 @@ services:
postgres:
condition: service_healthy
restart: true

postgres:
image: "docker.io/postgres:17"
image: docker.io/postgres
networks:
- packet-network-dev
environment:
POSTGRES_USER: "postgres"
POSTGRES_DB: "postgres"
POSTGRES_PASSWORD: "mysecretpassword"
POSTGRES_USER: postgres
POSTGRES_DATABASE: postgres
POSTGRES_PASSWORD: mysecretpassword
ports:
- "5432:5432"
healthcheck:
Expand Down
3 changes: 2 additions & 1 deletion packet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
# Initialize the extensions
db = SQLAlchemy(app)
migrate = Migrate(app, db)
app.logger.info('SQLAlchemy pointed at ' + repr(db.engine.url))
with app.app_context():
app.logger.info('SQLAlchemy pointed at ' + repr(db.engine.url))

APP_CONFIG = ProviderConfiguration(issuer=app.config['OIDC_ISSUER'],
client_metadata=ClientMetadata(app.config['OIDC_CLIENT_ID'],
Expand Down
35 changes: 17 additions & 18 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
Flask-Gzip==0.2
Flask-Mail==0.10.0
Flask-Migrate~=2.7.0
Flask-pyoidc~=3.7.0
Flask~=1.1.4
csh-ldap @ git+https://github.com/costowell/csh_ldap@67dd183744746c758d6c13878f539437d2628b63
ddtrace==3.12.2
flask_sqlalchemy~=2.5.1
gunicorn~=20.0.4
mypy==1.17.1
Flask-Gzip
Flask-Mail
Flask-Migrate
Flask-pyoidc
Flask
csh-ldap
flask_sqlalchemy
gunicorn
mypy
onesignal-sdk~=1.0.0
psycopg2-binary~=2.9.3
pylint-quotes==0.2.3
pylint~=2.8.0
sentry-sdk~=1.5.12
sqlalchemy[mypy]~=1.4.31

psycopg2-binary
pylint-quotes
pylint
sentry-sdk
sqlalchemy[mypy]
setuptools
# Broken transitive dependency we should version
MarkupSafe~=2.0.1
MarkupSafe
# Tool to generate requirements.txt
pip-tools~=6.6.2
pip-tools
Loading
Loading