diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 031a7fc..6c64d49 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -5,7 +5,7 @@ body: - type: markdown attributes: value: | - Thanks for taking the time to suggest an idea for Shortify! + Thanks for taking the time to suggest an idea for Slash! - type: textarea attributes: label: Is your feature request related to a problem? diff --git a/.github/workflows/build-and-push-release-image.yml b/.github/workflows/build-and-push-release-image.yml index 28513f5..df5fa96 100644 --- a/.github/workflows/build-and-push-release-image.yml +++ b/.github/workflows/build-and-push-release-image.yml @@ -41,4 +41,4 @@ jobs: file: ./Dockerfile platforms: linux/amd64,linux/arm64 push: true - tags: stevenlgtm/shortify:latest, stevenlgtm/shortify:${{ env.VERSION }} + tags: stevenlgtm/slash:latest, stevenlgtm/slash:${{ env.VERSION }} diff --git a/.github/workflows/build-and-push-test-image.yml b/.github/workflows/build-and-push-test-image.yml index bca4382..25f312d 100644 --- a/.github/workflows/build-and-push-test-image.yml +++ b/.github/workflows/build-and-push-test-image.yml @@ -34,4 +34,4 @@ jobs: file: ./Dockerfile platforms: linux/amd64 push: true - tags: stevenlgtm/shortify:test + tags: stevenlgtm/slash:test diff --git a/Dockerfile b/Dockerfile index 1d0c4fb..46b7ef0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,18 +17,18 @@ WORKDIR /backend-build COPY . . COPY --from=frontend /frontend-build/dist ./server/dist -RUN go build -o shortify ./cmd/shortify/main.go +RUN go build -o slash ./cmd/slash/main.go # Make workspace with above generated files. FROM alpine:3.16 AS monolithic -WORKDIR /usr/local/shortify +WORKDIR /usr/local/slash RUN apk add --no-cache tzdata ENV TZ="UTC" -COPY --from=backend /backend-build/shortify /usr/local/shortify/ +COPY --from=backend /backend-build/slash /usr/local/slash/ # Directory to store the data, which can be referenced as the mounting point. -RUN mkdir -p /var/opt/shortify +RUN mkdir -p /var/opt/slash -ENTRYPOINT ["./shortify", "--mode", "prod", "--port", "5231"] +ENTRYPOINT ["./slash", "--mode", "prod", "--port", "5231"] diff --git a/README.md b/README.md index 650b748..eb0c1f4 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# Shortify +# Slash logo -**Shortify** is a bookmarking and short link service that allows you to save and share links easily. It lets you store and categorize links, generate short URLs for easy sharing, search and filter your saved links, and access them from any device. It simplifies link organization, management, and collaboration, making it effortless to navigate and share web resources. +**Slash** is a bookmarking and short link service that allows you to save and share links easily. It lets you store and categorize links, generate short URLs for easy sharing, search and filter your saved links, and access them from any device. It simplifies link organization, management, and collaboration, making it effortless to navigate and share web resources. -Let's Simplify, Share, and Save your links with **Shortify**. +Let's Simplify, Share, and Save your links with **Slash**. ## Deploy with Docker in seconds ```bash -docker run -d --name shortify -p 5231:5231 -v ~/.shortify/:/var/opt/shortify stevenlgtm/shortify:latest +docker run -d --name slash -p 5231:5231 -v ~/.slash/:/var/opt/slash stevenlgtm/slash:latest ``` ## Demo diff --git a/api/v1/analytics.go b/api/v1/analytics.go index 20a8dc7..24cdc28 100644 --- a/api/v1/analytics.go +++ b/api/v1/analytics.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/store" "github.com/labstack/echo/v4" "github.com/mssola/useragent" "golang.org/x/exp/slices" diff --git a/api/v1/auth.go b/api/v1/auth.go index b1b7461..9fc249f 100644 --- a/api/v1/auth.go +++ b/api/v1/auth.go @@ -5,8 +5,8 @@ import ( "fmt" "net/http" - "github.com/boojack/shortify/api/v1/auth" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/api/v1/auth" + "github.com/boojack/slash/store" "github.com/labstack/echo/v4" "golang.org/x/crypto/bcrypt" diff --git a/api/v1/auth/auth.go b/api/v1/auth/auth.go index 7e54331..a59a75a 100644 --- a/api/v1/auth/auth.go +++ b/api/v1/auth/auth.go @@ -5,14 +5,14 @@ import ( "strconv" "time" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/store" "github.com/golang-jwt/jwt/v4" "github.com/labstack/echo/v4" "github.com/pkg/errors" ) const ( - issuer = "shortify" + issuer = "slash" // Signing key section. For now, this is only used for signing, not for verifying since we only // have 1 version. But it will be used to maintain backward compatibility if we change the signing mechanism. keyID = "v1" @@ -33,9 +33,9 @@ const ( // 2. The access token has already expired, we refresh the token so that the ongoing request can pass through. CookieExpDuration = refreshTokenDuration - 1*time.Minute // AccessTokenCookieName is the cookie name of access token. - AccessTokenCookieName = "shortify.access-token" + AccessTokenCookieName = "slash.access-token" // RefreshTokenCookieName is the cookie name of refresh token. - RefreshTokenCookieName = "shortify.refresh-token" + RefreshTokenCookieName = "slash.refresh-token" ) type claimsMessage struct { diff --git a/api/v1/jwt.go b/api/v1/jwt.go index cf5ad2f..6292646 100644 --- a/api/v1/jwt.go +++ b/api/v1/jwt.go @@ -7,9 +7,9 @@ import ( "strings" "time" - "github.com/boojack/shortify/api/v1/auth" - "github.com/boojack/shortify/internal/util" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/api/v1/auth" + "github.com/boojack/slash/internal/util" + "github.com/boojack/slash/store" "github.com/golang-jwt/jwt/v4" "github.com/labstack/echo/v4" "github.com/pkg/errors" diff --git a/api/v1/redirector.go b/api/v1/redirector.go index 2f5ea94..bb46981 100644 --- a/api/v1/redirector.go +++ b/api/v1/redirector.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/store" "github.com/labstack/echo/v4" "github.com/pkg/errors" ) diff --git a/api/v1/shortcut.go b/api/v1/shortcut.go index f840c30..f3a6354 100644 --- a/api/v1/shortcut.go +++ b/api/v1/shortcut.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/store" "github.com/pkg/errors" "github.com/labstack/echo/v4" diff --git a/api/v1/user.go b/api/v1/user.go index 1c3774a..8b2718d 100644 --- a/api/v1/user.go +++ b/api/v1/user.go @@ -7,7 +7,7 @@ import ( "net/mail" "strconv" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/store" "github.com/labstack/echo/v4" "golang.org/x/crypto/bcrypt" diff --git a/api/v1/v1.go b/api/v1/v1.go index 07b0783..ecc6080 100644 --- a/api/v1/v1.go +++ b/api/v1/v1.go @@ -1,8 +1,8 @@ package v1 import ( - "github.com/boojack/shortify/server/profile" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/server/profile" + "github.com/boojack/slash/store" "github.com/labstack/echo/v4" ) diff --git a/api/v1/workspace.go b/api/v1/workspace.go index d91d766..3635311 100644 --- a/api/v1/workspace.go +++ b/api/v1/workspace.go @@ -5,8 +5,8 @@ import ( "fmt" "net/http" - "github.com/boojack/shortify/server/profile" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/server/profile" + "github.com/boojack/slash/store" "github.com/labstack/echo/v4" ) diff --git a/cmd/shortify/main.go b/cmd/slash/main.go similarity index 94% rename from cmd/shortify/main.go rename to cmd/slash/main.go index affbb34..1145e84 100644 --- a/cmd/shortify/main.go +++ b/cmd/slash/main.go @@ -12,10 +12,10 @@ import ( "github.com/spf13/viper" _ "modernc.org/sqlite" - "github.com/boojack/shortify/server" - _profile "github.com/boojack/shortify/server/profile" - "github.com/boojack/shortify/store" - "github.com/boojack/shortify/store/db" + "github.com/boojack/slash/server" + _profile "github.com/boojack/slash/server/profile" + "github.com/boojack/slash/store" + "github.com/boojack/slash/store/db" ) const ( @@ -36,7 +36,7 @@ var ( data string rootCmd = &cobra.Command{ - Use: "shortify", + Use: "slash", Short: "", Run: func(_cmd *cobra.Command, _args []string) { ctx, cancel := context.WithCancel(context.Background()) @@ -108,7 +108,7 @@ func init() { viper.SetDefault("mode", "dev") viper.SetDefault("port", 8082) - viper.SetEnvPrefix("shortify") + viper.SetEnvPrefix("slash") } func initConfig() { diff --git a/extension/background.js b/extension/background.js index fc15c2d..4e9359e 100644 --- a/extension/background.js +++ b/extension/background.js @@ -1,4 +1,4 @@ -import { getShortifyData } from "./common.js"; +import { getSlashData } from "./common.js"; const urlRegex = /https?:\/\/s\/(.+)/; @@ -6,16 +6,16 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => { if (typeof tab.url === "string") { const matchResult = urlRegex.exec(tab.url); if (matchResult) { - const shortifyData = await getShortifyData(); + const slashData = await getSlashData(); const name = matchResult[1]; - const url = `${shortifyData.domain}/s/${name}`; - return chrome.tabs.update({ url }); + const url = `${slashData.domain}/s/${name}`; + return chrome.tabs.update(tab.id, { url }); } } }); chrome.omnibox.onInputEntered.addListener(async (text) => { - const shortifyData = await getShortifyData(); - const url = `${shortifyData.domain}/s/${text}`; + const slashData = await getSlashData(); + const url = `${slashData.domain}/s/${text}`; return chrome.tabs.update({ url }); }); diff --git a/extension/common.js b/extension/common.js index 124a240..a071429 100644 --- a/extension/common.js +++ b/extension/common.js @@ -1,10 +1,10 @@ -export const getShortifyData = () => { +export const getSlashData = () => { return new Promise((resolve, reject) => { - chrome.storage.local.get(["shortify"], (data) => { - if (data?.shortify) { - resolve(data.shortify); + chrome.storage.local.get(["slash"], (data) => { + if (data?.slash) { + resolve(data.slash); } else { - reject("shortify data not found"); + reject("slash data not found"); } }); }); diff --git a/extension/manifest.json b/extension/manifest.json index 03eed63..3204b7d 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -1,5 +1,5 @@ { - "name": "Shortify", + "name": "Slash", "description": "", "version": "0.1.0", "manifest_version": 3, diff --git a/extension/popup.html b/extension/popup.html index 77907c4..cf23c3a 100644 --- a/extension/popup.html +++ b/extension/popup.html @@ -1,7 +1,7 @@ -

