diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4639fd8..bf4c942 100755 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -24,7 +24,7 @@ ## Readme If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit. -Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-BudgE/edit/master/readme-vars.yml). +Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-BudgE/edit/main/readme-vars.yml). These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play. Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io/images/docker-BudgE) @@ -115,7 +115,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Update the changelog -If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-BudgE/tree/master/root), add an entry to the changelog +If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-BudgE/tree/main/root), add an entry to the changelog ```yml changelogs: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 40aaa1c..b921ac7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -21,7 +21,7 @@ ------------------------------ - - [ ] I have read the [contributing](https://github.com/linuxserver/docker-BudgE/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications + - [ ] I have read the [contributing](https://github.com/linuxserver/docker-BudgE/blob/main/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications ------------------------------ diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index 1db4e1b..209c845 100755 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -4,24 +4,24 @@ on: workflow_dispatch: jobs: - external-trigger-master: + external-trigger-main: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.3 - name: External Trigger - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/main' run: | - if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_BUDGE_MASTER }}" ]; then - echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_BUDGE_MASTER is set; skipping trigger. ****" + if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_BUDGE_MAIN }}" ]; then + echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_BUDGE_MAIN is set; skipping trigger. ****" exit 0 fi - echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_BUDGE_MASTER\". ****" + echo "**** External trigger running off of main branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_BUDGE_MAIN\". ****" echo "**** Retrieving external version ****" EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/linuxserver/budge/releases/latest" | jq -r '. | .tag_name') if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then echo "**** Can't retrieve external version, exiting ****" - FAILURE_REASON="Can't retrieve external version for BudgE branch master" + FAILURE_REASON="Can't retrieve external version for BudgE branch main" GHA_TRIGGER_URL="https://github.com/linuxserver/docker-BudgE/actions/runs/${{ github.run_id }}" curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680, "description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}], @@ -64,13 +64,13 @@ jobs: if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then echo "**** Version ${EXT_RELEASE} already pushed, exiting ****" exit 0 - elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then + elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/main/lastBuild/api/json | jq -r '.building') == "true" ]; then echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****" exit 0 else echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****" response=$(curl -iX POST \ - https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/master/buildWithParameters?PACKAGE_CHECK=false \ + https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/main/buildWithParameters?PACKAGE_CHECK=false \ --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|") echo "**** Jenkins job queue url: ${response%$'\r'} ****" echo "**** Sleeping 10 seconds until job starts ****" diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index ffe331e..c6d4f53 100755 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -8,6 +8,6 @@ jobs: steps: - uses: actions/first-interaction@v1 with: - issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-BudgE/blob/master/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-BudgE/blob/master/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!' - pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-BudgE/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!' + issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-BudgE/blob/main/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-BudgE/blob/main/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!' + pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-BudgE/blob/main/.github/PULL_REQUEST_TEMPLATE.md)!' repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/package_trigger.yml b/.github/workflows/package_trigger.yml index df63c96..14533bb 100755 --- a/.github/workflows/package_trigger.yml +++ b/.github/workflows/package_trigger.yml @@ -4,25 +4,25 @@ on: workflow_dispatch: jobs: - package-trigger-master: + package-trigger-main: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.3 - name: Package Trigger - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/main' run: | - if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_BUDGE_MASTER }}" ]; then - echo "**** Github secret PAUSE_PACKAGE_TRIGGER_BUDGE_MASTER is set; skipping trigger. ****" + if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_BUDGE_MAIN }}" ]; then + echo "**** Github secret PAUSE_PACKAGE_TRIGGER_BUDGE_MAIN is set; skipping trigger. ****" exit 0 fi - if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then + if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/main/lastBuild/api/json | jq -r '.building') == "true" ]; then echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****" exit 0 fi - echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_BUDGE_MASTER\". ****" + echo "**** Package trigger running off of main branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_BUDGE_MAIN\". ****" response=$(curl -iX POST \ - https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/master/buildWithParameters?PACKAGE_CHECK=true \ + https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/main/buildWithParameters?PACKAGE_CHECK=true \ --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|") echo "**** Jenkins job queue url: ${response%$'\r'} ****" echo "**** Sleeping 10 seconds until job starts ****" diff --git a/.jenkins-external/README.lite b/.jenkins-external/README.lite deleted file mode 100644 index 71181ad..0000000 --- a/.jenkins-external/README.lite +++ /dev/null @@ -1,25 +0,0 @@ -# [linuxserver/BudgE](https://github.com/linuxserver/docker-BudgE) - -This readme has been truncated from the full version found [HERE](https://github.com/linuxserver/docker-BudgE) - -[BudgE](https://github.com/linuxserver/BudgE) is an open source 'budgeting with envelopes' personal finance app. - - -## Application Setup - -Access the web gui at http://SERVERIP:PORT - -## Usage - -```bash -docker run -d \ - --name=BudgE \ - -e PUID=1000 \ - -e PGID=1000 \ - -e TZ=America/New_York \ - -p 80:80 \ - -p 443:443 \ - -v /path/to/BudgE/config:/config \ - --restart unless-stopped \ - linuxserver/BudgE -``` diff --git a/.jenkins-external/budge.xml b/.jenkins-external/budge.xml deleted file mode 100644 index 1fc1df4..0000000 --- a/.jenkins-external/budge.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - budge - lscr.io/linuxserver/BudgE - https://github.com/orgs/linuxserver/packages/container/package/BudgE - Donations - https://www.linuxserver.io/donate - https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/donate.png - bridge - false - https://github.com/linuxserver/docker-BudgE/issues/new/choose - bash - https://github.com/linuxserver/docker-BudgE#application-setup - https://github.com/linuxserver/docker-BudgE#readme - https://github.com/linuxserver/BudgE - BudgE(https://github.com/linuxserver/BudgE) is an open source 'budgeting with envelopes' personal finance app. - http://[IP]:[PORT:80] - https://raw.githubusercontent.com/linuxserver/templates/main/unraid/budge.xml - https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver-ls-logo.png - 2022-05-02 - -### 2022-05-02 -- Initial Release. - - - - - - - - - diff --git a/.jenkins-external/docker-BudgE.md b/.jenkins-external/docker-BudgE.md deleted file mode 100644 index d1f8328..0000000 --- a/.jenkins-external/docker-BudgE.md +++ /dev/null @@ -1,159 +0,0 @@ ---- -title: BudgE ---- - - - -# [linuxserver/BudgE](https://github.com/linuxserver/docker-BudgE) - -[![Scarf.io pulls](https://scarf.sh/installs-badge/linuxserver-ci/linuxserver%2FBudgE?color=94398d&label-color=555555&logo-color=ffffff&style=for-the-badge&package-type=docker)](https://scarf.sh/gateway/linuxserver-ci/docker/linuxserver%2FBudgE) -[![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-BudgE.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-BudgE) -[![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-BudgE.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-BudgE/releases) -[![GitHub Package Repository](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub%20Package&logo=github)](https://github.com/linuxserver/docker-BudgE/packages) -[![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/linuxserver.io/docker-BudgE/container_registry) -[![Quay.io](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Quay.io)](https://quay.io/repository/linuxserver.io/BudgE) -[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/BudgE.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/BudgE) -[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/BudgE.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/BudgE) -[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-BudgE%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/master/) -[![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Fci-tests.linuxserver.io%2Flinuxserver%2FBudgE%2Flatest%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/BudgE/latest/index.html) - -[BudgE](https://github.com/linuxserver/BudgE) is an open source 'budgeting with envelopes' personal finance app. - -## Supported Architectures - -Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/). - -Simply pulling `lscr.io/linuxserver/BudgE` should retrieve the correct image for your arch, but you can also pull specific arch images via tags. - -The architectures supported by this image are: - -| Architecture | Tag | -| :----: | --- | -| x86-64 | amd64-latest | -| arm64 | arm64v8-latest | -| armhf | arm32v7-latest | - -## Application Setup - -Access the web gui at http://SERVERIP:PORT - -## Usage - -To help you get started creating a container from this image you can either use docker-compose or the docker cli. - -### docker-compose (recommended, [click here for more info](https://docs.linuxserver.io/general/docker-compose)) - -```yaml ---- -version: "2.1" -services: - BudgE: - image: lscr.io/linuxserver/BudgE - container_name: BudgE - environment: - - PUID=1000 - - PGID=1000 - - TZ=America/New_York - volumes: - - /path/to/BudgE/config:/config - ports: - - 80:80 - - 443:443 - restart: unless-stopped -``` - -### docker cli ([click here for more info](https://docs.docker.com/engine/reference/commandline/cli/)) - -```bash -docker run -d \ - --name=BudgE \ - -e PUID=1000 \ - -e PGID=1000 \ - -e TZ=America/New_York \ - -p 80:80 \ - -p 443:443 \ - -v /path/to/BudgE/config:/config \ - --restart unless-stopped \ - lscr.io/linuxserver/BudgE -``` - -## Parameters - -Docker images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `:` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container. - -### Ports (`-p`) - -| Parameter | Function | -| :----: | --- | -| `80` | http gui | -| `443` | https gui | - -### Environment Variables (`-e`) - -| Env | Function | -| :----: | --- | -| `PUID=1000` | for UserID - see below for explanation | -| `PGID=1000` | for GroupID - see below for explanation | -| `TZ=America/New_York` | Specify a timezone to use EG America/New_York | - -### Volume Mappings (`-v`) - -| Volume | Function | -| :----: | --- | -| `/config` | Persistent config files | - -#### Miscellaneous Options - -| Parameter | Function | -| :-----: | --- | - -## Environment variables from files (Docker secrets) - -You can set any environment variable from a file by using a special prepend `FILE__`. - -As an example: - -```bash --e FILE__PASSWORD=/run/secrets/mysecretpassword -``` - -Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file. - -## Umask for running applications - -For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional `-e UMASK=022` setting. -Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up [here](https://en.wikipedia.org/wiki/Umask) before asking for support. - -## User / Group Identifiers - -When using volumes (`-v` flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`. - -Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic. - -In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below: - -```bash - $ id username - uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup) -``` - -## Docker Mods - -[![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=BudgE&query=%24.mods%5B%27BudgE%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=BudgE "view available mods for this container.") [![Docker Universal Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=universal "view available universal mods.") - -We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above. - -## Support Info - -* Shell access whilst the container is running: - * `docker exec -it BudgE /bin/bash` -* To monitor the logs of the container in realtime: - * `docker logs -f BudgE` -* Container version number - * `docker inspect -f '{{ index .Config.Labels "build_version" }}' BudgE` -* Image version number - * `docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/BudgE` - -## Versions - -* **02.05.22:** - Initial Release. diff --git a/Dockerfile b/Dockerfile index cc08d76..a926a8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,50 +10,53 @@ LABEL maintainer="alex-phillips" ENV BUDGE_DATABASE=/config/budge.db RUN \ - echo "**** install build packages ****" && \ - apk add --no-cache --virtual=build-dependencies \ - curl \ - g++ \ + echo "**** install build packages ****" && \ + apk add --no-cache --virtual=build-dependencies \ + curl \ + g++ \ gcc \ - make \ + make \ musl-dev \ - python3 && \ - echo "**** install runtime packages ****" && \ - apk add --no-cache \ - nodejs \ - npm \ - sqlite && \ - echo "**** install budge ****" && \ - mkdir -p /app/budge && \ - if [ -z ${NOTEMARKS_RELEASE+x} ]; then \ - BUDGE_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/BudgE/commits/main" \ - | awk '/sha/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/budge.tar.gz -L \ - "https://github.com/linuxserver/BudgE/archive/${BUDGE_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/budge.tar.gz -C \ - /app/budge/ --strip-components=1 && \ - echo "**** install backend ****" && \ - cd /app/budge/backend && \ - npm i && \ - npm run build && \ - npm prune --production && \ - echo "**** install ynab importer ****" && \ - cd /app/budge/ynab && \ - npm i && \ - echo "**** install frontend ****" && \ - cd /app/budge/frontend && \ - npm i && \ - npm run build && \ - npm prune --production && \ - echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ - rm -rf \ - /root/.cache \ - /tmp/* + python3 && \ + echo "**** install runtime packages ****" && \ + apk add --no-cache \ + nodejs \ + npm \ + sqlite && \ + echo "**** install budge ****" && \ + mkdir -p /app/budge && \ + if [ -z ${NOTEMARKS_RELEASE+x} ]; then \ + BUDGE_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/BudgE/commits/main" \ + | awk '/sha/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/budge.tar.gz -L \ + "https://github.com/linuxserver/BudgE/archive/${BUDGE_RELEASE}.tar.gz" && \ + tar xf \ + /tmp/budge.tar.gz -C \ + /app/budge/ --strip-components=1 && \ + echo "**** install backend ****" && \ + cd /app/budge/backend && \ + npm i && \ + npm run build && \ + npm prune --production && \ + echo "**** install ynab importer ****" && \ + cd /app/budge/ynab && \ + npm i && \ + echo "**** install frontend ****" && \ + cd /app/budge/frontend && \ + npm i && \ + npm run build && \ + npm prune --production && \ + echo "**** overlay-fs bug workaround ****" && \ + mv /app/budge/frontend/node_modules /app/budge/frontend/node_modules-tmp && \ + mv /app/budge/backend/node_modules /app/budge/backend/node_modules-tmp && \ + echo "**** cleanup ****" && \ + apk del --purge \ + build-dependencies && \ + rm -rf \ + /root/.cache \ + /tmp/* # add local files COPY root/ / diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 1fed84c..a926a8e 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -10,50 +10,53 @@ LABEL maintainer="alex-phillips" ENV BUDGE_DATABASE=/config/budge.db RUN \ - echo "**** install build packages ****" && \ - apk add --no-cache --virtual=build-dependencies \ + echo "**** install build packages ****" && \ + apk add --no-cache --virtual=build-dependencies \ curl \ g++ \ gcc \ - make \ + make \ musl-dev \ - python3 && \ - echo "**** install runtime packages ****" && \ - apk add --no-cache \ - nodejs \ - npm \ - sqlite && \ - echo "**** install budge ****" && \ - mkdir -p /app/budge && \ - if [ -z ${NOTEMARKS_RELEASE+x} ]; then \ - BUDGE_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/BudgE/commits/main" \ - | awk '/sha/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/budge.tar.gz -L \ - "https://github.com/linuxserver/BudgE/archive/${BUDGE_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/budge.tar.gz -C \ - /app/budge/ --strip-components=1 && \ - echo "**** install backend ****" && \ - cd /app/budge/backend && \ - npm i && \ - npm run build && \ - npm prune --production && \ - echo "**** install ynab importer ****" && \ - cd /app/budge/ynab && \ - npm i && \ - echo "**** install frontend ****" && \ - cd /app/budge/frontend && \ - npm i && \ - npm run build && \ - npm prune --production && \ - echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ - rm -rf \ - /root/.cache \ - /tmp/* + python3 && \ + echo "**** install runtime packages ****" && \ + apk add --no-cache \ + nodejs \ + npm \ + sqlite && \ + echo "**** install budge ****" && \ + mkdir -p /app/budge && \ + if [ -z ${NOTEMARKS_RELEASE+x} ]; then \ + BUDGE_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/BudgE/commits/main" \ + | awk '/sha/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/budge.tar.gz -L \ + "https://github.com/linuxserver/BudgE/archive/${BUDGE_RELEASE}.tar.gz" && \ + tar xf \ + /tmp/budge.tar.gz -C \ + /app/budge/ --strip-components=1 && \ + echo "**** install backend ****" && \ + cd /app/budge/backend && \ + npm i && \ + npm run build && \ + npm prune --production && \ + echo "**** install ynab importer ****" && \ + cd /app/budge/ynab && \ + npm i && \ + echo "**** install frontend ****" && \ + cd /app/budge/frontend && \ + npm i && \ + npm run build && \ + npm prune --production && \ + echo "**** overlay-fs bug workaround ****" && \ + mv /app/budge/frontend/node_modules /app/budge/frontend/node_modules-tmp && \ + mv /app/budge/backend/node_modules /app/budge/backend/node_modules-tmp && \ + echo "**** cleanup ****" && \ + apk del --purge \ + build-dependencies && \ + rm -rf \ + /root/.cache \ + /tmp/* # add local files COPY root/ / diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 840ffda..6d84d99 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -10,50 +10,53 @@ LABEL maintainer="alex-phillips" ENV BUDGE_DATABASE=/config/budge.db RUN \ - echo "**** install build packages ****" && \ - apk add --no-cache --virtual=build-dependencies \ - curl \ + echo "**** install build packages ****" && \ + apk add --no-cache --virtual=build-dependencies \ + curl \ g++ \ gcc \ - make \ + make \ musl-dev \ - python3 && \ - echo "**** install runtime packages ****" && \ - apk add --no-cache \ - nodejs \ - npm \ - sqlite && \ - echo "**** install budge ****" && \ - mkdir -p /app/budge && \ - if [ -z ${NOTEMARKS_RELEASE+x} ]; then \ - BUDGE_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/BudgE/commits/main" \ - | awk '/sha/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/budge.tar.gz -L \ - "https://github.com/linuxserver/BudgE/archive/${BUDGE_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/budge.tar.gz -C \ - /app/budge/ --strip-components=1 && \ - echo "**** install backend ****" && \ - cd /app/budge/backend && \ - npm i && \ - npm run build && \ - npm prune --production && \ - echo "**** install ynab importer ****" && \ - cd /app/budge/ynab && \ - npm i && \ - echo "**** install frontend ****" && \ - cd /app/budge/frontend && \ - npm i && \ - npm run build && \ - npm prune --production && \ - echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ - rm -rf \ - /root/.cache \ - /tmp/* + python3 && \ + echo "**** install runtime packages ****" && \ + apk add --no-cache \ + nodejs \ + npm \ + sqlite && \ + echo "**** install budge ****" && \ + mkdir -p /app/budge && \ + if [ -z ${NOTEMARKS_RELEASE+x} ]; then \ + BUDGE_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/BudgE/commits/main" \ + | awk '/sha/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/budge.tar.gz -L \ + "https://github.com/linuxserver/BudgE/archive/${BUDGE_RELEASE}.tar.gz" && \ + tar xf \ + /tmp/budge.tar.gz -C \ + /app/budge/ --strip-components=1 && \ + echo "**** install backend ****" && \ + cd /app/budge/backend && \ + npm i && \ + npm run build && \ + npm prune --production && \ + echo "**** install ynab importer ****" && \ + cd /app/budge/ynab && \ + npm i && \ + echo "**** install frontend ****" && \ + cd /app/budge/frontend && \ + npm i && \ + npm run build && \ + npm prune --production && \ + echo "**** overlay-fs bug workaround ****" && \ + mv /app/budge/frontend/node_modules /app/budge/frontend/node_modules-tmp && \ + mv /app/budge/backend/node_modules /app/budge/backend/node_modules-tmp && \ + echo "**** cleanup ****" && \ + apk del --purge \ + build-dependencies && \ + rm -rf \ + /root/.cache \ + /tmp/* # add local files COPY root/ / diff --git a/Jenkinsfile b/Jenkinsfile index 21a9cb8..501efa3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0') GITLAB_NAMESPACE=credentials('gitlab-namespace-id') SCARF_TOKEN=credentials('scarf_api_key') - EXT_GIT_BRANCH = 'master' + EXT_GIT_BRANCH = 'main' EXT_USER = 'linuxserver' EXT_REPO = 'budge' BUILD_VERSION_ARG = 'budge_RELEASE' @@ -33,7 +33,7 @@ pipeline { CI_WEB='false' CI_PORT='80' CI_SSL='' - CI_DELAY='120' + CI_DELAY='500' CI_DOCKERENV='TZ=America/New_York' CI_AUTH='' CI_WEBPATH='' @@ -154,10 +154,10 @@ pipeline { } } } - // If this is a master build use live docker endpoints + // If this is a main build use live docker endpoints stage("Set ENV live build"){ when { - branch "master" + branch "main" environment name: 'CHANGE_ID', value: '' } steps { @@ -180,7 +180,7 @@ pipeline { // If this is a dev build use dev docker endpoints stage("Set ENV dev build"){ when { - not {branch "master"} + not {branch "main"} environment name: 'CHANGE_ID', value: '' } steps { @@ -257,7 +257,7 @@ pipeline { // Use helper containers to render templated files stage('Update-Templates') { when { - branch "master" + branch "main" environment name: 'CHANGE_ID', value: '' expression { env.CONTAINER_NAME != null @@ -268,13 +268,13 @@ pipeline { set -e TEMPDIR=$(mktemp -d) docker pull ghcr.io/linuxserver/jenkins-builder:latest - docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest + docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=main -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest # Stage 1 - Jenkinsfile update if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then mkdir -p ${TEMPDIR}/repo git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master + git checkout -f main cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/ git add Jenkinsfile git commit -m 'Bot Updating Templated Files' @@ -297,7 +297,7 @@ pipeline { mkdir -p ${TEMPDIR}/repo git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master + git checkout -f main for i in ${TEMPLATES_TO_DELETE}; do git rm "${i}" done @@ -318,7 +318,7 @@ pipeline { mkdir -p ${TEMPDIR}/repo git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master + git checkout -f main cd ${TEMPDIR}/docker-${CONTAINER_NAME} mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE @@ -374,7 +374,7 @@ pipeline { // Exit the build if the Templated files were just updated stage('Template-exit') { when { - branch "master" + branch "main" environment name: 'CHANGE_ID', value: '' environment name: 'FILES_UPDATED', value: 'true' expression { @@ -413,7 +413,7 @@ pipeline { // Add package to Scarf.sh and set permissions stage("Scarf.sh package registry"){ when { - branch "master" + branch "main" environment name: 'EXIT_STATUS', value: '' } steps{ @@ -570,7 +570,7 @@ pipeline { // Take the image we just built and dump package versions for comparison stage('Update-packages') { when { - branch "master" + branch "main" environment name: 'CHANGE_ID', value: '' environment name: 'EXIT_STATUS', value: '' } @@ -607,7 +607,7 @@ pipeline { echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github" if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO} - git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master + git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f main cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/ cd ${TEMPDIR}/${LS_REPO}/ wait @@ -631,7 +631,7 @@ pipeline { // Exit the build if the package file was just updated stage('PACKAGE-exit') { when { - branch "master" + branch "main" environment name: 'CHANGE_ID', value: '' environment name: 'PACKAGE_UPDATED', value: 'true' environment name: 'EXIT_STATUS', value: '' @@ -652,7 +652,7 @@ pipeline { // Exit the build if this is just a package check and there are no changes to push stage('PACKAGECHECK-exit') { when { - branch "master" + branch "main" environment name: 'CHANGE_ID', value: '' environment name: 'PACKAGE_UPDATED', value: 'false' environment name: 'EXIT_STATUS', value: '' @@ -902,7 +902,7 @@ pipeline { // If this is a public release tag it in the LS Github stage('Github-Tag-Push-Release') { when { - branch "master" + branch "main" expression { env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER } @@ -914,14 +914,14 @@ pipeline { sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \ -d '{"tag":"'${META_TAG}'",\ "object": "'${COMMIT_SHA}'",\ - "message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\ + "message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to main",\ "type": "commit",\ "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" sh '''#! /bin/bash curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json echo '{"tag_name":"'${META_TAG}'",\ - "target_commitish": "master",\ + "target_commitish": "main",\ "name": "'${META_TAG}'",\ "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**'${EXT_REPO}' Changes:**\\n\\n' > start printf '","draft": false,"prerelease": false}' >> releasebody.json diff --git a/README.md b/README.md index 76ebc6d..1415e14 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ - + [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io) @@ -37,7 +37,7 @@ Find us at: [![Quay.io](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Quay.io)](https://quay.io/repository/linuxserver.io/BudgE) [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/BudgE.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/BudgE) [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/BudgE.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/BudgE) -[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-BudgE%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/master/) +[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-BudgE%2Fjob%2Fmain%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-BudgE/job/main/) [![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Fci-tests.linuxserver.io%2Flinuxserver%2FBudgE%2Flatest%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/BudgE/latest/index.html) [BudgE](https://github.com/linuxserver/BudgE) is an open source 'budgeting with envelopes' personal finance app. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 196b23f..86b4549 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -5,9 +5,9 @@ project_name: docker-budge external_type: github_stable release_type: stable release_tag: latest -ls_branch: master +ls_branch: main repo_vars: - - EXT_GIT_BRANCH = 'master' + - EXT_GIT_BRANCH = 'main' - EXT_USER = 'linuxserver' - EXT_REPO = 'budge' - BUILD_VERSION_ARG = 'budge_RELEASE' @@ -23,7 +23,7 @@ repo_vars: - CI_WEB='false' - CI_PORT='80' - CI_SSL='' - - CI_DELAY='120' + - CI_DELAY='500' - CI_DOCKERENV='TZ=America/New_York' - CI_AUTH='' - CI_WEBPATH='' diff --git a/root/etc/cont-init.d/40-config b/root/etc/cont-init.d/40-config index ae8573d..4ab03d2 100644 --- a/root/etc/cont-init.d/40-config +++ b/root/etc/cont-init.d/40-config @@ -1,15 +1,15 @@ #!/usr/bin/with-contenv bash +if [ -d /app/budge/backend/node_modules-tmp ]; then + echo "New container detected. Setting up app folder and fixing permissions." + mv /app/budge/backend/node_modules-tmp /app/budge/backend/node_modules + mv /app/budge/frontend/node_modules-tmp /app/budge/frontend/node_modules +fi + cd /app/budge/backend touch /app/budge/backend/budge.sqlite -# copy config -[[ ! -e /config/config.js ]] && \ - mv /app/budge/backend/build/ormconfig.js /config/config.js - -ln -sf /config/config.js /app/budge/backend/build/ormconfig.js - # permissions chown -R abc:abc \ /app/budge \ diff --git a/root/etc/services.d/budge/run b/root/etc/services.d/budge/run index 64a6b11..752d159 100644 --- a/root/etc/services.d/budge/run +++ b/root/etc/services.d/budge/run @@ -1,6 +1,8 @@ #!/usr/bin/with-contenv bash -cd /app/budge/backend +cd /app/budge/backend/build + +shopt -s globstar exec \ s6-setuidgid abc /usr/bin/npm run start