diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb93a98..22aa17c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,14 +11,13 @@ jobs: runs-on: ubuntu-22.04 steps: - name: checkout - uses: actions/checkout@v2.0.0 + uses: actions/checkout@v3 - - name: setup .net core - uses: actions/setup-dotnet@v1.7.2 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.100 + dotnet-version: '8.0' - name: build run: dotnet build - working-directory: . - + working-directory: . \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 812c646..e6383c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /app COPY . . @@ -7,7 +7,7 @@ RUN dotnet restore WORKDIR /app/TechStacks RUN dotnet publish -c release -o /out --no-restore -FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime WORKDIR /app COPY --from=build /out ./ diff --git a/TechStacks.ServiceInterface/CustomAuthUserSession.cs b/TechStacks.ServiceInterface/CustomAuthUserSession.cs index 4f3df56..19ac290 100644 --- a/TechStacks.ServiceInterface/CustomAuthUserSession.cs +++ b/TechStacks.ServiceInterface/CustomAuthUserSession.cs @@ -14,7 +14,6 @@ namespace TechStacks.ServiceInterface public class CustomUserSession : AuthUserSession { public string GithubProfileUrl { get; set; } - public string TwitterProfileUrl { get; set; } public override void OnAuthenticated(IServiceBase authService, IAuthSession session, IAuthTokens tokens, Dictionary authInfo) { @@ -34,12 +33,8 @@ public override void OnAuthenticated(IServiceBase authService, IAuthSession sess GithubProfileUrl = avatarUrl; } } - if (authTokens.Provider.ToLower() == "twitter") - { - TwitterProfileUrl = session.GetProfileUrl().Replace("http://","https://"); - } - ProfileUrl = GithubProfileUrl ?? TwitterProfileUrl; + ProfileUrl = GithubProfileUrl; using (var db = dbFactory.OpenDbConnection()) { diff --git a/TechStacks.ServiceInterface/TechStacks.ServiceInterface.csproj b/TechStacks.ServiceInterface/TechStacks.ServiceInterface.csproj index fedd96b..dd00667 100644 --- a/TechStacks.ServiceInterface/TechStacks.ServiceInterface.csproj +++ b/TechStacks.ServiceInterface/TechStacks.ServiceInterface.csproj @@ -1,11 +1,11 @@  - net6.0 + net8.0 - - + + diff --git a/TechStacks.ServiceModel/TechStacks.ServiceModel.csproj b/TechStacks.ServiceModel/TechStacks.ServiceModel.csproj index 7e1ec9d..8d4f09b 100644 --- a/TechStacks.ServiceModel/TechStacks.ServiceModel.csproj +++ b/TechStacks.ServiceModel/TechStacks.ServiceModel.csproj @@ -1,9 +1,9 @@  - net6.0 + net8.0 - + \ No newline at end of file diff --git a/TechStacks.Tests/TechStacks.Tests.csproj b/TechStacks.Tests/TechStacks.Tests.csproj index 4ca04f0..2f7354d 100644 --- a/TechStacks.Tests/TechStacks.Tests.csproj +++ b/TechStacks.Tests/TechStacks.Tests.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 portable Library @@ -11,11 +11,11 @@ - - - - - + + + + + diff --git a/TechStacks/Configure.AppHost.cs b/TechStacks/Configure.AppHost.cs index dbb2cab..30f84be 100644 --- a/TechStacks/Configure.AppHost.cs +++ b/TechStacks/Configure.AppHost.cs @@ -243,7 +243,7 @@ SitemapFeature CreateSiteMap(IDbConnection db, string baseUrl) => LastModified = DateTime.UtcNow, UrlSet = db.Select(db.From().OrderByDescending(x => x.LastModified)) .Map(x => new SitemapUrl { - Location = baseUrl + new ClientTechnologyStack {Slug = x.Slug}.ToAbsoluteUri(), + Location = baseUrl + new ClientTechnologyStack {Slug = x.Slug}.ToGetUrl(), LastModified = x.LastModified, ChangeFrequency = SitemapFrequency.Weekly, }), @@ -254,7 +254,7 @@ SitemapFeature CreateSiteMap(IDbConnection db, string baseUrl) => LastModified = DateTime.UtcNow, UrlSet = db.Select(db.From().OrderByDescending(x => x.LastModified)) .Map(x => new SitemapUrl { - Location = baseUrl + new ClientTechnology {Slug = x.Slug}.ToAbsoluteUri(), + Location = baseUrl + new ClientTechnology {Slug = x.Slug}.ToGetUrl(), LastModified = x.LastModified, ChangeFrequency = SitemapFrequency.Weekly, }) @@ -265,7 +265,7 @@ SitemapFeature CreateSiteMap(IDbConnection db, string baseUrl) => LastModified = DateTime.UtcNow, UrlSet = db.Select(db.From().OrderByDescending(x => x.ModifiedDate)) .Map(x => new SitemapUrl { - Location = baseUrl + new ClientUser {UserName = x.UserName}.ToAbsoluteUri(), + Location = baseUrl + new ClientUser {UserName = x.UserName}.ToGetUrl(), LastModified = x.ModifiedDate, ChangeFrequency = SitemapFrequency.Weekly, }) diff --git a/TechStacks/TechStacks.csproj b/TechStacks/TechStacks.csproj index 3f70a7c..07a4873 100644 --- a/TechStacks/TechStacks.csproj +++ b/TechStacks/TechStacks.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 enable enable InProcess @@ -14,10 +14,10 @@ - - - - + + + + diff --git a/TechStacks/npm-shrinkwrap.json b/TechStacks/npm-shrinkwrap.json index b6ca804..65d1012 100644 --- a/TechStacks/npm-shrinkwrap.json +++ b/TechStacks/npm-shrinkwrap.json @@ -8,7 +8,7 @@ "name": "TechStacks", "version": "1.0.0", "dependencies": { - "@servicestack/client": "^1.2.5", + "@servicestack/client": "^2.0.17", "@servicestack/editor": "0.0.2", "@servicestack/images": "^1.0.0", "npm": "^9.2.0", @@ -197,13 +197,11 @@ } }, "node_modules/@servicestack/client": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@servicestack/client/-/client-1.2.5.tgz", - "integrity": "sha512-O8IUyCPc6DBlmwUaMt/rIXwJE5b6UTZh6sCiOzaeGpdxbm84bdfzfyEalzMdUK3slpqHe4r056qCgudyrnYdBA==", - "dependencies": { - "cross-fetch": "^3.1.4", - "es6-shim": "^0.35.6", - "eventsource": "^1.1.0" + "version": "2.0.17", + "resolved": "https://registry.npmjs.org/@servicestack/client/-/client-2.0.17.tgz", + "integrity": "sha512-8mHTY5kkFjg3Gf75ZKSsrzjCKxmc8RhY1FXZEtbR/BvlM/AxVJQvJIGk9lYFe/PLMYPHBF3qDDjL1RlG9uhagQ==", + "engines": { + "node": ">=18.0.0" } }, "node_modules/@servicestack/editor": { @@ -2638,14 +2636,6 @@ "sha.js": "^2.4.8" } }, - "node_modules/cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", - "dependencies": { - "node-fetch": "2.6.7" - } - }, "node_modules/cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", @@ -3557,11 +3547,6 @@ "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" }, - "node_modules/es6-shim": { - "version": "0.35.6", - "resolved": "https://registry.npmjs.org/es6-shim/-/es6-shim-0.35.6.tgz", - "integrity": "sha512-EmTr31wppcaIAgblChZiuN/l9Y7DPyw8Xtbg7fIVngn6zMW+IEBJDJngeKC3x6wr0V/vcA2wqeFnaw1bFJbDdA==" - }, "node_modules/es6-symbol": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", @@ -3920,14 +3905,6 @@ "node": ">=0.8.x" } }, - "node_modules/eventsource": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.2.tgz", - "integrity": "sha512-xAH3zWhgO2/3KIniEKYPr8plNSzlGINOUqYj0m0u7AB81iRw8b/3E73W6AuU+6klLbaSFmZnaETQ2lXPfAydrA==", - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -6994,25 +6971,6 @@ "lower-case": "^1.1.1" } }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/node-libs-browser": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", @@ -16135,11 +16093,6 @@ "resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.7.tgz", "integrity": "sha512-FclLrw8b9bMWf4QlCJuHBEVhSRsqDj6u3nIjAzPeJvgl//1hBlffdlk0MALceL14+koWEdU4ofRAXofbODxQzg==" }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, "node_modules/trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -17246,11 +17199,6 @@ "node": ">=8.0" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, "node_modules/webpack": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.12.0.tgz", @@ -17506,15 +17454,6 @@ "webpack": "^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0" } }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/whet.extend": { "version": "0.9.9", "resolved": "https://registry.npmjs.org/whet.extend/-/whet.extend-0.9.9.tgz", @@ -17843,14 +17782,9 @@ } }, "@servicestack/client": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@servicestack/client/-/client-1.2.5.tgz", - "integrity": "sha512-O8IUyCPc6DBlmwUaMt/rIXwJE5b6UTZh6sCiOzaeGpdxbm84bdfzfyEalzMdUK3slpqHe4r056qCgudyrnYdBA==", - "requires": { - "cross-fetch": "^3.1.4", - "es6-shim": "^0.35.6", - "eventsource": "^1.1.0" - } + "version": "2.0.17", + "resolved": "https://registry.npmjs.org/@servicestack/client/-/client-2.0.17.tgz", + "integrity": "sha512-8mHTY5kkFjg3Gf75ZKSsrzjCKxmc8RhY1FXZEtbR/BvlM/AxVJQvJIGk9lYFe/PLMYPHBF3qDDjL1RlG9uhagQ==" }, "@servicestack/editor": { "version": "0.0.2", @@ -19950,14 +19884,6 @@ "sha.js": "^2.4.8" } }, - "cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", - "requires": { - "node-fetch": "2.6.7" - } - }, "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", @@ -20714,11 +20640,6 @@ } } }, - "es6-shim": { - "version": "0.35.6", - "resolved": "https://registry.npmjs.org/es6-shim/-/es6-shim-0.35.6.tgz", - "integrity": "sha512-EmTr31wppcaIAgblChZiuN/l9Y7DPyw8Xtbg7fIVngn6zMW+IEBJDJngeKC3x6wr0V/vcA2wqeFnaw1bFJbDdA==" - }, "es6-symbol": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", @@ -21004,11 +20925,6 @@ "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" }, - "eventsource": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.2.tgz", - "integrity": "sha512-xAH3zWhgO2/3KIniEKYPr8plNSzlGINOUqYj0m0u7AB81iRw8b/3E73W6AuU+6klLbaSFmZnaETQ2lXPfAydrA==" - }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -23452,14 +23368,6 @@ "lower-case": "^1.1.1" } }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, "node-libs-browser": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", @@ -30490,11 +30398,6 @@ "resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.7.tgz", "integrity": "sha512-FclLrw8b9bMWf4QlCJuHBEVhSRsqDj6u3nIjAzPeJvgl//1hBlffdlk0MALceL14+koWEdU4ofRAXofbODxQzg==" }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -31395,11 +31298,6 @@ "chokidar": "^2.1.8" } }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, "webpack": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.12.0.tgz", @@ -31597,15 +31495,6 @@ "source-map": "~0.6.1" } }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "whet.extend": { "version": "0.9.9", "resolved": "https://registry.npmjs.org/whet.extend/-/whet.extend-0.9.9.tgz", diff --git a/TechStacks/package.json b/TechStacks/package.json index 5f90a94..bef6b72 100644 --- a/TechStacks/package.json +++ b/TechStacks/package.json @@ -16,7 +16,7 @@ "node": ">=16.0.0 <17.0.0" }, "dependencies": { - "@servicestack/client": "^1.2.5", + "@servicestack/client": "^2.0.17", "@servicestack/editor": "0.0.2", "@servicestack/images": "^1.0.0", "npm": "^9.2.0", diff --git a/TechStacks/src/layouts/default.vue b/TechStacks/src/layouts/default.vue index 827c30a..b58aada 100644 --- a/TechStacks/src/layouts/default.vue +++ b/TechStacks/src/layouts/default.vue @@ -2,7 +2,7 @@
- + - - - @@ -80,68 +77,10 @@ export default { href(url) { location.href = url; }, - - // async getPrerenderedHtml() { - // try { - // const host = location.host; - // const prerenderUrl = "/prerender"; - // const log = console.log && true; - - // const path = location.pathname + location.search; - // const getPreRender = async path => - // (await fetch(`${prerenderUrl}${path || "/"}`)).text(); - - // //pages can add to indicate pages rendered correctly - // const hasData = () => { - // if (window.__PRERENDERED) { - // if (log) console.log('already prerendered, skipping'); - // return true; - // } - // const ret = document.getElementsByClassName("no-prerender")[0] != null; - // if (ret && log) console.log("no-prerender, skipping..."); - // return ret; - // }; - - // let html = await getPreRender(path); - // if (!html || html.trim().length == 0) { - // if (log) console.log("empty html, skipping prerendering..."); - // return; - // } - // if (html.trim().indexOf("<") == -1) { - // if (log) console.log("invalid html, skipping prerendering... " + html.trim().substring(0,100)); - // return; - // } - // if (hasData()) return; - - // if (log) console.log(`injecting prerendered content: ${html.length} chars`); - // return html; - // } catch(e) { - // console.log("ERROR getPrerenderedHtml: ", e.message, e.stack); - // return null; - // } - // }, - - click(e) { - // this.goNav(e.ctrlKey ? -1 : 1); - }, - goNav, }, async mounted(){ - // try { - // const isBot = /bot|crawl|spider/i.test(navigator.userAgent); - // if (isBot) { - // this.prerenderedHtml = await this.getPrerenderedHtml(); - // } else { - // setTimeout(async () => { - // //still fetch for non-bots when no no-prerender, only happens on initial load - // this.prerenderedHtml = await this.getPrerenderedHtml(); - // }, 2000); - // } - // } catch(e) { - // console.log('getPrerenderedHtml()', e.message, e.stack); - // } window.onkeydown = globalNavShortcuts.bind(this); }, diff --git a/TechStacks/src/shared/gateway.js b/TechStacks/src/shared/gateway.js index 0083e76..6963bbf 100644 --- a/TechStacks/src/shared/gateway.js +++ b/TechStacks/src/shared/gateway.js @@ -1,4 +1,4 @@ -import {JsonServiceClient, toFormData} from "@servicestack/client"; +import {JsonApiClient, toFormData} from "@servicestack/client"; import { ActionPostCommentReport, ActionPostReport, @@ -72,7 +72,7 @@ import { const BaseUrl = "/"; -export const client = new JsonServiceClient(BaseUrl); +export const client = JsonApiClient.create(BaseUrl); export const getSessionInfo = async() => { try { diff --git a/TechStacks/src/static/static-layout.htm b/TechStacks/src/static/static-layout.htm index 4839d16..60e62d3 100644 --- a/TechStacks/src/static/static-layout.htm +++ b/TechStacks/src/static/static-layout.htm @@ -268,10 +268,11 @@
Stacks
Technologies
-
-
Favorites
{{#if auth}} + +
Favorites
+