Compare commits

...

No commits in common. "master" and "main" have entirely different histories.
master ... main

88 changed files with 5487 additions and 3906 deletions

View File

@ -5,49 +5,41 @@
# This Make file is used to execute the different parts if the bubble system
# by running for example deb64 will chain execute copy_fls, copy_flders and
# inflate to build an ISO . To begin a fresh skeleton, you need to run only
# fresh...after that. As builds are released for publication you can run nightly
# or releases to move the files to your web server location the
# run the build as you need.
# fresh...after that. As build sare release for publication you can run nightly
# or release to move the files to your web server location the
# run the build you need.
# None of these steps need to run as root all this can be ran ad a normal user
PY_PATH = ~/bubbles/python_modules
## 64 bit ISOs
dev64xfce:
python3 ${PY_PATH}/build_iso.py set e-xfce b-dev64
deb64xfce:
python3 ${PY_PATH}/build_iso.py set e-xfce b-deb64
deb64gfb:
python3 ${PY_PATH}/build_iso.py set e-gnomefb b-deb64
deb64opb:
python3 ${PY_PATH}/build_iso.py set e-openbox b-deb64
deb64kde:
python3 ${PY_PATH}/build_iso.py set e-kde b-deb64
dev64xfce:
python3 ${PY_PATH}/build_iso.py set e-xfce b-dev64
dev64gfb:
python3 ${PY_PATH}/build_iso.py set e-gnomefb b-dev64
deb64opb:
python3 ${PY_PATH}/build_iso.py set e-openbox b-deb64
dev64opb:
python3 ${PY_PATH}/build_iso.py set e-openbox b-dev64
dev64kde:
python3 ${PY_PATH}/build_iso.py set e-kde b-dev64
## 32 bit ISOs
deb32xfce:
python3 ${PY_PATH}/build_iso.py set e-xfce b-deb32
deb32gfb:
python3 ${PY_PATH}/build_iso.py set e-gnomefb b-deb32
deb32opb:
python3 ${PY_PATH}/build_iso.py set e-openbox b-deb32
deb32kde:
python3 ${PY_PATH}/build_iso.py set e-kde b-deb32
dev32xfce:
python3 ${PY_PATH}/build_iso.py set e-xfce b-dev32
deb32gfb:
python3 ${PY_PATH}/build_iso.py set e-gnomefb b-deb32
dev32gfb:
python3 ${PY_PATH}/build_iso.py set e-gnomefb b-dev32
deb32opb:
python3 ${PY_PATH}/build_iso.py set e-openbox b-deb32
dev32opb:
python3 ${PY_PATH}/build_iso.py set e-openbox b-dev32
dev32kde:
python3 ${PY_PATH}/build_iso.py set e-kde b-dev32
## arm ISOs
debarmxfce:

View File

@ -0,0 +1,3 @@
; gedit GtkAccelMap rc-file -*- scheme -*-
; this file is an automated accelerator map dump
;

View File

@ -1,864 +0,0 @@
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
info title
info underline
info "OS" distro
info "Host" model
info "Kernel" kernel
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "Resolution" resolution
info "DE" de
info "WM" wm
info "WM Theme" wm_theme
info "Theme" theme
info "Icons" icons
info "Terminal" term
info "Terminal Font" term_font
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
# info "GPU Driver" gpu_driver # Linux/macOS only
# info "CPU Usage" cpu_usage
# info "Disk" disk
# info "Battery" battery
# info "Font" font
# info "Song" song
# [[ "$player" ]] && prin "Music Player" "$player"
# info "Local IP" local_ip
# info "Public IP" public_ip
# info "Users" users
# info "Locale" locale # This only works on glibc systems.
info cols
}
# Title
# Hide/Show Fully qualified domain name.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --title_fqdn
title_fqdn="off"
# Kernel
# Shorten the output of the kernel function.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --kernel_shorthand
# Supports: Everything except *BSDs (except PacBSD and PC-BSD)
#
# Example:
# on: '4.8.9-1-ARCH'
# off: 'Linux 4.8.9-1-ARCH'
kernel_shorthand="on"
# Distro
# Shorten the output of the distro function
#
# Default: 'off'
# Values: 'on', 'tiny', 'off'
# Flag: --distro_shorthand
# Supports: Everything except Windows and Haiku
distro_shorthand="off"
# Show/Hide OS Architecture.
# Show 'x86_64', 'x86' and etc in 'Distro:' output.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --os_arch
#
# Example:
# on: 'Arch Linux x86_64'
# off: 'Arch Linux'
os_arch="on"
# Uptime
# Shorten the output of the uptime function
#
# Default: 'on'
# Values: 'on', 'tiny', 'off'
# Flag: --uptime_shorthand
#
# Example:
# on: '2 days, 10 hours, 3 mins'
# tiny: '2d 10h 3m'
# off: '2 days, 10 hours, 3 minutes'
uptime_shorthand="on"
# Memory
# Show memory pecentage in output.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --memory_percent
#
# Example:
# on: '1801MiB / 7881MiB (22%)'
# off: '1801MiB / 7881MiB'
memory_percent="off"
# Change memory output unit.
#
# Default: 'mib'
# Values: 'kib', 'mib', 'gib'
# Flag: --memory_unit
#
# Example:
# kib '1020928KiB / 7117824KiB'
# mib '1042MiB / 6951MiB'
# gib: ' 0.98GiB / 6.79GiB'
memory_unit="mib"
# Packages
# Show/Hide Package Manager names.
#
# Default: 'tiny'
# Values: 'on', 'tiny' 'off'
# Flag: --package_managers
#
# Example:
# on: '998 (pacman), 8 (flatpak), 4 (snap)'
# tiny: '908 (pacman, flatpak, snap)'
# off: '908'
package_managers="on"
# Shell
# Show the path to $SHELL
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --shell_path
#
# Example:
# on: '/bin/bash'
# off: 'bash'
shell_path="off"
# Show $SHELL version
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --shell_version
#
# Example:
# on: 'bash 4.4.5'
# off: 'bash'
shell_version="on"
# CPU
# CPU speed type
#
# Default: 'bios_limit'
# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'.
# Flag: --speed_type
# Supports: Linux with 'cpufreq'
# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value.
speed_type="bios_limit"
# CPU speed shorthand
#
# Default: 'off'
# Values: 'on', 'off'.
# Flag: --speed_shorthand
# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz
#
# Example:
# on: 'i7-6500U (4) @ 3.1GHz'
# off: 'i7-6500U (4) @ 3.100GHz'
speed_shorthand="off"
# Enable/Disable CPU brand in output.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --cpu_brand
#
# Example:
# on: 'Intel i7-6500U'
# off: 'i7-6500U (4)'
cpu_brand="on"
# CPU Speed
# Hide/Show CPU speed.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --cpu_speed
#
# Example:
# on: 'Intel i7-6500U (4) @ 3.1GHz'
# off: 'Intel i7-6500U (4)'
cpu_speed="on"
# CPU Cores
# Display CPU cores in output
#
# Default: 'logical'
# Values: 'logical', 'physical', 'off'
# Flag: --cpu_cores
# Support: 'physical' doesn't work on BSD.
#
# Example:
# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores)
# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores)
# off: 'Intel i7-6500U @ 3.1GHz'
cpu_cores="logical"
# CPU Temperature
# Hide/Show CPU temperature.
# Note the temperature is added to the regular CPU function.
#
# Default: 'off'
# Values: 'C', 'F', 'off'
# Flag: --cpu_temp
# Supports: Linux, BSD
# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable
# coretemp kernel module. This only supports newer Intel processors.
#
# Example:
# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]'
# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]'
# off: 'Intel i7-6500U (4) @ 3.1GHz'
cpu_temp="off"
# GPU
# Enable/Disable GPU Brand
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gpu_brand
#
# Example:
# on: 'AMD HD 7950'
# off: 'HD 7950'
gpu_brand="on"
# Which GPU to display
#
# Default: 'all'
# Values: 'all', 'dedicated', 'integrated'
# Flag: --gpu_type
# Supports: Linux
#
# Example:
# all:
# GPU1: AMD HD 7950
# GPU2: Intel Integrated Graphics
#
# dedicated:
# GPU1: AMD HD 7950
#
# integrated:
# GPU1: Intel Integrated Graphics
gpu_type="all"
# Resolution
# Display refresh rate next to each monitor
# Default: 'off'
# Values: 'on', 'off'
# Flag: --refresh_rate
# Supports: Doesn't work on Windows.
#
# Example:
# on: '1920x1080 @ 60Hz'
# off: '1920x1080'
refresh_rate="off"
# Gtk Theme / Icons / Font
# Shorten output of GTK Theme / Icons / Font
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --gtk_shorthand
#
# Example:
# on: 'Numix, Adwaita'
# off: 'Numix [GTK2], Adwaita [GTK3]'
gtk_shorthand="off"
# Enable/Disable gtk2 Theme / Icons / Font
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gtk2
#
# Example:
# on: 'Numix [GTK2], Adwaita [GTK3]'
# off: 'Adwaita [GTK3]'
gtk2="on"
# Enable/Disable gtk3 Theme / Icons / Font
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gtk3
#
# Example:
# on: 'Numix [GTK2], Adwaita [GTK3]'
# off: 'Numix [GTK2]'
gtk3="on"
# IP Address
# Website to ping for the public IP
#
# Default: 'http://ident.me'
# Values: 'url'
# Flag: --ip_host
public_ip_host="http://ident.me"
# Public IP timeout.
#
# Default: '2'
# Values: 'int'
# Flag: --ip_timeout
public_ip_timeout=2
# Desktop Environment
# Show Desktop Environment version
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --de_version
de_version="on"
# Disk
# Which disks to display.
# The values can be any /dev/sdXX, mount point or directory.
# NOTE: By default we only show the disk info for '/'.
#
# Default: '/'
# Values: '/', '/dev/sdXX', '/path/to/drive'.
# Flag: --disk_show
#
# Example:
# disk_show=('/' '/dev/sdb1'):
# 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 823G / 893G (93%)'
#
# disk_show=('/'):
# 'Disk (/): 74G / 118G (66%)'
#
disk_show=('/')
# Disk subtitle.
# What to append to the Disk subtitle.
#
# Default: 'mount'
# Values: 'mount', 'name', 'dir', 'none'
# Flag: --disk_subtitle
#
# Example:
# name: 'Disk (/dev/sda1): 74G / 118G (66%)'
# 'Disk (/dev/sdb2): 74G / 118G (66%)'
#
# mount: 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Local Disk): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 74G / 118G (66%)'
#
# dir: 'Disk (/): 74G / 118G (66%)'
# 'Disk (Local Disk): 74G / 118G (66%)'
# 'Disk (Videos): 74G / 118G (66%)'
#
# none: 'Disk: 74G / 118G (66%)'
# 'Disk: 74G / 118G (66%)'
# 'Disk: 74G / 118G (66%)'
disk_subtitle="mount"
# Disk percent.
# Show/Hide disk percent.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --disk_percent
#
# Example:
# on: 'Disk (/): 74G / 118G (66%)'
# off: 'Disk (/): 74G / 118G'
disk_percent="on"
# Song
# Manually specify a music player.
#
# Default: 'auto'
# Values: 'auto', 'player-name'
# Flag: --music_player
#
# Available values for 'player-name':
#
# amarok
# audacious
# banshee
# bluemindo
# clementine
# cmus
# deadbeef
# deepin-music
# dragon
# elisa
# exaile
# gnome-music
# gmusicbrowser
# gogglesmm
# guayadeque
# io.elementary.music
# iTunes
# juk
# lollypop
# mocp
# mopidy
# mpd
# muine
# netease-cloud-music
# olivia
# playerctl
# pogo
# pragha
# qmmp
# quodlibet
# rhythmbox
# sayonara
# smplayer
# spotify
# strawberry
# tauonmb
# tomahawk
# vlc
# xmms2d
# xnoise
# yarock
music_player="auto"
# Format to display song information.
#
# Default: '%artist% - %album% - %title%'
# Values: '%artist%', '%album%', '%title%'
# Flag: --song_format
#
# Example:
# default: 'Song: Jet - Get Born - Sgt Major'
song_format="%artist% - %album% - %title%"
# Print the Artist, Album and Title on separate lines
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --song_shorthand
#
# Example:
# on: 'Artist: The Fratellis'
# 'Album: Costello Music'
# 'Song: Chelsea Dagger'
#
# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger'
song_shorthand="off"
# 'mpc' arguments (specify a host, password etc).
#
# Default: ''
# Example: mpc_args=(-h HOST -P PASSWORD)
mpc_args=()
# Text Colors
# Text Colors
#
# Default: 'distro'
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
# Flag: --colors
#
# Each number represents a different part of the text in
# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info'
#
# Example:
# colors=(distro) - Text is colored based on Distro colors.
# colors=(4 6 1 8 8 6) - Text is colored in the order above.
colors=(distro)
# Text Options
# Toggle bold text
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --bold
bold="on"
# Enable/Disable Underline
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --underline
underline_enabled="on"
# Underline character
#
# Default: '-'
# Values: 'string'
# Flag: --underline_char
underline_char="-"
# Info Separator
# Replace the default separator with the specified string.
#
# Default: ':'
# Flag: --separator
#
# Example:
# separator="->": 'Shell-> bash'
# separator=" =": 'WM = dwm'
separator=":"
# Color Blocks
# Color block range
# The range of colors to print.
#
# Default: '0', '15'
# Values: 'num'
# Flag: --block_range
#
# Example:
#
# Display colors 0-7 in the blocks. (8 colors)
# neofetch --block_range 0 7
#
# Display colors 0-15 in the blocks. (16 colors)
# neofetch --block_range 0 15
block_range=(0 15)
# Toggle color blocks
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --color_blocks
color_blocks="off"
# Color block width in spaces
#
# Default: '3'
# Values: 'num'
# Flag: --block_width
block_width=3
# Color block height in lines
#
# Default: '1'
# Values: 'num'
# Flag: --block_height
block_height=1
# Color Alignment
#
# Default: 'auto'
# Values: 'auto', 'num'
# Flag: --col_offset
#
# Number specifies how far from the left side of the terminal (in spaces) to
# begin printing the columns, in case you want to e.g. center them under your
# text.
# Example:
# col_offset="auto" - Default behavior of neofetch
# col_offset=7 - Leave 7 spaces then print the colors
col_offset="auto"
# Progress Bars
# Bar characters
#
# Default: '-', '='
# Values: 'string', 'string'
# Flag: --bar_char
#
# Example:
# neofetch --bar_char 'elapsed' 'total'
# neofetch --bar_char '-' '='
bar_char_elapsed="-"
bar_char_total="="
# Toggle Bar border
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --bar_border
bar_border="on"
# Progress bar length in spaces
# Number of chars long to make the progress bars.
#
# Default: '15'
# Values: 'num'
# Flag: --bar_length
bar_length=15
# Progress bar colors
# When set to distro, uses your distro's logo colors.
#
# Default: 'distro', 'distro'
# Values: 'distro', 'num'
# Flag: --bar_colors
#
# Example:
# neofetch --bar_colors 3 4
# neofetch --bar_colors distro 5
bar_color_elapsed="distro"
bar_color_total="distro"
# Info display
# Display a bar with the info.
#
# Default: 'off'
# Values: 'bar', 'infobar', 'barinfo', 'off'
# Flags: --cpu_display
# --memory_display
# --battery_display
# --disk_display
#
# Example:
# bar: '[---=======]'
# infobar: 'info [---=======]'
# barinfo: '[---=======] info'
# off: 'info'
cpu_display="off"
memory_display="off"
battery_display="off"
disk_display="off"
# Backend Settings
# Image backend.
#
# Default: 'ascii'
# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off',
# 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty'
# Flag: --backend
image_backend="off"
# Image Source
#
# Which image or ascii file to display.
#
# Default: 'auto'
# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/'
# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")'
# Flag: --source
#
# NOTE: 'auto' will pick the best image source for whatever image backend is used.
# In ascii mode, distro ascii art will be used and in an image mode, your
# wallpaper will be used.
image_source="off"
# Ascii Options
# Ascii distro
# Which distro's ascii art to display.
#
# Default: 'auto'
# Values: 'auto', 'distro_name'
# Flag: --ascii_distro
# NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS",
# "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs,
# ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock,
# Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD,
# BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS,
# Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover,
# Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin,
# DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary,
# EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD,
# FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo,
# gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra,
# Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion,
# Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite,
# LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva,
# Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib,
# Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner,
# NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba,
# OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD,
# Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint,
# popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix,
# Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan,
# Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific,
# Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz,
# SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS,
# openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails,
# Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio,
# Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin,
# and IRIX have ascii logos
# NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants.
# Use '{distro name}_old' to use the old logos.
# NOTE: Ubuntu has flavor variants.
# Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME,
# Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors.
# NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu,
# CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android,
# Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola,
# Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS,
# Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian,
# postmarketOS, and Void have a smaller logo variant.
# Use '{distro name}_small' to use the small variants.
ascii_distro="none"
# Ascii Colors
#
# Default: 'distro'
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
# Flag: --ascii_colors
#
# Example:
# ascii_colors=(distro) - Ascii is colored based on Distro colors.
# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors.
ascii_colors=(distro)
# Bold ascii logo
# Whether or not to bold the ascii logo.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --ascii_bold
ascii_bold="on"
# Image Options
# Image loop
# Setting this to on will make neofetch redraw the image constantly until
# Ctrl+C is pressed. This fixes display issues in some terminal emulators.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --loop
image_loop="off"
# Thumbnail directory
#
# Default: '~/.cache/thumbnails/neofetch'
# Values: 'dir'
thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch"
# Crop mode
#
# Default: 'normal'
# Values: 'normal', 'fit', 'fill'
# Flag: --crop_mode
#
# See this wiki page to learn about the fit and fill options.
# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F
crop_mode="normal"
# Crop offset
# Note: Only affects 'normal' crop mode.
#
# Default: 'center'
# Values: 'northwest', 'north', 'northeast', 'west', 'center'
# 'east', 'southwest', 'south', 'southeast'
# Flag: --crop_offset
crop_offset="center"
# Image size
# The image is half the terminal width by default.
#
# Default: 'auto'
# Values: 'auto', '00px', '00%', 'none'
# Flags: --image_size
# --size
image_size="auto"
# Gap between image and text
#
# Default: '3'
# Values: 'num', '-num'
# Flag: --gap
gap=3
# Image offsets
# Only works with the w3m backend.
#
# Default: '0'
# Values: 'px'
# Flags: --xoffset
# --yoffset
yoffset=0
xoffset=0
# Image background color
# Only works with the w3m backend.
#
# Default: ''
# Values: 'color', 'blue'
# Flag: --bg_color
background_color=
# Misc Options
# Stdout mode
# Turn off all colors and disables image backend (ASCII/Image).
# Useful for piping into another command.
# Default: 'off'
# Values: 'on', 'off'
stdout="off"

View File

@ -1,101 +0,0 @@
#!/bin/sh
. /lib/live/config.sh
## live-config(7) - System Configuration Components
## Copyright (C) 2016-2020 The Debian Live team
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
#set -e
Cmdline ()
{
# Reading kernel command line
for _PARAMETER in ${LIVE_CONFIG_CMDLINE}
do
case "${_PARAMETER}" in
live-config.user-default-groups=*|user-default-groups=*)
LIVE_USER_DEFAULT_GROUPS="${_PARAMETER#*user-default-groups=}"
;;
live-config.user-fullname=*|user-fullname=*)
LIVE_USER_FULLNAME="${_PARAMETER#*user-fullname=}"
;;
live-config.username=*|username=*)
LIVE_USERNAME="${_PARAMETER#*username=}"
;;
esac
done
}
Init ()
{
# Checking if package is installed or already configured
if ! pkg_is_installed "user-setup" || \
component_was_executed "user-setup"
then
exit 0
fi
echo -n " user-setup"
}
Config ()
{
# Checking if package is already configured differently
if grep -q "^${LIVE_USERNAME}:" /etc/passwd
then
exit 0
fi
# Adjust formating of groups
if [ -n "${LIVE_USER_DEFAULT_GROUPS}" ]
then
LIVE_USER_DEFAULT_GROUPS="$(echo ${LIVE_USER_DEFAULT_GROUPS} | sed -e 's|,| |g')"
fi
# Make sure user is not in sudo group if sudo is disabled
case "${LIVE_CONFIG_NOROOT}" in
true)
LIVE_USER_DEFAULT_GROUPS="$(echo ${LIVE_USER_DEFAULT_GROUPS} | sed -e 's|sudo||')"
;;
esac
# Default password is: live
# passwords can be generated with 'echo "live" | mkpasswd -s',
# a blank password is 'U6aMy0wojraho'.
# _PASSWORD="8Ab05sVQ4LLps"
_PASSWORD="U6aMy0wojraho"
cat > /tmp/live-config.cfg << EOF
user-setup passwd/make-user boolean true
user-setup passwd/root-password-crypted string *
user-setup passwd/user-password-crypted string ${_PASSWORD}
user-setup passwd/user-default-groups string ${LIVE_USER_DEFAULT_GROUPS}
user-setup passwd/user-fullname string ${LIVE_USER_FULLNAME}
user-setup passwd/username string ${LIVE_USERNAME}
user-setup passwd/user-uid string 1000
EOF
debconf-set-selections < /tmp/live-config.cfg
rm -f /tmp/live-config.cfg
# Workaround for bug in shadow
set +e
/usr/lib/user-setup/user-setup-apply 2>&1 \
| grep -v "Shadow passwords are now on"
set -e
# Creating state file
touch /var/lib/live/config/user-setup
}
Cmdline
Init
Config

View File

@ -1,9 +0,0 @@
#!/bin/sh
# set the plymouth on boot
plymouth-set-default-theme -R lines
#Remove it first
rm -f /etc/alternatives/desktop-theme
# Then re-add it
ln -s /usr/share/desktop-base/lines-theme /etc/alternatives/desktop-theme

View File

@ -1,6 +0,0 @@
#!/bin/sh
# set installer permissions
chmod 755 /usr/bin/install-peppermint
chmod 755 /usr/share/applications/Install-peppermint.desktop
f=Install-peppermint.desktop ; gio set -t string $f metadata::xfce-exe-checksum "$(sha256sum $f | awk '{print $1}')"
chmod 755 -R /boot/grub/themes

View File

@ -1,6 +0,0 @@
#!/bin/sh
# Remove the grub symlink for the background
rm -f /etc/alternatives/desktop-grub
# Then recreate it with the Pep Background
ln -s /usr/share/desktop-base/active-theme/grub/pep-grub-16x9.png /etc/alternatives/desktop-grub

View File

@ -1,12 +0,0 @@
#!/bin/bash
### Error checking added to "lint-trap" section.
### Missing files no longer cause builds to fail.
# Remove software
# apt remove -y firefox-esr
# apt remove -y termit
apt --purge --yes autoremove gnome-keyring nvidia-tesla-470-alternative systemsettings imagemagick

View File

@ -1,49 +0,0 @@
#!/bin/bash
#git is needed for the git repos
apt install git --yes
#install pip3, needed for additional python modules
apt install --yes python3-pip
apt install --yes python3.11-venv
# Install the Luakit browser (used for pep tools)
apt install --yes luakit
# Install Plank
apt install --yes plank
# set the plymouth on boot
plymouth-set-default-theme -R lines
# Set the desktop base theme
# Remove it first
rm -f /etc/alternatives/desktop-theme
# Then re-add it
ln -s /usr/share/desktop-base/lines-theme /etc/alternatives/desktop-theme
# Remove the grub symlink for the background
rm -f /etc/alternatives/desktop-grub
# Then recreate it with the Pep Background
ln -s /usr/share/desktop-base/active-theme/grub/pep-grub-16x9.png /etc/alternatives/desktop-grub
# This will install hblock - a local ad-blocker utility
# https://github.com/hectorm/hblock
# This does not enable it. The user has the choice to turn it on
# by enabling it in PepHub or by typing 'hblock -S builtin' in terminal
curl https://raw.githubusercontent.com/hectorm/hblock/master/hblock --output /tmp/hblock
[ "$(sha256sum /tmp/hblock)" == "4031d86cd04fd7c6cb1b7e9acb1ffdbe9a3f84f693bfb287c68e1f1fa2c14c3b" ]
mv /tmp/hblock /usr/local/bin/hblock
chown 0:0 /usr/local/bin/hblock
chmod 755 /usr/local/bin/hblock
hblock -S none -D none exit 0
# check to see if this is the main line if it is then
# take care of raspi
if [ -e /usr/share/peppermint/pep_id ]
then
apt remove raspi-firmware -y
apt purge raspi-firmware -y
apt autoremove -y
else
echo "not there"
fi

View File

@ -1,10 +0,0 @@
#!/bin/bash
#[ -e /usr/local/bin/MakePackageLists.sh ] || exit 0
#cd /etc/calamares
#/usr/local/bin/MakePackageLists.sh
#rm /usr/local/bin/MakePackageLists.sh

View File

@ -1,37 +0,0 @@
#!/bin/bash
# Installing symlinks in the chroot
# We might be changing directories with each symlink.
# Don't assume each instance will be from ~/ for the root user.
# Workaround for using snapd on debian. Thank You - @stevesveryown.
[ ! -e /etc/skel/.local/share ] && mkdir -p /etc/skel/.local/share
#[ ! -e /var/lib/snapd/desktop/applications ] &&
#mkdir -p /var/lib/snapd/desktop/applications &&
#chmod 777 /var/lib/snapd/desktop/applications
#ln -s /var/lib/snapd/desktop/applications /etc/skel/.local/share/applications
ln -s snap /usr/bin/snap-store
# This fixes the 'Right-Click doesn't open terminal in nemo' issue.
ln -s xfce4-terminal /usr/bin/gnome-terminal
# This work-around lets ICE find Chromium (cromium-browser) in /usr/bin .
# No similar work-arounds were needed for FF, FF-ESR, Chrome or Vivaldi .
ln -s chromium /usr/bin/chromium-browser
# These are for the 3 installer scripts - icons.sh, themes.sh & walls.sh
# In 0610- we set the permissions to 777 on the DIRECTORY, not the contents.
ln -s icons /usr/share/pepicons
ln -s themes /usr/share/pepthemes
ln -s backgrounds /usr/share/pepwallpaper
# A better version of vi and vim than vim-tiny
rm /etc/alternatives/vi
ln -s ../../etc/alternatives/vim /usr/bin/vim
ln -s ../../usr/bin/vim.tiny /etc/alternatives/vim
ln -s ../../usr/bin/busybox /etc/alternatives/vi
# Put a .png at ~/.face from within /etc/skel
#ln -s /usr/share/pixmaps/logo.png /etc/skel/.face

View File

@ -1,54 +0,0 @@
#!/bin/bash
# As we progress, we may find additional files REQUIRING special permissions.
# Set write permissions for these files and directories in the chroot here.
# This allows write access to the Welcome Screen database to users in the "cdrom" group.
# IF this a system wide file, one user can disable or turn it off for *ALL* accounts.
# If this is meant to be on a per user basis, put the .db in ${HOME}/.config .
# Or rewrite welcome.py to write to the .db WHICH user requested to disable this feature.
# Set Permissions on desktop files
# Desktop links
chmod 755 /usr/share/applications/Pephub.desktop
chmod 755 /usr/share/applications/Welcome.desktop
chmod 755 /usr/share/applications/plank.desktop
chmod 755 /usr/share/applications/kumo.desktop
chmod 755 /usr/share/applications/Install-peppermint.desktop
# Executables
chmod 755 /usr/local/bin/hub
chmod 755 /usr/local/bin/xDaily
chmod 755 /usr/local/bin/kumo
chmod 755 /usr/local/bin/welcome
chmod 755 /usr/bin/install-peppermint
# Set permissions on the Python libs
chmod 755 -R /usr/lib/python3/dist-packages/tendo
chmod 755 -R /usr/lib/python3/dist-packages/tendo-0.3.0.dist-info
chmod 755 -R /usr/lib/python3/dist-packages/ttkbootstrap
chmod 755 -R /usr/lib/python3/dist-packages/ttkbootstrap-1.10.1.dist-info
chmod 755 -R /usr/lib/python3/dist-packages/ttkcreator
# Set permissions on the lines theme
chmod 755 -R /usr/share/desktop-base/lines-theme
# Set Grub Themes Permission
chmod 755 -R /boot/grub/themes
# Set the Calamares Permissions]
chmod 755 -R /etc/calamares
### After installation, additional groups to add new users to.
grep -B99 "#EXTRA_GROUPS=" /etc/adduser.conf > /etc/adduser.conf.new
grep "#EXTRA_GROUPS=" /etc/adduser.conf | cut -c2- >> /etc/adduser.conf.new
grep -B3 "#ADD_EXTRA_GROUPS=" /etc/adduser.conf >> /etc/adduser.conf.new
grep "#ADD_EXTRA_GROUPS=" /etc/adduser.conf | cut -c2- >> /etc/adduser.conf.new
grep -B3 "#NAME_REGEX=" /etc/adduser.conf >> /etc/adduser.conf.new
# These are for the 3 installer scripts - icons.sh, themes.sh & walls.sh
# In 0600- we created symlinks to these directories. This makes them writable.
chmod 755 -R /usr/share/icons
chmod 755 -R /usr/share/themes
chmod 755 -R /usr/share/backgrounds
chmod 755 -R /usr/share/pixmaps
# Quick patch from https://www.zdnet.com/article/major-linux-policykit-security-vulnerability-uncovered-pwnkit/
#chmod 0755 /usr/bin/pkexec # Their patch didn't work "pkexec must be setuid root"

View File

@ -1,31 +0,0 @@
#!/bin/bash
### Check for building a Devuan system
if [ -e /etc/devuan_version ]
then _plymouthcfg="/usr/share/initramfs-tools/scripts/init-premount/plymouth"
grep -B100 "mkdir -m 0755" ${_plymouthcfg} > ${_plymouthcfg}.new
echo -e "\tudevadm trigger -s graphics" >> ${_plymouthcfg}.new
echo -e "\t udevadm settle" >> ${_plymouthcfg}.new
echo -e '\t[ "$quiet" = "y" ] && reset' >> ${_plymouthcfg}.new
echo -e '\techo "Starting PeppermintOS Devuan"' >> ${_plymouthcfg}.new
grep -A10 "/usr/sbin/plymouthd" ${_plymouthcfg} >> ${_plymouthcfg}.new
echo -e "" >> ${_plymouthcfg}.new
mv ${_plymouthcfg}.new ${_plymouthcfg}
chmod +x ${_plymouthcfg}
# plymouth-set-default-theme futureprototype --rebuild-initrd
### Fixes "No OffLine Installs" in Devuan versions.
sed s/bullseye/chimaera/ /usr/sbin/sources-media > /tmp/sources-media
chmod +x /tmp/sources-media && mv /tmp/sources-media /usr/sbin/sources-media
### Some Gnome-ish software only looks for machine-id in /etc/
[ ! -e /etc/machine-id ] && ln -s /var/lib/dbus/machine-id /etc/machine-id
### Differentiate the Devuan slides from the Debian slides.
mv /etc/calamares/branding/peppermint/slides/devuan/s*.png /etc/calamares/branding/peppermint/
rm -rf /etc/calamares/branding/peppermint/slides/
else mv /etc/calamares/branding/peppermint/slides/debian/s*.png /etc/calamares/branding/peppermint/
rm -rf /etc/calamares/branding/peppermint/slides/
fi

View File

