From d52cfce90e2d5d031b8a420ac41b50272b51f7a3 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 31 Jul 2023 18:37:36 +0200 Subject: [PATCH] Split up "scripts" directory and move docs Cleanup time! Split up the "scripts" directory: - Move the scripts/examples directory to the top level. - Move scripts to be included with releases into a new "overlay" directory. - Move build tools into a new "tools" directory. - Also, move most documentation into the "doc" directory. --- .github/workflows/container-build-publish.yml | 22 +++++------ .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 4 +- Formula/eturnal.rb | 2 +- README.md | 8 ++-- config/reltool.config | 2 +- INSTALL.md => doc/INSTALL.md | 0 PACKAGING.md => doc/PACKAGING.md | 14 +++---- QUICK-TEST.md => doc/QUICK-TEST.md | 0 doc/overview.edoc | 4 +- docker-k8s/image/Dockerfile.ctng | 2 +- docker-k8s/image/README.md | 6 +-- {scripts/examples => examples}/check-relay-ip | 0 .../examples => examples}/make-credentials | 0 {scripts => overlay}/eturnalctl | 0 {scripts => overlay}/extensions/credentials | 0 {scripts => overlay}/extensions/disconnect | 0 {scripts => overlay}/extensions/info | 0 {scripts => overlay}/extensions/loglevel | 0 {scripts => overlay}/extensions/password | 0 {scripts => overlay}/extensions/reload | 0 {scripts => overlay}/extensions/sessions | 0 {scripts => overlay}/extensions/version | 0 {scripts => overlay}/hooks/post_stop | 0 {scripts => overlay}/hooks/pre_start | 0 .../init/openrc/eturnal.confd | 0 .../init/openrc/eturnal.initd | 0 .../init/systemd}/eturnal.service | 0 .../eturnal.init => overlay/init/sysv/eturnal | 0 .../logrotate/eturnal | 0 rebar.config | 38 +++++++++---------- src/eturnal.app.src | 2 +- {scripts => tools}/get-version | 0 {scripts => tools}/make-binaries | 2 +- {scripts => tools}/make-containers | 4 +- {scripts => tools}/make-installers | 2 +- {scripts => tools}/make-packages | 2 +- {scripts => tools}/make-release | 23 +++++------ {scripts => tools}/make-source | 2 +- {scripts => tools}/publish-release | 2 +- windows/make-installer | 4 +- 41 files changed, 74 insertions(+), 73 deletions(-) rename INSTALL.md => doc/INSTALL.md (100%) rename PACKAGING.md => doc/PACKAGING.md (87%) rename QUICK-TEST.md => doc/QUICK-TEST.md (100%) rename {scripts/examples => examples}/check-relay-ip (100%) rename {scripts/examples => examples}/make-credentials (100%) rename {scripts => overlay}/eturnalctl (100%) rename {scripts => overlay}/extensions/credentials (100%) rename {scripts => overlay}/extensions/disconnect (100%) rename {scripts => overlay}/extensions/info (100%) rename {scripts => overlay}/extensions/loglevel (100%) rename {scripts => overlay}/extensions/password (100%) rename {scripts => overlay}/extensions/reload (100%) rename {scripts => overlay}/extensions/sessions (100%) rename {scripts => overlay}/extensions/version (100%) rename {scripts => overlay}/hooks/post_stop (100%) rename {scripts => overlay}/hooks/pre_start (100%) rename config/eturnal.openrc => overlay/init/openrc/eturnal.confd (100%) rename scripts/eturnal.openrc => overlay/init/openrc/eturnal.initd (100%) rename {config => overlay/init/systemd}/eturnal.service (100%) rename scripts/eturnal.init => overlay/init/sysv/eturnal (100%) rename config/eturnal.logrotate => overlay/logrotate/eturnal (100%) rename {scripts => tools}/get-version (100%) rename {scripts => tools}/make-binaries (99%) rename {scripts => tools}/make-containers (97%) rename {scripts => tools}/make-installers (99%) rename {scripts => tools}/make-packages (99%) rename {scripts => tools}/make-release (82%) rename {scripts => tools}/make-source (97%) rename {scripts => tools}/publish-release (97%) diff --git a/.github/workflows/container-build-publish.yml b/.github/workflows/container-build-publish.yml index b097c14d3..c41624fc7 100644 --- a/.github/workflows/container-build-publish.yml +++ b/.github/workflows/container-build-publish.yml @@ -8,7 +8,7 @@ on: - 'doc/**' - 'docker-k8s/examples/**' - 'Formula/**' - - 'scripts/get-version' + - 'tools/get-version' - 'windows/**' - '**.md' schedule: @@ -18,7 +18,7 @@ on: - 'doc/**' - 'docker-k8s/examples/**' - 'Formula/**' - - 'scripts/get-version' + - 'tools/get-version' - 'windows/**' - '**.md' @@ -79,7 +79,7 @@ jobs: - name: On push master | extract git version if: needs.detect-change.outputs.update == 'false' - run: echo "TAG_VERSION=$(echo "$(./scripts/get-version)" | sed -e 's|+|-|')" >> $GITHUB_ENV + run: echo "TAG_VERSION=$(echo "$(./tools/get-version)" | sed -e 's|+|-|')" >> $GITHUB_ENV - name: On release | extract release tag if: needs.detect-change.outputs.update == 'true' @@ -100,7 +100,7 @@ jobs: python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 \ xz-utils unzip patch libstdc++6 rsync git meson ninja-build \ binfmt-support qemu-user-static - echo "OTP_VSN=$(awk '/^otp_vsn=/ {{gsub(/[^0-9.]/, ""); print}}' scripts/make-binaries)" >> $GITHUB_ENV + echo "OTP_VSN=$(awk '/^otp_vsn=/ {{gsub(/[^0-9.]/, ""); print}}' tools/make-binaries)" >> $GITHUB_ENV echo "ARCH=$(echo ${{ matrix.arch }} | sed -e 's|x64|x86_64|;s|arm64|aarch64|')" >> $GITHUB_ENV - name: Install erlang/OTP @@ -110,7 +110,7 @@ jobs: version-type: strict - name: Build ${{ matrix.arch }} musl-libc based binary archives - run: CHECK_DEPS=false scripts/make-binaries ${{ env.ARCH }}-linux-musl + run: CHECK_DEPS=false tools/make-binaries ${{ env.ARCH }}-linux-musl - name: Start container for rebar3 test suites ... run: | @@ -170,7 +170,7 @@ jobs: - name: On push master | extract git version if: needs.detect-change.outputs.update == 'false' - run: echo "TAG_VERSION=$(echo "$(./scripts/get-version)" | sed -e 's|+|-|')" >> $GITHUB_ENV + run: echo "TAG_VERSION=$(echo "$(./tools/get-version)" | sed -e 's|+|-|')" >> $GITHUB_ENV - name: On release | extract release tag if: needs.detect-change.outputs.update == 'true' @@ -249,7 +249,7 @@ jobs: - name: On push master | extract git version if: needs.detect-change.outputs.update == 'false' - run: echo "TAG_VERSION=$(echo "$(./scripts/get-version)" | sed -e 's|+|-|')" >> $GITHUB_ENV + run: echo "TAG_VERSION=$(echo "$(./tools/get-version)" | sed -e 's|+|-|')" >> $GITHUB_ENV - name: On release | extract release tag if: needs.detect-change.outputs.update == 'true' @@ -337,9 +337,9 @@ jobs: if: needs.detect-change.outputs.update == 'false' run: | echo "VSN=$(git describe --tag)" >> $GITHUB_ENV - echo "TAG_VERSION=$(echo "$(./scripts/get-version)" | sed -e 's|+|-|')" >> $GITHUB_ENV + echo "TAG_VERSION=$(echo "$(./tools/get-version)" | sed -e 's|+|-|')" >> $GITHUB_ENV echo "SRC=local" >> $GITHUB_ENV - echo "OTP_VSN=$(awk '/^otp_vsn=/ {{gsub(/[^0-9.]/, ""); print}}' scripts/make-binaries)" >> $GITHUB_ENV + echo "OTP_VSN=$(awk '/^otp_vsn=/ {{gsub(/[^0-9.]/, ""); print}}' tools/make-binaries)" >> $GITHUB_ENV - name: On release | extract git version and define build mode if: needs.detect-change.outputs.update == 'true' @@ -349,7 +349,7 @@ jobs: echo "TAG_VERSION=$(awk 'END{gsub("-", " "); print $1}' ${{ env.PKGREL_FILE }})" >> $GITHUB_ENV # define erlang/OTP version - echo "OTP_VSN=$(wget -O - https://raw.githubusercontent.com/${{ github.repository }}/$eturnal_vsn/scripts/make-binaries \ + echo "OTP_VSN=$(wget -O - https://raw.githubusercontent.com/${{ github.repository }}/$eturnal_vsn/tools/make-binaries \ | awk '/^otp_vsn=/ {{gsub(/[^0-9.]/, ""); print}}')" >> $GITHUB_ENV # check whether to build from archive or git, because git repo is HEAD here @@ -444,7 +444,7 @@ jobs: name: On push master | extract git version and define build variants if: needs.detect-change.outputs.update == 'false' run: | - echo "TAG_VERSION=$(echo "$(./scripts/get-version)" | sed -e 's|+|-|')" >> $GITHUB_ENV + echo "TAG_VERSION=$(echo "$(./tools/get-version)" | sed -e 's|+|-|')" >> $GITHUB_ENV - name: On release | extract release tags to be published/updated if: needs.detect-change.outputs.update == 'true' diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 7264e0f2d..e48f99077 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v3 - with: # For scripts/get-version: + with: # For tools/get-version: fetch-depth: 0 - name: Install dependencies env: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4d1d3dddf..ad783b8b1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v3 - with: # For scripts/get-version: + with: # For tools/get-version: fetch-depth: 0 - name: Set up MSVC environment uses: ilammy/msvc-dev-cmd@v1 @@ -44,7 +44,7 @@ jobs: run: windows/make-installer shell: bash - name: Install and start eturnal - run: ./eturnal-$(scripts/get-version)-x64 //SP- //VERYSILENT //SUPPRESSMSGBOXES + run: ./eturnal-$(tools/get-version)-x64 //SP- //VERYSILENT //SUPPRESSMSGBOXES shell: bash timeout-minutes: 10 - name: Restart eturnal diff --git a/Formula/eturnal.rb b/Formula/eturnal.rb index 4e696cafb..67bbef5fe 100644 --- a/Formula/eturnal.rb +++ b/Formula/eturnal.rb @@ -30,7 +30,7 @@ def install s.gsub! "$ETURNAL_ETC_PREFIX/etc/#{name}.yml", "#{etc}/#{name}.yml" end ## fix eturnalctl - inreplace "scripts/eturnalctl" do |s| + inreplace "overlay/eturnalctl" do |s| s.gsub! "(readlink ", "(readlink -f " end end diff --git a/README.md b/README.md index 1cb85e06e..cb70c7736 100644 --- a/README.md +++ b/README.md @@ -99,19 +99,19 @@ As an alternative, there's an `#eturnal` channel [on Slack][23]. [1]: https://github.com/processone/eturnal/actions/workflows/ci.yml [2]: https://eturnal.net/ [3]: https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00 - [4]: https://github.com/processone/eturnal/blob/master/QUICK-TEST.md + [4]: https://github.com/processone/eturnal/blob/master/doc/QUICK-TEST.md [5]: https://github.com/processone/eturnal/blob/master/docker-k8s/QUICK-TEST.md [6]: https://eturnal.net/documentation/code/docker.html [7]: https://software.opensuse.org/download/?package=eturnal&project=devel:languages:erlang [8]: https://pkgs.alpinelinux.org/packages?name=eturnal [9]: https://eturnal.net/documentation/#Installation [10]: https://eturnal.net/windows/ -[11]: https://github.com/processone/eturnal/blob/1.10.1/INSTALL.md +[11]: https://github.com/processone/eturnal/blob/1.10.1/doc/INSTALL.md [12]: https://en.wikipedia.org/wiki/YAML [13]: https://github.com/processone/eturnal/blob/1.10.1/config/eturnal.yml [14]: https://www.freedesktop.org/software/systemd/man/systemctl.html -[15]: https://github.com/processone/eturnal/blob/1.10.1/scripts/eturnal.init -[16]: https://github.com/processone/eturnal/blob/1.10.1/scripts/eturnal.openrc +[15]: https://github.com/processone/eturnal/blob/1.10.1/overlay/init/sysv/eturnal +[16]: https://github.com/processone/eturnal/blob/1.10.1/overlay/init/openrc/eturnal.initd [17]: https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html [18]: https://eturnal.net/documentation/ [19]: https://github.com/processone/eturnal/blob/1.10.1/CHANGELOG.md diff --git a/config/reltool.config b/config/reltool.config index 16f1409ce..fff901777 100644 --- a/config/reltool.config +++ b/config/reltool.config @@ -4,7 +4,7 @@ %%% %%% $ rebar3 compile %%% $ mkdir rel include priv -%%% $ sed -i "s/1\\.0\\.0/$(scripts/get-version)/" config/reltool.config +%%% $ sed -i "s/1\\.0\\.0/$(tools/get-version)/" config/reltool.config %%% $ erl -noinput -eval ' %%% {ok, Conf} = file:consult("config/reltool.config"), %%% {ok, Spec} = reltool:get_target_spec(Conf), diff --git a/INSTALL.md b/doc/INSTALL.md similarity index 100% rename from INSTALL.md rename to doc/INSTALL.md diff --git a/PACKAGING.md b/doc/PACKAGING.md similarity index 87% rename from PACKAGING.md rename to doc/PACKAGING.md index af144216a..aba38340d 100644 --- a/PACKAGING.md +++ b/doc/PACKAGING.md @@ -15,7 +15,7 @@ directory structure. Dependency Management --------------------- -Besides the dependencies [mentioned][3] in the [INSTALL.md][4] file, eturnal +Besides the dependencies [mentioned][3] in the [doc/INSTALL.md][4] file, eturnal depends on the Erlang libraries referenced as `deps` in the [rebar.config][5] file, _except_ for `recon` (which is just included for debugging purposes). The complete list of (direct and transitive) Erlang dependencies is: @@ -83,14 +83,14 @@ directory. Other directories created below the `_build` folder can be ignored. [1]: https://erlang.org/doc/design_principles/release_structure.html [2]: https://rebar3.org - [3]: https://github.com/processone/eturnal/blob/master/INSTALL.md#requirements - [4]: https://github.com/processone/eturnal/blob/master/INSTALL.md + [3]: https://github.com/processone/eturnal/blob/master/doc/INSTALL.md#requirements + [4]: https://github.com/processone/eturnal/blob/master/doc/INSTALL.md [5]: https://github.com/processone/eturnal/blob/master/rebar.config [6]: https://eturnal.net/download/ [7]: https://github.com/processone/eturnal/blob/master/build.config - [8]: https://github.com/processone/eturnal/blob/master/scripts/eturnalctl + [8]: https://github.com/processone/eturnal/blob/master/overlay/eturnalctl [9]: https://github.com/processone/eturnal/blob/master/config/eturnal.yml -[10]: https://github.com/processone/eturnal/blob/master/config/eturnal.service -[11]: https://github.com/processone/eturnal/blob/master/scripts/eturnal.init -[12]: https://github.com/processone/eturnal/blob/master/scripts/eturnal.openrc +[10]: https://github.com/processone/eturnal/blob/master/overlay/init/systemd/eturnal.service +[11]: https://github.com/processone/eturnal/blob/master/overlay/init/sysv/eturnal +[12]: https://github.com/processone/eturnal/blob/master/overlay/init/openrc/eturnal.initd [13]: https://github.com/processone/eturnal/blob/master/LICENSE diff --git a/QUICK-TEST.md b/doc/QUICK-TEST.md similarity index 100% rename from QUICK-TEST.md rename to doc/QUICK-TEST.md diff --git a/doc/overview.edoc b/doc/overview.edoc index a0af9d67d..6df037967 100644 --- a/doc/overview.edoc +++ b/doc/overview.edoc @@ -33,7 +33,7 @@ clients receive temporary TURN credentials where the user name is comprised of the (Unix) expiry timestamp and the password is derived from a {@section secret} shared between the service generating those credentials and eturnal. The service offering the credentials performs +href="https://github.com/processone/eturnal/blob/1.10.1/examples/make-credentials">performs a `Base64(HMAC-SHA1($secret, $timestamp))' operation to generate the ephemeral password, and eturnal does the same to verify it. @@ -51,7 +51,7 @@ Linux/x64 and Linux/arm64 systems, the binary release can be installed as described in this section. For building eturnal from source, see the INSTALL.md +href="https://github.com/processone/eturnal/blob/1.10.1/doc/INSTALL.md">INSTALL.md file shipped with eturnal's source code archive. diff --git a/docker-k8s/image/Dockerfile.ctng b/docker-k8s/image/Dockerfile.ctng index f6a2e51e7..d4e5f4b39 100644 --- a/docker-k8s/image/Dockerfile.ctng +++ b/docker-k8s/image/Dockerfile.ctng @@ -13,4 +13,4 @@ RUN apt-get update \ WORKDIR /eturnal ENTRYPOINT ["/usr/bin/tini","--"] -CMD ["/eturnal/scripts/make-binaries"] +CMD ["/eturnal/tools/make-binaries"] diff --git a/docker-k8s/image/README.md b/docker-k8s/image/README.md index aa300c500..cfa313a7e 100644 --- a/docker-k8s/image/README.md +++ b/docker-k8s/image/README.md @@ -16,7 +16,7 @@ default build process defined by the build arguments in the `Dockerfile`. C(web) -. SOURCE='web'
VERSION='x.x.x' .-> D; end subgraph install from binary tarball - K[(output from:
scripts/make-binaries)] -. eturnal-*musl*.tar.gz .-> E; + K[(output from:
tools/make-binaries)] -. eturnal-*musl*.tar.gz .-> E; end D(build) == METHOD='build' ==> F; E(package) -. METHOD='package' .-> F; @@ -75,7 +75,7 @@ docker buildx build --load \ ``` Building with `METHOD='package'` requires eturnal binary tarballs built with the -[make-binaries](../../scripts/make-binaries) script from this repository. The +[make-binaries](../../tools/make-binaries) script from this repository. The respective targets must be `x86_64-linux-musl` or `aarch64-linux-musl`. This depends of course on the image variant you want to build. The tarballs must be located in the root of the repository. @@ -108,7 +108,7 @@ hence, `$(uname -m)-linux-gnu` in the targets below. ```shell targets="$(uname -m)-linux-gnu $(uname -m)-linux-musl" -sed -i "s|targets='.*'|targets='$targets'|" $PWD/scripts/make-binaries +sed -i "s|targets='.*'|targets='$targets'|" $PWD/tools/make-binaries docker run --rm -d \ --name ctng-eturnal \ --user $(id -u $(whoami)) \ diff --git a/scripts/examples/check-relay-ip b/examples/check-relay-ip similarity index 100% rename from scripts/examples/check-relay-ip rename to examples/check-relay-ip diff --git a/scripts/examples/make-credentials b/examples/make-credentials similarity index 100% rename from scripts/examples/make-credentials rename to examples/make-credentials diff --git a/scripts/eturnalctl b/overlay/eturnalctl similarity index 100% rename from scripts/eturnalctl rename to overlay/eturnalctl diff --git a/scripts/extensions/credentials b/overlay/extensions/credentials similarity index 100% rename from scripts/extensions/credentials rename to overlay/extensions/credentials diff --git a/scripts/extensions/disconnect b/overlay/extensions/disconnect similarity index 100% rename from scripts/extensions/disconnect rename to overlay/extensions/disconnect diff --git a/scripts/extensions/info b/overlay/extensions/info similarity index 100% rename from scripts/extensions/info rename to overlay/extensions/info diff --git a/scripts/extensions/loglevel b/overlay/extensions/loglevel similarity index 100% rename from scripts/extensions/loglevel rename to overlay/extensions/loglevel diff --git a/scripts/extensions/password b/overlay/extensions/password similarity index 100% rename from scripts/extensions/password rename to overlay/extensions/password diff --git a/scripts/extensions/reload b/overlay/extensions/reload similarity index 100% rename from scripts/extensions/reload rename to overlay/extensions/reload diff --git a/scripts/extensions/sessions b/overlay/extensions/sessions similarity index 100% rename from scripts/extensions/sessions rename to overlay/extensions/sessions diff --git a/scripts/extensions/version b/overlay/extensions/version similarity index 100% rename from scripts/extensions/version rename to overlay/extensions/version diff --git a/scripts/hooks/post_stop b/overlay/hooks/post_stop similarity index 100% rename from scripts/hooks/post_stop rename to overlay/hooks/post_stop diff --git a/scripts/hooks/pre_start b/overlay/hooks/pre_start similarity index 100% rename from scripts/hooks/pre_start rename to overlay/hooks/pre_start diff --git a/config/eturnal.openrc b/overlay/init/openrc/eturnal.confd similarity index 100% rename from config/eturnal.openrc rename to overlay/init/openrc/eturnal.confd diff --git a/scripts/eturnal.openrc b/overlay/init/openrc/eturnal.initd similarity index 100% rename from scripts/eturnal.openrc rename to overlay/init/openrc/eturnal.initd diff --git a/config/eturnal.service b/overlay/init/systemd/eturnal.service similarity index 100% rename from config/eturnal.service rename to overlay/init/systemd/eturnal.service diff --git a/scripts/eturnal.init b/overlay/init/sysv/eturnal similarity index 100% rename from scripts/eturnal.init rename to overlay/init/sysv/eturnal diff --git a/config/eturnal.logrotate b/overlay/logrotate/eturnal similarity index 100% rename from config/eturnal.logrotate rename to overlay/logrotate/eturnal diff --git a/rebar.config b/rebar.config index db56c93e2..8c91c84fe 100644 --- a/rebar.config +++ b/rebar.config @@ -9,7 +9,7 @@ recon]}. {relx, - [{release, {eturnal, {cmd, "scripts/get-version"}}, + [{release, {eturnal, {cmd, "tools/get-version"}}, [eturnal, sasl, recon, @@ -51,22 +51,22 @@ {copy, "CHANGELOG.md", "doc/CHANGELOG.md"}, {copy, "README.md", "doc/README.md"}, {copy, "config/eturnal.yml", "etc/eturnal.yml"}, - {copy, "config/eturnal.openrc", "etc/openrc/eturnal.confd"}, - {copy, "config/eturnal.logrotate", "etc/logrotate.d/eturnal"}, - {copy, "scripts/hooks/pre_start", "bin/hooks/pre_start"}, - {copy, "scripts/hooks/post_stop", "bin/hooks/post_stop"}, - {copy, "scripts/extensions/credentials", "bin/extensions/credentials"}, - {copy, "scripts/extensions/disconnect", "bin/extensions/disconnect"}, - {copy, "scripts/extensions/info", "bin/extensions/info"}, - {copy, "scripts/extensions/loglevel", "bin/extensions/loglevel"}, - {copy, "scripts/extensions/password", "bin/extensions/password"}, - {copy, "scripts/extensions/reload", "bin/extensions/reload"}, - {copy, "scripts/extensions/sessions", "bin/extensions/sessions"}, - {template, "scripts/extensions/version", "bin/extensions/version"}, - {template, "scripts/eturnalctl", "bin/eturnalctl"}, - {template, "scripts/eturnal.init", "etc/init.d/eturnal"}, - {template, "scripts/eturnal.openrc", "etc/openrc/eturnal.initd"}, - {template, "config/eturnal.service", "etc/systemd/system/eturnal.service"}]}]}. + {copy, "overlay/extensions/credentials", "bin/extensions/credentials"}, + {copy, "overlay/extensions/disconnect", "bin/extensions/disconnect"}, + {copy, "overlay/extensions/info", "bin/extensions/info"}, + {copy, "overlay/extensions/loglevel", "bin/extensions/loglevel"}, + {copy, "overlay/extensions/password", "bin/extensions/password"}, + {copy, "overlay/extensions/reload", "bin/extensions/reload"}, + {copy, "overlay/extensions/sessions", "bin/extensions/sessions"}, + {copy, "overlay/hooks/post_stop", "bin/hooks/post_stop"}, + {copy, "overlay/hooks/pre_start", "bin/hooks/pre_start"}, + {copy, "overlay/init/openrc/eturnal.confd", "etc/openrc/eturnal.confd"}, + {copy, "overlay/logrotate/eturnal", "etc/logrotate.d/eturnal"}, + {template, "overlay/eturnalctl", "bin/eturnalctl"}, + {template, "overlay/extensions/version", "bin/extensions/version"}, + {template, "overlay/init/openrc/eturnal.initd", "etc/openrc/eturnal.initd"}, + {template, "overlay/init/sysv/eturnal", "etc/init.d/eturnal"}, + {template, "overlay/init/systemd/eturnal.service", "etc/systemd/system/eturnal.service"}]}]}. {erl_opts, [{platform_define, "^21\.[0-2]\.", old_persistent_term}, @@ -161,7 +161,7 @@ % Distribution packaging: {distro, [{relx, - [{release, {eturnal, {cmd, "scripts/get-version"}}, + [{release, {eturnal, {cmd, "tools/get-version"}}, [eturnal]}, {mode, minimal}, {system_libs, false}]}, @@ -180,7 +180,7 @@ {layout, edoc_layout_chunks}, {dir, "_build/exdoc+docs/lib/eturnal/doc"}]}, {post_hooks, - [{edoc, "ex_doc eturnal $(scripts/get-version) \\ + [{edoc, "ex_doc eturnal $(tools/get-version) \\ \"$REBAR_BUILD_DIR/lib/eturnal/ebin\" \\ --paths '_build/default/lib/*/ebin' \\ --source-ref $(git describe --tags) \\ diff --git a/src/eturnal.app.src b/src/eturnal.app.src index d926791c9..be0f6896d 100644 --- a/src/eturnal.app.src +++ b/src/eturnal.app.src @@ -1,6 +1,6 @@ {application, eturnal, [{description, "STUN/TURN server"}, - {vsn, {cmd, "scripts/get-version"}}, + {vsn, {cmd, "tools/get-version"}}, {mod, {eturnal_app, []}}, {applications, [kernel, diff --git a/scripts/get-version b/tools/get-version similarity index 100% rename from scripts/get-version rename to tools/get-version diff --git a/scripts/make-binaries b/tools/make-binaries similarity index 99% rename from scripts/make-binaries rename to tools/make-binaries index 27379126f..caf283359 100755 --- a/scripts/make-binaries +++ b/tools/make-binaries @@ -32,7 +32,7 @@ then fi rel_name='eturnal' -rel_vsn=$(scripts/get-version) +rel_vsn=$(tools/get-version) rebar_vsn='3.22.0' crosstool_vsn='1.25.0' zlib_vsn='1.2.13' diff --git a/scripts/make-containers b/tools/make-containers similarity index 97% rename from scripts/make-containers rename to tools/make-containers index 554d3606e..267886852 100644 --- a/scripts/make-containers +++ b/tools/make-containers @@ -94,7 +94,7 @@ fi # set build variables rel_name='eturnal' -rel_vsn="$(scripts/get-version)" +rel_vsn="$(tools/get-version)" tag_vsn="$(echo $rel_vsn | sed -e 's|+|-|')" tag_minor="$(echo $tag_vsn | sed -e 's|\.| |2' | awk '{{print $1}}')" tag_major="$(echo $tag_vsn | sed -e 's|\.| |1' | awk '{{print $1}}')" @@ -116,7 +116,7 @@ then if [ ! -f "$PWD/$rel_tarball" ] then echo >&2 'This script requires tarballs built for musl-libc with make-binaries script ...' - echo >&2 'Please execute "scripts/make-binaries" with targets "x86_64-linux-musl" and "aarch64-linux-musl" ...' + echo >&2 'Please execute "tools/make-binaries" with targets "x86_64-linux-musl" and "aarch64-linux-musl" ...' exit 1 fi done diff --git a/scripts/make-installers b/tools/make-installers similarity index 99% rename from scripts/make-installers rename to tools/make-installers index f8dccce00..5e7a4a894 100755 --- a/scripts/make-installers +++ b/tools/make-installers @@ -32,7 +32,7 @@ else fi rel_name='eturnal' -rel_vsn="$(scripts/get-version)" +rel_vsn="$(tools/get-version)" rel_dir="/opt/$rel_name" conf_file="/etc/$rel_name.yml" tmp_dir=$(mktemp -d "/tmp/.$rel_name.XXXXXX") diff --git a/scripts/make-packages b/tools/make-packages similarity index 99% rename from scripts/make-packages rename to tools/make-packages index f52f913bf..04b371415 100755 --- a/scripts/make-packages +++ b/tools/make-packages @@ -43,7 +43,7 @@ then fi rel_name='eturnal' -rel_vsn="$(scripts/get-version)" +rel_vsn="$(tools/get-version)" tmp_dir=$(mktemp -d "/tmp/.$myself.XXXXXX") trap 'rm -rf "$tmp_dir"' INT TERM EXIT diff --git a/scripts/make-release b/tools/make-release similarity index 82% rename from scripts/make-release rename to tools/make-release index c46c9f681..bbc9431cf 100755 --- a/scripts/make-release +++ b/tools/make-release @@ -59,13 +59,13 @@ then fi echo "$myself: Editing repository files ..." -sed -i -e "s|^rel_vsn=.*|rel_vsn='$new_vsn'|" 'scripts/get-version' +sed -i -e "s|^rel_vsn=.*|rel_vsn='$new_vsn'|" 'tools/get-version' sed -i -e "s|^$old_vsn-r.*|$new_vsn-r0|" 'docker-k8s/pkgrel' sed -i -e "s|$(echo "$old_vsn" | sed 's/\./\\./g')|$new_vsn|g" \ - 'README.md' 'INSTALL.md' 'QUICK-TEST.md' 'doc/overview.edoc' \ + 'README.md' 'doc/INSTALL.md' 'doc/QUICK-TEST.md' 'doc/overview.edoc' \ 'docker-k8s/README.md' sed -i -e "s|^rebar_vsn=.*|rebar_vsn='$rebar_vsn'|" \ - 'scripts/make-source' 'scripts/make-binaries' + 'tools/make-source' 'tools/make-binaries' sed -i -e "s|compare/$old_vsn|compare/$new_vsn|" \ -e "s|^## \[Unreleased\]$|&\\ \\ @@ -74,9 +74,10 @@ sed -i -e "s|compare/$old_vsn|compare/$new_vsn|" \ &|" 'CHANGELOG.md' echo "$myself: Committing result ..." -git add 'rebar.config' 'CHANGELOG.md' 'README.md' 'INSTALL.md' 'QUICK-TEST.md' \ - 'doc/overview.edoc' 'docker-k8s/README.md' 'docker-k8s/pkgrel' \ - 'scripts/get-version' 'scripts/make-source' 'scripts/make-binaries' +git add 'rebar.config' 'CHANGELOG.md' 'README.md' 'doc/INSTALL.md' \ + 'doc/QUICK-TEST.md' 'doc/overview.edoc' 'docker-k8s/README.md' \ + 'docker-k8s/pkgrel' 'tools/get-version' 'tools/make-source' \ + 'tools/make-binaries' git commit -m "Release $new_vsn" git -P show read -p "$myself: Does the commit look fine? (y/n) [n] " response @@ -101,9 +102,9 @@ sed -e 's|stylesheet.css|/stylesheet.css|' \ -e '/Generated by EDoc/d' \ 'doc/overview-summary.html' >'index.html' -scripts/make-source -scripts/make-binaries -scripts/make-installers -scripts/make-packages 2>&1 | tail -n 1 +tools/make-source +tools/make-binaries +tools/make-installers +tools/make-packages 2>&1 | tail -n 1 -echo "$myself: If everything looks fine, run scripts/publish-release." +echo "$myself: If everything looks fine, run tools/publish-release." diff --git a/scripts/make-source b/tools/make-source similarity index 97% rename from scripts/make-source rename to tools/make-source index 03da69d21..5b08ef713 100755 --- a/scripts/make-source +++ b/tools/make-source @@ -29,7 +29,7 @@ then fi rel_name='eturnal' -rel_vsn="$(scripts/get-version)" +rel_vsn="$(tools/get-version)" rebar_vsn='3.22.0' rel_dir="$rel_name-$rel_vsn" rel_tar="$rel_dir.tar" diff --git a/scripts/publish-release b/tools/publish-release similarity index 97% rename from scripts/publish-release rename to tools/publish-release index ba76cf871..4b33f0603 100755 --- a/scripts/publish-release +++ b/tools/publish-release @@ -10,7 +10,7 @@ PATH="$HOME/.cache/rebar3/bin:$HOME/.mix/escripts:$PATH" export PATH rel_name='eturnal' -rel_vsn="$(scripts/get-version | sed 's/+.*//')" +rel_vsn="$(tools/get-version | sed 's/+.*//')" prefix="/home/$rel_name" web_root_dir="$prefix/web" deb_repo_dir="/repositories/$rel_name/deb" diff --git a/windows/make-installer b/windows/make-installer index d743e9775..64d32a22b 100755 --- a/windows/make-installer +++ b/windows/make-installer @@ -37,7 +37,7 @@ then fi rel_name='eturnal' -rel_vsn=$(scripts/get-version) +rel_vsn=$(tools/get-version) inno_dep_installer_url='https://github.com/DomGries/InnoDependencyInstaller.git' echo "$myself: Creating Windows installer for $rel_name $rel_vsn." @@ -45,7 +45,7 @@ echo "$myself: Creating Windows installer for $rel_name $rel_vsn." echo "$myself: Editing $rel_name repository files ..." sed -i "s|@VERSION@|$rel_vsn|" \ "windows/$rel_name.iss" 'windows/delay-start.cmd' -sed -i "s|{cmd, *\"scripts/get-version\"}|\"$rel_vsn\"|" \ +sed -i "s|{cmd, *\"tools/get-version\"}|\"$rel_vsn\"|" \ 'rebar.config' "src/$rel_name.app.src" grep -q 'mkdir, "log"' 'rebar.config' || sed -i '/copy.*README/a\