Compare commits

...

2 Commits

Author SHA1 Message Date
decentral1se b61342b576
Fix logging
continuous-integration/drone/push Build is passing Details
2021-06-16 16:14:07 +02:00
decentral1se 0aa5c1b625
Pass env vars, push does build now 2021-06-16 15:54:32 +02:00
3 changed files with 9 additions and 6 deletions

View File

@ -5,10 +5,12 @@ services:
app:
image: "decentral1se/pubspace:latest"
environment:
- MASTODON_ACCESS_TOKEN_FILE=/run/secrets/access_token
- NEXTCLOUD_APP_PASSWORD_FILE=/run/secrets/app_password
- MASTODON_API_BASE_URL
- APP_LOG_LEVEL
- MASTODON_ACCESS_TOKEN_FILE=/run/secrets/access_token
- MASTODON_API_BASE_URL
- NEXTCLOUD_API_BASE_URL
- NEXTCLOUD_APP_PASSWORD_FILE=/run/secrets/app_password
- NEXTCLOUD_USER
secrets:
- access_token
- app_password

View File

@ -12,5 +12,5 @@ run:
build:
@docker build -t decentral1se/pubspace .
push:
push: build
@docker push decentral1se/pubspace

View File

@ -53,12 +53,13 @@ def create_share(fpath):
async def home(request: Request):
try:
payload = await request.json()
request.app.state.log.info(f"Received: {payload}")
file = payload["file"]
link = create_share(file)
if link:
app.state.log(f"Shared {file} on {link}")
request.app.state.log.info(f"Shared {file} on {link}")
else:
app.state.log(f"{file} has already been shared!")
request.app.state.log.info(f"{file} already shared or failure!")
except Exception:
return {}