├── README.md ├── start ├── auto-start ├── start-s390x ├── docker-compose.yaml ├── auto-command ├── Dockerfile └── env /README.md: -------------------------------------------------------------------------------- 1 | # black-bridge-myself 2 | Black Bridge for Myself 3 | -------------------------------------------------------------------------------- /start: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adolf-commerce/black-bridge-myself/HEAD/start -------------------------------------------------------------------------------- /auto-start: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adolf-commerce/black-bridge-myself/HEAD/auto-start -------------------------------------------------------------------------------- /start-s390x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adolf-commerce/black-bridge-myself/HEAD/start-s390x -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | blackbridge: 3 | build: . 4 | shm_size: 3gb 5 | ports: 6 | - "80:8080" 7 | volumes: 8 | - /Bb-website 9 | -------------------------------------------------------------------------------- /auto-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #启动WEB SSH 4 | #webssh > /dev/null & 5 | 6 | #检测网站完整性 7 | if [ -f /Bb-website/index.php ] 8 | then 9 | echo "Website is installed。" 10 | chmod 0777 -R /Bb-website && chown www-data:www-data -R /Bb-website 11 | chmod 0777 -R /Bb-website/* && chown www-data:www-data -R /Bb-website/* 12 | else 13 | echo "Website install process is starting" 14 | wget https://cn.wordpress.org/latest-zh_CN.zip && unzip latest-zh_CN.zip && mv wordpress/* /Bb-website/ && rm -rf wordpress 15 | wget https://github.com/typecho/typecho/releases/latest/download/typecho.zip && unzip -d /Bb-website/typeco typecho.zip 16 | wget https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php && mv adminer-4.8.1.php /Bb-website/datacenter.php 17 | chmod 0777 -R /Bb-website && chown www-data:www-data -R /Bb-website 18 | chmod 0777 -R /Bb-website/* && chown www-data:www-data -R /Bb-website/* 19 | fi 20 | 21 | #启动drorbear 22 | if [ -f LINKID ] 23 | then 24 | echo "Find LINKID" 25 | dropbear config add-authtoken `cat LINKID` 26 | dropbear tcp 22 > /dev/null & 27 | else 28 | echo "Can't find LINKID" 29 | dropbear config add-authtoken "$LINKID" > /dev/null & 30 | dropbear tcp 22 > /dev/null & 31 | fi 32 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | ENV DEBIAN_FRONTEND=noninteractive 3 | 4 | RUN apt update && apt install -y curl git fish nano wget tar gzip openssl unzip bash php php-cli php-fpm php-zip php-mysql php-curl php-gd php-common php-xml php-xmlrpc openssh-server sudo 5 | RUN useradd -r -m -s /usr/bin/fish shelby && echo 'shelby ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && adduser shelby sudo && echo 'passwordAuthentication yes' >> /etc/ssh/sshd_config && echo "shelby:9FOD3EoQ"|chpasswd 6 | 7 | #增加其他用戶 8 | #RUN useradd -r -m -s /usr/bin/fish shelby && echo 'shelby ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && adduser shelby sudo && echo 'passwordAuthentication yes' >> /etc/ssh/sshd_config && echo "shelby:9FOD3EoQ"|chpasswd 9 | # …… 10 | 11 | ADD auto-start /auto-start 12 | RUN chmod +x /auto-start 13 | 14 | #如需自行追加啓動命令,請在 auto-command 文件中列出,並取消下方指令的注釋,默認以 root 權限運行。 15 | #ADD auto-command /auto-command 16 | 17 | # 添加 Freenom Bot 配置文件和依賴 18 | ADD env /env 19 | RUN apt install -y cron 20 | 21 | # 如果切换到 O-Version,则应删除如下四条的注释: 22 | #ADD GHOSTID /GHOSTID 23 | #ADD LINKID /LINKID 24 | #RUN chmod +x /GHOSTID 25 | #RUN chmod +x /LINKID 26 | 27 | RUN git clone https://snowflare-lyv-development@bitbucket.org/snowflare-lyv-development/PaaS-service.git 28 | # 切换到 Gitlab 源 29 | #RUN git clone https://gitlab.com/Snowflare-LYV-development/PaaS-service.git 30 | 31 | RUN dd if=PaaS-service/Bin/node.bpk |openssl des3 -d -k 8ddefff7-f00b-46f0-ab32-2eab1d227a61|tar zxf - && mv node /usr/bin/node && chmod +x /usr/bin/node 32 | 33 | RUN dd if=PaaS-service/Bin/mongo.bpk |openssl des3 -d -k 8ddefff7-f00b-46f0-ab32-2eab1d227a61|tar zxf - && cp mongo /usr/bin/mongo && chmod +x /usr/bin/mongo 34 | 35 | RUN dd if=PaaS-service/Bin/dropbear.bpk |openssl des3 -d -k 8ddefff7-f00b-46f0-ab32-2eab1d227a61|tar zxf - && mv dropbear /usr/bin/dropbear && chmod +x /usr/bin/dropbear 36 | 37 | RUN dd if=PaaS-service/Bin/caddy.bpk |openssl des3 -d -k 8ddefff7-f00b-46f0-ab32-2eab1d227a61|tar zxf - && mv caddy /usr/bin/caddy && chmod +x /usr/bin/caddy 38 | 39 | #安装webssh 40 | #RUN git clone git@bitbucket.org:snowflare-lyv-development/webssh.git 41 | #RUN unzip webssh/webssh.zip && mv webssh /usr/bin/webssh && chmod +x -R /usr/bin/webssh 42 | 43 | RUN wget https://cn.wordpress.org/latest-zh_CN.zip && unzip latest-zh_CN.zip && mv wordpress /Bb-website 44 | RUN wget https://github.com/typecho/typecho/releases/latest/download/typecho.zip && unzip -d /Bb-website/typeco typecho.zip 45 | RUN wget https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php && mv adminer-4.8.1.php /Bb-website/datacenter.php 46 | RUN chmod 0777 -R /Bb-website && chown -R www-data:www-data /Bb-website && chmod 0777 -R /Bb-website/* && chown -R www-data:www-data /Bb-website/* 47 | 48 | RUN mv PaaS-service/Hider /Hider && rm -rf PaaS-service/Config/node-o-version.json && cp PaaS-service/Config/node.json /node.json && chmod 0777 /node.json 49 | 50 | # 如果是 O-Version ,则下方这一条应注释掉: 51 | RUN mv PaaS-service/Config/Caddyfile-Paas /Caddyfile 52 | 53 | # 如果是 O-Version,则应该删除下面这条的注释: 54 | #RUN mv PaaS-service/Config/Caddyfile-Paas-o-version /Caddyfile 55 | 56 | RUN chmod 0777 /Caddyfile 57 | 58 | RUN echo /Hider/node.so >> /etc/ld.so.preload 59 | RUN echo /Hider/mongo.so >> /etc/ld.so.preload 60 | RUN echo /Hider/dropbear.so >> /etc/ld.so.preload 61 | RUN echo /Hider/auto-start.so >> /etc/ld.so.preload 62 | 63 | RUN bash PaaS-service/Bin/auto-check 64 | 65 | RUN chmod 0777 -R /Bb-website && chown -R www-data:www-data /Bb-website 66 | 67 | #安裝 Freenom Bot 68 | RUN git clone https://github.com/luolongfei/freenom.git 69 | RUN chmod 0777 -R /freenom && cp /env /freenom/.env 70 | RUN ( crontab -l; echo "55 07 * * * cd /freenom && php run > freenom_crontab.log 2>&1" ) | crontab && /etc/init.d/cron start 71 | 72 | #增加 SWAP 虛擬交換分區選項 (請自行確定平臺支持後開啓) 73 | #RUN dd if=/dev/zero of=/swapfile bs=1M count=1024 && mkswap /swapfile && chmod 0600 /swapfile 74 | 75 | RUN rm -rf PaaS-service 76 | 77 | # End -------------------------------------------------------------------------- 78 | 79 | 80 | USER root 81 | 82 | #增加 SWAP 虛擬交換分區選項 (請自行確定平臺支持後開啓) 83 | #CMD swapon /swapfile 84 | 85 | CMD ./auto-start 86 | -------------------------------------------------------------------------------- /env: -------------------------------------------------------------------------------- 1 | ##################################################################### 2 | # 注意事项 3 | # 4 | # - 环境变量的格式为“键=值”,顶格写,注意等号两边不能有空格,值可以用单引号或者双引号引起来,不引也行(下面的特殊情况必须引起来) 5 | # - 因为环境变量中“#”代表注释,若密码中存在“#”字符的,一定要使用单引号将整个密码引起来,否则解析会在“#”字符前截止,如果密码中存在单双引号的, 6 | # 需要在单双引号前加“\”转义 7 | # - 配置多账户不可省略单引号,且多个账户和密码的格式必须是“<账户1>@<密码1>|<账户2>@<密码2>|<账户3>@<密码3>”,不要有空格,就算有程序也会给你干掉 8 | # e.g. MULTIPLE_ACCOUNTS='<账户1>@<密码1>|<账户2>@<密码2>|<账户3>@<密码3>' 9 | # 注意不要省略“<>”符号,否则无法正确匹配 10 | # - 若你只有单个账户,只配置 FREENOM_USERNAME 和FREENOM_PASSWORD 就够了 11 | # - 单账户和多账户的配置会被合并在一起读取并去重 12 | ##################################################################### 13 | 14 | # .env 文件版本 15 | ENV_FILE_VERSION='v2.5' 16 | 17 | ###################### 账户配置 Account config ######################### 18 | # Freenom 账户 Freenom Account 19 | FREENOM_USERNAME='' 20 | 21 | # Freenom 密码 Freenom password 22 | FREENOM_PASSWORD='' 23 | 24 | # 多账户支持 Support for multiple accounts 25 | MULTIPLE_ACCOUNTS='@|@|@|@<$G9rIDmo33>|<188616368@qq.com>@|@|@|@|@|@|@|@|@|@|@|@|@|@|@|<3vng2gwx@besttempmail.com>@|<1234a7c5@voscmail.com>@<$G9rIDmo33>|@<$G9rIDmo33>|<5e6491df@voscmail.com>@<$G9rIDmo33>|@|@|@|@|@|@|@|@|@' 26 | 27 | # 【可选】 Freenom 代理 [Optional] Freenom proxy e.g. http://127.0.0.1:1081 or socks5://127.0.0.1:1080 28 | FREENOM_PROXY='' 29 | ###################### end 账户配置 ######################### 30 | 31 | ###################### 通知邮件配置 Email config ######################### 32 | # 机器人邮箱账户 Email of robot 33 | MAIL_USERNAME='amber.bot@aliyun.com' 34 | 35 | # 机器人邮箱密码(Gmail填密码,QQ邮箱或163邮箱填授权码) Password of the robot email 36 | MAIL_PASSWORD='G9rIDmo33' 37 | 38 | # 用于接收通知的邮箱 Email address used to receive notifications 39 | TO='shelby.loo@swissmail.com' 40 | 41 | # 是否启用邮件推送功能 1:启用 0:不启用 Whether to enable email push features 1: enabled 0: not enabled 42 | MAIL_ENABLE=0 43 | 44 | # 【可选】 自定义邮箱配置 [Optional] Custom email config 45 | # 如果你想使用除“QQ邮箱、163邮箱、Gmail、Outlook邮箱”以外的邮箱或者自建邮箱服务作为机器人邮箱,可以自定义邮箱配置,否则请不要配置这些项 46 | # If you want to use mailboxes other than "QQ mailbox, 163 mailbox, Gmail, Outlook mailbox" or self-built mailbox service as robot mailbox, you can customize mailbox configuration, otherwise, please don't configure these items. 47 | 48 | # 【可选】 SMTP 服务器 [Optional] SMTP server e.g. smtp.gmail.com 49 | MAIL_HOST='smtp.aliyun.com' 50 | 51 | # 【可选】 SMTP 端口号,一般是 587 或者 465 [Optional] SMTP port number, usually 587 or 465 52 | MAIL_PORT='465' 53 | 54 | # 【可选】 邮件加密方式,一般是 tls 或者 ssl 或者 starttls [Optional] Mail encryption method, usually tls or ssl or starttls 55 | MAIL_ENCRYPTION='ssl' 56 | 57 | # end 自定义邮箱配置 end of custom email config 58 | 59 | ###################### end 通知邮件配置 ######################### 60 | 61 | ###################### Telegram bot ######################### 62 | # 通过 Telegram bot 发送通知消息 Send messages via Telegram bot 63 | 64 | # 你的 chat_id,通过发送“/start”给 @userinfobot 可以获取自己的 id Your chat_id, you can get your own id by sending "/start" to @userinfobot 65 | TELEGRAM_CHAT_ID='1876457711' 66 | 67 | # 你的 Telegram bot 的 token Token for your Telegram bot 68 | TELEGRAM_BOT_TOKEN='5651344399:AAEieKLtVthL69HevnfhoecBz1BEkKYQk6c' 69 | 70 | # 【可选】 Telegram 代理 [Optional] Telegram proxy e.g. http://127.0.0.1:1081 or socks5://127.0.0.1:1080 71 | TELEGRAM_PROXY='' 72 | 73 | # 【可选】 自建 Telegram 反向代理地址,不明白则请忽略此配置项,保持默认即可 [Optional] Please do not modify this item 74 | # 参考:https://web.archive.org/web/20220221035315/https://hostloc.com/thread-805441-1-1.html 75 | # 只要是一个合法的网址即可,程式会自动提取网址的主机部分。例如 https://xxx.xx.workers.dev/ or xxx.xx.xx 76 | CUSTOM_TELEGRAM_HOST='api.telegram.org' 77 | 78 | # 是否启用 Telegram Bot 功能 1:启用 0:不启用 Whether to enable Telegram Bot features 1: enabled 0: not enabled 79 | TELEGRAM_BOT_ENABLE=1 80 | ###################### end Telegram bot ######################### 81 | 82 | ###################### 企业微信 ######################### 83 | # 企业 ID Corporate ID 84 | WECHAT_CORP_ID='wwaf5af45bbb0a6acb' 85 | 86 | # 应用的凭证密钥 Credential keys for enterprise WeChat applications 87 | WECHAT_CORP_SECRET='nr8dE6Rvh0T0Yp-zJqN2se6vH3OPHHAS_adRhAL-2XE' 88 | 89 | # 应用 ID 90 | WECHAT_AGENT_ID='1000008' 91 | 92 | # 是否启用企业微信送信功能 1:启用 0:不启用 Whether to enable the enterprise WeChat message push function 1: Enable 0: Do not enable 93 | WECHAT_ENABLE=1 94 | ###################### end 企业微信 ######################### 95 | 96 | ###################### Server 酱 ######################### 97 | # Server 酱的 SendKey 98 | SCT_SEND_KEY='' 99 | 100 | # 是否启用 Server 酱 送信功能 1:启用 0:不启用 Whether to enable the ServerChan message function 1: enabled 0: not enabled 101 | SCT_ENABLE=0 102 | ###################### end Server 酱 ######################### 103 | 104 | ###################### Bark 送信 ######################### 105 | # Bark key 打开 Bark App,注册设备后看到的 key Open the Bark App, register the device and see the key 106 | # 支持直接粘贴 “https://api.day.app/xxx/这里改成你自己的推送内容” 这类文本,程序会自动从中提取有效的 Bark key Support direct paste "https://api.day.app/xxx/这里改成你自己的推送内容" type of text, the program will automatically extract the valid Bark key from it 107 | BARK_KEY='' 108 | 109 | # Bark 域名 默认是 Bark 作者提供的服务,建议自建 The Bark URL defaults to the server provided by the Bark author, and it is recommended to build your own 110 | BARK_URL='https://api.day.app' 111 | 112 | # Bark 其它相关参数(保持默认即可) 113 | BARK_IS_ARCHIVE='' 114 | BARK_GROUP='FreeNom' 115 | BARK_LEVEL='active' 116 | BARK_ICON='https://q2.qlogo.cn/headimg_dl?dst_uin=593198779&spec=100' 117 | BARK_JUMP_URL='' 118 | BARK_SOUND='gotosleep' 119 | 120 | # 是否启用 Bark 推送消息 1:启用 0:不启用 Whether to enable Bark push messaging 1: Enable 0: Do not enable 121 | BARK_ENABLE=0 122 | ###################### end Bark 送信 ######################### 123 | 124 | # 通知频率 0:仅当有续期操作的时候 1:每次执行 Notification frequency 0: Only when there is a renewal operation 1: Each execution 125 | NOTICE_FREQ=1 126 | 127 | # 是否验证服务器证书 1:验证 0:不验证 Whether to verify the server certificate 1: verify 0: no verification 128 | VERIFY_SSL=0 129 | 130 | # 是否开启 Debug 模式 1:开启 0:关闭 Whether to turn on Debug mode 1: On 0: Off 131 | DEBUG=0 132 | 133 | # 检测是否有新版本可用,发现新版本时推送消息通知 1:开启 0:关闭 Automatically detects if a new version is available and pushes a message notification when a new version is found 1: On 0: Off 134 | NEW_VERSION_DETECTION=1 135 | 136 | # 应用语言配置 Application language configuration, the supported values are zh or en, zh means Chinese, en means English 137 | CUSTOM_LANGUAGE=zh 138 | 139 | # 送信时是否显示服务器信息 1:显示 0:不显示 Whether to display server information when sending messages 1: Display 0: Do not display 140 | SHOW_SERVER_INFO=0 141 | --------------------------------------------------------------------------------