From cd67fe6df3601240262fb1750f98504e9ab429d6 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sat, 31 Aug 2024 00:22:32 +0200 Subject: [PATCH 1/2] Delete unnecessary http:// from articles.go and issues.go --- cmd/frontend/articles.go | 2 +- cmd/frontend/issues.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/frontend/articles.go b/cmd/frontend/articles.go index 7b34023..fd6bef0 100644 --- a/cmd/frontend/articles.go +++ b/cmd/frontend/articles.go @@ -94,7 +94,7 @@ func SubmitArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc { return } - article.Link = fmt.Sprint("http://", c.Domain, c.Port, "/article/serve/", article.ID) + article.Link = fmt.Sprint(c.Domain, c.Port, "/article/serve/", article.ID) if err = db.UpdateAttributes(&b.Attribute{Table: "articles", ID: article.ID, AttName: "link", Value: article.Link}); err != nil { log.Println(err) http.Error(w, err.Error(), http.StatusInternalServerError) diff --git a/cmd/frontend/issues.go b/cmd/frontend/issues.go index b1c7258..228fa16 100644 --- a/cmd/frontend/issues.go +++ b/cmd/frontend/issues.go @@ -60,7 +60,7 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun article := &b.Article{ Title: "Autogenerated cpolis Issue Article", - EncURL: fmt.Sprint("http://", c.Domain, c.Port, "/image/serve/", imgFileName), + EncURL: fmt.Sprint(c.Domain, c.Port, "/image/serve/", imgFileName), EncLength: int(imgSize), EncType: mimeType, Published: true, @@ -84,7 +84,7 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun return } - article.Link = fmt.Sprint("http://", c.Domain, c.Port, "/article/serve/", article.ID) + article.Link = fmt.Sprint(c.Domain, c.Port, "/article/serve/", article.ID) if err = db.UpdateAttributes(&b.Attribute{Table: "articles", ID: article.ID, AttName: "link", Value: article.Link}); err != nil { log.Println(err) http.Error(w, err.Error(), http.StatusInternalServerError) From e4589f3b844cbaa2f693364d3ed3e16ebed1cc81 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sat, 31 Aug 2024 00:35:07 +0200 Subject: [PATCH 2/2] Remove unnecessary mv from update.sh --- update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update.sh b/update.sh index bd2f4a0..e80f44d 100755 --- a/update.sh +++ b/update.sh @@ -43,13 +43,13 @@ chmod +x $CPOLIS_DIR/tailwindcss $CPOLIS_DIR/tailwindcss -i $CPOLIS_DIR/web/static/css/input.css -o $CPOLIS_DIR/web/static/css/style.css echo '\nBuilding cpolis...' >&2 -go build -o $TMP_DIR/cpolis $CPOLIS_DIR/cmd/main.go +go build -o $BIN_DIR/cpolis $CPOLIS_DIR/cmd/main.go -echo '\nSetting system files up...' >&2 -sudo mv $TMP_DIR/cpolis $BIN_DIR/cpolis +echo '\nSetting up system files...' >&2 sudo chown root:root $BIN_DIR/cpolis chmod +x $BIN_DIR/cpolis +echo '\nSetting up service...' >&2 sudo mv $CPOLIS_DIR/cpolis.service $SYSTEMD_DIR sudo chown root:root $SYSTEMD_DIR/cpolis.service sudo systemctl daemon-reload