Skip to content

Commit eecf69b

Browse files
committed
改名为colorit
1 parent e78dea8 commit eecf69b

File tree

6 files changed

+87
-13
lines changed

6 files changed

+87
-13
lines changed

conf/colorit-local.nginx.conf

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
server {
2+
root /opt/colorit/web;
3+
error_page 404 /404.html;
4+
index index.html index.htm;
5+
6+
gzip on;
7+
gzip_min_length 1k;
8+
gzip_buffers 4 16k;
9+
gzip_http_version 1.0;
10+
gzip_comp_level 2;
11+
gzip_types text/plain application/x-javascript text/css application/xml;
12+
gzip_vary on;
13+
14+
server_name en.colorit.us colorit.us www.colorit.us colorit;
15+
16+
# For safety
17+
rewrite ^/cgi/.*$ /404.html break;
18+
rewrite ^/sessions/.*$ /404.html break;
19+
20+
# Rewrite rules
21+
rewrite ^/$ /html/index_en.html last;
22+
rewrite ^/sitemap$ /html/sitemap last;
23+
rewrite ^/robots.txt$ /html/robots.txt last;
24+
rewrite ^/img/(.*)$ /img/$1 last;
25+
rewrite ^/css/(.*)$ /css/$1 last;
26+
rewrite ^/js/(.*)$ /js/$1 last;
27+
rewrite ^/swf/(.*)$ /swf/$1 last;
28+
rewrite ^/getcolorcode$ /cgi/getcolorcode last;
29+
rewrite ^/(.*)$ /html/$1 last;
30+
31+
location / {
32+
try_files $uri $uri/;
33+
}
34+
35+
location /cgi {
36+
include uwsgi_params;
37+
uwsgi_pass 127.0.0.1:20003;
38+
}
39+
40+
}

conf/colorcode.nginx.conf conf/colorit-online.nginx.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
server {
2-
root /opt/colorcode/web;
2+
root /opt/colorit/web;
33
error_page 404 /404.html;
44
index index.html index.htm;
55

@@ -15,7 +15,7 @@ server {
1515
gzip_types text/plain application/x-javascript text/css application/xml;
1616
gzip_vary on;
1717

18-
server_name en.colorit.us colorit.us www.colorit.us colorcode;
18+
server_name en.colorit.us colorit.us www.colorit.us colorit;
1919

2020
# For safety
2121
rewrite ^/cgi/.*$ /404.html break;

install/blank

Whitespace-only changes.

install/init.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
if [ "x$(whoami)" != "xroot" ]; then
3+
echo "Only root can run this script."
4+
exit 1
5+
fi
6+
7+
PWD="/opt/colorit"
8+
9+
cd "/opt"
10+
ln -s ~/colorit colorit
11+
echo "ln -s ~/colorit /opt/colorit"
12+
ret=$?
13+
if [ "x${ret}" != "x0" ]; then
14+
echo "An error occurs when ln -s~/colorit /opt/colorit, please contact sparker5."
15+
exit 1
16+
fi
17+
18+
mkdir "${PWD}/logs"
19+
echo "mkdir ${PWD}/logs"
20+
ret=$?
21+
if [ "x${ret}" != "x0" ]; then
22+
echo "An error occurs when ln -s~/colorit /opt/colorit, please contact sparker5."
23+
exit 1
24+
fi
25+
26+
echo "127.0.0.1 colorit" >> /etc/hosts
27+
echo "echo \"127.0.0.1 colorit\" >> /etc/hosts"
28+
ret=$?
29+
if [ "x${ret}" != "x0" ]; then
30+
echo "An error occurs when ln -s~/colorit /opt/colorit, please contact sparker5."
31+
exit 1
32+
fi
33+
34+
echo "success"

tool/export.sh

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# replace for colorcode
2+
# replace for colorit
33

44
if [ "x$(whoami)" != "xroot" ]; then
55
echo "Only root can run this script."
@@ -13,22 +13,22 @@ if [ "x${rev}" == "x" ]; then
1313
exit 1
1414
fi
1515

16-
cd /opt/colorcode.git
17-
git archive "${rev}" -o /tmp/colorcode.tgz
16+
cd /opt/colorit.git
17+
git archive "${rev}" -o /tmp/colorit.tgz
1818
ret=$?
1919

2020
if [ "x${ret}" != "x0" ]; then
2121
echo "An error occurs when archiving."
2222
exit 1
2323
fi
2424

25-
cd /opt/colorcode
26-
tar xf /tmp/colorcode.tgz
25+
cd /opt/colorit
26+
tar xf /tmp/colorit.tgz
2727

28-
cat /opt/colorcode/conf/colorcode.nginx.conf > /etc/nginx/sites-enabled/colorcode.nginx.conf
28+
cat /opt/colorit/conf/colorit.nginx.conf > /etc/nginx/sites-enabled/colorit.nginx.conf
2929

30-
chown www-data:www-data -R /opt/colorcode
30+
chown www-data:www-data -R /opt/colorit
3131

32-
/opt/colorcode/tool/spawn-fcgi.sh stop
33-
/opt/colorcode/tool/spawn-fcgi.sh start
32+
/opt/colorit/tool/spawn-fcgi.sh stop
33+
/opt/colorit/tool/spawn-fcgi.sh start
3434
/etc/init.d/nginx restart

tool/spawn-fcgi.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ if [ "x$(whoami)" != "xroot" ]; then
55
exit 1
66
fi
77

8-
PWD="/opt/colorcode/web/cgi"
9-
PIDFILE="/var/run/colorcode-spawn-fcgi.pid"
8+
PWD="/opt/colorit/web/cgi"
9+
PIDFILE="/var/run/colorit-spawn-fcgi.pid"
1010

1111
case $1 in
1212
"start")

0 commit comments

Comments
 (0)