Compare commits
2 Commits
5b4fe5fc54
...
b61342b576
Author | SHA1 | Date |
---|---|---|
decentral1se | b61342b576 | |
decentral1se | 0aa5c1b625 |
|
@ -5,10 +5,12 @@ services:
|
||||||
app:
|
app:
|
||||||
image: "decentral1se/pubspace:latest"
|
image: "decentral1se/pubspace:latest"
|
||||||
environment:
|
environment:
|
||||||
- MASTODON_ACCESS_TOKEN_FILE=/run/secrets/access_token
|
|
||||||
- NEXTCLOUD_APP_PASSWORD_FILE=/run/secrets/app_password
|
|
||||||
- MASTODON_API_BASE_URL
|
|
||||||
- APP_LOG_LEVEL
|
- 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:
|
secrets:
|
||||||
- access_token
|
- access_token
|
||||||
- app_password
|
- app_password
|
||||||
|
|
2
makefile
2
makefile
|
@ -12,5 +12,5 @@ run:
|
||||||
build:
|
build:
|
||||||
@docker build -t decentral1se/pubspace .
|
@docker build -t decentral1se/pubspace .
|
||||||
|
|
||||||
push:
|
push: build
|
||||||
@docker push decentral1se/pubspace
|
@docker push decentral1se/pubspace
|
||||||
|
|
|
@ -53,12 +53,13 @@ def create_share(fpath):
|
||||||
async def home(request: Request):
|
async def home(request: Request):
|
||||||
try:
|
try:
|
||||||
payload = await request.json()
|
payload = await request.json()
|
||||||
|
request.app.state.log.info(f"Received: {payload}")
|
||||||
file = payload["file"]
|
file = payload["file"]
|
||||||
link = create_share(file)
|
link = create_share(file)
|
||||||
if link:
|
if link:
|
||||||
app.state.log(f"Shared {file} on {link}")
|
request.app.state.log.info(f"Shared {file} on {link}")
|
||||||
else:
|
else:
|
||||||
app.state.log(f"{file} has already been shared!")
|
request.app.state.log.info(f"{file} already shared or failure!")
|
||||||
except Exception:
|
except Exception:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
Reference in New Issue