Skip to content

Commit

Permalink
Merge pull request #4 from DaanSelen/development
Browse files Browse the repository at this point in the history
Looks fun! v0.1.1
  • Loading branch information
DaanSelen authored Nov 21, 2024
2 parents 3fcca02 + 6f5f351 commit 4e49691
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 9 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ FROM alpine:latest
LABEL maintainer="[email protected]"

# Install Apache & Bash
RUN apk update && apk add --no-cache apache2 bash
RUN apk update \
&& apk add --no-cache apache2 bash

# Suppress the ServerName warning
RUN echo "ServerName localhost" >> /etc/apache2/httpd.conf
RUN echo "ServerName localhost" >> /etc/apache2/httpd.conf \
&& mkdir /app \
&& mkdir /data

COPY entrypoint.sh /entrypoint.sh
COPY ntos /var/www/localhost/htdocs/

EXPOSE 80
COPY ntos /app

ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Such a remote management system often provides a way to install an agent. To inc

- A Debian installation medium, such as an USB-stick with Debian net(work)-inst(allation) or the CD/DVD media flashed onto it. (For flashing see: [rufus](https://rufus.ie/) / [Balena Etcher](https://www.balena.io/etcher))<br>

- Networking connectivity. (DHCP is easiest and fastest)

### How to setup a webserver with NTOS files:

1. To set everything up, execute the `setup.sh` bash script and answer its questions.<br>
Expand All @@ -33,14 +35,33 @@ Such a remote management system often provides a way to install an agent. To inc

> For an example see [preseed-screen](./assets/images/debian12-preseed-screen.png).<br>
2. Refering to the webserver endpoints below - enter the IP-address or hostname of the webserver followed by `/configs/<desired-config>/preseed.cfg`. By default the minimal configuration is available.<br>
2. Refering to the webserver endpoints below - enter the IP-address or hostname of the webserver (with the port) followed by `/configs/<desired-config>/preseed.cfg`. By default the minimal configuration is available.<br>
This makes the [Debian-installer](https://www.debian.org/devel/debian-installer/) use the preseed configuration for its installation.<br>
The only manual input needed for installation is the partitioning, this is because this project has been made for a machine with 4GB total storage.<br>
This means, if you have more than let's say 6GB total storage, then you can choose the Guided Partitioning (expert users can make something themselves).<br>

3. Now the machine will install itself using the selected configuration from ./ntos/configs (if you selected it correctly).<br>
Just wait a while, the older the machine the slowed it will be. Once the installation is complete the machine will restart itself as per instruction of the preseed. <br>

4. Once the machine has succesfully booted into the Desktop Environment (DE) you have chosen (the default is XFCE4) open a terminal and enter:<br>
`bash <(curl <your-ntos-server-ip/hostname:port>/configs/<desired-config>)`<br>
This will initiate the 'finisher'-script, after which the install should be complete.

> For examples see the image examples or the [images-directory](./assets/images)
5. Enjoy! Linux is so much fun to use. 😉

## Image examples:

![Preseed-screen](./assets/images/debian12-preseed-screen.png)
![Post-install desktop](./assets/images/debian12-postboot-desktop.png)
![Executing finish.sh](./assets/images/debian12-finishsh-progress.png)
![After installing and rebooting](./assets/images/debian12-postinstallreboot-desktop.png)
![Credask in action!](./assets/images/debian12-credask-inaction.png)

## Webserver endpoint structure:

The Bash `setup.sh`-script copies the needed files to the specificied location on the system, preferably a webserver root.
The Bash `install.sh`-script copies the needed files to the specificied location on the system, preferably a webserver root.

The following endpoints are available by default. This is needed for the new machine to set itself up.

Expand All @@ -53,4 +74,8 @@ The following endpoints are available by default. This is needed for the new mac
```

The above `/rdp` endpoint requires you to place premade `.rdp` files in the directory before running `setup.sh`.<br>
Then the finish script will ask for which one to pick.
Then the finish script will ask for which one to pick.

## Epilogue

Thanks!
Binary file added assets/images/debian12-credask-inaction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/debian12-finishsh-progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/debian12-postboot-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docker/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
ntos-server:
image: test:latest
#image: dselen/ntos-server:latest
container_name: ntos-server
restart: unless-stopped
ports:
- 8080:80/tcp
volumes:
- ntos_data:/data
volumes:
ntos_data:
11 changes: 10 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash

echo "Starting NTOS-Server..."
echo "Configuring NTOS-Server..."

cp -rv /app/* /data

ln -s /data/assets /var/www/localhost/htdocs/assets
ln -s /data/configs /var/www/localhost/htdocs/configs
ln -s /data/credcon /var/www/localhost/htdocs/credcon
ln -s /data/rdp /var/www/localhost/htdocs/rdp

echo "Done. Starting Apache2 webserver..."

httpd -D FOREGROUND &

Expand Down

0 comments on commit 4e49691

Please sign in to comment.