private void initAdminPipeline(ChannelHandlerContext ctx) { if (!ipFilterHandler.accept(ctx)) { ctx.close(); return; } var pipeline = ctx.pipeline(); pipeline.addLast(new UploadHandler(holder.props.jarPath, "/upload", "/static/ota")) .addLast(new OTAHandler(holder, rootPath + "/ota/start", "/static/ota")) .addLast(adminAuthHandler) .addLast(authCookieHandler) .addLast(cookieBasedUrlReWriterHandler); pipeline.remove(StaticFileHandler.class); pipeline.addLast(new StaticFileHandler(holder.props, new NoCacheStaticFile("/static"))) .addLast(otaLogic) .addLast(usersLogic) .addLast(statsLogic) .addLast(configsLogic) .addLast(hardwareStatsLogic) .addLast(httpAPILogic) .addLast(noMatchHandler) .remove(this); if (log.isTraceEnabled()) { log.trace("Initialized admin pipeline. {}", ctx.pipeline().names()); } }
private void initHttpPipeline(ChannelHandlerContext ctx) { ctx.pipeline() .addLast(letsEncryptHandler) .addLast("HttpChunkedWrite", new ChunkedWriteHandler()) .addLast("HttpUrlMapper", new UrlReWriterHandler("/favicon.ico", "/static/favicon.ico")) .addLast("HttpStaticFile", new StaticFileHandler(holder.props, new StaticFile("/static"), new StaticFileEdsWith(FileUtils.CSV_DIR, ".gz"), new StaticFileEdsWith(FileUtils.CSV_DIR, ".zip"))) .addLast(resetPasswordLogic) .addLast(httpAPILogic) .addLast(noMatchHandler) .remove(this); if (log.isTraceEnabled()) { log.trace("Initialized http pipeline. {}", ctx.pipeline().names()); } }