说实话nextcloud这个网盘以及用了几年了,无奈于每隔一段时间都会重装一次。所以记录一下。

去除“获取自己的nextcloud账号”

 如果你不需要这行字,可以在/config/config.php 文件中添加以下代码后保存后即可。

'simpleSignUpLink.shown' => false,

如果你想改成其他文字和跳转链接,可以把/nextcloud/core/l10n/zh_CN.json下的“获取自己对的免费账号”改成自己想要的文字。然后再把/core/templates/layout.public.php中的 “https://nextcloud.com/signup/”改成自己的链接。其他语言变通一下就好了。

隐藏“下载所有文件”按钮

nextcloud应用商店中下载Custom CSS,然后上传到/apps目录解压,再到nextcloud里激活。如果你的nextcloud能正常连接应用商店,可以直接在应用商店中下载并启用。

在设置中打开主题,在下面的Custom CSS输入框中添加以下代码。


#header-primary-action .primary{
    display:none;
}

更改新建用户的默认语言

在/config/config.php 文件中添加以下代码后保存后即可。

'default_language' => 'zh_CN'

自定义初始默认文件

如果你的nextcloud还没有开始安装,那么可以把/core/skeleton下的文件替换成自己需要的文件,但是需要注意下文件的权限,文件夹的权限为:755,文件的权限为:644,所有者为:www。
如果你的nextcloud已经安装过了,这个方法就不行了,因为更新后上面的文件就会被覆盖。

如果你的nextcloud已经安装好了,那么我们就需要自定义默认文件,在/config/config.php文件中添加以下代码。

'skeletondirectory' => 'core/custom_file',
#补充,如果不要默认文件,参数为空就行,如下。
'skeletondirectory' => '',

然后在/core目录下新建一个custom_file文件夹。将文件放进去即可。这样在新建用户后,默认就会创建自己设定文件,或者不创建文件。

PS:如果不行,请填绝对路径。

其他大部分的配置都可以在config.php文件中修改。

'knowledgebaseenabled' => true,		#在用户菜单中添加帮助选项
'allow_user_to_change_display_name' => False,		#是否允许用户改变显示昵称
'remember_login_cookie_lifetime' => 60*60*24*15,		#登录 Cookie 保留时间 'session_lifetime' => 60 * 60 * 24,		#Session 保留时间
'session_keepalive' => true,		#保持 Session 活跃
'token_auth_enforced' => false,		#强制开启客户端验证
'auth.bruteforce.protection.enabled' => true,		#强力保护
'lost_password_link' => 'https://file.jonny.vip/forgot',		#忘记密码链接
'htaccess.RewriteBase' => '/',		#htaccess 重写,Apache下有效
'htaccess.IgnoreFrontController' => false,		#如果 Apache 没有启用 "mov_env", 则启用此项
'proxy' => '',		#代理服务器
'proxyuserpwd' => '',		#代理服务器验证
'trashbin_retention_obligation' => '7, 30',		#垃圾箱选项, 保留 D1 天, 在 D2 天删
除. 设定为 auto 则为 30天删除. 可选项 : auto、D, auto、auto, D、D1, D2、disabled
'versions_retention_obligation' => '30, 180',		#文件版本保留, 可选项同上
'appcodechecker' => true,		#检测 APP 是否使用私有 API
'updatechecker' => true,		#更新检测
'updater.server.url' => 'https://updates.nextcloud.com/updater_server/',		#更新检测
服务器
'updater.release.channel' => 'stable',		#更新选项, 可选 : daily、beta、stable、
production
'has_internet_connection' => true,		#是否有网路链接
'check_for_working_webdav' => true,		#验证 working WebDAV 的连通性
'check_for_working_wellknown_setup' => true,		#验证 working .well-known URL 重定
向
'check_for_working_htaccess' => true,		#检测 .htaccess 文件可写性
'config_is_read_only' => false,		#配置文件权限
'log_type' => 'file',		#日志文件类型
'logfile' => '/var/log/nextcloud.log',		#日志文件保存路径
'loglevel' => 0,		#日志等级, 可选 : 0 = Debug, 1 = Info, 2 = Warning, 3 = Error, and 
4 = Fatal
'logdateformat' => 'l, d-M-Y H:i:s T',		#日期类型
'logtimezone' => 'Asia/Hong_Kong',		#时间区域
'log_query' => false,		#多服务器日志
'cron_log' => true,		#cron 日志
'log_rotate_size' => false,		#日志文件大小限制
'appstoreenabled' => true,		#NextCloud应用商店
'apps_paths' => array(		#APP 路径

      array(

       	'path'=> '/www/file/apps',

      	'url' => '/apps',

      	'writable' => true,

      ),

 ),

