-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.map
1 lines (1 loc) · 7.13 KB
/
start.map
1
{"version":3,"sources":["start.coffee"],"names":[],"mappings":";AACA,IAAA,WAAA;EAAA;oBAAA;;AAAA;AACC,EAAA,OAAA,CAAQ,QAAR,CAAA,CAAA;;AAEY,EAAA,qBAAA,GAAA;AACX,qCAAA,CAAA;AAAA,yCAAA,CAAA;AAAA,qDAAA,CAAA;AAAA,qDAAA,CAAA;AAAA,mDAAA,CAAA;AAAA,IAAA,IAAC,CAAA,UAAD,GAAY,CAAZ,CAAA;AAAA,IAEA,IAAC,CAAA,IAAD,GAAM,gBAFN,CAAA;AAIA,IAAA,IAAG,OAAO,CAAC,MAAR,CAAA,CAAA,GAAiB,CAApB;AACC,MAAA,IAAC,CAAA,GAAD,CAAM,4BAAA,GAA4B,IAAC,CAAA,IAAnC,CAAA,CAAA;AAAA,MACA,OAAO,CAAC,IAAR,CAAa,CAAb,CADA,CADD;KAJA;AAAA,IAOA,IAAC,CAAA,KAAD,CAAO,CAAP,EAAU,WAAA,GAAW,IAAC,CAAA,IAAZ,GAAiB,GAA3B,CAPA,CAAA;AAAA,IAQA,IAAC,CAAA,UAAD,CAAA,CARA,CAAA;AAAA,IASA,IAAC,CAAA,WAAD,CAAa,CAAA,SAAA,KAAA,GAAA;aAAA,SAAA,GAAA;eACZ,KAAC,CAAA,WAAD,CAAA,EADY;MAAA,EAAA;IAAA,CAAA,CAAA,CAAA,IAAA,CAAb,CATA,CADW;EAAA,CAFZ;;AAAA,wBAiBA,UAAA,GAAW,SAAA,GAAA;AACV,QAAA,QAAA;AAAA,IAAA,KAAA,GAAQ,OAAA,CAAQ,OAAR,CAAR,CAAA;AACA;AACC,MAAA,IAAC,CAAA,GAAD,GAAK,KAAK,CAAC,QAAN,CAAe,QAAf,CAAL,CAAA;aACA,IAAC,CAAA,GAAD,GAAK,KAAK,CAAC,QAAN,CAAe,SAAf,EAFN;KAAA,cAAA;AAKC,MAFK,U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M,SAAA,GAAA;AACL,QAAA,WAAA;AAAA,IADM,sBAAM,8DACZ,CAAA;AAAA,IAAA,IAAG,KAAA,IAAO,IAAC,CAAA,UAAX;aACC,OAAO,CAAC,KAAR,gBAAc,CAAA,aAAa,CAAC,KAAM,SAAA,aAAA,IAAA,CAAA,CAAlC,EADD;KADK;EAAA,CAlFN,CAAA;;AAAA,wBAsFA,GAAA,GAAI,SAAA,GAAA;AACH,QAAA,IAAA;AAAA,IADI,8DACJ,CAAA;AAAA,IAAA,IAAG,IAAC,CAAA,UAAD,GAAY,CAAf;aACC,OAAO,CAAC,KAAR,gBAAc,CAAA,aAAa,CAAC,GAAG,CAAC,OAAQ,SAAA,aAAA,IAAA,CAAA,CAAxC,EADD;KADG;EAAA,CAtFJ,CAAA;;qBAAA;;IADD,CAAA;;AAAA,IA2FI,WAAA,CAAA,CA3FJ,CAAA","file":"start.js","sourceRoot":"","sourcesContent":["# Server startup script\nclass YmSmtpStart\n\trequire('colors');\n\n\tconstructor:()->\n\t\t@debuglevel=5\n\n\t\t@name='Youmagine SMTP'\n\t\t# must be root\n\t\tif process.getuid()>1\n\t\t\t@err \"You must be root to start #{@name}\"\n\t\t\tprocess.exit(1);\n\t\t@debug 1,\"Starting #{@name} \"\n\t\t@checkUsers()\n\t\t@setupServer(=>\n\t\t\t@startHaraka()\n\t\t)\n\t\t\t\n\n\tcheckUsers:=>\n\t\tposix = require('posix')\n\t\ttry\n\t\t\t@uid=posix.getpwnam('nobody')\n\t\t\t@gid=posix.getgrnam('nogroup')\n\t\tcatch e\n\t\t\t# do nothing \n\t\t\t@err \"I want to drop privileges to nobody/nogroup, but the unix user and group do not exist\",e\n\t\t\tprocess.exit(1);\n\n\n\tsetupServer:(callback)=>\n\t\trsync = require('rsync')\n\t\tfs = require('fs')\n\t\tsync = new rsync().flags('ar').source(\"#{__dirname}/project/server/\").destination(\"#{__dirname}/server/\")\n\t\tsync.execute( (error, code, cmd)=>\n\t\t\tif error?\n\t\t\t\t@err 'Failed to sync server configuration',error,code,cmd\n\t\t\t\tprocess.exit(1)\n\t\t\t@debug 1,\"Synced server configuration\"\n\t\t\tcallback()\n\t\t)\n\t\tfs.chmod(\"#{__dirname}/spool\",(parseInt(\"0777\",8)))\n \n\tstartHaraka:=>\n\t\tforever = require('forever-monitor');\n\t\tconfig=\n\t\t\tmax:3 \n\t\t\targs:['--config',\"#{__dirname}/server/\"]\n\t\t\tminUptime:2000\n\t\t\tspinSleepTime:2000\n\t\t\tlogFile:\"#{__dirname}/logs/log.log\"\n\t\t\toutFile:\"#{__dirname}/logs/log.out\"\n\t\t\terrFile:\"#{__dirname}/logs/log.err\"\n\t\t\tsilent:true\n\n\t\tif @debuglevel>5\n\t\t\tconfig.silent = false\n\n\t\tif @debuglevel>0\n\t\t\tTail = require('tail').Tail;\n\t\t\ttail = new Tail(\"#{__dirname}/logs/ymsmtp.log\")\n\t\t\ttail.on(\"line\",(data)=>\n\t\t\t\tconsole.error 'YmSmtpLog'.green,data\n\t\t\t)\n\n\t\tchild = new (forever.Monitor)(\"#{__dirname}/node_modules/Haraka/bin/haraka\",config)\n\t\tchild.on('start', (p,d)=>\n\t\t\t@debug 3,'Haraka start'.blue,'PID:',d.pid,'FPID:',d.foreverPid\n\t\t);\n\t\tchild.on('stop', (p)=>\n\t\t\t@debug 3,'Haraka stopped'.blue\n\t\t);\n\t\tchild.on('restart', ()=>\n\t\t\t@debug 3,'Haraka restart'.blue,'PID:',child.childData.pid,'FPID:',child.childData.foreverPid\n\t\t);\n\t\tchild.on('error', (e)=>\n\t\t\t@err 'Haraka error'.blue,e,\"Check logfiles in logs/ to see what might have happened\";\n\t\t);\n\t\tchild.on('exit', (c)=>\n\t\t\t@err 'Haraka ended'.blue,\"Check logfiles in logs/ to see what might have happened\";\n\t\t);\n\t\tchild.start()\n\n\n\tdebug:(level,data...)=>\n\t\tif level<=@debuglevel\n\t\t\tconsole.error 'YmSmtpStart'.green,data...\n\n\terr:(data...)=>\n\t\tif @debuglevel>0\n\t\t\tconsole.error 'YmSmtpStart'.red.bgWhite,data...\n\nnew YmSmtpStart()\n\n\n"]}