mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Added makefile
This commit is contained in:
parent
9fbfd05600
commit
a4680105f8
29
Makefile
29
Makefile
@ -1,9 +1,26 @@
|
|||||||
|
ADDRESS = cowyo.com
|
||||||
|
PORT = 8001
|
||||||
|
|
||||||
CUR_DIR = $(shell bash -c 'pwd')
|
CUR_DIR = $(shell bash -c 'pwd')
|
||||||
CUR_USER = $(shell bash -c 'echo $USER')
|
USERCUR = $(shell bash -c 'whoami')
|
||||||
PORT ?= $(shell bash -c 'read -p "Port (e.g. 8001): " pwd; echo $$pwd')
|
|
||||||
EXTERNAL_ADDRESS ?= $(shell bash -c 'read -p "External address (e.g. something.com): " pwd; echo $$pwd')
|
|
||||||
|
|
||||||
all:
|
all:
|
||||||
echo The password is $(EXTERNAL_ADDRESS)
|
rm -rf jinstall
|
||||||
echo The port is $(PORT)
|
mkdir jinstall
|
||||||
echo The cwd is $(CUR_DIR)
|
cp install/cowyo.nginx jinstall/cowyo.nginx
|
||||||
|
sed -i 's/PORT/$(PORT)/g' jinstall/cowyo.nginx
|
||||||
|
sed -i 's/ADDRESS/$(ADDRESS)/g' jinstall/cowyo.nginx
|
||||||
|
sed -i 's^CUR_DIR^$(CUR_DIR)^g' jinstall/cowyo.nginx
|
||||||
|
cp install/cowyo.init jinstall/cowyo.init
|
||||||
|
sed -i 's/EXT_ADDRESS/$(ADDRESS)/g' jinstall/cowyo.init
|
||||||
|
sed -i 's^CUR_DIR^$(CUR_DIR)^g' jinstall/cowyo.init
|
||||||
|
sed -i 's^USERCUR^$(USERCUR)^g' jinstall/cowyo.init
|
||||||
|
mv jinstall/cowyo.init /etc/init.d/
|
||||||
|
chmod +x /etc/init.d/cowyo.init
|
||||||
|
mv jinstall/cowyo.nginx /etc/nginx/sites-available/cowyo.nginx
|
||||||
|
rm /etc/nginx/sites-enabled/cowyo.nginx
|
||||||
|
ln -s /etc/nginx-sites-available/cowyo.nginx /etc/nginx/sites-enabled/cowyo.nginx
|
||||||
|
/etc/init.d/nginx reload
|
||||||
|
/etc/init.d/nginx restart
|
||||||
|
/etc/init.d/cowyo.init start
|
||||||
|
rm -rf jinstall
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
# sudo /etc/init.d/cowyo start
|
# sudo /etc/init.d/cowyo start
|
||||||
|
|
||||||
dir="CUR_DIR"
|
dir="CUR_DIR"
|
||||||
user="USER"
|
user="USERCUR"
|
||||||
cmd="./cowyo EXTERNAL_ADDRESS"
|
cmd="./cowyo EXT_ADDRESS"
|
||||||
|
|
||||||
name="cowyo"
|
name="cowyo"
|
||||||
pid_file="/var/run/$name.pid"
|
pid_file="/var/run/$name.pid"
|
||||||
|
@ -5,7 +5,7 @@ server {
|
|||||||
access_log /etc/nginx/logs/access-cowyo.log;
|
access_log /etc/nginx/logs/access-cowyo.log;
|
||||||
error_log /etc/nginx/logs/error-cowyo.log info;
|
error_log /etc/nginx/logs/error-cowyo.log info;
|
||||||
root CUR_DIR;
|
root CUR_DIR;
|
||||||
server_name EXTERNAL_ADDRESS;
|
server_name ADDRESS;
|
||||||
|
|
||||||
# Media: images, icons, video, audio, HTC
|
# Media: images, icons, video, audio, HTC
|
||||||
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
|
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
|
||||||
|
Loading…
Reference in New Issue
Block a user