'enable_previews' => true,		#开启文件预览
'preview_max_x' => 2048,		#最大宽度
'preview_max_y' => 2048,		#最大高度
'preview_max_scale_factor' => 10,		#模糊系数
'preview_max_filesize_image' => 50,		#预览图片最大大小
'enabledPreviewProviders' => array(		#可预览文件后缀

  	'OC\\Preview\\PNG',

  	'OC\\Preview\\JPEG',

  	'OC\\Preview\\GIF',

  	'OC\\Preview\\BMP',

  	'OC\\Preview\\XBitmap',

  	'OC\\Preview\\MP3',

  	'OC\\Preview\\TXT',

  	'OC\\Preview\\MarkDown',

    'OC\\Preview\\Movie',

    'OC\\Preview\\MSOfficeDoc',

    'OC\\Preview\\MSOffice2003',

    'OC\\Preview\\MSOffice2007',

    'OC\\Preview\\OpenDocument',

    'OC\\Preview\\StarOffice',

    'OC\\Preview\\Illustrator',

    'OC\\Preview\\PDF',

    'OC\\Preview\\Photoshop',

    'OC\\Preview\\Postscript',

    'OC\\Preview\\SVG',

    'OC\\Preview\\TIFF',

    'OC\\Preview\\Font'

  ),

'ldapUserCleanupInterval' => 50,		#检查用户后台作业时间间隔, 单位 : 分
'comments.managerFactory' => 'OC\\Comments\\ManagerFactory',		#Comments 
Manager Factory
'systemtags.managerFactory' => 'OC\\SystemTag\\ManagerFactory',		#SystemTag 
Manager Factory
'mail_template_class' => 'OC\\Mail\\EMailTemplate',		#邮件模板
'maintenance' => false,		#维护模式
'cache_path' => '/www/file/data/$user/cache',		#缓存目录
'cache_chunk_gc_ttl' => 60*60*24,		#缓存删除时间
'sharing.managerFactory' => 'OC\\Share20\\ProviderFactory',		#Share Provider 
Factory
'sharing.maxAutocompleteResults' => 7,		#用户搜索最大返回数
'sharing.minSearchStringLength' => 0,		#搜索最小长度
'tempdirectory' => '/tmp/nextcloud',		#Temp 文件夹
'theme' => '',		#主题
'minimum.supported.desktop.version' => '2.17.8',		#最小桌面客户端版本
'quota_include_external_storage' => false,		#外部存储
'filesystem_check_changes' => 1,		#文件系统更改检测
'part_file_in_storage' => true,		#上传时切割
'mount_file' => '/www/file/data/mount.json',		#mount.json 路径
'filesystem_cache_readonly' => false,		#文件缓存只读
'max_filesize_animated_gifs_public_sharing' => -1,		#动态图片 gif 预览最大大小, 单位 :MB
'filelocking.enabled' => true,		#文件协作
'filelocking.ttl' => 60*60,		#文件协作锁定时间, 单位 : 秒
'memcache.locking' => 'OC\\Memcache\\Redis',		#文件协作缓存方式
'filelocking.debug' => false,		#文件写作 Debug 模式
'upgrade.disable-web' => false,		#基于 Web 的更新程序
'debug' => false,		#Debug 模式
'data-fingerprint' => '',		#备份确认
'copied_sample_config' => false,		#默认配置确认
'lookup_server' => 'https://lookup.nextcloud.com',		#自定义查询服务器
'gs.enabled' => false,		#Nextcloud's Global Scale
'gs.federation' => 'internal',		#内部使用 Nextcloud's Global Scale