Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
16c2c8e386
|
|||
|
aeeeebd3da
|
|||
|
2134eed508
|
@@ -32,13 +32,13 @@ jobs:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_USER }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
build-args: |
|
||||
VERSION=${{env.TAG}}
|
||||
version=${{env.TAG}}
|
||||
tags: |
|
||||
${{secrets.DOCKER_REGISTRY}}/${{env.IMAGE}}:${{env.TAG}}
|
||||
${{secrets.DOCKER_REGISTRY}}/${{env.IMAGE}}:latest
|
||||
|
||||
@@ -6,6 +6,7 @@ COPY ./app /code/app
|
||||
COPY ./log_config.yml /code/log_config.yml
|
||||
ARG version
|
||||
ENV VERSION=${version}
|
||||
RUN echo "Build Version: $VERSION"
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD wget --spider --quiet --tries=1 --timeout=5 --server-response http://127.0.0.1:8000/health 2>&1 | grep "200 OK" > /dev/null
|
||||
CMD ["uvicorn", "main:app", "--app-dir", "app", "--log-config", "log_config.yml", "--host","0.0.0.0", "--port", "8000"]
|
||||
@@ -18,12 +18,17 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
@router.get("/generate", summary="Embeddable Mastodon Feed")
|
||||
async def generate_static_page(settings: Annotated[Settings, Depends(get_settings)]):
|
||||
mastodon_token = settings.feeds['embed']['token']
|
||||
|
||||
mastodon_server = settings.mastodon_server
|
||||
mastodon_aid = settings.feeds['embed']['account_id']
|
||||
mastodon_token = str(settings.feeds['embed']['token'])
|
||||
mastodon_get_statuses_url=f'{mastodon_server}/api/v1/accounts/{mastodon_aid}/statuses'
|
||||
|
||||
s3_bucket = settings.feeds['embed']['s3_bucket']
|
||||
s3_filename = settings.feeds['embed']['s3_key']
|
||||
mastodon_get_statuses_url=settings.feeds['embed']['url']
|
||||
|
||||
try:
|
||||
latest_statuses = load_latest_statuses(mastodon_get_statuses_url, mastodon_token,20)
|
||||
latest_statuses = load_latest_statuses(mastodon_get_statuses_url, mastodon_token, 20)
|
||||
latest_statuses = [status for status in latest_statuses if status['in_reply_to_id'] == None]
|
||||
latest_statuses = [status for status in latest_statuses if status['in_reply_to_account_id'] == None]
|
||||
latest_statuses = [status for status in latest_statuses if status['reblog'] == None]
|
||||
|
||||
Reference in New Issue
Block a user