0xGA: Check-in [f67e1fe4ed]

Yet another PHP framework, but made for org-mode and geeks.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add narv installer
Timelines: family | ancestors | descendants | both | narv
Files: files | file ages | folders
SHA1:f67e1fe4edad11b46aa54768228fdb9073f2b82f
User & Date: milouse 2014-05-03 14:32:22
Context
2014-05-03
14:41
Add install instruction to the home page check-in: 9451eb76cb user: milouse tags: narv
14:32
Add narv installer check-in: f67e1fe4ed user: milouse tags: narv
00:14
Add default error page template and better regex for routes check-in: 0b81284ae3 user: milouse tags: narv
Changes

Added create_narv_installer.sh.







































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash

if [ -f "./narv_install.sh" ] ; then
    rm narv_install.sh
fi

gzip --best -k narv narv.py 
tar -czf narv.tar.gz narv.gz narv.py.gz

exec 6>&1 # bind fd #6 to stdout (save stdout)
exec > /tmp/narv_tmp_install # redirect stdout to this file

cat <<EOF
#!/usr/bin/env bash

PAYLOAD="$(base64 narv.tar.gz)"

EOF

exec 1>&6 6>&- # Restore stdout and close fd #6

sed "1,32d" create_narv_installer.sh >> /tmp/narv_tmp_install
mv /tmp/narv_tmp_install narv_install.sh
chmod u+x narv_install.sh

rm *.gz
exit

####################################################
### INSTALLER SCRIPT
####################################################

WORKINGREP=`realpath ./narvroot`

echo "$PAYLOAD" | base64 -d > narv.tar.gz
tar xzf narv.tar.gz
rm narv.tar.gz
gzip -d narv.gz narv.py.gz
chmod u+x narv

echo ":: will init Narv in $WORKINGREP"

if [ -e "$WORKINGREP" ] ; then
    echo
    echo "ERROR: $WORKINGREP already exists on your system."
    echo
    echo "If you really wants to do a fresh install at this place, remove it first.
This program will now exit to let you do all the necessary things before."
    exit 1
fi

mkdir $WORKINGREP

echo ":: creating shared necessary directories structure"
install -dm 755 $WORKINGREP/var/log
install -dm 777 $WORKINGREP/var/tmp
install -dm 755	$WORKINGREP/usr/bin
install -dm 755	$WORKINGREP/etc

install -Dm 755 narv.py $WORKINGREP/usr/bin
install -Dm 755 narv    $WORKINGREP/usr/bin

rm narv narv.py

echo "General installation finished."
echo "You may now want to create your first app by entering the command:"
echo "$WORKINGREP/usr/bin/narv create [-d $WORKINGREP] <appname>"

Changes to narv.

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
...
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
Platform: `uname -o` `uname -r`; `python3 --version`

Usage: $0 [command] [args] <appname>

Where command should be one of:

help: show general help
init: initialize a new narv repository
create: initialize a new website
start: start narv server (require root priviledges to chroot)
stop: stop narv server (require root priviledges to chroot)
restart: restart narv server (require root priviledges to chroot)

And args could be:

................................................................................
                shift
                FOSSILFILE=`realpath $1`
                ;;
            --host|-H)
                shift
                DOMAINNAME=$1
                ;;
            console|create|init|init-chroot|restart|start|stop|-h|'help')
                COMMAND=$1
                ;;
            *)
                APPNAME=$1
                ;;
        esac
        shift
................................................................................
    exit 1
fi

case $COMMAND in
    -h|'help')
        usage_help
        ;;
    init)
        if [ -z "$WORKINGREP" ] ; then
            echo
            echo "Please provide necessary informations:"
            echo
            echo "--dest|-d: Destination folder of your installation"
            echo
            echo "If you have any doubt, please see help"
            echo "$0 help"
        fi

        if [ `dirname $FOSSILFILE` = "$WORKINGREP" ] ; then
            echo "For security reasons, install directory and fossil directory MUST be different."
            exit 1
        fi

        echo "Narv init"
        # echo ":: will save fossil repository file in $FOSSILFILE"
        echo ":: will init Narv in $WORKINGREP"

        if [ -e "$WORKINGREP" ] ; then
            echo
            echo "ERROR: $WORKINGREP already exists on your system."
            echo
            echo "If you really wants to do a fresh install at this place, remove it first.
This program will now exit to let you do all the necessary things before."
            exit 1
        fi

        #echo ":: fetching sources"
        #fossil clone http://projects.depar.is/0xGA $FOSSILFILE

        mkdir $WORKINGREP
        #fossil open $FOSSILFILE >/dev/null
        #fossil close

        echo ":: creating shared necessary directories structure"
	install -dm 755 $WORKINGREP/var/log
	install -dm 777 $WORKINGREP/var/tmp
	install -dm 755	$WORKINGREP/usr/bin
	install -dm 755	$WORKINGREP/etc

	install -Dm 755 narv.py $WORKINGREP/usr/bin
	install -Dm 755 narv    $WORKINGREP/usr/bin

        # Init the stuffs needed for chrooting

        echo "General installation finished."
        echo "You may now want to create your first app by entering the command:"
        echo "$WORKINGREP/usr/bin/narv create [-d $WORKINGREP] <appname>"
        ;;
    create)
        if [ -z $APPNAME -o -z $DOMAINNAME ]; then
            echo
            echo "Please provide necessary informations:"
            echo
            echo "--dest|-d: Destination folder of your installation"
            echo "--host|-H: Domain name of your application"







