diff --git a/.all-contributorsrc b/.all-contributorsrc index b2242bc4..223de146 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -364,11 +364,38 @@ "contributions": [ "code" ] + }, + { + "login": "cchalop1", + "name": "CHALOPIN ClΓ©ment", + "avatar_url": "https://avatars.githubusercontent.com/u/28163855?v=4", + "profile": "http://cchalop1.com", + "contributions": [ + "code" + ] + }, + { + "login": "geetansh", + "name": "Geetansh Jindal", + "avatar_url": "https://avatars.githubusercontent.com/u/9976198?v=4", + "profile": "https://github.com/geetansh", + "contributions": [ + "code" + ] + }, + { + "login": "0livier", + "name": "Olivier Garcia", + "avatar_url": "https://avatars.githubusercontent.com/u/10607?v=4", + "profile": "https://github.com/0livier", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, "projectName": "runtipi", - "projectOwner": "meienberger", + "projectOwner": "runtipi", "repoType": "github", "repoHost": "https://github.com", "skipCi": true, diff --git a/.github/workflows/alpha-release.yml b/.github/workflows/alpha-release.yml index 6e5e6a24..61abfbc7 100644 --- a/.github/workflows/alpha-release.yml +++ b/.github/workflows/alpha-release.yml @@ -11,25 +11,24 @@ jobs: create-tag: runs-on: ubuntu-latest outputs: - tagname: ${{ steps.create_tag.outputs.tagname }} - + tagname: ${{ steps.get_tag.outputs.tagname }} steps: - name: Checkout code uses: actions/checkout@v4 - - name: Create Tag - id: create_tag - uses: butlerlogic/action-autotag@stable - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - with: - tag_prefix: 'v' - tag_suffix: '-alpha.${{ github.event.inputs.tag }}' + - name: Get tag from package.json + id: get_tag + run: | + VERSION=$(npm run version --silent) + echo "tagname=v${VERSION}-alpha.${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT - build-images: + - uses: rickstaa/action-create-tag@v1 + with: + tag: ${{ steps.get_tag.outputs.tagname }} + + build-worker: runs-on: ubuntu-latest needs: create-tag - steps: - name: Checkout code uses: actions/checkout@v4 @@ -51,7 +50,38 @@ jobs: uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64,linux/arm64 + file: ./packages/worker/Dockerfile + platforms: linux/amd64 + push: true + tags: ghcr.io/${{ github.repository_owner }}/worker:${{ needs.create-tag.outputs.tagname }} + cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/worker:buildcache + cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/worker:buildcache,mode=max + + build-images: + runs-on: ubuntu-latest + needs: create-tag + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push images + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64 push: true tags: ghcr.io/${{ github.repository_owner }}/runtipi:${{ needs.create-tag.outputs.tagname }} cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/runtipi:buildcache @@ -60,7 +90,6 @@ jobs: build-cli: runs-on: ubuntu-latest needs: create-tag - steps: - name: Checkout code uses: actions/checkout@v4 @@ -107,7 +136,7 @@ jobs: publish-release: runs-on: ubuntu-latest - needs: [create-tag, build-images, build-cli] + needs: [create-tag, build-images, build-cli, build-worker] steps: - name: Download CLI @@ -116,35 +145,21 @@ jobs: name: cli path: cli + - name: Rename CLI + run: | + mv cli/bin/cli-x64 ./runtipi-cli-linux-x64 + - name: Create alpha release id: create_release - uses: actions/create-release@v1 + uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: body: | **${{ needs.create-tag.outputs.tagname }}** tag_name: ${{ needs.create-tag.outputs.tagname }} - release_name: ${{ needs.create-tag.outputs.tagname }} + name: ${{ needs.create-tag.outputs.tagname }} draft: false prerelease: true - - - name: Upload X64 Linux CLI binary to release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: cli/bin/cli-x64 - asset_name: runtipi-cli-linux-x64 - asset_content_type: application/octet-stream - - - name: Upload ARM64 Linux CLI binary to release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: cli/bin/cli-arm64 - asset_name: runtipi-cli-linux-arm64 - asset_content_type: application/octet-stream + files: | + runtipi-cli-linux-x64 diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 745fd618..4b8d8cbe 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -8,27 +8,57 @@ on: required: true jobs: - get-tag: + create-tag: runs-on: ubuntu-latest outputs: - tag: ${{ steps.get_tag.outputs.tag }} + tagname: ${{ steps.get_tag.outputs.tagname }} steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Get tag from VERSION file + - name: Get tag from package.json id: get_tag run: | VERSION=$(npm run version --silent) - echo "tag=v${VERSION}-beta.${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT + echo "tagname=v${VERSION}-beta.${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT + + - uses: rickstaa/action-create-tag@v1 + with: + tag: ${{ steps.get_tag.outputs.tagname }} + + build-worker: + runs-on: ubuntu-latest + needs: create-tag + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push images + uses: docker/build-push-action@v5 + with: + context: . + file: ./packages/worker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/${{ github.repository_owner }}/worker:${{ needs.create-tag.outputs.tagname }} + cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/worker:buildcache + cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/worker:buildcache,mode=max build-images: - needs: get-tag + needs: create-tag runs-on: ubuntu-latest steps: - name: Checkout code @@ -53,13 +83,13 @@ jobs: context: . platforms: linux/amd64,linux/arm64 push: true - tags: ghcr.io/${{ github.repository_owner }}/runtipi:${{ needs.get-tag.outputs.tag }} + tags: ghcr.io/${{ github.repository_owner }}/runtipi:${{ needs.create-tag.outputs.tagname }} cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/runtipi:buildcache cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/runtipi:buildcache,mode=max build-cli: runs-on: ubuntu-latest - needs: get-tag + needs: create-tag steps: - name: Checkout code uses: actions/checkout@v4 @@ -93,7 +123,7 @@ jobs: run: pnpm install - name: Set version - run: pnpm -r --filter cli set-version ${{ needs.get-tag.outputs.tag }} + run: pnpm -r --filter cli set-version ${{ needs.create-tag.outputs.tagname }} - name: Build CLI run: pnpm -r --filter cli package @@ -104,28 +134,9 @@ jobs: name: cli path: packages/cli/dist - create-tag: - needs: [build-images, build-cli] - runs-on: ubuntu-latest - outputs: - tagname: ${{ steps.create_tag.outputs.tagname }} - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Create Tag - id: create_tag - uses: butlerlogic/action-autotag@stable - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - with: - tag_prefix: 'v' - tag_suffix: '-beta.${{ github.event.inputs.tag }}' - publish-release: runs-on: ubuntu-latest - needs: [create-tag, build-images, build-cli] + needs: [create-tag, build-images, build-cli, build-worker] outputs: id: ${{ steps.create_release.outputs.id }} steps: @@ -135,38 +146,26 @@ jobs: name: cli path: cli + - name: Rename CLI + run: | + mv cli/bin/cli-x64 ./runtipi-cli-linux-x64 + mv cli/bin/cli-arm64 ./runtipi-cli-linux-arm64 + - name: Create beta release id: create_release - uses: actions/create-release@v1 + uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: body: | **${{ needs.create-tag.outputs.tagname }}** tag_name: ${{ needs.create-tag.outputs.tagname }} - release_name: ${{ needs.create-tag.outputs.tagname }} + name: ${{ needs.create-tag.outputs.tagname }} draft: false prerelease: true - - - name: Upload X64 Linux CLI binary to release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: cli/bin/cli-x64 - asset_name: runtipi-cli-linux-x64 - asset_content_type: application/octet-stream - - - name: Upload ARM64 Linux CLI binary to release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: cli/bin/cli-arm64 - asset_name: runtipi-cli-linux-arm64 - asset_content_type: application/octet-stream + files: | + runtipi-cli-linux-x64 + runtipi-cli-linux-arm64 e2e-tests: needs: [create-tag, publish-release] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b32df657..fc81012f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: Tipi CI on: - push: + pull_request: env: ROOT_FOLDER: /runtipi diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index dc9d23d5..fea580bb 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -72,9 +72,6 @@ jobs: run: | while ! ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@${{ steps.get-droplet-ip.outputs.droplet_ip }} "echo 'SSH is ready'"; do sleep 5; done - - name: Wait 1 minute for Droplet to be ready - run: sleep 60 - - name: Create docker group on Droplet uses: fifsky/ssh-action@master with: @@ -85,6 +82,9 @@ jobs: user: root key: ${{ secrets.SSH_KEY }} + - name: Wait 90 seconds for Docker to be ready on Droplet + run: sleep 90 + - name: Deploy app to Droplet uses: fifsky/ssh-action@master with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0678947c..1a94fdef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,28 +3,28 @@ on: workflow_dispatch: jobs: - get-tag: + create-tag: runs-on: ubuntu-latest + needs: [build-images, build-cli] outputs: - tag: ${{ steps.get_tag.outputs.tag }} + tagname: ${{ steps.get_tag.outputs.tagname }} steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Get tag from VERSION file + - name: Get tag from package.json id: get_tag run: | VERSION=$(npm run version --silent) - echo "tag=v${VERSION}" >> $GITHUB_OUTPUT + echo "tagname=v${VERSION}" >> $GITHUB_OUTPUT + + - uses: rickstaa/action-create-tag@v1 + with: + tag: ${{ steps.get_tag.outputs.tagname }} build-images: if: github.repository == 'runtipi/runtipi' - needs: get-tag + needs: create-tag runs-on: ubuntu-latest steps: - name: Checkout @@ -49,14 +49,45 @@ jobs: context: . platforms: linux/amd64,linux/arm64 push: true - tags: ghcr.io/${{ github.repository_owner }}/runtipi:${{ needs.get-tag.outputs.tag }},ghcr.io/${{ github.repository_owner }}/runtipi:latest + tags: ghcr.io/${{ github.repository_owner }}/runtipi:${{ needs.create-tag.outputs.tagname }},ghcr.io/${{ github.repository_owner }}/runtipi:latest cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/runtipi:buildcache cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/runtipi:buildcache,mode=max + build-worker: + runs-on: ubuntu-latest + needs: create-tag + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push images + uses: docker/build-push-action@v5 + with: + context: . + file: ./packages/worker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/${{ github.repository_owner }}/worker:${{ needs.create-tag.outputs.tagname }},ghcr.io/${{ github.repository_owner }}/worker:latest + cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/worker:buildcache + cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/worker:buildcache,mode=max + build-cli: runs-on: ubuntu-latest timeout-minutes: 10 - needs: get-tag + needs: create-tag steps: - name: Checkout code uses: actions/checkout@v4 @@ -90,7 +121,7 @@ jobs: run: pnpm install - name: Set version - run: pnpm -r --filter cli set-version ${{ needs.get-tag.outputs.tag }} + run: pnpm -r --filter cli set-version ${{ needs.create-tag.outputs.tagname }} - name: Build CLI run: pnpm -r --filter cli package @@ -101,23 +132,6 @@ jobs: name: cli path: packages/cli/dist - create-tag: - runs-on: ubuntu-latest - needs: [build-images, build-cli] - outputs: - tagname: ${{ steps.create_tag.outputs.tagname }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Create Tag - id: create_tag - uses: butlerlogic/action-autotag@stable - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - with: - tag_prefix: 'v' - publish-release: runs-on: ubuntu-latest needs: [create-tag] @@ -130,38 +144,26 @@ jobs: name: cli path: cli + - name: Rename CLI + run: | + mv cli/bin/cli-x64 ./runtipi-cli-linux-x64 + mv cli/bin/cli-arm64 ./runtipi-cli-linux-arm64 + - name: Create release id: create_release - uses: actions/create-release@v1 + uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: body: | **${{ needs.create-tag.outputs.tagname }}** tag_name: ${{ needs.create-tag.outputs.tagname }} - release_name: ${{ needs.create-tag.outputs.tagname }} + name: ${{ needs.create-tag.outputs.tagname }} draft: false prerelease: true - - - name: Upload X64 Linux CLI binary to release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: cli/bin/cli-x64 - asset_name: runtipi-cli-linux-x64 - asset_content_type: application/octet-stream - - - name: Upload ARM64 Linux CLI binary to release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: cli/bin/cli-arm64 - asset_name: runtipi-cli-linux-arm64 - asset_content_type: application/octet-stream + files: | + runtipi-cli-linux-x64 + runtipi-cli-linux-arm64 e2e-tests: needs: [create-tag, publish-release] @@ -176,7 +178,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Promote release - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.gitignore b/.gitignore index a6501c9b..6765c17b 100644 --- a/.gitignore +++ b/.gitignore @@ -54,8 +54,7 @@ node_modules/ /data/ /repos/ /apps/ -traefik/shared -traefik/tls +/traefik/ # media folder media @@ -67,3 +66,4 @@ media temp ./traefik/ +/user-config/ diff --git a/Dockerfile b/Dockerfile index 6b7b9cc9..fcdbbd5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,8 @@ RUN npm run build FROM node_base AS app ENV NODE_ENV production -# USER node + +USER node WORKDIR /app diff --git a/README.md b/README.md index 2bc257b2..388d3c84 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # Tipi β A personal homeserver for everyone - -[](#contributors-) - +[](#contributors-) [](https://github.com/runtipi/runtipi/blob/master/LICENSE) @@ -75,36 +73,36 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
{isLatest ? t('settings.actions.stay-up-to-date') : t('settings.actions.new-version', { version: version.latest })}
- {renderUpdate()} -{t('settings.actions.maintenance-subtitle')}
-{isLatest ? t('settings.actions.stay-up-to-date') : t('settings.actions.new-version', { version: version.latest })}
+ {renderUpdate()} +