commit 937f9f836fb50f91a011ee5e4e3be4fea1e47123 from: Aleksey Ryndin date: Mon Aug 28 11:17:34 2023 UTC Add how_to_run_locally.gmi commit - 7e2de1f4daae77879bab854760b85da96ae2433c commit + 937f9f836fb50f91a011ee5e4e3be4fea1e47123 blob - /dev/null blob + 112c44f7940521b8d79e71dab0d9929dc04e5be6 (mode 644) --- /dev/null +++ capsule/how_to_run_locally.gmi @@ -0,0 +1,57 @@ +# How to run vostok locally + +* Clone repository content: +``` +$ git clone ssh://anonymous@got.any-key.press/vostok +$ cd vostok +``` + +* Bind domain name "gemini.localhost" lo local IP address "127.0.0.1" (run as root): +``` +# echo "127.0.0.1 gemini.localhost" >> /etc/hosts +``` + +* Generate self-signed certificate and key for "gemini.localhost": +``` +$ mkdir cert/ +$ openssl req -newkey rsa:4096 -nodes -keyout cert/server.key -x509 -days 36500 -out cert/server.crt +Generating a 4096 bit RSA private key +<...> +writing new private key to 'cert/server.key' +----- +You are about to be asked to enter information that will be incorporated +into your certificate request. +What you are about to enter is what is called a Distinguished Name or a DN. +There are quite a few fields but you can leave some blank +For some fields there will be a default value, +If you enter '.', the field will be left blank. +----- +Country Name (2 letter code) []: +State or Province Name (full name) []: +Locality Name (eg, city) []: +Organization Name (eg, company) []: +Organizational Unit Name (eg, section) []: +Common Name (eg, fully qualified host name) []:gemini.localhost +Email Address []: +``` + +* Build and run server: +``` +$ make run_server +make -C vostok +c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o transport.o transport.cc +c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o error.o error.cc +c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o gemini.o gemini.cc +c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o args.o args.cc +c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o parse_url.o parse_url.cc +c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o open_file.o open_file.cc +c++ -O2 -pipe -Wall -Wextra -std=c++11 -c -o vostok.o vostok.cc +c++ -o vostok transport.o error.o gemini.o args.o parse_url.o open_file.o vostok.o -ltls +./vostok/vostok -c cert/server.crt -k cert/server.key -f ./ +🚀 Vostok server listening... +``` + +* Display index page using your favorite Gemini client (from another console): +``` +$ amfora gemini.localhost +```