-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.py
666 lines (633 loc) · 19.4 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
#!/usr/bin/env python3
class General:
UseGui = False
WaitAfterExecution = True
class PreInstallation:
class KeyboardLayout:
Layout = 'de_CH-latin1'
ConsoleFont = 'Lat2-Terminus16.psfu.gz'
# Sans-serif-fonts with only moderate eyecancer:
# cybercafe.fnt.gz
# gr928-8x16-thin.psfu.gz
# greek-polytonic.psfu.gz
# Lat2-Terminus16.psfu.gz
# LatGrkCyr-8x16.psfu.gz
class BootMode:
pass
class Internet:
PingAddress = 'archlinux.org'
class SystemClock:
pass
class Partitioning:
def partition(self):
pass
# function partition_disks() {
# #bash # For manual setup
# exec_cmd parted -s $disk \
# mklabel gpt \
# mkpart primary fat32 1MB 578MB \
# mkpart primary linux-swap 578MB 11.3GB \
# mkpart primary ext4 11.3GB 500GB
# # Set up LVM/LUKS/RAID?
# }
class Formatting:
def format(self):
pass
# function format_partitions() {
# #bash # For manual setup
# exec_cmd mkfs.fat -F32 ${disk}1
# exec_cmd mkswap ${disk}2
# exec_cmd swapon ${disk}2
# exec_cmd mkfs.ext4 ${disk}3
# }
class Mounting:
def mount(self):
pass
# function mount_partitions() {
# #bash # For manual setup
# exec_cmd mount ${disk}3 /mnt
# exec_cmd mkdir -p /mnt/boot
# exec_cmd mount ${disk}1 /mnt/boot
# }
class Installation:
class Mirrors:
UpdateMirrorList = True
# https://xyne.archlinux.ca/projects/reflector/#help-message
Countries = [
# 'Australia',
'Austria',
# 'Bangladesh',
'Belarus',
'Belgium',
'BosniaandHerzegovina',
# 'Brazil',
'Bulgaria',
# 'Canada',
# 'Chile',
# 'China',
# 'Colombia',
'Croatia',
'Czechia',
'Denmark',
# 'Ecuador',
'Finland',
'France',
'Germany',
'Greece',
# 'HongKong',
'Hungary',
'Iceland',
# 'India',
# 'Indonesia',
'Ireland',
# 'Israel',
'Italy',
'Japan',
# 'Kazakhstan',
# 'Lithuania',
'Luxembourg',
'Macedonia',
# 'Mexico',
'Netherlands',
'NewCaledonia',
# 'NewZealand',
'Norway',
# 'Philippines',
'Poland',
'Portugal',
# 'Qatar',
'Romania',
# 'Russia',
'Serbia',
# 'Singapore',
'Slovakia',
'Slovenia',
# 'SouthAfrica',
'SouthKorea',
'Spain',
'Sweden',
'Switzerland',
'Taiwan',
# 'Thailand',
# 'Turkey',
'Ukraine',
'UnitedKingdom',
# 'UnitedStates',
# 'Vietnam'
]
SortBy = 'score' # age,rate,country,score,delay
Protocol = 'https' # http,https,ftp,rsync
NFastest = 50
NMostRecentlyUpdated = 50
class BasePackages:
pass
class SystemConfiguration:
class FStab:
Identifier = 'U' # fstab file uses UUID('U') or labels('L')
class Chroot:
pass
class Timezone:
Region = 'Europe'
City = 'Zurich'
class Locale:
Main = 'de_CH'
Locales = [
"de_CH.UTF-8 UTF-8"
"de_CH ISO-8859-1"
"ja_JP.EUC-JP EUC-JP"
"ja_JP.UTF-8 UTF-8"
"en_GB.UTF-8 UTF-8"
"en_GB ISO-8859-1"
"en_US.UTF-8 UTF-8"
"en_US ISO-8859-1"
]
class NetworkConfiguration:
Hostname = 'keppler22b'
IP = '' # In case the system has a permanent ip(default: '127.0.1.1')
class InitRamFs:
EditMkInitCpioFile = True
class RootPassword:
pass
class BootLoader:
def install(self):
pass
# function install_bootloader() {
# #bash # For manual setup
# exec_cmd pacman --color=always --noconfirm -S grub
# exec_cmd grub-install --target=i386-pc $disk
# exec_cmd grub-mkconfig -o /boot/grub/grub.cfg
# }
class Reboot:
pass
class PostInstallation:
class GeneralRecommendations:
class SystemAdministration:
class UsersAndGroups:
def add(self):
pass
# add_users_and_groups() {
# local usr="raphael"
# useradd -mG wheel,users,sys,rfkill,log,http,games,ftp -s /bin/zsh -c 'Raphael Emberger' $usr
# passwd $usr
# }
class PrivilegeEscalation:
def configure(self):
pass
# handle_privilage_escalation() { # Allow users of group "wheel" to use su/sudo
# exec_cmd "sed -i 's/^# \(%wheel ALL=(ALL) ALL\)$/\1/g' /etc/sudoers"
# }
class ServiceManagement:
pass
class SystemMaintenance:
BackupDb = True
def change_pw_policy(self):
pass
# setup_pw_policy() {
# cat << EOF
# #%PAM-1.0
# password required pam_cracklib.so retry=2 minlen=10 difok=6 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1
# password required pam_unix.so use_authtok sha512 shadow
# EOF
# }
def setup_lockout_policy(self):
pass
# setup_lockout_policy() {
# cat << EOF
# #%PAM-1.0
# auth required pam_tally2.so deny=3 unlock_time=600 onerr=succeed
# account required pam_tally2.so
# EOF
# }
FailDelay = 4000000 # delay after failed login attempt in microseconds(0=no delay)
# install_hardened_linux= # default: ''
# restrict_k_log_acc=1 # Restrict kernel log access to root(set by linux-hardened, default: '')
# restrict_k_ptr_acc=2 # {1,2} Restrict kernel pointer access(set by linux-hardened, default: '')
# bpf_jit_enable=0 # En-/disable BPF JIT compiler(default: 1)
# # Install sandbox application(default: '')
# sandbox_app="firejail,lxc" # {firejail,bubblewrap,lxc,virtualbox}
# setup_firewall() {
# exec_cmd pacman --color=always --noconfirm -S ufw
# exec_cmd systemctl enable ufw.service
# }
# tcp_max_syn_backlog= # Change max syn backlog(default: '' => 256)
# tcp_syn_cookie_prot=1 # Helps protect against SYN flood attacks(default: '')
# tcp_rfc1337=1 # Protect against tcp time-wait assassination hazards(default: '')
# log_martians=1 # Log martian packets(default: '')
# icmp_echo_ignore_broadcasts=1 # Prevent being part of smurf attacks(default: '')
# icmp_ignore_bogus_error_responses=1 # default: ''
# send_redirects=0 # default: '' => 1
# accept_redirects=0 # default: '' => 1
# ssh_client="openssh" # {openssh,mosh,dropbear,...} Package to install ssh capabilities(default: "openssh")
# ssh_require_key= # Require SSH key(default: '')
# ssh_deny_root_login=1 # default: ''
# install_dnssec= # default: ''
# install_dnscrypt= # default: ''
# install_dnsmasq= # default: ''
# ########################################
# # 5.1.2 Package management
# #### 5.1.2.1 Pacman
# #### 5.1.2.2 Repositories
# enable_multilib=1 # default: ''
# setup_unoff_usr_repo() { # Add user repos and keys
# return;
# }
# install_pkgstats= # default: ''
# #### 5.1.2.3 Mirrors
# #### 5.1.2.4 Arch Build System
# #### 5.1.2.5 Arch User Repository
# aur_helper="pikaur" # default: '' => No automatic AUR package installation
# install_aur_helper() {
# exec_cmd pacman --color=always --noconfirm -S git gvim base-devel pyalpm
# exec_cmd git clone https://aur.archlinux.org/${aur_helper}.git /home/raphael/${aur_helper}
# exec_cmd chown raphael:raphael -R /home/raphael/${aur_helper}
# cd /home/raphael/${aur_helper}
# NO_PIPE=1 exec_cmd vim PKGBUILD
# exec_cmd sudo -Hu raphael bash -c makepkg -fsri
# local retval=$?
# exec_cmd cd -
# return $retval
# }
# ########################################
# # 5.1.3 Booting
# #### 5.1.3.1 Hardware auto-recognition
# setup_hardware_auto_recognition() {
# return
# }
# #### 5.1.3.2 Microcode
# #### 5.1.3.3 Retaining boot messages
# retain_boot_msgs=1 # default: ''
# #### 5.1.3.4 Num Lock activation
# activate_numlock_on_boot=1 # Extends the getty service(default: '')
# ########################################
# # 5.1.4 Graphical user interface
# #### 5.1.4.1 Display server
# disp_server="xorg" # {xorg,wayland} default: "xorg"
# #### 5.1.4.2 Display drivers
# install_display_drivers() {
# # Laptop: NVE7/GK107
# # Desktop: NVCF
# exec_cmd pacman --color=always --noconfirm -S \
# mesa bumblebee nvidia lib32-nvidia-utils lib32-virtualgl \
# --color=always --noconfirm
# exec_cmd systemctl enable bumblebeed.service
# }
# #### 5.1.4.3 Desktop environments
# install_de() {
# return
# }
# #### 5.1.4.4 Window managers
# install_wm() {
# exec_cmd pacman --color=always --noconfirm -S bspwm sxhkd
# }
# #### 5.1.4.5 Display manager
# install_dm() {
# exec_cmd pacman --color=always --noconfirm -S lightdm lightdm-gtk-greeter
# exec_cmd systemctl enable lightdm.service
# }
# ########################################
# # 5.1.5 Power management
# #### 5.1.5.1 ACPI events
# install_acpid=1 # default: ''
# setup_acpi() {
# # exec_cmd sed -i 's/^#\(HandleLidSwitch\)=.*$/\1=suspend/g' /etc/systemd/logind.conf
# return
# # No need for sevice restart since we'll reboot at the end.
# }
# #### 5.1.5.2 CPU frequency scaling
# setup_cpu_freq_scal() {
# return
# }
# #### 5.1.5.3 Laptops
# setup_laptop() {
# return
# }
# #### 5.1.5.4 Suspend and Hibernate
# setup_susp_and_hiber() {
# return
# }
# ########################################
# # 5.1.6 Multimedia
# #### 5.1.6.1 Sound
# setup_sound() {
# return
# }
# #### 5.1.6.2 Browser plugins
# setup_browser_plugins() {
# return
# }
# #### 5.1.6.3 Codecs
# setup_codecs() {
# exec_cmd pacman --color=always --noconfirm -S lame libfdk-aac flac openjpeg aom libde265 libmpeg2 libvpx x264 xvidcore gstreamer gst-plugins-good ffmpeg
# }
# ########################################
# # 5.1.7 Networking
# #### 5.1.7.1 Clock synchronization
# setup_clock_sync() {
# exec_cmd pacman --color=always --noconfirm -S ntp
# }
# #### 5.1.7.2 DNS security
# setup_dns_sec() {
# return
# }
# #### 5.1.7.3 Setting up a firewall
# setup_firewall() {
# exec_cmd pacman --color=always --noconfirm -S ufw
# }
# #### 5.1.7.4 Resource sharing
# setup_res_share() {
# exec_cmd pacman --color=always --noconfirm -S nfs-utils smbclient cifs-utils
# }
# ########################################
# # 5.1.8 Input devices
# #### 5.1.8.1 Keyboard layouts
# x11_keymap_layout='ch'
# x11_keymap_model='pc104'
# x11_keymap_variant=''
# x11_keymap_options=''
# #### 5.1.8.2 Mouse buttons
# setup_mouse() {
# return
# }
# #### 5.1.8.3 Laptop touchpads
# setup_touchpad() {
# exec_cmd pacman --color=always --noconfirm -S xf86-input-libinput
# }
# #### 5.1.8.4 TrackPoints
# setup_trackpoints() {
# return
# }
# ########################################
# # 5.1.9 Optimization
# #### 5.1.9.1 Benchmarking
# setup_benchmarking() {
# return
# }
# #### 5.1.9.2 Improving performance
# setup_benchmarking() {
# return
# }
# #### 5.1.9.3 Solid state drives
# setup_ssd() {
# return
# }
# ########################################
# # 5.1.10 System service
# #### 5.1.10.1 File index and search
# setup_file_index_and_search() {
# exec_cmd pacman --color=always --noconfirm -S mlocate
# exec_cmd updatedb
# }
# #### 5.1.10.2 Local mail delivery
# setup_mail() {
# return
# }
# #### 5.1.10.3 Printing
# setup_printing() {
# exec_cmd pacman --color=always --noconfirm -S cups cups-pdf avahi hplip system-config-printer gtk3-print-backends
# exec_cmd systemctl enable org.cups.cupsd.service
# exec_cmd systemctl enable avahi-daemon.service
# }
# ########################################
# # 5.1.11 Appearance
# #### 5.1.11.1 Fonts
# setup_fonts() {
# exec_cmd $aur_helper --color=always --noconfirm -S all-repository-fonts tamzen-font powerline-fonts powerline-console-fonts ttf-mplus
# }
# #### 5.1.11.2 GTK+ and Qt themes
# setup_gtk_qt() {
# exec_cmd pacman --color=always --noconfirm -S gtk3 gtk2 arc-gtk-theme breeze-gtk numix-gtk-theme materia-gtk-theme qt5-base qt4 breeze-kde4 breeze qtcurve-qt4 qtcurve-qt5 qt5-styleplugins lxappearance kde-gtk-config
# exec_cmd $aur_helper --color=always --noconfirm -S oomox adwaita-qt4 adwaita-qt5
# }
# ########################################
# # 5.1.12 Console improvements
# #### 5.1.12.1 Tab-completion enhancements
# setup_tab_completion() {
# return
# }
# #### 5.1.12.2 Aliases
# setup_aliases() {
# return
# }
# #### 5.1.12.3 Alternative shells
# setup_alt_shell() {
# exec_cmd pacman --color=always --noconfirm -S zsh zsh-completions
# exec_cmd chsh -s /bin/zsh
# }
# #### 5.1.12.4 Bash additions
# setup_bash_additions() {
# return
# }
# #### 5.1.12.5 Colored output
# setup_colored_output() {
# return
# }
# #### 5.1.12.6 Compressed files
# setup_compressed_files() {
# exec_cmd pacman --color=always --noconfirm -S p7zip unrar zip
# }
# #### 5.1.12.7 Console prompt
# setup_console_prompt() {
# exec_cmd $aur_helper --color=always --noconfirm -S oh-my-zsh-git
# }
# #### 5.1.12.8 Emacs shell
# setup_emacs_shell() {
# return
# }
# #### 5.1.12.9 Mouse support
# setup_mouse_support() {
# exec_cmd pacman --color=always --noconfirm -S gpm
# exec_cmd systemctl enable gpm.service
# }
# #### 5.1.12.10 Scrollback buffer
# setup_scrollback_buffer() {
# return
# }
# #### 5.1.12.11 Session management
# setup_session_management() {
# return
# }
# ############################################################
# # 5.2 Applications
# #
#
# packages=(
# # Terminal & tools
# rxvt-unicode # urxvt is bae
# wget # because
# nmap # Port scanner
# scrot # screenshot tool
# screenfetch archey3 lolcat cmatrix neofetch # Eye candy
# vimpager # vim as pager
# exa # better ls
# pv # pipe viewer
# fd # better find
# ranger # terminal based file manager
# htop # better top
# easy-rsa # RSA
# #valgrind gbd ddd # C debugging
# arch-install-scripts # genfstap etc.
# pacman-contrib # rankmirrors
# reflector # Mirror list updater
# udevil cifs-utils fuse-exfat # Mount different file systems
# tree # Print tree structure of file system
# reptyr # Attach terminal to running process
# #evtest # Event code of input devices
# dash # Compatability shell
# vim-plugins # Plugins for vim(duh)
# wmname # For some plugin in my dotfiles that I can't remember(something about bspwm maybe?)
#
# # Programming language support
# nodejs npm # Node
# sassc lessc # CSS preprocessors
# python-pip # Python package manager
# #jdk10-openjdk jdk9-openjdk jdk8-openjdk # Java
# gradle # Build tool
# #tesseract-data python-tensorflow python-pandas # Machine learning
#
# # IDEs
# netbeans # Java
# mono xterm # MONO-Framework(.NET)
#
# # Other
# redshift python-gobject python-xdg gtk3 gpsd # Screen color/brightness adjusting
# network-manager-applet nm-connection-editor networkmanager-openconnect networkmanager-openvpn # Network manager(duh)
# wpa_supplicant # wireless support
# pulseaudio alsa-tools alsa-utils pulseaudio-alsa pulseaudio-bluetooth pulseaudio-alsa bluez bluez-libs bluez-utils pavucontrol # Audio(& Bluetooth)
# rhythmbox # Music manager/streamer
# flashplugin
# openvpn # VPN
# xdotool # xprop
# compton #Composition manager
# i3lock # Lock screen
# base-devel # Development package group
#
# # Applications
# wireshark-gtk # Protocol sniffer
# tor # AnOnYmOuS bRoWsInG
# imagemagick # Picture editor
# vlc qt4 # video
# firefox chromium # FF > IE
# libreoffice-fresh libreoffice-fresh-de hunspell-de # Office
# #thunderbird thunderbird-i18n-de # Mail client
# xarchiver # Archive viewer
# texmaker # LaTeX editor
# tigervnc # VNC
# qiv # Picture viewer
# feh # Picture viewer
# gimp # Picture editor
#
# #virtualbox virtualbox-host-modules-arch
#
# # Backend
# texlive-most texlive-lang pandoc # LaTeX
# libmtp gvfs ntfs-3g # file system
# python-dbus nss-mdns # DNS
# udiskie polkit # Auto-mounting
# linux-headers # C-headers
# libnotify dunst lxsession # notification daemon
# mtpfs android-file-transfer # Android
# gnome-keyring # Password storage
# )
#
# # Packages to install(non-AUR)
# # default: omit
# aur_packages=(
# # Applications
# visual-studio-code-bin # VSCode editor
# slack-desktop # Team
# discord # Game
# whatsapp-web-desktop # Group
# skypeforlinux-stable-bin # Skype
# onlyoffice-bin # Nice but hardly usable office
# typora # Nice markdown editor
# spacefm # File manager
# minecraft # Finally a game(at least it's turing complete)
# #matlab libselinux #Matlab(duh)
# #vmware-workstation # VM
# umlet # UML
# gravit-designer-bin # Nice design program
# kaku-bin # Music streamer
# grabc # Color picker
# #jabref # Reference manager
#
# # IDEs
# intellij-idea-ultimate-edition intellij-idea-ultimate-edition-jre # JetBrains Java IDE
#
# # Other
# gksu # Graphical sudo request
# polybar # Best bar
# dmenu2 # Launcher
# #tamzen-font powerline-console-fonts ttf-mplus # Moar fontz
# #firefox-extension-stylish # Styling plugin (dead)
# jsawk-git # For some plugin in my dotfiles(don't know which one rn tbh)
# enpass-bin # Key manager
# jdk jdk8 jdk9 jdk-devel # Java
# nordnm # VPN provider
# python-pywal # Best eye candy there is
# ibus-mozc-ut2 # Input method manager
# dotdrop # dotfile manager
# )
#
#
#
#
#
#
# # Directory for Git repositories
# git_dir="$home/Dokumente/git"
#
# # Dotfiles location and repo
# # default: (skip)
# dotfiles_git="https://[email protected]/raember/dotfiles.git"
# dotfiles_dir="$home/dotfiles"
# dotfiles_install="" # Handle installation manually
#
# # Folders to create
# directories=(
# "$home/Downloads"
# "$git_dir"
# "$home/Bilder/wallpaper"
# "$home/Musik"
# "$home/Video"
# "$home/Dokumente"
# "$home/.bin"
# "$home/.config/{bspwm,sxhkd,polybar}"
# )
#
# # Packages to install(non-AUR)
# # default: omit
# # Script to run after the installation.
# # Used to setup installed packages
# aftermath() {
# # bspwm
# echo "exec bspwm" > $home/.xinitrc
# cp /usr/share/doc/bspwm/example/bspwmrc $home/.config/bspwm/
# cp /usr/share/doc/bspwm/example/sxhkdrc $home/.config/sxhkd/
#
# # powerline
# echo -e "powerline-daemon -q\n. /usr/lib/python3.6/site-packages/powerline/bindings/zsh/powerline.zsh" >> .zshrc
#
# # vimpager
# echo -e "export PAGER='vimpager'\nalias less=\$PAGER" > $home/.bashrc
#
# # ufw
# sudo ufw default deny
# sudo ufw enable
# sudo systemctl enable ufw
# sudo systemctl start ufw
#
# # virtualbox
# #sudo modprobe vboxdrv
#
# # slim
# sudo systemctl enable slim
#
# # cups
# sudo systemctl enable org.cups.cupsd.service
# sudo systemctl start org.cups.cupsd.service
#
# cd $home/Bilder/wallpaper
# wget https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-557971.jpg
# wal -i *
# cd -
# }