├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── NOTICE ├── README.md ├── bin ├── README.md ├── out │ └── README.md └── unit │ └── README.md ├── build.cfg.sample ├── build.cmd ├── build.dev.cfg.sample ├── build.prod.cfg.sample ├── build.sh ├── src ├── Apps │ ├── Implementations │ │ └── FanoAppImpl.pas │ └── Includes │ │ └── units.inc ├── Libs │ ├── Dir │ │ ├── Contracts │ │ │ ├── DirectoryCreatorIntf.pas │ │ │ └── DirectoryExistsIntf.pas │ │ └── Implementations │ │ │ ├── DirectoryCreatorImpl.pas │ │ │ ├── DirectoryExistsImpl.pas │ │ │ └── NullDirectoryExistsImpl.pas │ ├── File │ │ ├── Contracts │ │ │ ├── ContentModifierIntf.pas │ │ │ ├── FileContentAppenderIntf.pas │ │ │ ├── FileContentReaderIntf.pas │ │ │ ├── FileContentWriterIntf.pas │ │ │ └── TextFileCreatorIntf.pas │ │ └── Implementations │ │ │ ├── ContentModifierImpl.pas │ │ │ ├── CopyrightContentModifierImpl.pas │ │ │ ├── DecoratorContentModifierImpl.pas │ │ │ ├── FileHelperAppendImpl.pas │ │ │ ├── FileHelperImpl.pas │ │ │ ├── NullContentModifierImpl.pas │ │ │ ├── StdoutTextFileCreatorImpl.pas │ │ │ ├── TextFileCreatorImpl.pas │ │ │ └── TextFileCreatorWithModifierImpl.pas │ ├── Includes │ │ └── units.inc │ ├── KeyGen │ │ ├── Contracts │ │ │ └── KeyGeneratorIntf.pas │ │ └── Implementations │ │ │ └── BasicKeyGeneratorImpl.pas │ ├── List │ │ ├── Contracts │ │ │ └── ListIntf.pas │ │ └── Implementations │ │ │ └── HashListImpl.pas │ ├── Minifier │ │ ├── Contracts │ │ │ └── MinifierIntf.pas │ │ └── Implementations │ │ │ ├── CssMinifierImpl.pas │ │ │ └── JsMinifierImpl.pas │ └── Utils │ │ ├── cssmin.pas │ │ └── strformats.pas ├── Tasks │ ├── Contracts │ │ ├── TaskFactoryIntf.pas │ │ ├── TaskInfoIntf.pas │ │ ├── TaskIntf.pas │ │ ├── TaskListAwareIntf.pas │ │ └── TaskOptionsIntf.pas │ ├── Implementations │ │ ├── Base │ │ │ ├── AddToUnitSearchTaskImpl.pas │ │ │ ├── AddToUsesClauseTaskImpl.pas │ │ │ ├── BaseCreateFileTaskImpl.pas │ │ │ ├── CreateDependencyRegistrationTaskImpl.pas │ │ │ ├── CreateDependencyTaskImpl.pas │ │ │ └── CreateFileConsts.pas │ │ ├── ChangeDir │ │ │ └── ChangeDirTaskImpl.pas │ │ ├── Composite │ │ │ ├── CompositeTaskImpl.pas │ │ │ ├── ConditionalCompositeTaskImpl.pas │ │ │ ├── GroupTaskImpl.pas │ │ │ └── NamedCompositeTaskImpl.pas │ │ ├── Config │ │ │ ├── CompositeConfigTaskImpl.pas │ │ │ └── ForceConfigDecoratorTaskImpl.pas │ │ ├── Controller │ │ │ ├── CreateControllerFactoryFileTaskImpl.pas │ │ │ ├── CreateControllerFileTaskImpl.pas │ │ │ ├── CreateControllerTaskImpl.pas │ │ │ ├── CreateMultiRouteTaskImpl.pas │ │ │ ├── CreateRouteTaskImpl.pas │ │ │ ├── Factories │ │ │ │ └── CreateControllerTaskFactoryImpl.pas │ │ │ ├── Includes │ │ │ │ ├── rest.controller.factory.pas.inc │ │ │ │ ├── rest.controller.pas.inc │ │ │ │ └── routes.inc.inc │ │ │ ├── WithMultiRouteTaskImpl.pas │ │ │ └── WithNoRouteTaskImpl.pas │ │ ├── Csrf │ │ │ ├── CreateCsrfMiddlewareDependenciesTaskImpl.pas │ │ │ ├── ForceConfigSessionDecoratorTaskImpl.pas │ │ │ ├── Includes │ │ │ │ └── csrf.dependencies.inc │ │ │ └── WithCsrfTaskImpl.pas │ │ ├── Daemon │ │ │ └── SystemD │ │ │ │ ├── Factories │ │ │ │ └── SystemDDaemonTaskFactoryImpl.pas │ │ │ │ ├── Includes │ │ │ │ └── daemon.service.inc │ │ │ │ └── SystemDDaemonTaskImpl.pas │ │ ├── Decorator │ │ │ ├── DecoratorTaskImpl.pas │ │ │ └── WithOptionsDecoratorTaskImpl.pas │ │ ├── Deploy │ │ │ ├── Balancer │ │ │ │ └── Factories │ │ │ │ │ └── XDeployBalancerTaskFactoryImpl.pas │ │ │ ├── Cgi │ │ │ │ └── Factories │ │ │ │ │ └── XDeployCgiTaskFactoryImpl.pas │ │ │ ├── Core │ │ │ │ ├── AddDomainToEtcHostTaskImpl.pas │ │ │ │ ├── DeployTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ └── AbstractDeployTaskFactoryImpl.pas │ │ │ │ ├── WebServer │ │ │ │ │ ├── Apache │ │ │ │ │ │ ├── ApacheDebianVHostWriterImpl.pas │ │ │ │ │ │ ├── ApacheEnableVhostTaskImpl.pas │ │ │ │ │ │ ├── ApacheFedoraVHostWriterImpl.pas │ │ │ │ │ │ ├── ApacheFreeBsdVHostWriterImpl.pas │ │ │ │ │ │ ├── ApacheReloadWebServerTaskImpl.pas │ │ │ │ │ │ ├── ApacheVHostBalancerTplImpl.pas │ │ │ │ │ │ ├── ApacheVHostCgiTplImpl.pas │ │ │ │ │ │ ├── ApacheVHostFcgiTplImpl.pas │ │ │ │ │ │ ├── ApacheVHostFcgidTplImpl.pas │ │ │ │ │ │ ├── ApacheVHostHttpTplImpl.pas │ │ │ │ │ │ ├── ApacheVHostScgiTplImpl.pas │ │ │ │ │ │ ├── ApacheVHostUwsgiTplImpl.pas │ │ │ │ │ │ ├── ApacheWindowsVHostWriterImpl.pas │ │ │ │ │ │ └── Includes │ │ │ │ │ │ │ ├── balancer.vhost.conf.inc │ │ │ │ │ │ │ ├── cgi.vhost.conf.inc │ │ │ │ │ │ │ ├── fcgi.vhost.conf.inc │ │ │ │ │ │ │ ├── fcgid.vhost.conf.inc │ │ │ │ │ │ │ ├── http.vhost.conf.inc │ │ │ │ │ │ │ ├── scgi.vhost.conf.inc │ │ │ │ │ │ │ └── uwsgi.vhost.conf.inc │ │ │ │ │ ├── BaseWebServerVirtualHostTaskImpl.pas │ │ │ │ │ ├── Contracts │ │ │ │ │ │ ├── VirtualHostIntf.pas │ │ │ │ │ │ ├── VirtualHostTemplateIntf.pas │ │ │ │ │ │ └── VirtualHostWriterIntf.pas │ │ │ │ │ ├── Nginx │ │ │ │ │ │ ├── BaseNginxVirtualHostTaskImpl.pas │ │ │ │ │ │ ├── FcgidCheck │ │ │ │ │ │ │ └── FcgidCheckTaskImpl.pas │ │ │ │ │ │ ├── Includes │ │ │ │ │ │ │ ├── balancer.vhost.conf.inc │ │ │ │ │ │ │ ├── fcgi.vhost.conf.inc │ │ │ │ │ │ │ ├── http.vhost.conf.inc │ │ │ │ │ │ │ ├── scgi.vhost.conf.inc │ │ │ │ │ │ │ └── uwsgi.vhost.conf.inc │ │ │ │ │ │ ├── NginxFreeBsdVHostWriterImpl.pas │ │ │ │ │ │ ├── NginxLinuxVHostWriterImpl.pas │ │ │ │ │ │ ├── NginxReloadWebServerTaskImpl.pas │ │ │ │ │ │ ├── NginxVHostBalancerTplImpl.pas │ │ │ │ │ │ ├── NginxVHostFcgiTplImpl.pas │ │ │ │ │ │ ├── NginxVHostHttpTplImpl.pas │ │ │ │ │ │ ├── NginxVHostScgiTplImpl.pas │ │ │ │ │ │ ├── NginxVHostUwsgiTplImpl.pas │ │ │ │ │ │ └── NginxWindowsVHostWriterImpl.pas │ │ │ │ │ ├── ReloadWebServerTaskImpl.pas │ │ │ │ │ ├── VirtualHostImpl.pas │ │ │ │ │ ├── VirtualHostWriterImpl.pas │ │ │ │ │ └── WebServerVirtualHostTaskImpl.pas │ │ │ │ ├── WebServerTaskImpl.pas │ │ │ │ └── WithSkipEtcHostTaskImpl.pas │ │ │ ├── Fcgi │ │ │ │ └── Factories │ │ │ │ │ └── XDeployFcgiTaskFactoryImpl.pas │ │ │ ├── FcgiBalancer │ │ │ │ └── Factories │ │ │ │ │ └── XDeployFcgiBalancerTaskFactoryImpl.pas │ │ │ ├── Fcgid │ │ │ │ └── Factories │ │ │ │ │ └── XDeployFcgidTaskFactoryImpl.pas │ │ │ ├── Http │ │ │ │ └── Factories │ │ │ │ │ └── XDeployHttpTaskFactoryImpl.pas │ │ │ ├── HttpBalancer │ │ │ │ └── Factories │ │ │ │ │ └── XDeployHttpBalancerTaskFactoryImpl.pas │ │ │ ├── Scgi │ │ │ │ └── Factories │ │ │ │ │ └── XDeployScgiTaskFactoryImpl.pas │ │ │ ├── ScgiBalancer │ │ │ │ └── Factories │ │ │ │ │ └── XDeployScgiBalancerTaskFactoryImpl.pas │ │ │ ├── Uwsgi │ │ │ │ └── Factories │ │ │ │ │ └── XDeployUwsgiTaskFactoryImpl.pas │ │ │ └── UwsgiBalancer │ │ │ │ └── Factories │ │ │ │ └── XDeployUwsgiBalancerTaskFactoryImpl.pas │ │ ├── Duplicate │ │ │ ├── DuplicateCheckTaskImpl.pas │ │ │ ├── DuplicateCtrlCheckTaskImpl.pas │ │ │ ├── DuplicateMiddlewareCheckTaskImpl.pas │ │ │ ├── DuplicateModelCheckTaskImpl.pas │ │ │ └── DuplicateViewCheckTaskImpl.pas │ │ ├── EmptyDirCheck │ │ │ └── EmptyDirCheckTaskImpl.pas │ │ ├── GuidGen │ │ │ └── GuidGenTaskImpl.pas │ │ ├── InFanoProjectDirCheck │ │ │ └── InFanoProjectDirCheckTaskImpl.pas │ │ ├── Info │ │ │ ├── InfoTaskImpl.pas │ │ │ ├── SingleInfoTaskImpl.pas │ │ │ └── WithSingleInfoTaskImpl.pas │ │ ├── KeyGen │ │ │ ├── Factories │ │ │ │ └── KeyGenTaskFactoryImpl.pas │ │ │ └── KeyGenTaskImpl.pas │ │ ├── Logger │ │ │ ├── AbstractCreateLoggerDependenciesTaskImpl.pas │ │ │ ├── CompositeLoggerDependenciesTaskImpl.pas │ │ │ ├── CreateDbLoggerDependenciesTaskImpl.pas │ │ │ ├── CreateFileLoggerDependenciesTaskImpl.pas │ │ │ ├── CreateSyslogLoggerDependenciesTaskImpl.pas │ │ │ ├── Includes │ │ │ │ ├── dblogger.dependencies.inc │ │ │ │ ├── filelogger.dependencies.inc │ │ │ │ └── sysloglogger.dependencies.inc │ │ │ └── WithLoggerTaskImpl.pas │ │ ├── Middleware │ │ │ ├── Create │ │ │ │ ├── CreateMiddlewareFactoryFileTaskImpl.pas │ │ │ │ ├── CreateMiddlewareFileTaskImpl.pas │ │ │ │ ├── CreateMiddlewareTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ └── CreateMiddlewareTaskFactoryImpl.pas │ │ │ │ ├── Includes │ │ │ │ │ ├── middleware.factory.pas.inc │ │ │ │ │ └── middleware.pas.inc │ │ │ │ └── MiddlewareAddToUnitSearchTaskImpl.pas │ │ │ └── Support │ │ │ │ ├── CreateMiddlewareDependenciesTaskImpl.pas │ │ │ │ ├── CreateNoMiddlewareDependenciesTaskImpl.pas │ │ │ │ └── Includes │ │ │ │ ├── buildDispatcher.decl.inc │ │ │ │ └── buildDispatcher.impl.inc │ │ ├── Minifier │ │ │ ├── DirFileMinifierTaskImpl.pas │ │ │ ├── Factories │ │ │ │ ├── CssMinifierTaskFactoryImpl.pas │ │ │ │ └── JsMinifierTaskFactoryImpl.pas │ │ │ ├── MinifyDirTaskImpl.pas │ │ │ └── MinifyFileTaskImpl.pas │ │ ├── Model │ │ │ ├── CreateModelFactoryFileTaskImpl.pas │ │ │ ├── CreateModelFileTaskImpl.pas │ │ │ ├── CreateModelTaskImpl.pas │ │ │ ├── Factories │ │ │ │ └── CreateModelTaskFactoryImpl.pas │ │ │ └── Includes │ │ │ │ ├── model.factory.pas.inc │ │ │ │ └── model.pas.inc │ │ ├── Mvc │ │ │ └── Factories │ │ │ │ └── CreateMvcTaskFactoryImpl.pas │ │ ├── NotInFanoProjectDirCheck │ │ │ └── NotInFanoProjectDirCheckTaskImpl.pas │ │ ├── Null │ │ │ ├── Factories │ │ │ │ └── NullTaskFactoryImpl.pas │ │ │ └── NullTaskImpl.pas │ │ ├── Project │ │ │ ├── Cgi │ │ │ │ ├── CreateCgiAppFileTaskImpl.pas │ │ │ │ ├── CreateCgiDockerfileTaskImpl.pas │ │ │ │ ├── CreateCgiReadmeFileTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ └── CreateAppBootstrapCgiTaskFactoryImpl.pas │ │ │ │ └── Includes │ │ │ │ │ ├── app.pas.inc │ │ │ │ │ ├── dockercompose.inc │ │ │ │ │ ├── dockerfile.inc │ │ │ │ │ ├── readme.md.inc │ │ │ │ │ └── vhost.example.inc │ │ │ ├── Core │ │ │ │ ├── AddFanoRepoTaskImpl.pas │ │ │ │ ├── BaseGitRepoTaskImpl.pas │ │ │ │ ├── BaseProjectTaskImpl.pas │ │ │ │ ├── CheckoutFanoRepoTaskImpl.pas │ │ │ │ ├── CommitGitRepoTaskImpl.pas │ │ │ │ ├── CreateAdditionalFilesTaskImpl.pas │ │ │ │ ├── CreateAppConfigsTaskImpl.pas │ │ │ │ ├── CreateAppFileTaskImpl.pas │ │ │ │ ├── CreateBasicFileTaskImpl.pas │ │ │ │ ├── CreateBootstrapFileTaskImpl.pas │ │ │ │ ├── CreateCompilerConfigsTaskImpl.pas │ │ │ │ ├── CreateConfigMethodTaskImpl.pas │ │ │ │ ├── CreateCurlCompilerConfigsTaskImpl.pas │ │ │ │ ├── CreateDepFileTaskImpl.pas │ │ │ │ ├── CreateDirTaskImpl.pas │ │ │ │ ├── CreateDispatcherMethodTaskImpl.pas │ │ │ │ ├── CreateFileTaskImpl.pas │ │ │ │ ├── CreateProjectTaskImpl.pas │ │ │ │ ├── CreateReadmeFileTaskImpl.pas │ │ │ │ ├── CreateRouteFileTaskImpl.pas │ │ │ │ ├── CreateShellScriptsTaskImpl.pas │ │ │ │ ├── DecoratorCreateCompilerConfigsTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ └── CreateProjectTaskFactoryImpl.pas │ │ │ │ ├── Includes │ │ │ │ │ ├── appconfig.dependencies.inc.inc │ │ │ │ │ ├── bootstrap.pas.inc │ │ │ │ │ ├── build.cfg.inc │ │ │ │ │ ├── build.cmd.inc │ │ │ │ │ ├── build.dev.cfg.inc │ │ │ │ │ ├── build.prod.cfg.inc │ │ │ │ │ ├── build.sh.inc │ │ │ │ │ ├── clean.cmd.inc │ │ │ │ │ ├── clean.sh.inc │ │ │ │ │ ├── config.setup.cmd.inc │ │ │ │ │ ├── config.setup.sh.inc │ │ │ │ │ ├── controllers.dependencies.inc.inc │ │ │ │ │ ├── default.appconfig.dependencies.inc.inc │ │ │ │ │ ├── defines.cfg.inc │ │ │ │ │ ├── dependencies.inc.inc │ │ │ │ │ ├── env.inc │ │ │ │ │ ├── gitignore.inc │ │ │ │ │ ├── htaccess.example.inc │ │ │ │ │ ├── main.dependencies.inc.inc │ │ │ │ │ ├── methods │ │ │ │ │ │ ├── buildAppConfig.decl.inc │ │ │ │ │ │ └── buildAppConfig.impl.inc │ │ │ │ │ ├── middlewares.dependencies.inc.inc │ │ │ │ │ ├── models.dependencies.inc.inc │ │ │ │ │ ├── routes.inc.inc │ │ │ │ │ ├── simulate.run.cmd.inc │ │ │ │ │ ├── simulate.run.sh.inc │ │ │ │ │ └── views.dependencies.inc.inc │ │ │ │ ├── InitGitRepoTaskImpl.pas │ │ │ │ ├── RegisterConfigDependencyTaskImpl.pas │ │ │ │ ├── StageRepoTaskImpl.pas │ │ │ │ ├── WithGitInitialCommitTaskImpl.pas │ │ │ │ └── WithGitRepoTaskImpl.pas │ │ │ ├── Daemon │ │ │ │ ├── CreateDaemonBootstrapFileTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ └── CreateDaemonProjectTaskFactoryImpl.pas │ │ │ │ └── Includes │ │ │ │ │ └── bootstrap.pas.inc │ │ │ ├── FastCgi │ │ │ │ ├── CreateFcgiAppFileTaskImpl.pas │ │ │ │ ├── CreateFcgiDockerfileTaskImpl.pas │ │ │ │ ├── CreateFcgiReadmeFileTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ └── CreateAppBootstrapFcgiTaskFactoryImpl.pas │ │ │ │ └── Includes │ │ │ │ │ ├── app.pas.inc │ │ │ │ │ ├── dockercompose.inc │ │ │ │ │ ├── fano_dockerfile.inc │ │ │ │ │ ├── httpd_dockerfile.inc │ │ │ │ │ ├── readme.md.inc │ │ │ │ │ └── vhost.example.inc │ │ │ ├── Fcgid │ │ │ │ ├── CreateFcgidAppFileTaskImpl.pas │ │ │ │ ├── CreateFcgidDockerfileTaskImpl.pas │ │ │ │ ├── CreateFcgidReadmeFileTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ └── CreateAppBootstrapFcgidTaskFactoryImpl.pas │ │ │ │ └── Includes │ │ │ │ │ ├── app.pas.inc │ │ │ │ │ ├── dockercompose.inc │ │ │ │ │ ├── dockerfile.inc │ │ │ │ │ ├── readme.md.inc │ │ │ │ │ └── vhost.example.inc │ │ │ ├── Fpweb │ │ │ │ ├── CreateFpwebAppFileTaskImpl.pas │ │ │ │ ├── CreateFpwebReadmeFileTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ └── CreateAppBootstrapFpwebTaskFactoryImpl.pas │ │ │ │ └── Includes │ │ │ │ │ ├── app.pas.inc │ │ │ │ │ └── readme.md.inc │ │ │ ├── Helper │ │ │ │ └── Factories │ │ │ │ │ ├── CreateAppBootstrapTaskFactoryImpl.pas │ │ │ │ │ ├── CreateProjectDependenciesTaskFactoryImpl.pas │ │ │ │ │ └── WithSessionOrMiddlewareTaskImpl.pas │ │ │ ├── Indy │ │ │ │ ├── CreateIndyAppFileTaskImpl.pas │ │ │ │ ├── CreateIndyCompilerConfigsTaskImpl.pas │ │ │ │ ├── CreateIndyReadmeFileTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ ├── CreateAppBootstrapIndyTaskFactoryImpl.pas │ │ │ │ │ └── CreateProjectDependenciesIndyTaskFactoryImpl.pas │ │ │ │ └── Includes │ │ │ │ │ ├── app.pas.inc │ │ │ │ │ └── readme.md.inc │ │ │ ├── Mhd │ │ │ │ ├── CreateMhdAppFileTaskImpl.pas │ │ │ │ ├── CreateMhdCompilerConfigsTaskImpl.pas │ │ │ │ ├── CreateMhdReadmeFileTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ ├── CreateAppBootstrapMhdTaskFactoryImpl.pas │ │ │ │ │ └── CreateProjectDependenciesMhdTaskFactoryImpl.pas │ │ │ │ └── Includes │ │ │ │ │ ├── app.pas.inc │ │ │ │ │ └── readme.md.inc │ │ │ ├── Scgi │ │ │ │ ├── CreateScgiAppFileTaskImpl.pas │ │ │ │ ├── CreateScgiDockerfileTaskImpl.pas │ │ │ │ ├── CreateScgiReadmeFileTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ │ └── CreateAppBootstrapScgiTaskFactoryImpl.pas │ │ │ │ └── Includes │ │ │ │ │ ├── app.pas.inc │ │ │ │ │ ├── dockercompose.inc │ │ │ │ │ ├── fano_dockerfile.inc │ │ │ │ │ ├── httpd_dockerfile.inc │ │ │ │ │ ├── readme.md.inc │ │ │ │ │ └── vhost.example.inc │ │ │ └── Uwsgi │ │ │ │ ├── CreateUwsgiAppFileTaskImpl.pas │ │ │ │ ├── CreateUwsgiDockerfileTaskImpl.pas │ │ │ │ ├── CreateUwsgiReadmeFileTaskImpl.pas │ │ │ │ ├── Factories │ │ │ │ └── CreateAppBootstrapUwsgiTaskFactoryImpl.pas │ │ │ │ └── Includes │ │ │ │ ├── app.pas.inc │ │ │ │ ├── dockercompose.inc │ │ │ │ ├── fano_dockerfile.inc │ │ │ │ ├── httpd_dockerfile.inc │ │ │ │ ├── readme.md.inc │ │ │ │ └── vhost.example.inc │ │ ├── RootCheck │ │ │ └── RootCheckTaskImpl.pas │ │ ├── Session │ │ │ ├── BaseCreateSessionAppConfigsTaskImpl.pas │ │ │ ├── BaseCreateSessionDependenciesTaskImpl.pas │ │ │ ├── CompositeDbTypeTaskImpl.pas │ │ │ ├── CompositeFileTypeTaskImpl.pas │ │ │ ├── CompositeSessionTaskImpl.pas │ │ │ ├── CompositeSessionTypeTaskImpl.pas │ │ │ ├── CreateDbSessionIniAppConfigsTaskImpl.pas │ │ │ ├── CreateDbSessionJsonAppConfigsTaskImpl.pas │ │ │ ├── CreateFileSessionDependenciesTaskImpl.pas │ │ │ ├── CreateSessionAppConfigsTaskImpl.pas │ │ │ ├── CreateSessionDirTaskImpl.pas │ │ │ ├── CreateSessionIniAppConfigsTaskImpl.pas │ │ │ ├── CreateSessionJsonAppConfigsTaskImpl.pas │ │ │ ├── FirebirdDbSessionContentModifierImpl.pas │ │ │ ├── Includes │ │ │ │ ├── config.ini.db.inc │ │ │ │ ├── config.ini.inc │ │ │ │ ├── config.json.db.inc │ │ │ │ ├── config.json.inc │ │ │ │ ├── decl.dispatcher.method.inc │ │ │ │ ├── impl.db.firebird.dispatcher.method.inc │ │ │ │ ├── impl.db.mysql.dispatcher.method.inc │ │ │ │ ├── impl.db.postgresql.dispatcher.method.inc │ │ │ │ ├── impl.db.sqlite.dispatcher.method.inc │ │ │ │ ├── impl.ini.cookie.dispatcher.method.inc │ │ │ │ ├── impl.ini.file.dispatcher.method.inc │ │ │ │ ├── impl.json.cookie.dispatcher.method.inc │ │ │ │ └── impl.json.file.dispatcher.method.inc │ │ │ ├── IniCookieSessionContentModifierImpl.pas │ │ │ ├── IniFileSessionContentModifierImpl.pas │ │ │ ├── JsonCookieSessionContentModifierImpl.pas │ │ │ ├── JsonFileSessionContentModifierImpl.pas │ │ │ ├── MysqlDbSessionContentModifierImpl.pas │ │ │ ├── PostgresqlDbSessionContentModifierImpl.pas │ │ │ ├── SqliteDbSessionContentModifierImpl.pas │ │ │ └── WithDbSessionTaskImpl.pas │ │ ├── StdoutCheck │ │ │ └── StdoutCheckTaskImpl.pas │ │ ├── Text2Inc │ │ │ └── Text2IncTaskImpl.pas │ │ ├── View │ │ │ ├── CreateViewFactoryFileTaskImpl.pas │ │ │ ├── CreateViewFileTaskImpl.pas │ │ │ ├── CreateViewTaskImpl.pas │ │ │ ├── Factories │ │ │ │ └── CreateViewTaskFactoryImpl.pas │ │ │ └── Includes │ │ │ │ ├── view.factory.pas.inc │ │ │ │ └── view.pas.inc │ │ └── Writeln │ │ │ ├── Factories │ │ │ └── WritelnTaskFactoryImpl.pas │ │ │ └── WritelnTaskImpl.pas │ ├── Includes │ │ ├── Controller │ │ │ └── task.registrations.inc │ │ ├── Daemon │ │ │ ├── SystemD │ │ │ │ └── task.registrations.inc │ │ │ └── task.registrations.inc │ │ ├── Deploy │ │ │ ├── Cgi │ │ │ │ └── task.registrations.inc │ │ │ ├── Fcgi │ │ │ │ └── task.registrations.inc │ │ │ ├── FcgiBalancer │ │ │ │ └── task.registrations.inc │ │ │ ├── Fcgid │ │ │ │ └── task.registrations.inc │ │ │ ├── Http │ │ │ │ └── task.registrations.inc │ │ │ ├── HttpBalancer │ │ │ │ └── task.registrations.inc │ │ │ ├── Scgi │ │ │ │ └── task.registrations.inc │ │ │ ├── ScgiBalancer │ │ │ │ └── task.registrations.inc │ │ │ ├── Uwsgi │ │ │ │ └── task.registrations.inc │ │ │ ├── UwsgiBalancer │ │ │ │ └── task.registrations.inc │ │ │ ├── task.registrations.inc │ │ │ └── units.inc │ │ ├── GuidGen │ │ │ └── task.registrations.inc │ │ ├── Info │ │ │ ├── task.registrations.inc │ │ │ └── units.inc │ │ ├── KeyGen │ │ │ └── task.registrations.inc │ │ ├── Middleware │ │ │ └── task.registrations.inc │ │ ├── Minifier │ │ │ ├── Css │ │ │ │ └── task.registrations.inc │ │ │ ├── Js │ │ │ │ └── task.registrations.inc │ │ │ └── task.registrations.inc │ │ ├── Model │ │ │ └── task.registrations.inc │ │ ├── Mvc │ │ │ └── task.registrations.inc │ │ ├── Project │ │ │ ├── Cgi │ │ │ │ └── task.registrations.inc │ │ │ ├── FastCgi │ │ │ │ └── task.registrations.inc │ │ │ ├── Fcgid │ │ │ │ └── task.registrations.inc │ │ │ ├── Fpweb │ │ │ │ └── task.registrations.inc │ │ │ ├── Indy │ │ │ │ └── task.registrations.inc │ │ │ ├── Mhd │ │ │ │ └── task.registrations.inc │ │ │ ├── Scgi │ │ │ │ └── task.registrations.inc │ │ │ ├── Uwsgi │ │ │ │ └── task.registrations.inc │ │ │ ├── task.registrations.inc │ │ │ └── units.inc │ │ ├── Text2Inc │ │ │ └── task.registrations.inc │ │ ├── View │ │ │ └── task.registrations.inc │ │ ├── contracts.inc │ │ ├── task.registrations.inc │ │ └── units.inc │ └── Types │ │ └── TaskItemTypes.pas ├── fanocli.pas └── main.units.inc ├── tools ├── clean.cmd ├── clean.sh ├── config.setup.cmd └── config.setup.sh └── unit.search.cfg /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [zamronypj] 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 - 2022 Zamrony P. Juhara 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | This program contains 2 | --------------------------------------------------------------------------------- 3 | CSSMin 4 | https://www.gocher.me/CSSMin 5 | 6 | Copyright (c) 2007-2020, Udo Schmal 7 | 8 | Permission to use, copy, modify, and/or distribute the software for any purpose 9 | with or without fee is hereby granted, provided that the above copyright notice 10 | and this permission notice appear in all copies. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 13 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 14 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR 15 | CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 16 | DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 17 | ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 | --------------------------------------------------------------------------------- 19 | -------------------------------------------------------------------------------- /bin/README.md: -------------------------------------------------------------------------------- 1 | # Directory for compiler generated binary files 2 | -------------------------------------------------------------------------------- /bin/out/README.md: -------------------------------------------------------------------------------- 1 | # Directory for generated binary executable 2 | -------------------------------------------------------------------------------- /bin/unit/README.md: -------------------------------------------------------------------------------- 1 | # Directory for generated compiled units 2 | -------------------------------------------------------------------------------- /build.cfg.sample: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------ 2 | # Fano CLI Application (https://fanoframework.github.io) 3 | # 4 | # @link https://github.com/fanoframework/fano-cli 5 | # @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | # @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | #------------------------------------------------------------- 8 | 9 | #---------------------------------------------- 10 | # User configuration that applies to both 11 | # development and production environment 12 | # Please see Free Pascal Documentation for available 13 | # compiler configurations 14 | #---------------------------------------------- 15 | 16 | #---------------------------------------------- 17 | # Target OS 18 | # linux : Linux 19 | # win64 : Windows 64 (not tested yet) 20 | # win32 : Windows 32 (not tested yet) 21 | # freebsd : FreeBSD 22 | # darwin : MacOS 23 | #---------------------------------------------- 24 | -Tlinux 25 | 26 | #---------------------------------------------- 27 | # Output Windows console application 28 | # 29 | # Uncomment if target OS is Windows 30 | #---------------------------------------------- 31 | #-WC 32 | 33 | #---------------------------------------------- 34 | # Target CPU 35 | # x86_64 : Intel 64-bit architecture (default) 36 | # i386 : Intel 32-bit architecture 37 | #---------------------------------------------- 38 | #-Px86_64 39 | 40 | #---------------------------------------------- 41 | # Include configuration based on build type (default is prod) 42 | # using #INCLUDE directive 43 | # For example 44 | # $ BUILD_TYPE=prod ./build.sh 45 | #---------------------------------------------- 46 | #INCLUDE build.$BUILD_TYPE$.cfg 47 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM ------------------------------------------------------------ 3 | REM Fano CLI Application (https://fanoframework.github.io) 4 | REM 5 | REM @link https://github.com/fanoframework/fano-cli 6 | REM @copyright Copyright (c) 2018 Zamrony P. Juhara 7 | REM @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 8 | REM ------------------------------------------------------------- 9 | 10 | REM ------------------------------------ 11 | REM -- build script for Windows 12 | REM ------------------------------------ 13 | 14 | IF NOT EXIST build.cfg (copy build.cfg.sample build.cfg) 15 | IF NOT EXIST build.dev.cfg (copy build.dev.cfg.sample build.dev.cfg) 16 | IF NOT EXIST build.prod.cfg (copy build.prod.cfg.sample build.prod.cfg) 17 | 18 | IF NOT DEFINED BUILD_TYPE (SET BUILD_TYPE=prod) 19 | IF NOT DEFINED UNIT_OUTPUT_DIR (SET UNIT_OUTPUT_DIR=bin\unit) 20 | IF NOT DEFINED EXEC_OUTPUT_DIR (SET EXEC_OUTPUT_DIR=bin\out) 21 | IF NOT DEFINED FPC_BIN (SET FPC_BIN=C:\fpc\fpc.exe) 22 | IF NOT DEFINED FPC_CFG (SET FPC_CFG=C:\fpc\fpc.cfg) 23 | 24 | echo "Building Fano CLI with:" 25 | echo "FPC Bin=%FPC_BIN%" 26 | echo "FPC Cfg=%FPC_CFG%" 27 | 28 | %FPC_BIN% @%FPC_CFG% @unit.search.cfg @build.cfg src/fanocli.pas 29 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------ 2 | # Fano CLI Application (https://fanoframework.github.io) 3 | # 4 | # @link https://github.com/fanoframework/fano-cli 5 | # @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | # @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | #------------------------------------------------------------- 8 | #!/bin/bash 9 | 10 | #------------------------------------------------------ 11 | # Build script for Linux 12 | #------------------------------------------------------ 13 | 14 | BUILD_CFG=build.cfg 15 | BUILD_DEV_CFG=build.dev.cfg 16 | BUILD_PROD_CFG=build.prod.cfg 17 | 18 | if [ ! -f "${BUILD_CFG}" ]; then 19 | cp build.cfg.sample build.cfg 20 | fi 21 | 22 | if [ ! -f "${BUILD_DEV_CFG}" ]; then 23 | cp build.dev.cfg.sample build.dev.cfg 24 | fi 25 | 26 | if [ ! -f "${BUILD_PROD_CFG}" ]; then 27 | cp build.prod.cfg.sample build.prod.cfg 28 | fi 29 | 30 | if [ -z "${BUILD_TYPE}" ]; then 31 | export BUILD_TYPE="prod" 32 | fi 33 | 34 | if [ -z "${UNIT_OUTPUT_DIR}" ]; then 35 | export UNIT_OUTPUT_DIR="bin/unit" 36 | fi 37 | 38 | if [ -z "${EXEC_OUTPUT_DIR}" ]; then 39 | export EXEC_OUTPUT_DIR="bin/out" 40 | fi 41 | 42 | if [ -z "${FPC_BIN}" ]; then 43 | export FPC_BIN="fpc" 44 | fi 45 | 46 | $FPC_BIN @unit.search.cfg @build.cfg src/fanocli.pas 47 | -------------------------------------------------------------------------------- /src/Apps/Includes/units.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | FanoAppImpl, 10 | -------------------------------------------------------------------------------- /src/Libs/Dir/Contracts/DirectoryCreatorIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit DirectoryCreatorIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | type 16 | 17 | (*!-------------------------------------- 18 | * Interface for class that having capability 19 | * to create directory 20 | * 21 | * @author Zamrony P. Juhara 22 | *---------------------------------------*) 23 | IDirectoryCreator = interface 24 | ['{12FAD249-188B-4660-B107-DB37920423D9}'] 25 | 26 | function createDirIfNotExists(const dir : string) : string; 27 | end; 28 | 29 | implementation 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /src/Libs/Dir/Contracts/DirectoryExistsIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit DirectoryExistsIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | type 16 | 17 | (*!-------------------------------------- 18 | * Interface for class that having capability 19 | * to check for directory existence 20 | * 21 | * @author Zamrony P. Juhara 22 | *---------------------------------------*) 23 | IDirectoryExists = interface 24 | ['{D76D1660-FA8E-4464-B212-76A76B73B946}'] 25 | 26 | function dirExists(const dir : string) : boolean; 27 | end; 28 | 29 | implementation 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /src/Libs/Dir/Implementations/DirectoryCreatorImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit DirectoryCreatorImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | DirectoryCreatorIntf; 18 | 19 | type 20 | 21 | (*!-------------------------------------- 22 | * Helper class that create directory 23 | * 24 | * @author Zamrony P. Juhara 25 | *---------------------------------------*) 26 | TDirectoryCreator = class(TInterfacedObject, IDirectoryCreator) 27 | public 28 | function createDirIfNotExists(const dir : string) : string; 29 | end; 30 | 31 | implementation 32 | 33 | uses 34 | 35 | sysutils; 36 | 37 | function TDirectoryCreator.createDirIfNotExists(const dir : string) : string; 38 | begin 39 | result := dir; 40 | if (not directoryExists(result)) then 41 | begin 42 | mkdir(result); 43 | end; 44 | end; 45 | end. 46 | -------------------------------------------------------------------------------- /src/Libs/Dir/Implementations/DirectoryExistsImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit DirectoryExistsImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | DirectoryExistsIntf; 18 | 19 | type 20 | 21 | (*!-------------------------------------- 22 | * Helper class that check if directory is exists 23 | * 24 | * @author Zamrony P. Juhara 25 | *---------------------------------------*) 26 | TDirectoryExists = class(TInterfacedObject, IDirectoryExists) 27 | public 28 | function dirExists(const dir : string) : boolean; 29 | end; 30 | 31 | implementation 32 | 33 | uses 34 | 35 | sysutils; 36 | 37 | function TDirectoryExists.dirExists(const dir : string) : boolean; 38 | begin 39 | result := directoryExists(dir); 40 | end; 41 | end. 42 | -------------------------------------------------------------------------------- /src/Libs/Dir/Implementations/NullDirectoryExistsImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit NullDirectoryExistsImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | DirectoryExistsIntf; 18 | 19 | type 20 | 21 | (*!-------------------------------------- 22 | * Null class that always report directory 23 | * as exists 24 | * 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | TNullDirectoryExists = class(TInterfacedObject, IDirectoryExists) 28 | public 29 | function dirExists(const dir : string) : boolean; 30 | end; 31 | 32 | implementation 33 | 34 | 35 | function TNullDirectoryExists.dirExists(const dir : string) : boolean; 36 | begin 37 | //intentionally report all directories as exists 38 | result := true; 39 | end; 40 | end. 41 | -------------------------------------------------------------------------------- /src/Libs/File/Contracts/ContentModifierIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit ContentModifierIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | type 16 | 17 | (*!-------------------------------------- 18 | * Interface for class that having capability 19 | * to modify content 20 | * 21 | * @author Zamrony P. Juhara 22 | *---------------------------------------*) 23 | IContentModifier = interface 24 | ['{3D2E1028-D84A-418B-A0BB-B8349CEB7892}'] 25 | 26 | (*!------------------------------------------ 27 | * set variable name and its value 28 | *------------------------------------------- 29 | * @param varName name of variable 30 | * @param varValue value to replace 31 | * @return current instance 32 | *-------------------------------------------*) 33 | function setVar(const varName : string; const varValue : string) : IContentModifier; 34 | 35 | (*!------------------------------------------ 36 | * Modify content 37 | *------------------------------------------- 38 | * @param content original content to modify 39 | * @return modified content 40 | *-------------------------------------------*) 41 | function modify(const content : string) : string; 42 | end; 43 | 44 | implementation 45 | 46 | end. 47 | -------------------------------------------------------------------------------- /src/Libs/File/Contracts/FileContentAppenderIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit FileContentAppenderIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | type 16 | 17 | (*!-------------------------------------- 18 | * Interface for class that having capability 19 | * to append string to file 20 | * 21 | * @author Zamrony P. Juhara 22 | *---------------------------------------*) 23 | IFileContentAppender = interface 24 | ['{5CC27588-1116-4BF7-817E-B9AAFE5B6FA6}'] 25 | 26 | procedure append(const filename : string; const content : string); 27 | end; 28 | 29 | implementation 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /src/Libs/File/Contracts/FileContentReaderIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit FileContentReaderIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | type 16 | 17 | (*!-------------------------------------- 18 | * Interface for class that having capability 19 | * to read file content to string 20 | * 21 | * @author Zamrony P. Juhara 22 | *---------------------------------------*) 23 | IFileContentReader = interface 24 | ['{79DD321B-0739-43EF-955B-7B318D3A960D}'] 25 | 26 | function read(const filename : string) : string; 27 | end; 28 | 29 | implementation 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /src/Libs/File/Contracts/FileContentWriterIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit FileContentWriterIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | type 16 | 17 | (*!-------------------------------------- 18 | * Interface for class that having capability 19 | * to write string to file 20 | * 21 | * @author Zamrony P. Juhara 22 | *---------------------------------------*) 23 | IFileContentWriter = interface 24 | ['{4B31B5D0-990A-49D5-89B2-7AD0093AEA0C}'] 25 | 26 | procedure write(const filename : string; const content : string); 27 | end; 28 | 29 | implementation 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /src/Libs/File/Contracts/TextFileCreatorIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit TextFileCreatorIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | type 16 | 17 | (*!-------------------------------------- 18 | * Interface for class that having capability 19 | * to create text file 20 | * 21 | * @author Zamrony P. Juhara 22 | *---------------------------------------*) 23 | ITextFileCreator = interface 24 | ['{F5F691D2-2484-47CF-BBF5-2F750DBAA797}'] 25 | 26 | procedure createTextFile(const filename : string; const content : string); 27 | end; 28 | 29 | implementation 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /src/Libs/File/Implementations/StdoutTextFileCreatorImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit StdoutTextFileCreatorImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TextFileCreatorIntf; 18 | 19 | type 20 | 21 | (*!-------------------------------------- 22 | * ITextFileCreator class that just output content to 23 | * standard output instead of write to file 24 | * 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | TStdoutTextFileCreator = class(TInterfacedObject, ITextFileCreator) 28 | public 29 | procedure createTextFile(const filename : string; const content : string); 30 | end; 31 | 32 | implementation 33 | 34 | procedure TStdoutTextFileCreator.createTextFile(const filename : string; const content : string); 35 | begin 36 | write(content); 37 | end; 38 | end. 39 | -------------------------------------------------------------------------------- /src/Libs/Includes/units.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | strformats, 10 | -------------------------------------------------------------------------------- /src/Libs/KeyGen/Contracts/KeyGeneratorIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit KeyGeneratorIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | type 16 | 17 | (*!-------------------------------------- 18 | * Interface for class that having capability 19 | * to generate random key 20 | * 21 | * @author Zamrony P. Juhara 22 | *---------------------------------------*) 23 | IKeyGenerator = interface 24 | ['{CDF2A4BD-0161-4390-AC21-758399D89698}'] 25 | 26 | function generate(const len : integer; const prefix : string = '') : string; 27 | end; 28 | 29 | implementation 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /src/Libs/List/Contracts/ListIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | unit ListIntf; 10 | 11 | interface 12 | 13 | {$MODE OBJFPC} 14 | {$H+} 15 | 16 | type 17 | {------------------------------------------------ 18 | interface for any class having capability store hash list 19 | @author Zamrony P. Juhara 20 | -----------------------------------------------} 21 | IList = interface 22 | ['{0F439A0A-7156-4DC6-9B8C-96F4439810E7}'] 23 | function count() : integer; 24 | function get(const indx : integer) : pointer; 25 | procedure delete(const indx : integer); 26 | function add(const key : shortstring; const routeData : pointer) : integer; 27 | function find(const key : shortstring) : pointer; 28 | function keyOfIndex(const indx : integer) : shortstring; 29 | end; 30 | 31 | implementation 32 | end. 33 | -------------------------------------------------------------------------------- /src/Libs/Utils/strformats.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | unit StrFormats; 10 | 11 | interface 12 | 13 | {$MODE OBJFPC} 14 | {$H+} 15 | 16 | const 17 | 18 | TXT_BLACK = 30; 19 | TXT_RED = 31; 20 | TXT_GREEN = 32; 21 | TXT_YELLOW = 33; 22 | TXT_BLUE = 34; 23 | TXT_MAGENTA = 35; 24 | TXT_CYAN = 36; 25 | TXT_LIGHT_GREY = 37; 26 | TXT_DEFAULT = 39; 27 | TXT_DARK_GREY = 90; 28 | TXT_LIGHT_RED = 91; 29 | TXT_LIGHT_GREEN = 92; 30 | TXT_LIGHT_YELLOW = 93; 31 | TXT_LIGHT_BLUE = 94; 32 | TXT_LIGHT_MAGENTA = 95; 33 | TXT_LIGHT_CYAN = 96; 34 | TXT_WHITE = 97; 35 | 36 | (*!-------------------------------------- 37 | * display string with color 38 | *--------------------------------------- 39 | * @param astr string to display as 40 | *---------------------------------------*) 41 | function formatColor(const astr : string; const col: byte) : string; 42 | 43 | implementation 44 | 45 | uses 46 | 47 | SysUtils; 48 | 49 | function formatColor(const astr : string; const col: byte) : string; 50 | begin 51 | {$IFDEF WINDOWS} 52 | //do nothing on Windows 53 | result := astr; 54 | {$ELSE} 55 | result := format(#27'[1;%dm%s'#27'[0m', [col, astr]); 56 | {$ENDIF} 57 | end; 58 | end. 59 | -------------------------------------------------------------------------------- /src/Tasks/Contracts/TaskFactoryIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit TaskFactoryIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskIntf; 18 | 19 | type 20 | 21 | (*!-------------------------------------- 22 | * interface for ITask factory 23 | * 24 | * @author Zamrony P. Juhara 25 | *---------------------------------------*) 26 | ITaskFactory = interface 27 | ['{4D47A06F-E2E2-4BB3-A611-D7D1732F6B2A}'] 28 | function build() : ITask; 29 | end; 30 | 31 | implementation 32 | 33 | end. 34 | -------------------------------------------------------------------------------- /src/Tasks/Contracts/TaskInfoIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit TaskInfoIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | type 16 | 17 | (*!-------------------------------------- 18 | * interface for any class having capability 19 | * to describe a task. This is mostly use for help 20 | * 21 | * @author Zamrony P. Juhara 22 | *---------------------------------------*) 23 | ITaskInfo = interface 24 | ['{D3051780-EFA0-465D-8181-2096DD419BE1}'] 25 | function getLongOption() : string; 26 | function getDescription() : string; 27 | end; 28 | 29 | implementation 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /src/Tasks/Contracts/TaskIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit TaskIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | TaskOptionsIntf; 17 | 18 | type 19 | 20 | (*!-------------------------------------- 21 | * interface for task. Task is anything that 22 | * can be run 23 | * 24 | * @author Zamrony P. Juhara 25 | *---------------------------------------*) 26 | ITask = interface 27 | ['{E9FF160F-DE92-4475-91A3-88CEA2A92130}'] 28 | 29 | function run( 30 | const opt : ITaskOptions; 31 | const longOpt : shortstring 32 | ) : ITask; 33 | end; 34 | 35 | implementation 36 | 37 | end. 38 | -------------------------------------------------------------------------------- /src/Tasks/Contracts/TaskListAwareIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit TaskListAwareIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | ListIntf; 18 | 19 | type 20 | 21 | (*!-------------------------------------- 22 | * interface for any class having capability 23 | * to get list of available tasks. 24 | * 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | ITaskListAware = interface 28 | ['{662D0179-97D9-492F-A395-1AFE459D64FD}'] 29 | function getTaskList() : IList; 30 | end; 31 | 32 | implementation 33 | 34 | end. 35 | -------------------------------------------------------------------------------- /src/Tasks/Contracts/TaskOptionsIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit TaskOptionsIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | type 16 | 17 | (*!-------------------------------------- 18 | * interface for any class having capability 19 | * to query command line options of a task 20 | * 21 | * @author Zamrony P. Juhara 22 | *---------------------------------------*) 23 | ITaskOptions = interface 24 | ['{D2AF03BD-3B30-4C1D-9F14-3BAEE0E17C23}'] 25 | function hasOption(const longOpt: string) : boolean; 26 | function getOptionValue(const longOpt: string) : string; 27 | function getOptionValueDef(const longOpt: string; const defValue : string) : string; 28 | end; 29 | 30 | implementation 31 | 32 | end. 33 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Base/CreateFileConsts.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateFileConsts; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | const BASE_DIRECTORY = 'src' + DirectorySeparator + 'App'; 16 | 17 | implementation 18 | end. 19 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/ChangeDir/ChangeDirTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit ChangeDirTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | DecoratorTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that change active directory after 25 | * other task is finished 26 | *--------------------------------------------- 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TChangeDirTask = class(TDecoratorTask) 30 | public 31 | function run( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring 34 | ) : ITask; override; 35 | end; 36 | 37 | implementation 38 | 39 | uses 40 | 41 | SysUtils; 42 | 43 | 44 | function TChangeDirTask.run( 45 | const opt : ITaskOptions; 46 | const longOpt : shortstring 47 | ) : ITask; 48 | var targetDir : string; 49 | begin 50 | fActualTask.run(opt, longOpt); 51 | if opt.hasOption('cd') then 52 | begin 53 | targetDir := getCurrentDir() + '/' + opt.getOptionValue(longOpt); 54 | chDir(targetDir); 55 | writeln('Change current directory to ', targetDir); 56 | end; 57 | result := self; 58 | end; 59 | end. 60 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Config/CompositeConfigTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CompositeConfigTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ConditionalCompositeTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that execute first task if --config 25 | * parameter is set, otherwise run second task 26 | *--------------------------------------------- 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCompositeConfigTask = class(TConditionalCompositeTask) 30 | protected 31 | function condition( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring 34 | ) : boolean; override; 35 | end; 36 | 37 | implementation 38 | 39 | function TCompositeConfigTask.condition( 40 | const opt : ITaskOptions; 41 | const longOpt : shortstring 42 | ) : boolean; 43 | begin 44 | result := opt.hasOption('config'); 45 | end; 46 | end. 47 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Config/ForceConfigDecoratorTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit ForceConfigDecoratorTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | WithOptionsDecoratorTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that force --config parameter always set 25 | *--------------------------------------------- 26 | * @author Zamrony P. Juhara 27 | *---------------------------------------*) 28 | TForceConfigDecoratorTask = class(TWithOptionsDecoratorTask) 29 | public 30 | function hasOption(const longOpt: string) : boolean; override; 31 | end; 32 | 33 | implementation 34 | 35 | function TForceConfigDecoratorTask.hasOption(const longOpt: string) : boolean; 36 | begin 37 | result := fOrigOpts.hasOption(longOpt); 38 | if (longOpt = 'config') and (result = false) then 39 | begin 40 | //--config not set but we force --config parameter always set 41 | result := true; 42 | end; 43 | end; 44 | end. 45 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Controller/Includes/routes.inc.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strCtrlRoutesInc: string = 9 | '(*!------------------------------------------------------------' + LineEnding + 10 | ' * [[APP_NAME]] ([[APP_URL]])' + LineEnding + 11 | ' *' + LineEnding + 12 | ' * @link [[APP_REPOSITORY_URL]]' + LineEnding + 13 | ' * @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 14 | ' * @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 15 | ' *------------------------------------------------------------- *)' + LineEnding + 16 | ''; 17 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Controller/WithNoRouteTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit WithNoRouteTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | DecoratorTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that skip controller route creation 25 | * if there is --no-route parameter 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TWithNoRouteTask = class(TDecoratorTask) 30 | public 31 | function run( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring 34 | ) : ITask; override; 35 | end; 36 | 37 | implementation 38 | 39 | function TWithNoRouteTask.run( 40 | const opt : ITaskOptions; 41 | const longOpt : shortstring 42 | ) : ITask; 43 | begin 44 | if not opt.hasOption('no-route') then 45 | begin 46 | fActualTask.run(opt, longOpt); 47 | end; 48 | result := self; 49 | end; 50 | end. 51 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Csrf/Includes/csrf.dependencies.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strCsrfDependencies : string = 9 | ' container.add(' + LineEnding + 10 | ' ''verifyCsrfToken'',' + LineEnding + 11 | ' TCsrfMiddlewareFactory.create(' + LineEnding + 12 | ' (container[GuidToString(IAppConfiguration)] as IAppConfiguration)' + LineEnding + 13 | ' .getString(''secretKey'')' + LineEnding + 14 | ' )' + LineEnding + 15 | ' );' + LineEnding + 16 | '' + LineEnding + 17 | ' (container[''appMiddlewares''] as IMiddlewareList)' + LineEnding + 18 | ' .add(container[''verifyCsrfToken''] as IMiddleware);' + LineEnding + 19 | '' + LineEnding; 20 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Csrf/WithCsrfTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit WithCsrfTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ConditionalCompositeTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that execute first task if --with-csrf 25 | * is set, otherwise run second task 26 | *--------------------------------------------- 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TWithCsrfTask = class(TConditionalCompositeTask) 30 | protected 31 | function condition( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring 34 | ) : boolean; override; 35 | end; 36 | 37 | implementation 38 | 39 | function TWithCsrfTask.condition( 40 | const opt : ITaskOptions; 41 | const longOpt : shortstring 42 | ) : boolean; 43 | begin 44 | result := opt.hasOption('with-csrf'); 45 | end; 46 | end. 47 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Daemon/SystemD/Factories/SystemDDaemonTaskFactoryImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit SystemDDaemonTaskFactoryImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskIntf, 18 | TaskFactoryIntf; 19 | 20 | type 21 | 22 | (*!-------------------------------------- 23 | * Factory class for setting up web application 24 | * as daemon service with SystemD 25 | * 26 | * @author Zamrony P. Juhara 27 | *---------------------------------------*) 28 | TSystemDDaemonTaskFactory = class(TInterfacedObject, ITaskFactory) 29 | public 30 | function build() : ITask; 31 | end; 32 | 33 | implementation 34 | 35 | uses 36 | 37 | TextFileCreatorImpl, 38 | DirectoryCreatorImpl, 39 | ContentModifierImpl, 40 | RootCheckTaskImpl, 41 | SystemDDaemonTaskImpl; 42 | 43 | function TSystemDDaemonTaskFactory.build() : ITask; 44 | var task : ITask; 45 | begin 46 | task := TSystemDDaemonTask.create( 47 | TTextFileCreator.create(), 48 | TDirectoryCreator.create(), 49 | TContentModifier.create() 50 | ); 51 | 52 | //protect to avoid accidentally running without root privilege 53 | result := TRootCheckTask.create(task); 54 | end; 55 | 56 | end. 57 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Daemon/SystemD/Includes/daemon.service.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strDaemonServiceInc: string = 9 | '#------------------------------------------------------------' + LineEnding + 10 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 11 | '#' + LineEnding + 12 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 13 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 14 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 15 | '#------------------------------------------------------------- ' + LineEnding + 16 | 17 | '[Unit]' + LineEnding + 18 | 'Description=[[APP_NAME]]' + LineEnding + 19 | 'After=network.target' + LineEnding + 20 | 'StartLimitIntervalSec=0' + LineEnding + 21 | '' + LineEnding + 22 | '[Service]' + LineEnding + 23 | 'Type=simple' + LineEnding + 24 | 'Restart=always' + LineEnding + 25 | 'RestartSec=1' + LineEnding + 26 | 'User=[[USER]]' + LineEnding + 27 | 'ExecStart=[[APP_BIN]]' + LineEnding + 28 | '' + LineEnding + 29 | '[Install]' + LineEnding + 30 | 'WantedBy=multi-user.target' + LineEnding; 31 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Apache/ApacheVHostCgiTplImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit ApacheVHostCgiTplImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | ContentModifierIntf, 19 | VirtualHostTemplateIntf; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that creates apache virtual host template 25 | * for CGI web application 26 | *------------------------------------------ 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TApacheVHostCgiTpl = class(TInterfacedObject, IVirtualHostTemplate) 30 | public 31 | function getVhostTemplate( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring; 34 | const cntModifier : IContentModifier 35 | ) : string; 36 | end; 37 | 38 | implementation 39 | 40 | uses 41 | 42 | SysUtils; 43 | 44 | function TApacheVHostCgiTpl.getVhostTemplate( 45 | const opt : ITaskOptions; 46 | const longOpt : shortstring; 47 | const cntModifier : IContentModifier 48 | ) : string; 49 | var 50 | {$INCLUDE src/Tasks/Implementations/Deploy/Core/WebServer/Apache/Includes/cgi.vhost.conf.inc} 51 | begin 52 | result := strCgiVhostConf; 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Apache/Includes/fcgi.vhost.conf.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strFcgiVhostConf: string = 9 | '' + LineEnding + 10 | '' + LineEnding + 11 | ' ServerAdmin admin@[[SERVER_NAME]]' + LineEnding + 12 | ' DocumentRoot "[[DOC_ROOT]]"' + LineEnding + 13 | '' + LineEnding + 14 | ' ServerName [[SERVER_NAME]]' + LineEnding + 15 | ' ServerAlias *.[[SERVER_NAME]]' + LineEnding + 16 | '' + LineEnding + 17 | ' ErrorLog [[APACHE_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-error.log' + LineEnding + 18 | ' CustomLog [[APACHE_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-access.log combined' + LineEnding + 19 | '' + LineEnding + 20 | ' ' + LineEnding + 21 | ' Options -MultiViews -FollowSymlinks +SymlinksIfOwnerMatch +ExecCGI' + LineEnding + 22 | ' AllowOverride FileInfo Indexes' + LineEnding + 23 | ' Require all granted' + LineEnding + 24 | ' ' + LineEnding + 25 | '' + LineEnding + 26 | ' ProxyRequests Off' + LineEnding + 27 | ' ProxyPassMatch "/css|js|images|img|plugins|bower_components(.*)|webfonts" !' + LineEnding + 28 | ' ProxyPassMatch ^/(.*)$ "fcgi://[[HOST]]:[[PORT]]"' + LineEnding + 29 | ''; 30 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Apache/Includes/http.vhost.conf.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strHttpVhostConf: string = 9 | '' + LineEnding + 10 | '' + LineEnding + 11 | ' ServerAdmin admin@[[SERVER_NAME]]' + LineEnding + 12 | ' DocumentRoot "[[DOC_ROOT]]"' + LineEnding + 13 | '' + LineEnding + 14 | ' ServerName [[SERVER_NAME]]' + LineEnding + 15 | ' ServerAlias *.[[SERVER_NAME]]' + LineEnding + 16 | '' + LineEnding + 17 | ' ErrorLog [[APACHE_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-error.log' + LineEnding + 18 | ' CustomLog [[APACHE_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-access.log combined' + LineEnding + 19 | '' + LineEnding + 20 | ' ' + LineEnding + 21 | ' Options -MultiViews -FollowSymlinks +SymlinksIfOwnerMatch +ExecCGI' + LineEnding + 22 | ' AllowOverride FileInfo Indexes' + LineEnding + 23 | ' Require all granted' + LineEnding + 24 | ' ' + LineEnding + 25 | '' + LineEnding + 26 | ' ProxyRequests Off' + LineEnding + 27 | ' ProxyPassMatch "/css|js|images|img|plugins|bower_components(.*)|webfonts" !' + LineEnding + 28 | ' ProxyPassMatch ^/(.*)$ "http://[[HOST]]:[[PORT]]"' + LineEnding + 29 | ''; 30 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Apache/Includes/scgi.vhost.conf.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strScgiVhostConf: string = 9 | '' + LineEnding + 10 | '' + LineEnding + 11 | ' ServerAdmin admin@[[SERVER_NAME]]' + LineEnding + 12 | ' DocumentRoot "[[DOC_ROOT]]"' + LineEnding + 13 | '' + LineEnding + 14 | ' ServerName [[SERVER_NAME]]' + LineEnding + 15 | ' ServerAlias *.[[SERVER_NAME]]' + LineEnding + 16 | '' + LineEnding + 17 | ' ErrorLog [[APACHE_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-error.log' + LineEnding + 18 | ' CustomLog [[APACHE_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-access.log combined' + LineEnding + 19 | '' + LineEnding + 20 | ' ' + LineEnding + 21 | ' Options -MultiViews -FollowSymlinks +SymlinksIfOwnerMatch +ExecCGI' + LineEnding + 22 | ' AllowOverride FileInfo Indexes' + LineEnding + 23 | ' Require all granted' + LineEnding + 24 | ' ' + LineEnding + 25 | '' + LineEnding + 26 | ' ProxyRequests Off' + LineEnding + 27 | ' ProxyPassMatch "/css|js|images|img|plugins|bower_components(.*)|webfonts" !' + LineEnding + 28 | ' ProxyPassMatch ^/(.*)$ "scgi://[[HOST]]:[[PORT]]"' + LineEnding + 29 | ''; 30 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Apache/Includes/uwsgi.vhost.conf.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strUwsgiVhostConf: string = 9 | '' + LineEnding + 10 | '' + LineEnding + 11 | ' ServerAdmin admin@[[SERVER_NAME]]' + LineEnding + 12 | ' DocumentRoot "[[DOC_ROOT]]"' + LineEnding + 13 | '' + LineEnding + 14 | ' ServerName [[SERVER_NAME]]' + LineEnding + 15 | ' ServerAlias *.[[SERVER_NAME]]' + LineEnding + 16 | '' + LineEnding + 17 | ' ErrorLog [[APACHE_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-error.log' + LineEnding + 18 | ' CustomLog [[APACHE_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-access.log combined' + LineEnding + 19 | '' + LineEnding + 20 | ' ' + LineEnding + 21 | ' Options -MultiViews -FollowSymlinks +SymlinksIfOwnerMatch +ExecCGI' + LineEnding + 22 | ' AllowOverride FileInfo Indexes' + LineEnding + 23 | ' Require all granted' + LineEnding + 24 | ' ' + LineEnding + 25 | '' + LineEnding + 26 | ' ProxyRequests Off' + LineEnding + 27 | ' ProxyPassMatch "/css|js|images|img|plugins|bower_components(.*)|webfonts" !' + LineEnding + 28 | ' ProxyPassMatch ^/(.*)$ "uwsgi://[[HOST]]:[[PORT]]"' + LineEnding + 29 | ''; 30 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Contracts/VirtualHostIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit VirtualHostIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf; 18 | 19 | type 20 | 21 | (*!-------------------------------------- 22 | * interface for any class having capability 23 | * to query web virtual host configuration 24 | * 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | IVirtualHost = interface 28 | ['{DA492850-C0B3-483F-A2A3-419C50170033}'] 29 | function getServerName(const opt : ITaskOptions; const longOpt : shortstring) : string; 30 | function getDocumentRoot(const opt : ITaskOptions; const longOpt : shortstring) : string; 31 | function getHost(const opt : ITaskOptions; const longOpt : shortstring) : string; 32 | function getPort(const opt : ITaskOptions; const longOpt : shortstring) : string; 33 | end; 34 | 35 | implementation 36 | 37 | end. 38 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Contracts/VirtualHostTemplateIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit VirtualHostTemplateIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | ContentModifierIntf; 19 | 20 | type 21 | 22 | (*!-------------------------------------- 23 | * interface for any class having capability 24 | * to query web virtual host template configuration 25 | * 26 | * @author Zamrony P. Juhara 27 | *---------------------------------------*) 28 | IVirtualHostTemplate = interface 29 | ['{F809C8E0-A14F-41BA-8012-660D2992B87B}'] 30 | function getVhostTemplate( 31 | const opt : ITaskOptions; 32 | const longOpt : shortstring; 33 | const cntModifier : IContentModifier 34 | ) : string; 35 | end; 36 | 37 | implementation 38 | 39 | end. 40 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Contracts/VirtualHostWriterIntf.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit VirtualHostWriterIntf; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | ContentModifierIntf; 18 | 19 | type 20 | 21 | (*!-------------------------------------- 22 | * interface for any class having capability 23 | * to write web virtual host configuration 24 | * 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | IVirtualHostWriter = interface 28 | ['{452E15EC-5647-4D84-BFE3-77F47F8EFBF6}'] 29 | procedure writeVhost( 30 | const serverName : string; 31 | const vhostTpl : string; 32 | const cntModifier : IContentModifier 33 | ); 34 | end; 35 | 36 | implementation 37 | 38 | end. 39 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Nginx/Includes/balancer.vhost.conf.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strBalancerVhostConf: string = 9 | 'upstream lb-[[SERVER_NAME]] {' + LineEnding + 10 | ' [[LOAD_BALANCER_METHOD]]' + LineEnding + 11 | ' [[LOAD_BALANCER_MEMBERS]]' + LineEnding + 12 | '}'+ LineEnding + 13 | '' + LineEnding + 14 | 'server {' + LineEnding + 15 | '' + LineEnding + 16 | ' listen 80;' + LineEnding + 17 | ' root "[[DOC_ROOT]]";' + LineEnding + 18 | '' + LineEnding + 19 | ' server_name [[SERVER_NAME]] *.[[SERVER_NAME]];' + LineEnding + 20 | '' + LineEnding + 21 | ' error_log "[[NGINX_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-error.log";' + LineEnding + 22 | ' access_log "[[NGINX_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-access.log";' + LineEnding + 23 | '' + LineEnding + 24 | ' location / {' + LineEnding + 25 | ' try_files $uri @[[SERVER_NAME]];' + LineEnding + 26 | ' }' + LineEnding + 27 | '' + LineEnding + 28 | ' location @[[SERVER_NAME]] {' + LineEnding + 29 | ' [[PROXY_PASS_TYPE]] [[SERVER_PREFIX]]lb-[[SERVER_NAME]];' + LineEnding + 30 | ' [[PROXY_PARAMS_TYPE]]' + LineEnding + 31 | ' }' + LineEnding + 32 | '' + LineEnding + 33 | '}'; 34 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Nginx/Includes/fcgi.vhost.conf.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strFcgiVhostConf: string = 9 | 'server {' + LineEnding + 10 | '' + LineEnding + 11 | ' listen 80;' + LineEnding + 12 | ' root "[[DOC_ROOT]]";' + LineEnding + 13 | '' + LineEnding + 14 | ' server_name [[SERVER_NAME]] *.[[SERVER_NAME]];' + LineEnding + 15 | '' + LineEnding + 16 | ' error_log "[[NGINX_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-error.log";' + LineEnding + 17 | ' access_log "[[NGINX_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-access.log";' + LineEnding + 18 | '' + LineEnding + 19 | ' location / {' + LineEnding + 20 | ' try_files $uri @[[SERVER_NAME]];' + LineEnding + 21 | ' }' + LineEnding + 22 | '' + LineEnding + 23 | ' location @[[SERVER_NAME]] {' + LineEnding + 24 | ' fastcgi_pass [[HOST]]:[[PORT]];' + LineEnding + 25 | ' include fastcgi_params;' + LineEnding + 26 | ' }' + LineEnding + 27 | '' + LineEnding + 28 | '}'; 29 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Nginx/Includes/http.vhost.conf.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strHttpVhostConf: string = 9 | 'server {' + LineEnding + 10 | '' + LineEnding + 11 | ' listen 80;' + LineEnding + 12 | ' root "[[DOC_ROOT]]";' + LineEnding + 13 | '' + LineEnding + 14 | ' server_name [[SERVER_NAME]] *.[[SERVER_NAME]];' + LineEnding + 15 | '' + LineEnding + 16 | ' error_log "[[NGINX_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-error.log";' + LineEnding + 17 | ' access_log "[[NGINX_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-access.log";' + LineEnding + 18 | '' + LineEnding + 19 | ' location / {' + LineEnding + 20 | ' try_files $uri @[[SERVER_NAME]];' + LineEnding + 21 | ' }' + LineEnding + 22 | '' + LineEnding + 23 | ' location @[[SERVER_NAME]] {' + LineEnding + 24 | ' proxy_pass http://[[HOST]]:[[PORT]];' + LineEnding + 25 | ' }' + LineEnding + 26 | '' + LineEnding + 27 | '}'; 28 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Nginx/Includes/scgi.vhost.conf.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strScgiVhostConf: string = 9 | 'server {' + LineEnding + 10 | '' + LineEnding + 11 | ' listen 80;' + LineEnding + 12 | ' root "[[DOC_ROOT]]";' + LineEnding + 13 | '' + LineEnding + 14 | ' server_name [[SERVER_NAME]] *.[[SERVER_NAME]];' + LineEnding + 15 | '' + LineEnding + 16 | ' error_log "[[NGINX_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-error.log";' + LineEnding + 17 | ' access_log "[[NGINX_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-access.log";' + LineEnding + 18 | '' + LineEnding + 19 | ' location / {' + LineEnding + 20 | ' try_files $uri @[[SERVER_NAME]];' + LineEnding + 21 | ' }' + LineEnding + 22 | '' + LineEnding + 23 | ' location @[[SERVER_NAME]] {' + LineEnding + 24 | ' scgi_pass [[HOST]]:[[PORT]];' + LineEnding + 25 | ' include scgi_params;' + LineEnding + 26 | ' }' + LineEnding + 27 | '' + LineEnding + 28 | '}'; 29 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Nginx/Includes/uwsgi.vhost.conf.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strUwsgiVhostConf: string = 9 | 'server {' + LineEnding + 10 | '' + LineEnding + 11 | ' listen 80;' + LineEnding + 12 | ' root "[[DOC_ROOT]]";' + LineEnding + 13 | '' + LineEnding + 14 | ' server_name [[SERVER_NAME]] *.[[SERVER_NAME]];' + LineEnding + 15 | '' + LineEnding + 16 | ' error_log "[[NGINX_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-error.log";' + LineEnding + 17 | ' access_log "[[NGINX_LOG_DIR]]' + DirectorySeparator + '[[SERVER_NAME]]-access.log";' + LineEnding + 18 | '' + LineEnding + 19 | ' location / {' + LineEnding + 20 | ' try_files $uri @[[SERVER_NAME]];' + LineEnding + 21 | ' }' + LineEnding + 22 | '' + LineEnding + 23 | ' location @[[SERVER_NAME]] {' + LineEnding + 24 | ' uwsgi_pass [[HOST]]:[[PORT]];' + LineEnding + 25 | ' include uwsgi_params;' + LineEnding + 26 | ' }' + LineEnding + 27 | '' + LineEnding + 28 | '}'; 29 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Nginx/NginxReloadWebServerTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit NginxReloadWebServerTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ReloadWebServerTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that adds domain name entry to /etc/hosts 25 | *------------------------------------------ 26 | * @author Zamrony P. Juhara 27 | *---------------------------------------*) 28 | TNginxReloadWebServerTask = class(TReloadWebServerTask) 29 | protected 30 | function getSvcName() : string; override; 31 | end; 32 | 33 | implementation 34 | 35 | function TNginxReloadWebServerTask.getSvcName() : string; 36 | begin 37 | result := 'nginx'; 38 | end; 39 | 40 | end. 41 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Nginx/NginxVHostHttpTplImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit NginxVHostHttpTplImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | ContentModifierIntf, 19 | VirtualHostTemplateIntf; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that creates nginx virtual host template 25 | * for http web application 26 | *------------------------------------------ 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TNginxVHostHttpTpl = class(TInterfacedObject, IVirtualHostTemplate) 30 | public 31 | function getVhostTemplate( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring; 34 | const cntModifier : IContentModifier 35 | ) : string; 36 | end; 37 | 38 | implementation 39 | 40 | uses 41 | 42 | SysUtils; 43 | 44 | function TNginxVHostHttpTpl.getVhostTemplate( 45 | const opt : ITaskOptions; 46 | const longOpt : shortstring; 47 | const cntModifier : IContentModifier 48 | ) : string; 49 | var 50 | {$INCLUDE src/Tasks/Implementations/Deploy/Core/WebServer/Nginx/Includes/http.vhost.conf.inc} 51 | begin 52 | result := strHttpVhostConf; 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WebServer/Nginx/NginxVHostScgiTplImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit NginxVHostScgiTplImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | ContentModifierIntf, 19 | VirtualHostTemplateIntf; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that creates nginx virtual host template 25 | * for SCGI web application 26 | *------------------------------------------ 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TNginxVHostScgiTpl = class(TInterfacedObject, IVirtualHostTemplate) 30 | public 31 | function getVhostTemplate( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring; 34 | const cntModifier : IContentModifier 35 | ) : string; 36 | end; 37 | 38 | implementation 39 | 40 | uses 41 | 42 | SysUtils; 43 | 44 | function TNginxVHostScgiTpl.getVhostTemplate( 45 | const opt : ITaskOptions; 46 | const longOpt : shortstring; 47 | const cntModifier : IContentModifier 48 | ) : string; 49 | var 50 | {$INCLUDE src/Tasks/Implementations/Deploy/Core/WebServer/Nginx/Includes/scgi.vhost.conf.inc} 51 | begin 52 | result := strScgiVhostConf; 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Deploy/Core/WithSkipEtcHostTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit WithSkipEtcHostTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ConditionalCompositeTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that run first task if --skip-etc-hosts 25 | * parameter to skip domain entry creation 26 | * in /etc/hosts or second task if default behavior 27 | *---------------------------------------- 28 | * @author Zamrony P. Juhara 29 | *---------------------------------------*) 30 | TWithSkipEtcHostTask = class(TConditionalCompositeTask) 31 | protected 32 | function condition( 33 | const opt : ITaskOptions; 34 | const longOpt : shortstring 35 | ) : boolean; override; 36 | end; 37 | 38 | implementation 39 | 40 | uses 41 | 42 | sysutils; 43 | 44 | function TWithSkipEtcHostTask.condition( 45 | const opt : ITaskOptions; 46 | const longOpt : shortstring 47 | ) : boolean; 48 | begin 49 | result := opt.hasOption('skip-etc-hosts'); 50 | end; 51 | end. 52 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/GuidGen/GuidGenTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit GuidGenTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | SysUtils; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that generate GUID 25 | *--------------------------------------------- 26 | * @author Zamrony P. Juhara 27 | *---------------------------------------*) 28 | TGuidGenTask = class(TInterfacedObject, ITask) 29 | public 30 | function run( 31 | const opt : ITaskOptions; 32 | const longOpt : shortstring 33 | ) : ITask; 34 | end; 35 | 36 | implementation 37 | 38 | function TGuidGenTask.run( 39 | const opt : ITaskOptions; 40 | const longOpt : shortstring 41 | ) : ITask; 42 | var guid : TGUID; 43 | begin 44 | createGUID(guid); 45 | write(GuidToString(guid)); 46 | result := self; 47 | end; 48 | end. 49 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Info/WithSingleInfoTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit WithSingleInfoTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ConditionalCompositeTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that execute first task if --task 25 | * is set, otherwise run second task 26 | *--------------------------------------------- 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TWithSingleInfoTask = class(TConditionalCompositeTask) 30 | protected 31 | function condition( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring 34 | ) : boolean; override; 35 | end; 36 | 37 | implementation 38 | 39 | function TWithSingleInfoTask.condition( 40 | const opt : ITaskOptions; 41 | const longOpt : shortstring 42 | ) : boolean; 43 | begin 44 | result := opt.hasOption('task'); 45 | end; 46 | end. 47 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/KeyGen/Factories/KeyGenTaskFactoryImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit KeyGenTaskFactoryImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskIntf, 18 | TaskFactoryIntf; 19 | 20 | type 21 | 22 | (*!-------------------------------------- 23 | * Factory class for key generator task 24 | * 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | TKeyGenTaskFactory = class(TInterfacedObject, ITaskFactory) 28 | public 29 | function build() : ITask; 30 | end; 31 | 32 | implementation 33 | 34 | uses 35 | 36 | KeyGenTaskImpl, 37 | BasicKeyGeneratorImpl; 38 | 39 | function TKeyGenTaskFactory.build() : ITask; 40 | begin 41 | result := TKeyGenTask.create(TBasicKeyGenerator.create()); 42 | end; 43 | end. 44 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Logger/Includes/dblogger.dependencies.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strLoggerDependencies : string = 9 | ' container.add(' + LineEnding + 10 | ' ''logger'',' + LineEnding + 11 | ' TDbLoggerFactory.create()' + LineEnding + 12 | ' );' + LineEnding + 13 | '' + LineEnding; 14 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Logger/Includes/filelogger.dependencies.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strLoggerDependencies : string = 9 | ' container.add(' + LineEnding + 10 | ' ''logger'',' + LineEnding + 11 | ' TFileLoggerFactory.create(' + LineEnding + 12 | ' [[BASE_DIR]] + ''/storages/logs/app.log''' + LineEnding + 13 | ' )' + LineEnding + 14 | ' );' + LineEnding + 15 | '' + LineEnding; 16 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Logger/Includes/sysloglogger.dependencies.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strLoggerDependencies : string = 9 | ' container.add(' + LineEnding + 10 | ' ''logger'',' + LineEnding + 11 | ' TSysLogLoggerFactory.create().prefix(''fano'')' + LineEnding + 12 | ' );' + LineEnding + 13 | '' + LineEnding; 14 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Logger/WithLoggerTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit WithLoggerTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ConditionalCompositeTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that execute first task if --with-logger 25 | * is set, otherwise run second task 26 | *--------------------------------------------- 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TWithLoggerTask = class(TConditionalCompositeTask) 30 | protected 31 | function condition( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring 34 | ) : boolean; override; 35 | end; 36 | 37 | implementation 38 | 39 | function TWithLoggerTask.condition( 40 | const opt : ITaskOptions; 41 | const longOpt : shortstring 42 | ) : boolean; 43 | begin 44 | result := opt.hasOption('with-logger'); 45 | end; 46 | end. 47 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Middleware/Support/Includes/buildDispatcher.decl.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strBuildDispatcherDecl : string = 9 | ' function buildDispatcher(' + LineEnding + 10 | ' const container : IDependencyContainer;' + LineEnding + 11 | ' const routeMatcher : IRouteMatcher;' + LineEnding + 12 | ' const config : IAppConfiguration' + LineEnding + 13 | ' ) : IDispatcher; override;' + LineEnding; 14 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Middleware/Support/Includes/buildDispatcher.impl.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strBuildDispatcherImpl : string = 9 | ' function TAppServiceProvider.buildDispatcher(' + LineEnding + 10 | ' const container : IDependencyContainer;' + LineEnding + 11 | ' const routeMatcher : IRouteMatcher;' + LineEnding + 12 | ' const config : IAppConfiguration' + LineEnding + 13 | ' ) : IDispatcher;' + LineEnding + 14 | ' begin' + LineEnding + 15 | ' container.add(''appMiddlewares'', TMiddlewareListFactory.create());' + LineEnding + 16 | '' + LineEnding + 17 | ' container.add(' + LineEnding + 18 | ' GuidToString(IDispatcher),' + LineEnding + 19 | ' TMwExecDispatcherFactory.create(' + LineEnding + 20 | ' container[''appMiddlewares''] as IMiddlewareLinkList,' + LineEnding + 21 | ' routeMatcher,' + LineEnding + 22 | ' TRequestResponseFactory.create()' + LineEnding + 23 | ' )' + LineEnding + 24 | ' );' + LineEnding + 25 | ' result := container[GuidToString(IDispatcher)] as IDispatcher;' + LineEnding + 26 | ' end;' + LineEnding; 27 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Minifier/Factories/CssMinifierTaskFactoryImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CssMinifierTaskFactoryImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskIntf, 18 | TaskFactoryIntf; 19 | 20 | type 21 | 22 | (*!-------------------------------------- 23 | * Factory class for CSS minifier task 24 | * 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | TCssMinifierTaskFactory = class(TInterfacedObject, ITaskFactory) 28 | public 29 | function build() : ITask; 30 | end; 31 | 32 | implementation 33 | 34 | uses 35 | 36 | NullTaskImpl, 37 | DirFileMinifierTaskImpl, 38 | CssMinifierImpl, 39 | FileHelperImpl, 40 | MinifyFileTaskImpl, 41 | MinifyDirTaskImpl; 42 | 43 | function TCssMinifierTaskFactory.build() : ITask; 44 | begin 45 | result := TDirFileMinifierTask.create( 46 | TMinifyFileTask.create( 47 | TCssMinifier.create(), 48 | TFileHelper.create() 49 | ), 50 | TMinifyDirTask.create( 51 | TCssMinifier.create(), 52 | TFileHelper.create() 53 | ) 54 | ); 55 | end; 56 | 57 | end. 58 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Minifier/Factories/JsMinifierTaskFactoryImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit JsMinifierTaskFactoryImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskIntf, 18 | TaskFactoryIntf; 19 | 20 | type 21 | 22 | (*!-------------------------------------- 23 | * Factory class for JavaScript minifier task 24 | * 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | TJsMinifierTaskFactory = class(TInterfacedObject, ITaskFactory) 28 | public 29 | function build() : ITask; 30 | end; 31 | 32 | implementation 33 | 34 | uses 35 | 36 | NullTaskImpl, 37 | DirFileMinifierTaskImpl, 38 | JsMinifierImpl, 39 | FileHelperImpl, 40 | MinifyFileTaskImpl, 41 | MinifyDirTaskImpl; 42 | 43 | function TJsMinifierTaskFactory.build() : ITask; 44 | begin 45 | result := TDirFileMinifierTask.create( 46 | TMinifyFileTask.create( 47 | TJsMinifier.create(), 48 | TFileHelper.create() 49 | ), 50 | TMinifyDirTask.create( 51 | TJsMinifier.create(), 52 | TFileHelper.create() 53 | ) 54 | ); 55 | end; 56 | 57 | end. 58 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Null/Factories/NullTaskFactoryImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit NullTaskFactoryImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskIntf, 18 | TaskFactoryIntf; 19 | 20 | type 21 | 22 | (*!-------------------------------------- 23 | * Factory class for create project task 24 | * 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | TNullTaskFactory = class(TInterfacedObject, ITaskFactory) 28 | public 29 | function build() : ITask; 30 | end; 31 | 32 | implementation 33 | 34 | uses 35 | 36 | NullTaskImpl; 37 | 38 | 39 | function TNullTaskFactory.build() : ITask; 40 | begin 41 | result := TNullTask.create(); 42 | end; 43 | 44 | end. 45 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Null/NullTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit NullTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf; 19 | 20 | type 21 | 22 | (*!-------------------------------------- 23 | * Task that does nothing 24 | * 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | TNullTask = class(TInterfacedObject, ITask) 28 | public 29 | function run( 30 | const opt : ITaskOptions; 31 | const longOpt : shortstring 32 | ) : ITask; 33 | end; 34 | 35 | implementation 36 | 37 | function TNullTask.run( 38 | const opt : ITaskOptions; 39 | const longOpt : shortstring 40 | ) : ITask; 41 | begin 42 | //intentionally does nothing 43 | result := self; 44 | end; 45 | end. 46 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Cgi/CreateCgiAppFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateCgiAppFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateAppFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create app.pas file for CGI project 25 | * 26 | * @author Zamrony P. Juhara 27 | *---------------------------------------*) 28 | TCreateCgiAppFileTask = class(TCreateAppFileTask) 29 | protected 30 | 31 | procedure createApp( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring; 34 | const dir : string 35 | ); override; 36 | 37 | end; 38 | 39 | implementation 40 | 41 | uses 42 | 43 | sysutils; 44 | 45 | procedure TCreateCgiAppFileTask.createApp( 46 | const opt : ITaskOptions; 47 | const longOpt : shortstring; 48 | const dir : string 49 | ); 50 | var 51 | {$INCLUDE src/Tasks/Implementations/Project/Cgi/Includes/app.pas.inc} 52 | begin 53 | createTextFile(dir + '/app.pas', strAppPas); 54 | end; 55 | 56 | end. 57 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Cgi/CreateCgiReadmeFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateCgiReadmeFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateReadmeFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create web application project 25 | * custom README file for CGI project 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateCgiReadmeFileTask = class(TCreateReadmeFileTask) 30 | protected 31 | procedure createReadmeFile(const dir : string); override; 32 | end; 33 | 34 | implementation 35 | 36 | uses 37 | 38 | sysutils; 39 | 40 | procedure TCreateCgiReadmeFileTask.createReadmeFile(const dir : string); 41 | var 42 | {$INCLUDE src/Tasks/Implementations/Project/Cgi/Includes/readme.md.inc} 43 | begin 44 | createTextFile(dir + '/README.md', strReadme); 45 | end; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Cgi/Includes/dockercompose.inc: -------------------------------------------------------------------------------- 1 | strDockercompose : string = 2 | '#------------------------------------------------------------' + LineEnding + 3 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 4 | '#' + LineEnding + 5 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 6 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 7 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 8 | '#--------------------------------------------------------------' + LineEnding + 9 | '' + LineEnding + 10 | 'version: "2"' + LineEnding + 11 | 'services:' + LineEnding + 12 | ' fano:' + LineEnding + 13 | ' build: .' + LineEnding + 14 | '' + LineEnding; 15 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Cgi/Includes/vhost.example.inc: -------------------------------------------------------------------------------- 1 | strVhostExample : string = 2 | '#------------------------------------------------------------' + LineEnding + 3 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 4 | '#' + LineEnding + 5 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 6 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 7 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 8 | '#--------------------------------------------------------------' + LineEnding + 9 | '' + LineEnding + 10 | '' + LineEnding + 11 | ' ' + LineEnding + 12 | ' Options +ExecCGI' + LineEnding + 13 | ' AllowOverride FileInfo Indexes' + LineEnding + 14 | ' Require all granted' + LineEnding + 15 | ' DirectoryIndex app.cgi' + LineEnding + 16 | ' AddHandler cgi-script .cgi' + LineEnding + 17 | ' ' + LineEnding + 18 | ' RewriteEngine On' + LineEnding + 19 | '' + LineEnding + 20 | ' RewriteCond %{REQUEST_FILENAME} !-d' + LineEnding + 21 | ' RewriteCond %{REQUEST_FILENAME} !-f' + LineEnding + 22 | ' RewriteRule ^(.*)$ app.cgi [L]' + LineEnding + 23 | ' ' + LineEnding + 24 | ' ' + LineEnding + 25 | '' + LineEnding + 26 | '' + LineEnding; 27 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/BaseProjectTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit BaseProjectTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf; 19 | 20 | type 21 | 22 | (*!-------------------------------------- 23 | * Base task that create web application project 24 | * using fano web framework 25 | * 26 | * @author Zamrony P. Juhara 27 | *---------------------------------------*) 28 | TBaseProjectTask = class(TInterfacedObject, ITask) 29 | protected 30 | baseDirectory : string; 31 | public 32 | function run( 33 | const opt : ITaskOptions; 34 | const longOpt : shortstring 35 | ) : ITask; virtual; 36 | end; 37 | 38 | implementation 39 | 40 | uses 41 | 42 | sysutils; 43 | 44 | function TBaseProjectTask.run( 45 | const opt : ITaskOptions; 46 | const longOpt : shortstring 47 | ) : ITask; 48 | begin 49 | baseDirectory := opt.getOptionValue(longOpt); 50 | result := self; 51 | end; 52 | end. 53 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/CreateAppFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateAppFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create app.pas file 25 | * 26 | * @author Zamrony P. Juhara 27 | *---------------------------------------*) 28 | TCreateAppFileTask = class abstract (TCreateFileTask) 29 | protected 30 | 31 | procedure createApp( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring; 34 | const dir : string 35 | ); virtual; abstract; 36 | 37 | public 38 | function run( 39 | const opt : ITaskOptions; 40 | const longOpt : shortstring 41 | ) : ITask; override; 42 | end; 43 | 44 | implementation 45 | 46 | function TCreateAppFileTask.run( 47 | const opt : ITaskOptions; 48 | const longOpt : shortstring 49 | ) : ITask; 50 | begin 51 | //need to call parent run() so baseDirectory can be initialized 52 | inherited run(opt, longOpt); 53 | createApp(opt, longOpt, baseDirectory + '/src'); 54 | result := self; 55 | end; 56 | end. 57 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/CreateBasicFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2020 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateBasicFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create web application project 25 | * custom file on specified directory 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateBasicFileTask = class abstract (TCreateFileTask) 30 | protected 31 | procedure createFile(const dir : string); virtual; abstract; 32 | public 33 | function run( 34 | const opt : ITaskOptions; 35 | const longOpt : shortstring 36 | ) : ITask; override; 37 | end; 38 | 39 | implementation 40 | 41 | function TCreateBasicFileTask.run( 42 | const opt : ITaskOptions; 43 | const longOpt : shortstring 44 | ) : ITask; 45 | begin 46 | //need to call parent run() so baseDirectory can be initialized 47 | inherited run(opt, longOpt); 48 | createFile(baseDirectory); 49 | result := self; 50 | end; 51 | end. 52 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/CreateReadmeFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateReadmeFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create web application project 25 | * custom README file 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateReadmeFileTask = class abstract (TCreateFileTask) 30 | protected 31 | procedure createReadmeFile(const dir : string); virtual; abstract; 32 | public 33 | function run( 34 | const opt : ITaskOptions; 35 | const longOpt : shortstring 36 | ) : ITask; override; 37 | end; 38 | 39 | implementation 40 | 41 | function TCreateReadmeFileTask.run( 42 | const opt : ITaskOptions; 43 | const longOpt : shortstring 44 | ) : ITask; 45 | begin 46 | //need to call parent run() so baseDirectory can be initialized 47 | inherited run(opt, longOpt); 48 | createReadmeFile(baseDirectory); 49 | result := self; 50 | end; 51 | end. 52 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/appconfig.dependencies.inc.inc: -------------------------------------------------------------------------------- 1 | strAppConfigDependenciesInc: string = 2 | (*!------------------------------------------------------------ 3 | * Fano CLI Application (https://fanoframework.github.io) 4 | * 5 | * @link https://github.com/fanoframework/fano-cli 6 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 7 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 8 | *------------------------------------------------------------- *) 9 | ' container.add(' + LineEnding + 10 | ' ''config'',' + LineEnding + 11 | ' [[FACTORY_CLASS]].create(' + LineEnding + 12 | ' [[BASE_DIR]] + ''[[APP_CONFIG_FILE]]''' + LineEnding + 13 | ' )' + LineEnding + 14 | ' );' + LineEnding + 15 | ' container.alias(GuidToString(IAppConfiguration), ''config'');' + LineEnding + 16 | ' result := container[''config''] as IAppConfiguration;' + LineEnding; 17 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/clean.cmd.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strClearUnitsCmd: string = 9 | '@echo off' + LineEnding + 10 | 'REM ------------------------------------------------------------' + LineEnding + 11 | 'REM [[APP_NAME]] ([[APP_URL]])' + LineEnding + 12 | 'REM' + LineEnding + 13 | 'REM @link [[APP_REPOSITORY_URL]]' + LineEnding + 14 | 'REM @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 15 | 'REM @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 16 | 'REM -------------------------------------------------------------' + LineEnding + 17 | '' + LineEnding + 18 | 'REM ------------------------------------------------------' + LineEnding + 19 | 'REM Scripts to delete all compiled unit files' + LineEnding + 20 | 'REM ------------------------------------------------------' + LineEnding + 21 | '' + LineEnding + 22 | 'FOR /R bin\unit %i IN (*) DO IF NOT %i == README.md del %i'; 23 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/clean.sh.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strClearUnitsSh: string = 9 | '#------------------------------------------------------------' + LineEnding + 10 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 11 | '#' + LineEnding + 12 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 13 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 14 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 15 | '#--------------------------------------------------------------' + LineEnding + 16 | '#!/bin/bash' + LineEnding + 17 | '' + LineEnding + 18 | '#------------------------------------------------------' + LineEnding + 19 | '# Scripts to delete all compiled unit files' + LineEnding + 20 | '#------------------------------------------------------' + LineEnding + 21 | '' + LineEnding + 22 | 'find bin/unit ! -name ''README.md'' -type f -exec rm -f {} +'; 23 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/controllers.dependencies.inc.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strCtrlDependenciesInc: string = 9 | '(*!------------------------------------------------------------' + LineEnding + 10 | ' * [[APP_NAME]] ([[APP_URL]])' + LineEnding + 11 | ' *' + LineEnding + 12 | ' * @link [[APP_REPOSITORY_URL]]' + LineEnding + 13 | ' * @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 14 | ' * @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 15 | ' *------------------------------------------------------------- *)' + LineEnding + 16 | '' + LineEnding + 17 | '{%dependencies.inc}' + LineEnding + 18 | '' + LineEnding + 19 | '{---put your controller-related dependencies registration here---}' + LineEnding + 20 | ''; 21 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/default.appconfig.dependencies.inc.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strDefaultAppConfigDependenciesInc: string = 9 | ' result := inherited buildAppConfig(container);' + LineEnding; 10 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/dependencies.inc.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strDependenciesInc: string = 9 | '(*!------------------------------------------------------------' + LineEnding + 10 | ' * [[APP_NAME]] ([[APP_URL]])' + LineEnding + 11 | ' *' + LineEnding + 12 | ' * @link [[APP_REPOSITORY_URL]]' + LineEnding + 13 | ' * @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 14 | ' * @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 15 | ' *------------------------------------------------------------- *)' + LineEnding + 16 | '' + LineEnding + 17 | '{$INCLUDE main.dependencies.inc}' + LineEnding + 18 | '{$INCLUDE middlewares.dependencies.inc}' + LineEnding + 19 | '{$INCLUDE models.dependencies.inc}' + LineEnding + 20 | '{$INCLUDE views.dependencies.inc}' + LineEnding + 21 | '{$INCLUDE controllers.dependencies.inc}' + LineEnding + 22 | ''; 23 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/htaccess.example.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strHtaccessExampleInc: string = 9 | 'DirectoryIndex app.cgi' + LineEnding + 10 | '' + LineEnding + 11 | ' RewriteEngine On' + LineEnding + 12 | '' + LineEnding + 13 | ' # redirect http to https' + LineEnding + 14 | ' # RewriteCond %{HTTPS} off' + LineEnding + 15 | ' # RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]' + LineEnding + 16 | '' + LineEnding + 17 | ' RewriteCond %{REQUEST_FILENAME} !-d' + LineEnding + 18 | ' RewriteCond %{REQUEST_FILENAME} !-f' + LineEnding + 19 | ' RewriteRule ^(.*)$ app.cgi [L]' + LineEnding + 20 | ''; 21 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/main.dependencies.inc.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strMainDependenciesInc: string = 9 | '(*!------------------------------------------------------------' + LineEnding + 10 | ' * [[APP_NAME]] ([[APP_URL]])' + LineEnding + 11 | ' *' + LineEnding + 12 | ' * @link [[APP_REPOSITORY_URL]]' + LineEnding + 13 | ' * @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 14 | ' * @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 15 | ' *------------------------------------------------------------- *)' + LineEnding + 16 | '' + LineEnding + 17 | '{---put your main dependencies registration here---}' + LineEnding + 18 | '{ container.add(''db'', TMySqlDbFactory.create()); }' + LineEnding + 19 | ''; 20 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/methods/buildAppConfig.decl.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strBuildAppConfigMethodDecl : string = 9 | ' function buildAppConfig(const container : IDependencyContainer) : IAppConfiguration; override;' + LineEnding; 10 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/methods/buildAppConfig.impl.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strBuildAppConfigMethodImpl : string = 9 | ' function TAppServiceProvider.buildAppConfig(const container : IDependencyContainer) : IAppConfiguration;' + LineEnding + 10 | ' begin' + LineEnding + 11 | '[[CONFIG_IMPL_SECTION]]' + LineEnding + 12 | ' end;' + LineEnding; 13 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/middlewares.dependencies.inc.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strMiddlewaresDependenciesInc: string = 9 | '(*!------------------------------------------------------------' + LineEnding + 10 | ' * [[APP_NAME]] ([[APP_URL]])' + LineEnding + 11 | ' *' + LineEnding + 12 | ' * @link [[APP_REPOSITORY_URL]]' + LineEnding + 13 | ' * @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 14 | ' * @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 15 | ' *------------------------------------------------------------- *)' + LineEnding + 16 | '' + LineEnding + 17 | '{%dependencies.inc}' + LineEnding + 18 | '' + LineEnding + 19 | '{---put your middleware-related dependencies registration here---}' + LineEnding + 20 | ''; 21 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/models.dependencies.inc.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strModelDependenciesInc: string = 9 | '(*!------------------------------------------------------------' + LineEnding + 10 | ' * [[APP_NAME]] ([[APP_URL]])' + LineEnding + 11 | ' *' + LineEnding + 12 | ' * @link [[APP_REPOSITORY_URL]]' + LineEnding + 13 | ' * @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 14 | ' * @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 15 | ' *------------------------------------------------------------- *)' + LineEnding + 16 | '' + LineEnding + 17 | '{%dependencies.inc}' + LineEnding + 18 | '' + LineEnding + 19 | '{---put your data model-related dependencies registration here---}' + LineEnding + 20 | ''; 21 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/routes.inc.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strRoutesInc: string = 9 | '(*!------------------------------------------------------------' + LineEnding + 10 | ' * [[APP_NAME]] ([[APP_URL]])' + LineEnding + 11 | ' *' + LineEnding + 12 | ' * @link [[APP_REPOSITORY_URL]]' + LineEnding + 13 | ' * @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 14 | ' * @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 15 | ' *------------------------------------------------------------- *)' + LineEnding + 16 | '{---put your routes registration here---}' + LineEnding + 17 | '{ router.get(''/'', THomeControllerFactory.create()); }' + LineEnding + 18 | ''; 19 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/Includes/views.dependencies.inc.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strViewDependenciesInc: string = 9 | '(*!------------------------------------------------------------' + LineEnding + 10 | ' * [[APP_NAME]] ([[APP_URL]])' + LineEnding + 11 | ' *' + LineEnding + 12 | ' * @link [[APP_REPOSITORY_URL]]' + LineEnding + 13 | ' * @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 14 | ' * @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 15 | ' *------------------------------------------------------------- *)' + LineEnding + 16 | '' + LineEnding + 17 | '{%dependencies.inc}' + LineEnding + 18 | '' + LineEnding + 19 | '{---put your views-related dependencies registration here---}' + LineEnding + 20 | ''; 21 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Core/StageRepoTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit StageRepoTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | BaseGitRepoTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that stage new files so it is 25 | * ready for commit 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TStageRepoTask = class(TBaseGitRepoTask) 30 | public 31 | function run( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring 34 | ) : ITask; override; 35 | end; 36 | 37 | implementation 38 | 39 | uses 40 | 41 | sysutils; 42 | 43 | function TStageRepoTask.run( 44 | const opt : ITaskOptions; 45 | const longOpt : shortstring 46 | ) : ITask; 47 | var outputString : string; 48 | begin 49 | //need to call parent run() so baseDirectory can be initialized 50 | inherited run(opt, longOpt); 51 | 52 | // following line equals calling following command on shell 53 | // $ git add . 54 | runGit(baseDirectory, ['add', '.'], outputString); 55 | writeln(outputString); 56 | 57 | result := self; 58 | end; 59 | end. 60 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Daemon/CreateDaemonBootstrapFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateDaemonBootstrapFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateBootstrapFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create bootstrap.pas for daemon 25 | * 26 | * @author Zamrony P. Juhara 27 | *---------------------------------------*) 28 | TCreateDaemonBootstrapFileTask = class(TCreateBootstrapFileTask) 29 | protected 30 | procedure createBootstrap( 31 | const opt : ITaskOptions; 32 | const longOpt : shortstring; 33 | const dir : string 34 | ); override; 35 | end; 36 | 37 | implementation 38 | 39 | uses 40 | 41 | sysutils; 42 | 43 | procedure TCreateDaemonBootstrapFileTask.createBootstrap( 44 | const opt : ITaskOptions; 45 | const longOpt : shortstring; 46 | const dir : string 47 | ); 48 | var 49 | {$INCLUDE src/Tasks/Implementations/Project/Daemon/Includes/bootstrap.pas.inc} 50 | begin 51 | createTextFile(dir + '/bootstrap.pas', strBootstrapPas); 52 | end; 53 | 54 | end. 55 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/FastCgi/CreateFcgiReadmeFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateFcgiReadmeFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateReadmeFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create web application project 25 | * custom README file for FastCGI project 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateFcgiReadmeFileTask = class(TCreateReadmeFileTask) 30 | protected 31 | procedure createReadmeFile(const dir : string); override; 32 | end; 33 | 34 | implementation 35 | 36 | uses 37 | 38 | sysutils; 39 | 40 | procedure TCreateFcgiReadmeFileTask.createReadmeFile(const dir : string); 41 | var 42 | {$INCLUDE src/Tasks/Implementations/Project/FastCgi/Includes/readme.md.inc} 43 | begin 44 | createTextFile(dir + '/README.md', strReadme); 45 | end; 46 | 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/FastCgi/Includes/dockercompose.inc: -------------------------------------------------------------------------------- 1 | strDockercompose : string = 2 | '#------------------------------------------------------------' + LineEnding + 3 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 4 | '#' + LineEnding + 5 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 6 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 7 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 8 | '#--------------------------------------------------------------' + LineEnding + 9 | '' + LineEnding + 10 | 'version: "2"' + LineEnding + 11 | 'services:' + LineEnding + 12 | ' fano:' + LineEnding + 13 | ' build: ' + LineEnding + 14 | ' context: .' + LineEnding + 15 | ' dockerfile: fano_dockerfile' + LineEnding + 16 | ' ports: ' + LineEnding + 17 | ' - "7704:7704"' + LineEnding + 18 | ' apache:' + LineEnding + 19 | ' build:' + LineEnding + 20 | ' context: .' + LineEnding + 21 | ' dockerfile: httpd_dockerfile' + LineEnding + 22 | ' depends_on:' + LineEnding + 23 | ' - fano' + LineEnding + 24 | '' + LineEnding; 25 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/FastCgi/Includes/fano_dockerfile.inc: -------------------------------------------------------------------------------- 1 | strDockerfile : string = 2 | '#------------------------------------------------------------' + LineEnding + 3 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 4 | '#' + LineEnding + 5 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 6 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 7 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 8 | '#--------------------------------------------------------------' + LineEnding + 9 | '' + LineEnding + 10 | '#-----------------------------------' + LineEnding + 11 | '# use Ubuntu 20.04' + LineEnding + 12 | '#-----------------------------------' + LineEnding + 13 | 'FROM ubuntu' + LineEnding + 14 | '' + LineEnding + 15 | 'COPY ./config/ /usr/local/fano/config' + LineEnding + 16 | 'COPY ./resources/ /usr/local/fano/resources' + LineEnding + 17 | 'COPY ./storages/ /usr/local/fano/storages' + LineEnding + 18 | 'COPY ./public/ /usr/local/fano/public' + LineEnding + 19 | 'COPY ./bin/app.cgi /usr/local/fano/app.cgi' + LineEnding + 20 | 'WORKDIR /usr/local/fano/' + LineEnding + 21 | 'CMD ["/usr/local/fano/app.cgi", "--host=0.0.0.0", "--port=7704"]' + LineEnding; 22 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/FastCgi/Includes/vhost.example.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2020 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strVhostExample: string = 9 | '' + LineEnding + 10 | ' ProxyRequests Off' + LineEnding + 11 | ' ProxyPassMatch "/css|js|images|img|plugins|bower_components(.*)|webfonts" !' + LineEnding + 12 | ' ProxyPassMatch ^/(.*)$ "fcgi://fano:7704"' + LineEnding + 13 | ''; 14 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Fcgid/CreateFcgidAppFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateFcgidAppFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateAppFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create FastCGI app.pas 25 | * with Apache web server and mod_fcgid module 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateFcgidAppFileTask = class(TCreateAppFileTask) 30 | protected 31 | procedure createApp( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring; 34 | const dir : string 35 | ); override; 36 | end; 37 | 38 | implementation 39 | 40 | uses 41 | 42 | sysutils; 43 | 44 | procedure TCreateFcgidAppFileTask.createApp( 45 | const opt : ITaskOptions; 46 | const longOpt : shortstring; 47 | const dir : string 48 | ); 49 | var 50 | {$INCLUDE src/Tasks/Implementations/Project/Fcgid/Includes/app.pas.inc} 51 | begin 52 | createTextFile(dir + '/app.pas', strAppPas); 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Fcgid/CreateFcgidReadmeFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateFcgidReadmeFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateReadmeFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create web application project 25 | * custom README file 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateFcgidReadmeFileTask = class(TCreateReadmeFileTask) 30 | protected 31 | procedure createReadmeFile(const dir : string); override; 32 | end; 33 | 34 | implementation 35 | 36 | uses 37 | 38 | sysutils; 39 | 40 | procedure TCreateFcgidReadmeFileTask.createReadmeFile(const dir : string); 41 | var 42 | {$INCLUDE src/Tasks/Implementations/Project/Fcgid/Includes/readme.md.inc} 43 | begin 44 | createTextFile(dir + '/README.md', strReadme); 45 | end; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Fcgid/Includes/dockercompose.inc: -------------------------------------------------------------------------------- 1 | strDockercompose : string = 2 | '#------------------------------------------------------------' + LineEnding + 3 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 4 | '#' + LineEnding + 5 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 6 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 7 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 8 | '#--------------------------------------------------------------' + LineEnding + 9 | '' + LineEnding + 10 | 'version: "2"' + LineEnding + 11 | 'services:' + LineEnding + 12 | ' fano:' + LineEnding + 13 | ' build: .' + LineEnding + 14 | '' + LineEnding; 15 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Fcgid/Includes/vhost.example.inc: -------------------------------------------------------------------------------- 1 | strVhostExample : string = 2 | '#------------------------------------------------------------' + LineEnding + 3 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 4 | '#' + LineEnding + 5 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 6 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 7 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 8 | '#--------------------------------------------------------------' + LineEnding + 9 | '' + LineEnding + 10 | '' + LineEnding + 11 | ' ' + LineEnding + 12 | ' Options +ExecCGI' + LineEnding + 13 | ' AllowOverride FileInfo Indexes' + LineEnding + 14 | ' Require all granted' + LineEnding + 15 | ' DirectoryIndex app.cgi' + LineEnding + 16 | ' AddHandler fcgid-script .cgi' + LineEnding + 17 | ' ' + LineEnding + 18 | '' + LineEnding + 19 | '' + LineEnding; 20 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Fpweb/CreateFpwebReadmeFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateFpwebReadmeFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateReadmeFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create web application project 25 | * custom README file for http project 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateFpwebReadmeFileTask = class(TCreateReadmeFileTask) 30 | protected 31 | procedure createReadmeFile(const dir : string); override; 32 | end; 33 | 34 | implementation 35 | 36 | uses 37 | 38 | sysutils; 39 | 40 | procedure TCreateFpwebReadmeFileTask.createReadmeFile(const dir : string); 41 | var 42 | {$INCLUDE src/Tasks/Implementations/Project/Fpweb/Includes/readme.md.inc} 43 | begin 44 | createTextFile(dir + '/README.md', strReadme); 45 | end; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Indy/CreateIndyReadmeFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateIndyReadmeFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateReadmeFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create web application project 25 | * custom README file for http project 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateIndyReadmeFileTask = class(TCreateReadmeFileTask) 30 | protected 31 | procedure createReadmeFile(const dir : string); override; 32 | end; 33 | 34 | implementation 35 | 36 | uses 37 | 38 | sysutils; 39 | 40 | procedure TCreateIndyReadmeFileTask.createReadmeFile(const dir : string); 41 | var 42 | {$INCLUDE src/Tasks/Implementations/Project/Indy/Includes/readme.md.inc} 43 | begin 44 | createTextFile(dir + '/README.md', strReadme); 45 | end; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Mhd/CreateMhdReadmeFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateMhdReadmeFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateReadmeFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create web application project 25 | * custom README file for http project 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateMhdReadmeFileTask = class(TCreateReadmeFileTask) 30 | protected 31 | procedure createReadmeFile(const dir : string); override; 32 | end; 33 | 34 | implementation 35 | 36 | uses 37 | 38 | sysutils; 39 | 40 | procedure TCreateMhdReadmeFileTask.createReadmeFile(const dir : string); 41 | var 42 | {$INCLUDE src/Tasks/Implementations/Project/Mhd/Includes/readme.md.inc} 43 | begin 44 | createTextFile(dir + '/README.md', strReadme); 45 | end; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Scgi/CreateScgiReadmeFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateScgiReadmeFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateReadmeFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create web application project 25 | * custom README file for SCGI project 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateScgiReadmeFileTask = class(TCreateReadmeFileTask) 30 | protected 31 | procedure createReadmeFile(const dir : string); override; 32 | end; 33 | 34 | implementation 35 | 36 | uses 37 | 38 | sysutils; 39 | 40 | procedure TCreateScgiReadmeFileTask.createReadmeFile(const dir : string); 41 | var 42 | {$INCLUDE src/Tasks/Implementations/Project/Scgi/Includes/readme.md.inc} 43 | begin 44 | createTextFile(dir + '/README.md', strReadme); 45 | end; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Scgi/Includes/dockercompose.inc: -------------------------------------------------------------------------------- 1 | strDockercompose : string = 2 | '#------------------------------------------------------------' + LineEnding + 3 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 4 | '#' + LineEnding + 5 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 6 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 7 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 8 | '#--------------------------------------------------------------' + LineEnding + 9 | '' + LineEnding + 10 | 'version: "2"' + LineEnding + 11 | 'services:' + LineEnding + 12 | ' fano:' + LineEnding + 13 | ' build: ' + LineEnding + 14 | ' context: .' + LineEnding + 15 | ' dockerfile: fano_dockerfile' + LineEnding + 16 | ' ports: ' + LineEnding + 17 | ' - "7704:7704"' + LineEnding + 18 | ' apache:' + LineEnding + 19 | ' build:' + LineEnding + 20 | ' context: .' + LineEnding + 21 | ' dockerfile: httpd_dockerfile' + LineEnding + 22 | ' depends_on:' + LineEnding + 23 | ' - fano' + LineEnding + 24 | '' + LineEnding; 25 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Scgi/Includes/fano_dockerfile.inc: -------------------------------------------------------------------------------- 1 | strDockerfile : string = 2 | '#------------------------------------------------------------' + LineEnding + 3 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 4 | '#' + LineEnding + 5 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 6 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 7 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 8 | '#--------------------------------------------------------------' + LineEnding + 9 | '' + LineEnding + 10 | '#-----------------------------------' + LineEnding + 11 | '# use Ubuntu 20.04' + LineEnding + 12 | '#-----------------------------------' + LineEnding + 13 | 'FROM ubuntu' + LineEnding + 14 | '' + LineEnding + 15 | 'COPY ./config/ /usr/local/fano/config' + LineEnding + 16 | 'COPY ./resources/ /usr/local/fano/resources' + LineEnding + 17 | 'COPY ./storages/ /usr/local/fano/storages' + LineEnding + 18 | 'COPY ./public/ /usr/local/fano/public' + LineEnding + 19 | 'COPY ./bin/app.cgi /usr/local/fano/app.cgi' + LineEnding + 20 | 'WORKDIR /usr/local/fano/' + LineEnding + 21 | 'CMD ["/usr/local/fano/app.cgi", "--host=0.0.0.0", "--port=7704"]' + LineEnding; 22 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Scgi/Includes/vhost.example.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2020 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strVhostExample: string = 9 | '' + LineEnding + 10 | ' ProxyRequests Off' + LineEnding + 11 | ' ProxyPassMatch "/css|js|images|img|plugins|bower_components(.*)|webfonts" !' + LineEnding + 12 | ' ProxyPassMatch ^/(.*)$ "scgi://fano:7704"' + LineEnding + 13 | ''; 14 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Uwsgi/CreateUwsgiReadmeFileTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateUwsgiReadmeFileTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | CreateReadmeFileTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that create web application project 25 | * custom README file for uwsgi project 26 | * 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCreateUwsgiReadmeFileTask = class(TCreateReadmeFileTask) 30 | protected 31 | procedure createReadmeFile(const dir : string); override; 32 | end; 33 | 34 | implementation 35 | 36 | uses 37 | 38 | sysutils; 39 | 40 | procedure TCreateUwsgiReadmeFileTask.createReadmeFile(const dir : string); 41 | var 42 | {$INCLUDE src/Tasks/Implementations/Project/Uwsgi/Includes/readme.md.inc} 43 | begin 44 | createTextFile(dir + '/README.md', strReadme); 45 | end; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Uwsgi/Includes/dockercompose.inc: -------------------------------------------------------------------------------- 1 | strDockercompose : string = 2 | '#------------------------------------------------------------' + LineEnding + 3 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 4 | '#' + LineEnding + 5 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 6 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 7 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 8 | '#--------------------------------------------------------------' + LineEnding + 9 | '' + LineEnding + 10 | 'version: "2"' + LineEnding + 11 | 'services:' + LineEnding + 12 | ' fano:' + LineEnding + 13 | ' build: ' + LineEnding + 14 | ' context: .' + LineEnding + 15 | ' dockerfile: fano_dockerfile' + LineEnding + 16 | ' ports: ' + LineEnding + 17 | ' - "7704:7704"' + LineEnding + 18 | ' apache:' + LineEnding + 19 | ' build:' + LineEnding + 20 | ' context: .' + LineEnding + 21 | ' dockerfile: httpd_dockerfile' + LineEnding + 22 | ' depends_on:' + LineEnding + 23 | ' - fano' + LineEnding + 24 | '' + LineEnding; 25 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Uwsgi/Includes/fano_dockerfile.inc: -------------------------------------------------------------------------------- 1 | strDockerfile : string = 2 | '#------------------------------------------------------------' + LineEnding + 3 | '# [[APP_NAME]] ([[APP_URL]])' + LineEnding + 4 | '#' + LineEnding + 5 | '# @link [[APP_REPOSITORY_URL]]' + LineEnding + 6 | '# @copyright Copyright (c) [[COPYRIGHT_YEAR]] [[COPYRIGHT_HOLDER]]' + LineEnding + 7 | '# @license [[LICENSE_URL]] ([[LICENSE]])' + LineEnding + 8 | '#--------------------------------------------------------------' + LineEnding + 9 | '' + LineEnding + 10 | '#-----------------------------------' + LineEnding + 11 | '# use Ubuntu 20.04' + LineEnding + 12 | '#-----------------------------------' + LineEnding + 13 | 'FROM ubuntu' + LineEnding + 14 | '' + LineEnding + 15 | 'COPY ./config/ /usr/local/fano/config' + LineEnding + 16 | 'COPY ./resources/ /usr/local/fano/resources' + LineEnding + 17 | 'COPY ./storages/ /usr/local/fano/storages' + LineEnding + 18 | 'COPY ./public/ /usr/local/fano/public' + LineEnding + 19 | 'COPY ./bin/app.cgi /usr/local/fano/app.cgi' + LineEnding + 20 | 'WORKDIR /usr/local/fano/' + LineEnding + 21 | 'CMD ["/usr/local/fano/app.cgi", "--host=0.0.0.0", "--port=7704"]' + LineEnding; 22 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Project/Uwsgi/Includes/vhost.example.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2020 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strVhostExample: string = 9 | '' + LineEnding + 10 | ' ProxyRequests Off' + LineEnding + 11 | ' ProxyPassMatch "/css|js|images|img|plugins|bower_components(.*)|webfonts" !' + LineEnding + 12 | ' ProxyPassMatch ^/(.*)$ "uwsgi://fano:7704"' + LineEnding + 13 | ''; 14 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/CompositeFileTypeTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CompositeFileTypeTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ConditionalCompositeTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that run first task if --type=json or --type 25 | * otherwise run second task 26 | *--------------------------------------------- 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCompositeFileTypeTask = class(TConditionalCompositeTask) 30 | protected 31 | function condition( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring 34 | ) : boolean; override; 35 | end; 36 | 37 | implementation 38 | 39 | function TCompositeFileTypeTask.condition( 40 | const opt : ITaskOptions; 41 | const longOpt : shortstring 42 | ) : boolean; 43 | begin 44 | result := (opt.getOptionValueDef('type', 'json') = 'json'); 45 | end; 46 | end. 47 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/CompositeSessionTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CompositeSessionTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ConditionalCompositeTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that execute first task if --with-session 25 | * parameter is set, otherwise run second task 26 | *--------------------------------------------- 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TCompositeSessionTask = class(TConditionalCompositeTask) 30 | protected 31 | function condition( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring 34 | ) : boolean; override; 35 | end; 36 | 37 | implementation 38 | 39 | function TCompositeSessionTask.condition( 40 | const opt : ITaskOptions; 41 | const longOpt : shortstring 42 | ) : boolean; 43 | begin 44 | result := opt.hasOption('with-session'); 45 | end; 46 | end. 47 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/CreateDbSessionIniAppConfigsTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateDbSessionIniAppConfigsTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ContentModifierIntf, 20 | KeyGeneratorIntf, 21 | CreateSessionIniAppConfigsTaskImpl; 22 | 23 | type 24 | 25 | (*!-------------------------------------- 26 | * Task that create web application json config files 27 | * using fano web framework 28 | * 29 | * @author Zamrony P. Juhara 30 | *---------------------------------------*) 31 | TCreateDbSessionIniAppConfigsTask = class(TCreateSessionIniAppConfigsTask) 32 | protected 33 | function getConfigTemplate() : string; override; 34 | end; 35 | 36 | implementation 37 | 38 | uses 39 | 40 | sysutils; 41 | 42 | function TCreateDbSessionIniAppConfigsTask.getConfigTemplate() : string; 43 | var 44 | {$INCLUDE src/Tasks/Implementations/Session/Includes/config.ini.db.inc} 45 | begin 46 | result := strConfigIniDb; 47 | end; 48 | 49 | end. 50 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/CreateDbSessionJsonAppConfigsTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateDbSessionJsonAppConfigsTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ContentModifierIntf, 20 | KeyGeneratorIntf, 21 | CreateSessionJsonAppConfigsTaskImpl; 22 | 23 | type 24 | 25 | (*!-------------------------------------- 26 | * Task that create web application json config files 27 | * using fano web framework 28 | * 29 | * @author Zamrony P. Juhara 30 | *---------------------------------------*) 31 | TCreateDbSessionJsonAppConfigsTask = class(TCreateSessionJsonAppConfigsTask) 32 | protected 33 | function getConfigTemplate() : string; override; 34 | end; 35 | 36 | implementation 37 | 38 | uses 39 | 40 | sysutils; 41 | 42 | function TCreateDbSessionJsonAppConfigsTask.getConfigTemplate() : string; 43 | var 44 | {$INCLUDE src/Tasks/Implementations/Session/Includes/config.json.db.inc} 45 | begin 46 | result := strConfigJsonDb; 47 | end; 48 | 49 | end. 50 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/CreateFileSessionDependenciesTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateFileSessionDependenciesTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ConditionalCompositeTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that add file session support to project creation 25 | *--------------------------------------------- 26 | * @author Zamrony P. Juhara 27 | *---------------------------------------*) 28 | TCreateFileSessionDependenciesTask = class(TConditionalCompositeTask) 29 | protected 30 | function condition( 31 | const opt : ITaskOptions; 32 | const longOpt : shortstring 33 | ) : boolean; override; 34 | end; 35 | 36 | implementation 37 | 38 | 39 | function TCreateFileSessionDependenciesTask.condition( 40 | const opt : ITaskOptions; 41 | const longOpt : shortstring 42 | ) : boolean; 43 | begin 44 | result := (opt.getOptionValueDef('type', 'json') = 'json'); 45 | end; 46 | end. 47 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/CreateSessionIniAppConfigsTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateSessionIniAppConfigsTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ContentModifierIntf, 20 | KeyGeneratorIntf, 21 | BaseCreateSessionAppConfigsTaskImpl; 22 | 23 | type 24 | 25 | (*!-------------------------------------- 26 | * Task that create web application ini config files 27 | * using fano web framework 28 | * 29 | * @author Zamrony P. Juhara 30 | *---------------------------------------*) 31 | TCreateSessionIniAppConfigsTask = class(TBaseCreateSessionAppConfigsTask) 32 | protected 33 | function getConfigType() : string; override; 34 | function getConfigTemplate() : string; override; 35 | end; 36 | 37 | implementation 38 | 39 | uses 40 | 41 | sysutils; 42 | 43 | function TCreateSessionIniAppConfigsTask.getConfigType() : string; 44 | begin 45 | result := 'ini'; 46 | end; 47 | 48 | function TCreateSessionIniAppConfigsTask.getConfigTemplate() : string; 49 | var 50 | {$INCLUDE src/Tasks/Implementations/Session/Includes/config.ini.inc} 51 | begin 52 | result := strConfigIni; 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/CreateSessionJsonAppConfigsTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit CreateSessionJsonAppConfigsTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ContentModifierIntf, 20 | KeyGeneratorIntf, 21 | BaseCreateSessionAppConfigsTaskImpl; 22 | 23 | type 24 | 25 | (*!-------------------------------------- 26 | * Task that create web application json config files 27 | * using fano web framework 28 | * 29 | * @author Zamrony P. Juhara 30 | *---------------------------------------*) 31 | TCreateSessionJsonAppConfigsTask = class(TBaseCreateSessionAppConfigsTask) 32 | protected 33 | function getConfigType() : string; override; 34 | function getConfigTemplate() : string; override; 35 | end; 36 | 37 | implementation 38 | 39 | uses 40 | 41 | sysutils; 42 | 43 | function TCreateSessionJsonAppConfigsTask.getConfigType() : string; 44 | begin 45 | result := 'json'; 46 | end; 47 | 48 | function TCreateSessionJsonAppConfigsTask.getConfigTemplate() : string; 49 | var 50 | {$INCLUDE src/Tasks/Implementations/Session/Includes/config.json.inc} 51 | begin 52 | result := strConfigJson; 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/Includes/config.ini.db.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strConfigIniDb: string = 9 | '[fano]' + LineEnding + 10 | 'appName=[[APP_NAME]]' + LineEnding + 11 | 'baseUrl=[[BASE_URL]]' + LineEnding + 12 | 'secretKey=[[SECRET_KEY]]' + LineEnding + 13 | '' + LineEnding + 14 | '[session]' + LineEnding + 15 | 'name=[[SESSION_NAME]]' + LineEnding + 16 | 'tableName=[[SESSION_TABLE]]"' + LineEnding + 17 | 'sessionIdColumn=[[SESSION_ID_COLUMN]]' + LineEnding + 18 | 'dataColumn=[[SESSION_DATA_COLUMN]]"' + LineEnding + 19 | 'expiredAtColumn=[[SESSION_EXPIRED_AT_COLUMN]]"' + LineEnding + 20 | '' + LineEnding + 21 | '[cookie]' + LineEnding + 22 | 'name=[[COOKIE_NAME]]' + LineEnding + 23 | 'domain=[[COOKIE_DOMAIN]]' + LineEnding + 24 | 'maxAge=[[COOKIE_MAX_AGE]]' + LineEnding + 25 | '' + LineEnding + 26 | '[db]' + LineEnding + 27 | 'version=[[DB_VER]]' + LineEnding + 28 | 'host=[[DB_HOST]]' + LineEnding + 29 | 'port=[[DB_PORT]]' + LineEnding + 30 | 'db=[[DB_NAME]]' + LineEnding + 31 | 'user=[[DB_USER]]' + LineEnding + 32 | 'passw=[[DB_PASSW]]' + LineEnding; 33 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/Includes/config.ini.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strConfigIni: string = 9 | '[fano]' + LineEnding + 10 | 'appName=[[APP_NAME]]' + LineEnding + 11 | 'baseUrl=[[BASE_URL]]' + LineEnding + 12 | 'secretKey=[[SECRET_KEY]]' + LineEnding + 13 | '[session]' + LineEnding + 14 | 'name=[[SESSION_NAME]]' + LineEnding + 15 | 'dir=[[SESSION_DIR]]' + LineEnding + 16 | '[cookie]' + LineEnding + 17 | 'name=[[COOKIE_NAME]]' + LineEnding + 18 | 'domain=[[COOKIE_DOMAIN]]' + LineEnding + 19 | 'maxAge=[[COOKIE_MAX_AGE]]' + LineEnding; 20 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/Includes/config.json.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strConfigJson: string = 9 | '{' + LineEnding + 10 | ' "appName" : "[[APP_NAME]]",' + LineEnding + 11 | '' + LineEnding + 12 | ' "baseUrl" : "[[BASE_URL]]",' + LineEnding + 13 | '' + LineEnding + 14 | ' "secretKey" : "[[SECRET_KEY]]",' + LineEnding + 15 | '' + LineEnding + 16 | ' "session" : {' + LineEnding + 17 | ' "name" : "[[SESSION_NAME]]",' + LineEnding + 18 | ' "dir" : "[[SESSION_DIR]]"' + LineEnding + 19 | ' },' + LineEnding + 20 | '' + LineEnding + 21 | ' "cookie" : {' + LineEnding + 22 | ' "name" : "[[COOKIE_NAME]]",' + LineEnding + 23 | ' "domain" : "[[COOKIE_DOMAIN]]",' + LineEnding + 24 | ' "maxAge" : [[COOKIE_MAX_AGE]]' + LineEnding + 25 | ' }' + LineEnding + 26 | '}'; 27 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/Includes/decl.dispatcher.method.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | strDeclDispatcherMethod : string = 9 | ' function buildDispatcher(' + LineEnding + 10 | ' const container : IDependencyContainer;' + LineEnding + 11 | ' const routeMatcher : IRouteMatcher;' + LineEnding + 12 | ' const config : IAppConfiguration' + LineEnding + 13 | ' ) : IDispatcher; override;' + LineEnding; 14 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Session/WithDbSessionTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit WithDbSessionTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ConditionalCompositeTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task that execute first task if --with-session=db 25 | * is set, otherwise run second task 26 | *--------------------------------------------- 27 | * @author Zamrony P. Juhara 28 | *---------------------------------------*) 29 | TWithDbSessionTask = class(TConditionalCompositeTask) 30 | protected 31 | function condition( 32 | const opt : ITaskOptions; 33 | const longOpt : shortstring 34 | ) : boolean; override; 35 | end; 36 | 37 | implementation 38 | 39 | function TWithDbSessionTask.condition( 40 | const opt : ITaskOptions; 41 | const longOpt : shortstring 42 | ) : boolean; 43 | begin 44 | result := lowercase(opt.getOptionValue('with-session')) = 'db'; 45 | end; 46 | end. 47 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/StdoutCheck/StdoutCheckTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit StdoutCheckTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf, 19 | ConditionalCompositeTaskImpl; 20 | 21 | type 22 | 23 | (*!-------------------------------------- 24 | * Task runs first task only if 25 | * there is --stdout command line option otherwise 26 | * it runs second task 27 | *--------------------------------------------- 28 | * @author Zamrony P. Juhara 29 | *---------------------------------------*) 30 | TStdoutCheckTask = class(TConditionalCompositeTask) 31 | protected 32 | function condition( 33 | const opt : ITaskOptions; 34 | const longOpt : shortstring 35 | ) : boolean; override; 36 | end; 37 | 38 | implementation 39 | 40 | function TStdoutCheckTask.condition( 41 | const opt : ITaskOptions; 42 | const longOpt : shortstring 43 | ) : boolean; 44 | begin 45 | result := opt.hasOption('stdout'); 46 | end; 47 | end. 48 | -------------------------------------------------------------------------------- /src/Tasks/Implementations/Writeln/WritelnTaskImpl.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit WritelnTaskImpl; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskOptionsIntf, 18 | TaskIntf; 19 | 20 | type 21 | 22 | (*!-------------------------------------- 23 | * Task that write text to STDOUT 24 | *-------------------------------------------- 25 | * @author Zamrony P. Juhara 26 | *---------------------------------------*) 27 | TWritelnTask = class(TInterfacedObject, ITask) 28 | private 29 | fText : string; 30 | public 31 | constructor create(const str : string); 32 | function run( 33 | const opt : ITaskOptions; 34 | const longOpt : shortstring 35 | ) : ITask; 36 | end; 37 | 38 | implementation 39 | 40 | constructor TWritelnTask.create(const str : string); 41 | begin 42 | fText := str; 43 | end; 44 | 45 | function TWritelnTask.run( 46 | const opt : ITaskOptions; 47 | const longOpt : shortstring 48 | ) : ITask; 49 | begin 50 | writeln(fText); 51 | result := self; 52 | end; 53 | end. 54 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Controller/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateControllerTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'controller', 15 | formatColor('--controller', TXT_GREEN) + '=[controller-name] Create new controller' + LineEnding + 16 | ' --route=[route pattern] if omitted, controller name is assumed.' + LineEnding + 17 | ' --method=[request method] if omitted, HTTP GET is assumed.', 18 | taskFactory.build() 19 | ); 20 | finally 21 | taskFactory := nil; 22 | end; 23 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Daemon/SystemD/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TSystemDDaemonTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'daemon-sysd', 15 | formatColor('--daemon-sysd', TXT_GREEN) + '=[service name] Register daemon as service in SystemD.' + LineEnding + 16 | ' --user=[username] User whose service will be run as. If not set, current non-root user is used.' + LineEnding + 17 | ' --bin=[application binary] Path of executable binary. If not set then, default bin/app.cgi is used.', 18 | taskFactory.build() 19 | ); 20 | finally 21 | taskFactory := nil; 22 | end; 23 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Daemon/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%fanocli.pas} 10 | 11 | {$INCLUDE SystemD/task.registrations.inc} 12 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/Cgi/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TXDeployCgiTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'deploy-cgi', 15 | formatColor('--deploy-cgi', TXT_GREEN) + '=[server name] Deploy as CGI web application.' + LineEnding + 16 | ' --web-server=[web server] if omitted, apache is assumed.' + LineEnding + 17 | ' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding + 18 | ' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding + 19 | ' --stdout=Output virtual host configuration to STDOUT (no root privilege needed).', 20 | taskFactory.build() 21 | ); 22 | finally 23 | taskFactory := nil; 24 | end; 25 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/Fcgi/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TXDeployFcgiTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'deploy-fcgi', 15 | formatColor('--deploy-fcgi', TXT_GREEN) + '=[server name] Deploy as FastCGI web application with mod_proxy_fcgi.' + LineEnding + 16 | ' --web-server=[web server] if omitted, apache is assumed.' + LineEnding + 17 | ' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding + 18 | ' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding + 19 | ' --host=[host where FastCGI app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 20 | ' --port=[port where FastCGI app listen] if omitted, 20477 is assumed.' + LineEnding + 21 | ' --stdout=Output virtual host configuration to STDOUT (no root privilege needed).', 22 | taskFactory.build() 23 | ); 24 | finally 25 | taskFactory := nil; 26 | end; 27 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/FcgiBalancer/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TXDeployFcgiBalancerTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'deploy-lb-fcgi', 15 | formatColor('--deploy-lb-fcgi', TXT_GREEN) + '=[server name] Deploy as FastCGI web application with mod_proxy_balancer.' + LineEnding + 16 | ' --members=[host1:port1,host2:port2,...], if omitted, 2 default members is assumed.' + LineEnding + 17 | ' --lbmethod=[load balancing scheduler algorithm] if omitted, byrequests is assumed.' + LineEnding + 18 | ' --web-server=[web server] if omitted, apache is assumed.' + LineEnding + 19 | ' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding + 20 | ' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding + 21 | ' --host=[host where FastCGI app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 22 | ' --port=[port where FastCGI app listen] if omitted, 20477 is assumed.' + LineEnding + 23 | ' --stdout=Output virtual host configuration to STDOUT (no root privilege needed).', 24 | taskFactory.build() 25 | ); 26 | finally 27 | taskFactory := nil; 28 | end; 29 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/Fcgid/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TXDeployFCgidTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'deploy-fcgid', 15 | formatColor('--deploy-fcgid', TXT_GREEN) + '=[server name] Deploy as FastCGI web application with mod_fcgid.' + LineEnding + 16 | ' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding + 17 | ' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding + 18 | ' --stdout=Output virtual host configuration to STDOUT (no root privilege needed).', 19 | taskFactory.build() 20 | ); 21 | finally 22 | taskFactory := nil; 23 | end; 24 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/Http/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TXDeployHttpTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'deploy-http', 15 | formatColor('--deploy-http', TXT_GREEN) + '=[server name] Deploy as http web application over http reverse proxy server.' + LineEnding + 16 | ' --web-server=[web server] if omitted, apache is assumed.' + LineEnding + 17 | ' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding + 18 | ' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding + 19 | ' --host=[host where http app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 20 | ' --port=[port where http app listen] if omitted, 20477 is assumed.' + LineEnding + 21 | ' --stdout=Output virtual host configuration to STDOUT (no root privilege needed).', 22 | taskFactory.build() 23 | ); 24 | finally 25 | taskFactory := nil; 26 | end; 27 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/HttpBalancer/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TXDeployHttpBalancerTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'deploy-lb-http', 15 | formatColor('--deploy-lb-http', TXT_GREEN) + '=[server name] Deploy as http web application with mod_proxy_balancer.' + LineEnding + 16 | ' --members=[host1:port1,host2:port2,...], if omitted, 2 default members is assumed.' + LineEnding + 17 | ' --lbmethod=[load balancing scheduler algorithm] if omitted, byrequests is assumed.' + LineEnding + 18 | ' --web-server=[web server] if omitted, apache is assumed.' + LineEnding + 19 | ' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding + 20 | ' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding + 21 | ' --host=[host where http app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 22 | ' --port=[port where http app listen] if omitted, 20477 is assumed.' + LineEnding + 23 | ' --stdout=Output virtual host configuration to STDOUT (no root privilege needed).', 24 | taskFactory.build() 25 | ); 26 | finally 27 | taskFactory := nil; 28 | end; 29 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/Scgi/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TXDeployScgiTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'deploy-scgi', 15 | formatColor('--deploy-scgi', TXT_GREEN) + '=[server name] Deploy as SCGI web application.' + LineEnding + 16 | ' --web-server=[web server] if omitted, apache is assumed.' + LineEnding + 17 | ' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding + 18 | ' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding + 19 | ' --host=[host where SCGI app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 20 | ' --port=[port where SCGI app listen] if omitted, 20477 is assumed.' + LineEnding + 21 | ' --stdout=Output virtual host configuration to STDOUT (no root privilege needed).', 22 | taskFactory.build() 23 | ); 24 | finally 25 | taskFactory := nil; 26 | end; 27 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/ScgiBalancer/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TXDeployScgiBalancerTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'deploy-lb-scgi', 15 | formatColor('--deploy-lb-scgi', TXT_GREEN) + '=[server name] Deploy as SCGI web application with mod_proxy_balancer.' + LineEnding + 16 | ' --members=[host1:port1,host2:port2,...], if omitted, 2 default members is assumed.' + LineEnding + 17 | ' --lbmethod=[load balancing scheduler algorithm] if omitted, byrequests is assumed.' + LineEnding + 18 | ' --web-server=[web server] if omitted, apache is assumed.' + LineEnding + 19 | ' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding + 20 | ' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding + 21 | ' --host=[host where SCGI app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 22 | ' --port=[port where SCGI app listen] if omitted, 20477 is assumed.' + LineEnding + 23 | ' --stdout=Output virtual host configuration to STDOUT (no root privilege needed).', 24 | taskFactory.build() 25 | ); 26 | finally 27 | taskFactory := nil; 28 | end; 29 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/Uwsgi/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TXDeployUwsgiTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'deploy-uwsgi', 15 | formatColor('--deploy-uwsgi', TXT_GREEN) + '=[server name] Deploy as uwsgi web application.' + LineEnding + 16 | ' --web-server=[web server] if omitted, apache is assumed.' + LineEnding + 17 | ' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding + 18 | ' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding + 19 | ' --host=[host where uwsgi app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 20 | ' --port=[port where uwsgi app listen] if omitted, 20477 is assumed.' + LineEnding + 21 | ' --stdout=Output virtual host configuration to STDOUT (no root privilege needed).', 22 | taskFactory.build() 23 | ); 24 | finally 25 | taskFactory := nil; 26 | end; 27 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/UwsgiBalancer/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TXDeployUwsgiBalancerTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'deploy-lb-uwsgi', 15 | formatColor('--deploy-lb-uwsgi', TXT_GREEN) + '=[server name] Deploy as uwsgi web application with mod_proxy_balancer.' + LineEnding + 16 | ' --members=[host1:port1,host2:port2,...], if omitted, 2 default members is assumed.' + LineEnding + 17 | ' --lbmethod=[load balancing scheduler algorithm] if omitted, byrequests is assumed.' + LineEnding + 18 | ' --web-server=[web server] if omitted, apache is assumed.' + LineEnding + 19 | ' --doc-root=[document-root] if omitted, public directory in current directory is used.' + LineEnding + 20 | ' --server-ip=[web server ip] if omitted, 127.0.0.1 is assumed.' + LineEnding + 21 | ' --host=[host where uwsgi app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 22 | ' --port=[port where uwsgi app listen] if omitted, 20477 is assumed.' + LineEnding + 23 | ' --stdout=Output virtual host configuration to STDOUT (no root privilege needed).', 24 | taskFactory.build() 25 | ); 26 | finally 27 | taskFactory := nil; 28 | end; 29 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%fanocli.pas} 10 | 11 | {$INCLUDE Scgi/task.registrations.inc} 12 | {$INCLUDE Cgi/task.registrations.inc} 13 | {$INCLUDE Fcgi/task.registrations.inc} 14 | {$INCLUDE Uwsgi/task.registrations.inc} 15 | {$INCLUDE Fcgid/task.registrations.inc} 16 | {$INCLUDE Http/task.registrations.inc} 17 | {$INCLUDE ScgiBalancer/task.registrations.inc} 18 | {$INCLUDE FcgiBalancer/task.registrations.inc} 19 | {$INCLUDE UwsgiBalancer/task.registrations.inc} 20 | {$INCLUDE HttpBalancer/task.registrations.inc} 21 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Deploy/units.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | XDeployCgiTaskFactoryImpl, 10 | XDeployFcgiTaskFactoryImpl, 11 | XDeployFcgidTaskFactoryImpl, 12 | XDeployScgiTaskFactoryImpl, 13 | XDeployUwsgiTaskFactoryImpl, 14 | XDeployHttpTaskFactoryImpl, 15 | XDeployScgiBalancerTaskFactoryImpl, 16 | XDeployFcgiBalancerTaskFactoryImpl, 17 | XDeployUwsgiBalancerTaskFactoryImpl, 18 | XDeployHttpBalancerTaskFactoryImpl, 19 | -------------------------------------------------------------------------------- /src/Tasks/Includes/GuidGen/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | appInst.registerTask( 12 | 'guid', 13 | formatColor('--guid', TXT_GREEN) + ' Generate GUID.', 14 | TGuidGenTask.create() 15 | ); 16 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Info/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | appInst.registerTask( 12 | 'help', 13 | formatColor('--help', TXT_GREEN) + ' Display help information', 14 | TWithSingleInfoTask.create( 15 | TSingleInfoTask.create(appInst.getTaskList()), 16 | TInfoTask.create(appInst.getTaskList()) 17 | ) 18 | ); 19 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Info/units.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | InfoTaskImpl, 10 | SingleInfoTaskImpl, 11 | WithSingleInfoTaskImpl, 12 | -------------------------------------------------------------------------------- /src/Tasks/Includes/KeyGen/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TKeyGenTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'key', 15 | formatColor('--key', TXT_GREEN) + '=[length] Generate random key.', 16 | taskFactory.build() 17 | ); 18 | finally 19 | taskFactory := nil; 20 | end; 21 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Middleware/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateMiddlewareTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'middleware', 15 | formatColor('--middleware', TXT_GREEN) + '=[middleware-name] Create new middleware', 16 | taskFactory.build() 17 | ); 18 | finally 19 | taskFactory := nil; 20 | end; 21 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Minifier/Css/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCssMinifierTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'cssmin', 15 | formatColor('--cssmin', TXT_GREEN) + '=[path] Minify CSS file. Path can be file path or directory.' + LineEnding + 16 | ' --output=[output path] target output path' + LineEnding + 17 | ' if omitted, it is assumed [path].min.css' + LineEnding + 18 | ' if output-path = stdout, minified version is output to STDOUT', 19 | taskFactory.build() 20 | ); 21 | finally 22 | taskFactory := nil; 23 | end; 24 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Minifier/Js/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TJsMinifierTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'jsmin', 15 | formatColor('--jsmin', TXT_GREEN) + '=[path] Minify JavaScript file. Path can be file path or directory.' + LineEnding + 16 | ' --output=[output path] target output path' + LineEnding + 17 | ' if omitted, it is assumed [path].min.js' + LineEnding + 18 | ' if output-path = stdout, minified version is output to STDOUT', 19 | taskFactory.build() 20 | ); 21 | finally 22 | taskFactory := nil; 23 | end; 24 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Minifier/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | {$INCLUDE Js/task.registrations.inc} 12 | {$INCLUDE Css/task.registrations.inc} 13 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Model/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateModelTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'model', 15 | formatColor('--model', TXT_GREEN) + '=[model-name] Create new model', 16 | taskFactory.build() 17 | ); 18 | finally 19 | taskFactory := nil; 20 | end; 21 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Mvc/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateMvcTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'mvc', 15 | formatColor('--mvc', TXT_GREEN) + '=[name] Create new controller, model and view', 16 | taskFactory.build() 17 | ); 18 | finally 19 | taskFactory := nil; 20 | end; 21 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Project/Cgi/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateProjectTaskFactory.create( 12 | TCreateProjectDependenciesTaskFactory.create(), 13 | TCreateAppBootstrapCgiTaskFactory.create() 14 | ); 15 | try 16 | appInst.registerTask( 17 | 'project-cgi', 18 | formatColor('--project-cgi', TXT_GREEN) + '=[project-name] Create new CGI project.' + LineEnding + 19 | ' --config=[json, ini] Type of generated application config. If omitted, json is assumed.' + LineEnding + 20 | ' --with-session=[file, cookie, db] Add session support' + LineEnding + 21 | ' --with-middleware Add middleware support' + LineEnding + 22 | ' --with-csrf Add CSRF support' + LineEnding + 23 | ' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding + 24 | ' --no-git if omitted, git repository is created.' + LineEnding + 25 | ' --no-initial-commit if omitted, git repository is created with initial commit.', 26 | taskFactory.build() 27 | ); 28 | finally 29 | taskFactory := nil; 30 | end; 31 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Project/FastCgi/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateDaemonProjectTaskFactory.create( 12 | TCreateProjectDependenciesTaskFactory.create(), 13 | TCreateAppBootstrapFcgiTaskFactory.create() 14 | ); 15 | try 16 | appInst.registerTask( 17 | 'project-fcgi', 18 | formatColor('--project-fcgi', TXT_GREEN) + '=[project-name] Create new FastCGI project.' + LineEnding + 19 | ' --config=[ini, json] if omitted, config is not setup.' + LineEnding + 20 | ' --host=[host where FastCGI app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 21 | ' --port=[port where FastCGI app listen] if omitted, 20477 is assumed.' + LineEnding + 22 | ' --with-session=[file, cookie, db] Add session support' + LineEnding + 23 | ' --with-middleware Add middleware support' + LineEnding + 24 | ' --with-csrf Add CSRF support' + LineEnding + 25 | ' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding + 26 | ' --no-git if omitted, git repository is created.' + LineEnding + 27 | ' --no-initial-commit if omitted, git repository is created with initial commit.', 28 | taskFactory.build() 29 | ); 30 | finally 31 | taskFactory := nil; 32 | end; 33 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Project/Fcgid/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateDaemonProjectTaskFactory.create( 12 | TCreateProjectDependenciesTaskFactory.create(), 13 | TCreateAppBootstrapFcgidTaskFactory.create(), 14 | 'public' 15 | ); 16 | try 17 | appInst.registerTask( 18 | 'project-fcgid', 19 | formatColor('--project-fcgid', TXT_GREEN) + '=[project-name] Create new FastCGI project with Apache and mod_fcgid.' + LineEnding + 20 | ' --config=[ini, json] if omitted, config is not setup.' + LineEnding + 21 | ' --with-session=[file, cookie, db] Add session support' + LineEnding + 22 | ' --with-middleware Add middleware support' + LineEnding + 23 | ' --with-csrf Add CSRF support' + LineEnding + 24 | ' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding + 25 | ' --no-git if omitted, git repository is created.' + LineEnding + 26 | ' --no-initial-commit if omitted, git repository is created with initial commit.', 27 | taskFactory.build() 28 | ); 29 | finally 30 | taskFactory := nil; 31 | end; 32 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Project/Fpweb/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateDaemonProjectTaskFactory.create( 12 | TCreateProjectDependenciesTaskFactory.create(), 13 | TCreateAppBootstrapFpwebTaskFactory.create() 14 | ); 15 | try 16 | appInst.registerTask( 17 | 'project-http', 18 | formatColor('--project-http', TXT_GREEN) + '=[project-name] Create new http project using TFpHttpServer' + LineEnding + 19 | ' --config=[ini, json] if omitted, config is not setup.' + LineEnding + 20 | ' --host=[host where http app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 21 | ' --port=[port where http app listen] if omitted, 20477 is assumed.' + LineEnding + 22 | ' --with-session=[file, cookie, db] Add session support' + LineEnding + 23 | ' --with-middleware Add middleware support' + LineEnding + 24 | ' --with-csrf Add CSRF support' + LineEnding + 25 | ' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding + 26 | ' --no-git if omitted, git repository is created.' + LineEnding + 27 | ' --no-initial-commit if omitted, git repository is created with initial commit.', 28 | taskFactory.build() 29 | ); 30 | finally 31 | taskFactory := nil; 32 | end; 33 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Project/Scgi/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateDaemonProjectTaskFactory.create( 12 | TCreateProjectDependenciesTaskFactory.create(), 13 | TCreateAppBootstrapScgiTaskFactory.create() 14 | ); 15 | try 16 | appInst.registerTask( 17 | 'project-scgi', 18 | formatColor('--project-scgi', TXT_GREEN) + '=[project-name] Create new SCGI project' + LineEnding + 19 | ' --config=[ini, json] if omitted, config is not setup.' + LineEnding + 20 | ' --host=[host where SCGI app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 21 | ' --port=[port where SCGI app listen] if omitted, 20477 is assumed.' + LineEnding + 22 | ' --with-session=[file, cookie, db] Add session support' + LineEnding + 23 | ' --with-middleware Add middleware support' + LineEnding + 24 | ' --with-csrf Add CSRF support' + LineEnding + 25 | ' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding + 26 | ' --no-git if omitted, git repository is created.' + LineEnding + 27 | ' --no-initial-commit if omitted, git repository is created with initial commit.', 28 | taskFactory.build() 29 | ); 30 | finally 31 | taskFactory := nil; 32 | end; 33 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Project/Uwsgi/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateDaemonProjectTaskFactory.create( 12 | TCreateProjectDependenciesTaskFactory.create(), 13 | TCreateAppBootstrapUwsgiTaskFactory.create() 14 | ); 15 | try 16 | appInst.registerTask( 17 | 'project-uwsgi', 18 | formatColor('--project-uwsgi', TXT_GREEN) + '=[project-name] Create new uwsgi project' + LineEnding + 19 | ' --config=[ini, json] if omitted, config is not setup.' + LineEnding + 20 | ' --host=[host where uwsgi app listen] if omitted, 127.0.0.1 is assumed.' + LineEnding + 21 | ' --port=[port where uwsgi app listen] if omitted, 20477 is assumed.' + LineEnding + 22 | ' --with-session=[file, cookie, db] Add session support' + LineEnding + 23 | ' --with-middleware Add middleware support' + LineEnding + 24 | ' --with-csrf Add CSRF support' + LineEnding + 25 | ' --with-logger=[file, db, syslog] Add logger dependencies' + LineEnding + 26 | ' --no-git if omitted, git repository is created.' + LineEnding + 27 | ' --no-initial-commit if omitted, git repository is created with initial commit.', 28 | taskFactory.build() 29 | ); 30 | finally 31 | taskFactory := nil; 32 | end; 33 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Project/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%fanocli.pas} 10 | 11 | {$INCLUDE Cgi/task.registrations.inc} 12 | {$INCLUDE FastCgi/task.registrations.inc} 13 | {$INCLUDE Scgi/task.registrations.inc} 14 | {$INCLUDE Uwsgi/task.registrations.inc} 15 | {$INCLUDE Fcgid/task.registrations.inc} 16 | {$INCLUDE Mhd/task.registrations.inc} 17 | {$INCLUDE Fpweb/task.registrations.inc} 18 | {$INCLUDE Indy/task.registrations.inc} 19 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Project/units.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | CreateProjectDependenciesTaskFactoryImpl, 10 | CreateProjectDependenciesMhdTaskFactoryImpl, 11 | CreateProjectDependenciesIndyTaskFactoryImpl, 12 | CreateProjectTaskFactoryImpl, 13 | CreateDaemonProjectTaskFactoryImpl, 14 | 15 | CreateAppBootstrapCgiTaskFactoryImpl, 16 | CreateAppBootstrapScgiTaskFactoryImpl, 17 | CreateAppBootstrapFcgiTaskFactoryImpl, 18 | CreateAppBootstrapFcgidTaskFactoryImpl, 19 | CreateAppBootstrapUwsgiTaskFactoryImpl, 20 | CreateAppBootstrapMhdTaskFactoryImpl, 21 | CreateAppBootstrapFpwebTaskFactoryImpl, 22 | CreateAppBootstrapIndyTaskFactoryImpl, 23 | -------------------------------------------------------------------------------- /src/Tasks/Includes/Text2Inc/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | appInst.registerTask( 12 | 'txt2inc', 13 | formatColor('--txt2inc', TXT_GREEN) + ' Generate Pascal string variable declaration from file string.' + LineEnding + 14 | ' --src=[source file path] if omitted, STDIN is used.' + LineEnding + 15 | ' --dst=[destination file path]' + LineEnding + 16 | ' if omitted and --src is set, use --src file path concatenated with inc extension' + LineEnding + 17 | ' if omitted and --src is not set, output to STDOUT.' + LineEnding + 18 | ' --var=[name of variable] if omitted, "myStr" is used.' + LineEnding, 19 | TText2IncTask.create() 20 | ); 21 | -------------------------------------------------------------------------------- /src/Tasks/Includes/View/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%../Includes/task.registrations.inc} 10 | 11 | taskFactory := TCreateViewTaskFactory.create(); 12 | try 13 | appInst.registerTask( 14 | 'view', 15 | formatColor('--view', TXT_GREEN) + '=[view-name] Create new view', 16 | taskFactory.build() 17 | ); 18 | finally 19 | taskFactory := nil; 20 | end; 21 | -------------------------------------------------------------------------------- /src/Tasks/Includes/contracts.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | TaskIntf, 10 | TaskFactoryIntf, 11 | TaskListAwareIntf, 12 | -------------------------------------------------------------------------------- /src/Tasks/Includes/task.registrations.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {%fanocli.pas} 10 | 11 | {$INCLUDE Info/task.registrations.inc} 12 | {$INCLUDE KeyGen/task.registrations.inc} 13 | {$INCLUDE GuidGen/task.registrations.inc} 14 | {$INCLUDE Project/task.registrations.inc} 15 | {$INCLUDE Controller/task.registrations.inc} 16 | {$INCLUDE View/task.registrations.inc} 17 | {$INCLUDE Model/task.registrations.inc} 18 | {$INCLUDE Mvc/task.registrations.inc} 19 | {$INCLUDE Middleware/task.registrations.inc} 20 | {$INCLUDE Deploy/task.registrations.inc} 21 | {$INCLUDE Minifier/task.registrations.inc} 22 | {$INCLUDE Daemon/task.registrations.inc} 23 | {$INCLUDE Text2Inc/task.registrations.inc} 24 | -------------------------------------------------------------------------------- /src/Tasks/Includes/units.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {$INCLUDE Deploy/units.inc} 10 | {$INCLUDE Info/units.inc} 11 | 12 | KeyGenTaskImpl, 13 | KeyGenTaskFactoryImpl, 14 | GuidGenTaskImpl, 15 | Text2IncTaskImpl, 16 | 17 | {$INCLUDE Project/units.inc} 18 | 19 | CreateControllerTaskFactoryImpl, 20 | CreateViewTaskFactoryImpl, 21 | CreateModelTaskFactoryImpl, 22 | CreateMvcTaskFactoryImpl, 23 | CreateMiddlewareTaskFactoryImpl, 24 | JsMinifierTaskFactoryImpl, 25 | CssMinifierTaskFactoryImpl, 26 | WritelnTaskFactoryImpl, 27 | SystemDDaemonTaskFactoryImpl; 28 | -------------------------------------------------------------------------------- /src/Tasks/Types/TaskItemTypes.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | unit TaskItemTypes; 9 | 10 | interface 11 | 12 | {$MODE OBJFPC} 13 | {$H+} 14 | 15 | uses 16 | 17 | TaskIntf; 18 | 19 | type 20 | 21 | TTaskItem = record 22 | longOption : string; 23 | description : string; 24 | task : ITask; 25 | end; 26 | PTaskItem = ^TTaskItem; 27 | 28 | implementation 29 | 30 | end. 31 | -------------------------------------------------------------------------------- /src/fanocli.pas: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | program fanocli; 9 | 10 | {$MODE OBJFPC} 11 | {$H+} 12 | 13 | uses 14 | 15 | {$INCLUDE main.units.inc} 16 | 17 | procedure registerTask(const appInst : TFanoCliApplication); 18 | var 19 | taskFactory : ITaskFactory; 20 | begin 21 | {$INCLUDE Tasks/Includes/task.registrations.inc} 22 | end; 23 | 24 | var 25 | app : TFanoCliApplication; 26 | 27 | begin 28 | app := TFanoCliApplication.create(nil); 29 | try 30 | registerTask(app); 31 | app.run(); 32 | finally 33 | app.free(); 34 | end; 35 | end. 36 | -------------------------------------------------------------------------------- /src/main.units.inc: -------------------------------------------------------------------------------- 1 | (*!------------------------------------------------------------ 2 | * Fano CLI Application (https://fanoframework.github.io) 3 | * 4 | * @link https://github.com/fanoframework/fano-cli 5 | * @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | * @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | *------------------------------------------------------------- *) 8 | 9 | {$INCLUDE Apps/Includes/units.inc} 10 | {$INCLUDE Libs/Includes/units.inc} 11 | {$INCLUDE Tasks/Includes/contracts.inc} 12 | {$INCLUDE Tasks/Includes/units.inc} 13 | -------------------------------------------------------------------------------- /tools/clean.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM ------------------------------------------------------------ 3 | REM Fano CLI Application (https://fanoframework.github.io) 4 | REM 5 | REM @link https://github.com/fanoframework/fano-cli 6 | REM @copyright Copyright (c) 2018 Zamrony P. Juhara 7 | REM @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 8 | REM ------------------------------------------------------------- 9 | 10 | REM ------------------------------------------------------ 11 | REM Scripts to delete all compiled unit files 12 | REM ------------------------------------------------------ 13 | 14 | FOR /R bin\unit %i IN (*) DO IF NOT %i == README.md del %i 15 | -------------------------------------------------------------------------------- /tools/clean.sh: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------ 2 | # Fano CLI Application (https://fanoframework.github.io) 3 | # 4 | # @link https://github.com/fanoframework/fano-cli 5 | # @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | # @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | #------------------------------------------------------------- 8 | #!/bin/bash 9 | 10 | #------------------------------------------------------ 11 | # Scripts to delete all compiled unit files 12 | #------------------------------------------------------ 13 | 14 | find bin/unit ! -name 'README.md' -type f -exec rm -f {} + 15 | -------------------------------------------------------------------------------- /tools/config.setup.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM ------------------------------------------------------------ 3 | REM Fano CLI Application (https://fanoframework.github.io) 4 | REM 5 | REM @link https://github.com/fanoframework/fano-cli 6 | REM @copyright Copyright (c) 2018 Zamrony P. Juhara 7 | REM @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 8 | REM ------------------------------------------------------------- 9 | 10 | REM ------------------------------------------------------ 11 | REM Scripts to setup configuration files 12 | REM ------------------------------------------------------ 13 | 14 | copy build.prod.cfg.sample build.prod.cfg 15 | copy build.dev.cfg.sample build.dev.cfg 16 | copy build.cfg.sample build.cfg 17 | -------------------------------------------------------------------------------- /tools/config.setup.sh: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------ 2 | # Fano CLI Application (https://fanoframework.github.io) 3 | # 4 | # @link https://github.com/fanoframework/fano-cli 5 | # @copyright Copyright (c) 2018 - 2022 Zamrony P. Juhara 6 | # @license https://github.com/fanoframework/fano-cli/blob/master/LICENSE (MIT) 7 | #------------------------------------------------------------- 8 | #!/bin/bash 9 | 10 | #------------------------------------------------------ 11 | # Scripts to setup configuration files 12 | #------------------------------------------------------ 13 | 14 | cp build.prod.cfg.sample build.prod.cfg 15 | cp build.dev.cfg.sample build.dev.cfg 16 | cp build.cfg.sample build.cfg 17 | 18 | # replace target compilation based on platform 19 | if [["$OSTYPE" == "freebsd"*]]; then 20 | sed -i '' 's/\-Tlinux/\-Tfreebsd/g' build.cfg 21 | elif [["$OSTYPE" == "msys"*]]; then 22 | sed -i '' 's/\-Tlinux/\-Twin64/g' build.cfg 23 | elif [["$OSTYPE" == "darwin"*]]; then 24 | sed -i '' 's/\-Tlinux/\-Tdarwin/g' build.cfg 25 | fi 26 | --------------------------------------------------------------------------------