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

Can't upload images #2475

Closed
rosquillas opened this issue Sep 30, 2022 · 3 comments
Closed

Can't upload images #2475

rosquillas opened this issue Sep 30, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@rosquillas
Copy link

Trying to post an image returns this error

"SyntaxError: Unexpected token 'i', "images_disabled" is not valid JSON"

Not sure where to fix

@rosquillas rosquillas added the bug Something isn't working label Sep 30, 2022
@dessalines
Copy link
Member

How did you install lemmy?

Post your docker-compose.yml and lemmy.hjson config.

Its almost certainly the pictrs config block, it changed in the main branch and is broken for current releases.

Use the example for the pictrs block here: https://join-lemmy.org/docs/en/administration/configuration.html

@rosquillas
Copy link
Author

rosquillas commented Oct 4, 2022

We've installed it with docker, here are my files

`Config file:

{

for more info about the config, check out the documentation

https://join-lemmy.org/docs/en/administration/configuration.html

setup: {
# username for the admin user
admin_username: "......."
# password for the admin user
admin_password: "..........."
# name of the site (can be changed later)
site_name: "lemmy-lab"
}

opentelemetry_url: "http://otel:4137/"

the domain name of your instance (eg "lemmy.ml")

hostname: "lemmy.***.com"

address where lemmy should listen for incoming requests

bind: "0.0.0.0"

port where lemmy should listen for incoming requests

port: 8536

settings related to the postgresql database

pictrs_config: {
pictrs_url: "http://localhost:8080/"
}
database: {
# name of the postgres database for lemmy
database: "lemmy"
# username to connect to postgres
user: "*****"
# password to connect to postgres
password: "*******"
# host where postgres is running
host: "postgres"
# port where postgres can be accessed
port: 5432
# maximum number of active sql connections
pool_size: 5
}
slur_filter:
'''
(fag(g|got|tard)?\b|cock\s?sucker(s|ing)?|ni((g{2,}|q)+|[gq]{2,})[e3r]+(s|z)?|mudslime?s?|kikes?|\bspi(c|k)s?\b|\bchinks?|gooks?|bitch(es|ing|y)?|whor(es?|ing)|\btr(a|@)nn?(y|ies?)|\b(b|re|r)tard(ed)?s?)
'''

# optional: email sending configuration

email: {

# hostname and port of the smtp server

smtp_server: ""

# login name for smtp server

smtp_login: ""

# password to login to the smtp server

smtp_password: ""

# address to send emails from, eg "noreply@your-instance.com"

smtp_from_address: ""

# whether or not smtp connections should use tls

use_tls: true

}

}

docker_compose.yaml

version: '2.2'

services:
postgres:
image: postgres:14-alpine
environment:
- POSTGRES_USER=******
- POSTGRES_PASSWORD=*****
- POSTGRES_DB=*****
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
restart: always

lemmy:
image: dessalines/lemmy:0.16.7-rc.2
ports:
- "127.0.0.1:8536:8536"
- "127.0.0.1:6669:6669"
restart: always
environment:
- RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy_apub=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_actor=info,lemmy_db_views_moderator=info,lemmy_routes=info,lemmy_utils=info,lemmy_websocket=info"
volumes:
- ./lemmy.hjson:/config/config.hjson
depends_on:
- postgres
- pictrs

lemmy-ui:
image: dessalines/lemmy-ui:0.16.7-rc.2
ports:
- "127.0.0.1:1235:1234"
restart: always
environment:
- LEMMY_INTERNAL_HOST=lemmy:8536
- LEMMY_EXTERNAL_HOST=localhost:8536
- LEMMY_HTTPS=true
depends_on:
- lemmy

pictrs:
image: asonix/pictrs:0.3.1
ports:
- "127.0.0.1:8537:8080"
- "127.0.0.1:6670:6669"
user: 991:991
volumes:
- ./volumes/pictrs:/mnt
restart: always
environment:
- PICTRS__API_KEY=string
`

@dessalines
Copy link
Member

Yep, your pictrs block is wrong. Check my instructions above.

@Nutomic Nutomic closed this as completed Jan 16, 2023
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