Compare commits
2 Commits
5b4fe5fc54
...
b61342b576
Author | SHA1 | Date |
---|---|---|
decentral1se | b61342b576 | |
decentral1se | 0aa5c1b625 |
|
@ -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
|
||||
|
|
2
makefile
2
makefile
|
@ -12,5 +12,5 @@ run:
|
|||
build:
|
||||
@docker build -t decentral1se/pubspace .
|
||||
|
||||
push:
|
||||
push: build
|
||||
@docker push decentral1se/pubspace
|
||||
|
|
|
@ -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 {}
|
||||
|
||||
|
|
Reference in New Issue