Refactoring
This commit is contained in:
22
README
22
README
@@ -13,7 +13,13 @@ A gemini server written in rust.
|
|||||||
|
|
||||||
## Installation and running
|
## Installation and running
|
||||||
|
|
||||||
OpenSSL 1.1.0g or LibreSSL 2.7.0 or newer is required.
|
It's recommended that you build with Libressl instead of Openssl
|
||||||
|
|
||||||
|
## Install from crates.io:
|
||||||
|
|
||||||
|
cargo install gemserv
|
||||||
|
|
||||||
|
## Build from source:
|
||||||
|
|
||||||
- Clone the repo
|
- Clone the repo
|
||||||
- If you want to use all features run 'cargo build --release' or if you only
|
- If you want to use all features run 'cargo build --release' or if you only
|
||||||
@@ -26,20 +32,6 @@ OpenSSL 1.1.0g or LibreSSL 2.7.0 or newer is required.
|
|||||||
In the init-scripts directory there's OpenRC(Courtesy of Tastytea) and systemd
|
In the init-scripts directory there's OpenRC(Courtesy of Tastytea) and systemd
|
||||||
service files.
|
service files.
|
||||||
|
|
||||||
### NetBSD
|
|
||||||
If running on NetBSD you'll need to set the environmental variable OPENSSL_DIR
|
|
||||||
before compiling.
|
|
||||||
|
|
||||||
'export OPENSSL_DIR="/usr/pkg"'
|
|
||||||
|
|
||||||
Also to run you'll need to symlink libssl, and libcrypt to "/usr/lib" by
|
|
||||||
running:
|
|
||||||
|
|
||||||
'ln -s /usr/pkg/lib/libssl.so.1.1 /usr/lib'
|
|
||||||
'ln -s /usr/pkg/lib/libcrypt.so.1.1 /usr/lib'
|
|
||||||
|
|
||||||
Thanks to tiwesdaeg for figuring it out.
|
|
||||||
|
|
||||||
## CGI and SCGI
|
## CGI and SCGI
|
||||||
|
|
||||||
There's example SCGI scripts for python and perl in the cgi-scripts directory.
|
There's example SCGI scripts for python and perl in the cgi-scripts directory.
|
||||||
|
|||||||
4
src/lib/mod.rs
Normal file
4
src/lib/mod.rs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
pub mod util;
|
||||||
|
pub mod status;
|
||||||
|
pub mod conn;
|
||||||
|
pub mod tls;
|
||||||
12
src/main.rs
12
src/main.rs
@@ -17,15 +17,17 @@ use tokio::io::AsyncReadExt;
|
|||||||
use tokio::runtime;
|
use tokio::runtime;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
mod lib;
|
||||||
mod cgi;
|
mod cgi;
|
||||||
mod config;
|
mod config;
|
||||||
mod status;
|
|
||||||
use status::Status;
|
|
||||||
mod conn;
|
|
||||||
mod logger;
|
mod logger;
|
||||||
mod revproxy;
|
mod revproxy;
|
||||||
mod tls;
|
|
||||||
mod util;
|
use lib::util;
|
||||||
|
use lib::conn;
|
||||||
|
use lib::status;
|
||||||
|
use status::Status;
|
||||||
|
use lib::tls;
|
||||||
|
|
||||||
fn get_mime(path: &PathBuf) -> String {
|
fn get_mime(path: &PathBuf) -> String {
|
||||||
let mut mime = "text/gemini".to_string();
|
let mut mime = "text/gemini".to_string();
|
||||||
|
|||||||
Reference in New Issue
Block a user