Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Version 2.0.2
Browse files Browse the repository at this point in the history
- Applied multiple optimizations to Docker stuff
- Updated README

.
  • Loading branch information
SoftCreatR committed Sep 20, 2020
1 parent d72951d commit ca0f0df
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 36 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ Edit the file `docker-compose.yml` and configure Warp-Up. See [warp-up.conf.dist
When done, run:

```bash
sudo docker-compose build
sudo docker-compose run
sudo docker build --tag warp-up:latest .
sudo docker run -it warp-up
```

#### Options available
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Warp-Up
description: Automatically generated referrer bonuses for Cloudflare WARP.
logo: /warp-up-logo.png
Expand Down
20 changes: 6 additions & 14 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
FROM bitnami/minideb:latest
MAINTAINER Sascha Greuel <[email protected]>
LABEL maintainer="Sascha Greuel <[email protected]>"

# Disable prompts from apt.
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update -y &&\
apt-get install -y --no-install-recommends \
git \
curl \
RUN install_packages \
bash \
ca-certificates \
ncurses-bin && \
apt-get autoremove -y && \
curl && \
apt-get clean -y && \
rm -rf /tmp/* /var/tmp/* /var/cache/apt/archives/* /var/lib/apt/lists/*

RUN git clone https://github.com/SoftCreatR/warp-up.git /root/warp-up
RUN curl -sL 1-2.dev/warp-up -o /root/warp-up.sh && \
chmod +x /root/warp-up.sh

RUN apt-get remove git -y

WORKDIR /root/warp-up/

ENTRYPOINT ["/bin/bash", "warp-up.sh", "--id $REFERRER", "--iterations $ITERATIONS", "--interval $INTERVAL", "--log-file $LOG_FILE", "--disclaimer"]
ENTRYPOINT ["/root/warp-up.sh"]
8 changes: 2 additions & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
---
version: "3"

services:
warp-up:
image: warp-up:latest
build: .
container_name: warp-up
# Apply your configuration here
environment:
- REFERRER=
- ITERATIONS=
- INTERVAL=20
- LOG_FILE=warp-up.log
tty: true
38 changes: 24 additions & 14 deletions warp-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# for Cloudflare WARP. #
# #
# Author : Sascha Greuel <[email protected]> #
# Date : 2020-09-18 20:24 #
# Date : 2020-09-20 21:36 #
# License : MIT #
# Version : 2.0.1 #
# Version : 2.0.2 #
# #
# Usage : bash warp-up.sh #
##############################################################
Expand Down Expand Up @@ -191,7 +191,7 @@ warpUp() {
warp_enabled ^false \
tos "$(date '+%Y-%m-%dT%T.000%:z')" \
type Android \
locale "$(locale | grep LANG= | cut -d= -f2 | cut -d. -f1)"
locale "en_US"
)"

{
Expand All @@ -218,7 +218,19 @@ warpUp() {
else
FAILURE=$((FAILURE + 1))

echo "$(date): $API_RESPONSE"
if [[ $API_RESPONSE == *"Access denied"* ]]; then
echo -ne "\ec"
echo ""
echo -e "${CRED}Unable to establish an API connection. Aborting.${CEND}"
echo ""
echo ""

exit 1
elif [[ $API_RESPONSE == "Internal Server Error" ]]; then
echo "$(date): Failure: Internal Server Error. If this problem persists, restart Warp-Up with an increased request interval."
else
echo "$(date): Failure."
fi
fi
} >>"$LOG_FILE" 2>&1
}
Expand All @@ -228,7 +240,7 @@ warpUp() {
#######

if [ -z "$TRAVIS_BUILD" ] && [ -z "$DISCLAIMER_AGREE" ]; then
clear
echo -ne "\ec"

echo " DISCLAIMER"
echo ""
Expand All @@ -253,7 +265,7 @@ if [ -z "$TRAVIS_BUILD" ] && [ -z "$DISCLAIMER_AGREE" ]; then
echo ""

while true; do
read -rp " Do you agree? (y/n): " yn </dev/tty
read -rep " Do you agree? (y/n): " yn </dev/tty

case $yn in
[Yy]*)
Expand All @@ -273,7 +285,7 @@ if [ -z "$TRAVIS_BUILD" ] && [ -z "$DISCLAIMER_AGREE" ]; then
done
fi

clear
echo -ne "\ec"

WELCOME_TXT="Welcome to Warp Up - $WARP_UP_VER"
WELCOME_LEN=${#WELCOME_TXT}
Expand All @@ -291,7 +303,7 @@ fi

if [ -z "$REFERRER" ] || [[ ! "$REFERRER" =~ ^\{?[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{12}\}?$ ]]; then
while true; do
read -n 36 -rp " Warp ID : " REFERRER </dev/tty
read -rep " Warp ID : " REFERRER </dev/tty

if [[ $REFERRER =~ ^\{?[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{12}\}?$ ]]; then
if [[ -x "$0" ]]; then
Expand All @@ -312,7 +324,7 @@ fi

if [ -z "$ITERATIONS" ] || [[ ! "$ITERATIONS" =~ ^[0-9]+$ ]]; then
while true; do
read -rp " Iterations : " ITERATIONS </dev/tty
read -rep " Iterations : " ITERATIONS </dev/tty

if [[ "$ITERATIONS" =~ ^[0-9]+$ ]]; then
if [[ -x "$0" ]]; then
Expand All @@ -334,8 +346,8 @@ fi
echo " Interval : $INTERVAL"

echo ""
echo " Log File : $LOG_FILE"
echo " Travis : ${TRAVIS_BUILD:-"no"}"
echo " Log File : $LOG_FILE"
echo " Travis : ${TRAVIS_BUILD:-"no"}"
echo ""

echo " ##################"
Expand All @@ -344,9 +356,8 @@ echo " ##################"
echo ""

# Begin new log entry
HASH=$(date '+%N' | sha1sum | head -c 40)
HASH=$(date '+%s%N' | sha1sum | head -c 40)
START=$(date)
END=$(date --date="+$((ITERATIONS * INTERVAL)) seconds")

cat <<FOE >>$LOG_FILE
<<<<<<<<${HASH}<<<<
Expand All @@ -356,7 +367,6 @@ Iterations : ${ITERATIONS}
Interval : ${INTERVAL}
Process Start : ${START}
Process End (est) : ${END}
======
Expand Down

0 comments on commit ca0f0df

Please sign in to comment.