Shortify extension

+

Slash extension

Domain diff --git a/extension/popup.js b/extension/popup.js index 3de7fd3..356f0e6 100644 --- a/extension/popup.js +++ b/extension/popup.js @@ -1,11 +1,11 @@ -import { getShortifyData } from "./common.js"; +import { getSlashData } from "./common.js"; const saveButton = document.body.querySelector("#save-button"); const domainInput = document.body.querySelector("#domain-input"); saveButton.addEventListener("click", () => { chrome.storage.local.set({ - shortify: { + slash: { domain: domainInput.value, }, }); @@ -13,9 +13,9 @@ saveButton.addEventListener("click", () => { (async () => { try { - const shortifyData = await getShortifyData(); - if (shortifyData) { - domainInput.value = shortifyData.domain; + const slashData = await getSlashData(); + if (slashData) { + domainInput.value = slashData.domain; } } catch (error) { // do nothing. diff --git a/go.mod b/go.mod index 849eb28..5adc6ea 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/boojack/shortify +module github.com/boojack/slash go 1.19 diff --git a/scripts/.air.toml b/scripts/.air.toml index d7a2991..f3b3cbe 100644 --- a/scripts/.air.toml +++ b/scripts/.air.toml @@ -2,8 +2,8 @@ root = "." tmp_dir = ".air" [build] - bin = "./.air/shortify" - cmd = "go build -o ./.air/shortify ./cmd/shortify/main.go" + bin = "./.air/slash" + cmd = "go build -o ./.air/slash ./cmd/slash/main.go" delay = 1000 exclude_dir = [".air", "web", "build"] exclude_file = [] diff --git a/server/embed_frontend.go b/server/embed_frontend.go index b7401ce..4c7bfe1 100644 --- a/server/embed_frontend.go +++ b/server/embed_frontend.go @@ -5,7 +5,7 @@ import ( "io/fs" "net/http" - "github.com/boojack/shortify/internal/util" + "github.com/boojack/slash/internal/util" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" ) diff --git a/server/profile/profile.go b/server/profile/profile.go index 809ac0d..8109214 100644 --- a/server/profile/profile.go +++ b/server/profile/profile.go @@ -6,7 +6,7 @@ import ( "path/filepath" "strings" - "github.com/boojack/shortify/server/version" + "github.com/boojack/slash/server/version" "github.com/spf13/viper" ) @@ -14,7 +14,7 @@ import ( type Profile struct { // Data is the data directory Data string `json:"-"` - // DSN points to where Shortify stores its own data + // DSN points to store data DSN string `json:"-"` // Mode can be "prod" or "dev" Mode string `json:"mode"` @@ -57,7 +57,7 @@ func GetProfile() (*Profile, error) { } if profile.Mode == "prod" && profile.Data == "" { - profile.Data = "/var/opt/shortify" + profile.Data = "/var/opt/slash" } dataDir, err := checkDSN(profile.Data) @@ -67,7 +67,7 @@ func GetProfile() (*Profile, error) { } profile.Data = dataDir - profile.DSN = fmt.Sprintf("%s/shortify_%s.db", dataDir, profile.Mode) + profile.DSN = fmt.Sprintf("%s/slash_%s.db", dataDir, profile.Mode) profile.Version = version.GetCurrentVersion(profile.Mode) return &profile, nil } diff --git a/server/server.go b/server/server.go index f940bda..5ebb267 100644 --- a/server/server.go +++ b/server/server.go @@ -5,9 +5,9 @@ import ( "fmt" "time" - apiv1 "github.com/boojack/shortify/api/v1" - "github.com/boojack/shortify/server/profile" - "github.com/boojack/shortify/store" + apiv1 "github.com/boojack/slash/api/v1" + "github.com/boojack/slash/server/profile" + "github.com/boojack/slash/store" "github.com/google/uuid" "github.com/labstack/echo/v4" @@ -52,7 +52,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store embedFrontend(e) // In dev mode, we'd like to set the const secret key to make signin session persistence. - secret := "shortify" + secret := "slash" if profile.Mode == "prod" { var err error secret, err = s.getSystemSecretSessionName(ctx) diff --git a/store/db/db.go b/store/db/db.go index e9f60bd..f110789 100644 --- a/store/db/db.go +++ b/store/db/db.go @@ -12,8 +12,8 @@ import ( "sort" "time" - "github.com/boojack/shortify/server/profile" - "github.com/boojack/shortify/server/version" + "github.com/boojack/slash/server/profile" + "github.com/boojack/slash/server/version" ) //go:embed migration @@ -89,7 +89,7 @@ func (db *DB) Open(ctx context.Context) (err error) { if err != nil { return fmt.Errorf("failed to read raw database file, err: %w", err) } - backupDBFilePath := fmt.Sprintf("%s/shortify_%s_%d_backup.db", db.profile.Data, db.profile.Version, time.Now().Unix()) + backupDBFilePath := fmt.Sprintf("%s/slash_%s_%d_backup.db", db.profile.Data, db.profile.Version, time.Now().Unix()) if err := os.WriteFile(backupDBFilePath, rawBytes, 0644); err != nil { return fmt.Errorf("failed to write raw database file, err: %w", err) } diff --git a/store/store.go b/store/store.go index 181f27c..f6274f8 100644 --- a/store/store.go +++ b/store/store.go @@ -4,7 +4,7 @@ import ( "database/sql" "sync" - "github.com/boojack/shortify/server/profile" + "github.com/boojack/slash/server/profile" ) // Store provides database access to all raw objects. diff --git a/test/store/activity_test.go b/test/store/activity_test.go index 0f1cf17..8ae2a31 100644 --- a/test/store/activity_test.go +++ b/test/store/activity_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/store" "github.com/stretchr/testify/require" ) diff --git a/test/store/shortcut_test.go b/test/store/shortcut_test.go index f1890aa..43a395d 100644 --- a/test/store/shortcut_test.go +++ b/test/store/shortcut_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/store" "github.com/stretchr/testify/require" ) diff --git a/test/store/store.go b/test/store/store.go index aefc738..903e766 100644 --- a/test/store/store.go +++ b/test/store/store.go @@ -5,9 +5,9 @@ import ( "fmt" "testing" - "github.com/boojack/shortify/store" - "github.com/boojack/shortify/store/db" - test "github.com/boojack/shortify/test" + "github.com/boojack/slash/store" + "github.com/boojack/slash/store/db" + test "github.com/boojack/slash/test" // sqlite driver. _ "modernc.org/sqlite" diff --git a/test/store/user_test.go b/test/store/user_test.go index 588fbab..a200881 100644 --- a/test/store/user_test.go +++ b/test/store/user_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/store" "github.com/stretchr/testify/require" "golang.org/x/crypto/bcrypt" diff --git a/test/store/workspace_setting_test.go b/test/store/workspace_setting_test.go index 0a24818..6ae4b7f 100644 --- a/test/store/workspace_setting_test.go +++ b/test/store/workspace_setting_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/boojack/shortify/store" + "github.com/boojack/slash/store" "github.com/google/uuid" "github.com/stretchr/testify/require" ) diff --git a/test/test.go b/test/test.go index 746ecd5..bd2ae20 100644 --- a/test/test.go +++ b/test/test.go @@ -5,8 +5,8 @@ import ( "net" "testing" - "github.com/boojack/shortify/server/profile" - "github.com/boojack/shortify/server/version" + "github.com/boojack/slash/server/profile" + "github.com/boojack/slash/server/version" ) func getUnusedPort() int { @@ -31,7 +31,7 @@ func GetTestingProfile(t *testing.T) *profile.Profile { Mode: mode, Port: port, Data: dir, - DSN: fmt.Sprintf("%s/shortify_%s.db", dir, mode), + DSN: fmt.Sprintf("%s/slash_%s.db", dir, mode), Version: version.GetCurrentVersion(mode), } } diff --git a/web/README.md b/web/README.md index f1a273e..e696190 100644 --- a/web/README.md +++ b/web/README.md @@ -1 +1 @@ -# Shortify +# Slash diff --git a/web/index.html b/web/index.html index 847a109..6dd635e 100644 --- a/web/index.html +++ b/web/index.html @@ -5,7 +5,7 @@ - Shortify + Slash
diff --git a/web/package.json b/web/package.json index c63316d..aa4586d 100644 --- a/web/package.json +++ b/web/package.json @@ -1,5 +1,5 @@ { - "name": "shortify", + "name": "slash", "scripts": { "dev": "vite", "build": "tsc && vite build", diff --git a/web/src/components/AboutDialog.tsx b/web/src/components/AboutDialog.tsx index 3a6c9f6..498a8c4 100644 --- a/web/src/components/AboutDialog.tsx +++ b/web/src/components/AboutDialog.tsx @@ -19,12 +19,12 @@ const AboutDialog: React.FC = (props: Props) => {

- Shortify is a bookmarking and short link service that allows you to save and share links + Slash is a bookmarking and short link service that allows you to save and share links easily.

See more in: - + GitHub
diff --git a/web/src/components/GenerateQRCodeDialog.tsx b/web/src/components/GenerateQRCodeDialog.tsx index f96df66..7adb18b 100644 --- a/web/src/components/GenerateQRCodeDialog.tsx +++ b/web/src/components/GenerateQRCodeDialog.tsx @@ -13,7 +13,7 @@ interface Props { const GenerateQRCodeDialog: React.FC = (props: Props) => { const { shortcut, onClose } = props; const containerRef = useRef(null); - const shortifyLink = absolutifyLink(`/s/${shortcut.name}`); + const shortcutLink = absolutifyLink(`/s/${shortcut.name}`); const handleCloseBtnClick = () => { onClose(); @@ -44,7 +44,7 @@ const GenerateQRCodeDialog: React.FC = (props: Props) => {
- +