找回密码
 注册
首页 ≡≡网络技术≡≡ PHP语言 Nextcloud配置文件config.php完整版详解

PHP Nextcloud配置文件config.php完整版详解

灰儿 2023-10-18 09:33:34
Nextcloud作为可个人使用的私有云,不但功能方面非常强大,而且搭建却特别的简单,只要有vps,搭好php+mysql环境,就可以使用了。

Nextcloud除了网页版可以快速使用,还有iOS和Android的客户端,再加上还有WebDAV功能,很多文件管理App都可以添加WebDAV来进行便捷操作。

搭建好Nextcloud,可以参考 Nextcloud安全设置及文件配置 进行服务器级别的优化,还可以修改Nextcloud的配置文件config.php来进行进阶优化。

下面给出config.php文件的完整中文对照,大家可以按需开启功能。

  1. <?php

  2. $CONFIG = array(

  3.   'instanceid' => '',    #安装 ID, 在安装时自动设定, 更改会出导致 NextCloud 无法访问

  4.   'passwordsalt' => '',    #用于加密密码, 更改后会导致无法登陆

  5.   'secret' => '',    #用于加密传输等

  6.   'trusted_domains' => array (                #域名

  7.     0 => 'blog.haitianhome.com',

  8.   ),

  9.   'datadirectory' => '/home/wwwroot/data',                #NextCloud 数据放置目录

  10.   'version' => '16.0.4.1',                #版本号

  11.   /* 数据库信息 */

  12.   'dbtype' => 'mysql',                #数据库类型

  13.   'dbhost' => 'localhost',                #数据库服务器

  14.   'dbname' => '',                #数据库名

  15.   'dbuser' => '',                #数据库用户名

  16.   'dbpassword' => '',                #数据库密码

  17.   'dbtableprefix' => 'oc_',                #数据库前缀

  18.   'installed' => True,                #是否安装

  19.   'default_language' => 'za',                #默认语言

  20.   'defaultapp' => 'files',                #默认 APP

  21.   'knowledgebaseenabled' => true,                #在用户菜单中添加帮助选项

  22.   'allow_user_to_change_display_name' => False,                #是否允许用户改变显示昵称

  23.   'remember_login_cookie_lifetime' => 60*60*24*15,                #登录 Cookie 保留时间

  24.   'session_lifetime' => 60 * 60 * 24,                #Session 保留时间

  25.   'session_keepalive' => true,                #保持 Session 活跃

  26.   'token_auth_enforced' => false,                #强制开启客户端验证

  27.   'auth.bruteforce.protection.enabled' => true,                #强力保护

  28.   'skeletondirectory' => '/home/wwwroot/file/core/skeleton',                #skeleton 目录

  29.   'user_backends' => array(

  30.       array(

  31.               'class' => 'OC_User_IMAP',                #可选 : IMAP (OC_User_IMAP), SMB
  32. (OC_User_SMB), and FTP (OC_User_FTP)

  33.               'arguments' => array('{imap.gmail.com:993/imap/ssl}INBOX')

  34.       )

  35.   ),

  36.   'lost_password_link' => 'https://blog.haitianhome.com/forgot',                #忘记密码链接

  37.   /* 邮箱服务器信息 */

  38.   'mail_domain' => 'haitianhome.com',                #发送邮箱域名

  39.   'mail_from_address' => 'admin',                #发送邮箱用户

  40.   'mail_smtpdebug' => false,                #SMTP Debug

  41.   'mail_smtpmode' => 'php',                #发送模式, 可选 : sendmail、smtp、qmail、php

  42.   'mail_smtphost' => '127.0.0.1',                #邮件服务器

  43.   'mail_smtpport' => 25,                #邮件服务器端口

  44.   'mail_smtptimeout' => 10,                #超时设定, 单位 : 秒

  45.   'mail_smtpsecure' => '',                #安全模式, 可选 : ssl、tls

  46.   'mail_smtpauth' => false,                #验证

  47.   'mail_smtpauthtype' => 'LOGIN',                #验证模式, 可选 : LOGIN、PLAIN

  48.   'mail_smtpname' => '',                #验证用户名

  49.   'mail_smtppassword' => '',                #验证密码

  50.   /* Proxy */

  51.   'overwritehost' => '',                #重写地址

  52.   'overwriteprotocol' => '',                #协议, 可选 : HTTP、HTTPS

  53.   'overwritewebroot' => '',                #重写根目录

  54.   'overwritecondaddr' => '',                #IP 地址重写, 支持正则表达式

  55.   'overwrite.cli.url' => '',                #制定 URL

  56.   'htaccess.RewriteBase' => '/',                #htaccess 重写

  57.   'htaccess.IgnoreFrontController' => false,                #如果 Apache 没有启用 "mov_env", 则启用此项

  58.   'proxy' => '',                #代理服务器

  59.   'proxyuserpwd' => '',                #代理服务器验证

  60.   'trashbin_retention_obligation' => '7, 30',                #垃圾箱选项, 保留 D1 天, 在 D2 天删
  61. 除. 设定为 auto 则为 30天删除. 可选项 : auto、D, auto、auto, D、D1, D2、disabled

  62.   'versions_retention_obligation' => '30, 180',                #文件版本保留, 可选项同上

  63.   'appcodechecker' => true,                #检测 APP 是否使用私有 API

  64.   'updatechecker' => true,                #更新检测

  65.   'updater.server.url' => 'https://updates.nextcloud.com/updater_server/',                #更新检测
  66. 服务器

  67.   'updater.release.channel' => 'stable',                #更新选项, 可选 : daily、beta、stable、
  68. production

  69.   'has_internet_connection' => true,                #是否有网路链接

  70.   'check_for_working_webdav' => true,                #验证 working WebDAV 的连通性

  71.   'check_for_working_wellknown_setup' => true,                #验证 working .well-known URL 重定


  72.   'check_for_working_htaccess' => true,                #检测 .htaccess 文件可写性

  73.   'config_is_read_only' => false,                #配置文件权限

  74.   'log_type' => 'file',                #日志文件类型

  75.   'logfile' => '/var/log/nextcloud.log',                #日志文件保存路径

  76.   'loglevel' => 0,                #日志等级, 可选 : 0 = Debug, 1 = Info, 2 = Warning, 3 = Error, and
  77. 4 = Fatal

  78.   'syslog_tag' => 'Nextcloud',                #

  79.   'log.condition' => [

  80.           'shared_secret' => '57b58edb6637fe3059b3595cf9c41b9',

  81.        'users' => ['sample-user'],

  82.       'apps' => ['files'],

  83.   ],

  84.   'logdateformat' => 'l, d-M-Y H:i:s T',                #日期类型

  85.   'logtimezone' => 'Asia/Hong_Kong',                #时间区域

  86.   'log_query' => false,                #多服务器日志

  87.   'cron_log' => true,                #cron 日志

  88.   'log_rotate_size' => false,                #日志文件大小限制

  89.   'customclient_desktop' =>                #桌面客户端链接

  90.       'https://nextcloud.com/install/#install-clients',

  91.   'customclient_android' =>                #Android 客户端链接

  92.       'https://play.google.com/store/apps/details?id=com.nextcloud.client',

  93.   'customclient_ios' =>                #iOS 客户端链接

  94.       'https://itunes.apple.com/us/app/nextcloud/id1125420102?mt=8',

  95.   'appstoreenabled' => true,                #NextCloud App Store

  96.   'apps_paths' => array(                #APP 路径

  97.       array(

  98.                'path'=> '/home/www/file/apps',

  99.               'url' => '/apps',

  100.               'writable' => true,

  101.       ),

  102.   ),

  103.   'enable_previews' => true,                #开启文件预览

  104.   'preview_max_x' => 2048,                #最大宽度

  105.   'preview_max_y' => 2048,                #最大高度

  106.   'preview_max_scale_factor' => 10,                #模糊系数

  107.   'preview_max_filesize_image' => 50,                #预览图片最大大小

  108.   /*'preview_libreoffice_path' => '/usr/local/libreoffice',                #libreoffice 预览配置

  109.   'preview_office_cl_parameters' =>

  110.           ' --headless --nologo --nofirststartwizard --invisible --norestore '.

  111.           '--convert-to pdf --outdir ',*/

  112.   'enabledPreviewProviders' => array(                #可预览文件后缀

  113.           'OC\\Preview\\PNG',

  114.           'OC\\Preview\\JPEG',

  115.           'OC\\Preview\\GIF',

  116.           'OC\\Preview\\BMP',

  117.           'OC\\Preview\\XBitmap',

  118.           'OC\\Preview\\MP3',

  119.           'OC\\Preview\\TXT',

  120.           'OC\\Preview\\MarkDown',

  121.     'OC\\Preview\\Movie',

  122.     'OC\\Preview\\MSOfficeDoc',

  123.     'OC\\Preview\\MSOffice2003',

  124.     'OC\\Preview\\MSOffice2007',

  125.     'OC\\Preview\\OpenDocument',

  126.     'OC\\Preview\\StarOffice',

  127.     'OC\\Preview\\Illustrator',

  128.     'OC\\Preview\\PDF',

  129.     'OC\\Preview\\Photoshop',

  130.     'OC\\Preview\\Postscript',

  131.     'OC\\Preview\\SVG',

  132.     'OC\\Preview\\TIFF',

  133.     'OC\\Preview\\Font'

  134.   ),

  135.   'ldapUserCleanupInterval' => 51,                #检查用户后台作业时间间隔, 单位 : 分

  136.   'comments.managerFactory' => 'OC\\Comments\\ManagerFactory',                #Comments
  137. Manager Factory

  138.   'systemtags.managerFactory' => 'OC\\SystemTag\\ManagerFactory',                #SystemTag
  139. Manager Factory

  140.   'mail_template_class' => 'OC\\Mail\\EMailTemplate',                #邮件模板

  141.   'maintenance' => false,                #维护模式

  142.   /**'openssl' => array(                #OpenSSL

  143.           'config' => '/absolute/location/of/openssl.cnf',

  144.   ),**/

  145.   'memcache.local' => 'OC\\Memcache\\APCu',                #Memcached

  146.   'memcache.distributed' => 'OC\\Memcache\\Memcached',

  147.   'redis' => [                #Redis

  148.           'host' => 'localhost', #Redis 服务器

  149.           'port' => 6379,                #Redis 端口

  150.           'timeout' => 0.0,                #Redis 超时设定

  151.           'password' => '7p^*F}7nMYX^N=ufP]vVU)u27JDXiii8Hd4Mq2P8RAPxLg)WxCUT,2#9pRmvsxrZ',               
  152. #Redis 密码

  153.           'dbindex' => 1,                #Redis 数据库选择

  154.   ],

  155.   'memcached_servers' => array(                #Memcached 服务器

  156.           array('localhost', 11211),

  157.   ),

  158.   'memcached_options' => array(                #Memcached 选项

  159.           \Memcached::OPT_CONNECT_TIMEOUT => 50,

  160.           \Memcached::OPT_RETRY_TIMEOUT =>   50,

  161.           \Memcached::OPT_SEND_TIMEOUT =>    50,

  162.           \Memcached::OPT_RECV_TIMEOUT =>    50,

  163.           \Memcached::OPT_POLL_TIMEOUT =>    50,

  164.           \Memcached::OPT_COMPRESSION =>          true,

  165.           \Memcached::OPT_LIBKETAMA_COMPATIBLE => true,

  166.           \Memcached::OPT_BINARY_PROTOCOL =>      true,

  167.   ),

  168.   'cache_path' => '/wwwroot/file/data/$user/cache',                #缓存目录

  169.   'cache_chunk_gc_ttl' => 60*60*24,                #缓存删除时间

  170.   /*'objectstore' => [                #Object Store 模式

  171.           'class' => 'OC\\Files\\ObjectStore\\Swift',

  172.           'arguments' => [

  173.                   // trystack will use your facebook id as the user name

  174.                   'username' => 'jonny0201',

  175.                   // in the trystack dashboard go to user -> settings -> API Password to

  176.                   // generate a password

  177.                   'password' => 'Secr3tPaSSWoRdt7',

  178.                   // must already exist in the objectstore, name can be different

  179.                   'container' => 'nextcloud',

  180.                   // prefix to prepend to the fileid, default is 'oid:urn:'

  181.                   'objectPrefix' => 'oid:urn:',

  182.                   // create the container if it does not exist. default is false

  183.                   'autocreate' => true,

  184.                   // required, dev-/trystack defaults to 'RegionOne'

  185.                   'region' => 'RegionOne',

  186.                   // The Identity / Keystone endpoint

  187.                   'url' => 'http://8.21.28.222:5000/v2.0',

  188.                   // required on dev-/trystack

  189.                   'tenantName' => 'facebook100000123456789',

  190.                   // dev-/trystack uses swift by default, the lib defaults to 'cloudFiles'

  191.                   // if omitted

  192.                   'serviceName' => 'swift',

  193.                   // The Interface / url Type, optional

  194.                   'urlType' => 'internal'

  195.           ],

  196.   ],*/

  197.   'sharing.managerFactory' => 'OC\\Share20\\ProviderFactory',                #Share Provider
  198. Factory

  199.   'sharing.maxAutocompleteResults' => 7,                #用户搜索最大返回数

  200.   'sharing.minSearchStringLength' => 0,                #搜索最小长度

  201.   /*'dbdriveroptions' => array(                #MySQL SSL

  202.           PDO::MYSQL_ATTR_SSL_CA => '/file/path/to/ca_cert.pem',

  203.           PDO::MYSQL_ATTR_INIT_COMMAND => 'SET wait_timeout = 28800'

  204.   ),*/

  205.   #'sqlite.journal_mode' => 'DELETE',                #SQLite journal 模式

  206.   'mysql.utf8mb4' => false,

  207.   'supportedDatabases' => array(                #支持的数据库

  208.           'sqlite',

  209.           'mysql',

  210.           'pgsql',

  211.           'oci',

  212.   ),

  213.   'tempdirectory' => '/tmp/nextcloudtemp',                #Temp 文件夹

  214.   'hashingCost' => 10,                #加密数值

  215.   #'blacklisted_files' => array('.htaccess'),                #禁止列表

  216.   'share_folder' => '/',                #默认分享文件夹

  217.   'theme' => '',                #主题

  218.   'cipher' => 'chacha20',                #加密方式

  219.   'minimum.supported.desktop.version' => '2.17.8',                #最小桌面客户端版本

  220.   'quota_include_external_storage' => false,                #外部存储

  221.   'filesystem_check_changes' => 1,                #文件系统更改检测

  222.   'part_file_in_storage' => true,                #上传时切割

  223.   'mount_file' => '/www/file/data/mount.json',                #mount.json 路径

  224.   'filesystem_cache_readonly' => false,                #文件缓存只读

  225.   #'trusted_proxies' => array('203.0.113.45', '198.51.100.128'),                #信任的 Proxy 服务
  226. 器列表

  227.   'forwarded_for_headers' => array('HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR'),                #转发

  228.   'max_filesize_animated_gifs_public_sharing' => -1,                #动态图片 gif 预览最大大小, 单位 :MB

  229.   'filelocking.enabled' => true,                #文件协作

  230.   'filelocking.ttl' => 60*60,                #文件协作锁定时间, 单位 : 秒

  231.   'memcache.locking' => 'OC\\Memcache\\Redis',                #文件协作缓存方式

  232.   'filelocking.debug' => false,                #文件写作 Debug 模式

  233.   'upgrade.disable-web' => false,                #基于 Web 的更新程序

  234.   'debug' => false,                #Debug 模式

  235.   'data-fingerprint' => '',                #备份确认

  236.   'copied_sample_config' => false,                #默认配置确认

  237.   #'lookup_server' => 'https://lookup.nextcloud.com',                #自定义查询服务器

  238.   'gs.enabled' => false,                #Nextcloud's Global Scale

  239.   'gs.federation' => 'internal',                #内部使用 Nextcloud's Global Scale

  240. );

  241. ?>
复制代码


您需要登录后才可以回帖 登录 | 注册
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。