wipe: Add wipe_mail.from configuration
This commit is contained in:
parent
2286cf2d88
commit
0574c91196
10
api/api.py
10
api/api.py
@ -3,7 +3,7 @@ import uuid
|
|||||||
import ansible_runner
|
import ansible_runner
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict, List
|
||||||
from fastapi import FastAPI, HTTPException, Request, Security, Depends
|
from fastapi import FastAPI, HTTPException, Request, Security, Depends
|
||||||
from fastapi.responses import StreamingResponse
|
from fastapi.responses import StreamingResponse
|
||||||
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
||||||
@ -112,7 +112,7 @@ app = FastAPI(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/deployment")
|
@app.get("/deployment", response_model=List[DeploymentDTO])
|
||||||
async def deployment_list(request: Request, user: User = Depends(get_user)):
|
async def deployment_list(request: Request, user: User = Depends(get_user)):
|
||||||
return [
|
return [
|
||||||
DeploymentDTO.from_deployment(deployment, request)
|
DeploymentDTO.from_deployment(deployment, request)
|
||||||
@ -150,7 +150,7 @@ async def deployment_logs(
|
|||||||
return StreamingResponse(stream(), media_type="text/plain")
|
return StreamingResponse(stream(), media_type="text/plain")
|
||||||
|
|
||||||
|
|
||||||
@app.get("/deployment/{id}")
|
@app.get("/deployment/{id}", response_model=DeploymentDTO)
|
||||||
async def deployment(
|
async def deployment(
|
||||||
request: Request,
|
request: Request,
|
||||||
deployment: Deployment = Depends(get_deployment),
|
deployment: Deployment = Depends(get_deployment),
|
||||||
@ -162,10 +162,10 @@ async def deployment(
|
|||||||
detail=f"This token does not allow to access {deployment.args.service} deployments.",
|
detail=f"This token does not allow to access {deployment.args.service} deployments.",
|
||||||
)
|
)
|
||||||
|
|
||||||
return DeploymentDTO.from_deployment(deployments[id], request)
|
return DeploymentDTO.from_deployment(deployment, request)
|
||||||
|
|
||||||
|
|
||||||
@app.post("/deployment")
|
@app.post("/deployment", response_model=DeploymentDTO)
|
||||||
async def deploy(args: DeployArgs, request: Request, user: User = Depends(get_user)):
|
async def deploy(args: DeployArgs, request: Request, user: User = Depends(get_user)):
|
||||||
if args.service not in user.allowed_services:
|
if args.service not in user.allowed_services:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
@ -12,6 +12,7 @@ QUEUE_DRIVER=sync
|
|||||||
MAIL_DRIVER=smtp
|
MAIL_DRIVER=smtp
|
||||||
MAIL_HOST={{ wipe_mail.host }}
|
MAIL_HOST={{ wipe_mail.host }}
|
||||||
MAIL_PORT={{ wipe_mail.port|default(587) }}
|
MAIL_PORT={{ wipe_mail.port|default(587) }}
|
||||||
|
MAIL_FROM={{ wipe_mail.from }}
|
||||||
MAIL_USERNAME={{ wipe_mail.user }}
|
MAIL_USERNAME={{ wipe_mail.user }}
|
||||||
MAIL_PASSWORD={{ wipe_mail.password }}
|
MAIL_PASSWORD={{ wipe_mail.password }}
|
||||||
MAIL_ENCRYPTION={{ wipe_mail.encryption|default("tls") }}
|
MAIL_ENCRYPTION={{ wipe_mail.encryption|default("tls") }}
|
||||||
|
@ -14,18 +14,15 @@ wipe_steam_key: !vault |
|
|||||||
37303233613065646638303535643535386162316330316161383537313132626261356465313065
|
37303233613065646638303535643535386162316330316161383537313132626261356465313065
|
||||||
6134633232366434643833333762316462363639653034636438
|
6134633232366434643833333762316462363639653034636438
|
||||||
wipe_mail:
|
wipe_mail:
|
||||||
host: smtp.googlemail.com
|
host: smtp.zoho.com
|
||||||
user: !vault |
|
user: wipe@kadet.net
|
||||||
$ANSIBLE_VAULT;1.1;AES256
|
from: "WIPE #7 <wipe@kadet.net>"
|
||||||
31346166396462643734663735323164343665393930613665643963616538363363346561343531
|
encryption: 'ssl'
|
||||||
6538613135353762656434383831386438636565373865650a623730643062643538663235616363
|
port: 465
|
||||||
34363938383133633964666130396265343134623939323562363234313664386337636635633035
|
|
||||||
3939643362333366300a376135393436663765316132643639366466373665663133363761366234
|
|
||||||
38306230633661653133653961356633376166633761333738633030643765313135
|
|
||||||
password: !vault |
|
password: !vault |
|
||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
31663537613531663362383135343538393663383566383030643339643733326333663133663362
|
31316133303937316531303931313766366230323862343038616465663865323233616466313865
|
||||||
3566303538353239666139363764373166626261366435330a646166623736636566346162366164
|
6366376233333032313832646461353865663463623732370a393435663334306161636362663238
|
||||||
33636566393161336362643038353163623264393134353639653339613066343965303434303234
|
34353431356132353464643662643531333961323938316638643734323035336164356630306635
|
||||||
6666613363613731330a643065613838356131633031356233656535363138323366373737393135
|
3730396332633166380a626538623530353261333964663665393231356238316132643133383233
|
||||||
38633831306539613634326530383234306361623237633832623662333539626339
|
39656463623665646465383361666537333639613263393634313432323561393166
|
||||||
|
Loading…
Reference in New Issue
Block a user