aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/xesite/main.go2
-rw-r--r--internal/lume/lume.go22
-rw-r--r--internal/mi/mi.go53
3 files changed, 0 insertions, 77 deletions
diff --git a/cmd/xesite/main.go b/cmd/xesite/main.go
index e33af33..fd30211 100644
--- a/cmd/xesite/main.go
+++ b/cmd/xesite/main.go
@@ -28,7 +28,6 @@ var (
githubSecret = flag.String("github-secret", "", "GitHub secret to use for webhooks")
internalAPIBind = flag.String("internal-api-bind", ":3001", "Port to listen on for the internal API")
mimiAnnounceURL = flag.String("mimi-announce-url", "", "URL to use for the mimi announce service")
- miToken = flag.String("mi-token", "", "Token to use for the mi API")
patreonSaasProxyURL = flag.String("patreon-saasproxy-url", "http://xesite-patreon-saasproxy.flycast", "URL to use for the patreon saasproxy")
siteURL = flag.String("site-url", "https://xeiaso.net/", "URL to use for the site")
)
@@ -65,7 +64,6 @@ func main() {
Development: *devel,
PatreonClient: pc,
DataDir: *dataDir,
- MiToken: *miToken,
MimiAnnounceURL: *mimiAnnounceURL,
})
if err != nil {
diff --git a/internal/lume/lume.go b/internal/lume/lume.go
index 891e895..2dc5b74 100644
--- a/internal/lume/lume.go
+++ b/internal/lume/lume.go
@@ -26,7 +26,6 @@ import (
"tailscale.com/metrics"
"xeiaso.net/v4/internal/config"
"xeiaso.net/v4/internal/jsonfeed"
- "xeiaso.net/v4/internal/mi"
"xeiaso.net/v4/pb/external/mimi/announce"
"xeiaso.net/v4/pb/external/protofeed"
)
@@ -71,7 +70,6 @@ type FS struct {
opt *Options
conf *config.Config
- miClient *mi.Client
mimiClient announce.Announce
fs fs.FS
@@ -131,7 +129,6 @@ type Options struct {
URL string
PatreonClient *patreon.Client
DataDir string
- MiToken string
MimiAnnounceURL string
}
@@ -209,11 +206,6 @@ func New(ctx context.Context, o *Options) (*FS, error) {
siteCommit = ref.Hash().String()
}
- if o.MiToken != "" {
- fs.miClient = mi.New(o.MiToken, "xeiaso.net/v4/internal/lume "+os.Args[0])
- slog.Debug("mi integration enabled")
- }
-
if o.MimiAnnounceURL != "" {
mimiClient := announce.NewAnnounceProtobufClient(o.MimiAnnounceURL, &http.Client{})
fs.mimiClient = mimiClient
@@ -231,13 +223,6 @@ func New(ctx context.Context, o *Options) (*FS, error) {
return nil, err
}
- if fs.miClient != nil {
- go func() {
- if err := fs.miClient.Refresh(); err != nil {
- slog.Error("failed to refresh mi", "err", err)
- }
- }()
- }
go fs.mimiRefresh()
fs.lastBuildTime = time.Now()
@@ -303,13 +288,6 @@ func (f *FS) Update(ctx context.Context) error {
return err
}
- if f.miClient != nil {
- go func() {
- if err := f.miClient.Refresh(); err != nil {
- slog.Error("failed to refresh mi", "err", err)
- }
- }()
- }
go f.mimiRefresh()
return nil
diff --git a/internal/mi/mi.go b/internal/mi/mi.go
deleted file mode 100644
index 67134fd..0000000
--- a/internal/mi/mi.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package mi
-
-import (
- "errors"
- "net/http"
-)
-
-type Client struct {
- cli *http.Client
- baseURL string
- headers http.Header
-}
-
-func New(token string, userAgent string) *Client {
- headers := http.Header{}
- headers.Set("Authorization", token)
- headers.Set("User-Agent", userAgent)
-
- cli := &http.Client{}
-
- return &Client{
- cli: cli,
- baseURL: "https://mi.within.website",
- headers: headers,
- }
-}
-
-func (c *Client) Refresh() error {
- if c == nil {
- return nil
- }
-
- req, err := http.NewRequest("POST", c.baseURL+"/api/blog/refresh", nil)
- if err != nil {
- return err
- }
-
- for k, v := range c.headers {
- req.Header[k] = v
- }
-
- resp, err := c.cli.Do(req)
- if err != nil {
- return err
- }
- defer resp.Body.Close()
-
- if resp.StatusCode != http.StatusOK {
- return errors.New("non-200 status code")
- }
-
- return nil
-}