Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bba916e0f | ||
|
|
21ff9787e8 | ||
|
|
6f3edbdfd9 | ||
|
|
e3c7ce0604 | ||
|
|
441debc4c7 | ||
|
|
9206dce65f | ||
|
|
038a9176d5 |
14
README.md
14
README.md
@@ -100,7 +100,7 @@ echo 'alias tbc="nc termbin.com 9999 | pbcopy"' >> .bash_profile
|
|||||||
echo less typing now! | tbc
|
echo less typing now! | tbc
|
||||||
```
|
```
|
||||||
|
|
||||||
__Remember__ to restart your terminal session after adding any of provided above!
|
__Remember__ to reload the shell with `source ~/.bashrc` or `source ~/.bash_profile` after adding any of provided above!
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -131,13 +131,19 @@ To use fiche you have to have netcat installed. You probably already have it - t
|
|||||||
sudo make install
|
sudo make install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using Ports on FreeBSD
|
||||||
|
|
||||||
|
To install the port: `cd /usr/ports/net/fiche/ && make install clean`. To add the package: `pkg install fiche`.
|
||||||
|
|
||||||
|
_See [#86](https://github.com/solusipse/fiche/issues/86) for more info._
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: fiche [-D6epbsdSolBuw].
|
usage: fiche [-D6epbsdSolBuw].
|
||||||
[-d domain] [-p port] [-s slug size]
|
[-d domain] [-L listen_addr ] [-p port] [-s slug size]
|
||||||
[-o output directory] [-B buffer size] [-u user name]
|
[-o output directory] [-B buffer size] [-u user name]
|
||||||
[-l log file] [-b banlist] [-w whitelist] [-S]
|
[-l log file] [-b banlist] [-w whitelist] [-S]
|
||||||
```
|
```
|
||||||
@@ -196,8 +202,8 @@ fiche -s 6
|
|||||||
__Output url with default value__: `http://localhost/xxxx`,
|
__Output url with default value__: `http://localhost/xxxx`,
|
||||||
where x is a randomized character
|
where x is a randomized character
|
||||||
|
|
||||||
__Output url with example value 6__: `http://localhost/xxxx`,
|
__Output url with example value 6__: `http://localhost/xxxxxx`,
|
||||||
where is a randomized character
|
where x is a randomized character
|
||||||
|
|
||||||
__Default value:__ 4
|
__Default value:__ 4
|
||||||
|
|
||||||
|
|||||||
7
fiche.c
7
fiche.c
@@ -197,6 +197,8 @@ void fiche_init(Fiche_Settings *settings) {
|
|||||||
"example.com",
|
"example.com",
|
||||||
// output dir
|
// output dir
|
||||||
"code",
|
"code",
|
||||||
|
// listen_addr
|
||||||
|
"0.0.0.0",
|
||||||
// port
|
// port
|
||||||
9999,
|
9999,
|
||||||
// slug length
|
// slug length
|
||||||
@@ -442,7 +444,7 @@ static int start_server(Fiche_Settings *settings) {
|
|||||||
// Prepare address and port handler
|
// Prepare address and port handler
|
||||||
struct sockaddr_in address;
|
struct sockaddr_in address;
|
||||||
address.sin_family = AF_INET;
|
address.sin_family = AF_INET;
|
||||||
address.sin_addr.s_addr = INADDR_ANY;
|
address.sin_addr.s_addr = inet_addr(settings->listen_addr);
|
||||||
address.sin_port = htons(settings->port);
|
address.sin_port = htons(settings->port);
|
||||||
|
|
||||||
// Bind to port
|
// Bind to port
|
||||||
@@ -457,7 +459,8 @@ static int start_server(Fiche_Settings *settings) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
print_status("Server started listening on port: %d.", settings->port);
|
print_status("Server started listening on: %s:%d.",
|
||||||
|
settings->listen_addr, settings->port);
|
||||||
print_separator();
|
print_separator();
|
||||||
|
|
||||||
// Run dispatching loop
|
// Run dispatching loop
|
||||||
|
|||||||
5
fiche.h
5
fiche.h
@@ -43,6 +43,11 @@ typedef struct Fiche_Settings {
|
|||||||
*/
|
*/
|
||||||
char *output_dir_path;
|
char *output_dir_path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Address on which fiche is waiting for connections
|
||||||
|
*/
|
||||||
|
char *listen_addr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Port on which fiche is waiting for connections
|
* @brief Port on which fiche is waiting for connections
|
||||||
*/
|
*/
|
||||||
|
|||||||
13
main.c
13
main.c
@@ -44,7 +44,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
// Parse input arguments
|
// Parse input arguments
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt(argc, argv, "D6eSp:b:s:d:o:l:B:u:w:")) != -1) {
|
while ((c = getopt(argc, argv, "D6eSL:p:b:s:d:o:l:B:u:w:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|
||||||
// domain
|
// domain
|
||||||
@@ -61,6 +61,13 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// listen_addr
|
||||||
|
case 'L':
|
||||||
|
{
|
||||||
|
fs.listen_addr = optarg;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
// slug size
|
// slug size
|
||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
@@ -120,8 +127,8 @@ int main(int argc, char **argv) {
|
|||||||
// Display help in case of any unsupported argument
|
// Display help in case of any unsupported argument
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
printf("usage: fiche [-dpsSoBulbw].\n");
|
printf("usage: fiche [-dLpsSoBulbw].\n");
|
||||||
printf(" [-d domain] [-p port] [-s slug size]\n");
|
printf(" [-d domain] [-L listen_addr] [-p port] [-s slug size]\n");
|
||||||
printf(" [-o output directory] [-B buffer size] [-u user name]\n");
|
printf(" [-o output directory] [-B buffer size] [-u user name]\n");
|
||||||
printf(" [-l log file] [-b banlist] [-w whitelist] [-S]\n");
|
printf(" [-l log file] [-b banlist] [-w whitelist] [-S]\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user