依赖
Ruby、 Rails
npm install pm2@latest -g
修改gem、bundle源
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
gem sources -l
确保只有 gems.ruby-china.com
bundle config mirror.https://rubygems.org https://gems.ruby-china.com
Ngnix转发
location / {
try_files /_not_exists_ @backend;
}
location @backend {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:3000;
}
软链
ln -s /data/redmine-5.1/public /www/wwwroot/yourdomain/
启动
pm2 start "bundle exec rails server -e production" --name redmine --cwd /data/redmine-5.1
保存
pm2 save
pm2 startup
修改状态颜色
public/javascripts/application.js
$(function(){
$("#content table.issues tbody tr td").each(function(){
let status_class = $(this).attr('class');
if(status_class == 'status'){
let html = $(this).html();
if(html == '已解决'){
$(this).html("<span style='color:green;'>已解决√</span>");
}else if(html == '新问题'){
$(this).html("<span style='color:red;'>新问题</span>");
}else if(html == '处理中'){
$(this).html("<span style='color:#00BBFF;'>处理中……</span>");
}else if(html == '拒绝'){
$(this).html("<span style='color:#BB5500;'>拒绝</span>");
}else if(html == '关闭'){
$(this).html("<span style='color:#444444;'>关闭</span>");
}else if(html == '待反馈'){
$(this).html("<span style='color:#EEEE00;'>待反馈</span>");
}
}
});
});