图床Chevereto V3升级至V4(Chevereto V3 Upgrade to V4)

图床Chevereto V3升级至V4(Chevereto V3 Upgrade to V4)

研究了一天,终于给大家端上来了。首先安装准备,需要先知道想升级的版本来准备环境。

特别注意,api和s3兼容的问题。

第一个是api没有太大的变化,但是根据设置,应该是公钥改成了私钥。

第二点就是s3兼容的问题,导致图片可以上传,但地址一直对不上,也没有目标地址的选项。

参考文档:

https://v4-docs.chevereto.com/application/installing/installation.html#stack

Version PHP
4.2 8.1.28
4.1 8.0.30
4.0 ~8.0
Version MySQL MariaDB
4.2 8.0.1 10.2.2
4.1 5.7; 8 10
4.0 5.7; 8 10

 

V3和V4的对比

System V4 V3
PHP 8 7.4
V4 Path V3 Path
Settings /app/env.php /app/settings.php
Composer /app/composer.json /composer.json
CLI /app/bin/legacy /cli.php
Themes /content/legacy/themes /app/themes
Peafowl /content/legacy/themes/Peafowl/lib /lib

这些了解清楚后就可以进入准备环节了,准备好环境后。

NGINX伪静态:

# Chevereto Nginx rewrite rules
# Make sure to place these inside your server{} block

# Disable access to .ht* files
location ~ /\.ht {
	deny all;
}

# Disable access to sensitive files in app path
location ~ /(app|content|lib)/.*\.(po|php|lock|sql)$ {
   deny all;
}

# Disable log on not found images + image replacement
location ~* \.(jpe?g|png|gif|webp) {
	log_not_found off;
	error_page 404 /content/images/system/default/404.gif;
}

# 静态资源(包括字体、CSS、JS、JSON、图片等)设置 CORS 头
location ~* \.(ttf|ttc|otf|eot|woff|woff2|font\.css|css|js|json|jpe?g|png|gif|webp)$ {
    add_header Access-Control-Allow-Origin "*" always;
    add_header Cross-Origin-Resource-Policy "same-site" always;
    add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
    add_header Access-Control-Allow-Headers "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type" always;
}
# Force serve upload path as static content (match your upload folder if needed)
location /images {}

# Route dynamic request to index.php
location / {
	try_files $uri $uri/ /index.php?$query_string;
}

中文翻译更新:

关于文件的中文更新问题

msgid "file"
msgid_plural "files"
msgstr[0] "文件"

原来的这段,小写改成大写即可

msgid "File"
msgid_plural "Files"
msgstr[0] "文件"

更新目录:/app/languages

msgid "add file URLs"
msgstr "添加文件网址"

msgid "Drag and drop or paste files here to upload"
msgstr "在此处拖放或粘贴文件以上传"

msgid "Get direct links, Markdown, BBCode and HTML thumbnails."
msgstr "直接的源图片链接, BBCode代码和HTML缩略图显示."

更新缓存目录:/app/.cache/languages

		"add file URLs" => [
		0 => "添加文件网址",
	],
		"Drag and drop or paste files here to upload" => [
		0 => "在此处拖放或粘贴文件以上传",
	],
		"Get direct links, Markdown, BBCode and HTML thumbnails." => [
		0 => "直接的源图片链接, BBCode代码和HTML缩略图显示.",
	],

 

您暂时无权查看此隐藏内容!
内容查看本文隐藏内容仅限注册用户查看,请先
© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...