moved to giti2p
parent
37b1a669cb
commit
0a98dcaeb0
|
@ -41,7 +41,6 @@ add_executable(i2pdtunnelwizard main.cpp
|
|||
tunneltype.h
|
||||
randomstringgenerator.h randomstringgenerator.cpp
|
||||
randomstringgenerator.h randomstringgenerator.cpp
|
||||
memorymanagment.h memorymanagment.cpp
|
||||
http/crow.h
|
||||
http/crow/app.h
|
||||
http/crow/ci_map.h
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# i2pd tunnel wizard
|
||||
|
||||
A simple assistant for generating i2pd tunnel configuration files with an intuitive web interface without JS and i18n support (Russian and English).
|
||||
A simple assistant for generating i2pd tunnel configuration files with an intuitive web interface (without JS) and i18n support (Russian and English).
|
||||
|
||||
Clean C++. One external dependency is the `asio` library.
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<a href="{{url}}&lang=en">English</a> | <a href="{{url}}&lang=ru">Русский</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://notabug.org/acetone/i2pdtunnelwizard" target="_blank" style="text-decoration: none">i2pd tunnel wizard</a> v{{version}} <br>
|
||||
<a href="http://git.community.i2p/acetone/i2pdtunnelwizard" target="_blank" style="text-decoration: none">i2pd tunnel wizard</a> v{{version}} <br>
|
||||
acetone, 2025 (no copyright)
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
<a href="{{url}}&lang=en">English</a> | <a href="{{url}}&lang=ru">Русский</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://notabug.org/acetone/i2pdtunnelwizard" target="_blank" style="text-decoration: none">i2pd tunnel wizard</a> v{{version}} <br>
|
||||
<a href="http://git.community.i2p/acetone/i2pdtunnelwizard" target="_blank" style="text-decoration: none">i2pd tunnel wizard</a> v{{version}} <br>
|
||||
acetone, 2025 (no copyright)
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -156,7 +156,7 @@
|
|||
<a href="/?lang=en">English</a> | <a href="/?lang=ru">Русский</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://notabug.org/acetone/i2pdtunnelwizard" target="_blank" style="text-decoration: none">i2pd tunnel wizard</a> v{{version}} <br>
|
||||
<a href="http://git.community.i2p/acetone/i2pdtunnelwizard" target="_blank" style="text-decoration: none">i2pd tunnel wizard</a> v{{version}} <br>
|
||||
acetone, 2025 (no copyright)
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "httpserver.h"
|
||||
#include "../tunnelconstructor.h"
|
||||
#include "../memorymanagment.h"
|
||||
#include "crow/mustache.h"
|
||||
#include "../htmldata.h"
|
||||
#include "../tunnelconstructor.h"
|
||||
|
|
9
main.cpp
9
main.cpp
|
@ -1,9 +1,7 @@
|
|||
#include <iostream>
|
||||
#include "tunnelconstructor.h"
|
||||
#include <fstream>
|
||||
|
||||
#include "http/httpserver.h"
|
||||
#include "htmldata.h"
|
||||
#include "versionnumber.h"
|
||||
|
||||
void usage(char* argv0)
|
||||
{
|
||||
|
@ -13,6 +11,9 @@ void usage(char* argv0)
|
|||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
std::cout << "i2pd tunnel wizard v" << VERSION << std::endl;
|
||||
std::cout << "src: http://git.i2p/acetone/i2pdtunnelwizard" << std::endl;
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
usage(argv[0]);
|
||||
|
@ -22,7 +23,7 @@ int main(int argc, char* argv[])
|
|||
const std::string address (argv[1]);
|
||||
const uint16_t port (std::stoi(argv[2]));
|
||||
|
||||
std::cout << "Address: http://" << address << ":" << port << std::endl;
|
||||
std::cout << "web ui: http://" << address << ":" << port << std::endl;
|
||||
|
||||
crow::App<crow::UTF8> app;
|
||||
app.loglevel(crow::LogLevel::Critical);
|
||||
|
|
|
@ -1,124 +0,0 @@
|
|||
#include "memorymanagment.h"
|
||||
|
||||
/*
|
||||
* Author: David Robert Nadeau
|
||||
* Site: http://NadeauSoftware.com/
|
||||
* License: Creative Commons Attribution 3.0 Unported License
|
||||
* http://creativecommons.org/licenses/by/3.0/deed.en_US
|
||||
*/
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include <psapi.h>
|
||||
|
||||
#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
#include <mach/mach.h>
|
||||
|
||||
#elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
|
||||
#include <fcntl.h>
|
||||
#include <procfs.h>
|
||||
|
||||
#elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
|
||||
#include <stdio.h>
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
#error "Cannot define getPeakRSS( ) or getCurrentRSS( ) for an unknown OS."
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the peak (maximum so far) resident set size (physical
|
||||
* memory use) measured in bytes, or zero if the value cannot be
|
||||
* determined on this OS.
|
||||
*/
|
||||
size_t getPeakRSS( )
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
/* Windows -------------------------------------------------- */
|
||||
PROCESS_MEMORY_COUNTERS info;
|
||||
GetProcessMemoryInfo( GetCurrentProcess( ), &info, sizeof(info) );
|
||||
return (size_t)info.PeakWorkingSetSize;
|
||||
|
||||
#elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
|
||||
/* AIX and Solaris ------------------------------------------ */
|
||||
struct psinfo psinfo;
|
||||
int fd = -1;
|
||||
if ( (fd = open( "/proc/self/psinfo", O_RDONLY )) == -1 )
|
||||
return (size_t)0L; /* Can't open? */
|
||||
if ( read( fd, &psinfo, sizeof(psinfo) ) != sizeof(psinfo) )
|
||||
{
|
||||
close( fd );
|
||||
return (size_t)0L; /* Can't read? */
|
||||
}
|
||||
close( fd );
|
||||
return (size_t)(psinfo.pr_rssize * 1024L);
|
||||
|
||||
#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
|
||||
/* BSD, Linux, and OSX -------------------------------------- */
|
||||
struct rusage rusage;
|
||||
getrusage( RUSAGE_SELF, &rusage );
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
return (size_t)rusage.ru_maxrss;
|
||||
#else
|
||||
return (size_t)(rusage.ru_maxrss * 1024L);
|
||||
#endif
|
||||
|
||||
#else
|
||||
/* Unknown OS ----------------------------------------------- */
|
||||
return (size_t)0L; /* Unsupported. */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the current resident set size (physical memory use) measured
|
||||
* in bytes, or zero if the value cannot be determined on this OS.
|
||||
*/
|
||||
size_t getCurrentRSS( )
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
/* Windows -------------------------------------------------- */
|
||||
PROCESS_MEMORY_COUNTERS info;
|
||||
GetProcessMemoryInfo( GetCurrentProcess( ), &info, sizeof(info) );
|
||||
return (size_t)info.WorkingSetSize;
|
||||
|
||||
#elif defined(__APPLE__) && defined(__MACH__)
|
||||
/* OSX ------------------------------------------------------ */
|
||||
struct mach_task_basic_info info;
|
||||
mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
|
||||
if ( task_info( mach_task_self( ), MACH_TASK_BASIC_INFO,
|
||||
(task_info_t)&info, &infoCount ) != KERN_SUCCESS )
|
||||
return (size_t)0L; /* Can't access? */
|
||||
return (size_t)info.resident_size;
|
||||
|
||||
#elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
|
||||
/* Linux ---------------------------------------------------- */
|
||||
long rss = 0L;
|
||||
FILE* fp = NULL;
|
||||
if ( (fp = fopen( "/proc/self/statm", "r" )) == NULL )
|
||||
return (size_t)0L; /* Can't open? */
|
||||
if ( fscanf( fp, "%*s%ld", &rss ) != 1 )
|
||||
{
|
||||
fclose( fp );
|
||||
return (size_t)0L; /* Can't read? */
|
||||
}
|
||||
fclose( fp );
|
||||
return (size_t)rss * (size_t)sysconf( _SC_PAGESIZE);
|
||||
|
||||
#else
|
||||
/* AIX, BSD, Solaris, and Unknown OS ------------------------ */
|
||||
return (size_t)0L; /* Unsupported. */
|
||||
#endif
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
//#pragma once
|
||||
|
||||
/*
|
||||
* Author: David Robert Nadeau
|
||||
* Site: http://NadeauSoftware.com/
|
||||
* License: Creative Commons Attribution 3.0 Unported License
|
||||
* http://creativecommons.org/licenses/by/3.0/deed.en_US
|
||||
*/
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include <psapi.h>
|
||||
|
||||
#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
#include <mach/mach.h>
|
||||
|
||||
#elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
|
||||
#include <fcntl.h>
|
||||
#include <procfs.h>
|
||||
|
||||
#elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
|
||||
#include <stdio.h>
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
#error "Cannot define getPeakRSS( ) or getCurrentRSS( ) for an unknown OS."
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
size_t getPeakRSS( );
|
||||
size_t getCurrentRSS( );
|
Loading…
Reference in New Issue