123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360 |
- Me.load({
- makeme: '>=0.9.0',
- plugins: [ 'installs' ],
- blend: [
- 'src/*/*.me',
- 'test/test.me',
- 'paks/ssl/*.me',
- 'doc/doc.me',
- ],
- configure: {
- requires: [ 'osdep' ],
- discovers: [ 'ssl' ],
- },
- settings: {
- integrate: true,
-
- prefixes: 'install-prefixes',
- manifest: 'installs/manifest.me',
- certs: {
- gendh: true
- },
- compiler: {
- fortify: true
- },
-
- goahead: {
-
- accessLog: false,
-
- auth: true,
-
- authStore: 'file',
-
- autoLogin: false,
- clientCache: [ 'css', 'gif', 'ico', 'jpg', 'js', 'png', ],
- clientCacheLifespan: 86400,
-
- cgi: true,
-
- cgiVarPrefix: "CGI_"
-
- digest: true,
-
- documents: 'web',
-
- javascript: true,
-
- legacy: false,
-
- limitBuffer: 1024,
- limitFiles: 0,
- limitFilename: 256,
- limitHeader: 2048,
- limitHeaders: 4096,
- limitNumHeaders: 64,
- limitParseTimeout: 5,
- limitPassword: 32,
- limitPost: 16384,
- limitPut: 204800000,
- limitSessionLife: 1800,
- limitSessionCount: 512,
- limitString: 256,
- limitTimeout: 60,
- limitUri: 2048,
- limitUpload: 204800000,
-
- listen: ['http://*:80', 'https://*:443']
-
- logging: true,
- logfile: 'stderr:0',
- tracing: true,
-
- putDir: '.',
-
- realm: 'example.com',
-
- replaceMalloc: false,
-
- stealth: true,
- ssl: {
- authority: '',
- cache: 512,
- certificate: 'self.crt',
- ciphers: '',
- key: 'self.key',
- logLevel: 5
- handshakes: 1,
- revoke: '',
- ticket: true,
- timeout: 86400,
- verifyIssuer: false,
- verifyPeer: false,
- },
-
- upload: true,
- uploadDir: 'tmp',
-
- xframeHeader: 'SAMEORIGIN',
- },
- mbedtls: {
- compact: true,
- },
-
- rom: false,
- },
- usage: {
- 'goahead.accessLog': 'Enable request access log (true|false)',
- 'goahead.caFile': 'File of client certificates (path)',
- 'goahead.certificate': 'Server certificate for SSL (path)',
- 'goahead.ciphers': 'SSL cipher suite (string)',
- 'goahead.cgi': 'Enable the CGI handler (true|false)',
- 'goahead.cgiBin': 'Directory CGI programs (path)',
- 'goahead.clientCache': 'Extensions to cache in the client (Array)',
- 'goahead.clientCacheLifespan':'Lifespan in seconds to cache in the client',
- 'goahead.javascript': 'Enable the Javascript JST handler (true|false)',
- 'goahead.key': 'Server private key for SSL (path)',
- 'goahead.legacy': 'Enable the GoAhead 2.X legacy APIs (true|false)',
- 'goahead.limitBuffer': 'I/O Buffer size. Also chunk size.',
- 'goahead.limitFilename': 'Maximum filename size',
- 'goahead.limitHeader': 'Maximum HTTP single header size',
- 'goahead.limitHeaders': 'Maximum HTTP header size',
- 'goahead.limitNumHeaders': 'Maximum number of headers',
- 'goahead.limitPassword': 'Maximum password size',
- 'goahead.limitPost': 'Maximum POST (and other method) incoming body size',
- 'goahead.limitPut': 'Maximum PUT body size ~ 200MB',
- 'goahead.limitSessionLife': 'Session lifespan in seconds (30 mins)',
- 'goahead.limitSessionCount': 'Maximum number of sessions to support',
- 'goahead.limitString': 'Default string allocation size',
- 'goahead.limitTimeout': 'Request inactivity timeout in seconds',
- 'goahead.limitUri': 'Maximum URI size',
- 'goahead.limitUpload': 'Maximum upload size ~ 200MB',
- 'goahead.listen': 'Addresses to listen to (["http://IP:port", ...])',
- 'goahead.logfile': 'Default location and level for debug log (path:level)',
- 'goahead.logging': 'Enable application logging (true|false)',
- 'goahead.pam': 'Enable Unix Pluggable Auth Module (true|false)',
- 'goahead.putDir': 'Define the directory for file uploaded via HTTP PUT (path)',
- 'goahead.realm': 'Authentication realm (string)',
- 'goahead.revoke': 'List of revoked client certificates',
- 'goahead.replaceMalloc': 'Replace malloc with non-fragmenting allocator (true|false)',
- 'goahead.ssl.cache': 'Set the session cache size (items)',
- 'goahead.ssl.logLevel': 'Starting logging level for SSL messages',
- 'goahead.ssl.renegotiate': 'Enable/Disable SSL renegotiation (defaults to true)',
- 'goahead.ssl.ticket': 'Enable session resumption via ticketing - client side session caching',
- 'goahead.ssl.timeout': 'Session and ticketing duration in seconds',
- 'goahead.stealth': 'Run in stealth mode. Disable OPTIONS, TRACE (true|false)',
- 'goahead.tune': 'Optimize (size|speed|balanced)',
- 'goahead.upload': 'Enable file upload (true|false)',
- 'goahead.uploadDir': 'Define directory for uploaded files (path)',
- 'rom': 'Build without a file system (true|false)',
- },
- customize: [
-
- 'custom.me',
- ],
- scripts: {
- postconfig: `
- if (me.settings.goahead.authStore != 'pam') {
- me.settings.compiler.hasPam = false
- }
- `,
- },
- targets: {
- libgo: {
- type: 'lib',
- sources: [ 'src/*.c' ],
- headers: [ 'src/*.h' ],
- exclude: /goahead\.c/,
- depends: [ 'osdep', 'ssl' ],
- scripts: {
- prebuild: `
- if (me.settings.compiler.hasPam && me.settings.goahead.pam) {
- me.target.libraries.push('pam')
- }
- `
- },
- },
- goahead: {
- type: 'exe',
- sources: [ 'src/goahead.c' ],
- headers: [ 'src/*.h' ],
- depends: [ 'libgo', 'install-certs' ],
- scripts: {
- prebuild: `
- if (me.settings.compiler.hasPam) {
- me.target.libraries.push('pam')
- }
- cp(['${BIN}/self.key', '${BIN}/self.crt'], 'src')
- cp(['${BIN}/self.key', '${BIN}/self.crt'], 'test')
- `,
- },
- },
-
- gopass: {
- enable: 'me.settings.goahead.auth',
- type: 'exe',
- sources: [ 'src/utils/gopass.c' ],
- headers: [ 'src/*.h' ],
- depends: [ 'libgo' ],
- },
-
- webcomp: {
- enable: 'me.settings.rom',
- type: 'exe',
- sources: [ 'src/utils/webcomp.c' ],
- headers: [ 'src/*.h' ],
- depends: [ ],
- },
- run: {
- home: 'src',
- run: 'goahead -v',
- },
- rom: {
- action: `
- let path = Path('src/rom.c')
- trace('Create', path)
- path.write(Cmd.run('webcomp rom.files', {dir: 'src'}))
- `,
- },
- install: {
- home: '${TOP}',
- generate: ' ',
- depends: [ 'all', 'stop', 'installBinary', 'start' ],
- action: `
- trace('Info', me.settings.title + ' installed at ' + me.prefixes.vapp)
- trace('Info', 'Configuration directory ' + me.prefixes.etc)
- trace('Info', 'Documents directory ' + me.prefixes.web)
- trace('Info', 'Executables directory ' + me.prefixes.vapp.join('bin'))
- trace('Info', 'Use "man goahead" for usage')
- trace('Info', 'Run via "cd ' + me.prefixes.etc + ' ; sudo goahead -v ' + me.prefixes.web + '"')
- trace('Info', 'Browse to ' + me.settings.goahead.listen[0].replace('*', 'localhost').replace(':80', '/'))
- let pid = Cmd.ps('goahead')
- if (pid && pid.length > 0) {
- trace('Info', me.settings.title + ' PID: ' + pid[0].pid)
- }
- `,
- },
- projects: {
- action: `genProjects('')`,
- },
- publish: {
- action: `publish()`,
- },
- mine: {
- action: `genProjects('', 'mine', Config.OS + '-' + Config.CPU)`,
- },
- mgen: {
- action: `genProjects('-with mbedtls', 'mine', Config.OS + '-' + Config.CPU)`,
- }
- },
- })
|