Blob


1 # How to run vostok locally
3 * Install external dependencies if needed:
5 => external_dependencies.gmi vostok external dependencies
7 * Clone repository content:
8 ```
9 $ git clone ssh://anonymous@got.any-key.press/vostok
10 $ cd vostok
11 ```
13 * Bind domain name "gemini.localhost" lo local IP address "127.0.0.1" (run as root):
14 ```
15 # echo "127.0.0.1 gemini.localhost" >> /etc/hosts
16 ```
18 * Generate self-signed certificate and key for "gemini.localhost":
19 ```
20 $ mkdir cert/
21 $ openssl req -newkey rsa:4096 -nodes -keyout cert/server.key -x509 -days 36500 -out cert/server.crt
22 Generating a 4096 bit RSA private key
23 <...>
24 writing new private key to 'cert/server.key'
25 -----
26 You are about to be asked to enter information that will be incorporated
27 into your certificate request.
28 What you are about to enter is what is called a Distinguished Name or a DN.
29 There are quite a few fields but you can leave some blank
30 For some fields there will be a default value,
31 If you enter '.', the field will be left blank.
32 -----
33 Country Name (2 letter code) []:
34 State or Province Name (full name) []:
35 Locality Name (eg, city) []:
36 Organization Name (eg, company) []:
37 Organizational Unit Name (eg, section) []:
38 Common Name (eg, fully qualified host name) []:gemini.localhost
39 Email Address []:
40 ```
42 * Build and run server:
43 ```
44 $ make run
45 make -C vostok
46 c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o transport.o transport.cc
47 c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o error.o error.cc
48 c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o gemini.o gemini.cc
49 c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o args.o args.cc
50 c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o parse_url.o parse_url.cc
51 c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o open_file.o open_file.cc
52 c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o vostok.o vostok.cc
53 c++ -o vostok transport.o error.o gemini.o args.o parse_url.o open_file.o vostok.o -ltls
54 ./vostok/vostok -c cert/server.crt -k cert/server.key -f ./
55 🚀 Vostok server listening...
56 ```
58 * Display index page using your favorite Gemini client (from another console):
59 ```
60 $ amfora gemini.localhost
61 ```