How do I dropdown?
This is how you dropdown.
<details> <summary>How do I dropdown?</summary> <br> This is how you dropdown.
<details> <summary>How do I dropdown?</summary> <br> This is how you dropdown.
version: "3" | |
services: | |
traefik: | |
image: "traefik:v2.0" | |
container_name: "traefik" | |
command: | |
# Globals | |
- "--log.level=DEBUG" | |
- "--api=true" |
version: "3.3" | |
services: | |
caddy: | |
image: abiosoft/caddy:1.0.3-no-stats | |
container_name: caddy | |
hostname: caddy | |
restart: unless-stopped | |
volumes: |
version: '3' | |
# Variables to fill in: | |
# Line 23: <LETSENCRYPT_MAIL_ADDRESS> - your mail address for contact with Let's Encrypt | |
# Line 36: <TRAEFIK_DASHBOARD_ADMIN_PASSWORD> - MD5 hash of your password (use http://www.htaccesstools.com/htpasswd-generator/) | |
# Line 54: <POSTGRES_PASSWORD> - the password for the postgres db. Use the same during mastodon:setup! | |
# Lines 31, 86, 111: <DOMAIN> - e.g. social.yourdomain.com (Must have an A record pointing to your box' IP) (AAAA for IPv6 ;) | |
services: | |
traefik: |
from locust import HttpLocust, TaskSet, task | |
class MostBasicLoadTest(TaskSet): | |
def on_start(self): | |
""" on_start is called when a Locust start before any task is scheduled """ | |
self.login() | |
def login(self): | |
self.client.post("/api/api-token-auth/", | |
{ |
from typing import Optional | |
import base64 | |
from passlib.context import CryptContext | |
from datetime import datetime, timedelta | |
import jwt | |
from jwt import PyJWTError | |
from pydantic import BaseModel |
from fastapi import FastAPI, Query | |
from fastapi.responses import JSONResponse | |
from typing import Optional | |
from pydantic import BaseModel, Field | |
tags_metadata = [ | |
{ | |
"name": "create-user", | |
"description": "Create new user based on *ID*. Will **overwrite** existing user.", | |
}, |
# Sample from @citizen428 https://dev.to/citizen428/comment/6cmh | |
FROM golang:alpine as build | |
RUN apk add --no-cache ca-certificates | |
WORKDIR /build | |
ADD . . | |
RUN CGO_ENABLED=0 GOOS=linux \ | |
go build -ldflags '-extldflags "-static"' -o app | |
FROM scratch | |
COPY --from=build /etc/ssl/certs/ca-certificates.crt \ |
import os | |
from fastapi import FastAPI | |
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware | |
import sentry_sdk | |
sentry_sdk.init( | |
dsn='your Sentry dns', # CHANGE HERE | |
environment=os.getenv('ENV', 'dev'), # You should read it from environment variable |
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |