├── .dockerignore ├── etc └── systemd │ └── system │ ├── sysinit.target.wants │ └── feedbin-init.service │ ├── multi-user.target.wants │ └── container-feedbin.service │ ├── feedbin-init.service │ ├── container-mc@.service │ ├── container-feedbin-rake.service │ ├── container-caddy.service │ ├── container-redis.service │ ├── container-minio.service │ ├── container-elasticsearch.service │ ├── container-postgres.service │ ├── container-feedbin-privacy-please.service │ ├── container-feedbin-extract.service │ └── container-feedbin.service ├── .github ├── dependabot.yml └── workflows │ └── build.yml ├── .gitmodules ├── Containerfile ├── Dockerfile ├── LICENSE ├── README.md └── usr └── sbin └── feedbin-init /.dockerignore: -------------------------------------------------------------------------------- 1 | **/.git 2 | -------------------------------------------------------------------------------- /etc/systemd/system/sysinit.target.wants/feedbin-init.service: -------------------------------------------------------------------------------- 1 | /etc/systemd/system/feedbin-init.service -------------------------------------------------------------------------------- /etc/systemd/system/multi-user.target.wants/container-feedbin.service: -------------------------------------------------------------------------------- 1 | /etc/systemd/system/container-feedbin.service -------------------------------------------------------------------------------- /etc/systemd/system/feedbin-init.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | DefaultDependencies=no 3 | Conflicts=shutdown.target 4 | After=local-fs.target 5 | Before=sysinit.target shutdown.target 6 | 7 | [Service] 8 | ExecStart=/usr/sbin/feedbin-init %H 9 | Type=oneshot 10 | RemainAfterExit=yes 11 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | 8 | - package-ecosystem: "docker" 9 | directory: "/" 10 | schedule: 11 | interval: "daily" 12 | 13 | - package-ecosystem: "gitsubmodule" 14 | directory: "/" 15 | schedule: 16 | interval: "daily" 17 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vendor/github.com/feedbin/feedbin"] 2 | path = vendor/github.com/feedbin/feedbin 3 | url = https://github.com/feedbin/feedbin.git 4 | [submodule "vendor/github.com/feedbin/extract"] 5 | path = vendor/github.com/feedbin/extract 6 | url = https://github.com/feedbin/extract.git 7 | [submodule "vendor/github.com/feedbin/privacy-please"] 8 | path = vendor/github.com/feedbin/privacy-please 9 | url = https://github.com/feedbin/privacy-please.git 10 | -------------------------------------------------------------------------------- /etc/systemd/system/container-mc@.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Podman container-mc@%I.service 3 | Documentation=man:podman-generate-systemd(1) 4 | Wants=network-online.target container-minio.service 5 | After=network-online.target container-minio.service 6 | RequiresMountsFor=%t/containers 7 | 8 | [Service] 9 | ExecStart=/usr/bin/podman run --rm --name mc --net host --env-file /data/minio/.env --entrypoint /bin/sh docker.io/minio/mc -c 'until mc alias set minio "$MINIO_HOST" "$MINIO_ACCESS_KEY" "$MINIO_SECRET_KEY"; do sleep 1; done && mc ls --quiet --summarize "minio/%I" || mc mb "minio/%I" && mc anonymous set download "minio/%I"' 10 | Type=oneshot 11 | RemainAfterExit=yes 12 | -------------------------------------------------------------------------------- /etc/systemd/system/container-feedbin-rake.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Podman container-feedbin-rake.service 3 | Documentation=man:podman-generate-systemd(1) 4 | Wants=network-online.target container-elasticsearch.service container-postgres.service 5 | After=network-online.target container-elasticsearch.service container-postgres.service 6 | RequiresMountsFor=%t/containers 7 | 8 | [Service] 9 | ExecStart=/usr/bin/podman run --rm --name feedbin-rake --net host --volume /var/run/postgresql:/var/run/postgresql:rw --env-file /data/feedbin/.env localhost:5000/feedbin:edge /bin/sh -c 'until pg_isready; do sleep 1; done && until curl -fsSo /dev/null --head "${ELASTICSEARCH_URL:-http://127.0.0.1:9200}"; do sleep 1; done && bundle exec rake db:migrate || bundle exec rake db:setup' 10 | Type=oneshot 11 | RemainAfterExit=yes 12 | -------------------------------------------------------------------------------- /etc/systemd/system/container-caddy.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Podman container-caddy.service 3 | Documentation=man:podman-generate-systemd(1) 4 | Wants=network-online.target 5 | After=network-online.target 6 | RequiresMountsFor=%t/containers 7 | 8 | [Service] 9 | Environment=PODMAN_SYSTEMD_UNIT=%n 10 | Restart=on-failure 11 | TimeoutStopSec=70 12 | ExecStartPre=/bin/rm -f %t/%n.ctr-id 13 | ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --sdnotify=conmon --cgroups=no-conmon --rm -d --replace --name caddy --net host --volume /data/caddy/Caddyfile:/etc/caddy/Caddyfile:rw --volume /data/caddy/data:/data:rw docker.io/library/caddy:2-alpine 14 | ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id 15 | ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id 16 | Type=notify 17 | NotifyAccess=all 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /etc/systemd/system/container-redis.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Podman container-redis.service 3 | Documentation=man:podman-generate-systemd(1) 4 | Wants=network-online.target 5 | After=network-online.target 6 | RequiresMountsFor=%t/containers 7 | 8 | [Service] 9 | Environment=PODMAN_SYSTEMD_UNIT=%n 10 | Restart=on-failure 11 | TimeoutStopSec=70 12 | ExecStartPre=/bin/rm -f %t/%n.ctr-id 13 | ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --sdnotify=conmon --cgroups=no-conmon --rm -d --replace --name redis --net host --volume /data/redis/data:/data:rw --env-file /data/redis/.env docker.io/library/redis:6-alpine redis-server --appendonly yes 14 | ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id 15 | ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id 16 | Type=notify 17 | NotifyAccess=all 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /etc/systemd/system/container-minio.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Podman container-minio.service 3 | Documentation=man:podman-generate-systemd(1) 4 | Wants=network-online.target container-caddy.service 5 | After=network-online.target container-caddy.service 6 | RequiresMountsFor=%t/containers 7 | 8 | [Service] 9 | Environment=PODMAN_SYSTEMD_UNIT=%n 10 | Restart=on-failure 11 | TimeoutStopSec=70 12 | ExecStartPre=/bin/rm -f %t/%n.ctr-id 13 | ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --sdnotify=conmon --cgroups=no-conmon --rm -d --replace --name minio --net host --volume /data/minio/data:/data:rw --env-file /data/minio/.env docker.io/minio/minio server /data 14 | ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id 15 | ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id 16 | Type=notify 17 | NotifyAccess=all 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /etc/systemd/system/container-elasticsearch.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Podman container-elasticsearch.service 3 | Documentation=man:podman-generate-systemd(1) 4 | Wants=network-online.target 5 | After=network-online.target 6 | RequiresMountsFor=%t/containers 7 | 8 | [Service] 9 | Environment=PODMAN_SYSTEMD_UNIT=%n 10 | Restart=on-failure 11 | TimeoutStopSec=70 12 | ExecStartPre=/bin/rm -f %t/%n.ctr-id 13 | ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --sdnotify=conmon --cgroups=no-conmon --rm -d --replace --name elasticsearch --net host --volume /data/elasticsearch/data:/usr/share/elasticsearch/data --env-file /data/elasticsearch/.env docker.io/library/elasticsearch:8.5.3 14 | ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id 15 | ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id 16 | Type=notify 17 | NotifyAccess=all 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /Containerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/ntkme/systemd-podman:edge 2 | 3 | RUN podman pull docker.io/library/caddy:2-alpine \ 4 | && podman pull docker.io/library/elasticsearch:8.10.4 \ 5 | && podman pull docker.io/library/postgres:16-alpine \ 6 | && podman pull docker.io/library/redis:6-alpine \ 7 | && podman pull docker.io/minio/mc:latest \ 8 | && podman pull docker.io/minio/minio:latest \ 9 | && printf '%s\n' \ 10 | '[[registry]]' \ 11 | 'prefix = "localhost"' \ 12 | 'location = "localhost"' \ 13 | 'insecure = true' \ 14 | | tee /etc/containers/registries.conf.d/localhost.conf \ 15 | && podman pull localhost:5000/feedbin:edge \ 16 | && rm /etc/containers/registries.conf.d/localhost.conf \ 17 | && rm -rf /usr/share/containers/storage \ 18 | && mv /var/lib/containers/storage /usr/share/containers/storage 19 | 20 | ADD etc /etc 21 | ADD usr /usr 22 | 23 | VOLUME ["/data"] 24 | -------------------------------------------------------------------------------- /etc/systemd/system/container-postgres.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Podman container-postgres.service 3 | Documentation=man:podman-generate-systemd(1) 4 | Wants=network-online.target 5 | After=network-online.target 6 | RequiresMountsFor=%t/containers 7 | 8 | [Service] 9 | Environment=PODMAN_SYSTEMD_UNIT=%n 10 | Restart=on-failure 11 | TimeoutStopSec=70 12 | ExecStartPre=/bin/rm -f %t/%n.ctr-id 13 | ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --sdnotify=conmon --cgroups=no-conmon --rm -d --replace --name postgres --net host --volume /data/postgresql/data:/var/lib/postgresql/data:rw --volume /var/run/postgresql:/var/run/postgresql:rw --env-file /data/postgresql/.env docker.io/library/postgres:14-alpine 14 | ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id 15 | ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id 16 | Type=notify 17 | NotifyAccess=all 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /etc/systemd/system/container-feedbin-privacy-please.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Podman container-feedbin-privacy-please.service 3 | Documentation=man:podman-generate-systemd(1) 4 | Wants=network-online.target container-caddy.service 5 | After=network-online.target container-caddy.service 6 | RequiresMountsFor=%t/containers 7 | 8 | [Service] 9 | Environment=PODMAN_SYSTEMD_UNIT=%n 10 | Restart=on-failure 11 | TimeoutStopSec=70 12 | ExecStartPre=/bin/rm -f %t/%n.ctr-id 13 | ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --sdnotify=conmon --cgroups=no-conmon --rm -d --replace --name feedbin-privacy-please --net host --env-file /data/privacy-please/.env --env PORT=3002 --workdir /opt/feedbin/privacy-please localhost:5000/feedbin:edge 14 | ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id 15 | ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id 16 | Type=notify 17 | NotifyAccess=all 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.io/library/ruby:3.4.8 2 | 3 | COPY vendor/github.com /opt 4 | 5 | RUN apt-get update \ 6 | && apt-get install -y --no-install-recommends libidn11-dev libvips42 nodejs npm postgresql-client \ 7 | && rm -rf /var/lib/apt/lists/* \ 8 | && gem update --system \ 9 | && npm install -g yarn \ 10 | && cd /opt/feedbin/feedbin \ 11 | && bundle install \ 12 | && cd /opt/feedbin/privacy-please \ 13 | && rm Gemfile.lock \ 14 | && bundle install \ 15 | && cd /opt/feedbin/extract \ 16 | && npm ci \ 17 | && mkdir users \ 18 | && PIGO_TAG_NAME=$(basename "$(curl -fsSLo /dev/null --write-out "%{url_effective}\n" https://github.com/esimov/pigo/releases/latest)") \ 19 | && PIGO_DIR=pigo-$(echo "$PIGO_TAG_NAME" | tr -d v)-linux-amd64 \ 20 | && curl -fsSL https://github.com/esimov/pigo/releases/download/$PIGO_TAG_NAME/$PIGO_DIR.tar.gz | tar -vxzC /opt \ 21 | && ln -s /opt/$PIGO_DIR/pigo /usr/local/bin/pigo 22 | 23 | WORKDIR /opt/feedbin/feedbin 24 | 25 | CMD ["bundle", "exec", "foreman", "start"] 26 | -------------------------------------------------------------------------------- /etc/systemd/system/container-feedbin-extract.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Podman container-feedbin-extract.service 3 | Documentation=man:podman-generate-systemd(1) 4 | Wants=network-online.target container-caddy.service 5 | After=network-online.target container-caddy.service 6 | RequiresMountsFor=%t/containers 7 | 8 | [Service] 9 | Environment=PODMAN_SYSTEMD_UNIT=%n 10 | Restart=on-failure 11 | TimeoutStopSec=70 12 | ExecStartPre=/bin/rm -f %t/%n.ctr-id 13 | ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --sdnotify=conmon --cgroups=no-conmon --rm -d --replace --name feedbin-extract --net host --env-file /data/feedbin/.env --env PORT=3001 --workdir /opt/feedbin/extract localhost:5000/feedbin:edge /bin/sh -c 'if test -n "$EXTRACT_USER" -a -n "$EXTRACT_SECRET"; then echo "$EXTRACT_SECRET" >"users/$EXTRACT_USER"; fi && exec "$@"' -- node app/server.js 14 | ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id 15 | ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id 16 | Type=notify 17 | NotifyAccess=all 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 なつき 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /etc/systemd/system/container-feedbin.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Podman container-feedbin.service 3 | Documentation=man:podman-generate-systemd(1) 4 | Wants=network-online.target container-caddy.service container-feedbin-extract.service container-feedbin-privacy-please.service container-feedbin-rake.service container-mc@feedbin.service container-redis.service 5 | After=network-online.target container-caddy.service container-feedbin-extract.service container-feedbin-privacy-please.service container-feedbin-rake.service container-mc@feedbin.service container-redis.service 6 | RequiresMountsFor=%t/containers 7 | 8 | [Service] 9 | Environment=PODMAN_SYSTEMD_UNIT=%n 10 | Restart=on-failure 11 | TimeoutStopSec=70 12 | ExecStartPre=/bin/rm -f %t/%n.ctr-id 13 | ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --sdnotify=conmon --cgroups=no-conmon --rm -d --replace --name feedbin --net host --volume /var/run/postgresql:/var/run/postgresql:rw --env-file /data/feedbin/.env --env RAILS_SERVE_STATIC_FILES=true localhost:5000/feedbin:edge /bin/sh -c 'bundle exec rake assets:precompile && bundle exec foreman start && exec bundle exec rails server' 14 | ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id 15 | ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id 16 | Type=notify 17 | NotifyAccess=all 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # feedbin 2 | 3 | Whole Feedbin stack in a container. 4 | 5 | ## Usage 6 | 7 | #### Add DNS Records 8 | 9 | - `feedbin.domain.name` 10 | - `api.feedbin.domain.name` 11 | - `minio.feedbin.domain.name` 12 | - `privacy-please.feedbin.domain.name` 13 | 14 | #### Start Feedbin in a Container 15 | 16 | ###### With `podman` 17 | 18 | ``` sh 19 | sudo podman run -d \ 20 | --name feedbin \ 21 | --privileged \ 22 | --hostname feedbin.domain.name \ 23 | --publish 80:80/tcp \ 24 | --publish 443:443/tcp \ 25 | --volume /sys/fs/cgroup:/sys/fs/cgroup:ro \ 26 | --volume /var/lib/feedbin:/data \ 27 | ghcr.io/ntkme/feedbin:edge 28 | ``` 29 | 30 | ###### With `docker` 31 | 32 | ``` sh 33 | docker run -d \ 34 | --name feedbin \ 35 | --privileged \ 36 | --hostname feedbin.domain.name \ 37 | --publish 80:80/tcp \ 38 | --publish 443:443/tcp \ 39 | --cgroupns host \ 40 | --volume /sys/fs/cgroup:/sys/fs/cgroup \ 41 | --volume /var/lib/feedbin:/data \ 42 | --device /dev/fuse \ 43 | --stop-signal SIGRTMIN+3 \ 44 | ghcr.io/ntkme/feedbin:edge 45 | ``` 46 | 47 | #### Grant Admin Access 48 | 49 | ###### With `podman` 50 | 51 | ``` sh 52 | sudo podman exec feedbin podman exec feedbin rake feedbin:make_admin[support@feedbin.domain.name] 53 | ``` 54 | 55 | ###### With `docker` 56 | 57 | ``` sh 58 | docker exec feedbin podman exec feedbin rake feedbin:make_admin[support@feedbin.domain.name] 59 | ``` 60 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: 6 | - '**' 7 | tags: 8 | - 'v*.*.*' 9 | pull_request: 10 | branches: 11 | - '**' 12 | 13 | concurrency: 14 | group: ${{ github.workflow }}-${{ github.ref }} 15 | cancel-in-progress: true 16 | 17 | jobs: 18 | build: 19 | name: Build 20 | 21 | runs-on: ubuntu-latest 22 | 23 | services: 24 | registry: 25 | image: docker.io/library/registry:latest 26 | ports: 27 | - 5000:5000 28 | 29 | steps: 30 | - name: Checkout 31 | uses: actions/checkout@v6 32 | with: 33 | submodules: true 34 | 35 | - name: Docker Metadata 36 | id: docker-metadata 37 | uses: docker/metadata-action@v5 38 | with: 39 | images: | 40 | ghcr.io/${{ github.repository }} 41 | tags: | 42 | type=edge 43 | type=ref,event=branch 44 | type=ref,event=pr 45 | type=schedule 46 | type=semver,pattern={{version}} 47 | type=semver,pattern={{major}}.{{minor}} 48 | type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} 49 | 50 | - name: Build 51 | uses: docker/build-push-action@v6 52 | with: 53 | context: . 54 | push: true 55 | tags: localhost:5000/feedbin:edge 56 | 57 | - name: Force Rootful Native OverlayFS 58 | run: | 59 | printf '%s\n' '#!/bin/sh' 'exec /usr/bin/sudo -n -- /usr/bin/buildah "$@"' | sudo tee /usr/local/bin/buildah 60 | printf '%s\n' '#!/bin/sh' 'exec /usr/bin/sudo -n -- /usr/bin/podman "$@"' | sudo tee /usr/local/bin/podman 61 | printf '%s\n' '#!/bin/sh' 'exec /usr/bin/sudo -n -- /usr/bin/skopeo "$@"' | sudo tee /usr/local/bin/skopeo 62 | sudo chmod a+x /usr/local/bin/buildah /usr/local/bin/podman /usr/local/bin/skopeo 63 | 64 | - name: Build 65 | uses: redhat-actions/buildah-build@v2 66 | with: 67 | tags: ${{ steps.docker-metadata.outputs.tags }} 68 | labels: ${{ steps.docker-metadata.outputs.labels }} 69 | containerfiles: |- 70 | Containerfile 71 | extra-args: |- 72 | --net=host 73 | --security-opt=seccomp=unconfined 74 | 75 | - name: Push 76 | if: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }} 77 | uses: redhat-actions/push-to-registry@v2 78 | with: 79 | tags: ${{ steps.docker-metadata.outputs.tags }} 80 | username: ${{ github.actor }} 81 | password: ${{ github.token }} 82 | -------------------------------------------------------------------------------- /usr/sbin/feedbin-init: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if test "$#" -ne 1 -o -z "$1"; then 5 | echo "Usage: $0 hostname" 6 | exit 1 7 | fi 8 | 9 | configure () { 10 | echo "# $1" && test -e "$1" || tee "$1" && "${2:-.}" "$1" && echo 11 | } 12 | 13 | secure_random () { 14 | head -c 512 /dev/urandom | sha256sum | head -c 64 15 | } 16 | 17 | mkdir -p /data/caddy/data \ 18 | /data/elasticsearch/data \ 19 | /data/feedbin \ 20 | /data/minio/data \ 21 | /data/postgresql/data \ 22 | /data/privacy-please \ 23 | /data/redis/data \ 24 | /var/run/postgresql 25 | 26 | chown 1000:1000 /data/elasticsearch/data 27 | 28 | configure /data/elasticsearch/.env : <