6 Commits
2.0.2 ... 2.0.3

Author SHA1 Message Date
Sonny
2c499a7789 chore: release v2.0.3 2024-07-07 20:27:31 +02:00
Sonny
5baa9e1c35 fix: seed file warnings 2024-07-07 20:27:19 +02:00
Sonny
fd896db872 chore: switch to pnpm 2024-07-07 20:23:26 +02:00
Sonny
a45d534fa0 chore(deps): update deps and remove deprecated package 2024-07-07 20:21:12 +02:00
Sonny
5d083327a8 fix: (temp) disable xframe check and set same-site cookie to none 2024-07-07 19:59:17 +02:00
Sonny
136fcfac5d ci: (re)enable deployment step 2024-07-07 14:52:06 +02:00
12 changed files with 9605 additions and 14413 deletions

View File

@@ -1,5 +1,5 @@
# node ace generate:key # node ace generate:key
APP_KEY=UfdS996001I_koCN1OiZiSh-DJZTyvGc APP_KEY=soY8ZAtItT_fCkNUADfgffZUUo675lOj
TZ=UTC TZ=UTC
PORT=3333 PORT=3333
HOST=localhost HOST=localhost
@@ -13,4 +13,4 @@ DB_PASSWORD=my-links-pwd
DB_DATABASE=my-links DB_DATABASE=my-links
GOOGLE_CLIENT_ID= GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET= GOOGLE_CLIENT_SECRET=
GOOGLE_CLIENT_CALLBACK_URL=http://localhost:3333/auth/callback GOOGLE_CLIENT_CALLBACK_URL=http://localhost:3333/auth/callback

View File

@@ -36,18 +36,18 @@ jobs:
tags: ${{ steps.docker_meta.outputs.tags }} tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }} labels: ${{ steps.docker_meta.outputs.labels }}
# execute_commands_via_ssh: execute_commands_via_ssh:
# name: Pull latest docker image and start up the application with Docker Compose name: Pull latest docker image and start up the application with Docker Compose
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# needs: push_image_to_docker_hub needs: push_image_to_docker_hub
# steps: steps:
# - name: Executing remote ssh commands - name: Executing remote ssh commands
# uses: appleboy/ssh-action@master uses: appleboy/ssh-action@master
# with: with:
# host: ${{ secrets.SSH_HOST }} host: ${{ secrets.SSH_HOST }}
# port: ${{ secrets.SSH_PORT }} port: ${{ secrets.SSH_PORT }}
# username: ${{ secrets.SSH_USERNAME }} username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
# script: | script: |
# cd /infra/my-links cd /infra/my-links
# sh startup.sh sh startup.sh

View File

@@ -8,14 +8,14 @@ RUN corepack enable
# All deps stage # All deps stage
FROM base AS deps FROM base AS deps
WORKDIR /app WORKDIR /app
ADD package.json package-lock.json ./ ADD package.json pnpm-lock.yaml ./
RUN npm install --ignore-scripts RUN pnpm install --ignore-scripts
# Production only deps stage # Production only deps stage
FROM base AS production-deps FROM base AS production-deps
WORKDIR /app WORKDIR /app
ADD package.json package-lock.json ./ ADD package.json pnpm-lock.yaml ./
RUN npm install --ignore-scripts RUN pnpm install --ignore-scripts
# Build stage # Build stage
FROM base AS build FROM base AS build

View File

@@ -1,19 +1,19 @@
dev: dev:
docker compose down @docker compose down
docker compose -f dev.docker-compose.yml up -d --wait @docker compose -f dev.docker-compose.yml up -d --wait
node ace migration:fresh @node ace migration:fresh
npm run dev @pnpm run dev
prod: prod:
docker compose -f dev.docker-compose.yml down @docker compose -f dev.docker-compose.yml down
docker compose up -d --build --wait @docker compose up -d --build --wait
seed: seed:
node ace db:seed @node ace db:seed
down: down:
-docker compose down @-docker compose down
-docker compose -f dev.docker-compose.yml down @-docker compose -f dev.docker-compose.yml down
release: release:
npm run release @pnpm run release

