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

Warning about default_phone_region #1544

Closed
Nico83500 opened this issue Jul 22, 2021 · 7 comments
Closed

Warning about default_phone_region #1544

Nico83500 opened this issue Jul 22, 2021 · 7 comments

Comments

@Nico83500
Copy link

Nico83500 commented Jul 22, 2021

Hi,
I just create a Docker instance for Nextcloud and I get a warning about default_phone_region.
I'm French and I must edit the data/config/config.php file to add :
'force_language' => 'fr',
'default_locale' => 'fr_FR',
'force_locale' => 'fr_FR',
'default_language' => 'fr',
'default_phone_region' => 'FR',
Is it possible to configure it without editing config.php ? Could you add an environment variable to configure it ?
Thank you !

@sitarane
Copy link

Duplicate of #1465

@noizo
Copy link

noizo commented Jan 29, 2022

Not exacly a variable, but i managed to do some tricks in entrypoint section.
Now i have All checks passed just after launching nextcloud.
Here it's nexcloud with traefik, but entryoint is not related to traefik at all.

    nextcloud-app:
        image: nextcloud:latest
        entrypoint: sh -c "apt update && apt upgrade -y && apt install --no-install-recommends -y libmagickcore-6.q16-6-extra && runuser -u www-data -- php occ config:system:set default_phone_region --type string --value="PL" && echo "expose_php=Off" >> /usr/local/etc/php/conf.d/nextcloud.ini && /entrypoint.sh apache2-foreground"
        container_name: nextcloud-app
        restart: always
        depends_on:
            - nextcloud-db
            - nextcloud-redis
        environment:
            - REDIS_HOST=nextcloud-redis
            - REDIS_HOST_PASSWORD=test # REPLACE WITH REDIS PASSWORD
            - MYSQL_HOST=nextcloud-db
            - MYSQL_USER=nextcloud # MYSQL USERNAME
            - MYSQL_PASSWORD=test # PASSWORD OF MYSQL USER
            - MYSQL_DATABASE=nextcloud # MYSQL DATABASE
            - NEXTCLOUD_TRUSTED_DOMAINS=cloud.domain.com
            - OVERWRITEHOST=cloud.domain.com
            - OVERWRITEPROTOCOL=https
            - OVERWRITECLIURL=https://cloud.ndomian.com
            - TRUSTED_PROXIES=172.22.0.0/24
            - APACHE_DISABLE_REWRITE_IP=1
        volumes:
            - ./nextcloud:/var/www/html
        labels:
            - "traefik.enable=true"
            - "traefik.docker.network=proxy"
            - "traefik.http.middlewares.nextcloud-https.redirectscheme.scheme=https"
            - "traefik.http.routers.nextcloud-http.entrypoints=http"
            - "traefik.http.routers.nextcloud-http.rule=Host(`cloud.domain.com`)"
            - "traefik.http.routers.nextcloud-http.middlewares=nextcloud-https@docker"
            - "traefik.http.routers.nextcloud.entrypoints=https"
            - "traefik.http.routers.nextcloud.rule=Host(`cloud.domain.com`)"
            - "traefik.http.routers.nextcloud.tls=true"
            - "traefik.http.routers.nextcloud.middlewares=nextcloud-dav,secHeaders@file"
            - "traefik.http.services.nextcloud.loadbalancer.server.port=80"
            - "traefik.http.middlewares.nextcloud-dav.replacepathregex.regex=^/.well-known/ca(l|rd)dav"
            - "traefik.http.middlewares.nextcloud-dav.replacepathregex.replacement=/remote.php/dav/"
        networks:
            - proxy
            - default

runuser -u www-data -- php occ config:system:set default_phone_region --type string --value="PL" is essentially what You need to set that up.

@kosssi
Copy link

kosssi commented Jan 3, 2023

This issue can be close, you can configure all variables like this :

      NC_force_language: fr
      NC_default_locale: fr_FR
      NC_force_locale: fr_FR
      NC_default_language: fr
      NC_default_phone_region: fr

You can see the discussion, the MR and code.

@J0WI
Copy link
Contributor

J0WI commented Apr 4, 2023

Duplicate of #1465

@J0WI J0WI marked this as a duplicate of #1465 Apr 4, 2023
@J0WI J0WI closed this as completed Apr 4, 2023
@loganmarchione
Copy link

Are we sure this works? I'm putting this in my docker compose file and it's not setting these in my config.php...

version: '3'
services:
  nextcloud:
    container_name: nextcloud
    image: nextcloud:26.0.2-apache
    restart: unless-stopped
    environment:
      - NC_force_language="fr"
      - NC_default_locale="fr_FR"
      - NC_force_locale="fr_FR"
      - NC_default_language="fr"
      - NC_default_phone_region="fr"
...
...
...

@J0WI
Copy link
Contributor

J0WI commented Jun 22, 2023

Environment variables are not written into config.php. These are runtime settings that overwrite config.php.

@loganmarchione
Copy link

@J0WI wow that makes sense why I'm not seeing it. Thanks for the reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants