Skip to content

Commit

Permalink
feat(iptvboss): adding last cron changes
Browse files Browse the repository at this point in the history
  • Loading branch information
groenator committed Mar 3, 2024
1 parent 73a51d7 commit d8a6aa0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 24 deletions.
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
iptvboss/*
.venv/*
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
.vscode/settings.json
.vscode/tasks.json
.vscode/launch.json
.vscode/extensions.json
.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/
Expand Down
34 changes: 17 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@

# Use the official CentOS base image
FROM consol/rocky-xfce-vnc
FROM consol/debian-xfce-vnc

# Set locale to avoid warnings
ENV LC_ALL=C.UTF-8

# Switch to root temporarily to perform system updates
USER 0

# Install necessary dependencies
RUN yum install -y wget cronie vlc \
&& yum update -y \
&& yum clean all
# Set the working directory
WORKDIR /headless

# Create a new user with home directory set to /headless
RUN useradd -m -d /headless -s /bin/bash iptvboss
# Update package list and upgrade installed packages
RUN apt-get update && apt-get upgrade -y

# Install necessary dependencies
RUN apt-get install --no-install-recommends wget cron curl sudo vlc -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Cronitor by default
RUN curl https://cronitor.io/install-linux?sudo=1 | sh

# Set the working directory
WORKDIR /headless
# Create a new user with home directory set to /he adless
RUN useradd -m -d /headless -s /bin/bash iptvboss

# Copy the cron file to the cron.d directory
COPY iptvboss-cron /var/spool/crontab/iptvboss/iptvboss-cron
COPY iptvboss-cron /etc/cron.d/iptvboss-cron

# Give execution rights on the cron job
RUN chmod 0644 /var/spool/crontab/iptvboss/iptvboss-cron

# Create the log file to be able to run tail
RUN touch /var/log/cron.log
RUN crontab -u iptvboss /etc/cron.d/iptvboss-cron && \
chmod u+s /usr/sbin/cron && \
touch /var/log/cron.log && \
chown iptvboss:iptvboss /var/log/cron.log

# Download and extract iptvboss tar
RUN wget "https://github.com/walrusone/iptvboss-release/releases/latest/download/iptvboss-3.4.160.0-linux-amd64.tar.gz" && \
Expand All @@ -45,9 +48,6 @@ ENV PATH="/usr/lib/iptvboss/bin:${PATH}"
# Switch back to the non-root user
USER 1000

# Apply cron job
RUN crontab /var/spool/crontab/iptvboss/iptvboss-cron

# Expose VNC port
EXPOSE 5901
EXPOSE 6901
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ services:
dockerfile: Dockerfile
container_name: iptvboss
environment:
- CRONITOR_ENABLE=true
- CRONITOR_API_KEY=7151dcaa743f43e3b5f3c64fb4649dd9
networks:
- portainer_network
Expand Down
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ else
echo "CRONITOR_API_KEY not set. Please make sure it is defined."
fi

echo "Start cron"
cron &
echo "cron started"

echo "Start vnc"
/dockerstartup/vnc_startup.sh --wait
```
3 changes: 2 additions & 1 deletion iptvboss-cron
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
0 04-17/12 * * * /usr/lib/iptvboss/bin/iptvboss -nogui
0 04-17/12 * * * /usr/lib/iptvboss/bin/iptvboss -nogui >> /var/log/cron.log 2>&1
0 * * * * echo "Hello World" >> /var/log/cron.log 2>&1

0 comments on commit d8a6aa0

Please sign in to comment.