2017-04-15 23:16:20 +02:00
< ? php
2022-02-11 17:46:40 +01:00
// Settings can also be overwritten in two ways:
2020-10-17 11:03:47 +02:00
//
2022-02-11 17:46:40 +01:00
// First priority:
2020-10-17 11:03:47 +02:00
// A .txt file with the same name as the setting in /data/settingoverrides
// the content of the file is used as the setting value
//
2022-02-11 17:46:40 +01:00
// Second priority:
2020-10-17 11:03:47 +02:00
// An environment variable with the same name as the setting and prefix "GROCY_"
// so for example "GROCY_BASE_URL"
//
2022-02-11 17:46:40 +01:00
// Third priority:
2020-10-17 11:03:47 +02:00
// The settings defined here below
// Either "production", "dev", "demo" or "prerelease"
2023-08-02 21:10:03 +02:00
// When not "production", the application will work in a demo mode which means
// authentication is disabled and some demo data will be generated during the database schema migration
// (pass the query parameter "nodemodata", e.g. https://grocy.example.com/?nodemodata to skip that)
2018-07-12 19:12:31 +02:00
Setting ( 'MODE' , 'production' );
2018-04-18 19:03:39 +02:00
2022-02-11 17:46:40 +01:00
// The directory name of one of the available localization folders
// in the "/localization" directory (e.g. "en" or "de")
2020-08-31 19:11:51 +02:00
Setting ( 'DEFAULT_LOCALE' , 'en' );
2018-04-18 19:03:39 +02:00
2022-02-11 17:46:40 +01:00
// This is used to define the first day of a week for calendar views,
2020-10-17 11:03:47 +02:00
// leave empty to use the locale default
// Needs to be a number where Sunday = 0, Monday = 1 and so forth
2019-07-06 20:19:21 +02:00
Setting ( 'CALENDAR_FIRST_DAY_OF_WEEK' , '' );
2020-10-17 11:03:47 +02:00
// If calendars should show week numbers
2019-09-18 18:30:25 +02:00
Setting ( 'CALENDAR_SHOW_WEEK_OF_YEAR' , true );
2022-02-11 17:46:40 +01:00
// Set this if you want to have a different start day for the weekly meal plan view,
// leave empty to use CALENDAR_FIRST_DAY_OF_WEEK (see above)
// Needs to be a number where Sunday = 0, Monday = 1 and so forth
2023-05-01 14:49:02 +02:00
// Can also be set to -1 to dynamically start the meal plan week on "today"
2022-02-11 17:46:40 +01:00
Setting ( 'MEAL_PLAN_FIRST_DAY_OF_WEEK' , '' );
2023-05-19 18:08:26 +02:00
// To keep it simple: Grocy does not handle any currency conversions,
2020-10-17 11:03:47 +02:00
// this here is used to format all money values,
2022-02-11 17:46:40 +01:00
// so doesn't really matter, but needs to be the
2020-10-17 11:03:47 +02:00
// ISO 4217 code of the currency ("USD", "EUR", "GBP", etc.)
2019-03-09 16:04:03 +01:00
Setting ( 'CURRENCY' , 'USD' );
2018-07-26 20:27:38 +02:00
2023-02-05 15:55:45 +01:00
// Your preferred unit for energy
// E.g. "kcal" or "kJ" or something else (doesn't really matter, it's only used to display energy values)
Setting ( 'ENERGY_UNIT' , 'kcal' );
2023-05-19 18:08:26 +02:00
// When running Grocy in a subdirectory, this should be set to the relative path, otherwise empty
2022-02-11 17:46:40 +01:00
// It needs to be set to the part (of the URL) AFTER the document root,
2020-12-19 15:00:31 +01:00
// if URL rewriting is disabled, including index.php
// Example with URL Rewriting support:
// Root URL = https://example.com/grocy
2020-10-17 11:03:47 +02:00
// => BASE_PATH = /grocy
2020-12-19 15:00:31 +01:00
// Example without URL Rewriting support:
// Root URL = https://example.com/grocy/public/index.php/
// => BASE_PATH = /grocy/public/index.php
2020-03-06 20:41:00 +01:00
Setting ( 'BASE_PATH' , '' );
2020-12-19 15:00:31 +01:00
// The base URL of your installation,
2020-10-17 11:03:47 +02:00
// should be just "/" when running directly under the root of a (sub)domain
// or for example "https://example.com/grocy" when using a subdirectory
2018-07-12 19:12:31 +02:00
Setting ( 'BASE_URL' , '/' );
2018-04-22 19:47:46 +02:00
2020-10-17 11:03:47 +02:00
// The plugin to use for external barcode lookups,
2025-01-12 13:58:47 +01:00
// must be the filename (folder "/plugins" for built-in plugins or "/data/plugins" for user plugins) without the .php extension,
// see /plugins/DemoBarcodeLookupPlugin.php for a commented example implementation
// Leave empty to disable external barcode lookups
2025-01-11 20:04:32 +01:00
Setting ( 'STOCK_BARCODE_LOOKUP_PLUGIN' , 'OpenFoodFactsBarcodeLookupPlugin' );
2018-06-15 20:50:40 +02:00
2020-10-17 11:03:47 +02:00
// If, however, your webserver does not support URL rewriting, set this to true
2018-07-12 19:12:31 +02:00
Setting ( 'DISABLE_URL_REWRITING' , false );
2018-09-30 17:14:04 +02:00
2022-02-11 17:46:40 +01:00
// Specify an custom homepage if desired, by default the homepage will be set to the stock overview page
// This needs to be one of the following values:
2020-10-17 11:03:47 +02:00
// stock, shoppinglist, recipes, chores, tasks, batteries, equipment, calendar, mealplan
2019-06-22 16:02:52 +02:00
Setting ( 'ENTRY_PAGE' , 'stock' );
2019-03-01 19:33:33 +01:00
2020-10-17 11:03:47 +02:00
// Set this to true if you want to disable authentication / the login screen,
// places where user context is needed will then use the default (first existing) user
2019-07-06 18:29:18 +02:00
Setting ( 'DISABLE_AUTH' , false );
2020-10-17 11:03:47 +02:00
// Either "Grocy\Middleware\DefaultAuthMiddleware", "Grocy\Middleware\ReverseProxyAuthMiddleware"
// or any class that implements Grocy\Middleware\AuthMiddleware
2020-08-19 19:23:13 +02:00
Setting ( 'AUTH_CLASS' , 'Grocy\Middleware\DefaultAuthMiddleware' );
2022-02-11 17:46:40 +01:00
// Options when using ReverseProxyAuthMiddleware
Setting ( 'REVERSE_PROXY_AUTH_HEADER' , 'REMOTE_USER' ); // The name of the HTTP header which your reverse proxy uses to pass the username (on successful authentication)
Setting ( 'REVERSE_PROXY_AUTH_USE_ENV' , false ); // Set to true if the username is passed as environment variable
2020-08-19 19:23:13 +02:00
2022-02-11 17:46:40 +01:00
// Options when using LdapAuthMiddleware
2020-10-20 21:43:58 +02:00
Setting ( 'LDAP_ADDRESS' , '' ); // Example value "ldap://vm-dc2019.local.berrnd.net"
2021-06-20 19:22:18 +08:00
Setting ( 'LDAP_BASE_DN' , '' ); // Example value "DC=local,DC=berrnd,DC=net"
Setting ( 'LDAP_BIND_DN' , '' ); // Example value "CN=grocy_bind_account,OU=service_accounts,DC=local,DC=berrnd,DC=net"
Setting ( 'LDAP_BIND_PW' , '' ); // Password for the above account
Setting ( 'LDAP_USER_FILTER' , '' ); // Example value "(OU=grocy_users)"
2021-07-11 10:34:46 +02:00
Setting ( 'LDAP_UID_ATTR' , '' ); // Windows AD: "sAMAccountName", OpenLDAP: "uid", GLAuth: "cn"
2020-10-20 21:43:58 +02:00
2020-10-17 11:03:47 +02:00
// Default permissions for new users
// the array needs to contain the technical/constant names
2022-02-11 17:46:40 +01:00
// See the file controllers/Users/User.php for possible values
2020-08-29 12:05:32 +02:00
Setting ( 'DEFAULT_PERMISSIONS' , [ 'ADMIN' ]);
2022-02-11 17:46:40 +01:00
// "1D" (=> Code128) or "2D" (=> DataMatrix)
2025-03-21 17:49:31 +01:00
Setting ( 'GROCYCODE_TYPE' , '2D' );
2021-07-11 10:34:46 +02:00
2022-02-11 17:46:40 +01:00
2021-07-11 10:34:46 +02:00
// Label printer settings
2023-05-19 18:08:26 +02:00
Setting ( 'LABEL_PRINTER_WEBHOOK' , '' ); // The URI that Grocy will POST to when asked to print a label
2022-02-11 17:46:40 +01:00
Setting ( 'LABEL_PRINTER_RUN_SERVER' , true ); // Whether the webhook will be called server- or client-side
Setting ( 'LABEL_PRINTER_PARAMS' , [ 'font_family' => 'Source Sans Pro (Regular)' ]); // Additional parameters supplied to the webhook
2025-03-21 16:40:56 +01:00
Setting ( 'LABEL_PRINTER_HOOK_JSON' , true ); // TRUE to use JSON or FALSE to use normal POST request variables
2022-02-11 17:46:40 +01:00
2021-06-18 20:45:42 +02:00
2021-07-11 10:34:46 +02:00
// Thermal printer options
// Thermal printers are receipt printers, not regular printers,
// the printer must support the ESC/POS protocol, see https://github.com/mike42/escpos-php
2022-02-11 17:46:40 +01:00
Setting ( 'TPRINTER_IS_NETWORK_PRINTER' , false ); // Set to true if it's a network printer
2021-07-11 10:34:46 +02:00
Setting ( 'TPRINTER_PRINT_QUANTITY_NAME' , true ); // Set to false if you do not want to print the quantity names (related to the shopping list)
Setting ( 'TPRINTER_PRINT_NOTES' , true ); // Set to false if you do not want to print notes (related to the shopping list)
Setting ( 'TPRINTER_IP' , '127.0.0.1' ); // IP of the network printer (does only matter if it's a network printer)
2022-02-11 17:46:40 +01:00
Setting ( 'TPRINTER_PORT' , 9100 ); // Port of the network printer (does only matter if it's a network printer)
2021-07-11 10:34:46 +02:00
Setting ( 'TPRINTER_CONNECTOR' , '/dev/usb/lp0' ); // Printer device (does only matter if you use a locally attached printer)
// For USB on Linux this is often '/dev/usb/lp0', for serial printers it could be similar to '/dev/ttyS0'
// Make sure that the user that runs the webserver has permissions to write to the printer - on Linux add your webserver user to the LP group with usermod -a -G lp www-data
2021-06-18 20:45:42 +02:00
2022-02-11 17:46:40 +01:00
// Feature flags
// Here you can disable the parts which you don't need to have a less cluttered UI
// (set the setting to "false" to disable the corresponding part, which should be self explanatory)
Setting ( 'FEATURE_FLAG_STOCK' , true );
Setting ( 'FEATURE_FLAG_SHOPPINGLIST' , true );
Setting ( 'FEATURE_FLAG_RECIPES' , true );
Setting ( 'FEATURE_FLAG_CHORES' , true );
Setting ( 'FEATURE_FLAG_TASKS' , true );
Setting ( 'FEATURE_FLAG_BATTERIES' , true );
Setting ( 'FEATURE_FLAG_EQUIPMENT' , true );
Setting ( 'FEATURE_FLAG_CALENDAR' , true );
Setting ( 'FEATURE_FLAG_LABEL_PRINTER' , false );
// Sub feature flags
Setting ( 'FEATURE_FLAG_STOCK_PRICE_TRACKING' , true );
Setting ( 'FEATURE_FLAG_STOCK_LOCATION_TRACKING' , true );
Setting ( 'FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING' , true );
Setting ( 'FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING' , true );
Setting ( 'FEATURE_FLAG_STOCK_PRODUCT_FREEZING' , true );
Setting ( 'FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD' , true ); // Activate the number pad in due date fields on (supported) mobile browsers
Setting ( 'FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS' , true );
2023-02-05 15:06:59 +01:00
Setting ( 'FEATURE_FLAG_RECIPES_MEALPLAN' , true );
2022-02-11 17:46:40 +01:00
Setting ( 'FEATURE_FLAG_CHORES_ASSIGNMENTS' , true );
Setting ( 'FEATURE_FLAG_THERMAL_PRINTER' , false );
// Feature settings
2022-02-11 18:18:17 +01:00
Setting ( 'FEATURE_FLAG_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING' , false ); // Set this to true if you want to disable the ability to scan a barcode via the device camera (Browser API)
2022-02-11 17:46:40 +01:00
Setting ( 'FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA' , true ); // Enables the torch automatically (if the device has one)
2020-10-17 11:03:47 +02:00
// Default user settings
2022-04-03 13:00:14 +02:00
// These settings can be changed per user and via the UI,
// below are the defaults which are used when the user has not changed the setting so far
2019-09-19 17:46:52 +02:00
2020-10-17 11:03:47 +02:00
// Night mode related
2022-04-02 19:26:55 +02:00
DefaultUserSetting ( 'night_mode' , 'follow-system' ); // "on" = Night mode is always on ; "off" = Night mode is always off / "follow-system" = System preferred color schema is used
2018-09-30 17:14:04 +02:00
DefaultUserSetting ( 'auto_night_mode_enabled' , false ); // If night mode is enabled automatically when inside a given time range (see the two settings below)
2020-10-17 11:03:47 +02:00
DefaultUserSetting ( 'auto_night_mode_time_range_from' , '20:00' ); // Format HH:mm
DefaultUserSetting ( 'auto_night_mode_time_range_to' , '07:00' ); // Format HH:mm
2018-09-30 18:02:59 +02:00
DefaultUserSetting ( 'auto_night_mode_time_range_goes_over_midnight' , true ); // If the time range above goes over midnight
2022-04-05 18:18:38 +02:00
DefaultUserSetting ( 'night_mode_enabled_internal' , false ); // Internal setting if night mode is actually enabled (based on the other settings)
2019-04-20 15:30:45 +02:00
2022-02-11 17:46:40 +01:00
// Generic settings
DefaultUserSetting ( 'auto_reload_on_db_change' , false ); // If the page should be automatically reloaded when there was an external change
DefaultUserSetting ( 'show_clock_in_header' , false ); // Show a clock in the header next to the logo or not
DefaultUserSetting ( 'keep_screen_on' , false ); // If the screen should always be kept on
DefaultUserSetting ( 'keep_screen_on_when_fullscreen_card' , false ); // If the screen should be kept on when a "fullscreen-card" is displayed
2020-01-05 10:03:02 +01:00
2020-10-17 11:03:47 +02:00
// Stock settings
2018-10-20 14:55:49 +02:00
DefaultUserSetting ( 'product_presets_location_id' , - 1 ); // Default location id for new products (-1 means no location is preset)
DefaultUserSetting ( 'product_presets_product_group_id' , - 1 ); // Default product group id for new products (-1 means no product group is preset)
DefaultUserSetting ( 'product_presets_qu_id' , - 1 ); // Default quantity unit id for new products (-1 means no quantity unit is preset)
2021-11-13 17:05:23 +01:00
DefaultUserSetting ( 'product_presets_default_due_days' , 0 ); // Default due days for new products (-1 means that the product will be never overdue)
2022-02-07 19:12:31 +01:00
DefaultUserSetting ( 'product_presets_treat_opened_as_out_of_stock' , true ); // Default "Treat opened as out of stock" option for new products
2025-01-15 20:34:53 +01:00
DefaultUserSetting ( 'product_presets_default_stock_label_type' , 0 ); // "Default stock entry label" option for new products (0 = No label, 1 = Single Label, 2 = Label per unit)
2020-10-20 13:08:54 -05:00
DefaultUserSetting ( 'stock_decimal_places_amounts' , 4 ); // Default decimal places allowed for amounts
2022-06-04 14:09:35 +02:00
DefaultUserSetting ( 'stock_decimal_places_prices_input' , 2 ); // Default decimal places allowed for prices (input)
DefaultUserSetting ( 'stock_decimal_places_prices_display' , 2 ); // Default decimal places allowed for prices (display)
2022-02-11 17:46:40 +01:00
DefaultUserSetting ( 'stock_auto_decimal_separator_prices' , false ); // If the decimal separator should be set automatically for amount inputs
DefaultUserSetting ( 'stock_due_soon_days' , 5 ); // The "expiring soon" days
DefaultUserSetting ( 'stock_default_purchase_amount' , 0 ); // The default amount prefilled on the purchase page
DefaultUserSetting ( 'stock_default_consume_amount' , 1 ); // The default amount prefilled on the consume page
DefaultUserSetting ( 'stock_default_consume_amount_use_quick_consume_amount' , false ); // If the products quick consume amount should be prefilled on the consume page
DefaultUserSetting ( 'scan_mode_consume_enabled' , false ); // If scan mode on the consume page is enabled
DefaultUserSetting ( 'scan_mode_purchase_enabled' , false ); // If scan mode on the purchase page is enabled
DefaultUserSetting ( 'show_icon_on_stock_overview_page_when_product_is_on_shopping_list' , true ); // When enabled, an icon is shown on the stock overview page (next to the product name) when the prodcut is currently on a shopping list
2025-01-18 10:33:26 +01:00
DefaultUserSetting ( 'stock_overview_show_all_out_of_stock_products' , false ); // By default the stock overview page lists all products which are currently in stock or below their min. stock amount - when this is enabled, all (active) products are always shown
2021-03-31 21:12:51 +01:00
DefaultUserSetting ( 'show_purchased_date_on_purchase' , false ); // Whether the purchased date should be editable on purchase (defaults to today otherwise)
2020-11-15 19:53:44 +01:00
DefaultUserSetting ( 'show_warning_on_purchase_when_due_date_is_earlier_than_next' , true ); // Show a warning on purchase when the due date of the purchased product is earlier than the next due date in stock
2019-04-20 15:30:45 +02:00
2020-10-17 11:03:47 +02:00
// Shopping list settings
2020-11-15 19:53:44 +01:00
DefaultUserSetting ( 'shopping_list_to_stock_workflow_auto_submit_when_prefilled' , false ); // Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default due days" set
2022-02-11 17:46:40 +01:00
DefaultUserSetting ( 'shopping_list_show_calendar' , false ); // When enabled, a small (month view) calendar will be shown on the shopping list page
2025-01-19 20:16:37 +01:00
DefaultUserSetting ( 'shopping_list_round_up' , false ); // When enabled, all quantity amounts on the shopping list are always displayed rounded up to the nearest whole number
2022-04-07 19:25:27 +02:00
DefaultUserSetting ( 'shopping_list_auto_add_below_min_stock_amount' , false ); // If products should be automatically added to the shopping list when they are below their min. stock amount
DefaultUserSetting ( 'shopping_list_auto_add_below_min_stock_amount_list_id' , 1 ); // When the above setting is enabled, the id of the shopping list to which the products will be added
2025-02-03 18:36:10 +01:00
DefaultUserSetting ( 'shopping_list_print_show_header' , true ); // Default for the shopping list print option "Show header"
DefaultUserSetting ( 'shopping_list_print_group_by_product_group' , true ); // Default for the shopping list print option "Group by product group"
DefaultUserSetting ( 'shopping_list_print_layout_type' , 'table' ); // Default for the shopping list print option "Layout type" (table or list)
2020-02-01 12:54:05 +01:00
2020-10-17 11:03:47 +02:00
// Recipe settings
2020-02-10 18:24:15 +01:00
DefaultUserSetting ( 'recipe_ingredients_group_by_product_group' , false ); // Group recipe ingredients by their product group
2022-02-09 17:48:21 +01:00
DefaultUserSetting ( 'recipes_show_list_side_by_side' , true ); // If the recipe should be displayed next to recipe list on the recipes page
2022-04-01 22:43:49 +02:00
DefaultUserSetting ( 'recipes_show_ingredient_checkbox' , false ); // When enabled, a little checkbox will be shown next to each ingredient to mark it as done
2020-02-10 18:24:15 +01:00
2020-10-17 11:03:47 +02:00
// Chores settings
2022-02-11 17:46:40 +01:00
DefaultUserSetting ( 'chores_due_soon_days' , 5 ); // The "due soon" days
2025-01-14 19:43:12 +01:00
DefaultUserSetting ( 'chores_overview_swap_tracking_buttons' , false ); // When enabled, the "Track next chore schedule" and "Track chore execution now" buttons/menu items are swapped
2019-04-20 15:30:45 +02:00
2020-10-17 11:03:47 +02:00
// Batteries settings
2022-02-11 17:46:40 +01:00
DefaultUserSetting ( 'batteries_due_soon_days' , 5 ); // The "due soon" days
2019-04-20 15:30:45 +02:00
2020-10-17 11:03:47 +02:00
// Tasks settings
2022-02-11 17:46:40 +01:00
DefaultUserSetting ( 'tasks_due_soon_days' , 5 ); // The "due soon" days
2018-11-21 19:08:36 +01:00
2023-11-04 14:11:02 +01:00
// Calendar settings
DefaultUserSetting ( 'calendar_color_products' , '#007bff' ); // The event color (hex code) for due products
DefaultUserSetting ( 'calendar_color_tasks' , '#28a745' ); // The event color (hex code) for due tasks
DefaultUserSetting ( 'calendar_color_chores' , '#ffc107' ); // The event color (hex code) for due chores
DefaultUserSetting ( 'calendar_color_batteries' , '#17a2b8' ); // The event color (hex code) for due battery charge cycles
DefaultUserSetting ( 'calendar_color_meal_plan' , '#6c757d' ); // The event color (hex code) for meal plan items