forked from tsg-ut/ctfd-theme-tsgctf
-
Notifications
You must be signed in to change notification settings - Fork 2
/
nuxt.config.js
143 lines (126 loc) · 3.06 KB
/
nuxt.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import axios from 'axios';
import {createProxyMiddleware} from 'http-proxy-middleware';
const proxy = createProxyMiddleware({
target: 'http://localhost:8000',
});
const isStatic = process.env.NUXT_ENV_STATIC === 'true';
const staticBase = (process.env.NODE_ENV === 'development' || isStatic) ? '' : '/themes/pbctf/static';
export default {
ssr: isStatic,
head: {
title: 'Blue Water CTF',
meta: [
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
{
name: 'description',
hid: 'description',
content: "Blue Water CTF is a capture the flag event organized by Blue Water.",
},
{name: 'apple-mobile-web-app-title', content: 'Blue Water CTF'},
{name: 'og:title', content: 'Blue Water CTF'},
{name: 'og:site_name', content: 'Blue Water CTF'},
{name: 'og:description', content: "Blue Water CTF is a capture the flag event organized by Blue Water"},
{name: 'og:type', content: 'website'},
{name: 'og:url', content: 'https://bw.ctf.ing'},
{name: 'og:image', content: `${staticBase}/ogimage.png`},
{name: 'twitter:card', content: 'summary'},
{name: 'twitter:site', content: '@pb_ctf'},
{name: 'twitter:title', content: 'Blue Water CTF'},
{
name: 'twitter:description',
content: "Blue Water CTF is a capture the flag event organized by Blue Water",
},
{name: 'twitter:image', content: `${staticBase}/ogimage.jpg`},
{name: 'twitter:image:alt', content: 'Blue Water CTF'},
],
link: [{rel: 'icon', type: 'image/png', href: `${staticBase}/icon.png`}],
},
loading: {color: '#fff'},
css: [],
plugins: ['~/plugins/axios', '~/plugins/vue-timeago', '~/plugins/inject-is-static'],
modules: [
...(isStatic ? [] : [
'nuxt-client-init-module',
]),
'@nuxtjs/axios',
'@nuxtjs/markdownit',
'@nuxtjs/pwa',
// ...(isStatic ? [] : [
// '@nuxtjs/onesignal',
// ]),
],
generate: {
fallback: '404.html',
routes: async () => {
if (!isStatic) {
return [];
}
const {data} = await axios.get('https://bw.ctf.ing/api/v1/teams');
return data.data.map(({id}) => `/teams/${id}`);
},
concurrency: 5,
},
axios: {
baseURL: 'https://bw.ctf.ing/',
browserBaseURL: '/',
},
// oneSignal: {
// init: {
// appId: '37f6f0f0-e195-43ba-9fc8-d08702e11484', // public token
// allowLocalhostAsSecureOrigin: true,
// },
// },
markdownit: {
html: true,
injected: true,
},
build: {
postcss: {
plugins: {
precss: {},
'postcss-import-url': {},
},
preset: {
features: {
customProperties: false,
},
},
},
publicPath: `${staticBase}/_nuxt/`,
},
router: {},
serverMiddleware: [
...(process.env.NODE_ENV === 'development'
? [
{
path: '/api',
handler: proxy,
},
{
path: '/login',
handler: proxy,
},
{
path: '/logout',
handler: proxy,
},
{
path: '/register',
handler: proxy,
},
{
path: '/teams/join',
handler: proxy,
},
{
path: '/teams/new',
handler: proxy,
},
]
: []),
],
env: {
session: process.env.SESSION || '',
},
};