View File

@@ -19,13 +19,13 @@ cp example.env .env
make dev make dev
``` ```
### NPM ### PNPM
```shell ```shell
# reset database and (force) apply all migrations # reset database and (force) apply all migrations
node ace migration:fresh node ace migration:fresh
# start dev server # start dev server
npm run dev pnpm run dev
``` ```
## Start as prod ## Start as prod
@@ -36,17 +36,17 @@ npm run dev
make prod make prod
``` ```
### NPM ### PNPM
```shell ```shell
# create production build # create production build
npm run build pnpm run build
# go to the build folder # go to the build folder
cd build cd build
# clone your .env # clone your .env
cp ../.env . cp ../.env .
# then start the production build # then start the production build
npm run start pnpm run start
``` ```
## Generate app_key ## Generate app_key

View File

@@ -1,5 +1,4 @@
import env from '#start/env'; import env from '#start/env';
import app from '@adonisjs/core/services/app';
import { defineConfig, stores } from '@adonisjs/session'; import { defineConfig, stores } from '@adonisjs/session';
const sessionConfig = defineConfig({ const sessionConfig = defineConfig({
@@ -16,7 +15,7 @@ const sessionConfig = defineConfig({
* Define how long to keep the session data alive without * Define how long to keep the session data alive without
* any activity. * any activity.
*/ */
age: '2h', age: '7d',
/** /**
* Configuration for session cookie and the * Configuration for session cookie and the
@@ -25,8 +24,10 @@ const sessionConfig = defineConfig({
cookie: { cookie: {
path: '/', path: '/',
httpOnly: true, httpOnly: true,
secure: app.inProduction, secure: true,
sameSite: 'lax',
// TODO: set this to lax and found a solution to keep auth when using extension
sameSite: 'none',
}, },
/** /**

View File

@@ -27,9 +27,7 @@ const shieldConfig = defineConfig({
* iFrames * iFrames
*/ */
xFrame: { xFrame: {
enabled: true, enabled: false,
action: 'ALLOW-FROM',
domain: '*',
}, },
/** /**

View File

@@ -8,7 +8,6 @@ export default class extends BaseSeeder {
static environment = ['development', 'testing']; static environment = ['development', 'testing'];
async run() { async run() {
// eslint-disable-next-line unicorn/no-await-expression-member
const users = await getUserIds(); const users = await getUserIds();
const collections = faker.helpers.multiple( const collections = faker.helpers.multiple(
@@ -26,14 +25,16 @@ export async function getUserIds() {
return users.map(({ id }) => id); return users.map(({ id }) => id);
} }
let collectionId = 0;
function createRandomCollection(userIds: User['id'][]) { function createRandomCollection(userIds: User['id'][]) {
const authorId = faker.helpers.arrayElements(userIds, 1).at(0); const authorId = faker.helpers.arrayElements(userIds, 1).at(0);
collectionId++;
return { return {
id: faker.string.uuid(), id: collectionId,
name: faker.string.alphanumeric({ length: { min: 5, max: 25 } }), name: faker.string.alphanumeric({ length: { min: 5, max: 25 } }),
description: faker.string.alphanumeric({ length: { min: 0, max: 254 } }), description: faker.string.alphanumeric({ length: { min: 0, max: 254 } }),
visibility: Visibility.PRIVATE, visibility: Visibility.PRIVATE,
nextId: undefined, nextId: collectionId + 1,
authorId, authorId,
}; };
} }

View File

@@ -9,7 +9,6 @@ export default class extends BaseSeeder {
static environment = ['development', 'testing']; static environment = ['development', 'testing'];
async run() { async run() {
// eslint-disable-next-line unicorn/no-await-expression-member
const users = await getUserIds(); const users = await getUserIds();
const links = await Promise.all( const links = await Promise.all(

14348
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "my-links", "name": "my-links",
"version": "2.0.2", "version": "2.0.3",
"type": "module", "type": "module",
"license": "UNLICENSED", "license": "UNLICENSED",
"scripts": { "scripts": {
@@ -44,40 +44,39 @@
"@japa/assert": "^3.0.0", "@japa/assert": "^3.0.0",
"@japa/plugin-adonisjs": "^3.0.1", "@japa/plugin-adonisjs": "^3.0.1",
"@japa/runner": "^3.1.4", "@japa/runner": "^3.1.4",
"@swc/core": "^1.5.24", "@swc/core": "^1.6.13",
"@types/luxon": "^3.4.2", "@types/luxon": "^3.4.2",
"@types/node": "^20.13.0", "@types/node": "^20.14.10",
"@types/react": "^18.3.3", "@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0", "@types/react-dom": "^18.3.0",
"@types/react-select": "^5.0.1",
"@types/react-toggle": "^4.0.5", "@types/react-toggle": "^4.0.5",
"@typescript-eslint/eslint-plugin": "^7.11.0", "@typescript-eslint/eslint-plugin": "^7.15.0",
"@vitejs/plugin-react": "^4.3.0", "@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"hot-hook": "^0.2.6", "hot-hook": "^0.2.6",
"husky": "^9.0.11", "husky": "^9.0.11",
"lint-staged": "^15.2.5", "lint-staged": "^15.2.7",
"pino-pretty": "^11.1.0", "pino-pretty": "^11.2.1",
"prettier": "^3.3.0", "prettier": "^3.3.2",
"release-it": "^17.3.0", "release-it": "^17.4.1",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "^5.4.5", "typescript": "~5.4.5",
"vite": "^5.2.12" "vite": "^5.3.3"
}, },
"dependencies": { "dependencies": {
"@adonisjs/ally": "^5.0.2", "@adonisjs/ally": "^5.0.2",
"@adonisjs/auth": "^9.2.1", "@adonisjs/auth": "^9.2.3",
"@adonisjs/core": "^6.9.1", "@adonisjs/core": "^6.12.1",
"@adonisjs/cors": "^2.2.1", "@adonisjs/cors": "^2.2.1",
"@adonisjs/inertia": "^1.1.0", "@adonisjs/inertia": "^1.1.0",
"@adonisjs/lucid": "^20.6.0", "@adonisjs/lucid": "^21.1.0",
"@adonisjs/session": "^7.4.0", "@adonisjs/session": "^7.4.2",
"@adonisjs/shield": "^8.1.1", "@adonisjs/shield": "^8.1.1",
"@adonisjs/static": "^1.1.1", "@adonisjs/static": "^1.1.1",
"@adonisjs/vite": "^3.0.0", "@adonisjs/vite": "^3.0.0",
"@emotion/react": "^11.11.4", "@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5", "@emotion/styled": "^11.11.5",
"@inertiajs/react": "^1.1.0", "@inertiajs/react": "^1.2.0",
"@izzyjs/route": "^1.1.0-0", "@izzyjs/route": "^1.1.0-0",
"@vinejs/vine": "^2.1.0", "@vinejs/vine": "^2.1.0",
"bentocache": "^1.0.0-beta.9", "bentocache": "^1.0.0-beta.9",
@@ -88,7 +87,7 @@
"knex": "^3.1.0", "knex": "^3.1.0",
"luxon": "^3.4.4", "luxon": "^3.4.4",
"node-html-parser": "^6.1.13", "node-html-parser": "^6.1.13",
"pg": "^8.11.5", "pg": "^8.12.0",
"react": "^18.3.1", "react": "^18.3.1",
"react-dnd": "^16.0.1", "react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1", "react-dnd-html5-backend": "^16.0.1",

9542
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff