8 Commits
2.0.1 ... 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
Sonny
efcb1d0ef9 chore: release v2.0.2 2024-07-06 03:28:11 +02:00
Sonny
8b9e74bfe1 fix: allow iframe 2024-07-06 03:27:07 +02:00
12 changed files with 9605 additions and 14412 deletions

View File

@@ -1,5 +1,5 @@
# node ace generate:key
APP_KEY=UfdS996001I_koCN1OiZiSh-DJZTyvGc
APP_KEY=soY8ZAtItT_fCkNUADfgffZUUo675lOj
TZ=UTC
PORT=3333
HOST=localhost
@@ -13,4 +13,4 @@ DB_PASSWORD=my-links-pwd
DB_DATABASE=my-links
GOOGLE_CLIENT_ID=
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 }}
labels: ${{ steps.docker_meta.outputs.labels }}
# execute_commands_via_ssh:
# name: Pull latest docker image and start up the application with Docker Compose
# runs-on: ubuntu-latest
# needs: push_image_to_docker_hub
# steps:
# - name: Executing remote ssh commands
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SSH_HOST }}
# port: ${{ secrets.SSH_PORT }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# script: |
# cd /infra/my-links
# sh startup.sh
execute_commands_via_ssh:
name: Pull latest docker image and start up the application with Docker Compose
runs-on: ubuntu-latest
needs: push_image_to_docker_hub
steps:
- name: Executing remote ssh commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
cd /infra/my-links
sh startup.sh

View File

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

View File

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

View File

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

View File

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

View File

@@ -27,8 +27,7 @@ const shieldConfig = defineConfig({
* iFrames
*/
xFrame: {
enabled: true,
action: 'DENY',
enabled: false,
},
/**

View File

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

View File

@@ -9,7 +9,6 @@ export default class extends BaseSeeder {
static environment = ['development', 'testing'];
async run() {
// eslint-disable-next-line unicorn/no-await-expression-member
const users = await getUserIds();
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",
"version": "2.0.1",
"version": "2.0.3",
"type": "module",
"license": "UNLICENSED",
"scripts": {
@@ -44,40 +44,39 @@
"@japa/assert": "^3.0.0",
"@japa/plugin-adonisjs": "^3.0.1",
"@japa/runner": "^3.1.4",
"@swc/core": "^1.5.24",
"@swc/core": "^1.6.13",
"@types/luxon": "^3.4.2",
"@types/node": "^20.13.0",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-select": "^5.0.1",
"@types/react-toggle": "^4.0.5",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@vitejs/plugin-react": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"hot-hook": "^0.2.6",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"pino-pretty": "^11.1.0",
"prettier": "^3.3.0",
"release-it": "^17.3.0",
"lint-staged": "^15.2.7",
"pino-pretty": "^11.2.1",
"prettier": "^3.3.2",
"release-it": "^17.4.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"vite": "^5.2.12"
"typescript": "~5.4.5",
"vite": "^5.3.3"
},
"dependencies": {
"@adonisjs/ally": "^5.0.2",
"@adonisjs/auth": "^9.2.1",
"@adonisjs/core": "^6.9.1",
"@adonisjs/auth": "^9.2.3",
"@adonisjs/core": "^6.12.1",
"@adonisjs/cors": "^2.2.1",
"@adonisjs/inertia": "^1.1.0",
"@adonisjs/lucid": "^20.6.0",
"@adonisjs/session": "^7.4.0",
"@adonisjs/lucid": "^21.1.0",
"@adonisjs/session": "^7.4.2",
"@adonisjs/shield": "^8.1.1",
"@adonisjs/static": "^1.1.1",
"@adonisjs/vite": "^3.0.0",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@inertiajs/react": "^1.1.0",
"@inertiajs/react": "^1.2.0",
"@izzyjs/route": "^1.1.0-0",
"@vinejs/vine": "^2.1.0",
"bentocache": "^1.0.0-beta.9",
@@ -88,7 +87,7 @@
"knex": "^3.1.0",
"luxon": "^3.4.4",
"node-html-parser": "^6.1.13",
"pg": "^8.11.5",
"pg": "^8.12.0",
"react": "^18.3.1",
"react-dnd": "^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