Skip to content

Commit

Permalink
Refine DigitalOcean droplet image. v1.0.302
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Aug 7, 2023
1 parent 1cc1dbd commit 1523c92
Show file tree
Hide file tree
Showing 28 changed files with 154 additions and 357 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ jobs:
src: ossrs/srs-cloud:${{ env.SRS_TAG }}
dst: |
ossrs/srs-cloud:${{ env.SRS_MAJOR }}
ossrs/srs-terraform:${{ env.SRS_TAG }}
ossrs/srs-terraform:${{ env.SRS_MAJOR }}
runs-on: ubuntu-20.04

aliyun:
Expand All @@ -93,6 +91,4 @@ jobs:
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-cloud:${{ env.SRS_TAG }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-cloud:${{ env.SRS_MAJOR }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-terraform:${{ env.SRS_TAG }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-terraform:${{ env.SRS_MAJOR }}
runs-on: ubuntu-20.04
4 changes: 0 additions & 4 deletions .github/workflows/focal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ jobs:
src: ossrs/srs-cloud:${{ env.SRS_TAG }}
dst: |
ossrs/srs-cloud:${{ env.SRS_MAJOR }}
ossrs/srs-terraform:${{ env.SRS_TAG }}
ossrs/srs-terraform:${{ env.SRS_MAJOR }}
runs-on: ubuntu-20.04

aliyun:
Expand All @@ -93,6 +91,4 @@ jobs:
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-cloud:${{ env.SRS_TAG }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-cloud:${{ env.SRS_MAJOR }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-terraform:${{ env.SRS_TAG }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-terraform:${{ env.SRS_MAJOR }}
runs-on: ubuntu-20.04
2 changes: 0 additions & 2 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ jobs:
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-cloud:${{ env.SRS_TAG }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-cloud:${{ env.SRS_MAJOR }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-terraform:${{ env.SRS_TAG }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-terraform:${{ env.SRS_MAJOR }}
runs-on: ubuntu-20.04

k8s:
Expand Down
31 changes: 27 additions & 4 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Build a docker image:
```bash
docker rm -f script 2>/dev/null || echo 'OK' &&
docker rmi srs-script-dev 2>/dev/null || echo 'OK' &&
docker build -t srs-script-dev -f Dockerfile.script .
docker build -t srs-script-dev -f scripts/setup-ubuntu/Dockerfile.script .
```

Create a docker container in daemon:
Expand Down Expand Up @@ -316,7 +316,7 @@ bash scripts/tools/secret.sh --output test/.env &&
docker exec -it script ./test/srs-cloud.test -test.v -wait-ready -endpoint http://localhost:2022 \
-srs-log=true -wait-ready=true -init-password=false \
-check-api-secret=true \
-test.parallel 3
-test.parallel 8
```

Access the browser: [http://localhost:2022](http://localhost:2022)
Expand Down Expand Up @@ -390,7 +390,7 @@ bash scripts/tools/secret.sh --output test/.env &&
docker exec -it aapanel ./test/srs-cloud.test -test.v -wait-ready -endpoint http://srs.cloud.local:80 \
-srs-log=true -wait-ready=true -init-password=false \
-check-api-secret=true \
-test.parallel 3
-test.parallel 8
```

Open [http://localhost:7800/srscloud](http://localhost:7800/srscloud) to install plugin.
Expand Down Expand Up @@ -473,7 +473,7 @@ bash scripts/tools/secret.sh --output test/.env &&
docker exec -it bt ./test/srs-cloud.test -test.v -wait-ready -endpoint http://srs.cloud.local:80 \
-srs-log=true -wait-ready=true -init-password=false \
-check-api-secret=true \
-test.parallel 3
-test.parallel 8
```

Open [http://localhost:7800/srscloud](http://localhost:7800/srscloud) to install plugin.
Expand All @@ -483,3 +483,26 @@ Open [http://localhost:7800/srscloud](http://localhost:7800/srscloud) to install
In the [application store](http://localhost:7800/soft), there is a `srs_cloud` plugin. After test, you can install the plugin
`build/bt-srs_cloud.zip` to production BT panel.

## Develop the Droplet Image

To build SRS droplet image for [DigitalOcean Marketplace](https://marketplace.digitalocean.com/).

For the first run, please [install Packer](https://www.packer.io/intro/getting-started/install.html) and plugin:

```bash
brew tap hashicorp/tap &&
brew install hashicorp/tap/packer &&
PACKER_LOG=1 packer plugins install github.com/digitalocean/digitalocean v1.1.1
```

Start to build SRS image by:

```bash
(cd scripts/setup-droplet &&
export DIGITALOCEAN_TOKEN=$(grep market "${HOME}/Library/Application Support/doctl/config.yaml" |grep -v context |awk '{print $2}') &&
packer build srs.json)
```

> Note: You can also create a [token](https://cloud.digitalocean.com/account/api/tokens) and setup the env `DIGITALOCEAN_TOKEN`.
Please check the [snapshot](https://cloud.digitalocean.com/images/snapshots/droplets).
30 changes: 0 additions & 30 deletions Dockerfile.dev

This file was deleted.

3 changes: 1 addition & 2 deletions focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ COPY --from=redis /usr/local/bin/redis-server /usr/local/bin/redis-server
ENV PORT=":2024" NODE_ENV=production SRS_DOCKERIZED=true MGMT_DOCKER=true PLATFORM_DOCKER=true CLOUD=DOCKER

# Create link for compatible reason.
RUN ln -sf /usr/local/srs-cloud /usr/local/srs-terraform && \
mkdir -p /usr/local/lighthouse/softwares && \
RUN mkdir -p /usr/local/lighthouse/softwares && \
ln -sf /usr/local/srs-cloud /usr/local/lighthouse/softwares/srs-cloud

# Setup the work directory to platform.
Expand Down
4 changes: 0 additions & 4 deletions platform/containers/conf/conf.d/nginx.http.conf

This file was deleted.

8 changes: 0 additions & 8 deletions platform/containers/conf/conf.d/nginx.server.conf

This file was deleted.

6 changes: 0 additions & 6 deletions platform/containers/conf/default.d/00.default.conf

This file was deleted.

19 changes: 0 additions & 19 deletions platform/containers/conf/default.d/10.mgmt.conf

This file was deleted.

19 changes: 0 additions & 19 deletions platform/containers/conf/default.d/20.srs.conf

This file was deleted.

8 changes: 0 additions & 8 deletions platform/containers/conf/default.d/90.dvr.preview.conf

This file was deleted.

23 changes: 19 additions & 4 deletions platform/containers/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,24 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
#SRS-HTTP-START
include /data/config/nginx.http.conf;
#SRS-HTTP-END

server {
listen 80 default_server;
server_name srs.cloud.local;

#SRS-SERVER-START
include /data/config/nginx.server.conf;
#SRS-SERVER-END

#SRS-PROXY-START
location / {
proxy_pass http://127.0.0.1:2022;
proxy_set_header Host $host;
}
#SRS-PROXY-END
}
}

2 changes: 1 addition & 1 deletion platform/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
package main

// The version for platform.
const version = "v1.0.301"
const version = "v1.0.302"
1 change: 0 additions & 1 deletion releases/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ FROM ${ARCH}ossrs/srs-cloud:focal-1 AS dist
COPY --from=build /g/releases/releases /usr/local/srs-cloud/releases/releases

ENV PORT=":9000"
RUN ln -sf /usr/local/srs-cloud /usr/local/srs-terraform
WORKDIR /usr/local/srs-cloud/releases
CMD ["./releases"]
2 changes: 1 addition & 1 deletion releases/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package main

// The latest version of SRS Cloud.
const latest = "v1.0.301"
const latest = "v1.0.302"

// The api service version of SRS Cloud.
const api = "v1.0.374"
Expand Down
14 changes: 0 additions & 14 deletions scripts/setup-aapanel/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/setup-aapanel/do_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ Uninstall() {
rm -rf $INSTALL_HOME
echo "Remove install $INSTALL_HOME ok"

SRS_ALIAS=/usr/local/srs-terraform
rm -rf $SRS_HOME $SRS_ALIAS
echo "Remove srs home $SRS_HOME ok"

rm -f ~/credentials.txt
echo "Remove credentials.txt"

Expand Down
30 changes: 0 additions & 30 deletions scripts/setup-bt/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/setup-bt/do_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ Uninstall() {
rm -rf $INSTALL_HOME
echo "Remove install $INSTALL_HOME ok"

SRS_ALIAS=/usr/local/srs-terraform
rm -rf $SRS_HOME $SRS_ALIAS
echo "Remove srs home $SRS_HOME ok"

rm -f ~/credentials.txt
echo "Remove credentials.txt"

Expand Down
42 changes: 0 additions & 42 deletions scripts/setup-droplet/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/setup-droplet/files/etc/update-motd.d/99-one-click
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ On the server:
For help and more information, visit https://discord.gg/bQUPDRqy79
********************************************************************************
To delete this message of the day: rm -rf $(readlink -f ${0})
To delete this message of the day: rm -f $(readlink -f ${0})
EOF
Loading

0 comments on commit 1523c92

Please sign in to comment.