Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Default config is not accepted #5462

Closed
5 tasks done
dlukt opened this issue Feb 27, 2025 · 3 comments
Closed
5 tasks done

[Bug]: Default config is not accepted #5462

dlukt opened this issue Feb 27, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@dlukt
Copy link

dlukt commented Feb 27, 2025

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Do you agree to follow the rules in our Code of Conduct?
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

lemmy_server[240919]: thread 'main' panicked at crates/utils/src/settings/mod.rs:22:22:
lemmy_server[240919]: Failed to load settings file, see documentation (https://join-lemmy.org/docs/en/administration/configuration.html).: 
LemmyError { message: Unknown("\"unknown field `max_avatar_size`, expected one of `url`, `api_key`, `cache_external_link_previews`, `image_mode`, `proxy_bypass_domain
s`, `upload_timeout`, `max_thumbnail_size`\" near 40:20"), inner: "unknown field `max_avatar_size`, expected one of `url`, `api_key`, `cache_external_link_previews`, 
`image_mode`, `proxy_bypass_domains`, `upload_timeout`, `max_thumbnail_size`" near 40:20, context: SpanTrace [] }

max_avatar_size,max_banner_size,image_upload_disabled are not accepted.

Likewise,

  cors_origin: ["forum.goeppingen.social"]

results in

LemmyError { message: Unknown("UnexpectedChar at 85:16 at \"[\\\"forum.goeppin\""), inner: UnexpectedChar at 85:16 at "[\"forum.goeppin", context: SpanTrace [] }

Steps to Reproduce

run lemmy with the modified default config file, found at https://github.com/LemmyNet/lemmy/blob/main/config/defaults.hjson referenced at https://join-lemmy.org/docs/administration/from_scratch.html

in particular have this set

  pictrs: {
    # Address where pictrs is available (for image hosting)
    url: "http://localhost:8080/"
    # Set a custom pictrs API key. ( Required for deleting images )
    api_key: "some key"
    # Specifies how to handle remote images, so that users don't have to connect directly to remote
    # servers.
    image_mode: "ProxyAllImages"
    # Allows bypassing proxy for specific image hosts when using ProxyAllImages.
    # 
    # imgur.com is bypassed by default to avoid rate limit errors. When specifying any bypass
    # in the config, this default is ignored and you need to list imgur explicitly. To proxy imgur
    # requests, specify a noop bypass list, eg `proxy_bypass_domains ["example.org"]`.
    proxy_bypass_domains: [
      "i.imgur.com"
      /* ... */
    ]
    # Timeout for uploading images to pictrs (in seconds)
    upload_timeout: 30
    # Resize post thumbnails to this maximum width/height.
    max_thumbnail_size: 512
    # Maximum size for user avatar, community icon and site icon.
    max_avatar_size: 512
    # Maximum size for user, community and site banner. Larger images are downscaled to fit
    # into a square of this size.
    max_banner_size: 1024
    # Prevent users from uploading images for posts or embedding in markdown. Avatars, icons and
    # banners can still be uploaded.
    image_upload_disabled: false
  }

Technical Details

Gentoo amd64

Version

0.19.9

Lemmy Instance URL

No response

@dlukt dlukt added the bug Something isn't working label Feb 27, 2025
@dessalines
Copy link
Member

dessalines commented Feb 27, 2025

The config in main is very different from the config for release/v0.19 .

@Nutomic lemmy-docs, just like joinlemmy-site, should be using gitmodules to be able to include the correct config file from a given release branch, and not the one from main, which is bound to be broken much of the time.

You have a update-includes.sh script, but it should really be replaced with gitmodules.

@dlukt
Copy link
Author

dlukt commented Feb 27, 2025

Thank you, close at your own will

@dessalines dessalines closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2025
@Nutomic
Copy link
Member

Nutomic commented Feb 28, 2025

Fixed the config shown in documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants