Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

wip #34

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/aws.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/csv-editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

178 changes: 178 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/magento2plugin.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/raspap-docker.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 83 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
FROM alehaa/debian-systemd:buster
RUN apt update && apt install -y sudo wget procps curl systemd && rm -rf /var/lib/apt/lists/*
COPY setup.sh .
# Base image
FROM debian:latest

RUN debian_frontend=noninteractive

USER root
RUN echo 'iptables-persistent iptables-persistent/autosave_v4 boolean true' | debconf-set-selections
RUN echo 'iptables-persistent iptables-persistent/autosave_v6 boolean true' | debconf-set-selections


# Update the system
RUN apt-get update && apt-get upgrade -y

# Install dependencies
RUN apt-get install -y \
git \
lighttpd \
php7.4-cgi \
hostapd \
dnsmasq \
vnstat \
qrencode \
dhcpcd5 -y \
iptables-persistent



# Enable PHP for lighttpd
RUN lighttpd-enable-mod fastcgi-php

# Clone RaspAP repository
RUN git clone https://github.com/RaspAP/raspap-webgui /var/www/html/raspap-webgui

# Copy additional lighttpd config file
COPY raspap-webgui/config/50-raspap-router.conf /etc/lighttpd/conf-available/50-raspap-router.conf
RUN ln -s /etc/lighttpd/conf-available/50-raspap-router.conf /etc/lighttpd/conf-enabled/50-raspap-router.conf

# Set up configuration directories
RUN mkdir /etc/raspap/
RUN mkdir /etc/raspap/backups
RUN mkdir /etc/raspap/networking
RUN mkdir /etc/raspap/hostapd
RUN mkdir /etc/raspap/lighttpd

# Copy auth control file
RUN cp /var/www/html/raspap-webgui/raspap.php /etc/raspap/

# Set file ownership
RUN chown -R www-data:www-data /var/www/html
RUN chown -R www-data:www-data /etc/raspap

# Move control scripts
RUN mv /var/www/html/raspap-webgui/installers/*log.sh /etc/raspap/hostapd
RUN mv /var/www/html/raspap-webgui/installers/service*.sh /etc/raspap/hostapd
RUN chown -c root:www-data /etc/raspap/hostapd/*.sh
RUN chmod 750 /etc/raspap/hostapd/*.sh

# Copy default configurations
COPY raspap-webgui/config/hostapd.conf /etc/default/hostapd
COPY raspap-webgui/config/hostapd.conf /etc/hostapd/hostapd.conf
COPY raspap-webgui/config/090_raspap.conf /etc/dnsmasq.d/090_raspap.conf
COPY raspap-webgui/config/090_wlan0.conf /etc/dnsmasq.d/090_wlan0.conf
COPY raspap-webgui/config/dhcpcd.conf /etc/dhcpcd.conf
COPY raspap-webgui/config/config.php /var/www/html/includes/
COPY raspap-webgui/config/defaults.json /etc/raspap/networking/

# Enable IP forwarding
RUN #mkdir /etc/sysctl.d/
RUN #echo "net.ipv4.ip_forward=1" >> /etc/sysctl.d/90_raspap.conf
#RUN sysctl -p /etc/sysctl.d/90_raspap.conf
RUN #/etc/init.d/procps restart
USER root

# Set up iptables masquerade rules
#RUN iptables -t nat -git
# Enable hostapd service
RUN echo "DAEMON_CONF=\"/etc/hostapd/hostapd.conf\"" >> /etc/default/hostapd

# Expose port 80
EXPOSE 80

# Start lighttpd service
CMD ["lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"]
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
8 changes: 8 additions & 0 deletions dnsmasq.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
interface=wlan0
dhcp-range=192.168.50.100,192.168.50.200,255.255.255.0,12h
dhcp-option=3,192.168.50.1
dhcp-option=6,192.168.50.1
server=8.8.8.8
server=8.8.4.4
log-queries
log-dhcp
Loading