From f8d4486f77c66230d422c9badac0eef338d03749 Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Fri, 26 Sep 2025 07:55:24 +0000 Subject: [PATCH 1/2] Add server demo and add more server packages to CI --- config/x86_64/ci.toml | 19 ++++++++++++++-- config/x86_64/server-demo.toml | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 config/x86_64/server-demo.toml diff --git a/config/x86_64/ci.toml b/config/x86_64/ci.toml index 04ea65ecd..b12346541 100644 --- a/config/x86_64/ci.toml +++ b/config/x86_64/ci.toml @@ -27,6 +27,7 @@ base-initfs = {} bash = {} binutils = {} bootloader = {} +bzip2 = {} ca-certificates = {} cairo = {} #cairodemo = {} # linking errors @@ -94,22 +95,29 @@ kernel = {} kibi = {} lci = {} libc-bench = {} +libavif = {} +libedit = {} libffi = {} libgcc = {} libgmp = {} libiconv = {} +libicu = {} libjpeg = {} libogg = {} +libonig = {} liborbital = {} libpng = {} libstdcxx = {} libsodium = {} libvorbis = {} +libwebp = {} libxkbcommon = {} +libuuid = {} libxml2 = {} llvm18 = {} lsd = {} lua54 = {} +lz4 = {} #mdp = {} # gcc hangs mednafen = {} mesa = {} @@ -128,10 +136,13 @@ neverball = {} #newlib = {} # obsolete #newlibtest = {} # obsolete nghttp2 = {} +nginx = {} #nushell = {} # needs cargo update onefetch = {} openjazz = {} +openssh = {} openssl1 = {} +openssl3 = {} openttd = {} openttd-opengfx = {} openttd-openmsx = {} @@ -154,6 +165,7 @@ patchelf = {} pcre = {} perg = {} periodictable = {} +php84 = {} #perl5 = {} # ctermid, tempnam, ttyname pixelcannon = {} #pixman = {} # depends on glib which does not build @@ -164,7 +176,7 @@ pop-icon-theme = {} #powerline = {} # dirs prboom = {} procedural-wallpapers-rs = {} -#python37 = {} # getaddrinfo +python312 = {} #qemu = {} # can be built, but not working readline = {} redoxerd = {} @@ -179,6 +191,7 @@ resist = {} ripgrep = {} rodioplay = {} rs-nes = {} +rsync = {} rust = {} rust64 = {} #rust-cairo = {} # linking errors @@ -207,7 +220,7 @@ simple-http-server = {} smith = {} sodium = {} sopwith = {} -#openssh = {} +sqlite3 = {} strace = {} #syobonaction = {} # linking errors terminfo = {} @@ -224,5 +237,7 @@ vttest = {} #webrender = {} # unwind #wesnoth = {} winit = {} +xxhash = {} xz = {} zlib = {} +zstd = {} diff --git a/config/x86_64/server-demo.toml b/config/x86_64/server-demo.toml new file mode 100644 index 000000000..9e06f9fbb --- /dev/null +++ b/config/x86_64/server-demo.toml @@ -0,0 +1,41 @@ +# Configuration for server stack demonstration + +include = ["../server.toml"] + +# General settings +[general] +# Filesystem size in MiB +filesystem_size = 2048 + +# Package settings +[packages] +# Daemons +openssh = {} +nginx = {} + +# Backends +php84 = {} +luajit = {} +python312 = {} +# go = {} +# zig = {} + +# Tools +nano = {} +neovim = {} +rsync = {} +vim = {} +sqlite3 = {} +# tmux = {} +# htop = {} + +# Content +website = {} + +[users.nobody] +password = "" +shell = "/usr/bin/ion" #TODO: nologin? + +[users.nginx] +password = "" +shell = "/usr/bin/ion" #TODO: nologin? From 769ebff8a090688702ff587d25e2b1f4d2a9e8a2 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sat, 27 Sep 2025 02:41:38 +0700 Subject: [PATCH 2/2] Add server demo scripts --- config/base.toml | 6 ++ config/x86_64/ci.toml | 1 + config/x86_64/server-demo.toml | 160 ++++++++++++++++++++++++++++++++- 3 files changed, 166 insertions(+), 1 deletion(-) diff --git a/config/base.toml b/config/base.toml index a4e705605..8f2e64e18 100644 --- a/config/base.toml +++ b/config/base.toml @@ -162,6 +162,12 @@ data = "" directory = true mode = 0o755 +[[files]] +path = "/var/run" +data = "" +directory = true +mode = 0o755 + [[files]] path = "/var/tmp" data = "" diff --git a/config/x86_64/ci.toml b/config/x86_64/ci.toml index b12346541..a1d61ca86 100644 --- a/config/x86_64/ci.toml +++ b/config/x86_64/ci.toml @@ -35,6 +35,7 @@ cairo = {} cargo = {} cleye = {} #cmatrix = {} # needs ncursesw now +composer = {} contain = {} coreutils = {} cosmic-edit = {} diff --git a/config/x86_64/server-demo.toml b/config/x86_64/server-demo.toml index 9e06f9fbb..42d7c5bff 100644 --- a/config/x86_64/server-demo.toml +++ b/config/x86_64/server-demo.toml @@ -5,7 +5,7 @@ include = ["../server.toml"] # General settings [general] # Filesystem size in MiB -filesystem_size = 2048 +filesystem_size = 4096 # Package settings [packages] @@ -15,6 +15,7 @@ nginx = {} # Backends php84 = {} +composer = {} luajit = {} python312 = {} # go = {} @@ -32,6 +33,134 @@ sqlite3 = {} # Content website = {} +[[files]] +path = "/home/user/public_html/index.php" +data = """ + php /bin/composer install +""" + +[[files]] +postinstall = true +data = "" +path = "/etc/nginx/conf.d" +directory = true + +[[files]] +postinstall = true +path = "/etc/nginx/nginx.conf" +data = """ +user nginx; +worker_processes auto; +error_log /var/log/nginx/error.log; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} +http { + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + access_log /var/log/nginx/access.log main; + + include mime.types; + include fastcgi.conf; + default_type application/octet-stream; + + include /etc/nginx/conf.d/*.conf; +} +""" + +[[files]] +postinstall = true +path = "/etc/nginx/conf.d/localhost.conf" +data = """ +server { + listen 80; + server_name localhost; + root /usr/share/website; + + location / { + index index.html index.htm; + } +} +""" + +[[files]] +postinstall = true +path = "/etc/nginx/conf.d/php-www.conf" +data = """ +server { + listen 8081; + server_name localhost; + root /home/user/public_html; + + index index.php index.html index.htm; + + location / { + try_files $uri $uri/ =404; + } + + location ~ \\.php$ { + include fastcgi_params; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } +} +""" + +[[files]] +postinstall = true +path = "/etc/php/84/php-fpm.conf" +data = """ + +include=/etc/php/84/php-fpm.d/*.conf +""" + +[[files]] +postinstall = true +path = "/etc/php/84/php-fpm.d/www.conf" +data = """ +[www] +user = user +group = user +listen = 127.0.0.1:9000 +pm = static +pm.max_children = 1 +""" + +[[files]] +postinstall = true +path = "/etc/ssh/sshd_config" +data = """ +Port 22 +AddressFamily inet +AuthorizedKeysFile .ssh/authorized_keys +PermitRootLogin yes +PasswordAuthentication yes +PermitEmptyPasswords yes +Subsystem sftp /usr/libexec/sftp-server +""" + [users.nobody] password = "" shell = "/usr/bin/ion" #TODO: nologin? @@ -39,3 +168,32 @@ shell = "/usr/bin/ion" #TODO: nologin? [users.nginx] password = "" shell = "/usr/bin/ion" #TODO: nologin? + +[[files]] +path = "/home/user/server.sh" +data = """ +#!/usr/bin/env bash + +/bin/sshd -D & +nginx -g "daemon off;" & +php-fpm --nodaemonize & +""" + +[[files]] +path = "/home/user/Welcome.txt" +data = """ +############################################################################## +# Welcome to Redox Server Demo! +# +# This is a quick demonstration of Redox used as server stack. +# At the moment we support SSH, NGINX, Python, PHP. There's more to come +# +# This server demo is insecure by design, we encourage you to get familiar into +# basics of server security if you wish to use this as a production server. +# +# To start the daemon, run +# > sudo bash server.sh +# +# The server will start port 22 (ssh), 80 (static web) and 8080 (php) +############################################################################## +"""