Skip to content

Set LibreCode logo as the default admin avatar #127

Description

@vitormattos

Description

Set the LibreCode logo as the default avatar for the Nextcloud admin user.

We can use this image:

https://github.com/LibreCodeCoop/site/blob/main/source/assets/images/logo/librecode_author.jpg

The image should be added to this repository, so the setup does not need to download it from another repository every time the environment is created.

A possible location is:

.docker/assets/librecode_author.jpg

The avatar should be configured in:

.docker/scripts/nextcloud-entrypoint.sh

It would be good to create a small function for this task, following the same style used for other setup steps in the entrypoint.

The Nextcloud avatar API can be used to upload the image. For example:

BASE_URL="https://dev.localhost"
USERNAME="admin"
PASSWORD="admin"
IMAGE_PATH="avatar.png"

curl --fail-with-body --silent --show-error \
  --user "${USERNAME}:${PASSWORD}" \
  --request POST \
  --header "Accept: application/json" \
  --header "OCS-APIRequest: true" \
  --form "files[]=@${IMAGE_PATH};type=image/png" \
  "${BASE_URL}/ocs/v2.php/avatar/${USERNAME}"

The implementation should use the existing Nextcloud admin configuration, such as NEXTCLOUD_ADMIN_USER and NEXTCLOUD_ADMIN_PASSWORD, instead of hardcoded credentials.

Expected result

After creating a new development environment, the admin user should have the LibreCode logo as its avatar without any manual setup.

Good first issue

This is a good first issue for contributors who want to learn how the LibreSign development environment is prepared and how Nextcloud can be configured during setup.

The change is small and focused, and most of the work is inside the Nextcloud entrypoint script.

Additional context

  • If you have questions, feel free to ask in this issue.
  • Give a ⭐️ star to this repository if you find LibreSign useful and would like to support the project.
  • You can also join our community: https://t.me/LibreSign

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dockerPull requests that update Docker codeenhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions