热搜词
发表于 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. 向

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

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

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

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

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

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

  80.   'log.condition' => [

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

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

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

  84.   ],

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

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

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

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

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

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

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

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

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

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

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

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

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

  98.       array(

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

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

  101.               'writable' => true,

  102.       ),

  103.   ),

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

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

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

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

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

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

  110.   'preview_office_cl_parameters' =>

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

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

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

  114.           'OC\\Preview\\PNG',

  115.           'OC\\Preview\\JPEG',

  116.           'OC\\Preview\\GIF',

  117.           'OC\\Preview\\BMP',

  118.           'OC\\Preview\\XBitmap',

  119.           'OC\\Preview\\MP3',

  120.           'OC\\Preview\\TXT',

  121.           'OC\\Preview\\MarkDown',

  122.     'OC\\Preview\\Movie',

  123.     'OC\\Preview\\MSOfficeDoc',

  124.     'OC\\Preview\\MSOffice2003',

  125.     'OC\\Preview\\MSOffice2007',

  126.     'OC\\Preview\\OpenDocument',

  127.     'OC\\Preview\\StarOffice',

  128.     'OC\\Preview\\Illustrator',

  129.     'OC\\Preview\\PDF',

  130.     'OC\\Preview\\Photoshop',

  131.     'OC\\Preview\\Postscript',

  132.     'OC\\Preview\\SVG',

  133.     'OC\\Preview\\TIFF',

  134.     'OC\\Preview\\Font'

  135.   ),

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

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

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

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

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

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

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

  145.   ),**/

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

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

  148.   'redis' => [                #Redis

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

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

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

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

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

  155.   ],

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

  157.           array('localhost', 11211),

  158.   ),

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

  160.           \Memcached::OPT_CONNECT_TIMEOUT => 50,

  161.           \Memcached::OPT_RETRY_TIMEOUT =>   50,

  162.           \Memcached::OPT_SEND_TIMEOUT =>    50,

  163.           \Memcached::OPT_RECV_TIMEOUT =>    50,

  164.           \Memcached::OPT_POLL_TIMEOUT =>    50,

  165.           \Memcached::OPT_COMPRESSION =>          true,

  166.           \Memcached::OPT_LIBKETAMA_COMPATIBLE => true,

  167.           \Memcached::OPT_BINARY_PROTOCOL =>      true,

  168.   ),

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

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

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

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

  173.           'arguments' => [

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

  175.                   'username' => 'jonny0201',

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

  177.                   // generate a password

  178.                   'password' => 'Secr3tPaSSWoRdt7',

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

  180.                   'container' => 'nextcloud',

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

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

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

  184.                   'autocreate' => true,

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

  186.                   'region' => 'RegionOne',

  187.                   // The Identity / Keystone endpoint

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

  189.                   // required on dev-/trystack

  190.                   'tenantName' => 'facebook100000123456789',

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

  192.                   // if omitted

  193.                   'serviceName' => 'swift',

  194.                   // The Interface / url Type, optional

  195.                   'urlType' => 'internal'

  196.           ],

  197.   ],*/

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

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

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

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

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

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

  205.   ),*/

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

  207.   'mysql.utf8mb4' => false,

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

  209.           'sqlite',

  210.           'mysql',

  211.           'pgsql',

  212.           'oci',

  213.   ),

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  241. );

  242. ?>
复制代码


全部评论0
回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|管理员之家 ( 苏ICP备2023053177号-2 )

GMT+8, 2026-10-9 03:13 , Processed in 0.142654 second(s), 23 queries .

Powered by Discuz! X3.5

Cpoyright © 2001-2026 Discuz! Team