Skip to content

Commit

Permalink
Add Support For Docker Volumes
Browse files Browse the repository at this point in the history
* Restructure customization files into data folder

* Remove theme list, add docker mode check for settings

* Add fs setting load for docker

* Add .env variable for checking is docker built or not

* Fix Docker env variable override

* Rename volume name into project name

* Remove RWX permissions from data folder

* Refactor theme list and theme read

* Allow custom favicon, Add theme name to fetch

* Move themes folder outside data folder

* Bump docker compose version to 3.8

* Update Dockerfile job name

* Simplify theme colors

* Update Dockerfile with data chown

* Update terminal opacity and blur handling

* Update yarn docker build command to consider volume

* Improve meta icon handling

* Improve docker data handling for bind mounts

* Update asset paths in settings

* Update contributing guideline
  • Loading branch information
excalith authored Jan 9, 2024
1 parent f406aa9 commit de45a26
Show file tree
Hide file tree
Showing 49 changed files with 984 additions and 481 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BUILD_MODE=local
21 changes: 11 additions & 10 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To report a new issue, please follow these steps:
- Provide your **OS** and **Browser** information.
- Add any **additional Context** about the problem here such as console logs and screenshots. If you do not know how to get the console logs, please check your browser's documentation on how to get the console logs. If you cannot find the console logs, please mention that in the issue so that maintainers can help you get the logs.

> **Note**
> [!NOTE]
> If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
### Feature Requests
Expand All @@ -52,29 +52,30 @@ If maintainers approve your suggestion, the discussion will be converted to an i
In order to contribute to the source of the project

1. Fork the repository and create a new branch for your feature or enhancement `kebab-case` for the branch name.
- For new documents, please use the `theme-theme-name` as the branch name.
- For new theme, please use the `theme-theme-name` as the branch name.
- For features or enhancements, please use the `feat-feat-name` as the branch name.
- For fixes, please use the `fix-issue-name` as the branch name.
2. Use [commit messages](#commit-messages) guideline for your commits.
3. Send a pull request to the `main` branch using the [pull request](#pull-requests) guideline.

> **Warning**
> [!IMPORTANT]
> Please **do not** change design into a complicated and / or overwhelming experience. It should launch fast, be easy to use and not distract from the functionality.
### New Themes

I really appreciate contributions in the form of new themes to the project. If you'd like to add a new theme, please follow these steps:

1. Create a new `json` file in the `public/themes` folder using the theme name as the file name. Please use `kebab-case` for the file name. You can use the default theme file as a starting point.
2. Add the theme name to the array in the `src/utils/themes.js` file. Please use the same name as the file and use alphabetical order.
3. Test your theme by running the project locally by running `yarn dev` command
1. Have a look at [Themes](https://github.com/excalith/excalith-start-page/wiki/Themes#theme-scheme) wiki page for the scheme you should use.
2. Head to `data/themes` folder
3. Create `themename-variant.json` file using lowercase (variant should have hypens before ie. `catppuccin-latte`)
4. Fill the theme structure with your own colors
5. Test in on local server using `yarn dev` command
1. Use `set theme` command to see your theme on the list
2. Use `set theme <theme-name>` to see your theme in action
6. Send a PR!

> **Warning**
> Since themes are stored in the local storage, you should run the `set theme <theme-name>` command to see your changes.
More information about themes can be found in the [Wiki Page](https://github.com/excalith/excalith-start-page/wiki/Themes).
> [!IMPORTANT]
> Since themes are stored in the local storage while running as a web app, you should run the `set theme <theme-name>` command to see your changes.
### New Features / Enhancements

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
push_to_registries:
name: Push Docker image to multiple registries
name: Push Docker image to GHCR and DockerHub registries
runs-on: ubuntu-latest
permissions:
packages: write
Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ RUN \
else echo "Lockfile not found." && exit 1; \
fi


# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# Set mode to Docker (for data fetching switches between docker and web)
ENV BUILD_MODE docker

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
Expand All @@ -34,19 +36,21 @@ RUN yarn build
FROM base AS runner
WORKDIR /app

# Set NODE_ENV to production
ENV NODE_ENV production


# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/data ./data

USER nextjs

Expand Down
File renamed without changes
Loading

1 comment on commit de45a26

@vercel
Copy link

@vercel vercel bot commented on de45a26 Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

start-page – ./

start-page-git-main-excalith.vercel.app
start-page-excalith.vercel.app
excalith-start-page.vercel.app

Please sign in to comment.