@ -1,39 +0,0 @@
#!/bin/bash
### Error checking added to "lint-trap" section.
### Missing files no longer cause builds to fail.
### Do NOT remove these files.
# /usr/share/lightdm/lightdm.conf.d/01_debian.conf
## This section is the "lint-trap" to remove files and/or
## directories not associated with or required by PepOS.
## Followed by \ , add files to be removed, one per line.
for i in \
/usr/bin/install-debian \
/usr/share/applications/install-debian.desktop \
/usr/share/applications/xfburn.desktop \
/usr/share/applications/luakit.desktop \
/root/.cache/pip \
do [ -e $i ] &&
rm -rf ${i} ||
echo " The path ${i} was not found and couldn't be removed."
done
### This might be better in an OS-tweaks hook script.
# Lowers the footprint in RAM by 200 MB at the small expense of added size to the ISO.
update-icon-caches /usr/share/icons/*
### Setting --apt-recommends and --apt-suggests defaults to '0'
echo -e "# Changing these values to \"1\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends
echo -e "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99No-Recommends
### Fixes the "Not installing grub for UEFI Secure Boot" in all versions , after the default was changed.
#sed s/keyutils/"keyutils --install-recommends"/ /usr/sbin/bootloader-config > /tmp/bootloader-config
echo -e "$(grep -A1 -B20 "Installing grub-efi (uefi)..." /usr/sbin/bootloader-config) --install-recommends" > /tmp/bootloader-config
echo -e "$(grep -A2 "else" /usr/sbin/bootloader-config) --install-recommends\nfi" >> /tmp/bootloader-config
chmod +x /tmp/bootloader-config && mv /tmp/bootloader-config /usr/sbin/bootloader-config

View File

@ -1,7 +0,0 @@
#!/bin/bash
#John's note: this will not harm the other architectures.
rm live/initrd.img
rm live/vmlinuz
cp live/initrd.img-* live/initrd.img
cp live/vmlinuz-* live/vmlinuz

View File

@ -1,3 +1,9 @@
#!/bin/bash
# run the main Hooks python module
python3 /usr/lib/python3/dist-packages/pepperpy/hooks.py
### Setting --apt-recommends and --apt-suggests defaults to '0'
echo -e "# Changing these values to \"1\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends
echo -e "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99No-Recommends

View File

@ -1,3 +1,9 @@
#!/bin/bash
# run the main Hooks python module
python3 /usr/lib/python3/dist-packages/pepperpy/hooks.py
### Setting --apt-recommends and --apt-suggests defaults to '0'
echo -e "# Changing these values to \"1\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends
echo -e "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99No-Recommends

View File

@ -1,3 +1,9 @@
#!/bin/bash
# run the main Hooks python module
python3 /usr/lib/python3/dist-packages/pepperpy/hooks.py
### Setting --apt-recommends and --apt-suggests defaults to '0'
echo -e "# Changing these values to \"1\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends
echo -e "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99No-Recommends

View File

@ -0,0 +1,31 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Exit immediately if a command exits with a non-zero status
set -e
# Function to remove NVIDIA software
remove_nvidia_packages() {
echo "Removing NVIDIA-related packages..."
if dpkg -l | grep -q nvidia; then
apt-get --purge --yes autoremove nvidia*
echo "NVIDIA packages removed successfully."
else
echo "No NVIDIA packages found to remove."
fi
}
# Main function
main() {
remove_nvidia_packages
echo "Software removal process completed."
}
# Run the main function
main
exit 0

View File

@ -1,12 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
### Error checking added to "lint-trap" section.
### Missing files no longer cause builds to fail.
# Remove software
#apt --purge --yes autoremove nvidia*

View File

@ -4,6 +4,38 @@
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
### install cockpit server manager
apt -y install cockpit*
# Exit immediately if a command exits with a non-zero status
set -e
# Function to check if a package is installed
is_installed() {
dpkg -l "$1" &> /dev/null
}
# Function to install Cockpit and related packages
install_cockpit_packages() {
PACKAGES=("cockpit" "cockpit-machines" "cockpit-podman")
for PACKAGE in "${PACKAGES[@]}"; do
if ! is_installed "$PACKAGE"; then
echo "Installing $PACKAGE..."
apt-get install -y "$PACKAGE"
echo "$PACKAGE installed successfully."
else
echo "$PACKAGE is already installed."
fi
done
}
# Main function
main() {
echo "Starting Cockpit installation..."
install_cockpit_packages
echo "Cockpit installation completed."
}
# Run the main function
main
exit 0

View File

@ -0,0 +1,101 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Exit immediately if a command exits with a non-zero status
set -e
# Function to check if a package is installed
is_installed() {
dpkg -l "$1" &> /dev/null
}
# Install required SELinux packages
install_selinux_packages() {
PACKAGES=("selinux-basics" "selinux-policy-default" "auditd")
for PACKAGE in "${PACKAGES[@]}"; do
if ! is_installed "$PACKAGE"; then
echo "Installing $PACKAGE..."
apt-get install -y "$PACKAGE"
echo "$PACKAGE installed successfully."
else
echo "$PACKAGE is already installed."
fi
done
}
# Initialize SELinux if not already active
initialize_selinux() {
if [ ! -f /etc/selinux/config ]; then
echo "Activating SELinux..."
selinux-activate
else
echo "SELinux is already activated."
fi
}
# Restart auditd service
restart_auditd() {
if systemctl is-active --quiet auditd; then
echo "Restarting auditd service..."
systemctl restart auditd
else
echo "Auditd service not running."
fi
}
# Disable AppArmor if it is running
disable_apparmor() {
if systemctl is-active --quiet apparmor; then
echo "Disabling and removing AppArmor..."
systemctl disable apparmor
systemctl stop apparmor
apt-get -y purge apparmor
else
echo "AppArmor is not running or already disabled."
fi
}
# Set SELinux to enforcing mode
set_selinux_enforcing() {
if getenforce | grep -q "Enforcing"; then
echo "SELinux is already in enforcing mode."
else
echo "Setting SELinux to enforcing mode..."
/usr/sbin/setenforce 1
fi
}
# Configure file contexts (example)
restore_file_contexts() {
echo "Restoring file contexts in /etc/..."
/sbin/restorecon -Rv /etc/
}
# Allow HTTPD scripts and modules to connect to the network (example)
configure_httpd_selinux() {
echo "Allowing HTTPD scripts and modules to connect to the network..."
/usr/sbin/setsebool -P httpd_can_network_connect 1
}
# Main function
main() {
install_selinux_packages
initialize_selinux
restart_auditd
disable_apparmor
set_selinux_enforcing
restore_file_contexts
configure_httpd_selinux
echo "SELinux setup completed successfully."
}
# Run the main function
main
exit 0

View File

@ -0,0 +1,33 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Exit immediately if a command exits with a non-zero status
set -e
# Function to remove unnecessary files
remove_file() {
local FILE_PATH="$1"
if [ -f "$FILE_PATH" ]; then
echo "Removing file: $FILE_PATH"
rm "$FILE_PATH"
echo "File $FILE_PATH removed successfully."
else
echo "File $FILE_PATH does not exist, skipping removal."
fi
}
# Main function
main() {
remove_file "/etc/default/grub"
echo "File cleanup completed."
}
# Run the main function
main
exit 0

View File

@ -1,3 +1,9 @@
#!/bin/bash
# run the main Hooks python module
python3 /usr/lib/python3/dist-packages/pepperpy/hooks.py
### Setting --apt-recommends and --apt-suggests defaults to '0'
echo -e "# Changing these values to \"1\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends
echo -e "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99No-Recommends

View File

@ -1,3 +1,9 @@
#!/bin/bash
# run the main Hooks python module
python3 /usr/lib/python3/dist-packages/pepperpy/hooks.py
### Setting --apt-recommends and --apt-suggests defaults to '0'
echo -e "# Changing these values to \"1\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends
echo -e "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99No-Recommends

View File

@ -1,3 +1,9 @@
#!/bin/bash
# run the main Hooks python module
python3 /usr/lib/python3/dist-packages/pepperpy/hooks.py
### Setting --apt-recommends and --apt-suggests defaults to '0'
echo -e "# Changing these values to \"1\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends
echo -e "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99No-Recommends

View File

@ -4,9 +4,28 @@
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
### Error checking added to "lint-trap" section.
### Missing files no longer cause builds to fail.
# Exit immediately if a command exits with a non-zero status
set -e
# Remove software
#apt --purge --yes autoremove nvidia*
# Function to remove NVIDIA software
remove_nvidia_packages() {
echo "Removing NVIDIA-related packages..."
if dpkg -l | grep -q nvidia; then
apt-get --purge --yes autoremove nvidia*
echo "NVIDIA packages removed successfully."
else
echo "No NVIDIA packages found to remove."
fi
}
# Main function
main() {
remove_nvidia_packages
echo "Software removal process completed."
}
# Run the main function
main
exit 0

View File

@ -0,0 +1,110 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Exit immediately if a command exits with a non-zero status
set -e
# Function to check if a package is installed
is_installed() {
dpkg -l "$1" &> /dev/null
}
# Install required SELinux packages if not already installed
install_selinux_packages() {
PACKAGES=("selinux-basics" "selinux-policy-default" "auditd")
for PACKAGE in "${PACKAGES[@]}"; do
if ! is_installed "$PACKAGE"; then
echo "Installing $PACKAGE..."
apt-get install -y "$PACKAGE"
else
echo "$PACKAGE is already installed."
fi
done
}
# Initialize SELinux if not already active
initialize_selinux() {
if [ ! -f /etc/selinux/config ]; then
echo "Activating SELinux..."
selinux-activate
else
echo "SELinux is already activated."
fi
}
# Restart auditd service
restart_auditd() {
if service auditd status &> /dev/null; then
echo "Restarting auditd service..."
service auditd restart
else
echo "Auditd service not found."
fi
}
# Enable SELinux policy activation on boot
enable_selinux_policy() {
if [ -f /etc/init.d/selinux-policy-activate ]; then
echo "Enabling SELinux policy activation on boot..."
update-rc.d selinux-policy-activate defaults
else
echo "SELinux policy activation script not found."
fi
}
# Disable AppArmor if it is running
disable_apparmor() {
if service apparmor status &> /dev/null; then
echo "Disabling AppArmor..."
service apparmor stop
update-rc.d -f apparmor remove
apt-get -y purge apparmor
else
echo "AppArmor is not running."
fi
}
# Set SELinux to enforcing mode
set_selinux_enforcing() {
if getenforce | grep -q "Enforcing"; then
echo "SELinux is already in enforcing mode."
else
echo "Setting SELinux to enforcing mode..."
/usr/sbin/setenforce 1
fi
}
# Configure file contexts (example)
restore_file_contexts() {
echo "Restoring file contexts in /etc/..."
/sbin/restorecon -Rv /etc/
}
# Allow HTTPD scripts and modules to connect to the network (example)
configure_httpd_selinux() {
echo "Allowing HTTPD scripts and modules to connect to the network..."
/usr/sbin/setsebool -P httpd_can_network_connect 1
}
# Main function
main() {
install_selinux_packages
initialize_selinux
restart_auditd
enable_selinux_policy
disable_apparmor
set_selinux_enforcing
restore_file_contexts
configure_httpd_selinux
echo "SELinux setup completed successfully."
}
# Run the main function
main
exit 0

View File

@ -0,0 +1,33 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Exit immediately if a command exits with a non-zero status
set -e
# Function to remove unnecessary files
remove_file() {
local FILE_PATH="$1"
if [ -f "$FILE_PATH" ]; then
echo "Removing file: $FILE_PATH"
rm "$FILE_PATH"
echo "File $FILE_PATH removed successfully."
else
echo "File $FILE_PATH does not exist, skipping removal."
fi
}
# Main function
main() {
remove_file "/etc/default/grub"
echo "File cleanup completed."
}
# Run the main function
main
exit 0

View File

@ -29,5 +29,5 @@ popularity-contest popularity-contest/participate boolean false
### Account setup
# Skip creation of a root account (normal user account will be able to
# use sudo).
d-i passwd/root-login boolean false
#d-i passwd/root-login boolean false

View File

@ -29,5 +29,5 @@ popularity-contest popularity-contest/participate boolean false
### Account setup
# Skip creation of a root account (normal user account will be able to
# use sudo).
d-i passwd/root-login boolean false
#d-i passwd/root-login boolean false

View File

@ -7,12 +7,12 @@
# This script copies a file to the chroot and runs commands during the Debian installation process.
# Copy files to the chroot directory
#echo "Copying files to chroot..."
#cp /preseed/grub/grub /cdrom/etc/default
echo "Copying files to chroot..."
cp /preseed/grub/grub /cdrom/etc/default
# update grub and initramfs
#chroot /cdrom update-initramfs -u
#chroot /cdrom update-grub
chroot /cdrom update-initramfs -u
chroot /cdrom update-grub
#exit 0
exit 0

View File

@ -7,12 +7,12 @@
# This script copies a file to the chroot and runs commands during the Debian installation process.
# Copy files to the chroot directory
#echo "Copying files to chroot..."
#cp /preseed/grub/grub /cdrom/etc/default
echo "Copying files to chroot..."
cp /preseed/grub/grub /cdrom/etc/default
# update grub and initramfs
#chroot /cdrom update-initramfs -u
#chroot /cdrom update-grub
chroot /cdrom update-initramfs -u
chroot /cdrom update-grub
#exit 0
exit 0

View File

@ -68,7 +68,7 @@ Comment[tr]=xDaily Güncelleme Aracı için bir GUI
Categories=XFCE;GTK;Settings;X-XFCE-SettingsDialog;
Type=Application
Exec=xdaily-gui
Icon=/usr/share/pixmaps/xd.png
Icon=xd
Terminal=false
NoDisplay=false

View File

@ -0,0 +1,11 @@
[Default Applications]
x-scheme-handler/http=xfce4-web-browser.desktop
x-scheme-handler/https=xfce4-web-browser.desktop
text/x-python=org.xfce.mousepad.desktop
text/plain=org.xfce.mousepad.desktop
[Added Associations]
x-scheme-handler/http=xfce4-web-browser.desktop;
x-scheme-handler/https=xfce4-web-browser.desktop;
text/x-python=org.xfce.mousepad.desktop;
text/plain=org.xfce.mousepad.desktop;

View File

@ -7,7 +7,7 @@
* Screen
"""
import os.path
import shutil
# This will get the logged in user
gusr = os.getlogin()
spath = "/home/" + gusr + "/.local/share/pmostools/peptools"
@ -29,10 +29,15 @@ def determine_browser(run_addrs):
profile_path = os.path.expanduser(
f"/home/{gusr}/.local/share/pmostools/ff_profile/"
)
if shutil.which('firefox'):
command = (
f'firefox -P firefox_kumo --profile "{profile_path}" {run_addrs} &'
)
print("Found the FF, running Firefox")
else:
print("Firefox not found, running with luakit instead")
command = f'luakit -U {run_addrs} &'
else:
command = f'luakit -U {run_addrs} &'
print("This is a 32bit Flagship with no browser")

View File

@ -115,8 +115,8 @@ get_started = ttk.Button(menu_xd_intro, text="Get started",
command=lambda:xdaily_functions.manage_updates_tab(main_notebook, output_text, run_task_updates,xd_intro,manage_updates),
width=8
)
get_started.grid(row=1, column=0, ipadx=6.5, ipady=6.5, padx=6.5,
pady=6.5,
get_started.grid(row=1, column=0, ipadx=6, ipady=6, padx=6,
pady=6,
sticky='ew'
)
pep_docs = ttk.Button(menu_xd_intro, text="Pep Docs",
@ -124,21 +124,21 @@ pep_docs = ttk.Button(menu_xd_intro, text="Pep Docs",
command = xdaily_functions.pep_docs,
width=8
)
pep_docs.grid(row=1, column=1, ipadx=6.5, ipady=6.5, padx=6.5,
pady=6.5, sticky='ew'
pep_docs.grid(row=1, column=1, ipadx=6, ipady=6, padx=6,
pady=6, sticky='ew'
)
community = ttk.Button(menu_xd_intro, text="Forums",
bootstyle="danger", cursor="hand2",
command = xdaily_functions.source_forge, width=8
)
community.grid(row=2, column=0, ipadx=6.5, ipady=6.5, padx=6.5,
pady=6.5, sticky='ew'
community.grid(row=2, column=0, ipadx=6, ipady=6, padx=6,
pady=6, sticky='ew'
)
runall = ttk.Button(menu_xd_intro, text="Run all tasks",
bootstyle="danger", cursor="hand2",
command = xdaily_functions.run_terminal_xdaily, width=8
)
runall.grid(row=2, column=1, ipadx=6.5, ipady=6.5, padx=6.5, pady=6.5,
runall.grid(row=2, column=1, ipadx=6, ipady=6, padx=6, pady=6,
sticky='ew'
)
#####################################################

View File

@ -31,17 +31,33 @@ BUTTON_TEXT = "Submit"
STYLE_TYPE = "danger"
CURSOR_ICON = "hand2"
def set_browser():
"""
Determine the system and set the browser type
"""
architecture = platform.architecture()[0]
if '64bit' in architecture:
browser_type = "min"
else:
browser_type = "luakit"
return browser_type
gusr = os.getlogin()
def determine_browser(run_addrs):
""" Determine what browser should be used by kumo"""
lwpath = "/home/" + gusr + "/.local/share/pmostools/lw_profile"
ffpath = "/home/" + gusr + "/.local/share/pmostools/ff_profile"
if os.path.exists(lwpath) and os.path.isdir(lwpath):
profile_path = os.path.expanduser(
f"/home/{gusr}/.local/share/pmostools/lw_profile/"
)
command = (
f'librewolf -P kumo --profile "{profile_path}" {run_addrs} &'
)
print("Found the LW, running LibreWolf")
elif os.path.exists(ffpath) and os.path.isdir(ffpath):
profile_path = os.path.expanduser(
f"/home/{gusr}/.local/share/pmostools/ff_profile/"
)
command = (
f'firefox -P firefox_kumo --profile "{profile_path}" {run_addrs} &'
)
print("Found the FF, running Firefox")
else:
command = f'luakit -U {run_addrs} &'
print("This is a 32bit Flagship with no browser")
return command
def submit_password(password_entry,
@ -297,7 +313,7 @@ def currently_pending_updates(xd_intro):
tree.insert(type_node, "end", values=(package, ""))
tree.set(type_node, "count", str(data["count"]))
tree.pack(expand=True, fill=tk.BOTH, padx=5.7, pady=5.7)
tree.pack(expand=True, fill=tk.BOTH, padx=6, pady=6)
def get_update_records():
@ -327,22 +343,23 @@ def wbase(window_object):
def pep_docs():
"""Open Pep Docs"""
browser_type = set_browser()
url = "https://peppermint_os.codeberg.page/html/"
command = (
f'{browser_type} --new-window {url} &'
)
run_addrs = "https://peppermint_os.codeberg.page/html/"
command = determine_browser(run_addrs)
if command:
os.system(command)
else:
print("There no suitebable browser installed!")
def source_forge():
"""Open Sourceforge"""
browser_type = set_browser()
url ="https://sourceforge.net/p/peppermintos/pepos/"
command = (
f'{browser_type} --new-window {url} &'
)
run_addrs = "https://sourceforge.net/p/peppermintos/pepos/"
command = determine_browser(run_addrs)
if command:
os.system(command)
else:
print("There no suitebable browser installed!")
def manage_updates_tab(main_notebook, output_text, run_task_updates,xd_intro, manage_updates):
""" Move to the manage updates tab"""

View File

@ -3,8 +3,8 @@
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* This is the hook module use dto run for the normal hooks,
* this will run afte rthe ISO main build begins.
* This hook is the central one used for all the builds
* Add things as needed
"""
import os
import platform
@ -35,7 +35,7 @@ def remove_packages_from_the_build():
os.system(f'apt --purge --yes autoremove {package}')
def remove_desktop_files():
def remmove_desktop_files():
"""
Use this def to remove any .desktop files you donot need
"""
@ -135,8 +135,7 @@ def hblock_setup():
os.system('chmod 755 /usr/local/bin/hblock')
os.system('hblock -S none -D none exit 0')
## this function may not be necessary because the bug is already fixed
## in live-build.
## this function may not be necessary because the bug is already fixed in live-build.
def manage_raspi_firmware():
"""
Manage when the raspi firmware, is removed.
@ -231,7 +230,6 @@ def final_cleanup():
Followed by "\" , add files to be removed, one per line.
"""
files_to_remove = [ "/usr/bin/install-debian",
"/usr/share/applications/min.desktop",
"/usr/share/applications/calamares-install-debian.desktop"
]
for file_path in files_to_remove:
@ -244,10 +242,10 @@ def final_cleanup():
# Lowers the footprint in RAM by 200 MB at the small expense of added size to the ISO.
os.system('update-icon-caches /usr/share/icons/*')
### Setting --apt-recommends and --apt-suggests defaults to '0'
# Create and write to the file
os.system('echo "# Changing these values to \\"1\\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends')
# Append additional content to the file
os.system('echo "APT::Install-Recommends \\"0\\";\nAPT::Install-Suggests \\"0\\";" >> /etc/apt/apt.conf.d/99No-Recommends')
#os.system('echo -e "# Changing these values to \"1\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends')
#os.system('echo -e "# Changing these values to \\"1\\" may quickly fill up a small partition" > /etc/apt/apt.conf.d/99No-Recommends')
#os.system('echo -e "APT::Install-Recommends \"0\";\nAPT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99No-Recommends')
#os.system('echo -e "APT::Install-Recommends \\"0\\";\nAPT::Install-Suggests \\"0\\";" >> /etc/apt/apt.conf.d/99No-Recommends')
### Fixes the "Not installing grub for UEFI Secure Boot" in all versions , after the default was changed.
#sed s/keyutils/"keyutils --install-recommends"/ /usr/sbin/bootloader-config > /tmp/bootloader-config
os.system('echo -e "$(grep -A1 -B20 "Installing grub-efi (uefi)..." /usr/sbin/bootloader-config) --install-recommends" > /tmp/bootloader-config')
@ -282,7 +280,7 @@ def start():
apt_install_packages()
remove_packages_from_the_build()
install_librewolf_browser()
remove_desktop_files()
remmove_desktop_files()
setup_plymouth_theme_grub()
hblock_setup()
manage_raspi_firmware()
@ -293,7 +291,7 @@ def start():
rename_kernel()
else:
apt_install_packages()
remove_desktop_files()
remmove_desktop_files()
remove_packages_from_the_build()
setup_plymouth_theme_grub()
hblock_setup()

View File

@ -139,7 +139,6 @@ def other_misc_settings():
# Then recreate it with the Pep Background
os.system(makelnk)
def remmove_desktop_files():
"""
Use this def to remove any .desktop files you donot need

View File

@ -1,12 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
### Error checking added to "lint-trap" section.
### Missing files no longer cause builds to fail.
# Remove software
#apt --purge --yes autoremove nvidia*

View File

@ -1,17 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Check if it's Debian (based on ID field)
if grep -q '^PRETTY_NAME="PeppermintOS Debian"' /etc/os-release && grep -q 'VERSION_CODENAME=bookworm' /etc/os-release; then
# Install software only if it's Debian and codename is bookworm
apt --yes install cockpit* || true
# Check if it's Devuan (based on ID field)
elif grep -q '^PRETTY_NAME="PeppermintOS Devuan' /etc/os-release && grep -q 'VERSION_CODENAME=daedalus' /etc/os-release; then
echo "This is Devuan distribution, and the codename is daedalus. Packages will not be installed."
else
echo "This distribution is not supported. Packages will not be installed."
fi

View File

@ -0,0 +1,230 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to install Apache if not installed
install_apache_if_needed() {
if ! dpkg -l apache2 > /dev/null 2>&1; then
echo "Apache is not installed. Installing..."
if sudo apt-get install -y apache2; then
echo "Apache installed successfully."
else
echo "Failed to install Apache. Exiting."
exit 1
fi
fi
}
# Function to install Certbot if not installed
install_certbot_if_needed() {
if ! command -v certbot &> /dev/null; then
echo "Certbot is not installed. Installing..."
if sudo apt-get install -y certbot python3-certbot-apache; then
echo "Certbot installed successfully."
else
echo "Failed to install Certbot. Exiting."
exit 1
fi
fi
}
# Function to start Apache
start_apache() {
sudo systemctl start apache2
dialog --msgbox "Apache started." 10 30
}
# Function to stop Apache
stop_apache() {
sudo systemctl stop apache2
dialog --msgbox "Apache stopped." 10 30
}
# Function to restart Apache
restart_apache() {
sudo systemctl restart apache2
dialog --msgbox "Apache restarted." 10 30
}
# Function to enable Apache at boot
enable_apache_at_boot() {
sudo systemctl enable apache2
dialog --msgbox "Apache enabled at boot." 10 30
}
# Function to disable Apache at boot
disable_apache_at_boot() {
sudo systemctl disable apache2
dialog --msgbox "Apache disabled at boot." 10 30
}
# Function to secure Apache installation
secure_apache() {
echo "Apache does not require additional security configuration."
dialog --msgbox "Apache installation secured." 10 30
}
# Function to configure Apache virtual hosts
configure_apache_virtual_hosts() {
DOMAIN=$(dialog --inputbox "Enter the domain name for the virtual host (e.g., example.com):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [ $? -ne 0 ]; then
return
fi
if [[ -n "$DOMAIN" ]]; then
sudo mkdir -p /var/www/$DOMAIN/public_html
sudo chown -R www-data:www-data /var/www/$DOMAIN/public_html
sudo chmod -R 755 /var/www/$DOMAIN
cat << EOF | sudo tee /etc/apache2/sites-available/$DOMAIN.conf > /dev/null
<VirtualHost *:80>
ServerAdmin webmaster@$DOMAIN
ServerName $DOMAIN
DocumentRoot /var/www/$DOMAIN/public_html
ErrorLog \${APACHE_LOG_DIR}/error.log
CustomLog \${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
EOF
sudo a2ensite $DOMAIN.conf
sudo systemctl reload apache2
dialog --msgbox "Virtual host for $DOMAIN configured successfully." 10 60
fi
}
# Function to enable or disable Apache virtual host (site)
enable_disable_apache_site() {
SITE=$(dialog --inputbox "Enter the site configuration file name (without .conf):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [ $? -ne 0 ]; then
return
fi
if [[ -z "$SITE" ]]; then
dialog --msgbox "No site configuration file name entered. Returning to menu." 10 30
return
fi
ACTION=$(dialog --clear --backtitle "Enable/Disable Apache Site" \
--title "Enable/Disable Apache Site" \
--menu "Choose an action:" 10 40 2 \
1 "Enable" \
2 "Disable" \
3>&1 1>&2 2>&3 3>&-)
if [ $? -ne 0 ]; then
return
fi
case $ACTION in
1)
sudo a2ensite $SITE.conf
sudo systemctl reload apache2
dialog --msgbox "Apache site $SITE enabled." 10 30
;;
2)
sudo a2dissite $SITE.conf
sudo systemctl reload apache2
dialog --msgbox "Apache site $SITE disabled." 10 30
;;
*)
dialog --msgbox "Invalid option." 10 30
;;
esac
}
# Function to enable or disable Apache modules
enable_disable_apache_module() {
MODULE=$(dialog --inputbox "Enter the name of the Apache module to enable/disable (e.g., rewrite):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [ $? -ne 0 ]; then
return
fi
if [[ -z "$MODULE" ]]; then
dialog --msgbox "No module name entered. Returning to menu." 10 30
return
fi
ACTION=$(dialog --clear --backtitle "Enable/Disable Apache Module" \
--title "Enable/Disable Apache Module" \
--menu "Choose an action:" 10 40 2 \
1 "Enable" \
2 "Disable" \
3>&1 1>&2 2>&3 3>&-)
if [ $? -ne 0 ]; then
return
fi
case $ACTION in
1)
sudo a2enmod $MODULE
sudo systemctl restart apache2
dialog --msgbox "Apache module $MODULE enabled." 10 30
;;
2)
sudo a2dismod $MODULE
sudo systemctl restart apache2
dialog --msgbox "Apache module $MODULE disabled." 10 30
;;
*)
dialog --msgbox "Invalid option." 10 30
;;
esac
}
# Function to configure Certbot for Apache
configure_certbot() {
DOMAIN=$(dialog --inputbox "Enter the domain name for which you want to configure Certbot (e.g., example.com):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [ $? -ne 0 ]; then
return
fi
if [[ -n "$DOMAIN" ]]; then
sudo certbot --apache -d $DOMAIN
fi
}
# Function to configure Apache
configure_apache() {
while true; do
CHOICE=$(dialog --clear --backtitle "Configure Apache" \
--title "Apache Menu" \
--menu "Choose an option:" 20 60 12 \
1 "Install/Check Apache" \
2 "Start Apache" \
3 "Stop Apache" \
4 "Restart Apache" \
5 "Enable Apache at Boot" \
6 "Disable Apache at Boot" \
7 "Secure Apache Installation" \
8 "Configure Virtual Host" \
9 "Enable/Disable Apache Site" \
10 "Enable/Disable Apache Module" \
11 "Configure Certbot" \
12 "Return to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
clear
case $CHOICE in
1) install_apache_if_needed ;;
2) start_apache ;;
3) stop_apache ;;
4) restart_apache ;;
5) enable_apache_at_boot ;;
6) disable_apache_at_boot ;;
7) secure_apache ;;
8) configure_apache_virtual_hosts ;;
9) enable_disable_apache_site ;;
10) enable_disable_apache_module ;;
11) configure_certbot ;;
12) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Show main configuration menu
configure_apache

View File

@ -0,0 +1,235 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to install Docker if not installed
install_docker_if_needed() {
if ! command -v docker &> /dev/null; then
echo "Docker is not installed. Installing..."
if curl -fsSL https://get.docker.com | sudo sh; then
echo "Docker installed successfully."
else
echo "Failed to install Docker. Exiting."
exit 1
fi
else
echo "Docker is already installed."
fi
}
# Function to configure Docker
configure_docker() {
while true; do
OPTION=$(dialog --clear --backtitle "Configure Docker" \
--title "Docker Configuration Menu" \
--menu "Choose an option:" 15 60 6 \
1 "Create Docker Network" \
2 "Manage Docker Containers" \
3 "Manage Docker Images" \
4 "Manage Docker Volumes" \
5 "Manage Docker Compose" \
6 "Return to Main Menu" \
3>&1 1>&2 2>&3)
# Check if user canceled
if [ $? -eq 1 ]; then
return
fi
case $OPTION in
1) NETWORK=$(dialog --inputbox "Enter Docker network name:" 10 40 3>&1 1>&2 2>&3)
if [ $? -ne 1 ]; then
sudo docker network create $NETWORK
fi ;;
2) manage_docker_containers ;;
3) manage_docker_images ;;
4) manage_docker_volumes ;;
5) manage_docker_compose ;;
6) return ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to manage Docker containers
manage_docker_containers() {
while true; do
ACTION=$(dialog --clear --backtitle "Manage Docker Containers" \
--title "Docker Container Management" \
--menu "Choose an action:" 15 60 4 \
1 "List Containers" \
2 "Start Container" \
3 "Stop Container" \
4 "Return to Docker Menu" \
3>&1 1>&2 2>&3)
# Check if user canceled
if [ $? -eq 1 ]; then
return
fi
case $ACTION in
1) sudo docker ps -a ;;
2) CONTAINER=$(dialog --inputbox "Enter the container ID or name:" 10 40 3>&1 1>&2 2>&3)
if [ $? -ne 1 ]; then
sudo docker start $CONTAINER
fi ;;
3) CONTAINER=$(dialog --inputbox "Enter the container ID or name:" 10 40 3>&1 1>&2 2>&3)
if [ $? -ne 1 ]; then
sudo docker stop $CONTAINER
fi ;;
4) return ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to manage Docker images
manage_docker_images() {
while true; do
ACTION=$(dialog --clear --backtitle "Manage Docker Images" \
--title "Docker Image Management" \
--menu "Choose an action:" 15 60 4 \
1 "List Images" \
2 "Pull Image" \
3 "Remove Image" \
4 "Return to Docker Menu" \
3>&1 1>&2 2>&3)
# Check if user canceled
if [ $? -eq 1 ]; then
return
fi
case $ACTION in
1) sudo docker images ;;
2) IMAGE=$(dialog --inputbox "Enter the image name (e.g., ubuntu):" 10 40 3>&1 1>&2 2>&3)
if [ $? -ne 1 ]; then
sudo docker pull $IMAGE
fi ;;
3) IMAGE=$(dialog --inputbox "Enter the image ID or name:" 10 40 3>&1 1>&2 2>&3)
if [ $? -ne 1 ]; then
sudo docker rmi $IMAGE
fi ;;
4) return ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to manage Docker volumes
manage_docker_volumes() {
while true; do
ACTION=$(dialog --clear --backtitle "Manage Docker Volumes" \
--title "Docker Volume Management" \
--menu "Choose an action:" 15 60 4 \
1 "List Volumes" \
2 "Create Volume" \
3 "Remove Volume" \
4 "Return to Docker Menu" \
3>&1 1>&2 2>&3)
# Check if user canceled
if [ $? -eq 1 ]; then
return
fi
case $ACTION in
1) sudo docker volume ls ;;
2) VOLUME=$(dialog --inputbox "Enter the volume name:" 10 40 3>&1 1>&2 2>&3)
if [ $? -ne 1 ]; then
sudo docker volume create $VOLUME
fi ;;
3) VOLUME=$(dialog --inputbox "Enter the volume name or ID:" 10 40 3>&1 1>&2 2>&3)
if [ $? -ne 1 ]; then
sudo docker volume rm $VOLUME
fi ;;
4) return ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to manage Docker Compose
manage_docker_compose() {
while true; do
ACTION=$(dialog --clear --backtitle "Manage Docker Compose" \
--title "Docker Compose Management" \
--menu "Choose an action:" 15 60 4 \
1 "Run Docker Compose" \
2 "Stop Docker Compose" \
3 "Remove Docker Compose" \
4 "Return to Docker Menu" \
3>&1 1>&2 2>&3)
# Check if user canceled
if [ $? -eq 1 ]; then
return
fi
case $ACTION in
1) docker_compose_up ;;
2) docker_compose_down ;;
3) docker_compose_remove ;;
4) return ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to run Docker Compose
docker_compose_up() {
COMPOSE_FILE=$(dialog --inputbox "Enter the Docker Compose file (e.g., docker-compose.yaml):" 10 40 3>&1 1>&2 2>&3)
if [ $? -ne 1 ] && [ -n "$COMPOSE_FILE" ]; then
sudo docker-compose -f $COMPOSE_FILE up -d
fi
}
# Function to stop Docker Compose
docker_compose_down() {
COMPOSE_FILE=$(dialog --inputbox "Enter the Docker Compose file (e.g., docker-compose.yaml):" 10 40 3>&1 1>&2 2>&3)
if [ $? -ne 1 ] && [ -n "$COMPOSE_FILE" ]; then
sudo docker-compose -f $COMPOSE_FILE down
fi
}
# Function to remove Docker Compose
docker_compose_remove() {
COMPOSE_FILE=$(dialog --inputbox "Enter the Docker Compose file (e.g., docker-compose.yaml):" 10 40 3>&1 1>&2 2>&3)
if [ $? -ne 1 ] && [ -n "$COMPOSE_FILE" ]; then
sudo docker-compose -f $COMPOSE_FILE down --volumes --remove-orphans
fi
}
# Function to display the main menu
main_menu() {
while true; do
CHOICE=$(dialog --clear --backtitle "Server Utilities Installation and Configuration" \
--title "Main Menu" \
--menu "Choose an option:" 15 60 4 \
1 "Install/Check Docker" \
2 "Configure Docker" \
3 "Exit" \
3>&1 1>&2 2>&3)
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $CHOICE in
1) install_docker_if_needed ;;
2) configure_docker ;;
3) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
echo "Server utilities installation and configuration script completed."
}
# Display main menu
main_menu

View File

@ -0,0 +1,149 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to enable firewalld
enable_firewalld() {
systemctl enable firewalld
systemctl start firewalld
dialog --msgbox "firewalld enabled and started." 10 30
}
# Function to disable firewalld
disable_firewalld() {
systemctl stop firewalld
systemctl disable firewalld
dialog --msgbox "firewalld disabled and stopped." 10 30
}
# Function to add service to firewalld
add_service() {
SERVICE=$(dialog --inputbox "Enter the service name to add (e.g., ssh, http, https):" 10 50 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
return 1
fi
if [ -z "$SERVICE" ]; then
dialog --msgbox "Please enter a valid service name." 10 30
else
firewall-cmd --permanent --add-service=$SERVICE
firewall-cmd --reload
dialog --msgbox "Service $SERVICE added to firewalld." 10 30
fi
}
# Function to remove service from firewalld
remove_service() {
SERVICE=$(dialog --inputbox "Enter the service name to remove:" 10 50 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
return 1
fi
if [ -z "$SERVICE" ]; then
dialog --msgbox "Please enter a valid service name." 10 30
else
firewall-cmd --permanent --remove-service=$SERVICE
firewall-cmd --reload
dialog --msgbox "Service $SERVICE removed from firewalld." 10 30
fi
}
# Function to add port to firewalld
add_port() {
PORT=$(dialog --inputbox "Enter the port to add (e.g., 8080/tcp):" 10 50 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
return 1
fi
if [ -z "$PORT" ]; then
dialog --msgbox "Please enter a valid port." 10 30
else
firewall-cmd --permanent --add-port=$PORT
firewall-cmd --reload
dialog --msgbox "Port $PORT added to firewalld." 10 30
fi
}
# Function to remove port from firewalld
remove_port() {
PORT=$(dialog --inputbox "Enter the port to remove (e.g., 8080/tcp):" 10 50 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
return 1
fi
if [ -z "$PORT" ]; then
dialog --msgbox "Please enter a valid port." 10 30
else
firewall-cmd --permanent --remove-port=$PORT
firewall-cmd --reload
dialog --msgbox "Port $PORT removed from firewalld." 10 30
fi
}
# Function to configure zones in firewalld
configure_zones() {
ZONE=$(dialog --inputbox "Enter the zone name (e.g., public, home, work):" 10 50 3>&1 1>&2 2>&3 3>&-)
INTERFACE=$(dialog --inputbox "Enter the interface name (e.g., eth0, wlan0):" 10 50 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
return 1
fi
if [ -z "$ZONE" ] || [ -z "$INTERFACE" ]; then
dialog --msgbox "Please enter valid zone and interface names." 10 30
else
firewall-cmd --zone=$ZONE --add-interface=$INTERFACE --permanent
firewall-cmd --reload
dialog --msgbox "Interface $INTERFACE added to zone $ZONE." 10 30
fi
}
# Function to configure firewalld options
configure_firewalld() {
while true; do
FIREWALL_CHOICE=$(dialog --clear --backtitle "Firewalld Configuration" \
--title "Firewalld Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Enable firewalld" \
2 "Disable firewalld" \
3 "Add Service" \
4 "Remove Service" \
5 "Add Port" \
6 "Remove Port" \
7 "Configure Zones" \
8 "Back to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $FIREWALL_CHOICE in
1) enable_firewalld ;;
2) disable_firewalld ;;
3) add_service ;;
4) remove_service ;;
5) add_port ;;
6) remove_port ;;
7) configure_zones ;;
8) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 30 ;;
esac
done
}
# Execute the main function to configure firewalld
configure_firewalld

View File

@ -0,0 +1,120 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to set hostname
set_hostname() {
NEW_HOSTNAME=$(dialog --inputbox "Enter the new hostname:" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
if [ -z "$NEW_HOSTNAME" ]; then
dialog --msgbox "Hostname cannot be empty. Please enter a valid hostname." 10 60
else
hostnamectl set-hostname "$NEW_HOSTNAME"
dialog --msgbox "Hostname set to $NEW_HOSTNAME." 10 60
fi
}
# Function to display current hostname
show_hostname() {
CURRENT_HOSTNAME=$(hostnamectl --static)
dialog --msgbox "Current hostname is: $CURRENT_HOSTNAME" 10 60
}
# Function to display network interfaces
show_network_interfaces() {
dialog --msgbox "$(ip -o link show | awk '{print $2,$9}')" 20 60
}
# Function to display IP addresses
show_ip_addresses() {
dialog --msgbox "$(ip -4 addr show | grep inet)" 30 80
}
# Function to configure DNS settings
configure_dns() {
while true; do
DNS_CHOICE=$(dialog --clear --backtitle "DNS Configuration" \
--title "DNS Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Set DNS Servers" \
2 "Show DNS Configuration" \
3 "Back to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
case $DNS_CHOICE in
1) set_dns_servers ;;
2) show_dns_configuration ;;
3) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 60 ;;
esac
done
}
# Function to set DNS servers
set_dns_servers() {
DNS_SERVERS=$(dialog --inputbox "Enter DNS servers separated by comma (e.g., 8.8.8.8,8.8.4.4):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
if [ -z "$DNS_SERVERS" ]; then
dialog --msgbox "DNS servers cannot be empty. Please enter valid DNS servers." 10 60
else
echo "nameserver $DNS_SERVERS" | sudo tee /etc/resolv.conf >/dev/null
dialog --msgbox "DNS servers set to: $DNS_SERVERS" 10 60
fi
}
# Function to show current DNS configuration
show_dns_configuration() {
CURRENT_DNS=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}' | tr '\n' ' ')
dialog --msgbox "Current DNS configuration:\n$CURRENT_DNS" 10 60
}
# Function to configure host options
configure_host() {
while true; do
HOST_CHOICE=$(dialog --clear --backtitle "Host Configuration" \
--title "Host Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Set Hostname" \
2 "Show Hostname" \
3 "Show Network Interfaces" \
4 "Show IP Addresses" \
5 "DNS Configuration" \
6 "Back to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
case $HOST_CHOICE in
1) set_hostname ;;
2) show_hostname ;;
3) show_network_interfaces ;;
4) show_ip_addresses ;;
5) configure_dns ;;
6) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 60 ;;
esac
done
}
# Execute the main function to configure host settings
configure_host

View File

@ -0,0 +1,225 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to install MariaDB if not installed
install_mariadb_if_needed() {
if ! dpkg -l mariadb-server > /dev/null 2>&1; then
echo "MariaDB is not installed. Installing..."
if sudo apt-get install -y mariadb-server; then
echo "MariaDB installed successfully."
else
echo "Failed to install MariaDB. Exiting."
dialog --msgbox "Failed to install MariaDB. Exiting." 10 30
exit 1
fi
else
dialog --msgbox "MariaDB is already installed." 10 30
fi
}
# Function to start MariaDB
start_mariadb() {
sudo systemctl start mariadb
if [[ $? -eq 0 ]]; then
dialog --msgbox "MariaDB started successfully." 10 30
else
dialog --msgbox "Failed to start MariaDB." 10 30
fi
}
# Function to stop MariaDB
stop_mariadb() {
sudo systemctl stop mariadb
if [[ $? -eq 0 ]]; then
dialog --msgbox "MariaDB stopped successfully." 10 30
else
dialog --msgbox "Failed to stop MariaDB." 10 30
fi
}
# Function to restart MariaDB
restart_mariadb() {
sudo systemctl restart mariadb
if [[ $? -eq 0 ]]; then
dialog --msgbox "MariaDB restarted successfully." 10 30
else
dialog --msgbox "Failed to restart MariaDB." 10 30
fi
}
# Function to enable MariaDB at boot
enable_mariadb_at_boot() {
sudo systemctl enable mariadb
if [[ $? -eq 0 ]]; then
dialog --msgbox "MariaDB enabled at boot successfully." 10 30
else
dialog --msgbox "Failed to enable MariaDB at boot." 10 30
fi
}
# Function to disable MariaDB at boot
disable_mariadb_at_boot() {
sudo systemctl disable mariadb
if [[ $? -eq 0 ]]; then
dialog --msgbox "MariaDB disabled at boot successfully." 10 30
else
dialog --msgbox "Failed to disable MariaDB at boot." 10 30
fi
}
# Function to secure MariaDB installation
secure_mariadb() {
sudo mysql_secure_installation
if [[ $? -eq 0 ]]; then
dialog --msgbox "MariaDB installation secured successfully." 10 30
else
dialog --msgbox "Failed to secure MariaDB installation." 10 30
fi
}
# Function to create a database
create_database() {
DATABASE=$(dialog --inputbox "Enter the name of the database to create:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; then
mysql -e "CREATE DATABASE IF NOT EXISTS $DATABASE;"
if [[ $? -eq 0 ]]; then
dialog --msgbox "Database '$DATABASE' created successfully." 10 60
else
dialog --msgbox "Failed to create database '$DATABASE'." 10 60
fi
fi
}
# Function to create a table
create_table() {
DATABASE=$(dialog --inputbox "Enter the name of the database:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Enter the name of the table to create:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" ]]; then
mysql -e "USE $DATABASE; CREATE TABLE IF NOT EXISTS $TABLE (id INT AUTO_INCREMENT PRIMARY KEY);"
if [[ $? -eq 0 ]]; then
dialog --msgbox "Table '$TABLE' created in database '$DATABASE' successfully." 10 60
else
dialog --msgbox "Failed to create table '$TABLE' in database '$DATABASE'." 10 60
fi
fi
}
# Function to insert data into a table
insert_data() {
DATABASE=$(dialog --inputbox "Enter the name of the database:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Enter the name of the table to insert data into:" 10 40 3>&1 1>&2 2>&3 3>&-)
DATA=$(dialog --inputbox "Enter data to insert into table (e.g., 'value1, value2'):" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" && -n "$DATA" ]]; then
mysql -e "USE $DATABASE; INSERT INTO $TABLE VALUES ($DATA);"
if [[ $? -eq 0 ]]; then
dialog --msgbox "Data inserted into table '$TABLE' in database '$DATABASE' successfully." 10 60
else
dialog --msgbox "Failed to insert data into table '$TABLE' in database '$DATABASE'." 10 60
fi
fi
}
# Function to query data from a table
query_data() {
DATABASE=$(dialog --inputbox "Enter the name of the database:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Enter the name of the table to query from:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" ]]; then
QUERY=$(dialog --inputbox "Enter SQL query (e.g., 'SELECT * FROM $TABLE;'):" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$QUERY" ]]; then
RESULT=$(mysql -e "USE $DATABASE; $QUERY")
if [[ $? -eq 0 ]]; then
dialog --msgbox "Query executed successfully. Result:\n$RESULT" 20 80
else
dialog --msgbox "Failed to execute query on table '$TABLE' in database '$DATABASE'." 10 60
fi
fi
fi
}
# Function to backup the database
backup_database() {
DATABASE=$(dialog --inputbox "Enter the name of the database to backup:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; then
mysqldump $DATABASE > $DATABASE.sql
if [[ $? -eq 0 ]]; then
dialog --msgbox "Database '$DATABASE' backed up to '$DATABASE.sql' successfully." 10 60
else
dialog --msgbox "Failed to backup database '$DATABASE'." 10 60
fi
fi
}
# Function to restore the database
restore_database() {
DATABASE=$(dialog --inputbox "Enter the name of the database to restore into:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; then
FILE=$(dialog --inputbox "Enter the path to the SQL file to restore:" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -f "$FILE" ]]; then
mysql $DATABASE < $FILE
if [[ $? -eq 0 ]]; then
dialog --msgbox "Database '$DATABASE' restored successfully." 10 60
else
dialog --msgbox "Failed to restore database '$DATABASE'." 10 60
fi
else
dialog --msgbox "File not found or invalid." 10 60
fi
fi
}
# Function to configure MariaDB
configure_mariadb() {
while true; do
CHOICE=$(dialog --clear --backtitle "Configure MariaDB" \
--title "MariaDB Menu" \
--menu "Choose an option:" 20 60 12 \
1 "Install/Check MariaDB" \
2 "Start MariaDB" \
3 "Stop MariaDB" \
4 "Restart MariaDB" \
5 "Enable MariaDB at Boot" \
6 "Disable MariaDB at Boot" \
7 "Secure MariaDB Installation" \
8 "Create Database" \
9 "Create Table" \
10 "Insert Data into Table" \
11 "Query Data from Table" \
12 "Backup Database" \
13 "Restore Database" \
14 "Return to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
clear
break
fi
clear
case $CHOICE in
1) install_mariadb_if_needed ;;
2) start_mariadb ;;
3) stop_mariadb ;;
4) restart_mariadb ;;
5) enable_mariadb_at_boot ;;
6) disable_mariadb_at_boot ;;
7) secure_mariadb ;;
8) create_database ;;
9) create_table ;;
10) insert_data ;;
11) query_data ;;
12) backup_database ;;
13) restore_database ;;
14) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Show main configuration menu
configure_mariadb

View File

@ -0,0 +1,224 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to install Nginx if not installed
install_nginx_if_needed() {
if ! dpkg -l nginx > /dev/null 2>&1; then
echo "Nginx is not installed. Installing..."
if sudo apt-get install -y nginx; then
echo "Nginx installed successfully."
else
echo "Failed to install Nginx. Exiting."
exit 1
fi
fi
}
# Function to install Certbot if not installed
install_certbot_if_needed() {
if ! command -v certbot &> /dev/null; then
echo "Certbot is not installed. Installing..."
if sudo apt-get install -y certbot python3-certbot-nginx; then
echo "Certbot installed successfully."
else
echo "Failed to install Certbot. Exiting."
exit 1
fi
fi
}
# Function to start Nginx
start_nginx() {
sudo systemctl start nginx
dialog --msgbox "Nginx started." 10 30
}
# Function to stop Nginx
stop_nginx() {
sudo systemctl stop nginx
dialog --msgbox "Nginx stopped." 10 30
}
# Function to restart Nginx
restart_nginx() {
sudo systemctl restart nginx
dialog --msgbox "Nginx restarted." 10 30
}
# Function to enable Nginx at boot
enable_nginx_at_boot() {
sudo systemctl enable nginx
dialog --msgbox "Nginx enabled at boot." 10 30
}
# Function to disable Nginx at boot
disable_nginx_at_boot() {
sudo systemctl disable nginx
dialog --msgbox "Nginx disabled at boot." 10 30
}
# Function to secure Nginx installation
secure_nginx() {
echo "Nginx does not require additional security configuration."
dialog --msgbox "Nginx installation secured." 10 30
}
# Function to configure Nginx virtual hosts
configure_nginx_virtual_hosts() {
DOMAIN=$(dialog --inputbox "Enter the domain name for the virtual host (e.g., example.com):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DOMAIN" ]]; then
sudo mkdir -p /var/www/$DOMAIN/html
sudo chown -R www-data:www-data /var/www/$DOMAIN/html
sudo chmod -R 755 /var/www/$DOMAIN
cat << EOF | sudo tee /etc/nginx/sites-available/$DOMAIN > /dev/null
server {
listen 80;
listen [::]:80;
server_name $DOMAIN;
root /var/www/$DOMAIN/html;
index index.html;
location / {
try_files \$uri \$uri/ =404;
}
}
EOF
sudo ln -s /etc/nginx/sites-available/$DOMAIN /etc/nginx/sites-enabled/
sudo systemctl reload nginx
dialog --msgbox "Virtual host for $DOMAIN configured successfully." 10 60
fi
}
# Function to enable or disable Nginx virtual host (site)
enable_disable_nginx_site() {
SITE=$(dialog --inputbox "Enter the site configuration file name (without .conf):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -z "$SITE" ]]; then
dialog --msgbox "No site configuration file name entered. Returning to menu." 10 30
return
fi
ACTION=$(dialog --clear --backtitle "Enable/Disable Nginx Site" \
--title "Enable/Disable Nginx Site" \
--menu "Choose an action:" 10 40 2 \
1 "Enable" \
2 "Disable" \
3>&1 1>&2 2>&3 3>&-)
if [ $? -ne 0 ]; then
return
fi
case $ACTION in
1)
sudo ln -s /etc/nginx/sites-available/$SITE /etc/nginx/sites-enabled/
sudo systemctl reload nginx
dialog --msgbox "Nginx site $SITE enabled." 10 30
;;
2)
sudo rm -f /etc/nginx/sites-enabled/$SITE
sudo systemctl reload nginx
dialog --msgbox "Nginx site $SITE disabled." 10 30
;;
*)
dialog --msgbox "Invalid option." 10 30
;;
esac
}
# Function to enable or disable Nginx modules
enable_disable_nginx_module() {
MODULE=$(dialog --inputbox "Enter the name of the Nginx module to enable/disable (e.g., ssl):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -z "$MODULE" ]]; then
dialog --msgbox "No module name entered. Returning to menu." 10 30
return
fi
ACTION=$(dialog --clear --backtitle "Enable/Disable Nginx Module" \
--title "Enable/Disable Nginx Module" \
--menu "Choose an action:" 10 40 2 \
1 "Enable" \
2 "Disable" \
3>&1 1>&2 2>&3 3>&-)
if [ $? -ne 0 ]; then
return
fi
case $ACTION in
1)
sudo ln -s /etc/nginx/modules-available/$MODULE.conf /etc/nginx/modules-enabled/
sudo systemctl restart nginx
dialog --msgbox "Nginx module $MODULE enabled." 10 30
;;
2)
sudo rm -f /etc/nginx/modules-enabled/$MODULE.conf
sudo systemctl restart nginx
dialog --msgbox "Nginx module $MODULE disabled." 10 30
;;
*)
dialog --msgbox "Invalid option." 10 30
;;
esac
}
# Function to configure Certbot for Nginx
configure_certbot() {
DOMAIN=$(dialog --inputbox "Enter the domain name for which you want to configure Certbot (e.g., example.com):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DOMAIN" ]]; then
sudo certbot --nginx -d $DOMAIN
fi
}
# Function to configure Nginx
configure_nginx() {
while true; do
CHOICE=$(dialog --clear --backtitle "Configure Nginx" \
--title "Nginx Menu" \
--menu "Choose an option:" 20 60 12 \
1 "Install/Check Nginx" \
2 "Start Nginx" \
3 "Stop Nginx" \
4 "Restart Nginx" \
5 "Enable Nginx at Boot" \
6 "Disable Nginx at Boot" \
7 "Secure Nginx Installation" \
8 "Configure Virtual Host" \
9 "Enable/Disable Nginx Site" \
10 "Enable/Disable Nginx Module" \
11 "Configure Certbot" \
12 "Return to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
clear
case $CHOICE in
1) install_nginx_if_needed ;;
2) start_nginx ;;
3) stop_nginx ;;
4) restart_nginx ;;
5) enable_nginx_at_boot ;;
6) disable_nginx_at_boot ;;
7) secure_nginx ;;
8) configure_nginx_virtual_hosts ;;
9) enable_disable_nginx_site ;;
10) enable_disable_nginx_module ;;
11) configure_certbot ;;
12) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Show main configuration menu
configure_nginx

View File

@ -0,0 +1,143 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to install Postfix if not installed
install_postfix_if_needed() {
if ! dpkg -l postfix > /dev/null 2>&1; then
echo "Postfix is not installed. Installing..."
if sudo apt-get install -y postfix; then
echo "Postfix installed successfully."
else
echo "Failed to install Postfix. Exiting."
exit 1
fi
fi
}
# Function to configure Postfix interactively
configure_postfix() {
echo "Configuring Postfix..."
if ! sudo dpkg-reconfigure postfix; then
echo "Failed to configure Postfix."
dialog --title "Error" --msgbox "Failed to configure Postfix." 10 60
exit 1
fi
echo "Postfix configured successfully."
dialog --title "Success" --msgbox "Postfix configured successfully." 10 60
}
# Function to start Postfix service
start_postfix() {
echo "Starting Postfix service..."
if ! sudo systemctl start postfix; then
echo "Failed to start Postfix service."
dialog --title "Error" --msgbox "Failed to start Postfix service." 10 60
exit 1
fi
echo "Postfix service started successfully."
dialog --title "Success" --msgbox "Postfix service started successfully." 10 60
}
# Function to stop Postfix service
stop_postfix() {
echo "Stopping Postfix service..."
if ! sudo systemctl stop postfix; then
echo "Failed to stop Postfix service."
dialog --title "Error" --msgbox "Failed to stop Postfix service." 10 60
exit 1
fi
echo "Postfix service stopped successfully."
dialog --title "Success" --msgbox "Postfix service stopped successfully." 10 60
}
# Function to restart Postfix service
restart_postfix() {
echo "Restarting Postfix service..."
if ! sudo systemctl restart postfix; then
echo "Failed to restart Postfix service."
dialog --title "Error" --msgbox "Failed to restart Postfix service." 10 60
exit 1
fi
echo "Postfix service restarted successfully."
dialog --title "Success" --msgbox "Postfix service restarted successfully." 10 60
}
# Function to enable Postfix service at boot
enable_postfix_at_boot() {
echo "Enabling Postfix service at boot..."
if ! sudo systemctl enable postfix; then
echo "Failed to enable Postfix service at boot."
dialog --title "Error" --msgbox "Failed to enable Postfix service at boot." 10 60
exit 1
fi
echo "Postfix service enabled at boot successfully."
dialog --title "Success" --msgbox "Postfix service enabled at boot successfully." 10 60
}
# Function to disable Postfix service at boot
disable_postfix_at_boot() {
echo "Disabling Postfix service at boot..."
if ! sudo systemctl disable postfix; then
echo "Failed to disable Postfix service at boot."
dialog --title "Error" --msgbox "Failed to disable Postfix service at boot." 10 60
exit 1
fi
echo "Postfix service disabled at boot successfully."
dialog --title "Success" --msgbox "Postfix service disabled at boot successfully." 10 60
}
# Function to configure Postfix securely (optional)
secure_postfix() {
echo "Securing Postfix configuration..."
# You can add additional secure configuration steps here if needed
echo "Postfix configuration secured successfully."
dialog --title "Success" --msgbox "Postfix configuration secured successfully." 10 60
}
# Function to display the main menu
main_menu() {
while true; do
CHOICE=$(dialog --clear --backtitle "Postfix Configuration" \
--title "Postfix Menu" \
--menu "Choose an option:" 15 60 9 \
1 "Install/Check Postfix" \
2 "Configure Postfix" \
3 "Start Postfix" \
4 "Stop Postfix" \
5 "Restart Postfix" \
6 "Enable Postfix at Boot" \
7 "Disable Postfix at Boot" \
8 "Secure Postfix Configuration" \
9 "Return to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
clear
case $CHOICE in
1) install_postfix_if_needed ;;
2) configure_postfix ;;
3) start_postfix ;;
4) stop_postfix ;;
5) restart_postfix ;;
6) enable_postfix_at_boot ;;
7) disable_postfix_at_boot ;;
8) secure_postfix ;;
9) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
echo "Postfix configuration script completed."
}
# Display main menu
main_menu

View File

@ -0,0 +1,226 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Função para instalar PostgreSQL, se necessário
install_postgresql_if_needed() {
if ! dpkg -l postgresql > /dev/null 2>&1; then
echo "PostgreSQL não está instalado. Instalando..."
if sudo apt-get install -y postgresql; then
echo "PostgreSQL instalado com sucesso."
dialog --msgbox "PostgreSQL instalado com sucesso." 10 30
else
echo "Falha ao instalar PostgreSQL. Saindo."
dialog --msgbox "Falha ao instalar PostgreSQL. Saindo." 10 30
exit 1
fi
else
dialog --msgbox "PostgreSQL já está instalado." 10 30
fi
}
# Função para iniciar PostgreSQL
start_postgresql() {
sudo systemctl start postgresql
if [[ $? -eq 0 ]]; then
dialog --msgbox "PostgreSQL iniciado com sucesso." 10 30
else
dialog --msgbox "Falha ao iniciar PostgreSQL." 10 30
fi
}
# Função para parar PostgreSQL
stop_postgresql() {
sudo systemctl stop postgresql
if [[ $? -eq 0 ]]; then
dialog --msgbox "PostgreSQL parado com sucesso." 10 30
else
dialog --msgbox "Falha ao parar PostgreSQL." 10 30
fi
}
# Função para reiniciar PostgreSQL
restart_postgresql() {
sudo systemctl restart postgresql
if [[ $? -eq 0 ]]; then
dialog --msgbox "PostgreSQL reiniciado com sucesso." 10 30
else
dialog --msgbox "Falha ao reiniciar PostgreSQL." 10 30
fi
}
# Função para habilitar PostgreSQL na inicialização
enable_postgresql_at_boot() {
sudo systemctl enable postgresql
if [[ $? -eq 0 ]]; then
dialog --msgbox "PostgreSQL habilitado na inicialização com sucesso." 10 30
else
dialog --msgbox "Falha ao habilitar PostgreSQL na inicialização." 10 30
fi
}
# Função para desabilitar PostgreSQL na inicialização
disable_postgresql_at_boot() {
sudo systemctl disable postgresql
if [[ $? -eq 0 ]]; then
dialog --msgbox "PostgreSQL desabilitado na inicialização com sucesso." 10 30
else
dialog --msgbox "Falha ao desabilitar PostgreSQL na inicialização." 10 30
fi
}
# Função para garantir a instalação do PostgreSQL
secure_postgresql() {
sudo passwd postgres
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'your_password';"
if [[ $? -eq 0 ]]; then
dialog --msgbox "Instalação do PostgreSQL protegida com sucesso." 10 30
else
dialog --msgbox "Falha ao proteger a instalação do PostgreSQL." 10 30
fi
}
# Função para criar um banco de dados
create_database() {
DATABASE=$(dialog --inputbox "Digite o nome do banco de dados a ser criado:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; then
sudo -u postgres createdb $DATABASE
if [[ $? -eq 0 ]]; então
dialog --msgbox "Banco de dados '$DATABASE' criado com sucesso." 10 60
else
dialog --msgbox "Falha ao criar o banco de dados '$DATABASE'." 10 60
fi
fi
}
# Função para criar uma tabela
create_table() {
DATABASE=$(dialog --inputbox "Digite o nome do banco de dados:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Digite o nome da tabela a ser criada:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" ]]; então
sudo -u postgres psql -d $DATABASE -c "CREATE TABLE $TABLE (id SERIAL PRIMARY KEY);"
if [[ $? -eq 0 ]]; então
dialog --msgbox "Tabela '$TABLE' criada no banco de dados '$DATABASE' com sucesso." 10 60
else
dialog --msgbox "Falha ao criar a tabela '$TABLE' no banco de dados '$DATABASE'." 10 60
fi
fi
}
# Função para inserir dados em uma tabela
insert_data() {
DATABASE=$(dialog --inputbox "Digite o nome do banco de dados:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Digite o nome da tabela para inserir dados:" 10 40 3>&1 1>&2 2>&3 3>&-)
DATA=$(dialog --inputbox "Digite os dados para inserir na tabela (por exemplo, 'valor1, valor2'):" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" && -n "$DATA" ]]; então
sudo -u postgres psql -d $DATABASE -c "INSERT INTO $TABLE VALUES ($DATA);"
if [[ $? -eq 0 ]]; então
dialog --msgbox "Dados inseridos na tabela '$TABLE' no banco de dados '$DATABASE' com sucesso." 10 60
else
dialog --msgbox "Falha ao inserir dados na tabela '$TABLE' no banco de dados '$DATABASE'." 10 60
fi
fi
}
# Função para consultar dados de uma tabela
query_data() {
DATABASE=$(dialog --inputbox "Digite o nome do banco de dados:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Digite o nome da tabela para consultar:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" ]]; então
QUERY=$(dialog --inputbox "Digite a consulta SQL (por exemplo, 'SELECT * FROM $TABLE;'):" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$QUERY" ]]; então
RESULT=$(sudo -u postgres psql -d $DATABASE -c "$QUERY")
if [[ $? -eq 0 ]]; então
dialog --msgbox "Consulta executada com sucesso. Resultado:\n$RESULT" 20 80
else
dialog --msgbox "Falha ao executar a consulta na tabela '$TABLE' no banco de dados '$DATABASE'." 10 60
fi
fi
fi
}
# Função para fazer backup do banco de dados
backup_database() {
DATABASE=$(dialog --inputbox "Digite o nome do banco de dados para fazer backup:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; então
sudo -u postgres pg_dump $DATABASE > $DATABASE.sql
if [[ $? -eq 0 ]]; então
dialog --msgbox "Banco de dados '$DATABASE' feito backup para '$DATABASE.sql' com sucesso." 10 60
else
dialog --msgbox "Falha ao fazer backup do banco de dados '$DATABASE'." 10 60
fi
fi
}
# Função para restaurar o banco de dados
restore_database() {
DATABASE=$(dialog --inputbox "Digite o nome do banco de dados para restaurar:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; então
FILE=$(dialog --inputbox "Digite o caminho para o arquivo SQL para restaurar:" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -f "$FILE" ]]; então
sudo -u postgres psql -d $DATABASE < $FILE
if [[ $? -eq 0 ]]; então
dialog --msgbox "Banco de dados '$DATABASE' restaurado com sucesso." 10 60
else
dialog --msgbox "Falha ao restaurar o banco de dados '$DATABASE'." 10 60
fi
else
dialog --msgbox "Arquivo não encontrado ou inválido." 10 60
fi
fi
}
# Função para configurar PostgreSQL
configure_postgresql() {
while true; do
CHOICE=$(dialog --clear --backtitle "Configurar PostgreSQL" \
--title "Menu do PostgreSQL" \
--menu "Escolha uma opção:" 20 60 14 \
1 "Instalar/Verificar PostgreSQL" \
2 "Iniciar PostgreSQL" \
3 "Parar PostgreSQL" \
4 "Reiniciar PostgreSQL" \
5 "Habilitar PostgreSQL na Inicialização" \
6 "Desabilitar PostgreSQL na Inicialização" \
7 "Proteger Instalação do PostgreSQL" \
8 "Criar Banco de Dados" \
9 "Criar Tabela" \
10 "Inserir Dados na Tabela" \
11 "Consultar Dados da Tabela" \
12 "Fazer Backup do Banco de Dados" \
13 "Restaurar Banco de Dados" \
14 "Retornar ao Menu Principal" \
3>&1 1>&2 2>&3 3>&-)
clear
# Verificar se o usuário cancelou
if [ $? -eq 1 ]; então
break
fi
case $CHOICE in
1) install_postgresql_if_needed ;;
2) start_postgresql ;;
3) stop_postgresql ;;
4) restart_postgresql ;;
5) enable_postgresql_at_boot ;;
6) disable_postgresql_at_boot ;;
7) secure_postgresql ;;
8) create_database ;;
9) create_table ;;
10) insert_data ;;
11) query_data ;;
12) backup_database ;;
13) restore_database ;;
14) break ;;
*) dialog --msgbox "Opção inválida." 10 30 ;;
esac
done
}
# Mostrar menu de configuração principal
configure_postgresql

View File

@ -0,0 +1,234 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to generate SSH keys
generate_ssh_keys() {
dialog --yesno "Do you want to generate SSH keys?" 10 60
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
SSH_DIR=~/.ssh
mkdir -p $SSH_DIR
SSH_KEY_FILE=$SSH_DIR/id_rsa
ssh-keygen -t rsa -b 4096 -f $SSH_KEY_FILE -N ""
dialog --msgbox "SSH keys generated in $SSH_KEY_FILE." 10 60
}
# Function to add SSH key to authorized_keys
add_ssh_key() {
KEY_FILE=$(dialog --inputbox "Enter the path to the SSH public key file:" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
if [ -z "$KEY_FILE" ]; then
dialog --msgbox "Please enter a valid path to the SSH public key file." 10 60
else
mkdir -p ~/.ssh
cat "$KEY_FILE" >> ~/.ssh/authorized_keys
dialog --msgbox "SSH key added to authorized_keys." 10 60
fi
}
# Function to configure advanced SSH options
configure_advanced_ssh() {
while true; do
ADV_CHOICE=$(dialog --clear --backtitle "SSH Advanced Configuration" \
--title "SSH Advanced Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Edit SSH Config File" \
2 "Restart SSH Service" \
3 "Check SSH Service Status" \
4 "Install OpenSSH Server" \
5 "Uninstall OpenSSH Server" \
6 "View SSH Logs" \
7 "Backup SSH Config" \
8 "Restore SSH Config" \
9 "Change SSH Port" \
10 "Enable/Disable Password Authentication" \
11 "List SSH Connections" \
12 "Back to SSH Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
case $ADV_CHOICE in
1) ${EDITOR:-nano} /etc/ssh/sshd_config ;;
2) systemctl restart ssh ;;
3) systemctl status ssh ;;
4) install_openssh_server ;;
5) uninstall_openssh_server ;;
6) view_ssh_logs ;;
7) backup_ssh_config ;;
8) restore_ssh_config ;;
9) change_ssh_port ;;
10) toggle_password_authentication ;;
11) list_ssh_connections ;;
12) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 60 ;;
esac
done
}
# Function to install OpenSSH Server
install_openssh_server() {
dialog --yesno "Do you want to install OpenSSH Server?" 10 60
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
apt update
apt install -y openssh-server
systemctl start ssh
systemctl enable ssh
dialog --msgbox "OpenSSH Server installed and enabled." 10 60
}
# Function to uninstall OpenSSH Server
uninstall_openssh_server() {
dialog --yesno "Do you want to uninstall OpenSSH Server?" 10 60
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
systemctl stop ssh
systemctl disable ssh
apt remove -y openssh-server
dialog --msgbox "OpenSSH Server uninstalled." 10 60
}
# Function to view SSH logs
view_ssh_logs() {
dialog --msgbox "$(journalctl -u ssh --no-pager)" 30 80
}
# Function to backup SSH config
backup_ssh_config() {
BACKUP_DIR="/var/backups"
BACKUP_FILE="sshd_config_$(date +"%Y%m%d_%H%M%S").bak"
cp /etc/ssh/sshd_config $BACKUP_DIR/$BACKUP_FILE
dialog --msgbox "SSH config backed up to $BACKUP_DIR/$BACKUP_FILE." 10 60
}
# Function to restore SSH config
restore_ssh_config() {
BACKUP_FILE=$(dialog --inputbox "Enter the full path of the SSH config backup file:" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
if [ -z "$BACKUP_FILE" ]; then
dialog --msgbox "Please enter a valid path to the SSH config backup file." 10 60
elif [ ! -f "$BACKUP_FILE" ]; then
dialog --msgbox "Backup file not found." 10 60
else
cp "$BACKUP_FILE" /etc/ssh/sshd_config
systemctl restart ssh
dialog --msgbox "SSH config restored from $BACKUP_FILE." 10 60
fi
}
# Function to change SSH port
change_ssh_port() {
NEW_PORT=$(dialog --inputbox "Enter the new SSH port:" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
if [[ $NEW_PORT =~ ^[0-9]+$ ]]; then
sed -i "s/#Port 22/Port $NEW_PORT/" /etc/ssh/sshd_config
systemctl restart ssh
dialog --msgbox "SSH port changed to $NEW_PORT." 10 60
else
dialog --msgbox "Invalid port number." 10 60
fi
}
# Function to enable/disable password authentication in SSH
toggle_password_authentication() {
STATUS=$(dialog --menu "Choose an option:" 10 60 2 \
1 "Enable Password Authentication" \
2 "Disable Password Authentication" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
case $STATUS in
1) sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config ;;
2) sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config ;;
esac
systemctl restart ssh
dialog --msgbox "Password authentication $(echo $STATUS | tr '[:lower:]' '[:upper:]')." 10 60
}
# Function to list SSH connections
list_ssh_connections() {
netstat -tnpa | grep 'ESTABLISHED.*sshd'
dialog --msgbox "List of SSH connections displayed." 10 60
}
# Function to check if OpenSSH is installed
check_ssh_installation() {
dpkg -l openssh-server >/dev/null 2>&1
if [ $? -eq 0 ]; then
dialog --msgbox "OpenSSH is installed." 10 60
else
dialog --msgbox "OpenSSH is not installed." 10 60
fi
}
# Function to configure SSH options
configure_ssh() {
while true; do
SSH_CHOICE=$(dialog --clear --backtitle "SSH Configuration" \
--title "SSH Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Generate SSH Keys" \
2 "Add SSH Key to authorized_keys" \
3 "Advanced Configuration" \
4 "Check SSH Installation" \
5 "Back to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
case $SSH_CHOICE in
1) generate_ssh_keys ;;
2) add_ssh_key ;;
3) configure_advanced_ssh ;;
4) check_ssh_installation ;;
5) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 60 ;;
esac
done
}
# Execute the main function to configure SSH
configure_ssh

View File

@ -0,0 +1,162 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to configure static IP
configure_static_ip() {
while true; do
# Prompt for network interface
INTERFACE=$(dialog --inputbox "Enter physical network interface (e.g., eth0):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
# Prompt for IP address
IP_ADDRESS=$(dialog --inputbox "Enter static IP address (e.g., 192.168.1.100):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
# Validate IP address format
if ! valid_ip "$IP_ADDRESS"; then
dialog --msgbox "Invalid IP address format. Please enter a valid IP address." 10 60
continue
fi
# Prompt for netmask
NETMASK=$(dialog --inputbox "Enter netmask (e.g., 255.255.255.0):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
# Validate netmask format
if ! valid_netmask "$NETMASK"; then
dialog --msgbox "Invalid netmask format. Please enter a valid netmask." 10 60
continue
fi
# Prompt for gateway
GATEWAY=$(dialog --inputbox "Enter gateway (optional, leave blank if none):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
# Prompt for DNS server
DNS_SERVER=$(dialog --inputbox "Enter DNS server (optional, leave blank if none):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
# Apply the static IP configuration
if [ -z "$INTERFACE" ] || [ -z "$IP_ADDRESS" ] || [ -z "$NETMASK" ]; then
dialog --msgbox "Network interface, IP address, and netmask cannot be empty. Please enter valid information." 10 60
else
apply_static_ip "$INTERFACE" "$IP_ADDRESS" "$NETMASK" "$GATEWAY" "$DNS_SERVER"
return $?
fi
done
}
# Function to validate IP address format
valid_ip() {
local ip=$1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
local IFS='.'
ip=($ip)
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
else
false
fi
}
# Function to validate netmask format
valid_netmask() {
local netmask=$1
if [[ $netmask =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
local IFS='.'
netmask=($netmask)
[[ ${netmask[0]} -le 255 && ${netmask[1]} -le 255 && ${netmask[2]} -le 255 && ${netmask[3]} -le 255 ]]
else
false
fi
}
# Function to apply static IP configuration
apply_static_ip() {
local interface=$1
local ip_address=$2
local netmask=$3
local gateway=$4
local dns_server=$5
# Apply configuration to /etc/network/interfaces
cat <<EOF | sudo tee /etc/network/interfaces >/dev/null
auto lo
iface lo inet loopback
auto $interface
iface $interface inet static
address $ip_address
netmask $netmask
gateway $gateway
dns-nameservers $dns_server
EOF
# Restart networking service
sudo systemctl restart networking
# Check if configuration applied successfully
if ifconfig $interface | grep -q "$ip_address"; then
dialog --msgbox "Static IP configuration applied successfully:\nInterface: $interface\nIP Address: $ip_address\nNetmask: $netmask\nGateway: $gateway\nDNS Server: $dns_server" 12 60
return 0
else
dialog --msgbox "Failed to apply static IP configuration. Please check your settings and try again." 10 60
return 1
fi
}
# Main function to configure host settings
configure_host() {
while true; do
HOST_CHOICE=$(dialog --clear --backtitle "Host Configuration" \
--title "Host Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Configure Static IP" \
2 "Show Current Network Settings" \
3 "Back to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
case $HOST_CHOICE in
1) configure_static_ip ;;
2) show_current_network_settings ;;
3) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 60 ;;
esac
done
}
# Function to show current network settings
show_current_network_settings() {
CURRENT_SETTINGS=$(ip addr show)
dialog --msgbox "Current Network Settings:\n\n$CURRENT_SETTINGS" 20 80
}
# Execute the main function to configure host settings
configure_host

View File

@ -0,0 +1,79 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to create users
create_user() {
local USERNAME
local FULLNAME
local PASSWORD
local GROUPS
local SELECTED_GROUPS
# Prompt for username
USERNAME=$(dialog --inputbox "Enter the username of the new user:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -z "$USERNAME" ]]; then
dialog --msgbox "Username cannot be empty. User creation canceled." 10 30
return
fi
# Check if username already exists
if id "$USERNAME" &>/dev/null; then
dialog --msgbox "User $USERNAME already exists. User creation canceled." 10 30
return
fi
# Prompt for full name
FULLNAME=$(dialog --inputbox "Enter the full name of the new user:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -z "$FULLNAME" ]]; then
dialog --msgbox "Full name cannot be empty. User creation canceled." 10 30
return
fi
# Prompt for password
PASSWORD=$(dialog --passwordbox "Enter the password for user $USERNAME:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -z "$PASSWORD" ]]; then
dialog --msgbox "Password cannot be empty. User creation canceled." 10 30
return
fi
# Get list of available groups
GROUPS=$(getent group | cut -d: -f1)
GROUPS_ARR=()
for group in $GROUPS; do
GROUPS_ARR+=("$group" "" off)
done
# Select groups to add user
SELECTED_GROUPS=$(dialog --checklist "Select groups to add user $USERNAME:" 20 60 10 "${GROUPS_ARR[@]}" 3>&1 1>&2 2>&3 3>&-)
if [[ -z "$SELECTED_GROUPS" ]]; then
dialog --msgbox "No groups selected. User $USERNAME will not be added to any groups." 10 30
fi
# Create the user
useradd -m -c "$FULLNAME" "$USERNAME"
if [[ $? -eq 0 ]]; then
echo "$USERNAME:$PASSWORD" | chpasswd
if [[ $? -eq 0 ]]; then
dialog --msgbox "User $USERNAME created successfully." 10 30
# Add user to selected groups
for group in $SELECTED_GROUPS; do
usermod -aG "$group" "$USERNAME"
if [[ $? -ne 0 ]]; then
dialog --msgbox "Failed to add user $USERNAME to group $group." 10 30
fi
done
else
dialog --msgbox "Failed to set password for user $USERNAME. User creation canceled." 10 30
userdel -r "$USERNAME" # Rollback user creation if password setting failed
fi
else
dialog --msgbox "Failed to create user $USERNAME. User creation canceled." 10 30
fi
}
# Call the function to create users
create_user

View File

@ -0,0 +1,98 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Function to update package list
update_package_list() {
echo "Updating package list..."
if ! sudo apt update; then
echo "Failed to update package list."
dialog --title "Error" --msgbox "Failed to update package list. Check your internet connection or repository settings." 10 60
return 1
fi
echo "Package list updated successfully."
}
# Function to install selected packages
install_selected_packages() {
local selected_packages=("$@")
echo "Installing selected packages..."
for package in "${selected_packages[@]}"; do
echo "Installing package: $package"
if sudo apt install -y "$package"; then
echo "Package $package installed successfully."
else
echo "Failed to install package: $package"
dialog --title "Error" --msgbox "Failed to install package: $package" 10 60
fi
done
echo "All packages installed successfully."
dialog --title "Success" --msgbox "All packages installed successfully." 10 60
}
# List of packages available for installation
PACKAGES=("vim"
"nano"
"emacs"
"mcedit"
"joe"
"wget"
"curl"
"lynx"
"htop"
"iftop"
"iotop"
"net-tools"
"dnsutils")
# Check if script is running as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
dialog --title "Error" --msgbox "This script must be run as root." 10 30
exit 1
fi
# Update package list before installation
update_package_list
# Prepare package list for dialog
DIALOG_PACKAGES=()
for idx in "${!PACKAGES[@]}"; do
DIALOG_PACKAGES+=("$((idx + 1))" "${PACKAGES[$idx]}" off)
done
while true; do
# Show dialog box for package selection
echo "Starting package selection dialog..."
selections=$(dialog --stdout --checklist "Select packages to install (use space to select):" 20 60 ${#PACKAGES[@]} "${DIALOG_PACKAGES[@]}" 3>&1 1>&2 2>&3)
# Check if cancel button is pressed or no selection was made
if [[ $? -ne 0 ]]; then
echo "Installation canceled."
dialog --title "Information" --msgbox "Installation canceled." 10 60
exit 0
fi
# Check if no selection was made
if [[ -z "$selections" ]]; then
echo "No packages selected. Please select at least one package."
dialog --title "Error" --msgbox "No packages selected. Please select at least one package." 10 60
else
break
fi
done
# Convert selection indices into package names
packages_to_install=()
for index in $selections; do
packages_to_install+=("${PACKAGES[$((index - 1))]}")
done
# Call function to install selected packages
install_selected_packages "${packages_to_install[@]}"
echo "Script completed."

View File

@ -0,0 +1,89 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
# Directory where the scripts are located
SCRIPT_DIR="/usr/local/bin"
# Function to display the main menu
main_menu() {
while true; do
CHOICE=$(dialog --clear --backtitle "PeppermintOS Server Configuration" \
--title "Main Menu" \
--menu "Choose an option:" 20 60 15 \
1 "Configure SSH" \
2 "Configure Static IP" \
3 "Update and Install Packages" \
4 "Configure firewalld" \
5 "Configure Hostname" \
6 "Create User" \
7 "Configure Nginx" \
8 "Configure Apache2" \
9 "Configure Postfix" \
10 "Configure MariaDB" \
11 "Configure PostgreSQL" \
12 "Configure Docker" \
13 "Exit" \
3>&1 1>&2 2>&3)
# Check if user canceled or exited
if [[ $? -ne 0 ]]; then
clear
echo "Menu closed or canceled. Exiting..."
exit 0
fi
clear
case $CHOICE in
1) sudo "$SCRIPT_DIR/configure_ssh.sh" ;;
2) sudo "$SCRIPT_DIR/configure_static_ip.sh" ;;
3) sudo "$SCRIPT_DIR/update_and_install.sh" ;;
4) sudo "$SCRIPT_DIR/configure_firewalld.sh" ;;
5) sudo "$SCRIPT_DIR/configure_hostname.sh" ;;
6) sudo "$SCRIPT_DIR/create_user.sh" ;;
7) sudo "$SCRIPT_DIR/configure_nginx.sh" ;;
8) sudo "$SCRIPT_DIR/configure_apache2.sh" ;;
9) sudo "$SCRIPT_DIR/configure_postfix.sh" ;;
10) sudo "$SCRIPT_DIR/configure_mariadb.sh" ;;
11) sudo "$SCRIPT_DIR/configure_postgresql.sh" ;;
12) sudo "$SCRIPT_DIR/configure_docker.sh" ;;
13) clear; echo "Exiting..."; exit 0 ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Show welcome message
dialog --msgbox "Welcome to PeppermintOS Server Friendly Configuration Tool!
This tool will help you configure various aspects of your server, including:
1. SSH: Configure the SSH server and client for secure remote access.
2. Static IP: Set a static IP address for consistent network communication.
3. Update and Install Packages: Ensure your system is up-to-date and install essential packages.
4. firewalld: Set up firewall rules to secure your server.
5. Hostname: Change the hostname of your server.
6. Create User: Add new users to your system.
7. Nginx: Configure the Nginx web server.
8. Apache2: Configure the Apache2 web server.
9. Postfix: Configure the Postfix mail server.
10. MariaDB: Set up the MariaDB database server.
11. PostgreSQL: Set up the PostgreSQL database server.
12. PHP: Configure PHP and related settings.
13. Docker: Configure Docker and manage containers.
14. Exit: Exit the configuration tool.
Please select an option from the menu to begin." 20 60
# Check if user canceled the welcome message
if [[ $? -ne 0 ]]; then
clear
echo "Welcome message closed or canceled. Exiting..."
exit 0
fi
# Display main menu
main_menu

View File

@ -0,0 +1,224 @@
#!/bin/bash
# Detect init system
detect_init_system() {
if [[ -x "$(command -v systemctl)" ]]; then
INIT_SYSTEM="systemd"
elif [[ -x "$(command -v service)" ]]; then
INIT_SYSTEM="sysvinit"
elif [[ -x "$(command -v rc-service)" ]]; then
INIT_SYSTEM="openrc"
elif [[ -x "$(command -v runsvdir)" ]]; then
INIT_SYSTEM="runit"
else
echo "Unsupported init system. Exiting."
exit 1
fi
}
# Function to install Apache if not installed
install_apache_if_needed() {
case $INIT_SYSTEM in
systemd | sysvinit)
if ! dpkg -l apache2 > /dev/null 2>&1; then
echo "Apache is not installed. Installing..."
if sudo apt-get install -y apache2; then
echo "Apache installed successfully."
else
echo "Failed to install Apache. Exiting."
exit 1
fi
fi
;;
openrc)
if ! apk info -q apache2 > /dev/null 2>&1; then
echo "Apache is not installed. Installing..."
if sudo apk add apache2; then
echo "Apache installed successfully."
else
echo "Failed to install Apache. Exiting."
exit 1
fi
fi
;;
runit)
echo "Runit does not require Apache installation."
;;
esac
}
# Function to start Apache
start_apache() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service apache2 start
;;
openrc)
sudo rc-service apache2 start
;;
runit)
echo "Use 'sv start apache2' to start Apache with runit."
;;
esac
dialog --msgbox "Apache started." 10 30
}
# Function to stop Apache
stop_apache() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service apache2 stop
;;
openrc)
sudo rc-service apache2 stop
;;
runit)
echo "Use 'sv stop apache2' to stop Apache with runit."
;;
esac
dialog --msgbox "Apache stopped." 10 30
}
# Function to restart Apache
restart_apache() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service apache2 restart
;;
openrc)
sudo rc-service apache2 restart
;;
runit)
echo "Use 'sv restart apache2' to restart Apache with runit."
;;
esac
dialog --msgbox "Apache restarted." 10 30
}
# Function to enable Apache at boot
enable_apache_at_boot() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo update-rc.d apache2 enable
;;
openrc)
sudo rc-update add apache2 default
;;
runit)
echo "Runit does not require enabling services at boot."
;;
esac
dialog --msgbox "Apache enabled at boot." 10 30
}
# Function to disable Apache at boot
disable_apache_at_boot() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo update-rc.d apache2 disable
;;
openrc)
sudo rc-update del apache2 default
;;
runit)
echo "Runit does not require disabling services at boot."
;;
esac
dialog --msgbox "Apache disabled at boot." 10 30
}
# Function to configure Apache virtual hosts
configure_apache_virtual_hosts() {
DOMAIN=$(dialog --inputbox "Enter the domain name for the virtual host (e.g., example.com):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DOMAIN" ]]; then
case $INIT_SYSTEM in
systemd | sysvinit)
sudo mkdir -p /var/www/$DOMAIN/public_html
sudo chown -R www-data:www-data /var/www/$DOMAIN/public_html
sudo chmod -R 755 /var/www/$DOMAIN
cat << EOF | sudo tee /etc/apache2/sites-available/$DOMAIN.conf > /dev/null
<VirtualHost *:80>
ServerAdmin webmaster@$DOMAIN
ServerName $DOMAIN
DocumentRoot /var/www/$DOMAIN/public_html
ErrorLog \${APACHE_LOG_DIR}/error.log
CustomLog \${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
EOF
sudo a2ensite $DOMAIN.conf
sudo service apache2 reload
;;
openrc)
sudo mkdir -p /var/www/$DOMAIN/public_html
sudo chown -R apache:apache /var/www/$DOMAIN/public_html
sudo chmod -R 755 /var/www/$DOMAIN
cat << EOF | sudo tee /etc/apache2/sites-available/$DOMAIN.conf > /dev/null
<VirtualHost *:80>
ServerAdmin webmaster@$DOMAIN
ServerName $DOMAIN
DocumentRoot /var/www/$DOMAIN/public_html
ErrorLog /var/log/apache2/$DOMAIN_error.log
CustomLog /var/log/apache2/$DOMAIN_access.log combined
</VirtualHost>
EOF
sudo a2ensite $DOMAIN.conf
sudo service apache2 reload
;;
runit)
echo "Runit does not use Apache virtual hosts in the same way."
;;
esac
dialog --msgbox "Virtual host for $DOMAIN configured successfully." 10 60
fi
}
# Function to configure Apache
configure_apache() {
while true; do
CHOICE=$(dialog --clear --backtitle "Configure Apache" \
--title "Apache Menu" \
--menu "Choose an option:" 20 60 11 \
1 "Install/Check Apache" \
2 "Start Apache" \
3 "Stop Apache" \
4 "Restart Apache" \
5 "Enable Apache at Boot" \
6 "Disable Apache at Boot" \
7 "Secure Apache Installation" \
8 "Configure Virtual Host" \
9 "Enable/Disable Apache Site" \
10 "Enable/Disable Apache Module" \
11 "Configure Certbot" \
12 "Return to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $CHOICE in
1) install_apache_if_needed ;;
2) start_apache ;;
3) stop_apache ;;
4) restart_apache ;;
5) enable_apache_at_boot ;;
6) disable_apache_at_boot ;;
7) secure_apache ;;
8) configure_apache_virtual_hosts ;;
9) enable_disable_apache_site ;;
10) enable_disable_apache_module ;;
11) configure_certbot ;;
12) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Main script logic
detect_init_system
configure_apache

View File

@ -0,0 +1,219 @@
#!/bin/bash
# Detect init system
detect_init_system() {
if [[ -x "$(command -v systemctl)" ]]; then
INIT_SYSTEM="systemd"
elif [[ -x "$(command -v service)" ]]; then
INIT_SYSTEM="sysvinit"
elif [[ -x "$(command -v rc-service)" ]]; then
INIT_SYSTEM="openrc"
elif [[ -x "$(command -v runsvdir)" ]]; then
INIT_SYSTEM="runit"
else
echo "Unsupported init system. Exiting."
exit 1
fi
}
# Function to enable firewalld
enable_firewalld() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service firewalld start
sudo chkconfig firewalld on
;;
openrc)
sudo rc-service firewalld start
sudo rc-update add firewalld default
;;
runit)
echo "Runit does not use firewalld."
;;
esac
dialog --msgbox "firewalld enabled and started." 10 30
}
# Function to disable firewalld
disable_firewalld() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service firewalld stop
sudo chkconfig firewalld off
;;
openrc)
sudo rc-service firewalld stop
sudo rc-update del firewalld default
;;
runit)
echo "Runit does not use firewalld."
;;
esac
dialog --msgbox "firewalld disabled and stopped." 10 30
}
# Function to add service to firewalld
add_service() {
SERVICE=$(dialog --inputbox "Enter the service name to add (e.g., ssh, http, https):" 10 50 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
return 1
fi
if [ -z "$SERVICE" ]; then
dialog --msgbox "Please enter a valid service name." 10 30
else
case $INIT_SYSTEM in
systemd | sysvinit)
firewall-cmd --permanent --add-service=$SERVICE
firewall-cmd --reload
;;
openrc | runit)
echo "Firewalld is not used with OpenRC or Runit."
;;
esac
dialog --msgbox "Service $SERVICE added to firewalld." 10 30
fi
}
# Function to remove service from firewalld
remove_service() {
SERVICE=$(dialog --inputbox "Enter the service name to remove:" 10 50 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
return 1
fi
if [ -z "$SERVICE" ]; then
dialog --msgbox "Please enter a valid service name." 10 30
else
case $INIT_SYSTEM in
systemd | sysvinit)
firewall-cmd --permanent --remove-service=$SERVICE
firewall-cmd --reload
;;
openrc | runit)
echo "Firewalld is not used with OpenRC or Runit."
;;
esac
dialog --msgbox "Service $SERVICE removed from firewalld." 10 30
fi
}
# Function to add port to firewalld
add_port() {
PORT=$(dialog --inputbox "Enter the port to add (e.g., 8080/tcp):" 10 50 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
return 1
fi
if [ -z "$PORT" ]; then
dialog --msgbox "Please enter a valid port." 10 30
else
case $INIT_SYSTEM in
systemd | sysvinit)
firewall-cmd --permanent --add-port=$PORT
firewall-cmd --reload
;;
openrc | runit)
echo "Firewalld is not used with OpenRC or Runit."
;;
esac
dialog --msgbox "Port $PORT added to firewalld." 10 30
fi
}
# Function to remove port from firewalld
remove_port() {
PORT=$(dialog --inputbox "Enter the port to remove (e.g., 8080/tcp):" 10 50 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
return 1
fi
if [ -z "$PORT" ]; then
dialog --msgbox "Please enter a valid port." 10 30
else
case $INIT_SYSTEM in
systemd | sysvinit)
firewall-cmd --permanent --remove-port=$PORT
firewall-cmd --reload
;;
openrc | runit)
echo "Firewalld is not used with OpenRC or Runit."
;;
esac
dialog --msgbox "Port $PORT removed from firewalld." 10 30
fi
}
# Function to configure zones in firewalld
configure_zones() {
ZONE=$(dialog --inputbox "Enter the zone name (e.g., public, home, work):" 10 50 3>&1 1>&2 2>&3 3>&-)
INTERFACE=$(dialog --inputbox "Enter the interface name (e.g., eth0, wlan0):" 10 50 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
return 1
fi
if [ -z "$ZONE" ] || [ -z "$INTERFACE" ]; then
dialog --msgbox "Please enter valid zone and interface names." 10 30
else
case $INIT_SYSTEM in
systemd | sysvinit)
firewall-cmd --zone=$ZONE --add-interface=$INTERFACE --permanent
firewall-cmd --reload
;;
openrc | runit)
echo "Firewalld is not used with OpenRC or Runit."
;;
esac
dialog --msgbox "Interface $INTERFACE added to zone $ZONE." 10 30
fi
}
# Function to configure firewalld options
configure_firewalld() {
while true; do
FIREWALL_CHOICE=$(dialog --clear --backtitle "Firewalld Configuration" \
--title "Firewalld Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Enable firewalld" \
2 "Disable firewalld" \
3 "Add Service" \
4 "Remove Service" \
5 "Add Port" \
6 "Remove Port" \
7 "Configure Zones" \
8 "Back to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $FIREWALL_CHOICE in
1) enable_firewalld ;;
2) disable_firewalld ;;
3) add_service ;;
4) remove_service ;;
5) add_port ;;
6) remove_port ;;
7) configure_zones ;;
8) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 30 ;;
esac
done
}
# Main script logic
detect_init_system
configure_firewalld

View File

@ -0,0 +1,116 @@
#!/bin/bash
# Function to set hostname
set_hostname() {
NEW_HOSTNAME=$(dialog --inputbox "Enter the new hostname:" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
if [ -z "$NEW_HOSTNAME" ]; then
dialog --msgbox "Hostname cannot be empty. Please enter a valid hostname." 10 60
else
hostnamectl set-hostname "$NEW_HOSTNAME"
dialog --msgbox "Hostname set to $NEW_HOSTNAME." 10 60
fi
}
# Function to display current hostname
show_hostname() {
CURRENT_HOSTNAME=$(hostnamectl --static)
dialog --msgbox "Current hostname is: $CURRENT_HOSTNAME" 10 60
}
# Function to display network interfaces
show_network_interfaces() {
dialog --msgbox "$(ip -o link show | awk '{print $2,$9}')" 20 60
}
# Function to display IP addresses
show_ip_addresses() {
dialog --msgbox "$(ip -4 addr show | grep inet)" 30 80
}
# Function to configure DNS settings
configure_dns() {
while true; do
DNS_CHOICE=$(dialog --clear --backtitle "DNS Configuration" \
--title "DNS Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Set DNS Servers" \
2 "Show DNS Configuration" \
3 "Back to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
case $DNS_CHOICE in
1) set_dns_servers ;;
2) show_dns_configuration ;;
3) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 60 ;;
esac
done
}
# Function to set DNS servers
set_dns_servers() {
DNS_SERVERS=$(dialog --inputbox "Enter DNS servers separated by comma (e.g., 8.8.8.8,8.8.4.4):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
if [ -z "$DNS_SERVERS" ]; then
dialog --msgbox "DNS servers cannot be empty. Please enter valid DNS servers." 10 60
else
echo "nameserver $DNS_SERVERS" | sudo tee /etc/resolv.conf >/dev/null
dialog --msgbox "DNS servers set to: $DNS_SERVERS" 10 60
fi
}
# Function to show current DNS configuration
show_dns_configuration() {
CURRENT_DNS=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}' | tr '\n' ' ')
dialog --msgbox "Current DNS configuration:\n$CURRENT_DNS" 10 60
}
# Function to configure host options
configure_host() {
while true; do
HOST_CHOICE=$(dialog --clear --backtitle "Host Configuration" \
--title "Host Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Set Hostname" \
2 "Show Hostname" \
3 "Show Network Interfaces" \
4 "Show IP Addresses" \
5 "DNS Configuration" \
6 "Back to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
case $HOST_CHOICE in
1) set_hostname ;;
2) show_hostname ;;
3) show_network_interfaces ;;
4) show_ip_addresses ;;
5) configure_dns ;;
6) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 60 ;;
esac
done
}
# Execute the main function to configure host settings
configure_host

View File

@ -0,0 +1,243 @@
#!/bin/bash
# Detect init system
detect_init_system() {
if [[ -x "$(command -v systemctl)" ]]; then
INIT_SYSTEM="systemd"
elif [[ -x "$(command -v service)" ]]; then
INIT_SYSTEM="sysvinit"
elif [[ -x "$(command -v rc-service)" ]]; then
INIT_SYSTEM="openrc"
elif [[ -x "$(command -v runsvdir)" ]]; then
INIT_SYSTEM="runit"
else
echo "Unsupported init system. Exiting."
exit 1
fi
}
# Function to install MariaDB if not installed
install_mariadb_if_needed() {
case $INIT_SYSTEM in
systemd | sysvinit)
if ! dpkg -l mariadb-server > /dev/null 2>&1; then
echo "MariaDB is not installed. Installing..."
if sudo apt-get install -y mariadb-server; then
echo "MariaDB installed successfully."
else
echo "Failed to install MariaDB. Exiting."
exit 1
fi
fi
;;
openrc | runit)
echo "MariaDB installation is managed differently in OpenRC or Runit."
;;
esac
}
# Function to start MariaDB
start_mariadb() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service mariadb start
;;
openrc)
sudo rc-service mariadb start
;;
runit)
echo "Runit does not manage MariaDB."
;;
esac
dialog --msgbox "MariaDB started." 10 30
}
# Function to stop MariaDB
stop_mariadb() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service mariadb stop
;;
openrc)
sudo rc-service mariadb stop
;;
runit)
echo "Runit does not manage MariaDB."
;;
esac
dialog --msgbox "MariaDB stopped." 10 30
}
# Function to restart MariaDB
restart_mariadb() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service mariadb restart
;;
openrc)
sudo rc-service mariadb restart
;;
runit)
echo "Runit does not manage MariaDB."
;;
esac
dialog --msgbox "MariaDB restarted." 10 30
}
# Function to enable MariaDB at boot
enable_mariadb_at_boot() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo systemctl enable mariadb
;;
openrc)
sudo rc-update add mariadb default
;;
runit)
echo "Runit does not manage MariaDB."
;;
esac
dialog --msgbox "MariaDB enabled at boot." 10 30
}
# Function to disable MariaDB at boot
disable_mariadb_at_boot() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo systemctl disable mariadb
;;
openrc)
sudo rc-update del mariadb default
;;
runit)
echo "Runit does not manage MariaDB."
;;
esac
dialog --msgbox "MariaDB disabled at boot." 10 30
}
# Function to secure MariaDB installation
secure_mariadb() {
sudo mysql_secure_installation
dialog --msgbox "MariaDB installation secured." 10 30
}
# Function to create a database
create_database() {
DATABASE=$(dialog --inputbox "Enter the name of the database to create:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; then
mysql -e "CREATE DATABASE IF NOT EXISTS $DATABASE;"
dialog --msgbox "Database '$DATABASE' created successfully." 10 60
fi
}
# Function to create a table
create_table() {
DATABASE=$(dialog --inputbox "Enter the name of the database:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Enter the name of the table to create:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" ]]; then
mysql -e "USE $DATABASE; CREATE TABLE IF NOT EXISTS $TABLE (id INT AUTO_INCREMENT PRIMARY KEY);"
dialog --msgbox "Table '$TABLE' created in database '$DATABASE' successfully." 10 60
fi
}
# Function to insert data into a table
insert_data() {
DATABASE=$(dialog --inputbox "Enter the name of the database:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Enter the name of the table to insert data into:" 10 40 3>&1 1>&2 2>&3 3>&-)
DATA=$(dialog --inputbox "Enter data to insert into table (e.g., 'value1, value2'):" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" && -n "$DATA" ]]; then
mysql -e "USE $DATABASE; INSERT INTO $TABLE VALUES ($DATA);"
dialog --msgbox "Data inserted into table '$TABLE' in database '$DATABASE' successfully." 10 60
fi
}
# Function to query data from a table
query_data() {
DATABASE=$(dialog --inputbox "Enter the name of the database:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Enter the name of the table to query from:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" ]]; then
QUERY=$(dialog --inputbox "Enter SQL query (e.g., 'SELECT * FROM $TABLE;'):" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$QUERY" ]]; then
mysql -e "USE $DATABASE; $QUERY"
dialog --msgbox "Query executed successfully." 10 60
fi
fi
}
# Function to backup the database
backup_database() {
DATABASE=$(dialog --inputbox "Enter the name of the database to backup:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; then
mysqldump $DATABASE > $DATABASE.sql
dialog --msgbox "Database '$DATABASE' backed up to '$DATABASE.sql' successfully." 10 60
fi
}
# Function to restore the database
restore_database() {
DATABASE=$(dialog --inputbox "Enter the name of the database to restore into:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; then
FILE=$(dialog --inputbox "Enter the path to the SQL file to restore:" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -f "$FILE" ]]; then
mysql $DATABASE < $FILE
dialog --msgbox "Database '$DATABASE' restored successfully." 10 60
else
dialog --msgbox "File not found or invalid." 10 60
fi
fi
}
# Function to configure MariaDB options
configure_mariadb() {
while true; do
CHOICE=$(dialog --clear --backtitle "Configure MariaDB" \
--title "MariaDB Menu" \
--menu "Choose an option:" 20 60 14 \
1 "Install/Check MariaDB" \
2 "Start MariaDB" \
3 "Stop MariaDB" \
4 "Restart MariaDB" \
5 "Enable MariaDB at Boot" \
6 "Disable MariaDB at Boot" \
7 "Secure MariaDB Installation" \
8 "Create Database" \
9 "Create Table" \
10 "Insert Data into Table" \
11 "Query Data from Table" \
12 "Backup Database" \
13 "Restore Database" \
14 "Return to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $CHOICE in
1) install_mariadb_if_needed ;;
2) start_mariadb ;;
3) stop_mariadb ;;
4) restart_mariadb ;;
5) enable_mariadb_at_boot ;;
6) disable_mariadb_at_boot ;;
7) secure_mariadb ;;
8) create_database ;;
9) create_table ;;
10) insert_data ;;
11) query_data ;;
12) backup_database ;;
13) restore_database ;;
14) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Main script logic
detect_init_system
configure_mariadb

View File

@ -0,0 +1,283 @@
#!/bin/bash
# Detect init system
detect_init_system() {
if [[ -x "$(command -v systemctl)" ]]; then
INIT_SYSTEM="systemd"
elif [[ -x "$(command -v service)" ]]; then
INIT_SYSTEM="sysvinit"
elif [[ -x "$(command -v rc-service)" ]]; then
INIT_SYSTEM="openrc"
elif [[ -x "$(command -v runsvdir)" ]]; then
INIT_SYSTEM="runit"
else
echo "Unsupported init system. Exiting."
exit 1
fi
}
# Function to install Nginx if not installed
install_nginx_if_needed() {
case $INIT_SYSTEM in
systemd | sysvinit)
if ! dpkg -l nginx > /dev/null 2>&1; then
echo "Nginx is not installed. Installing..."
if sudo apt-get install -y nginx; then
echo "Nginx installed successfully."
else
echo "Failed to install Nginx. Exiting."
exit 1
fi
fi
;;
openrc | runit)
echo "Nginx installation is managed differently in OpenRC or Runit."
;;
esac
}
# Function to install Certbot if not installed
install_certbot_if_needed() {
case $INIT_SYSTEM in
systemd | sysvinit)
if ! command -v certbot &> /dev/null; then
echo "Certbot is not installed. Installing..."
if sudo apt-get install -y certbot python3-certbot-nginx; then
echo "Certbot installed successfully."
else
echo "Failed to install Certbot. Exiting."
exit 1
fi
fi
;;
openrc | runit)
echo "Certbot installation is managed differently in OpenRC or Runit."
;;
esac
}
# Function to start Nginx
start_nginx() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service nginx start
;;
openrc)
sudo rc-service nginx start
;;
runit)
echo "Runit does not manage Nginx."
;;
esac
dialog --msgbox "Nginx started." 10 30
}
# Function to stop Nginx
stop_nginx() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service nginx stop
;;
openrc)
sudo rc-service nginx stop
;;
runit)
echo "Runit does not manage Nginx."
;;
esac
dialog --msgbox "Nginx stopped." 10 30
}
# Function to restart Nginx
restart_nginx() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo service nginx restart
;;
openrc)
sudo rc-service nginx restart
;;
runit)
echo "Runit does not manage Nginx."
;;
esac
dialog --msgbox "Nginx restarted." 10 30
}
# Function to enable Nginx at boot
enable_nginx_at_boot() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo systemctl enable nginx
;;
openrc)
sudo rc-update add nginx default
;;
runit)
echo "Runit does not manage Nginx."
;;
esac
dialog --msgbox "Nginx enabled at boot." 10 30
}
# Function to disable Nginx at boot
disable_nginx_at_boot() {
case $INIT_SYSTEM in
systemd | sysvinit)
sudo systemctl disable nginx
;;
openrc)
sudo rc-update del nginx default
;;
runit)
echo "Runit does not manage Nginx."
;;
esac
dialog --msgbox "Nginx disabled at boot." 10 30
}
# Function to secure Nginx installation
secure_nginx() {
echo "Nginx does not require additional security configuration."
dialog --msgbox "Nginx installation secured." 10 30
}
# Function to configure Nginx virtual hosts
configure_nginx_virtual_hosts() {
DOMAIN=$(dialog --inputbox "Enter the domain name for the virtual host (e.g., example.com):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DOMAIN" ]]; then
sudo mkdir -p /var/www/$DOMAIN/html
sudo chown -R www-data:www-data /var/www/$DOMAIN/html
sudo chmod -R 755 /var/www/$DOMAIN
cat << EOF | sudo tee /etc/nginx/sites-available/$DOMAIN > /dev/null
server {
listen 80;
listen [::]:80;
server_name $DOMAIN;
root /var/www/$DOMAIN/html;
index index.html;
location / {
try_files \$uri \$uri/ =404;
}
}
EOF
sudo ln -s /etc/nginx/sites-available/$DOMAIN /etc/nginx/sites-enabled/
sudo systemctl reload nginx
dialog --msgbox "Virtual host for $DOMAIN configured successfully." 10 60
fi
}
# Function to enable or disable Nginx virtual host (site)
enable_disable_nginx_site() {
SITE=$(dialog --inputbox "Enter the site configuration file name (without .conf):" 10 40 3>&1 1>&2 2>&3 3>&-)
ACTION=$(dialog --clear --backtitle "Enable/Disable Nginx Site" \
--title "Enable/Disable Nginx Site" \
--menu "Choose an action:" 10 40 2 \
1 "Enable" \
2 "Disable" \
3>&1 1>&2 2>&3 3>&-)
case $ACTION in
1)
sudo ln -s /etc/nginx/sites-available/$SITE /etc/nginx/sites-enabled/
sudo systemctl reload nginx
dialog --msgbox "Nginx site $SITE enabled." 10 30
;;
2)
sudo rm -f /etc/nginx/sites-enabled/$SITE
sudo systemctl reload nginx
dialog --msgbox "Nginx site $SITE disabled." 10 30
;;
*)
dialog --msgbox "Invalid option." 10 30
;;
esac
}
# Function to enable or disable Nginx modules
enable_disable_nginx_module() {
MODULE=$(dialog --inputbox "Enter the name of the Nginx module to enable/disable (e.g., ssl):" 10 40 3>&1 1>&2 2>&3 3>&-)
ACTION=$(dialog --clear --backtitle "Enable/Disable Nginx Module" \
--title "Enable/Disable Nginx Module" \
--menu "Choose an action:" 10 40 2 \
1 "Enable" \
2 "Disable" \
3>&1 1>&2 2>&3 3>&-)
case $ACTION in
1)
sudo ln -s /etc/nginx/modules-available/$MODULE.conf /etc/nginx/modules-enabled/
sudo systemctl restart nginx
dialog --msgbox "Nginx module $MODULE enabled." 10 30
;;
2)
sudo rm -f /etc/nginx/modules-enabled/$MODULE.conf
sudo systemctl restart nginx
dialog --msgbox "Nginx module $MODULE disabled." 10 30
;;
*)
dialog --msgbox "Invalid option." 10 30
;;
esac
}
# Function to configure Certbot for Nginx
configure_certbot() {
DOMAIN=$(dialog --inputbox "Enter the domain name for which you want to configure Certbot (e.g., example.com):" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DOMAIN" ]]; then
sudo certbot --nginx -d $DOMAIN
fi
}
# Function to configure Nginx
configure_nginx() {
while true; do
CHOICE=$(dialog --clear --backtitle "Configure Nginx" \
--title "Nginx Menu" \
--menu "Choose an option:" 20 60 11 \
1 "Install/Check Nginx" \
2 "Start Nginx" \
3 "Stop Nginx" \
4 "Restart Nginx" \
5 "Enable Nginx at Boot" \
6 "Disable Nginx at Boot" \
7 "Secure Nginx Installation" \
8 "Configure Virtual Host" \
9 "Enable/Disable Nginx Site" \
10 "Enable/Disable Nginx Module" \
11 "Configure Certbot" \
12 "Return to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $CHOICE in
1) install_nginx_if_needed ;;
2) start_nginx ;;
3) stop_nginx ;;
4) restart_nginx ;;
5) enable_nginx_at_boot ;;
6) disable_nginx_at_boot ;;
7) secure_nginx ;;
8) configure_nginx_virtual_hosts ;;
9) enable_disable_nginx_site ;;
10) enable_disable_nginx_module ;;
11) configure_certbot ;;
12) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Main script logic
detect_init_system
configure_nginx

View File

@ -0,0 +1,274 @@
#!/bin/bash
# Function to install PHP if not installed
install_php_if_needed() {
if ! dpkg -l php > /dev/null 2>&1; then
echo "PHP is not installed. Installing..."
if sudo apt-get install -y php; then
echo "PHP installed successfully."
else
echo "Failed to install PHP. Exiting."
exit 1
fi
fi
}
# Function to configure PHP
configure_php() {
while true; do
OPTION=$(dialog --clear --backtitle "Configure PHP" \
--title "PHP Configuration Menu" \
--menu "Choose an option:" 15 60 4 \
1 "Configure PHP.ini" \
2 "Set PHP Error Reporting" \
3 "Set PHP Timezone" \
4 "Return to Main Menu" \
3>&1 1>&2 2>&3)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $OPTION in
1) sudo nano /etc/php/7.4/apache2/php.ini ;; # Adjust version if needed
2) echo "error_reporting = E_ALL" | sudo tee -a /etc/php/7.4/apache2/php.ini ;; # Adjust version if needed
3) TZ=$(dialog --inputbox "Enter PHP timezone (e.g., America/New_York):" 10 40 3>&1 1>&2 2>&3)
sudo sed -i "s|^;date.timezone =|date.timezone = $TZ|" /etc/php/7.4/apache2/php.ini ;; # Adjust version if needed
4) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to install Docker if not installed
install_docker_if_needed() {
if ! command -v docker &> /dev/null; then
echo "Docker is not installed. Installing..."
if curl -fsSL https://get.docker.com | sudo sh; then
echo "Docker installed successfully."
else
echo "Failed to install Docker. Exiting."
exit 1
fi
fi
}
# Function to configure Docker
configure_docker() {
while true; do
OPTION=$(dialog --clear --backtitle "Configure Docker" \
--title "Docker Configuration Menu" \
--menu "Choose an option:" 15 60 6 \
1 "Create Docker Network" \
2 "Manage Docker Containers" \
3 "Manage Docker Images" \
4 "Manage Docker Volumes" \
5 "Manage Docker Compose" \
6 "Return to Main Menu" \
3>&1 1>&2 2>&3)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $OPTION in
1) NETWORK=$(dialog --inputbox "Enter Docker network name:" 10 40 3>&1 1>&2 2>&3)
sudo docker network create $NETWORK ;;
2) manage_docker_containers ;;
3) manage_docker_images ;;
4) manage_docker_volumes ;;
5) manage_docker_compose ;;
6) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to manage Docker containers
manage_docker_containers() {
while true; do
ACTION=$(dialog --clear --backtitle "Manage Docker Containers" \
--title "Docker Container Management" \
--menu "Choose an action:" 15 60 4 \
1 "List Containers" \
2 "Start Container" \
3 "Stop Container" \
4 "Return to Docker Menu" \
3>&1 1>&2 2>&3)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $ACTION in
1) sudo docker ps -a ;;
2) CONTAINER=$(dialog --inputbox "Enter the container ID or name:" 10 40 3>&1 1>&2 2>&3)
sudo docker start $CONTAINER ;;
3) CONTAINER=$(dialog --inputbox "Enter the container ID or name:" 10 40 3>&1 1>&2 2>&3)
sudo docker stop $CONTAINER ;;
4) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to manage Docker images
manage_docker_images() {
while true; do
ACTION=$(dialog --clear --backtitle "Manage Docker Images" \
--title "Docker Image Management" \
--menu "Choose an action:" 15 60 4 \
1 "List Images" \
2 "Pull Image" \
3 "Remove Image" \
4 "Return to Docker Menu" \
3>&1 1>&2 2>&3)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $ACTION in
1) sudo docker images ;;
2) IMAGE=$(dialog --inputbox "Enter the image name (e.g., ubuntu):" 10 40 3>&1 1>&2 2>&3)
sudo docker pull $IMAGE ;;
3) IMAGE=$(dialog --inputbox "Enter the image ID or name:" 10 40 3>&1 1>&2 2>&3)
sudo docker rmi $IMAGE ;;
4) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to manage Docker volumes
manage_docker_volumes() {
while true; do
ACTION=$(dialog --clear --backtitle "Manage Docker Volumes" \
--title "Docker Volume Management" \
--menu "Choose an action:" 15 60 4 \
1 "List Volumes" \
2 "Create Volume" \
3 "Remove Volume" \
4 "Return to Docker Menu" \
3>&1 1>&2 2>&3)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $ACTION in
1) sudo docker volume ls ;;
2) VOLUME=$(dialog --inputbox "Enter the volume name:" 10 40 3>&1 1>&2 2>&3)
sudo docker volume create $VOLUME ;;
3) VOLUME=$(dialog --inputbox "Enter the volume name or ID:" 10 40 3>&1 1>&2 2>&3)
sudo docker volume rm $VOLUME ;;
4) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to manage Docker Compose
manage_docker_compose() {
while true; do
ACTION=$(dialog --clear --backtitle "Manage Docker Compose" \
--title "Docker Compose Management" \
--menu "Choose an action:" 15 60 4 \
1 "Run Docker Compose" \
2 "Stop Docker Compose" \
3 "Remove Docker Compose" \
4 "Return to Docker Menu" \
3>&1 1>&2 2>&3)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $ACTION in
1) docker_compose_up ;;
2) docker_compose_down ;;
3) docker_compose_remove ;;
4) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Function to run Docker Compose
docker_compose_up() {
COMPOSE_FILE=$(dialog --inputbox "Enter the Docker Compose file (e.g., docker-compose.yaml):" 10 40 3>&1 1>&2 2>&3)
if [[ -n "$COMPOSE_FILE" ]]; then
sudo docker-compose -f $COMPOSE_FILE up -d
fi
}
# Function to stop Docker Compose
docker_compose_down() {
COMPOSE_FILE=$(dialog --inputbox "Enter the Docker Compose file (e.g., docker-compose.yaml):" 10 40 3>&1 1>&2 2>&3)
if [[ -n "$COMPOSE_FILE" ]]; then
sudo docker-compose -f $COMPOSE_FILE down
fi
}
# Function to remove Docker Compose
docker_compose_remove() {
COMPOSE_FILE=$(dialog --inputbox "Enter the Docker Compose file (e.g., docker-compose.yaml):" 10 40 3>&1 1>&2 2>&3)
if [[ -n "$COMPOSE_FILE" ]]; then
sudo docker-compose -f $COMPOSE_FILE down --volumes --remove-orphans
fi
}
# Function to display the main menu
main_menu() {
while true; do
CHOICE=$(dialog --clear --backtitle "Server Utilities Installation and Configuration" \
--title "Main Menu" \
--menu "Choose an option:" 15 60 5 \
1 "Install/Check PHP" \
2 "Configure PHP" \
3 "Install/Check Docker" \
4 "Configure Docker" \
5 "Return to Main Menu" \
3>&1 1>&2 2>&3)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $CHOICE in
1) install_php_if_needed ;;
2) configure_php ;;
3) install_docker_if_needed ;;
4) configure_docker ;;
5) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
echo "Server utilities installation and configuration script completed."
}
# Display main menu
main_menu

View File

@ -0,0 +1,225 @@
#!/bin/bash
# Detect init system
detect_init_system() {
if [[ -x "$(command -v systemctl)" ]]; then
INIT_SYSTEM="systemd"
elif [[ -x "$(command -v service)" ]]; then
INIT_SYSTEM="sysvinit"
elif [[ -x "$(command -v rc-service)" ]]; then
INIT_SYSTEM="openrc"
elif [[ -x "$(command -v runsvdir)" ]]; then
INIT_SYSTEM="runit"
else
echo "Unsupported init system. Exiting."
exit 1
fi
}
# Function to install Postfix if not installed
install_postfix_if_needed() {
case $INIT_SYSTEM in
systemd | sysvinit | openrc | runit)
if ! dpkg -l postfix > /dev/null 2>&1; then
echo "Postfix is not installed. Installing..."
if sudo apt-get install -y postfix; then
echo "Postfix installed successfully."
else
echo "Failed to install Postfix. Exiting."
exit 1
fi
fi
;;
*)
echo "Unsupported init system. Cannot install Postfix."
;;
esac
}
# Function to configure Postfix interactively
configure_postfix() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Configuring Postfix..."
if ! sudo dpkg-reconfigure postfix; then
echo "Failed to configure Postfix."
dialog --title "Error" --msgbox "Failed to configure Postfix." 10 60
exit 1
fi
echo "Postfix configured successfully."
dialog --title "Success" --msgbox "Postfix configured successfully." 10 60
;;
openrc | runit)
echo "Postfix configuration is managed differently in OpenRC or Runit."
;;
esac
}
# Function to start Postfix service
start_postfix() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Starting Postfix service..."
if ! sudo systemctl start postfix; then
echo "Failed to start Postfix service."
dialog --title "Error" --msgbox "Failed to start Postfix service." 10 60
exit 1
fi
echo "Postfix service started successfully."
dialog --title "Success" --msgbox "Postfix service started successfully." 10 60
;;
openrc)
sudo rc-service postfix start
dialog --title "Success" --msgbox "Postfix service started successfully." 10 60
;;
runit)
echo "Runit does not manage Postfix."
;;
esac
}
# Function to stop Postfix service
stop_postfix() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Stopping Postfix service..."
if ! sudo systemctl stop postfix; then
echo "Failed to stop Postfix service."
dialog --title "Error" --msgbox "Failed to stop Postfix service." 10 60
exit 1
fi
echo "Postfix service stopped successfully."
dialog --title "Success" --msgbox "Postfix service stopped successfully." 10 60
;;
openrc)
sudo rc-service postfix stop
dialog --title "Success" --msgbox "Postfix service stopped successfully." 10 60
;;
runit)
echo "Runit does not manage Postfix."
;;
esac
}
# Function to restart Postfix service
restart_postfix() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Restarting Postfix service..."
if ! sudo systemctl restart postfix; then
echo "Failed to restart Postfix service."
dialog --title "Error" --msgbox "Failed to restart Postfix service." 10 60
exit 1
fi
echo "Postfix service restarted successfully."
dialog --title "Success" --msgbox "Postfix service restarted successfully." 10 60
;;
openrc)
sudo rc-service postfix restart
dialog --title "Success" --msgbox "Postfix service restarted successfully." 10 60
;;
runit)
echo "Runit does not manage Postfix."
;;
esac
}
# Function to enable Postfix service at boot
enable_postfix_at_boot() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Enabling Postfix service at boot..."
if ! sudo systemctl enable postfix; then
echo "Failed to enable Postfix service at boot."
dialog --title "Error" --msgbox "Failed to enable Postfix service at boot." 10 60
exit 1
fi
echo "Postfix service enabled at boot successfully."
dialog --title "Success" --msgbox "Postfix service enabled at boot successfully." 10 60
;;
openrc)
sudo rc-update add postfix default
dialog --title "Success" --msgbox "Postfix service enabled at boot successfully." 10 60
;;
runit)
echo "Runit does not manage Postfix."
;;
esac
}
# Function to disable Postfix service at boot
disable_postfix_at_boot() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Disabling Postfix service at boot..."
if ! sudo systemctl disable postfix; then
echo "Failed to disable Postfix service at boot."
dialog --title "Error" --msgbox "Failed to disable Postfix service at boot." 10 60
exit 1
fi
echo "Postfix service disabled at boot successfully."
dialog --title "Success" --msgbox "Postfix service disabled at boot successfully." 10 60
;;
openrc)
sudo rc-update del postfix default
dialog --title "Success" --msgbox "Postfix service disabled at boot successfully." 10 60
;;
runit)
echo "Runit does not manage Postfix."
;;
esac
}
# Function to configure Postfix securely (optional)
secure_postfix() {
echo "Securing Postfix configuration..."
# You can add additional secure configuration steps here if needed
echo "Postfix configuration secured successfully."
dialog --title "Success" --msgbox "Postfix configuration secured successfully." 10 60
}
# Function to display the main menu
main_menu() {
while true; do
CHOICE=$(dialog --clear --backtitle "Postfix Configuration" \
--title "Postfix Menu" \
--menu "Choose an option:" 15 60 9 \
1 "Install/Check Postfix" \
2 "Configure Postfix" \
3 "Start Postfix" \
4 "Stop Postfix" \
5 "Restart Postfix" \
6 "Enable Postfix at Boot" \
7 "Disable Postfix at Boot" \
8 "Secure Postfix Configuration" \
9 "Exit" \
3>&1 1>&2 2>&3 3>&-)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $CHOICE in
1) install_postfix_if_needed ;;
2) configure_postfix ;;
3) start_postfix ;;
4) stop_postfix ;;
5) restart_postfix ;;
6) enable_postfix_at_boot ;;
7) disable_postfix_at_boot ;;
8) secure_postfix ;;
9) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
echo "Postfix configuration script completed."
}
# Main script logic
detect_init_system
main_menu

View File

@ -0,0 +1,255 @@
#!/bin/bash
# Detect init system
detect_init_system() {
if [[ -x "$(command -v systemctl)" ]]; then
INIT_SYSTEM="systemd"
elif [[ -x "$(command -v service)" ]]; then
INIT_SYSTEM="sysvinit"
elif [[ -x "$(command -v rc-service)" ]]; then
INIT_SYSTEM="openrc"
elif [[ -x "$(command -v runsvdir)" ]]; then
INIT_SYSTEM="runit"
else
echo "Unsupported init system. Exiting."
exit 1
fi
}
# Function to install PostgreSQL if not installed
install_postgresql_if_needed() {
case $INIT_SYSTEM in
systemd | sysvinit | openrc | runit)
if ! dpkg -l postgresql > /dev/null 2>&1; then
echo "PostgreSQL is not installed. Installing..."
if sudo apt-get install -y postgresql; then
echo "PostgreSQL installed successfully."
else
echo "Failed to install PostgreSQL. Exiting."
exit 1
fi
fi
;;
*)
echo "Unsupported init system. Cannot install PostgreSQL."
;;
esac
}
# Function to start PostgreSQL
start_postgresql() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Starting PostgreSQL..."
sudo systemctl start postgresql
dialog --msgbox "PostgreSQL started." 10 30
;;
openrc)
sudo rc-service postgresql start
dialog --msgbox "PostgreSQL started." 10 30
;;
runit)
echo "Runit does not manage PostgreSQL."
;;
esac
}
# Function to stop PostgreSQL
stop_postgresql() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Stopping PostgreSQL..."
sudo systemctl stop postgresql
dialog --msgbox "PostgreSQL stopped." 10 30
;;
openrc)
sudo rc-service postgresql stop
dialog --msgbox "PostgreSQL stopped." 10 30
;;
runit)
echo "Runit does not manage PostgreSQL."
;;
esac
}
# Function to restart PostgreSQL
restart_postgresql() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Restarting PostgreSQL..."
sudo systemctl restart postgresql
dialog --msgbox "PostgreSQL restarted." 10 30
;;
openrc)
sudo rc-service postgresql restart
dialog --msgbox "PostgreSQL restarted." 10 30
;;
runit)
echo "Runit does not manage PostgreSQL."
;;
esac
}
# Function to enable PostgreSQL at boot
enable_postgresql_at_boot() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Enabling PostgreSQL at boot..."
sudo systemctl enable postgresql
dialog --msgbox "PostgreSQL enabled at boot." 10 30
;;
openrc)
sudo rc-update add postgresql default
dialog --msgbox "PostgreSQL enabled at boot." 10 30
;;
runit)
echo "Runit does not manage PostgreSQL."
;;
esac
}
# Function to disable PostgreSQL at boot
disable_postgresql_at_boot() {
case $INIT_SYSTEM in
systemd | sysvinit)
echo "Disabling PostgreSQL at boot..."
sudo systemctl disable postgresql
dialog --msgbox "PostgreSQL disabled at boot." 10 30
;;
openrc)
sudo rc-update del postgresql default
dialog --msgbox "PostgreSQL disabled at boot." 10 30
;;
runit)
echo "Runit does not manage PostgreSQL."
;;
esac
}
# Function to secure PostgreSQL installation
secure_postgresql() {
echo "Securing PostgreSQL installation..."
sudo passwd postgres
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'your_password';"
dialog --msgbox "PostgreSQL installation secured." 10 30
}
# Function to create a database
create_database() {
DATABASE=$(dialog --inputbox "Enter the name of the database to create:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; then
sudo -u postgres createdb $DATABASE
dialog --msgbox "Database '$DATABASE' created successfully." 10 60
fi
}
# Function to create a table
create_table() {
DATABASE=$(dialog --inputbox "Enter the name of the database:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Enter the name of the table to create:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" ]]; then
sudo -u postgres psql -d $DATABASE -c "CREATE TABLE $TABLE (id SERIAL PRIMARY KEY);"
dialog --msgbox "Table '$TABLE' created in database '$DATABASE' successfully." 10 60
fi
}
# Function to insert data into a table
insert_data() {
DATABASE=$(dialog --inputbox "Enter the name of the database:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Enter the name of the table to insert data into:" 10 40 3>&1 1>&2 2>&3 3>&-)
DATA=$(dialog --inputbox "Enter data to insert into table (e.g., 'value1, value2'):" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" && -n "$DATA" ]]; then
sudo -u postgres psql -d $DATABASE -c "INSERT INTO $TABLE VALUES ($DATA);"
dialog --msgbox "Data inserted into table '$TABLE' in database '$DATABASE' successfully." 10 60
fi
}
# Function to query data from a table
query_data() {
DATABASE=$(dialog --inputbox "Enter the name of the database:" 10 40 3>&1 1>&2 2>&3 3>&-)
TABLE=$(dialog --inputbox "Enter the name of the table to query from:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" && -n "$TABLE" ]]; then
QUERY=$(dialog --inputbox "Enter SQL query (e.g., 'SELECT * FROM $TABLE;'):" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$QUERY" ]]; then
sudo -u postgres psql -d $DATABASE -c "$QUERY"
dialog --msgbox "Query executed successfully." 10 60
fi
fi
}
# Function to backup the database
backup_database() {
DATABASE=$(dialog --inputbox "Enter the name of the database to backup:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; then
sudo -u postgres pg_dump $DATABASE > $DATABASE.sql
dialog --msgbox "Database '$DATABASE' backed up to '$DATABASE.sql' successfully." 10 60
fi
}
# Function to restore the database
restore_database() {
DATABASE=$(dialog --inputbox "Enter the name of the database to restore into:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -n "$DATABASE" ]]; then
FILE=$(dialog --inputbox "Enter the path to the SQL file to restore:" 10 60 3>&1 1>&2 2>&3 3>&-)
if [[ -f "$FILE" ]]; then
sudo -u postgres psql -d $DATABASE < $FILE
dialog --msgbox "Database '$DATABASE' restored successfully." 10 60
else
dialog --msgbox "File not found or invalid." 10 60
fi
fi
}
# Function to configure PostgreSQL
configure_postgresql() {
while true; do
CHOICE=$(dialog --clear --backtitle "Configure PostgreSQL" \
--title "PostgreSQL Menu" \
--menu "Choose an option:" 20 60 14 \
1 "Install/Check PostgreSQL" \
2 "Start PostgreSQL" \
3 "Stop PostgreSQL" \
4 "Restart PostgreSQL" \
5 "Enable PostgreSQL at Boot" \
6 "Disable PostgreSQL at Boot" \
7 "Secure PostgreSQL Installation" \
8 "Create Database" \
9 "Create Table" \
10 "Insert Data into Table" \
11 "Query Data from Table" \
12 "Backup Database" \
13 "Restore Database" \
14 "Return to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
clear
# Check if user canceled
if [ $? -eq 1 ]; then
break
fi
case $CHOICE in
1) install_postgresql_if_needed ;;
2) start_postgresql ;;
3) stop_postgresql ;;
4) restart_postgresql ;;
5) enable_postgresql_at_boot ;;
6) disable_postgresql_at_boot ;;
7) secure_postgresql ;;
8) create_database ;;
9) create_table ;;
10) insert_data ;;
11) query_data ;;
12) backup_database ;;
13) restore_database ;;
14) break ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Main script logic
detect_init_system
configure_postgresql

View File

@ -0,0 +1,346 @@
#!/bin/bash
# Function to generate SSH keys
generate_ssh_keys() {
dialog --yesno "Do you want to generate SSH keys?" 10 60
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
SSH_DIR=~/.ssh
mkdir -p $SSH_DIR
SSH_KEY_FILE=$SSH_DIR/id_rsa
ssh-keygen -t rsa -b 4096 -f $SSH_KEY_FILE -N ""
dialog --msgbox "SSH keys generated in $SSH_KEY_FILE." 10 60
}
# Function to add SSH key to authorized_keys
add_ssh_key() {
KEY_FILE=$(dialog --inputbox "Enter the path to the SSH public key file:" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
if [ -z "$KEY_FILE" ]; then
dialog --msgbox "Please enter a valid path to the SSH public key file." 10 60
else
mkdir -p ~/.ssh
cat "$KEY_FILE" >> ~/.ssh/authorized_keys
dialog --msgbox "SSH key added to authorized_keys." 10 60
fi
}
# Function to configure advanced SSH options
configure_advanced_ssh() {
while true; do
ADV_CHOICE=$(dialog --clear --backtitle "SSH Advanced Configuration" \
--title "SSH Advanced Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Edit SSH Config File" \
2 "Restart SSH Service" \
3 "Check SSH Service Status" \
4 "Install OpenSSH Server" \
5 "Uninstall OpenSSH Server" \
6 "View SSH Logs" \
7 "Backup SSH Config" \
8 "Restore SSH Config" \
9 "Change SSH Port" \
10 "Enable/Disable Password Authentication" \
11 "List SSH Connections" \
12 "Back to SSH Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
case $ADV_CHOICE in
1) ${EDITOR:-nano} /etc/ssh/sshd_config ;;
2) restart_ssh_service ;;
3) check_ssh_service_status ;;
4) install_openssh_server ;;
5) uninstall_openssh_server ;;
6) view_ssh_logs ;;
7) backup_ssh_config ;;
8) restore_ssh_config ;;
9) change_ssh_port ;;
10) toggle_password_authentication ;;
11) list_ssh_connections ;;
12) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 60 ;;
esac
done
}
# Function to install OpenSSH Server
install_openssh_server() {
dialog --yesno "Do you want to install OpenSSH Server?" 10 60
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
case $INIT_SYSTEM in
"sysvinit")
apt update
apt install -y openssh-server
service ssh start
update-rc.d ssh defaults
;;
"openrc")
apk update
apk add openssh
rc-update add sshd
rc-service sshd start
;;
"runit")
apk update
apk add openssh
ln -s /etc/runit/sv/sshd /run/runit/service
;;
*)
dialog --msgbox "Unsupported init system: $INIT_SYSTEM" 10 60
return 1
;;
esac
dialog --msgbox "OpenSSH Server installed and enabled." 10 60
}
# Function to uninstall OpenSSH Server
uninstall_openssh_server() {
dialog --yesno "Do you want to uninstall OpenSSH Server?" 10 60
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
case $INIT_SYSTEM in
"sysvinit")
service ssh stop
update-rc.d -f ssh remove
apt remove -y openssh-server
;;
"openrc")
rc-service sshd stop
rc-update del sshd
apk del openssh
;;
"runit")
rm /run/runit/service/sshd
apk del openssh
;;
*)
dialog --msgbox "Unsupported init system: $INIT_SYSTEM" 10 60
return 1
;;
esac
dialog --msgbox "OpenSSH Server uninstalled." 10 60
}
# Function to view SSH logs
view_ssh_logs() {
if command -v journalctl >/dev/null 2>&1; then
dialog --msgbox "$(journalctl -u ssh --no-pager)" 30 80
else
dialog --msgbox "Journalctl not found. Cannot view SSH logs." 10 60
fi
}
# Function to backup SSH config
backup_ssh_config() {
BACKUP_DIR="/var/backups"
BACKUP_FILE="sshd_config_$(date +"%Y%m%d_%H%M%S").bak"
cp /etc/ssh/sshd_config $BACKUP_DIR/$BACKUP_FILE
dialog --msgbox "SSH config backed up to $BACKUP_DIR/$BACKUP_FILE." 10 60
}
# Function to restore SSH config
restore_ssh_config() {
BACKUP_FILE=$(dialog --inputbox "Enter the full path of the SSH config backup file:" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
if [ -z "$BACKUP_FILE" ]; then
dialog --msgbox "Please enter a valid path to the SSH config backup file." 10 60
elif [ ! -f "$BACKUP_FILE" ]; then
dialog --msgbox "Backup file not found." 10 60
else
cp "$BACKUP_FILE" /etc/ssh/sshd_config
case $INIT_SYSTEM in
"sysvinit")
service ssh restart
;;
"openrc")
rc-service sshd restart
;;
"runit")
sv restart sshd
;;
*)
dialog --msgbox "Unsupported init system: $INIT_SYSTEM" 10 60
return 1
;;
esac
dialog --msgbox "SSH config restored from $BACKUP_FILE." 10 60
fi
}
# Function to change SSH port
change_ssh_port() {
NEW_PORT=$(dialog --inputbox "Enter the new SSH port:" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
if [[ $NEW_PORT =~ ^[0-9]+$ ]]; then
sed -i "s/#Port 22/Port $NEW_PORT/" /etc/ssh/sshd_config
case $INIT_SYSTEM in
"sysvinit")
service ssh restart
;;
"openrc")
rc-service sshd restart
;;
"runit")
sv restart sshd
;;
*)
dialog --msgbox "Unsupported init system: $INIT_SYSTEM" 10 60
return 1
;;
esac
dialog --msgbox "SSH port changed to $NEW_PORT." 10 60
else
dialog --msgbox "Invalid port number." 10 60
fi
}
# Function to enable/disable password authentication in SSH
toggle_password_authentication() {
STATUS=$(dialog --menu "Choose an option:" 10 60 2 \
1 "Enable Password Authentication" \
2 "Disable Password Authentication" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
case $STATUS in
1) sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config ;;
2) sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config ;;
esac
case $INIT_SYSTEM in
"sysvinit")
service ssh restart
;;
"openrc")
rc-service sshd restart
;;
"runit")
sv restart sshd
;;
*)
dialog --msgbox "Unsupported init system: $INIT_SYSTEM" 10 60
return 1
;;
esac
dialog --msgbox "Password authentication $(echo $STATUS | tr '[:lower:]' '[:upper:]')." 10 60
}
# Function to list SSH connections
list_ssh_connections() {
netstat -tnpa | grep 'ESTABLISHED.*sshd'
dialog --msgbox "List of SSH connections displayed." 10 60
}
# Function to check if OpenSSH is installed
check_ssh_installation() {
case $INIT_SYSTEM in
"sysvinit")
dpkg -l openssh-server >/dev/null 2>&1
;;
"openrc")
apk info openssh >/dev/null 2>&1
;;
"runit")
apk info openssh >/dev/null 2>&1
;;
*)
dialog --msgbox "Unsupported init system: $INIT_SYSTEM" 10 60
return 1
;;
esac
if [ $? -eq 0 ]; then
dialog --msgbox "OpenSSH is installed." 10 60
else
dialog --msgbox "OpenSSH is not installed." 10 60
fi
}
# Function to configure SSH options
configure_ssh() {
while true; do
SSH_CHOICE=$(dialog --clear --backtitle "SSH Configuration" \
--title "SSH Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Generate SSH Keys" \
2 "Add SSH Key to authorized_keys" \
3 "Advanced Configuration" \
4 "Check SSH Installation" \
5 "Back to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
case $SSH_CHOICE in
1) generate_ssh_keys ;;
2) add_ssh_key ;;
3) configure_advanced_ssh ;;
4) check_ssh_installation ;;
5) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 60 ;;
esac
done
}
# Determine the init system and execute the main function to configure SSH
if command -v systemctl >/dev/null 2>&1; then
INIT_SYSTEM="sysvinit"
elif command -v rc-service >/dev/null 2>&1; then
INIT_SYSTEM="openrc"
elif command -v sv >/dev/null 2>&1; then
INIT_SYSTEM="runit"
else
dialog --msgbox "Unsupported init system." 10 60
exit 1
fi
configure_ssh

View File

@ -0,0 +1,210 @@
#!/bin/bash
# Function to configure static IP
configure_static_ip() {
while true; do
# Prompt for network interface
INTERFACE=$(dialog --inputbox "Enter physical network interface (e.g., eth0):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
# Prompt for IP address
IP_ADDRESS=$(dialog --inputbox "Enter static IP address (e.g., 192.168.1.100):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
# Validate IP address format
if ! valid_ip "$IP_ADDRESS"; then
dialog --msgbox "Invalid IP address format. Please enter a valid IP address." 10 60
continue
fi
# Prompt for netmask
NETMASK=$(dialog --inputbox "Enter netmask (e.g., 255.255.255.0):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
# Validate netmask format
if ! valid_netmask "$NETMASK"; then
dialog --msgbox "Invalid netmask format. Please enter a valid netmask." 10 60
continue
fi
# Prompt for gateway
GATEWAY=$(dialog --inputbox "Enter gateway (optional, leave blank if none):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
# Prompt for DNS server
DNS_SERVER=$(dialog --inputbox "Enter DNS server (optional, leave blank if none):" 10 60 3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
return 1
fi
# Apply the static IP configuration
if [ -z "$INTERFACE" ] || [ -z "$IP_ADDRESS" ] || [ -z "$NETMASK" ]; then
dialog --msgbox "Network interface, IP address, and netmask cannot be empty. Please enter valid information." 10 60
else
apply_static_ip "$INTERFACE" "$IP_ADDRESS" "$NETMASK" "$GATEWAY" "$DNS_SERVER"
return $?
fi
done
}
# Function to validate IP address format
valid_ip() {
local ip=$1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
local IFS='.'
ip=($ip)
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
else
false
fi
}
# Function to validate netmask format
valid_netmask() {
local netmask=$1
if [[ $netmask =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
local IFS='.'
netmask=($netmask)
[[ ${netmask[0]} -le 255 && ${netmask[1]} -le 255 && ${netmask[2]} -le 255 && ${netmask[3]} -le 255 ]]
else
false
fi
}
# Function to apply static IP configuration
apply_static_ip() {
local interface=$1
local ip_address=$2
local netmask=$3
local gateway=$4
local dns_server=$5
# Apply configuration to /etc/network/interfaces
case $INIT_SYSTEM in
"sysvinit")
cat <<EOF | sudo tee /etc/network/interfaces >/dev/null
auto lo
iface lo inet loopback
auto $interface
iface $interface inet static
address $ip_address
netmask $netmask
gateway $gateway
dns-nameservers $dns_server
EOF
service networking restart
;;
"openrc")
cat <<EOF | sudo tee /etc/network/interfaces.d/$interface >/dev/null
iface $interface inet static
address $ip_address
netmask $netmask
gateway $gateway
dns-nameservers $dns_server
EOF
rc-service networking restart
;;
"runit")
cat <<EOF | sudo tee /etc/network.d/$interface >/dev/null
#!/bin/sh
exec ip addr add $ip_address/$netmask dev $interface
exec ip link set $interface up
EOF
chmod +x /etc/network.d/$interface
sv restart networking
;;
*)
dialog --msgbox "Unsupported init system: $INIT_SYSTEM" 10 60
return 1
;;
esac
# Check if configuration applied successfully
if ip addr show $interface | grep -q "$ip_address"; then
dialog --msgbox "Static IP configuration applied successfully:\nInterface: $interface\nIP Address: $ip_address\nNetmask: $netmask\nGateway: $gateway\nDNS Server: $dns_server" 12 60
return 0
else
dialog --msgbox "Failed to apply static IP configuration. Please check your settings and try again." 10 60
return 1
fi
}
# Main function to configure host settings
configure_host() {
while true; do
HOST_CHOICE=$(dialog --clear --backtitle "Host Configuration" \
--title "Host Menu" \
--menu "Choose an option:" 20 60 10 \
1 "Configure Static IP" \
2 "Show Current Network Settings" \
3 "Back to Main Menu" \
3>&1 1>&2 2>&3 3>&-)
# Check if user canceled
if [ $? -ne 0 ]; then
break
fi
case $HOST_CHOICE in
1) configure_static_ip ;;
2) show_current_network_settings ;;
3) break ;;
*) dialog --msgbox "Invalid option. Please choose a valid option." 10 60 ;;
esac
done
}
# Function to show current network settings
show_current_network_settings() {
case $INIT_SYSTEM in
"sysvinit")
CURRENT_SETTINGS=$(ifconfig)
;;
"openrc")
CURRENT_SETTINGS=$(ip addr show)
;;
"runit")
CURRENT_SETTINGS=$(ip addr show)
;;
*)
dialog --msgbox "Unsupported init system: $INIT_SYSTEM" 10 60
return 1
;;
esac
dialog --msgbox "Current Network Settings:\n\n$CURRENT_SETTINGS" 20 80
}
# Determine the init system and execute the main function to configure host settings
if command -v systemctl >/dev/null 2>&1; then
INIT_SYSTEM="sysvinit"
elif command -v rc-service >/dev/null 2>&1; then
INIT_SYSTEM="openrc"
elif command -v sv >/dev/null 2>&1; then
INIT_SYSTEM="runit"
else
dialog --msgbox "Unsupported init system." 10 60
exit 1
fi
configure_host

View File

@ -0,0 +1,75 @@
#!/bin/bash
# Function to create users
create_user() {
local USERNAME
local FULLNAME
local PASSWORD
local GROUPS
local SELECTED_GROUPS
# Prompt for username
USERNAME=$(dialog --inputbox "Enter the username of the new user:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -z "$USERNAME" ]]; then
dialog --msgbox "Username cannot be empty. User creation canceled." 10 30
return
fi
# Check if username already exists
if id "$USERNAME" &>/dev/null; then
dialog --msgbox "User $USERNAME already exists. User creation canceled." 10 30
return
fi
# Prompt for full name
FULLNAME=$(dialog --inputbox "Enter the full name of the new user:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -z "$FULLNAME" ]]; then
dialog --msgbox "Full name cannot be empty. User creation canceled." 10 30
return
fi
# Prompt for password
PASSWORD=$(dialog --passwordbox "Enter the password for user $USERNAME:" 10 40 3>&1 1>&2 2>&3 3>&-)
if [[ -z "$PASSWORD" ]]; then
dialog --msgbox "Password cannot be empty. User creation canceled." 10 30
return
fi
# Get list of available groups
GROUPS=$(getent group | cut -d: -f1)
GROUPS_ARR=()
for group in $GROUPS; do
GROUPS_ARR+=("$group" "" off)
done
# Select groups to add user
SELECTED_GROUPS=$(dialog --checklist "Select groups to add user $USERNAME:" 20 60 10 "${GROUPS_ARR[@]}" 3>&1 1>&2 2>&3 3>&-)
if [[ -z "$SELECTED_GROUPS" ]]; then
dialog --msgbox "No groups selected. User $USERNAME will not be added to any groups." 10 30
fi
# Create the user
useradd -m -c "$FULLNAME" "$USERNAME"
if [[ $? -eq 0 ]]; then
echo "$USERNAME:$PASSWORD" | chpasswd
if [[ $? -eq 0 ]]; then
dialog --msgbox "User $USERNAME created successfully." 10 30
# Add user to selected groups
for group in $SELECTED_GROUPS; do
usermod -aG "$group" "$USERNAME"
if [[ $? -ne 0 ]]; then
dialog --msgbox "Failed to add user $USERNAME to group $group." 10 30
fi
done
else
dialog --msgbox "Failed to set password for user $USERNAME. User creation canceled." 10 30
userdel -r "$USERNAME" # Rollback user creation if password setting failed
fi
else
dialog --msgbox "Failed to create user $USERNAME. User creation canceled." 10 30
fi
}
# Call the function to create users
create_user

View File

@ -0,0 +1,92 @@
#!/bin/bash
# Function to update package list
update_package_list() {
echo "Updating package list..."
if ! sudo apt update; then
echo "Failed to update package list."
dialog --title "Error" --msgbox "Failed to update package list. Check your internet connection or repository settings." 10 60
return 1
fi
echo "Package list updated successfully."
}
# Function to install selected packages
install_selected_packages() {
local selected_packages=("$@")
echo "Installing selected packages..."
for package in "${selected_packages[@]}"; do
echo "Installing package: $package"
if sudo apt install -y "$package"; then
echo "Package $package installed successfully."
else
echo "Failed to install package: $package"
dialog --title "Error" --msgbox "Failed to install package: $package" 10 60
fi
done
echo "All packages installed successfully."
dialog --title "Success" --msgbox "All packages installed successfully." 10 60
}
# List of packages available for installation
# Add more if necessary
PACKAGES=("vim"
"emacs"
"mcedit"
"joe"
"wget"
"curl"
"lynx"
"htop"
"iftop"
"iotop"
"git"
"btop"
"dnsutils")
# Check if script is running as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
dialog --title "Error" --msgbox "This script must be run as root." 10 30
exit 1
fi
# Update package list before installation
update_package_list
# Prepare package list for dialog
DIALOG_PACKAGES=()
for idx in "${!PACKAGES[@]}"; do
DIALOG_PACKAGES+=("$((idx + 1))" "${PACKAGES[$idx]}" off)
done
while true; do
# Show dialog box for package selection
echo "Starting package selection dialog..."
selections=$(dialog --stdout --checklist "Select packages to install (use space to select):" 20 60 ${#PACKAGES[@]} "${DIALOG_PACKAGES[@]}" 3>&1 1>&2 2>&3)
# Check if cancel button is pressed or no selection was made
if [[ $? -ne 0 ]]; then
echo "Installation canceled."
dialog --title "Information" --msgbox "Installation canceled." 10 60
exit 0
fi
# Check if no selection was made
if [[ -z "$selections" ]]; then
echo "No packages selected. Please select at least one package."
dialog --title "Error" --msgbox "No packages selected. Please select at least one package." 10 60
else
break
fi
done
# Convert selection into an array
IFS=" " read -r -a packages_to_install <<< "$selections"
# Call function to install selected packages
install_selected_packages "${packages_to_install[@]}"
echo "Script completed."

View File

@ -0,0 +1,81 @@
#!/bin/bash
# Directory where the scripts are located
SCRIPT_DIR="/usr/local/bin"
# Function to display the main menu
main_menu() {
while true; do
CHOICE=$(dialog --clear --backtitle "PeppermintOS Server Configuration" \
--title "Main Menu" \
--menu "Choose an option:" 20 60 15 \
1 "Configure SSH" \
2 "Configure Static IP" \
3 "Update and Install Packages" \
4 "Configure firewalld" \
5 "Configure Hostname" \
6 "Create User" \
7 "Configure Nginx" \
8 "Configure Apache2" \
9 "Configure Postfix" \
10 "Configure MariaDB" \
11 "Configure PostgreSQL" \
12 "Configure SQLite" \
13 "Configure PHP and Docker" \
14 "Exit" \
3>&1 1>&2 2>&3)
# Check if user canceled or exited
if [[ $? -ne 0 ]]; then
clear
echo "Menu closed or canceled. Exiting..."
exit 0
fi
clear
case $CHOICE in
1) sudo "$SCRIPT_DIR/configure_ssh.sh" ;;
2) sudo "$SCRIPT_DIR/configure_static_ip.sh" ;;
3) sudo "$SCRIPT_DIR/update_and_install.sh" ;;
4) sudo "$SCRIPT_DIR/configure_firewalld.sh" ;;
5) sudo "$SCRIPT_DIR/configure_hostname.sh" ;;
6) sudo "$SCRIPT_DIR/create_user.sh" ;;
7) sudo "$SCRIPT_DIR/configure_nginx.sh" ;;
8) sudo "$SCRIPT_DIR/configure_apache2.sh" ;;
9) sudo "$SCRIPT_DIR/configure_postfix.sh" ;;
10) sudo "$SCRIPT_DIR/configure_mariadb.sh" ;;
11) sudo "$SCRIPT_DIR/configure_postgresql.sh" ;;
12) sudo "$SCRIPT_DIR/configure_sqlite.sh" ;;
13) sudo "$SCRIPT_DIR/configure_php_and_docker.sh" ;;
14) clear; echo "Exiting..."; exit 0 ;;
*) dialog --msgbox "Invalid option." 10 30 ;;
esac
done
}
# Show welcome message
dialog --msgbox "Welcome to PeppermintOS Server Friendly Configuration Tool!
This tool will help you configure various aspects of your server, including:
1. SSH: Configure the SSH server and client for secure remote access.
2. Static IP: Set a static IP address for consistent network communication.
3. Update and Install Packages: Ensure your system is up-to-date and install essential packages.
4. firewalld: Set up firewall rules to secure your server.
5. Hostname: Change the hostname of your server.
6. Create User: Add new users to your system.
7. Nginx: Configure the Nginx web server.
8. Apache2: Configure the Apache2 web server.
9. Postfix: Configure the Postfix mail server.
10. MariaDB: Set up the MariaDB database server.
11. PostgreSQL: Set up the PostgreSQL database server.
12. SQLite: Configure the SQLite database.
13. PHP: Configure PHP and related settings.
14. Docker: Configure Docker and manage containers.
15. Exit: Exit the configuration tool.
Please select an option from the menu to begin." 20 60
# Display main menu
main_menu

View File

@ -8,7 +8,6 @@
<property name="dpms-on-ac-sleep" type="uint" value="60"/>
<property name="blank-on-ac" type="int" value="60"/>
<property name="dpms-on-ac-off" type="uint" value="60"/>
<property name="inactivity-sleep-mode-on-ac" type="uint" value="0"/>
<property name="inactivity-on-ac" type="uint" value="0"/>
<property name="inactivity-on-ac" type="uint" value="14"/>
</property>
</channel>

View File

@ -40,7 +40,6 @@ START_LIVEBUILD = "Start Live-Build Process"
BUILD_COMPILED = "ISO build has compiled successfully"
BUILD_COMPLETED = "ISO is ready for usage. Begin copy to Nightly for QA testing"
class BuildBase:
"""
Base class for building ISOs.
@ -56,12 +55,10 @@ class BuildBase:
os.chdir(HOME_FOLDER + FUSATO_ROOT)
self.build_system(desktop_helper)
def lb_helper(self):
""" Helper to set the lb commands for live-build"""
lbsetup = None
if self.sbase in ["deb", "dev", "debmin", "devmin", "debsrv",
"devsrv", "debld", "devld"]:
if self.sbase in ["deb", "dev", "debmin", "devmin", "debsrv", "devsrv", "debld", "devld"]:
arch_suffix = self.sarch[1:]
if arch_suffix in ["64", "32", "arm"]:
lbsetup = getattr(
@ -70,25 +67,22 @@ class BuildBase:
os.system(lbsetup)
return lbsetup
def infra_helper(self):
""" Get the build infrastucture ready """
infra_methods = [infra.BinaryFolders, infra.ChrootInstallerFiles,
infra.ArchitectureFiles, infra.Archive,
infra.InstallerFiles, infra.FusatoConfigs,
infra.ServerConfigFiles,
infra.ServerConfigFiles
]
for method in infra_methods:
method(self.sbase, self.sarch)
def cleanup_helper(self):
""" Clean and Move the comleted ISO """
finish_cleanup.make_check_sum()
finish_cleanup.check_build_type()
finish_cleanup.kill_old_iso()
def build_system(self, desktop_helper):
""" The actual building process """
current_working_directory = os.getcwd()
@ -109,10 +103,6 @@ class BuildBase:
inflate_bubble.make_bld_xfce(self.sbase, self.sarch[1:])
elif desktop_name == 'gfb':
inflate_bubble.make_bld_gnomeflashback(self.sbase, self.sarch[1:])
elif desktop_name == 'kde':
inflate_bubble.make_bld_kde(self.sbase, self.sarch[1:])
elif desktop_name == 'opb':
inflate_bubble.make_bld_openbox(self.sbase, self.sarch[1:])
logger.info(dir_current)
os.system(run_cmd)
logger.info(BUILD_COMPLETED)
@ -131,7 +121,6 @@ class BuildXfce(BuildBase):
"""
super().__init__(sbase, sarch, self.xfce_helper)
def xfce_helper(self):
""" The helper functions to ensure the xfce requirements are used """
arch_suffix = self.sarch[1:]
@ -158,7 +147,6 @@ class BuildGflashback(BuildBase):
"""
super().__init__(sbase, sarch, self.gfb_helper)
def gfb_helper(self):
"""
The helper functions to ensure the gnome flashback requirements
@ -166,8 +154,7 @@ class BuildGflashback(BuildBase):
"""
arch_suffix = self.sarch[1:]
cmd_list = None
if self.sbase in ["deb", "dev", "debmin", "devmin", "debsrv",
"devsrv", "debld", "devld"]:
if self.sbase in ["deb", "dev", "debmin", "devmin", "debsrv", "devsrv", "debld", "devld"]:
if arch_suffix in ["64", "32", "arm"]:
os.system(f'touch {self.sbase.upper()}.{arch_suffix}gfb')
if arch_suffix in ["64", "32", "arm"]:
@ -188,7 +175,6 @@ class BuildOpenbox(BuildBase):
"""
super().__init__(sbase, sarch, self.opb_helper)
def opb_helper(self):
"""
The helper functions to ensure the openbox requirements are
@ -196,8 +182,7 @@ class BuildOpenbox(BuildBase):
"""
arch_suffix = self.sarch[1:]
cmd_list = None
if self.sbase in ["deb", "dev", "debmin", "devmin", "debsrv",
"devsrv", "debld", "devld"]:
if self.sbase in ["deb", "dev", "debmin", "devmin", "debsrv", "devsrv", "debld", "devld"]:
if arch_suffix in ["64", "32", "arm"]:
os.system(f'touch {self.sbase.upper()}.{arch_suffix}opb')
if arch_suffix in ["64", "32", "arm"]:
@ -208,36 +193,6 @@ class BuildOpenbox(BuildBase):
return cmd_list
class BuildKde(BuildBase):
""" This class will ensure the KDE builds are built """
def __init__(self, sbase, sarch):
"""
init the building, super will
ensure that the method resolution order (MRO) is followed
correctly, allowing for a smooth inheritance hierarchy
"""
super().__init__(sbase, sarch, self.kde_helper)
def kde_helper(self):
"""
The helper functions to ensure the kde requirements are
used
"""
arch_suffix = self.sarch[1:]
cmd_list = None
if self.sbase in ["deb", "dev", "debmin", "devmin", "debsrv",
"devsrv", "debld", "devld"]:
if arch_suffix in ["64", "32", "arm"]:
os.system(f'touch {self.sbase.upper()}.{arch_suffix}kde')
if arch_suffix in ["64", "32", "arm"]:
cmd_list = getattr(conf, f"build{arch_suffix}_kde_build", [])
for command in cmd_list:
execute = command + '()'
exec(execute)
return cmd_list
class BuildLoaded(BuildBase):
""" This class will ensure the loaded xfce builds are built """
def __init__(self, sbase, sarch):
@ -248,7 +203,6 @@ class BuildLoaded(BuildBase):
"""
super().__init__(sbase, sarch, self.loaded_helper)
def loaded_helper(self):
"""
The helper functions to ensure the loaded xfce requirements are
@ -271,22 +225,18 @@ class BuildServer(BuildBase):
""" This class will ensure the Server builds are built """
def __init__(self, sbase, sarch):
"""
init the building, super will
ensure that the method resolution order (MRO) is followed
correctly, allowing for a smooth inheritance hierarchy
Initiate the building process for the Server.
Call super().__init__() with appropriate parameters.
"""
super().__init__(sbase, sarch, self.server_helper)
def server_helper(self):
"""
The helper functions to ensure the server requirements are
used
Helper method to assist in server-specific build tasks.
"""
arch_suffix = self.sarch[1:]
cmd_list = None
if self.sbase in ["deb", "dev", "debmin", "devmin", "debsrv",
"devsrv", "debld", "devld"]:
if self.sbase in ["deb", "dev", "debmin", "devmin", "debsrv", "devsrv", "debld", "devld"]:
if arch_suffix in ["64", "32", "arm"]:
os.system(f'touch {self.sbase.upper()}.{arch_suffix}server')
if arch_suffix in ["64", "32", "arm"]:
@ -307,7 +257,6 @@ class BuildMini(BuildBase):
"""
super().__init__(sbase, sarch, self.mini_helper)
def mini_helper(self):
"""
The helper functions to ensure the Mini requirements are
@ -370,7 +319,6 @@ class Decisions:
if desktop_build_function:
desktop_build_function()
def dxfce(self):
""" Arguments for the XFCE """
build_type_mapping = {
@ -444,24 +392,6 @@ class Decisions:
logger.critical("You have not specified a build to process!")
def dkde(self):
""" Arguments for the KDE """
build_type_mapping = {
'b-deb64': ("deb", "_64"),
'b-deb32': ("deb", "_32"),
'b-dev64': ("dev", "_64"),
'b-dev32': ("dev", "_32"),
'b-debarm': ("deb", "_arm"),
'b-devarm': ("dev", "_arm"),
}
build_argument = self.arguments.b
if build_argument in build_type_mapping:
readybuild()
BuildKde(*build_type_mapping[build_argument])
else:
logger.critical("You have not specified a build to process!")
def dloadxf(self):
""" Arguments for the loaded xfce """
build_type_mapping = {

View File

@ -3,24 +3,11 @@
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* This config file is the master configs used to build ISOs or arch
* and desktop as the need to scale the builds arises, you can add more
* settings to meet the need.
* This config file is the master configs used to build ISOs oer arch and desktop
* As the need to scale the builds arises, you can add more settings to meet the
* need.
"""
import paths
import inflate_bubble
import finish_cleanup
import copy_folders
import copy_files_specified
#########################################
# Sepecify the build to use, for exmaple #
# bookworm, trixie etc... #
#########################################
debian_codename ='bookworm'
devuan_codename ='daedalus'
##########################
# Functions to be ran
##########################
@ -50,7 +37,8 @@ shared_setup_loaded_cmds = ('inflate_bubble.set_fusato_structure',
'infra.icons_themes',
'infra.shared_files',
'infra.set_symlinks',
'infra.boostrap_shared'
'infra.boostrap_shared',
'infra.add_web_profile'
)
shared_setup_server_cmds = ('inflate_bubble.set_fusato_server_installer_structure',
@ -63,8 +51,7 @@ shared_setup_mini_cmds = ('inflate_bubble.set_fusato_mini_installer_structure',
'infra.mini_shared_installer_files'
)
flag_specific_setup_32_cmds = (
'inflate_bubble.set_specific_32_packages',)
flag_specific_setup_32_cmds = ('inflate_bubble.set_specific_32_packages',)
# Setup Desktop configs
# Add mor as needed
@ -77,10 +64,6 @@ setup_gfb_cmds = ('inflate_bubble.set_gfb',
setup_opb_cmds = ('inflate_bubble.set_opb',
'infra.open_box_configs',
)
setup_kde_cmds =('inflate_bubble.set_kde',
'infra.kde_configs',
)
setup_loaded_cmds = ('inflate_bubble.set_loaded',
'infra.loaded_configs',
'infra.loaded_folders',
@ -120,9 +103,6 @@ buildarm_xfce_build = (shared_setup_cmds + setup_xfce_cmds +
setup_chroot_grub_arm + setup_binary_grub_arm +
setup_fw_arm
)
# KDE
build_64_kde_build = ()
# Gnome_FlashBack
build64_gfb_build = (shared_setup_cmds + setup_gfb_cmds +
setup_chroot_grub_64 + setup_binary_grub_64 +
@ -155,22 +135,6 @@ buildarm_opb_build = (shared_setup_cmds + setup_opb_cmds +
setup_fw_arm
)
#Kde
build64_kde_build = (shared_setup_cmds + setup_kde_cmds +
setup_chroot_grub_64 + setup_binary_grub_64 +
setup_fw_64_32
)
build32_kde_build = (shared_setup_cmds + setup_kde_cmds +
setup_chroot_grub_32 + setup_binary_grub_32 +
setup_fw_64_32 + flag_specific_setup_32_cmds
)
buildarm_kde_build = (shared_setup_cmds + setup_opb_cmds +
setup_chroot_grub_arm + setup_binary_grub_arm +
setup_fw_arm
)
#Xfce_loaded
build64_loaded_build = (shared_setup_loaded_cmds + setup_loaded_cmds +
setup_chroot_grub_64 + setup_binary_grub_64 +
@ -198,15 +162,8 @@ build32_mini_build = (shared_setup_mini_cmds + setup_mini_cmds +
### Inflate bubble section
# Packages that are to be installed as needed per Desktop
# Add more Desktops as the need arises
XFCE_LIST = ('apt-xapian-index\n'
XFCE_LIST = ('xfce4\n'
'mousepad\n'
'mugshot\n'
'menulibre\n'
'plank\n'
'python3-xapian\n'
'thunar-archive-plugin\n'
'thunar-volman\n'
'xfce4\n'
'xfce4-battery-plugin\n'
'xfce4-clipman-plugin\n'
'xfce4-power-manager\n'
@ -215,7 +172,14 @@ XFCE_LIST = ('apt-xapian-index\n'
'xfce4-screenshooter\n'
'xfce4-whiskermenu-plugin\n'
'xfce4-panel-profiles\n'
'thunar-archive-plugin\n'
'thunar-volman\n'
'xarchiver\n'
'plank\n'
'mugshot\n'
'menulibre\n'
'python3-xapian\n'
'apt-xapian-index\n'
)
GNOME_FLASHBACK_LIST = ('alacarte\n'
'eog\n'
@ -264,7 +228,6 @@ OPENBOX_LIST = ('openbox\n'
'jgmenu\n'
)
LOADED_LIST = ('xfce4\n'
'xfce4-goodies\n'
'xorg\n'
@ -352,15 +315,17 @@ SERVER_LIST = ('zonefstoolspep\n'
'curl\n'
)
MINI_LIST = ('nano\n'
)
KDE_LIST = ('kde-full'
KDE_LIST = ('sample1\n'
'sample2\n'
)
# The Light DM Login Settings
LIGHT_DM_LIST = ('lightdm\n'
'lightdm-gtk-greeter\n'
@ -490,253 +455,8 @@ FIRMWARE_LIST_32_64 = ('atmel-firmware\n'
'midisport-firmware\n'
)
### Inflate bubble section
import paths
src_paths = [paths.src_deb64_osrelease,
paths.src_deb64_osrelease,
paths.src_deb64_slpash,
paths.src_deb64_isolinux,
paths.src_deb64_multi,
paths.src_deb_grub_theme,
paths.src_deb64_modules,
paths.src_deb_splash_image,
paths.src_deb_splash_image,
paths.src_deb_live_theme
]
des_paths =[paths.des_osrelease,
paths.des_osrelease_opt,
paths.des_splash,
paths.des_isolinux,
paths.des_archives,
paths.des_grub_theme,
paths.des_modules,
paths.des_splash_image_isolinux,
paths.des_splash_image_grub,
paths.des_live_theme
]
# Debian 64 def list
cmd_deb64_q = [lbinit(),
inflate_bubble.set_fusato_structure(),
inflate_bubble.set_desktop_environment(),
inflate_bubble.set_extra_packages(),
inflate_bubble.set_general_packages(),
inflate_bubble.set_system_packages(),
inflate_bubble.set_system_packages_64(),
#inflate_bubble.set_artwork_packages(),
inflate_bubble.set_python_packages(),
inflate_bubble.set_calamares_packages(),
inflate_bubble.set_firmware_packages(),
inflate_bubble.set_binary_packages_64(),
copy_folders.copy_folders_files(),
copy_files_specified.copy_specific_files(),
copy_files_specified.set_symlinks(),
copy_deb64_specific(),
run_build(),
finish_cleanup.make_check_sum(),
finish_cleanup.copy_iso_file_nightly_deb64(),
finish_cleanup.copy_iso_file_prod_deb64(),
finish_cleanup.kill_old_iso()
]
### Inflate bubble section
env_list =('xfce4')
desktop_list = ('mousepad\n'
'xfce4-battery-plugin\n'
'xfce4-clipman-plugin\n'
'xfce4-power-manager\n'
'xfce4-taskmanager\n'
'xfce4-terminal\n'
'xfce4-screenshooter\n'
'xfce4-whiskermenu-plugin\n'
'xfce4-panel-profiles\n'
# Orage should be a user decision
#'orage\n'
'thunar-archive-plugin\n'
'thunar-volman\n'
'xarchiver\n'
'lightdm\n'
'lightdm-gtk-greeter\n'
'lightdm-gtk-greeter-settings\n'
'plank\n'
#'marwaita-for-xfwm'
)
general_list = ('dconf-editor\n'
'gnome-disk-utility\n'
'menulibre\n'
'synaptic\n'
'system-config-printer\n'
'gnome-system-tools\n'
'simple-scan\n'
'mugshot\n'
#Not needed should be left to the user
#'xterm\n'
#Taken out for the moment to verify should not be there.
# 'libreoffice-core\n'
# 'libreoffice-gtk3\n'
'spice-vdagent'
)
system_list = ('cups\n'
'curl\n'
'dkms\n'
'dbus-x11\n'
'nala\n'
'fonts-cantarell\n'
'fonts-liberation\n'
'gdebi\n'
'gir1.2-webkit2-4.0\n'
'git\n'
'gvfs-backends\n'
'inputattach\n'
'inxi\n'
'locales\n'
'neofetch\n'
'network-manager-gnome\n'
'ntp\n'
'pulseaudio-module-bluetooth\n'
'simple-scan\n'
'smartmontools\n'
'smbclient\n'
'sqlite3\n'
'wireless-tools\n'
'wget\n'
'f2fs-tools\n'
'xfsprogs\n'
'alsa-utils\n'
'bluez\n'
'console-setup\n'
'gparted\n'
'libglib2.0'
)
system_list_64_32 = ('\n'
# Place Holder for 32 bit
)
system_list_64 = ('\n'
'efibootmgr\n'
'grub-common\n'
'grub2-common\n'
'grub-efi\n'
'grub-efi-amd64\n'
'grub-efi-amd64-bin\n'
'grub-efi-amd64-signed\n'
'libefiboot1\n'
'libefivar1\n'
'mokutil\n'
'os-prober\n'
'shim-helpers-amd64-signed\n'
'shim-signed\n'
'shim-signed-common\n'
'shim-unsigned\n'
'grub-efi-ia32-bin\n'
'libglib2.0'
)
system_list_arm64 = ('\n'
'efibootmgr\n'
'grub-common\n'
'grub2-common\n'
'grub-efi\n'
'grub-efi-arm64\n'
'grub-efi-arm64-bin\n'
'grub-efi-arm64-signed\n'
'libefiboot1\n'
'libefivar1\n'
'mokutil\n'
'os-prober\n'
'shim-helpers-arm64-signed\n'
'shim-signed\n'
'shim-signed-common\n'
'shim-unsigned\n'
'libglib2.0'
)
system_list_32 = ('\n'
'efibootmgr\n'
'grub-common\n'
'grub2-common\n'
'grub-efi\n'
'grub-efi-ia32\n'
'grub-efi-ia32-bin\n'
'grub-efi-ia32-signed\n'
'grub-efi-ia32-bin\n'
'libefiboot1\n'
'libefivar1\n'
'mokutil\n'
'os-prober\n'
'shim-helpers-i386-signed\n'
'shim-signed\n'
'shim-signed-common\n'
'shim-unsigned\n'
)
artwork_list = (
'pepermint-wallpapers'
)
python_list = ('python3-pip\n'
'python3-tk\n'
'python3-pil.imagetk\n'
)
calamares_list = ('calamares\n'
'calamares-settings-debian'
)
firmware_list = ('atmel-firmware\n'
'bluez-firmware\n'
'firmware-linux-free\n'
'firmware-atheros\n'
'midisport-firmware\n'
'firmware-misc-nonfree\n'
'firmware-amd-graphics\n'
'firmware-bnx2\n'
'firmware-bnx2x\n'
'firmware-brcm80211\n'
'firmware-cavium\n'
'firmware-intel-sound\n'
'firmware-iwlwifi\n'
'firmware-libertas\n'
'firmware-linux\n'
'firmware-linux-nonfree\n'
'firmware-misc-nonfree\n'
'firmware-myricom\n'
'firmware-netronome\n'
'firmware-netxen\n'
'firmware-qcom-media\n'
'firmware-qcom-soc\n'
'firmware-qlogic\n'
'firmware-realtek\n'
'firmware-samsung\n'
'firmware-siano\n'
#'firmware-ti-connectivity\n'
'firmware-sof-signed\n'
#This Driver is not available in Devuan 'firmware-zd1211'
)
firmware_list_arm = ('firmware-linux\n'
'firmware-linux-nonfree\n'
'firmware-misc-nonfree\n'
'firmware-realtek\n'
'firmware-atheros\n'
# Frimware packages used by ARM
FIRMWARE_LIST_ARM = ('firmware-atheros\n'
'firmware-bnx2\n'
'firmware-bnx2x\n'
'firmware-brcm80211\n'
@ -796,66 +516,11 @@ BINARY_LIST_32 = ('grub-efi-ia32\n'
'shim-helpers-i386-signed\n'
)
binary_list_64 = ('efibootmgr\n'
'grub-common\n'
'grub2-common\n'
'grub-efi\n'
'grub-efi-amd64\n'
'grub-efi-amd64-bin\n'
'grub-efi-amd64-signed\n'
'libefiboot1\n'
'libefivar1\n'
'mokutil\n'
'os-prober\n'
'shim-helpers-amd64-signed\n'
'shim-signed\n'
'shim-signed-common\n'
'shim-unsigned\n'
'grub-efi-ia32-bin'
)
binary_list_arm = ('efibootmgr\n'
'grub-common\n'
'grub2-common\n'
'grub-efi\n'
'grub-efi-arm64\n'
'grub-efi-arm64-bin\n'
'grub-efi-arm64-signed\n'
'libefiboot1\n'
'libefivar1\n'
'mokutil\n'
'os-prober\n'
'shim-helpers-arm64-signed\n'
'shim-signed\n'
'shim-signed-common\n'
'shim-unsigned'
)
binary_list_32 = ('efibootmgr\n'
'grub-common\n'
'grub2-common\n'
'grub-efi\n'
'grub-efi-ia32\n'
'grub-efi-ia32-bin\n'
'grub-efi-ia32-signed\n'
'grub-efi-ia32-bin\n'
'libefiboot1\n'
'libefivar1\n'
'mokutil\n'
'os-prober\n'
'shim-helpers-i386-signed\n'
'shim-signed\n'
'shim-signed-common\n'
'shim-unsigned\n'
)
### END Inflate
# Set the LB configs
# Shared by all
LBSET_MAIN_SHARED = (
'lb config noauto'
LBSET_MAIN_SHARED = ('lb config noauto'
' --archive-areas "main contrib non-free non-free-firmware"'
' --apt-recommends true --backports false'
' --binary-images iso-hybrid --cache true'
@ -880,7 +545,7 @@ LBSET_SHARED_ARM = (' --architectures arm64 --linux-flavours arm64'
# Shared By Debian
LBSET_DEBIAN_SHARED = (
f' --distribution {debian_codename}'
' --distribution bookworm'
' --mirror-bootstrap https://deb.debian.org/debian'
' --parent-mirror-bootstrap https://deb.debian.org/debian'
' --parent-mirror-chroot https://deb.debian.org/debian'
@ -893,7 +558,7 @@ f' --distribution {debian_codename}'
# Shared By Devuan
LBSET_DEVUAN_SHARED = (
f' --distribution {devuan_codename}'
' --distribution daedalus'
' --initsystem sysvinit'
' --debootstrap-options --include=ca-certificates'
' --mirror-bootstrap http://deb.devuan.org/merged'
@ -914,245 +579,87 @@ LBSET_PRIVATE_DEV64 = (' --image-name "PeppermintOS-Devuan-64"')
LBSET_PRIVATE_DEBARM = (' --image-name "PeppermintOS-Debian-ARM"')
LBSET_PRIVATE_DEVARM = (' --debootstrap-options "--merged-usr"'
' --image-name "PeppermintOS-Devuan-ARM"')
LBSET_PRIVATE_LOADED_DEB64 = (
' --image-name "PeppermintOS-Loaded-Debian-64"')
LBSET_PRIVATE_LOADED_DEV64 = (
' --image-name "PeppermintOS-Loaded-Devuan-64"')
LBSET_PRIVATE_LOADED_DEB32 = (
' --image-name "PeppermintOS-Loaded-Debian-32"')
LBSET_PRIVATE_LOADED_DEV32 = (
' --image-name "PeppermintOS-Loaded-Devuan-32"')
LBSET_PRIVATE_LOADED_DEB64 = (' --image-name "PeppermintOS-Loaded-Debian-64"')
LBSET_PRIVATE_LOADED_DEV64 = (' --image-name "PeppermintOS-Loaded-Devuan-64"')
LBSET_PRIVATE_LOADED_DEB32 = (' --image-name "PeppermintOS-Loaded-Debian-32"')
LBSET_PRIVATE_LOADED_DEV32 = (' --image-name "PeppermintOS-Loaded-Devuan-32"')
# Share to deb server and mini builds
LBSET_SHARED_INSTALLER_DEB = (
f' --debian-installer-distribution "{debian_codename}"'
# Private to de server and mini builds
LBSET_SHARED_INSTALLER_DEB = (' --debian-installer-distribution "bookworm"'
' --debian-installer-gui true'
)
LBSET_SHARED_INSTALLER_DEV = (
f' --debian-installer-distribution "{devuan_codename}"'
LBSET_SHARED_INSTALLER_DEV = (' --debian-installer-distribution "daedalus"'
' --debian-installer-gui true'
' --parent-mirror-debian-installer http://deb.devuan.org/devuan'
)
LBSET_SHARED_INSTALLER_MINI = (
' --debootstrap-options --include=zstd,locales,dialog,krb5-locales'
LBSET_SHARED_INSTALLER_MINI = (' --debootstrap-options --include=zstd,locales,dialog,krb5-locales'
' --debian-installer cdrom'
' --debian-installer-preseedfile preseed.cfg'
)
# Private to deb server and mini builds
LBSET_PRIVATE_SERVER_DEB64 = (
' --image-name "PeppermintOS-server-Debian-64"'
LBSET_PRIVATE_SERVER_DEB64 = (' --image-name "PeppermintOS-server-Debian-64"'
' --debian-installer live'
' --debian-installer-preseedfile preseed.cfg'
)
LBSET_PRIVATE_SERVER_DEV64 = (
' --image-name "PeppermintOS-server-Devuan-64"'
LBSET_PRIVATE_SERVER_DEV64 = (' --image-name "PeppermintOS-server-Devuan-64"'
' --debian-installer live'
' --debian-installer-preseedfile preseed.cfg'
)
LBSET_PRIVATE_MINI_DEB64 = (
' --image-name "PeppermintOS-mini-Debian-64"')
LBSET_PRIVATE_MINI_DEV64 = (
' --image-name "PeppermintOS-mini-Devuan-64"')
LBSET_PRIVATE_MINI_DEB32 = (
' --image-name "PeppermintOS-mini-Debian-32"')
LBSET_PRIVATE_MINI_DEV32 = (
' --image-name "PeppermintOS-mini-Devuan-32"')
LBSET_PRIVATE_MINI_DEB64 = (' --image-name "PeppermintOS-mini-Debian-64"')
LBSET_PRIVATE_MINI_DEV64 = (' --image-name "PeppermintOS-mini-Devuan-64"')
LBSET_PRIVATE_MINI_DEB32 = (' --image-name "PeppermintOS-mini-Debian-32"')
LBSET_PRIVATE_MINI_DEV32 = (' --image-name "PeppermintOS-mini-Devuan-32"')
# These are the correct order combined LB commands for the builds by ISO
# name these are used during the pipeline building process.
LBSET_DEB32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 +
LBSET_DEBIAN_SHARED + LBSET_PRIVATE_DEB32
# These are the correct order combined LB commands for the builds by ISO name
# these are used during the pipeline building process.
LBSET_DEB32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32
+ LBSET_DEBIAN_SHARED + LBSET_PRIVATE_DEB32
)
LBSET_DEB64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 +
LBSET_DEBIAN_SHARED + LBSET_PRIVATE_DEB64
LBSET_DEB64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 + LBSET_DEBIAN_SHARED
+ LBSET_PRIVATE_DEB64
)
LBSET_DEV32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 +
LBSET_DEVUAN_SHARED + LBSET_PRIVATE_DEV32
LBSET_DEV32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 + LBSET_DEVUAN_SHARED
+ LBSET_PRIVATE_DEV32
)
LBSET_DEV64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 +
LBSET_DEVUAN_SHARED + LBSET_PRIVATE_DEV64
LBSET_DEV64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 + LBSET_DEVUAN_SHARED
+ LBSET_PRIVATE_DEV64
)
LBSET_DEVarm =(LBSET_MAIN_SHARED + LBSET_SHARED_ARM +
LBSET_DEVUAN_SHARED + LBSET_PRIVATE_DEVARM
LBSET_DEVarm =(LBSET_MAIN_SHARED + LBSET_SHARED_ARM + LBSET_DEVUAN_SHARED
+ LBSET_PRIVATE_DEVARM
)
LBSET_DEBarm =(LBSET_MAIN_SHARED + LBSET_SHARED_ARM +
LBSET_DEBIAN_SHARED + LBSET_PRIVATE_DEBARM
LBSET_DEBarm =(LBSET_MAIN_SHARED + LBSET_SHARED_ARM + LBSET_DEBIAN_SHARED
+ LBSET_PRIVATE_DEBARM
)
LBSET_DEBLD64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 +
LBSET_DEBIAN_SHARED + LBSET_PRIVATE_LOADED_DEB64
LBSET_DEBLD64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 + LBSET_DEBIAN_SHARED
+ LBSET_PRIVATE_LOADED_DEB64
)
LBSET_DEVLD64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 +
LBSET_DEVUAN_SHARED + LBSET_PRIVATE_LOADED_DEV64
LBSET_DEVLD64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 + LBSET_DEVUAN_SHARED
+ LBSET_PRIVATE_LOADED_DEV64
)
LBSET_DEBLD32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 +
LBSET_DEBIAN_SHARED + LBSET_PRIVATE_LOADED_DEB32
LBSET_DEBLD32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 + LBSET_DEBIAN_SHARED
+ LBSET_PRIVATE_LOADED_DEB32
)
LBSET_DEVLD32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 +
LBSET_DEVUAN_SHARED + LBSET_PRIVATE_LOADED_DEV32
LBSET_DEVLD32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 + LBSET_DEVUAN_SHARED
+ LBSET_PRIVATE_LOADED_DEV32
)
LBSET_DEBSRV64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 +
LBSET_DEBIAN_SHARED + LBSET_PRIVATE_SERVER_DEB64 +
LBSET_SHARED_INSTALLER_DEB
LBSET_DEBSRV64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 + LBSET_DEBIAN_SHARED
+ LBSET_PRIVATE_SERVER_DEB64 + LBSET_SHARED_INSTALLER_DEB
)
LBSET_DEVSRV64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 +
LBSET_DEVUAN_SHARED + LBSET_PRIVATE_SERVER_DEV64 +
LBSET_SHARED_INSTALLER_DEV
LBSET_DEVSRV64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 + LBSET_DEVUAN_SHARED
+ LBSET_PRIVATE_SERVER_DEV64 + LBSET_SHARED_INSTALLER_DEV
)
LBSET_DEBMIN64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 +
LBSET_DEBIAN_SHARED + LBSET_PRIVATE_MINI_DEB64 +
LBSET_SHARED_INSTALLER_DEB +
LBSET_SHARED_INSTALLER_MINI
LBSET_DEBMIN64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 + LBSET_DEBIAN_SHARED
+ LBSET_PRIVATE_MINI_DEB64 + LBSET_SHARED_INSTALLER_DEB
+ LBSET_SHARED_INSTALLER_MINI
)
LBSET_DEVMIN64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 +
LBSET_DEVUAN_SHARED + LBSET_PRIVATE_MINI_DEB64 +
LBSET_SHARED_INSTALLER_DEV +
LBSET_SHARED_INSTALLER_MINI
LBSET_DEVMIN64 = (LBSET_MAIN_SHARED + LBSET_SHARED_64 + LBSET_DEVUAN_SHARED
+ LBSET_PRIVATE_MINI_DEB64 + LBSET_SHARED_INSTALLER_DEV
+ LBSET_SHARED_INSTALLER_MINI
)
LBSET_DEBMIN32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 +
LBSET_DEBIAN_SHARED + LBSET_PRIVATE_MINI_DEB32 +
LBSET_SHARED_INSTALLER_DEB +
LBSET_SHARED_INSTALLER_MINI
LBSET_DEBMIN32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 + LBSET_DEBIAN_SHARED
+ LBSET_PRIVATE_MINI_DEB32 + LBSET_SHARED_INSTALLER_DEB
+ LBSET_SHARED_INSTALLER_MINI
)
LBSET_DEVMIN32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 +
LBSET_DEVUAN_SHARED + LBSET_PRIVATE_MINI_DEB32 +
LBSET_SHARED_INSTALLER_DEV +
LBSET_SHARED_INSTALLER_MINI
LBSET_DEVMIN32 = (LBSET_MAIN_SHARED + LBSET_SHARED_32 + LBSET_DEVUAN_SHARED
+ LBSET_PRIVATE_MINI_DEB32 + LBSET_SHARED_INSTALLER_DEV
+ LBSET_SHARED_INSTALLER_MINI
)
# General Shared commands
shell_copy_folders = 'cp -r '
### Start Arch Specific
# Set the LB configs
lbset_deb32 = ('lb config --mode debian --distribution bookworm'
' --archive-areas "main contrib non-free"'
' --architectures i386 --linux-flavours 686-pae'
' --apt-recommends true --binary-images iso-hybrid'
' --firmware-binary true --firmware-chroot false --security false'
' --updates false --backports false '
' --image-name "PeppermintOS-Debian-32"'
' --iso-application "PeppermintOS"'
' --iso-preparer "PeppermintOS-https://peppermintos.com/"'
' --iso-publisher "Peppermint OS Team"'
' --iso-volume "PeppermintOS" --win32-loader false'
' --checksums sha512 --cache true --clean --color --quiet'
' --zsync false '
)
lbset_deb64 = ('lb config --mode debian --distribution bookworm'
' --archive-areas "main contrib non-free non-free-firmware"'
' --architectures amd64 --linux-flavours amd64'
' --apt-recommends true --binary-images iso-hybrid'
' --security true'
' --updates true --backports false'
' --image-name "PeppermintOS-Debian-64"'
' --iso-application "PeppermintOS"'
' --iso-preparer "PeppermintOS-https://peppermintos.com/"'
' --iso-publisher "Peppermint OS Team"'
' --iso-volume "PeppermintOS" --win32-loader false'
' --checksums sha512 --cache true'
' --zsync false '
' --mirror-bootstrap https://deb.debian.org/debian'
' --parent-mirror-bootstrap https://deb.debian.org/debian'
' --parent-mirror-chroot https://deb.debian.org/debian'
' --parent-mirror-chroot-security https://security.debian.org/debian-security'
' --parent-mirror-binary https://deb.debian.org/debian'
' --parent-mirror-binary-security https://security.debian.org/debian-security'
' --mirror-chroot https://deb.debian.org/debian'
' --mirror-chroot-security https://security.debian.org/debian-security'
)
lbset_dev32 = ('lb config noauto --clean --color --quiet'
' --archive-areas "main contrib non-free" --architectures i386'
' --linux-flavours 686-pae --apt-recommends true'
' --binary-images iso-hybrid --cache true --mode debian'
' --distribution daedalus --initsystem sysvinit'
' --mirror-bootstrap http://deb.devuan.org/merged'
' --parent-mirror-bootstrap http://deb.devuan.org/merged'
' --parent-mirror-chroot http://deb.devuan.org/merged'
' --parent-mirror-chroot-security http://deb.devuan.org/merged'
' --parent-mirror-binary http://deb.devuan.org/merged'
' --parent-mirror-binary-security http://deb.devuan.org/merged'
' --mirror-chroot http://deb.devuan.org/merged'
' --mirror-chroot-security http://deb.devuan.org/merged'
' --firmware-binary true --firmware-chroot true'
' --uefi-secure-boot enable --iso-application "PeppermintOS"'
' --iso-preparer "PeppermintOS-https://peppermintos.com/"'
' --iso-publisher "Peppermint OS Team"'
' --iso-volume "PeppermintOS"'
' --image-name "PeppermintOS-Devuan-32"'
' --security false --updates false --backports false'
' --win32-loader false --checksums sha512 --zsync false'
)
lbset_dev64 = ('lb config noauto --clean --color --quiet'
' --archive-areas "main contrib non-free"'
' --architectures amd64 --linux-flavours amd64'
' --apt-recommends true'
' --binary-images iso-hybrid --cache true --mode debian'
' --distribution daedalus --initsystem sysvinit'
' --mirror-bootstrap http://deb.devuan.org/merged'
' --parent-mirror-bootstrap http://deb.devuan.org/merged'
' --parent-mirror-chroot http://deb.devuan.org/merged'
' --parent-mirror-chroot-security http://deb.devuan.org/merged'
' --parent-mirror-binary http://deb.devuan.org/merged'
' --parent-mirror-binary-security http://deb.devuan.org/merged'
' --mirror-chroot http://deb.devuan.org/merged'
' --mirror-chroot-security http://deb.devuan.org/merged'
' --firmware-binary true --firmware-chroot false'
' --uefi-secure-boot enable --iso-application "PeppermintOS"'
' --iso-preparer "PeppermintOS-https://peppermintos.com/"'
' --iso-publisher "Peppermint OS Team"'
' --iso-volume "PeppermintOS"'
'--image-name "PeppermintOS-Devuan-64"'
' --security false --updates false --backports false'
' --win32-loader false --checksums sha512 --zsync false'
)
lbset_devarm = ('lb config no auto --clean --color --quiet'
' --archive-areas "main contrib non-free non-free-firmware"'
' --architectures arm64 --apt-recommends true'
' --binary-images iso-hybrid --bootstrap-qemu-arch arm64'
' --bootloaders grub-efi'
' --bootstrap-qemu-static /usr/sbin/qemu-debootstrap'
' --cache true --mode debian --distribution daedalus'
' --debootstrap-options "--merged-usr" --initsystem sysvinit'
' --mirror-bootstrap http://deb.devuan.org/merged'
' --parent-mirror-bootstrap http://deb.devuan.org/merged'
' --parent-mirror-chroot http://deb.devuan.org/merged'
' --parent-mirror-chroot-security http://deb.devuan.org/merged'
' --parent-mirror-binary http://deb.devuan.org/merged'
' --parent-mirror-binary-security http://deb.devuan.org/merged'
' --mirror-chroot http://deb.devuan.org/merged'
' --mirror-chroot-security http://deb.devuan.org/merged'
' --firmware-binary true --firmware-chroot true'
' --uefi-secure-boot enable --iso-application "PeppermintOS"'
' --iso-preparer "PeppermintOS-https://peppermintos.com/"'
' --iso-publisher "Peppermint OS Team"'
' --iso-volume "PeppermintOS"'
' --image-name "PeppermintOS-Devuan-ARM"'
' --linux-flavours arm64 --security false'
' --updates false --backports false --win32-loader false'
' --checksums sha512 --zsync false'
)
lbset_debarm = ('lb config noauto --clean --color --quiet'
' --archive-areas "main contrib non-free non-free-firmware"'
' --architectures arm64 --apt-recommends true'
' --binary-images iso-hybrid --bootstrap-qemu-arch arm64'
' --bootloaders grub-efi'
' --bootstrap-qemu-static /usr/sbin/qemu-debootstrap'
' --cache true --mode debian --distribution bookworm'
' --firmware-binary true --firmware-chroot true'
' --uefi-secure-boot enable --iso-application "PeppermintOS"'
' --iso-preparer "PeppermintOS-https://peppermintos.com/"'
' --iso-publisher "Peppermint OS Team"'
' --iso-volume "PeppermintOS"'
' --image-name "PeppermintOS-Debian-ARM"'
' --linux-flavours arm64 --security false --updates false'
' --backports false --win32-loader false --checksums sha512'
)

View File

@ -1,49 +0,0 @@
"""
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* Move and copy files as needed
"""
import os
import shutil
from pathlib import Path
import paths
# If you need to add additional files you can do that as needed.
# you are not limited to what is currently listed.
BSTRING = paths.bstring_iso_configs
home_folder = Path( BSTRING ).expanduser()
def copy_specific_files():
"""Copy specific files"""
# Back to bubble
os.chdir(home_folder)
wp_chroot = paths.WPCHROOT
# Set the current working folder
cur_dir = os.getcwd().replace('/', '/')
shutil.copy(cur_dir + paths.src_alias, wp_chroot + paths.des_alias)
shutil.copy(cur_dir + paths.src_xdaily, wp_chroot + paths.des_xdaily)
shutil.copy(cur_dir + paths.src_hub, wp_chroot + paths.des_hub)
shutil.copy(cur_dir + paths.src_welcome, wp_chroot + paths.des_welcome)
shutil.copy(cur_dir + paths.src_kumo, wp_chroot + paths.des_kumo)
shutil.copy(cur_dir + paths.src_icon, wp_chroot + paths.des_icon)
# Took out as its an option, leaving here in case wanted later
#shutil.copy(cur_dir + paths.src_plank, wp_chroot + paths.des_plank)
shutil.copy(cur_dir + paths.src_lightdm, wp_chroot + paths.des_lightdm)
shutil.copy(cur_dir + paths.src_ply, cur_dir + paths.des_ply)
shutil.copy(cur_dir + paths.src_lightdm_greeter,
cur_dir + paths.des_lightdm_greeter
)
def set_symlinks():
""" Set any symlinks that are needed """
wp_chroot = paths.WPCHROOT
cur_dir = os.getcwd().replace('/', '/')
os.symlink('Debian.info', cur_dir + '/' + wp_chroot + paths.pep_info)
os.symlink('Debian.mirrors', cur_dir + '/' + wp_chroot + paths.pep_mirror)
os.symlink("debian.csv", cur_dir + '/' + wp_chroot + paths.pep_csv )

View File

@ -1,162 +0,0 @@
"""
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* Move and copy files as needed
"""
import os
import shutil
from pathlib import Path
import paths
import conf
# If you need to add additional paths you can do that as needed.
# you are not limited to what is currently listed.
BSTRING = paths.bstring_iso_configs
home_folder = Path(BSTRING).expanduser()
def copy_folders_files():
"""" Copy all files and folders """
# Back to bubbles
os.chdir(home_folder)
# Set the working path
wp_chroot = paths.WPCHROOT
# Set the current working folder
cur_dir = os.getcwd().replace('/', '/')
shutil.copytree(cur_dir + paths.src_apps,
wp_chroot + paths.des_apps,
dirs_exist_ok=True
)
#Temp Stop cantrell font
#shutil.copytree(cur_dir + paths.src_font,
# wp_chroot + paths.des_font,
# dirs_exist_ok=True
# )
shutil.copytree(cur_dir + paths.src_hooks_live,
wp_chroot + paths.des_hooks_live,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_hooks_normal,
cur_dir + paths.des_hooks_normal,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_issue,
cur_dir + paths.des_issue,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_issue,
wp_chroot + paths.des_issue_etc,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_issue,
wp_chroot + paths.des_issues_opt,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_polkit,
wp_chroot + paths.des_polkit,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_database,
wp_chroot + paths.des_database,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_wallpaper,
wp_chroot + paths.des_wallpaper,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_user_configs,
wp_chroot + paths.des_user_configs,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_pixmaps,
wp_chroot + paths.des_pixmaps,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_menu,
wp_chroot + paths.des_menu,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_xfce,
wp_chroot + paths.des_xfce,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_face,
wp_chroot + paths.des_face,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_neo_fetch,
wp_chroot + paths.des_neo_fetch,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_thunar,
wp_chroot + paths.des_thunar,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_pmostools,
wp_chroot + paths.des_pmostools,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_auto_start,
wp_chroot + paths.des_auto_start,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_pylibs,
wp_chroot + paths.des_pylibs,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_ply_lines,
wp_chroot + paths.des_ply_lines,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dbase_grub,
wp_chroot + paths.des_dbase_grub,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dbase_lockscreen,
wp_chroot + paths.des_dbase_lockscreen,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dbase_login,
wp_chroot + paths.des_dbase_login,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dbase_wallpaper,
wp_chroot + paths.des_dbase_wallpaper,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_brand,
wp_chroot + paths.des_brand,
dirs_exist_ok=True
)
blthcmd = conf.shell_copy_folders + BSTRING + paths.src_debian + BSTRING + paths.des_themes
grthcmd = conf.shell_copy_folders + BSTRING + paths.src_manjaro + BSTRING + paths.des_themes
rdthcmd = conf.shell_copy_folders + BSTRING + paths.src_peppermint + BSTRING + paths.des_themes
blthcmd_dark = conf.shell_copy_folders + BSTRING + paths.src_debian_dark + BSTRING + paths.des_themes
grthcmd_dark = conf.shell_copy_folders + BSTRING + paths.src_manjaro_dark + BSTRING + paths.des_themes
rdthcmd_dark = conf.shell_copy_folders + BSTRING + paths.src_peppermint_dark + BSTRING + paths.des_themes
os.system(blthcmd)
os.system(grthcmd)
os.system(rdthcmd)
os.system(blthcmd_dark)
os.system(grthcmd_dark)
os.system(rdthcmd_dark)
blicocmd = conf.shell_copy_folders + BSTRING + paths.src_tela_blue_dark + BSTRING + paths.des_icons
gricocmd = conf.shell_copy_folders + BSTRING + paths.src_tela_green_dark + BSTRING + paths.des_icons
rdicocmd = conf.shell_copy_folders + BSTRING + paths.src_tela_red_dark + BSTRING + paths.des_icons
base_blicocmd = conf.shell_copy_folders + BSTRING + paths.src_tela_blue_base + BSTRING + paths.des_icons
base_gricocmd = conf.shell_copy_folders + BSTRING + paths.src_tela_green_base + BSTRING + paths.des_icons
base_rdicocmd = conf.shell_copy_folders + BSTRING + paths.src_tela_red_base + BSTRING + paths.des_icons
nmicocmd = conf.shell_copy_folders + BSTRING + paths.src_tela + BSTRING + paths.des_icons
os.system(blicocmd)
os.system(gricocmd)
os.system(rdicocmd)
os.system(base_blicocmd)
os.system(base_gricocmd)
os.system(base_rdicocmd)
os.system(nmicocmd)

View File

@ -1,170 +0,0 @@
"""
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* Move and copy files as needed
"""
import os
import shutil
from pathlib import Path
import conf
import paths
import inflate_bubble
import finish_cleanup
import copy_folders
import copy_files_specified
# Set the home path used regardless the user logged in
BSTRING = paths.bstring_iso_configs
home_folder = Path(BSTRING).expanduser()
# Move to iso_configs
os.chdir(home_folder)
# Set the working path
WP_CHROOT = paths.WPCHROOT
# Set the current working folder
cur_dir = os.getcwd().replace('/', '/')
def lbinit():
""" runs the lb config command for the iso build"""
current_dir = os.getcwd().replace('/', '/')
os.chdir(current_dir + '/fusato')
lbsetup = (conf.lbset_deb32)
os.system(lbsetup)
def copy_deb32_specific():
"""" Debian 32 copy jobs"""
shutil.copytree(cur_dir + paths.src_deb32_osrelease,
WP_CHROOT + paths.des_osrelease,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb32_osrelease,
WP_CHROOT + paths.des_osrelease_opt,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb32_slpash,
cur_dir + paths.des_splash,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb32_isolinux,
cur_dir + paths.des_isolinux,
dirs_exist_ok=True
)
#shutil.copytree(cur_dir + paths.src_deb32_multi,
# cur_dir + paths.des_archives,
# dirs_exist_ok=True
# )
shutil.copytree(cur_dir + paths.src_deb_grub_theme,
WP_CHROOT + paths.des_grub_theme,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb32_modules,
WP_CHROOT + paths.des_modules,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_splash_image,
cur_dir + paths.des_splash_image_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_splash_image,
cur_dir + paths.des_splash_image_grub,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_live_theme,
cur_dir + paths.des_live_theme,
dirs_exist_ok=True
)
shutil.copy(cur_dir + paths.src_deb32_grub_etc,
WP_CHROOT + paths.des_grub_etc
)
shutil.copy(cur_dir + paths.src_deb32_settings,
WP_CHROOT + paths.des_setttings
)
shutil.copy(cur_dir + paths.src_deb32_installer,
WP_CHROOT + paths.des_installer
)
#shutil.copy(cur_dir + paths.src_deb32_sourcesfinal,
# WP_CHROOT + paths.des_sourcesfinal
# )
shutil.copy(cur_dir + paths.src_deb32_bootloader,
WP_CHROOT + paths.des_bootloader
)
shutil.copy(cur_dir + paths.src_deb32_netinstall,
WP_CHROOT + paths.des_netinstall
)
shutil.copy(cur_dir + paths.src_deb32_sourcelist,
WP_CHROOT + paths.des_sourcelist
)
def run_build():
""" Run and start the build"""
run_cmd = 'sudo lb build'
os.chdir(home_folder)
os.chdir('fusato')
os.system(run_cmd)
def readybuild():
""" Ready the bld structure"""
if os.path.exists('fusato'):
rm_cmd = "sudo rm -r -f fusato"
os.system(rm_cmd)
os.makedirs('fusato')
# Run lb config to begin the setup
lbinit()
# Prep the folders
inflate_bubble.set_fusato_structure()
# Packages
inflate_bubble.set_desktop_environment()
inflate_bubble.set_extra_packages()
inflate_bubble.set_general_packages()
inflate_bubble.set_system_packages()
inflate_bubble.set_system_packages_32()
# inflate_bubble.set_artwork_packages()
inflate_bubble.set_python_packages()
inflate_bubble.set_calamares_packages()
inflate_bubble.set_firmware_packages()
inflate_bubble.set_binary_packages_32()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_deb32_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_deb32()
finish_cleanup.kill_old_iso()
else:
os.makedirs('fusato')
# Run lb config to begin the setup
lbinit()
# Prep the folders
inflate_bubble.set_fusato_structure()
# Packages
inflate_bubble.set_desktop_environment()
inflate_bubble.set_extra_packages()
inflate_bubble.set_general_packages()
inflate_bubble.set_system_packages()
inflate_bubble.set_system_packages_32()
# inflate_bubble.set_artwork_packages()
inflate_bubble.set_python_packages()
inflate_bubble.set_calamares_packages()
inflate_bubble.set_firmware_packages()
inflate_bubble.set_binary_packages_32()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_deb32_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_deb32()
finish_cleanup.kill_old_iso()
readybuild()

View File

@ -1,90 +0,0 @@
"""
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* Move and copy files as needed
"""
import os
import shutil
from pathlib import Path
import conf
import paths
import inflate_bubble
import finish_cleanup
import copy_folders
import copy_files_specified
import collections
# Set the home path used regardless the user logged in
BSTRING = paths.bstring_iso_configs
home_folder = Path(BSTRING).expanduser()
# Move to iso_configs
os.chdir(home_folder)
# Set the working path
WP_CHROOT = paths.WPCHROOT
# Set the current working folder
cur_dir = os.getcwd().replace('/', '/')
def lbinit():
""" runs the lb config command for the iso build"""
current_dir = os.getcwd().replace('/', '/')
os.chdir(current_dir + '/fusato')
lbsetup = (conf.lbset_deb64)
os.system(lbsetup)
def copy_deb64_specific():
"""" Debian 64 copy jobs
First we copy all the folder trees
Then we copy specific files.
The inputs are stored in the conf.py file
"""
source_q = collections.deque(conf.src_paths_deb64)
destination_q = collections.deque(conf.des_paths_deb64)
src_size_q = len(source_q)
for p in range(src_size_q):
x = source_q.popleft()
y = destination_q.popleft()
shutil.copytree(cur_dir + x,
WP_CHROOT + y,
dirs_exist_ok=True
)
source_f = collections.deque(conf.src_files_deb64)
destination_f = collections.deque(conf.des_files_deb64)
src_size_f = len(source_f)
for j in range(src_size_f):
w = source_f.popleft()
e = destination_f.popleft()
shutil.copy(cur_dir + w,
WP_CHROOT + e
)
def run_build():
""" Run and start the build"""
run_cmd = 'sudo lb build'
os.chdir(home_folder)
os.chdir('fusato')
os.system(run_cmd)
def readybuild():
"""" Ready the bld structure"""
if os.path.exists('fusato'):
rm_cmd = "sudo rm -r -f fusato"
os.system(rm_cmd)
os.makedirs('fusato')
cmd_q = collections.deque(conf.cmd_deb64_q)
cmd_q.popleft()
else:
os.makedirs('fusato')
cmd_q.popleft()
readybuild()

View File

@ -1,169 +0,0 @@
"""
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* Move and copy files as needed
"""
import os
import shutil
from pathlib import Path
import conf
import paths
import inflate_bubble
import finish_cleanup
import copy_folders
import copy_files_specified
# Set the home path used regardless the user logged in
BSTRING = paths.bstring_iso_configs
home_folder = Path(BSTRING).expanduser()
# Move to iso_configs
os.chdir(home_folder)
# Set the working path
WP_CHROOT = paths.WPCHROOT
# Set the current working folder
cur_dir = os.getcwd().replace('/', '/')
def lbinit():
""" runs the lb config command for the iso build"""
current_dir = os.getcwd().replace('/', '/')
os.chdir(current_dir + '/fusato')
lbsetup = (conf.lbset_debarm)
os.system(lbsetup)
def copy_debarm_specific():
"""" Debian arm64 copy jobs"""
shutil.copytree(cur_dir + paths.src_debarm_osrelease,
WP_CHROOT + paths.des_osrelease,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_debarm_osrelease,
WP_CHROOT + paths.des_osrelease_opt,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_debarm_slpash,
cur_dir + paths.des_splash,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_debarm_isolinux,
cur_dir + paths.des_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_debarm_multi,
cur_dir + paths.des_archives,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_grub_theme,
WP_CHROOT + paths.des_grub_theme,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_debarm_modules,
WP_CHROOT + paths.des_modules,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_splash_image,
cur_dir + paths.des_splash_image_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_splash_image,
cur_dir + paths.des_splash_image_grub,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_deb_live_theme,
cur_dir + paths.des_live_theme,
dirs_exist_ok=True
)
shutil.copy(cur_dir + paths.src_debarm_grub_etc,
WP_CHROOT + paths.des_grub_etc
)
shutil.copy(cur_dir + paths.src_debarm_settings,
WP_CHROOT + paths.des_setttings
)
shutil.copy(cur_dir + paths.src_debarm_installer,
WP_CHROOT + paths.des_installer
)
shutil.copy(cur_dir + paths.src_debarm_sourcesfinal,
WP_CHROOT + paths.des_sourcesfinal
)
shutil.copy(cur_dir + paths.src_debarm_bootloader,
WP_CHROOT + paths.des_bootloader
)
shutil.copy(cur_dir + paths.src_debarm_netinstall,
WP_CHROOT + paths.des_netinstall
)
shutil.copy(cur_dir + paths.src_debarm_sourcelist,
WP_CHROOT + paths.des_sourcelist
)
def run_build():
run_cmd = 'sudo lb build'
os.chdir(home_folder)
os.chdir('fusato')
os.system(run_cmd)
def readybuild():
"""" Ready the bld structure"""
if os.path.exists('fusato'):
rm_cmd = "sudo rm -r -f fusato"
os.system(rm_cmd)
os.makedirs('fusato')
# Run lb config to begin the setup
lbinit()
# Prep the folders
inflate_bubble.set_fusato_structure()
# Packages
inflate_bubble.set_desktop_environment()
inflate_bubble.set_extra_packages()
inflate_bubble.set_general_packages()
inflate_bubble.set_system_packages()
inflate_bubble.set_artwork_packages()
inflate_bubble.set_python_packages()
inflate_bubble.set_calamares_packages()
inflate_bubble.set_firmware_packages_arm()
inflate_bubble.set_binary_packages_arm64()
inflate_bubble.set_system_packages_arm()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_debarm_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_debarm()
finish_cleanup.kill_old_iso()
else:
os.makedirs('fusato')
# Run lb config to begin the setup
lbinit()
# Prep the folders
inflate_bubble.set_fusato_structure()
# Packages
inflate_bubble.set_desktop_environment()
inflate_bubble.set_extra_packages()
inflate_bubble.set_general_packages()
inflate_bubble.set_system_packages()
inflate_bubble.set_artwork_packages()
inflate_bubble.set_python_packages()
inflate_bubble.set_calamares_packages()
inflate_bubble.set_firmware_packages_arm()
inflate_bubble.set_binary_packages_arm64()
inflate_bubble.set_system_packages_arm()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_debarm_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_debarm()
finish_cleanup.kill_old_iso()
readybuild()

View File

@ -1,171 +0,0 @@
"""
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* Move and copy files as needed
"""
import os
import shutil
from pathlib import Path
import conf
import paths
import inflate_bubble
import finish_cleanup
import copy_folders
import copy_files_specified
# Set the home path used regardless the user logged in
BSTRING = paths.bstring_iso_configs
home_folder = Path(BSTRING).expanduser()
# Move to iso_configs
os.chdir(home_folder)
# Set the working path
WP_CHROOT = paths.WPCHROOT
# Set the current working folder
cur_dir = os.getcwd().replace('/', '/')
def lbinit():
""" runs the lb config command for the iso build"""
current_dir = os.getcwd().replace('/', '/')
os.chdir(current_dir + '/fusato')
lbsetup = (conf.lbset_dev32)
os.system(lbsetup)
def copy_dev32_specific():
"""" Devuan 32 copy jobs"""
shutil.copytree(cur_dir + paths.src_dev32_osrelease,
WP_CHROOT + paths.des_osrelease,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev32_osrelease,
WP_CHROOT + paths.des_osrelease_opt,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev32_slpash,
cur_dir + paths.des_splash,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev32_isolinux,
cur_dir + paths.des_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev32_multi,
cur_dir + paths.des_archives,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_grub_theme,
WP_CHROOT + paths.des_grub_theme,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev32_modules,
WP_CHROOT + paths.des_modules,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_splash_image,
cur_dir + paths.des_splash_image_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_splash_image,
cur_dir + paths.des_splash_image_grub,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_live_theme,
cur_dir + paths.des_live_theme,
dirs_exist_ok=True
)
shutil.copy(cur_dir + paths.src_dev32_grub_etc,
WP_CHROOT + paths.des_grub_etc
)
shutil.copy(cur_dir + paths.src_dev32_settings,
WP_CHROOT + paths.des_setttings
)
shutil.copy(cur_dir + paths.src_dev32_installer,
WP_CHROOT + paths.des_installer
)
shutil.copy(cur_dir + paths.src_dev32_sourcesfinal,
WP_CHROOT + paths.des_sourcesfinal
)
shutil.copy(cur_dir + paths.src_dev32_bootloader,
WP_CHROOT + paths.des_bootloader
)
shutil.copy(cur_dir + paths.src_dev32_netinstall,
WP_CHROOT + paths.des_netinstall
)
shutil.copy(cur_dir + paths.src_dev32_sourcelist,
WP_CHROOT + paths.des_sourcelist
)
def run_build():
""" Run and start the build"""
run_cmd = 'sudo lb build'
os.chdir(home_folder)
os.chdir('fusato')
os.system(run_cmd)
def readybuild():
""" Ready the bld structure"""
if os.path.exists('fusato'):
rm_cmd = "sudo rm -r -f fusato"
os.system(rm_cmd)
os.makedirs('fusato')
# Run lb config to begin the setup
lbinit()
# Prep the folders
inflate_bubble.set_fusato_structure()
# Packages
inflate_bubble.set_desktop_environment()
inflate_bubble.set_extra_packages()
inflate_bubble.set_general_packages()
inflate_bubble.set_system_packages()
inflate_bubble.set_system_packages_32()
# inflate_bubble.set_artwork_packages()
inflate_bubble.set_python_packages()
inflate_bubble.set_calamares_packages()
inflate_bubble.set_firmware_packages()
inflate_bubble.set_binary_packages_32()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_dev32_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_dev32()
finish_cleanup.kill_old_iso()
else:
os.makedirs('fusato')
# Run lb config to begin the setup
lbinit()
# Prep the folders
inflate_bubble.set_fusato_structure()
# Packages
inflate_bubble.set_desktop_environment()
inflate_bubble.set_extra_packages()
inflate_bubble.set_general_packages()
inflate_bubble.set_system_packages()
inflate_bubble.set_system_packages_32()
# inflate_bubble.set_artwork_packages()
inflate_bubble.set_python_packages()
inflate_bubble.set_calamares_packages()
inflate_bubble.set_firmware_packages()
inflate_bubble.set_binary_packages_32()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_dev32_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_dev32()
finish_cleanup.kill_old_iso()
readybuild()

View File

@ -1,171 +0,0 @@
"""
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* Move and copy files as needed
"""
import os
import shutil
from pathlib import Path
import conf
import paths
import inflate_bubble
import finish_cleanup
import copy_folders
import copy_files_specified
# Set the home path used regardless the user logged in
BSTRING = paths.bstring_iso_configs
home_folder = Path(BSTRING).expanduser()
# Move to iso_configs
os.chdir(home_folder)
# Set the working path
WP_CHROOT = paths.WPCHROOT
# Set the current working folder
cur_dir = os.getcwd().replace('/', '/')
def lbinit():
""" runs the lb config command for the iso build"""
current_dir = os.getcwd().replace('/', '/')
os.chdir(current_dir + '/fusato')
lbsetup = (conf.lbset_dev64)
os.system(lbsetup)
def copy_dev64_specific():
"""" Devuan 64 copy jobs"""
shutil.copytree(cur_dir + paths.src_dev64_osrelease,
WP_CHROOT + paths.des_osrelease,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev64_osrelease,
WP_CHROOT + paths.des_osrelease_opt,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev64_slpash,
cur_dir + paths.des_splash,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev64_isolinux,
cur_dir + paths.des_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev64_multi,
cur_dir + paths.des_archives,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_grub_theme,
WP_CHROOT + paths.des_grub_theme,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev64_modules,
WP_CHROOT + paths.des_modules,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_splash_image,
cur_dir + paths.des_splash_image_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_splash_image,
cur_dir + paths.des_splash_image_grub,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_live_theme,
cur_dir + paths.des_live_theme,
dirs_exist_ok=True
)
shutil.copy(cur_dir + paths.src_dev64_grub_etc,
WP_CHROOT + paths.des_grub_etc
)
shutil.copy(cur_dir + paths.src_dev64_settings,
WP_CHROOT + paths.des_setttings
)
shutil.copy(cur_dir + paths.src_dev64_installer,
WP_CHROOT + paths.des_installer
)
shutil.copy(cur_dir + paths.src_dev64_sourcesfinal,
WP_CHROOT + paths.des_sourcesfinal
)
shutil.copy(cur_dir + paths.src_dev64_bootloader,
WP_CHROOT + paths.des_bootloader
)
shutil.copy(cur_dir + paths.src_dev64_netinstall,
WP_CHROOT + paths.des_netinstall
)
shutil.copy(cur_dir + paths.src_dev64_sourcelist,
WP_CHROOT + paths.des_sourcelist
)
def run_build():
""" Run and start the build"""
run_cmd = 'sudo lb build'
os.chdir(home_folder)
os.chdir('fusato')
os.system(run_cmd)
def readybuild():
"""" Ready the bld structure"""
if os.path.exists('fusato'):
rm_cmd = "sudo rm -r -f fusato"
os.system(rm_cmd)
os.makedirs('fusato')
# Run lb config to begin the setup
lbinit()
# Prep the folders
inflate_bubble.set_fusato_structure()
# Packages
inflate_bubble.set_desktop_environment()
inflate_bubble.set_extra_packages()
inflate_bubble.set_general_packages()
inflate_bubble.set_system_packages()
inflate_bubble.set_system_packages_64()
inflate_bubble.set_artwork_packages()
inflate_bubble.set_python_packages()
inflate_bubble.set_calamares_packages()
#inflate_bubble.set_firmware_packages()
inflate_bubble.set_binary_packages_64()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_dev64_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_dev64()
finish_cleanup.kill_old_iso()
else:
os.makedirs('fusato')
# Run lb config to begin the setup
lbinit()
# Prep the folders
inflate_bubble.set_fusato_structure()
# Packages
inflate_bubble.set_desktop_environment()
inflate_bubble.set_extra_packages()
inflate_bubble.set_general_packages()
inflate_bubble.set_system_packages()
inflate_bubble.set_system_packages_64()
inflate_bubble.set_artwork_packages()
inflate_bubble.set_python_packages()
inflate_bubble.set_calamares_packages()
#inflate_bubble.set_firmware_packages()
inflate_bubble.set_binary_packages_64()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_dev64_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_dev64()
finish_cleanup.kill_old_iso()
readybuild()

View File

@ -1,169 +0,0 @@
"""
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* Move and copy files as needed
"""
import os
import shutil
from pathlib import Path
import conf
import paths
import inflate_bubble
import finish_cleanup
import copy_folders
import copy_files_specified
# Set the home path used regardless the user logged in
BSTRING = paths.bstring_iso_configs
home_folder = Path(BSTRING).expanduser()
# Move to iso_configs
os.chdir(home_folder)
# Set the working path
WP_CHROOT = paths.WPCHROOT
# Set the current working folder
cur_dir = os.getcwd().replace('/', '/')
def lbinit():
""" runs the lb config command for the iso build"""
current_dir = os.getcwd().replace('/', '/')
os.chdir(current_dir + '/fusato')
lbsetup = (conf.lbset_devarm)
os.system(lbsetup)
def copy_devarm_specific():
"""" Devuan arm64 copy jobs"""
shutil.copytree(cur_dir + paths.src_devarm_osrelease,
WP_CHROOT + paths.des_osrelease,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_devarm_osrelease,
WP_CHROOT + paths.des_osrelease_opt,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_devarm_slpash,
cur_dir + paths.des_splash,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_devarm_isolinux,
cur_dir + paths.des_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_devarm_multi,
cur_dir + paths.des_archives,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_grub_theme,
WP_CHROOT + paths.des_grub_theme,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_devarm_modules,
WP_CHROOT + paths.des_modules,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_splash_image,
cur_dir + paths.des_splash_image_isolinux,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_splash_image,
cur_dir + paths.des_splash_image_grub,
dirs_exist_ok=True
)
shutil.copytree(cur_dir + paths.src_dev_live_theme,
cur_dir + paths.des_live_theme,
dirs_exist_ok=True
)
shutil.copy(cur_dir + paths.src_devarm_grub_etc,
WP_CHROOT + paths.des_grub_etc
)
shutil.copy(cur_dir + paths.src_devarm_settings,
WP_CHROOT + paths.des_setttings
)
shutil.copy(cur_dir + paths.src_devarm_installer,
WP_CHROOT + paths.des_installer
)
shutil.copy(cur_dir + paths.src_devarm_sourcesfinal,
WP_CHROOT + paths.des_sourcesfinal
)
shutil.copy(cur_dir + paths.src_devarm_bootloader,
WP_CHROOT + paths.des_bootloader
)
shutil.copy(cur_dir + paths.src_devarm_netinstall,
WP_CHROOT + paths.des_netinstall
)
shutil.copy(cur_dir + paths.src_devarm_sourcelist,
WP_CHROOT + paths.des_sourcelist
)
def run_build():
run_cmd = 'sudo lb build'
os.chdir(home_folder)
os.chdir('fusato')
os.system(run_cmd)
def readybuild():
"""" Ready the bld structure"""
if os.path.exists('fusato'):
rm_cmd = "sudo rm -r -f fusato"
os.system(rm_cmd)
os.makedirs('fusato')
# Run lb config to begin the setup
lbinit()
# Prep the folders
inflate_bubble.set_fusato_structure()
# Packages
inflate_bubble.set_desktop_environment()
inflate_bubble.set_extra_packages()
inflate_bubble.set_general_packages()
inflate_bubble.set_system_packages()
inflate_bubble.set_artwork_packages()
inflate_bubble.set_python_packages()
inflate_bubble.set_calamares_packages()
inflate_bubble.set_firmware_packages_arm()
inflate_bubble.set_binary_packages_arm64()
inflate_bubble.set_system_packages_arm()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_devarm_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_devarm()
finish_cleanup.kill_old_iso()
else:
os.makedirs('fusato')
# Run lb config to begin the setup
lbinit()
# Prep the folders
inflate_bubble.set_fusato_structure()
# Packages
inflate_bubble.set_desktop_environment()
inflate_bubble.set_extra_packages()
inflate_bubble.set_general_packages()
inflate_bubble.set_system_packages()
inflate_bubble.set_artwork_packages()
inflate_bubble.set_python_packages()
inflate_bubble.set_calamares_packages()
inflate_bubble.set_firmware_packages_arm()
inflate_bubble.set_binary_packages_arm64()
inflate_bubble.set_system_packages_arm()
copy_folders.copy_folders_files()
copy_files_specified.copy_specific_files()
copy_files_specified.set_symlinks()
copy_devarm_specific()
run_build()
finish_cleanup.make_check_sum()
finish_cleanup.copy_iso_file_nightly_devarm()
finish_cleanup.kill_old_iso()
readybuild()

View File

@ -22,46 +22,20 @@ BASE_DESTINATION = '/var/www/html/nightly'
# Set the base ISO Name
BASE_NAME = 'PeppermintOS'
import paths
import time
# Set the home path used regardless the user logged in
bstring = '~/bubbles/iso_configs/fusato'
home_folder = Path( bstring ).expanduser()
string_home = str(home_folder)
def make_check_sum():
""" Generate the check sum files """
os.chdir(HOME_FOLDER + FUSATO_ROOT)
current_working_directory = os.getcwd().replace('\\', '/')
# Using only one os.walk loop
for root, dirs, files in os.walk(current_working_directory):
current_working_directory = os.getcwd().replace('/', '/')
for _, _, files in os.walk(current_working_directory):
for fiso in files:
if fiso.endswith('.iso'):
sha = "sha512sum "
ext = ".sha512.checksum"
gen_sum = sha + os.path.join(root, fiso) + ' > ' + os.path.join(root, fiso) + ext
ext = "-sha512.checksum"
gen_sum = sha + fiso + ' >' + fiso + ext
os.system(gen_sum)
#def make_check_sum():
# """ Generate the check sum files """
# os.chdir(HOME_FOLDER + FUSATO_ROOT)
# current_working_directory = os.getcwd().replace('/', '/')
#
# for _, _, files in os.walk(current_working_directory):
# current_dir = os.getcwd().replace('/', '/')
#
# # Second os.walk() loop properly indented
# for root, dirs, files in os.walk(current_dir):
# for fiso in files:
# if fiso.endswith('.iso'):
# sha = "sha512sum "
# ext = "-sha512.checksum"
# gen_sum = sha + fiso + ' >' + fiso + ext
# os.system(gen_sum)
def process_iso(base, arch, desktop):
"""
@ -106,10 +80,6 @@ def check_build_type():
'DEB.32opb': ('deb', '32', 'OPB'),
'DEV.64opb': ('dev', '64', 'OPB'),
'DEV.32opb': ('dev', '32', 'OPB'),
'DEB.64kde': ('deb', '64', 'KDE'),
'DEB.32kde': ('deb', '32', 'KDE'),
'DEV.64kde': ('dev', '64', 'KDE'),
'DEV.32kde': ('dev', '32', 'KDE'),
'DEBLD.64loaded': ('deb', '64', 'LOADED'),
'DEVLD.64loaded': ('dev', '64', 'LOADED'),
'DEBLD.32loaded': ('deb', '32', 'LOADED'),
@ -136,193 +106,13 @@ def check_build_type():
check_build()
def copy_iso_file_nightly_deb32():
""" Copy the new ISO to the Nightly folder"""
# Set the home path used regardless the user logged in
bstring = '/home/pepadmin/bubbles/iso_configs/fusato'
home_folder = Path( bstring ).expanduser()
string_home = str(home_folder)
today = str(date.today())
os.chdir(home_folder)
for root, dirs, files in os.walk(home_folder):
for fiso in files:
if fiso.endswith('.iso'):
src_iso = string_home + '/' + fiso
rdes = string_home + '/PeppermintOS-Debian_32_' + today + '.iso'
des_iso = '/var/www/html/nightly/deb32'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
for fsum in files:
if fsum.endswith('.checksum'):
src_sum = string_home + '/' + fsum
rdes_sum = string_home + '/PeppermintOS-Debian_32-sha512.checksum'
des_sum = '/var/www/html/nightly/deb32'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def copy_iso_file_nightly_deb64():
""" Copy the new ISO to the Nightly folder"""
# Set the home path used regardless the user logged in
bstring = '/home/pepadmin/bubbles/iso_configs/fusato'
home_folder = Path( bstring ).expanduser()
string_home = str(home_folder)
today = str(date.today())
os.chdir(home_folder)
for root, dirs, files in os.walk(home_folder):
for fiso in files:
if fiso.endswith('.iso'):
src_iso = string_home + '/' + fiso
rdes = string_home + '/PeppermintOS-Debian_64_' + today + '.iso'
des_iso = '/var/www/html/nightly/deb64'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
for fsum in files:
if fsum.endswith('.checksum'):
src_sum = string_home + '/' + fsum
rdes_sum = string_home + '/PeppermintOS-Debian_64-sha512.checksum'
des_sum = '/var/www/html/nightly/deb64'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def copy_iso_file_nightly_dev32():
""" Copy the new ISO to the Nightly folder"""
# Set the home path used regardless the user logged in
bstring = '/home/pepadmin/bubbles/iso_configs/fusato'
home_folder = Path( bstring ).expanduser()
string_home = str(home_folder)
today = str(date.today())
os.chdir(home_folder)
for root, dirs, files in os.walk(home_folder):
for fiso in files:
if fiso.endswith('.iso'):
src_iso = string_home + '/' + fiso
rdes = string_home + '/PeppermintOS-Devuan_32_' + today + '.iso'
des_iso = '/var/www/html/nightly/dev32'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
for fsum in files:
if fsum.endswith('.checksum'):
src_sum = string_home + '/' + fsum
rdes_sum = string_home + '/PeppermintOS-Devuan_32-sha512.checksum'
des_sum = '/var/www/html/nightly/dev32'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def copy_iso_file_nightly_dev64():
""" Copy the new ISO to the Nightly folder"""
# Set the home path used regardless the user logged in
bstring = '/home/pepadmin/bubbles/iso_configs/fusato'
home_folder = Path( bstring ).expanduser()
string_home = str(home_folder)
today = str(date.today())
os.chdir(home_folder)
for root, dirs, files in os.walk(home_folder):
for fiso in files:
if fiso.endswith('.iso'):
src_iso = string_home + '/' + fiso
rdes = string_home + '/PeppermintOS-Devuan_64_' + today + '.iso'
des_iso = '/var/www/html/nightly/dev64'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
for fsum in files:
if fsum.endswith('.checksum'):
src_sum = string_home + '/' + fsum
rdes_sum = string_home + '/PeppermintOS-Devuan_64-sha512.checksum'
des_sum = '/var/www/html/nightly/dev64'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def copy_iso_file_prod_deb64():
""" Copy the pro nightly and prep it for production push"""
today = str(date.today())
nstring = '/var/www/html/nightly/deb64'
nightly_folder = Path( nstring ).expanduser()
string_nightly = str(nightly_folder)
pstring= '/var/www/html/prod'
production_folder = Path( pstring ).expanduser()
string_production = str(production_folder)
src_iso = string_nightly + '/PeppermintOS-Debian_64_' + today + '.iso'
src_checksum = string_nightly + '/PeppermintOS-Debian_64-sha512.checksum'
rdes = string_nightly + '/PeppermintOS-Debian-64.iso'
des_iso = pstring
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
shutil.copy(src_checksum, des_iso)
os.remove(rdes)
os.remove(src_checksum)
def copy_iso_file_nightly_debarm():
""" Copy the new ISO to the Nightly folder"""
# Set the home path used regardless the user logged in
bstring = '/home/pepadmin/bubbles/iso_configs/fusato'
home_folder = Path( bstring ).expanduser()
string_home = str(home_folder)
today = str(date.today())
os.chdir(home_folder)
for root, dirs, files in os.walk(home_folder):
for fiso in files:
if fiso.endswith('.iso'):
src_iso = string_home + '/' + fiso
rdes = string_home + '/PeppermintOS-Debian_arm_' + today + '.iso'
des_iso = '/var/www/html/nightly/debarm'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
for fsum in files:
if fsum.endswith('.checksum'):
src_sum = string_home + '/' + fsum
rdes_sum = string_home + '/PeppermintOS-Debian_arm-sha512.checksum'
des_sum = '/var/www/html/nightly/debarm'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def copy_iso_file_nightly_devarm():
""" Copy the new ISO to the Nightly folder"""
# Set the home path used regardless the user logged in
bstring = '/home/pepadmin/bubbles/iso_configs/fusato'
home_folder = Path( bstring ).expanduser()
string_home = str(home_folder)
today = str(date.today())
os.chdir(home_folder)
for root, dirs, files in os.walk(home_folder):
for fiso in files:
if fiso.endswith('.iso'):
src_iso = string_home + '/' + fiso
rdes = string_home + '/PeppermintOS-Devuan_arm_' + today + '.iso'
des_iso = '/var/www/html/nightly/devarm'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
for fsum in files:
if fsum.endswith('.checksum'):
src_sum = string_home + '/' + fsum
rdes_sum = string_home + '/PeppermintOS-Devuan_arm-sha512.checksum'
des_sum = '/var/www/html/nightly/devarm'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def kill_fusato():
""" Delete the fusato folder as it is no longer needed"""
icstring ='~/bubbles/iso_configs/'
ic_root = Path( icstring ).expanduser()
os.chdir(ic_root)
current_dir = os.getcwd().replace('/', '/')
del_fldr = "fusato"
del_path = os.path.join(current_dir, del_fldr)
os.rmdir(del_path)
def kill_old_iso():
""" Delete older ISOs"""
base_path = BASE_DESTINATION
arch_list = ['/deb32/', '/deb64/', '/debarm/', '/dev32/', '/dev64/', '/devarm/']
de_list = ['gfb', 'opb', 'xfce', 'loaded', 'server', 'mini', 'kde']
de_list = ['gfb', 'opb', 'xfce', 'loaded', 'server', 'mini']
for archs in arch_list:
for desktops in de_list:
full_path = []
@ -339,15 +129,3 @@ def kill_old_iso():
if file_time < current_time - day*N:
print(f" Delete : {fls}")
os.remove(file_location)
for p in paths.nightly_paths:
N = 1
os.chdir(os.path.join(os.getcwd(), p))
list_of_files = os.listdir()
current_time = time.time()
day = 86400
for fls in list_of_files:
file_location = os.path.join(os.getcwd(), fls)
file_time = os.stat(file_location).st_mtime
if file_time < current_time - day*N:
print(f" Delete : {fls}")
os.remove(file_location)

View File

@ -95,7 +95,6 @@ def set_fusato_server_installer_structure():
# Define the directories to be created in includes-installer
installer_dirs = ['/preseed',
'/usr/lib/finish-install.d/',
'/usr/share/'
]
# Create the directories in includes-installer
@ -215,11 +214,6 @@ def make_bld_openbox(base, arch):
make_build_file(base, arch, 'opb', 'OpenBox Build')
def make_bld_kde(base, arch):
"""Write the kde build file"""
make_build_file(base, arch, 'kde', 'KDE Build')
def make_bld_loaded(base, arch):
"""Write the loaded build file"""
make_build_file(base, arch, 'loaded', 'Loaded Build')
@ -306,13 +300,6 @@ def set_opb():
)
def set_kde():
""" Create the list file for the kde list"""
make_package_list('kde.list.chroot',
conf.KDE_LIST, mode='x'
)
def set_loaded():
""" Create the list for the loaded list"""
make_package_list('loaded.list.chroot',
@ -382,119 +369,3 @@ def set_firmware_arm():
conf.FIRMWARE_LIST_ARM, mode='x'
)
import paths
import conf
# Set the home path used regardless the user logged in
BSTRING = paths.bstring_iso_conifgs_fusato
home_folder = Path(BSTRING).expanduser()
def set_desktop_environment():
""" Create the list for the desktop environment"""
# Start in iso_configs/fusato
os.chdir(home_folder)
# set current directory
current_dir = os.getcwd().replace('/', '/')
# change to package-lists
os.chdir(current_dir + paths.de_path)
with open('desktop.list.chroot', 'x', encoding='UTF-8') as de_file:
de_file.write(conf.env_list)
def set_extra_packages():
""" Create the list for the desktop environment extras goodies"""
with open(
'extra-desktop.list.chroot', 'x', encoding='UTF-8'
) as extra_file:
extra_file.write(conf.desktop_list)
def set_general_packages():
""" Create the list for standard install packages"""
with open('packages.list.chroot', 'x', encoding='UTF-8') as general_file:
general_file.write(conf.general_list)
def set_system_packages():
""" Create the list for system management packages"""
with open('system.list.chroot', 'x', encoding='UTF-8') as system_file:
system_file.write(conf.system_list)
def set_system_packages_32():
""" Create the list for system management packages"""
with open('system.list.chroot', 'a', encoding='UTF-8') as system_file:
system_file.write(conf.system_list_32)
def set_system_packages_64():
""" Create the list for system management packages"""
with open('system.list.chroot', 'a', encoding='UTF-8') as system_file:
system_file.write(conf.system_list_64)
def set_system_packages_arm():
""" Create the list for system management packages"""
with open('system.list.chroot', 'a', encoding='UTF-8') as system_file:
system_file.write(conf.system_list_arm64)
def set_artwork_packages():
""" Create the list for icons, wallpaper and themes"""
with open('artwork.list.chroot', 'x', encoding='UTF-8') as artwork_file:
artwork_file.write(conf.artwork_list)
def set_python_packages():
""" Create the list for python related needs"""
with open('python.list.chroot', 'x', encoding='UTF-8') as python_file:
python_file.write(conf.python_list)
def set_calamares_packages():
""" Create the list for the calamares installer"""
with open(
'installer.list.chroot', 'x', encoding='UTF-8'
) as calamares_file:
calamares_file.write(conf.calamares_list)
def set_firmware_packages():
""" Create the list for the firmware support for genral ISOs"""
with open('firmware.list.chroot', 'x', encoding='UTF-8') as firmware_file:
firmware_file.write(conf.firmware_list)
def set_firmware_packages_arm():
""" Create the list for the firmware support for arm ISOs"""
with open('firmware.list.chroot', 'x', encoding='UTF-8') as firmware_file:
firmware_file.write(conf.firmware_list_arm)
def set_binary_packages_64():
""" Create the list for grub binary packages for 64 bit"""
with open('installer.list.binary', 'x', encoding='UTF-8') as binary_file:
binary_file.write(conf.binary_list_64)
def set_binary_packages_arm64():
""" Create the list for grub binary packages for 64 bit"""
with open('installer.list.binary', 'x', encoding='UTF-8') as binary_file:
binary_file.write(conf.binary_list_arm)
def set_binary_packages_32():
""" Create the list for grub binary packages for 32 bit"""
with open('installer.list.binary', 'x', encoding='UTF-8') as binary_file:
binary_file.write(conf.binary_list_32)
def set_fusato_structure():
""" Make some needed folders for the fustao build process."""
working_path = os.getcwd().replace('/', '/')
make_fldrs = paths.make_folders
# make needed folders
for f in make_fldrs:
os.makedirs(working_path + f)

View File

@ -5,7 +5,7 @@
*
* Set the infrastructure for bubbles to begin the ISO build
* This copies needed config files to the binary and chroot
* locations, based on the build base and architecture.
* locations, based on the build base and architecture
"""
import os
import collections
@ -25,6 +25,7 @@ BINARYPTH = "/fusato/config/includes.binary"
BOOTSTRAP = "/fusato/config/includes.bootstrap"
FUSATOCONFIG = "/fusato/config"
# Set up the logging format
logger = logging.getLogger()
MSG_COPY = "Copying - "
@ -145,11 +146,6 @@ class ChrootInstallerFiles:
for base in bases:
cls(base)
#### This section is not really needed since this file is never executed
#### outright so I commented this
#if __name__ == "__main__": ## This seems incorrect, I am testing
# ChrootInstallerFiles.run_for_all_bases()
class BinaryFolders:
"""
@ -453,11 +449,8 @@ def get_id_build_type():
"""
This will get the type of build that is taking place
"""
source_folder = os.path.expanduser('~/start/bldtype')
dest_folder = os.path.join(os.path.expanduser('~'),'bubbles',
'iso_configs','fusato','config','includes.chroot','opt',
'pepconf'
)
source_folder = '/home/pepadmin/start/bldtype'
dest_folder = '/home/pepadmin/bubbles/iso_configs/fusato/config/includes.chroot/opt/pepconf'
os.makedirs(dest_folder, exist_ok=True)
for filename in os.listdir(source_folder):
src_file = os.path.join(source_folder, filename)
@ -466,7 +459,6 @@ def get_id_build_type():
shutil.copy(src_file, dest_file)
print(f'Copied: {src_file} to {dest_file}')
def ignore_missing_files(src, names):
return [name for name in names if not os.path.exists(os.path.join(src, name))]
@ -477,7 +469,7 @@ def add_web_profile():
typ
"""
logger.info("Copy Web Profiles")
path_to_bldtype_file = os.path.expanduser('~/start/bldtype')
path_to_bldtype_file = '/home/pepadmin/start/bldtype/'
lw_src_path = '/browser_profiles/lw/'
ff_src_path = '/browser_profiles/ff/'
des_src_path ='/etc/skel/.local/share/pmostools'
@ -714,7 +706,6 @@ def shared_server_files():
)
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des)
def boostrap_shared():
"""
Copy specific folders in the boostrap location
@ -789,21 +780,6 @@ def open_box_configs():
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des_ob)
def kde_configs():
"""
Copy the kde files
"""
logger.info("Copy KDE configs")
src_kde = '/kde'
des_kde = '/etc/skel/'
logger.info("INFO: Copying - " + HOME_FOLDER + src_kde)
shutil.copytree(HOME_FOLDER + src_kde,
HOME_FOLDER + WPCHROOT + des_kde,
dirs_exist_ok = True
)
logger.info(MSG_FIN + HOME_FOLDER + WPCHROOT + des_kde)
def loaded_configs():
"""
Copy the loaded xfce files

View File

@ -1,340 +0,0 @@
#### SHARED PATHS
## bstring paths - Public
bstring_iso_configs = '~/bubbles/iso_configs'
bstring_iso_conifgs_fusato = '~/bubbles/iso_configs/fusato'
# CHROOT
WPCHROOT = "fusato/config/includes.chroot"
##########################################
## Associated to inflate_bubble.py paths
# Desktop Environments
de_path = '/config/package-lists/'
# fusato folders to create
make_folders = [
'/config/includes.chroot/usr/share/distro-info/',
'/config/includes.chroot/usr/share/python-apt/templates/',
'/config/includes.chroot/usr/share/icons/default',
'/config/includes.chroot/usr/share/peppermint/',
'/config/includes.chroot/usr/share/themes/',
'/config/includes.chroot/usr/local/bin/',
'/config/includes.chroot/usr/bin/',
'/config/includes.chroot/usr/sbin',
'/config/includes.chroot/etc/lightdm',
'/config/includes.bootstrap/etc/apt',
'/config/includes.chroot/etc/default',
'/config/includes.chroot/etc/apt',
'/config/includes.chroot/etc/apt/preferences.d',
'/config/includes.chroot/etc/apt/sources.list.d',
'/config/includes.chroot/etc/skel/Desktop',
'/config/includes.chroot/etc/skel/.local/share',
'/config/includes.chroot/etc/skel/.config/autostart/'
]
# End Inflate Bubble Paths
# Nightly paths
nightly_paths = [
'/var/www/html/nightly/deb32',
'/var/www/html/nightly/dev32',
'/var/www/html/nightly/deb64',
'/var/www/html/nightly/dev64',
'/var/www/html/nightly/devarm',
'/var/www/html/nightly/debarm'
]
#########################################
### Associated to copy_files_specified.py
## Specified Files
#Alias things
src_alias = '/aliases/bash_aliases'
des_alias = '/etc/skel/.bash_aliases'
# Xdaily things
src_xdaily = '/PepProTools/xDaily'
des_xdaily = '/usr/local/bin/xDaily'
# Hub things
src_hub = '/PepProTools/hub'
des_hub = '/usr/local/bin/hub'
# Welcome things
src_welcome = '/PepProTools/welcome'
des_welcome = '/usr/local/bin/welcome'
# Kumo things
src_kumo = '/PepProTools/kumo'
des_kumo = '/usr/local/bin/kumo'
# Lightdm things
src_lightdm = '/lightdm/lightdm.conf'
des_lightdm = '/etc/lightdm/lightdm.conf'
src_lightdm_greeter = '/lightdm/lightdm-gtk-greeter.conf'
des_lightdm_greeter = '/fusato/config/includes.chroot/etc/lightdm/lightdm-gtk-greeter.conf'
# Plymouth things
src_ply = '/plymouth/plymouthd.conf'
des_ply = '/fusato/config/includes.chroot/usr/share/plymouthd.conf'
# Desktop-base things
src_dbase_grub = '/desktop_base/lines-theme/grub'
src_dbase_lockscreen = '/desktop_base/lines-theme/lockscreen'
src_dbase_login = '/desktop_base/lines-theme/login'
src_dbase_wallpaper = '/desktop_base/lines-theme/wallpaper'
des_dbase_grub = '/usr/share/desktop-base/lines-theme/grub'
des_dbase_lockscreen = '/usr/share/desktop-base/lines-theme/lockscreen'
des_dbase_login = '/usr/share/desktop-base/lines-theme/login'
des_dbase_wallpaper = '/usr/share/desktop-base/lines-theme/wallpaper'
# Symlinks
pep_info = '/usr/share/python-apt/templates/Peppermint.info'
pep_mirror = '/usr/share/python-apt/templates/Peppermint.mirrors'
pep_csv = '/usr/share/distro-info/peppermint.csv'
# Plank things
src_plank = '/application/plank.desktop'
des_plank = '/etc/skel/.config/autostart/plank.desktop'
### End of copy_file_specified.py
############################################
### Associated to copy_folders.py
## copy_folder_files
# Plymouth Things
src_ply_lines = '/plymouth/lines'
des_ply_lines = '/usr/share/plymouth/themes/lines'
# Application things
src_apps = '/application'
des_apps = '/usr/share/applications'
# Font things
src_font = '/font'
des_font = '/usr/share/fonts/pepconf'
# hooks things
src_hooks_live = '/hooks/live'
des_hooks_live = '/usr/lib/live/config'
src_hooks_normal = '/hooks/normal'
des_hooks_normal = '/fusato/config/hooks/normal'
# Issue things
src_issue = '/issue'
des_issue = '/fusato/config/includes.bootstrap/etc'
des_issue_etc = '/etc'
des_issues_opt = '/opt/pepconf'
# Polkit things
src_polkit = '/polkit'
des_polkit = '/usr/share/polkit-1/actions'
# Database things
src_database = '/database'
des_database = '/opt/pypep/dbpep'
# User Config things
src_user_configs = '/user_config'
des_user_configs = '/etc/live/config.conf.d'
# Pixmaps things
src_pixmaps = '/PepProPixMaps'
des_pixmaps = '/usr/share/pixmaps'
# Wallpaper things
src_wallpaper = '/wallpaper'
des_wallpaper = '/usr/share/backgrounds'
# Menu things
src_menu = '/menu/menus'
des_menu = '/etc/skel/.config/menus'
# Xfce4 things
src_xfce = '/xfce/xfce4'
des_xfce = '/etc/skel/.config/xfce4'
# user face profile things
src_face = '/face'
des_face = '/etc/skel/'
# neofecth things
src_neo_fetch = '/neofetch/neofetch'
des_neo_fetch = '/etc/skel/.config/neofetch'
# Thunar things
src_thunar = '/xfce/Thunar'
des_thunar = '/etc/skel/.config/Thunar'
# Pep Tools things
src_pmostools = '/pmostools'
des_pmostools = '/etc/skel/.local/share/pmostools'
# Autostart Things
src_auto_start = '/autostart'
des_auto_start ='/etc/skel/.config/autostart'
# Python Libs
src_pylibs = '/pylibraries'
des_pylibs = '/usr/lib/python3/dist-packages'
#Theme things
src_debian_dark = '/theme/Marwaita?Dark?Debian '
src_manjaro_dark = '/theme/Marwaita?Dark?Manjaro '
src_peppermint_dark = '/theme/Marwaita?Dark?Peppermint '
src_debian = '/theme/Marwaita?Debian '
src_manjaro = '/theme/Marwaita?Manjaro '
src_peppermint = '/theme/Marwaita?Peppermint '
des_themes = '/fusato/config/includes.chroot/usr/share/themes'
# icon things
src_tela_blue_dark = '/icons/Tela-circle-blue-dark '
src_tela_green_dark = '/icons/Tela-circle-green-dark '
src_tela_red_dark = '/icons/Tela-circle-red-dark '
src_tela_blue_base = '/icons/Tela-circle-blue '
src_tela_green_base = '/icons/Tela-circle-green '
src_tela_red_base = '/icons/Tela-circle-red '
src_tela = '/icons/Tela-circle '
des_icons = '/fusato/config/includes.chroot/usr/share/icons'
### End Copy Folders
##########################################################
### Arch Specific Paths.
# Folder
# OS Release Things
src_deb32_osrelease = '/osrelease/deb_32'
src_dev32_osrelease = '/osrelease/dev_32'
src_deb64_osrelease = '/osrelease/deb_64'
src_dev64_osrelease = '/osrelease/dev_64'
src_debarm_osrelease = '/osrelease/deb_arm'
src_devarm_osrelease = '/osrelease/dev_arm'
des_osrelease = '/usr/lib'
des_osrelease_opt = '/opt/pepconf'
# Boot Splash things
src_deb32_slpash = '/splash/deb_32/boot'
src_dev32_slpash = '/splash/dev_32/boot'
src_deb64_slpash = '/splash/deb_64/boot'
src_dev64_slpash = '/splash/dev_64/boot'
src_debarm_slpash = '/splash/deb_arm/boot'
src_devarm_slpash = '/splash/dev_arm/boot'
des_splash = '/fusato/config/includes.binary/boot'
src_deb32_isolinux = '/splash/deb_32/isolinux'
src_dev32_isolinux = '/splash/dev_32/isolinux'
src_deb64_isolinux = '/splash/deb_64/isolinux'
src_dev64_isolinux = '/splash/dev_32/isolinux'
src_debarm_isolinux = '/splash/deb_arm/isolinux'
src_devarm_isolinux = '/splash/dev_arm/isolinux'
des_isolinux = '/fusato/config/includes.binary/isolinux'
# The actual Splash images
src_deb_splash_image = '/splash/deb_splash'
src_dev_splash_image = '/splash/dev_splash'
des_splash_image_isolinux = '/fusato/config/includes.binary/isolinux'
des_splash_image_grub = '/fusato/config/includes.binary/boot/grub'
# Live Boot Theme
src_deb_live_theme = '/splash/deb_live-theme'
src_dev_live_theme = '/splash/deb_live-theme'
des_live_theme = '/fusato/config/includes.binary/boot/grub'
# MultiMedia things
src_deb32_multi = '/multimedia/deb_32'
src_dev32_multi = '/multimedia/dev_32'
src_deb64_multi = '/multimedia/deb_64'
src_dev64_multi = '/multimedia/dev_64'
src_debarm_multi = '/multimedia/deb_arm'
src_devarm_multi = '/multimedia/dev_arm'
des_archives = '/fusato/config/archives'
# Grub things
src_deb_grub_theme = '/grub/deb_themes'
src_dev_grub_theme = '/grub/dev_themes'
des_grub_theme = '/boot/grub/themes'
src_deb32_grub_etc = '/grub/deb_64/grub'
src_dev32_grub_etc = '/grub/dev_32/grub'
src_deb64_grub_etc = '/grub/deb_64/grub'
src_dev64_grub_etc = '/grub/dev_64/grub'
src_debarm_grub_etc = '/grub/deb_arm/grub'
src_devarm_grub_etc = '/grub/dev_arm/grub'
des_grub_etc = '/etc/default/grub'
# Calamares things
src_brand = '/calamares_settings/branding/peppermint'
des_brand = '/etc/calamares/branding/peppermint'
src_deb32_modules = '/calamares_settings/deb_32/calamares/modules'
src_dev32_modules = '/calamares_settings/dev_32/calamares/modules'
src_deb64_modules = '/calamares_settings/deb_64/calamares/modules'
src_dev64_modules = '/calamares_settings/dev_64/calamares/modules'
src_debarm_modules = '/calamares_settings/deb_arm/calamares/modules'
src_devarm_modules = '/calamares_settings/dev_arm/calamares/modules'
des_modules = '/etc/calamares/modules'
# Files
# Calamares Files
src_deb32_settings = '/calamares_settings/deb_32/calamares/settings.conf'
src_dev32_settings = '/calamares_settings/dev_32/calamares/settings.conf'
src_deb64_settings = '/calamares_settings/deb_64/calamares/settings.conf'
src_dev64_settings = '/calamares_settings/dev_64/calamares/settings.conf'
src_debarm_settings = '/calamares_settings/deb_arm/calamares/settings.conf'
src_devarm_settings = '/calamares_settings/dev_arm/calamares/settings.conf'
des_setttings = '/etc/calamares/settings.conf'
src_deb32_installer = '/calamares_settings/deb_32/install-peppermint'
src_dev32_installer = '/calamares_settings/dev_32/install-peppermint'
src_deb64_installer = '/calamares_settings/deb_64/install-peppermint'
src_dev64_installer = '/calamares_settings/dev_64/install-peppermint'
src_debarm_installer = '/calamares_settings/deb_arm/install-peppermint'
src_devarm_installer = '/calamares_settings/dev_arm/install-peppermint'
des_installer = '/usr/bin/install-peppermint'
src_deb32_sourcesfinal = '/calamares_settings/deb_32/sources-final'
src_dev32_sourcesfinal = '/calamares_settings/dev_32/sources-final'
src_deb64_sourcesfinal = '/calamares_settings/deb_64/sources-final'
src_dev64_sourcesfinal = '/calamares_settings/dev_64/sources-final'
src_debarm_sourcesfinal = '/calamares_settings/deb_arm/sources-final'
src_devarm_sourcesfinal = '/calamares_settings/dev_arm/sources-final'
des_sourcesfinal = '/usr/sbin/sources-final'
src_deb32_bootloader = '/calamares_settings/deb_32/bootloader-config'
src_dev32_bootloader = '/calamares_settings/dev_32/bootloader-config'
src_deb64_bootloader = '/calamares_settings/deb_64/bootloader-config'
src_dev64_bootloader = '/calamares_settings/dev_64/bootloader-config'
src_debarm_bootloader = '/calamares_settings/deb_arm/bootloader-config'
src_devarm_bootloader = '/calamares_settings/dev_arm/bootloader-config'
des_bootloader = '/usr/sbin/bootloader-config'
src_deb32_netinstall ='/calamares_settings/deb_32/calamares/netinstall-packages'
src_dev32_netinstall ='/calamares_settings/dev_32/calamares/netinstall-packages'
src_deb64_netinstall ='/calamares_settings/deb_64/calamares/netinstall-packages'
src_dev64_netinstall ='/calamares_settings/dev_64/calamares/netinstall-packages'
src_debarm_netinstall ='/calamares_settings/deb_arm/calamares/netinstall-packages'
src_devarm_netinstall ='/calamares_settings/dev_arm/calamares/netinstall-packages'
des_netinstall = '/etc/calamares/netinstall-packages'
src_icon = '/calamares_settings/adddesktopicon/add-calamares-desktop-icon'
des_icon = '/usr/bin/add-calamares-desktop-icon'
# Source things
src_deb32_sourcelist = '/sources/deb_32/sources.list'
src_dev32_sourcelist = '/sources/dev_32/sources.list'
src_deb64_sourcelist = '/sources/deb_64/sources.list'
src_dev64_sourcelist = '/sources/dev_64/sources.list'
src_debarm_sourcelist = '/sources/deb_arm/sources.list'
src_devarm_sourcelist = '/sources/dev_arm/sources.list'
des_sourcelist = '/opt/pepconf/sources.list'
# Main line ID File
src_main_line_pep_id = '/id_files/pep_id'
des_main_line_pep_id = '/usr/share/peppermint/pep_id'