<







 







|







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







12
13
14
15
16
17
18

19
20
21
22
23
24
25
...
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
...
173
174
175
176
177
178
179



















































180
181
182
183
184
185
186
Platform: `uname -o` `uname -r`; `python3 --version`

Usage: $0 [command] [args] <appname>

Where command should be one of:

help: show general help

create: initialize a new website
start: start narv server (require root priviledges to chroot)
stop: stop narv server (require root priviledges to chroot)
restart: restart narv server (require root priviledges to chroot)

And args could be:

................................................................................
                shift
                FOSSILFILE=`realpath $1`
                ;;
            --host|-H)
                shift
                DOMAINNAME=$1
                ;;
            console|create|init-chroot|restart|start|stop|-h|'help')
                COMMAND=$1
                ;;
            *)
                APPNAME=$1
                ;;
        esac
        shift
................................................................................
    exit 1
fi

case $COMMAND in
    -h|'help')
        usage_help
        ;;



















































    create)
        if [ -z $APPNAME -o -z $DOMAINNAME ]; then
            echo
            echo "Please provide necessary informations:"
            echo
            echo "--dest|-d: Destination folder of your installation"
            echo "--host|-H: Domain name of your application"

Added narv_install.sh.









































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/usr/bin/env bash

PAYLOAD="H4sIAL3hZFMAA+3XVVAcTr+gYYK7BBncElwHd3cI7oMM7j64u5NAcCe4u0uQYMGCu0twDzDo+f5V
W6f2Zuvc7Ld7TlWem66u7ou+6Ivf62ji6sFq5QPz78T+L7zc3P+sQF5u9v99/Qc3Dw83DJCDkxMI
5O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fkpDFeora02uJpG0xh8SxM2Xs74fj96SoIkxUyNrIcPon7y3BMvQ+hVDwECDh8ED+dI4VuMys7XC
uhwvcmxLt/PGxk9jz7DjgcXNjc2enm7Q8VqYDZOFL5MA2YDextr3Myp3Q5lXdjNgESMoifyp5UqR
vZgtf46goSMEH/uGqhv0u/wz8g6Sv4ACo5JZx9f4WE47FxM+bM/xChh+ar9wayOr9HaNd32oFH6N
l8EW4aBCT1nNA9+unfec6gM9I7kaozpQE77wt65XO5YvnZP5EcPtvfYbwszL1IU9Y66/IvsBIrtH
fIdTSTVM2qn5ts+jP3EvUx3ph6/OnFoXG3i94/MWxpBqwenQS62ggGOCBCtsPY/T6Pf8cLyQYPs0
lrKl2/Tn7XpZuNIRmCBOQ34e1sPcIOqSLGayb3CMK5o0tnahmU5LYRulMWBeQjGJ7tQnvMSf3bGa
54XEiQJK63hdNfTRKEtT7z7wZ74vEsBu2Rh8NrvHbqev1Ha6e7k/HFlwLqCIz6w83ijlPk9aWBmF
v6ae3lfV87Kpp2z43sJW81uoQjDvSzCGFGYIlajny+SoOq1YOj1t6EhYFZM9q8D4q9Gzon2eDpIA
+Tj0gFlyekXk8ouIJJLIV3GBga1oUykcgRG+mLrh2G/1Amypolp9vUXyvRK7l29wOK4yID+6/99N
8ddff/31119//fXXX3/99/QfYZqsDgAoAAA="

WORKINGREP=`realpath ./narvroot`

echo "$PAYLOAD" | base64 -d > narv.tar.gz
tar xzf narv.tar.gz
rm narv.tar.gz
gzip -d narv.gz narv.py.gz
chmod u+x narv

echo ":: will init Narv in $WORKINGREP"

if [ -e "$WORKINGREP" ] ; then
    echo
    echo "ERROR: $WORKINGREP already exists on your system."
    echo
    echo "If you really wants to do a fresh install at this place, remove it first.
This program will now exit to let you do all the necessary things before."
    exit 1
fi

mkdir $WORKINGREP

echo ":: creating shared necessary directories structure"
install -dm 755 $WORKINGREP/var/log
install -dm 777 $WORKINGREP/var/tmp
install -dm 755	$WORKINGREP/usr/bin
install -dm 755	$WORKINGREP/etc

install -Dm 755 narv.py $WORKINGREP/usr/bin
install -Dm 755 narv    $WORKINGREP/usr/bin

rm narv narv.py

echo "General installation finished."
echo "You may now want to create your first app by entering the command:"
echo "$WORKINGREP/usr/bin/narv create [-d $WORKINGREP] <appname>"