Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(caddy): add Caddy support for Outline services #198

Merged
merged 234 commits into from
Sep 23, 2024
Merged

Conversation

sbruens
Copy link

@sbruens sbruens commented Aug 14, 2024

This proof of concept lays the foundation for integrating Outline service support into Caddy through the implementation of two new Caddy modules:

  1. outline Host Module: This module serves as the central hub for server-wide configuration settings related to the Outline service. It also handles the configuration of application-level metrics, ensuring we can monitor the service's performance effectively.

  2. shadowsocks Layer4 App Guest Module: This module introduces a specialized handler to manage both stream-based and packet-based Shadowsocks connections. It operates in conjunction with the outline host module, utilizing its shared configuration settings.


Note:

While this PR establishes the core functionality, there are outstanding tasks related to metrics that might be addressed in separate PRs for better organization and focus:

  • Metric Prefixing: Evaluate the necessity of aliasing or modifying the shadowsocks_ prefix, particularly for server-wide metrics like {PREFIX}_build_info, and {PREFIX}_ports, which aren't specifically tied to Shadowsocks.
  • ip2info Support: Implement support for ip2info configuration within the outline module.
  • Key and Port Metrics: Track {PREFIX}_keys and {PREFIX_ports} metrics in this Caddy implementation.

sbruens added 30 commits May 31, 2024 17:03
@sbruens sbruens changed the title feat: add Caddy support for Outline services feat(caddy): add Caddy support for Outline services Sep 18, 2024
)

func (OutlineApp) CaddyModule() caddy.ModuleInfo {
return caddy.ModuleInfo{ID: outlineModuleName}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note we still need to provide a ModuleInfo with an accurate ID, so there is some duplication here now, but New() isn't used from it as far as I can tell. This is also why I'm not logging any errors here, since it is called and used in a few places.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's unfortunate. At least we don't have the two module objects co-existing anymore. Thanks for the changes.

)

func (OutlineApp) CaddyModule() caddy.ModuleInfo {
return caddy.ModuleInfo{ID: outlineModuleName}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's unfortunate. At least we don't have the two module objects co-existing anymore. Thanks for the changes.

Base automatically changed from sbruens/logger to master September 23, 2024 18:33
@sbruens sbruens merged commit cb5965f into master Sep 23, 2024
5 checks passed
@sbruens sbruens deleted the sbruens/caddy branch September 23, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants