enhancements for footer version with prod support
This commit is contained in:
parent
4c1f0af41b
commit
3de8df5ab5
|
@ -43,9 +43,6 @@ LND_CONNECT_ADDRESS=03cc1d0932bb99b0697f5b5e5961b83ab7fd66f1efc4c9f5c7bad66c1bcb
|
|||
NEXTAUTH_SECRET=3_0W_PhDRZVanbeJsZZGIEljexkKoGbL6qGIqSwTjjI
|
||||
JWT_SIGNING_PRIVATE_KEY={"kty":"oct","kid":"FvD__hmeKoKHu2fKjUrWbRKfhjimIM4IKshyrJG4KSM","alg":"HS512","k":"3_0W_PhDRZVanbeJsZZGIEljexkKoGbL6qGIqSwTjjI"}
|
||||
|
||||
# git version
|
||||
NEXT_PUBLIC_COMMIT_HASH=0de1343
|
||||
|
||||
# prisma db url
|
||||
DATABASE_URL="postgresql://sn:password@db:5432/stackernews?schema=public"
|
||||
|
||||
|
|
|
@ -320,7 +320,10 @@ export default function Footer ({ noLinks }) {
|
|||
</Link>
|
||||
</span>
|
||||
</small>
|
||||
<div className="version">version <a href={`https://github.com/stackernews/stacker.news/commit/${version}`}>{version}</a></div>
|
||||
{version &&
|
||||
<div className={styles.version}>
|
||||
running <a className='text-reset' href={`https://github.com/stackernews/stacker.news/commit/${version}`}>{version}</a>
|
||||
</div>}
|
||||
</Container>
|
||||
</footer>
|
||||
)
|
||||
|
|
|
@ -18,4 +18,11 @@
|
|||
}
|
||||
.contrastLink svg {
|
||||
fill: var(--theme-color);
|
||||
}
|
||||
|
||||
.version {
|
||||
margin: auto;
|
||||
font-size: 75%;
|
||||
margin-top: .15rem;
|
||||
color: var(--theme-grey) !important;
|
||||
}
|
|
@ -13,24 +13,24 @@ const corsHeaders = [
|
|||
}
|
||||
]
|
||||
|
||||
const commitHash = isProd
|
||||
? require('fs').readFileSync('version.txt', 'utf8').slice(0, 7)
|
||||
: require('child_process').execSync('git rev-parse HEAD').toString().slice(0, 7)
|
||||
|
||||
module.exports = withPWA({
|
||||
dest: 'public',
|
||||
register: true,
|
||||
customWorkerDir: 'sw'
|
||||
})(
|
||||
withPlausibleProxy()({
|
||||
env: {
|
||||
NEXT_PUBLIC_COMMIT_HASH: commitHash
|
||||
},
|
||||
compress: false,
|
||||
experimental: {
|
||||
scrollRestoration: true
|
||||
},
|
||||
generateBuildId: process.env.NODE_ENV === 'development'
|
||||
? undefined
|
||||
: async () => {
|
||||
// use the app version which eb doesn't otherwise give us
|
||||
// as the build id
|
||||
const { RuntimeSources } = require('/opt/elasticbeanstalk/deployment/app_version_manifest.json') // eslint-disable-line
|
||||
return Object.keys(RuntimeSources['stacker.news'])[0]
|
||||
},
|
||||
generateBuildId: isProd ? commitHash : undefined,
|
||||
// Use the CDN in production and localhost for development.
|
||||
assetPrefix: isProd ? 'https://a.stacker.news' : undefined,
|
||||
async headers () {
|
||||
|
|
|
@ -630,10 +630,4 @@ div[contenteditable]:focus,
|
|||
.popover-header {
|
||||
color: #212529;
|
||||
}
|
||||
}
|
||||
|
||||
.version {
|
||||
margin: auto;
|
||||
font-size: x-small;
|
||||
color: var(--theme-grey) !important;
|
||||
}
|
Loading…
Reference in New Issue