From c588eb86d9a3f9ba6b76e3fe66e66476b6f895ca Mon Sep 17 00:00:00 2001 From: Banana Date: Tue, 14 Apr 2020 00:08:38 +0200 Subject: [PATCH] updateting c client and readme --- CHANGELOG | 4 +++- client/c-client/selfpaste.c | 11 +++++++---- documentation/clients.txt | 3 +++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 40d7915..4a0701c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ -tbd version 0.4-beta Beryllium +tbd version 1.0 Beryllium +* final 1.0 working version * added perl as default allowed file * added shellscript to the default allowed files * added html and js to the default allowed files @@ -6,6 +7,7 @@ tbd version 0.4-beta Beryllium to clean old pastes. See clean-cronjob.txt for more details * Multiple secrets are now supported +* added a c client which can be build with the makefile 2020101 version 0.3-beta Lithium * Update information now included diff --git a/client/c-client/selfpaste.c b/client/c-client/selfpaste.c index 10890a7..2aa4bb1 100644 --- a/client/c-client/selfpaste.c +++ b/client/c-client/selfpaste.c @@ -153,22 +153,25 @@ int main(int argc, char *argv[]) { } else { printf("ERROR: Configfile '%s' not found.\n",configFilePath); if(arguments.create_config_file == 1) { - if(arguments.verbose) printf("Creating configfile: '%s'\n", configFilePath); + printf("Creating configfile: '%s'\n", configFilePath); FILE *fp = fopen(configFilePath, "w"); if (fp) { fputs("# selfpaste config file.\n", fp); fprintf(fp, "# See %s for more details.\n", argp_program_bug_address); fprintf(fp, "# Version: %s\n", argp_program_version); - fprintf(fp, "SELFPASTE_SECRET=%s\n", randomString(50)); + fprintf(fp, "SELFPASTE_UPLOAD_SECRET=%s\n", randomString(50)); + fputs("ENDPOINT=http://you-seflpaste-endpoi.nt\n", fp); fclose(fp); - if(arguments.verbose) printf("Config file '%s' created.\n", configFilePath); + + printf("Config file '%s' created.\nPlease update your settings!\n", configFilePath); + return(0); } else { printf("ERROR: Configfile '%s' could not be written.\n",configFilePath); - return(1); } } + return(1); } return(0); diff --git a/documentation/clients.txt b/documentation/clients.txt index d677b53..55e2dd1 100644 --- a/documentation/clients.txt +++ b/documentation/clients.txt @@ -2,6 +2,9 @@ A bash client 'selfpaste.sh' is available for use in the client folder. To create this file just copy selfpaste.default.sh to selfpaste.sh and make sure you change ENDPOINT and SELFPASTE_UPLOAD_SECRET. +A c client is available to be build with makefile. Build and see included +help for more information. + Requirements to create a new client are: - Talk to the selfpaste endpoint over HTTP(S) -- 2.39.5