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

fix: Change templates.env.globals["url_for"] #14

Merged
merged 1 commit into from
Dec 10, 2023
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
9 changes: 1 addition & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ ENV PYTHONPATH /app
# Copy content from builder stage
COPY --from=builder /app /app

# Install packages
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y tini && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Add qrcode user and create directories
RUN useradd -m qrcode && mkdir -p /app

Expand All @@ -54,4 +47,4 @@ USER qrcode
EXPOSE 8000

# Set entrypoint and cmd
ENTRYPOINT ["/usr/bin/tini", "--", "uvicorn", "--host", "0.0.0.0", "--port", "8000", "secure_qrcode.api:app"]
ENTRYPOINT ["uvicorn", "--host", "0.0.0.0", "--port", "8000", "secure_qrcode.api:app"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Encrypt your data using the modern ChaCha20-Poly1305 cipher and export it into a

## access via browser

Open the url https://secure-qrcode.onrender.com on your browser.
Open the url https://secure-qrcode.fly.dev on your browser.

If you want to run this on your local machine, see the next section.

Expand Down
29 changes: 29 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# fly.toml app configuration file generated for secure-qrcode on 2023-12-10T16:41:32-03:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "secure-qrcode"
primary_region = "dfw"

[build]

[http_service]
internal_port = 8000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]

[[http_service.checks]]
grace_period = "10s"
interval = "60s"
method = "GET"
timeout = "5s"
path = "/healthz"

[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 256
14 changes: 7 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions secure_qrcode/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
)
app.mount("/static", StaticFiles(directory="static"), name="static")
templates = Jinja2Templates(directory="templates")
templates.env.globals["url_for"] = app.url_path_for


@app.exception_handler(DecryptError)
Expand Down