Skip to content

Commit

Permalink
chore: release v0.4.4 (#158)
Browse files Browse the repository at this point in the history
* chore: release v0.4.1-hotfix.3

* fix(data-migration): early return if no categories have parents (#128)

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* Closes #130 (#131)

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* fix(database): use dynamic path for SQLite database file

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* docs(readme): use single README file for latest/preview version

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* feat(ci): add manual deployment workflow and adjust tag conditions

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* refactor(workflow): simplify manual-deploy GitHub Action

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* fix(metadata): handle multiple image URLs in mainImageUrl field

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* fix: auth error handling (#144)

* refactor(api): migrate Swagger UI to external documentation and enhance health endpoint

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* chore: release v0.4.3

* fix(docker): resolve issue with data directory permissions (#150)

* Fix issue #153: creation/update of root categories (#157)

* chore: release v0.4.3 (#149)

* chore: release v0.4.1-hotfix.3

* fix(data-migration): early return if no categories have parents (#128)

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* Closes #130 (#131)

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* fix(database): use dynamic path for SQLite database file

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* docs(readme): use single README file for latest/preview version

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* feat(ci): add manual deployment workflow and adjust tag conditions

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* refactor(workflow): simplify manual-deploy GitHub Action

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* fix(metadata): handle multiple image URLs in mainImageUrl field

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* fix: auth error handling (#144)

* refactor(api): migrate Swagger UI to external documentation and enhance health endpoint

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* chore: release v0.4.3

---------

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>
Co-authored-by: Prabhanjan <zetabytes.pp@gmail.com>

* Fix creation/update of root categories

---------

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>
Co-authored-by: Robert Goniszewski <43510122+goniszewski@users.noreply.github.com>
Co-authored-by: Prabhanjan <zetabytes.pp@gmail.com>

* Fix issue #145: bookmarks without images (#156)

* chore: release v0.4.3 (#149)

* chore: release v0.4.1-hotfix.3

* fix(data-migration): early return if no categories have parents (#128)

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* Closes #130 (#131)

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* fix(database): use dynamic path for SQLite database file

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* docs(readme): use single README file for latest/preview version

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* feat(ci): add manual deployment workflow and adjust tag conditions

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* refactor(workflow): simplify manual-deploy GitHub Action

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* fix(metadata): handle multiple image URLs in mainImageUrl field

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* fix: auth error handling (#144)

* refactor(api): migrate Swagger UI to external documentation and enhance health endpoint

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>

* chore: release v0.4.3

---------

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>
Co-authored-by: Prabhanjan <zetabytes.pp@gmail.com>

* Fix bookmark creation/update without image

---------

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>
Co-authored-by: Robert Goniszewski <43510122+goniszewski@users.noreply.github.com>
Co-authored-by: Prabhanjan <zetabytes.pp@gmail.com>

* chore: release v0.4.4

---------

Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>
Co-authored-by: Prabhanjan <zetabytes.pp@gmail.com>
Co-authored-by: Guillaume Poussel <gpoussel@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 9, 2024
1 parent a7ccb95 commit df7971a
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 34 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y python3 python3-pip wget build-essentia
bun i -g svelte-kit@latest

RUN adduser --disabled-password --gecos '' grimoire
RUN mkdir -p /app/data && chown -R grimoire:grimoire /app/data && chmod 755 /app/data
RUN mkdir -p /app/data && chown -R grimoire:grimoire /app/data && chmod 766 /app/data
WORKDIR /app

FROM base AS dependencies
Expand All @@ -35,6 +35,7 @@ COPY --from=build /app/build ./build
COPY --from=build /app/migrations ./migrations
COPY --from=build /app/migrate.js ./migrate.js
COPY --from=build /app/package.json ./package.json
COPY docker-entrypoint.sh /
ENV NODE_ENV=production \
PUBLIC_ORIGIN=${PUBLIC_ORIGIN:-http://localhost:5173} \
ORIGIN=${PUBLIC_ORIGIN:-http://localhost:5173} \
Expand All @@ -43,8 +44,9 @@ ENV NODE_ENV=production \
PUBLIC_SIGNUP_DISABLED=${PUBLIC_SIGNUP_DISABLED:-false} \
BODY_SIZE_LIMIT=${BODY_SIZE_LIMIT:-5000000}

RUN chmod +x /docker-entrypoint.sh
USER grimoire
EXPOSE ${PORT}
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:$PORT/api/health || exit 1
ENTRYPOINT ["sh", "-c", "bun --bun run run-migrations && bun ./build/index.js"]
ENTRYPOINT ["/docker-entrypoint.sh"]
4 changes: 4 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
chown -R grimoire:grimoire /app/data
chmod 755 /app/data
bun --bun run run-migrations && bun ./build/index.js
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grimoire",
"version": "0.4.3",
"version": "0.4.4",
"description": "Bookmark manager for the wizards 🧙",
"author": "Robert Goniszewski <robert@goniszewski.com>",
"main": "./build/index.js",
Expand Down
13 changes: 6 additions & 7 deletions src/lib/components/AddCategoryForm/AddCategoryForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@
let form: HTMLFormElement;
export let closeModal: () => void;
const categoriesOptions = writable<{ value: string; label: string }[]>([
const categoriesOptions = writable<{ value: string | null; label: string }[]>([
{
value: 'null',
value: null,
label: 'No parent'
}
]);
$: {
$categoriesOptions = [
{
value: 'null',
value: null,
label: 'No parent'
},
...$page.data.categories
.filter((c) => {
return c.id !== $category.id;
})
.map((c) => ({
value: c.id,
value: c.id.toString(),
label: c.name
}))
];
Expand Down Expand Up @@ -224,13 +224,12 @@
name="parent"
searchable
placeholder="Select parent category..."
required
value={$category.parent?.id || $categoriesOptions[0].value}
value={$category.parent?.id?.toString() || $categoriesOptions[0].value}
items={$categoriesOptions}
class="this-select input input-bordered w-max"
on:change={(event) => {
// @ts-ignore-next-line
$category.parent = $page.data.categories.find((c) => c.id === event.detail.value);
$category.parent = $page.data.categories.find((c) => c.id.toString() === event.detail.value);
}}
/>
</div>
Expand Down
13 changes: 6 additions & 7 deletions src/lib/components/EditCategoryForm/EditCategoryForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@
let form: HTMLFormElement;
export let closeModal: () => void;
const categoriesOptions = writable<{ value: number; label: string }[]>([
const categoriesOptions = writable<{ value: string | null; label: string }[]>([
{
value: 0,
value: null,
label: 'No parent'
}
]);
$: {
$categoriesOptions = [
{
value: 0,
value: null,
label: 'No parent'
},
...$page.data.categories
.filter((c) => {
return c.id !== $category.id;
})
.map((c) => ({
value: c.id,
value: c.id.toString(),
label: c.name
}))
];
Expand Down Expand Up @@ -214,13 +214,12 @@
name="parent"
searchable
placeholder="Select parent category..."
required
value={$category.parent?.id || $categoriesOptions[0].value}
value={$category.parent?.id?.toString() || $categoriesOptions[0].value}
items={$categoriesOptions}
class="this-select input input-bordered w-max"
on:change={(event) => {
// @ts-ignore-next-line
$category.parent = $page.data.categories.find((c) => c.id === event.detail.value);
$category.parent = $page.data.categories.find((c) => c.id.toString() === event.detail.value);
}}
/>
</div>
Expand Down
35 changes: 18 additions & 17 deletions src/routes/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,15 @@ export const actions = {
error: 'Failed to add bookmark'
};
}
const { id: mainImageId } = await storage.storeImage(
mainImageUrl,
title,
ownerId,
bookmark.id
);
const { id: iconId } = await storage.storeImage(iconUrl, title, ownerId, bookmark.id);
const mainImage = mainImageUrl
? await storage.storeImage(mainImageUrl, title, ownerId, bookmark.id)
: undefined;
const icon = iconUrl
? await storage.storeImage(iconUrl, title, ownerId, bookmark.id)
: undefined;
const updatedBookmark = await updateBookmark(bookmark.id, ownerId, {
mainImageId,
iconId
...(mainImage ? { mainImageId: mainImage.id } : {}),
...(icon ? { iconId: icon.id } : {})
});

await upsertTagsForBookmark(bookmark.id, ownerId, tagNames);
Expand Down Expand Up @@ -149,8 +148,10 @@ export const actions = {

const tagNames = tags.map((tag: any) => tag.label);

const { id: mainImageId } = await storage.storeImage(mainImageUrl, title, ownerId, id);
const { id: iconId } = await storage.storeImage(iconUrl, title, ownerId, id);
const mainImage = mainImageUrl
? await storage.storeImage(mainImageUrl, title, ownerId, id)
: undefined;
const icon = iconUrl ? await storage.storeImage(iconUrl, title, ownerId, id) : undefined;

const bookmarkData = {
author,
Expand All @@ -169,8 +170,8 @@ export const actions = {
title,
url,
read,
...(mainImageId ? { mainImageId } : {}),
...(iconId ? { iconId } : {})
...(mainImage ? { mainImageId: mainImage.id } : {}),
...(icon ? { iconId: icon.id } : {})
};

const bookmark = await updateBookmark(id, ownerId, bookmarkData);
Expand Down Expand Up @@ -290,7 +291,7 @@ export const actions = {
const description = data.get('description') as string;
const icon = data.get('icon') as string;
const color = data.get('color') as string;
const parent = JSON.parse(data.get('parent') as string);
const parent = data.get('parent') ? JSON.parse(data.get('parent') as string) : null;
const parentValue = parent?.value ? parent.value : parent;
const archived = data.get('archived') === 'on' ? new Date() : null;
const setPublic = data.get('public') === 'on' ? new Date() : null;
Expand All @@ -301,7 +302,7 @@ export const actions = {
description,
icon,
color,
parentId: parentValue === 'null' ? null : parentValue,
parentId: parentValue,
archived,
public: setPublic,
ownerId,
Expand Down Expand Up @@ -332,7 +333,7 @@ export const actions = {
const description = data.get('description') as string;
const icon = data.get('icon') as string;
const color = data.get('color') as string;
const parent = JSON.parse(data.get('parent') as string);
const parent = data.get('parent') ? JSON.parse(data.get('parent') as string) : null;
const parentValue = parent?.value ? parent.value : parent;
const archived = data.get('archived') === 'on' ? new Date() : null;
const setPublic = data.get('public') === 'on' ? new Date() : null;
Expand All @@ -343,7 +344,7 @@ export const actions = {
description,
icon,
color,
parentId: parentValue === 'null' ? null : parentValue,
parentId: parentValue,
archived,
public: setPublic
};
Expand Down

0 comments on commit df7971a

Please sign in to comment.