Skip to content

Conversation

@alexlambson
Copy link
Collaborator

@alexlambson alexlambson commented Aug 24, 2025

  • rename an endpoint
  • fix the model for screenshot uploads.

TODO:

  • map serializer return link for most recent image and all images
  • map serializer return mapfile links
  • better file validation using serializer.
  • endpoint for map image file uploads
  • file edit endpoint to allow renaming and reordering images
  • file delete endpoint for non-map files.
  • Tests for map image upload endpoint
  • Make a way to ban images
  • hide images unless map.is_published
  • Make Bannable abstract model.
  • Remove the extra hash fields from the file base object moved to kanban
  • Make a base file serializer, then dry up the mapfile and image serializers
  • Make sure image uploads are indeed images in the file serializer. Check file size etc
  • Maybe switch to https://docs.djangoproject.com/en/5.2/ref/models/fields/#imagefield
  • Make sure to set the user on the file model for file uploads
  • escape all text fields moved to kanban

After merging

  • Make sure database is persisting after the postgres upgrade.

- rename an endpoint
- fix the model for screenshot uploads.

TODO:

- [] map serializer return link for most recent image and all images
- [] map serializer return mapfile links
@alexlambson alexlambson self-assigned this Aug 24, 2025
- Add map images to the map serializer.
- Test map images return
- Add user_id to file upload model
- Some documentation
- Stole the file extension getter from the map upload
- Add todos for tomorrow. Going to need `BannableObject` sooner rather than later due to circular imports.
- use user id in `CanEdit` to save a query
- Add the map image upload endpoint
- fixed issues found via tests
- disallow uploads for banned maps, temporary maps, and legacy maps
- Test file size checks
- modify uploaded files to convert to jpeg, slightly shrink, and remove exif
- add the cnc_user_id to uploaded files
- make moderabile object
- Fix circular imports with file extensions
- Fix broken 0002 migration due to the object manager not using the correct schema state
- move image uploading to its own file
- Add `/maps/img/id` edit endpoint
- Add `editable_fields` to serializers, which allows for fields to be set during creation, but never allowed to be updated.

# Configurable user setup
ENV USER=cncnet
ENV UID=1000
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing issues on machines where the user ID of the host didn't match

alias /usr/share/nginx/html/static/; # The nginx container's mounted volume.
expires 30d;
add_header Cache-Control public;
include /etc/nginx/mime.types;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed to serve files

from kirovy.models import CncUser


class Moderabile(models.Model):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is a word

@alexlambson alexlambson merged commit 9152a31 into main Nov 7, 2025
1 check passed
@alexlambson alexlambson deleted the alex/feat/map-screenshots branch November 7, 2025 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants