Skip to content

Commit

Permalink
Merge branch 'main' into global-styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobsters6666 authored Jun 22, 2024
2 parents 0ed7280 + a0e9540 commit 45747b1
Show file tree
Hide file tree
Showing 52 changed files with 1,007 additions and 668 deletions.
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.astro
.strapi
.tmp
dist
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": ["prettier-plugin-astro"],
"overrides": [
{
"files": "*.astro",
"options": {
"parser": "astro"
}
}
]
}
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.documentSelectors": ["**/*.astro"],
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modificationsIfAvailable",
"editor.codeActionsOnSave": {
"source.organizeImports": "always",
"source.fixAll": "always"
},
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
"files.trimTrailingWhitespace": true,
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"package.json": "*"
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# WDCC Website V3

https://github.com/UoaWDCC/wdcc-website-v3/wiki#getting-started
16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "wdcc-website-v3",
"version": "1.0.0",
"repository": "https://github.com/UoaWDCC/wdcc-website-v3.git",
"license": "MIT",
"scripts": {
"setup": "yarn && cd ./web && yarn && cd ../strapi && yarn",
"dev": "concurrently \"cd ./web && yarn dev\" \"cd ./strapi && yarn dev\"",
"lint": "prettier --write ."
},
"devDependencies": {
"concurrently": "^8.2.2",
"prettier": "3.3.2",
"prettier-plugin-astro": "^0.14.0"
}
}
10 changes: 5 additions & 5 deletions strapi/config/admin.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
export default ({ env }) => ({
auth: {
secret: env('ADMIN_JWT_SECRET'),
secret: env("ADMIN_JWT_SECRET"),
},
apiToken: {
salt: env('API_TOKEN_SALT'),
salt: env("API_TOKEN_SALT"),
},
transfer: {
token: {
salt: env('TRANSFER_TOKEN_SALT'),
salt: env("TRANSFER_TOKEN_SALT"),
},
},
flags: {
nps: env.bool('FLAG_NPS', true),
promoteEE: env.bool('FLAG_PROMOTE_EE', true),
nps: env.bool("FLAG_NPS", true),
promoteEE: env.bool("FLAG_PROMOTE_EE", true),
},
});
111 changes: 60 additions & 51 deletions strapi/config/database.ts
Original file line number Diff line number Diff line change
@@ -1,82 +1,91 @@
import path from 'path';
import path from "path";

export default ({ env }) => {
const client = env('DATABASE_CLIENT', 'sqlite');
const client = env("DATABASE_CLIENT", "sqlite");

const connections = {
mysql: {
connection: {
connectionString: env('DATABASE_URL'),
host: env('DATABASE_HOST', 'localhost'),
port: env.int('DATABASE_PORT', 3306),
database: env('DATABASE_NAME', 'strapi'),
user: env('DATABASE_USERNAME', 'strapi'),
password: env('DATABASE_PASSWORD', 'strapi'),
ssl: env.bool('DATABASE_SSL', false) && {
key: env('DATABASE_SSL_KEY', undefined),
cert: env('DATABASE_SSL_CERT', undefined),
ca: env('DATABASE_SSL_CA', undefined),
capath: env('DATABASE_SSL_CAPATH', undefined),
cipher: env('DATABASE_SSL_CIPHER', undefined),
connectionString: env("DATABASE_URL"),
host: env("DATABASE_HOST", "localhost"),
port: env.int("DATABASE_PORT", 3306),
database: env("DATABASE_NAME", "strapi"),
user: env("DATABASE_USERNAME", "strapi"),
password: env("DATABASE_PASSWORD", "strapi"),
ssl: env.bool("DATABASE_SSL", false) && {
key: env("DATABASE_SSL_KEY", undefined),
cert: env("DATABASE_SSL_CERT", undefined),
ca: env("DATABASE_SSL_CA", undefined),
capath: env("DATABASE_SSL_CAPATH", undefined),
cipher: env("DATABASE_SSL_CIPHER", undefined),
rejectUnauthorized: env.bool(
'DATABASE_SSL_REJECT_UNAUTHORIZED',
true
"DATABASE_SSL_REJECT_UNAUTHORIZED",
true,
),
},
},
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
pool: {
min: env.int("DATABASE_POOL_MIN", 2),
max: env.int("DATABASE_POOL_MAX", 10),
},
},
mysql2: {
connection: {
host: env('DATABASE_HOST', 'localhost'),
port: env.int('DATABASE_PORT', 3306),
database: env('DATABASE_NAME', 'strapi'),
user: env('DATABASE_USERNAME', 'strapi'),
password: env('DATABASE_PASSWORD', 'strapi'),
ssl: env.bool('DATABASE_SSL', false) && {
key: env('DATABASE_SSL_KEY', undefined),
cert: env('DATABASE_SSL_CERT', undefined),
ca: env('DATABASE_SSL_CA', undefined),
capath: env('DATABASE_SSL_CAPATH', undefined),
cipher: env('DATABASE_SSL_CIPHER', undefined),
host: env("DATABASE_HOST", "localhost"),
port: env.int("DATABASE_PORT", 3306),
database: env("DATABASE_NAME", "strapi"),
user: env("DATABASE_USERNAME", "strapi"),
password: env("DATABASE_PASSWORD", "strapi"),
ssl: env.bool("DATABASE_SSL", false) && {
key: env("DATABASE_SSL_KEY", undefined),
cert: env("DATABASE_SSL_CERT", undefined),
ca: env("DATABASE_SSL_CA", undefined),
capath: env("DATABASE_SSL_CAPATH", undefined),
cipher: env("DATABASE_SSL_CIPHER", undefined),
rejectUnauthorized: env.bool(
'DATABASE_SSL_REJECT_UNAUTHORIZED',
true
"DATABASE_SSL_REJECT_UNAUTHORIZED",
true,
),
},
},
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
pool: {
min: env.int("DATABASE_POOL_MIN", 2),
max: env.int("DATABASE_POOL_MAX", 10),
},
},
postgres: {
connection: {
connectionString: env('DATABASE_URL'),
host: env('DATABASE_HOST', 'localhost'),
port: env.int('DATABASE_PORT', 5432),
database: env('DATABASE_NAME', 'strapi'),
user: env('DATABASE_USERNAME', 'strapi'),
password: env('DATABASE_PASSWORD', 'strapi'),
ssl: env.bool('DATABASE_SSL', false) && {
key: env('DATABASE_SSL_KEY', undefined),
cert: env('DATABASE_SSL_CERT', undefined),
ca: env('DATABASE_SSL_CA', undefined),
capath: env('DATABASE_SSL_CAPATH', undefined),
cipher: env('DATABASE_SSL_CIPHER', undefined),
connectionString: env("DATABASE_URL"),
host: env("DATABASE_HOST", "localhost"),
port: env.int("DATABASE_PORT", 5432),
database: env("DATABASE_NAME", "strapi"),
user: env("DATABASE_USERNAME", "strapi"),
password: env("DATABASE_PASSWORD", "strapi"),
ssl: env.bool("DATABASE_SSL", false) && {
key: env("DATABASE_SSL_KEY", undefined),
cert: env("DATABASE_SSL_CERT", undefined),
ca: env("DATABASE_SSL_CA", undefined),
capath: env("DATABASE_SSL_CAPATH", undefined),
cipher: env("DATABASE_SSL_CIPHER", undefined),
rejectUnauthorized: env.bool(
'DATABASE_SSL_REJECT_UNAUTHORIZED',
true
"DATABASE_SSL_REJECT_UNAUTHORIZED",
true,
),
},
schema: env('DATABASE_SCHEMA', 'public'),
schema: env("DATABASE_SCHEMA", "public"),
},
pool: {
min: env.int("DATABASE_POOL_MIN", 2),
max: env.int("DATABASE_POOL_MAX", 10),
},
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
},
sqlite: {
connection: {
filename: path.join(
__dirname,
'..',
'..',
env('DATABASE_FILENAME', '.tmp/data.db')
"..",
"..",
env("DATABASE_FILENAME", ".tmp/data.db"),
),
},
useNullAsDefault: true,
Expand All @@ -87,7 +96,7 @@ export default ({ env }) => {
connection: {
client,
...connections[client],
acquireConnectionTimeout: env.int('DATABASE_CONNECTION_TIMEOUT', 60000),
acquireConnectionTimeout: env.int("DATABASE_CONNECTION_TIMEOUT", 60000),
},
};
};
48 changes: 24 additions & 24 deletions strapi/config/middlewares.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
export default ({env}) => [
'strapi::logger',
'strapi::errors',
'strapi::cors',
'strapi::poweredBy',
'strapi::query',
'strapi::body',
'strapi::session',
'strapi::favicon',
'strapi::public',
export default ({ env }) => [
"strapi::logger",
"strapi::errors",
"strapi::cors",
"strapi::poweredBy",
"strapi::query",
"strapi::body",
"strapi::session",
"strapi::favicon",
"strapi::public",
{
name: 'strapi::security',
name: "strapi::security",
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': [
"connect-src": ["'self'", "https:"],
"img-src": [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
`https://${env('BUCKET_NAME')}.fly.storage.tigris.dev`,
env('AWS_ENDPOINT_URL_S3'),
"data:",
"blob:",
"market-assets.strapi.io",
`https://${env("BUCKET_NAME")}.fly.storage.tigris.dev`,
env("AWS_ENDPOINT_URL_S3"),
],
'media-src': [
"media-src": [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
`https://${env('BUCKET_NAME')}.fly.storage.tigris.dev`,
env('AWS_ENDPOINT_URL_S3'),
"data:",
"blob:",
"market-assets.strapi.io",
`https://${env("BUCKET_NAME")}.fly.storage.tigris.dev`,
env("AWS_ENDPOINT_URL_S3"),
],
upgradeInsecureRequests: null,
},
Expand Down
8 changes: 4 additions & 4 deletions strapi/config/server.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
host: env("HOST", "0.0.0.0"),
port: env.int("PORT", 1337),
app: {
keys: env.array('APP_KEYS'),
keys: env.array("APP_KEYS"),
},
webhooks: {
populateRelations: env.bool('WEBHOOKS_POPULATE_RELATIONS', false),
populateRelations: env.bool("WEBHOOKS_POPULATE_RELATIONS", false),
},
});
2 changes: 1 addition & 1 deletion strapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.1.0",
"description": "A Strapi application",
"scripts": {
"develop": "strapi develop",
"dev": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi"
Expand Down
12 changes: 2 additions & 10 deletions strapi/src/admin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"extends": "@strapi/typescript-utils/tsconfigs/admin",
"include": [
"../plugins/**/admin/src/**/*",
"./"
],
"exclude": [
"node_modules/",
"build/",
"dist/",
"**/*.test.ts"
]
"include": ["../plugins/**/admin/src/**/*", "./"],
"exclude": ["node_modules/", "build/", "dist/", "**/*.test.ts"]
}
2 changes: 1 addition & 1 deletion strapi/src/admin/webpack.config.example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
"use strict";

/* eslint-disable no-unused-vars */
module.exports = (config, webpack) => {
Expand Down
Loading

0 comments on commit 45747b1

Please sign in to comment.