Skip to content

Commit

Permalink
Update DO droplet.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Aug 7, 2023
1 parent 1cc1dbd commit 53e4aed
Show file tree
Hide file tree
Showing 25 changed files with 166 additions and 352 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
47 changes: 43 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,42 @@ 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/).

First of all, please create a [token](https://cloud.digitalocean.com/account/api/tokens) and setup the env
`DIGITALOCEAN_TOKEN`, for example:

```bash
export DIGITALOCEAN_TOKEN=$(grep access-token "${HOME}/Library/Application Support/doctl/config.yaml" |awk '{print $2}')
```

Then [install Packer](https://www.packer.io/intro/getting-started/install.html):

```bash
brew tap hashicorp/tap
brew install hashicorp/tap/packer
```

Next, install the plugin:

```bash
PACKER_LOG=1 packer plugins install \
github.com/digitalocean/digitalocean v1.1.1
```

Finally, start to build SRS image by:

```bash
packer build srs.json
```

or from root:

```bash
cd scripts/setup-droplet
PACKER_LOG=1 packer build srs.json
```

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
}
}

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"]
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 53e4aed

Please sign in to comment.