Browse Source

Refactor repo

pipeline
bdherouville 2 years ago
parent
commit
2b64ed46b3
  1. 0
      application/Dockerfile
  2. 7
      application/src/app.py
  3. 0
      application/src/static/style.css
  4. 0
      application/src/templates/index.html
  5. 70
      chrome_repackage/README.md
  6. 1555
      chrome_repackage/google_chrome_repackage.spec
  7. 24
      imagebuilder/kiosk.ks
  8. 69
      imagebuilder/kiosk.toml
  9. 46
      kiosk.toml

0
Dockerfile → application/Dockerfile

7
src/app.py → application/src/app.py

@ -1,7 +1,8 @@
import platform import platform
from flask import Flask, render_template from flask import Flask, render_template
app = Flask(__name__) app = Flask(__name__, template_folder="/app/templates")
@app.route('/') @app.route('/')
def system_info(): def system_info():
@ -13,7 +14,7 @@ def system_info():
'Machine': platform.machine(), 'Machine': platform.machine(),
'Processor': platform.processor() 'Processor': platform.processor()
} }
return render_template('system_info.html', system_info=system_info) return render_template('index.html', system_info=system_info)
if __name__ == '__main__': if __name__ == '__main__':
app.run(debug=True) app.run(host="0.0.0.0", debug=True)

0
src/static/style.css → application/src/static/style.css

0
src/templates/index.html → application/src/templates/index.html

70
chrome_repackage/README.md

@ -0,0 +1,70 @@
# Google Chrome RPM Installation Guide
This guide provides step-by-step instructions for downloading and rebuilding the Google Chrome RPM package on a RPM-based Linux distribution.
## Prerequisites
Before you proceed, ensure that you have the following prerequisites installed on your system:
- `rpmrebuild`: A tool for rebuilding RPM packages.
- `rpmbuild`: The RPM Package Manager build tool.
## Installation Steps
1. **Download Google RPM**
```bash
# Replace <URL> with the actual download URL
wget <URL>/google-chrome-stable-119.0.6045.199-1.x86_64.rpm
```
2. **Rebuild the RPM Package**
```bash
rpmrebuild -s google-chrome-stable.spec -p google-chrome-stable-119.0.6045.199-1.x86_64.rpm
```
3. **Extract the Contents**
```bash
rpm2cpio google-chrome-stable-119.0.6045.199-1.x86_64.rpm | cpio -idmv
```
4. **Move Google Chrome to the Desired Location**
```bash
mv opt/google usr/bin/
```
5. **Create Symbolic Links**
```bash
cd usr/bin/
rm -f google-chrome-stable
ln -s google/chrome/google-chrome google-chrome-stable
ln -s google/chrome/google-chrome chrome
cd ../..
```
6. **Create RPM Build Directory**
```bash
mkdir -p $HOME/rpmbuild/BUILDROOT/google-chrome-stable-119.0.6045.199-1.x86_64
```
7. **Copy Files to RPM Build Directory**
```bash
for i in etc usr; do cp -r $i $HOME/rpmbuild/BUILDROOT/google-chrome-stable-119.0.6045.199-1.x86_64/; done
```
8. **Build the RPM Package**
```bash
rpmbuild -bb google-chrome-stable.spec
```
After completing these steps, you should have successfully downloaded, rebuilt, and repackaged the Google Chrome RPM for your system. The resulting RPM package will be available in the RPM build directory (`$HOME/rpmbuild/RPMS/x86_64/`).
Note: Ensure that you replace `<URL>` with the actual download URL of the Google Chrome RPM.

1555
chrome_repackage/google_chrome_repackage.spec

File diff suppressed because it is too large

24
kiosk.ks → imagebuilder/kiosk.ks

@ -8,11 +8,11 @@ zerombr
clearpart --all --initlabel clearpart --all --initlabel
autopart --type=plain --fstype=xfs --nohome autopart --type=plain --fstype=xfs --nohome
network --bootproto=dhcp network --bootproto=dhcp
rootpw --iscrypted $6$3OrUXJfD.64WiZl2$4/oBFyFgIyPI6LdLCbE.h99YBrFa..pC3x3WlHNH8mUf4ssZmhlhy17CHc0n3kAvHvWecpqunVOd/4kOGB7Ms. rootpw --iscrypted $6$vnnc7bdpgCJMBDB.$TRBsboYscXsKPv57IHnKuy1BzLhuejJgft17s07ZQRSsgFhPI9QLPX6Spt4AiND4TaolQAR8FzMV2Osf2dhj10
#Use this line if creating an Edge Installer ISO that includes a local ostree commit #Use this line if creating an Edge Installer ISO that includes a local ostree commit
#ostreesetup --osname=rhel --url=file:///ostree/repo --ref=rhel/9/x86_64/edge --nogpg #ostreesetup --osname=rhel --url=file:///ostree/repo --ref=rhel/9/x86_64/edge --nogpg
#Use this to fetch from a remote URL #Use this to fetch from a remote URL
ostreesetup --osname=rhel --url=http://[YOUR_SERVER_IP:PORT]/repo --ref=rhel/9/x86_64/edge --nogpg ostreesetup --osname=rhel --url=http://192.168.0.116:30239/repo --ref=rhel/9/x86_64/edge --nogpg
%post %post
#Default to graphical boot target #Default to graphical boot target
@ -30,17 +30,31 @@ Session=gnome-kiosk-script
SystemAccount=false SystemAccount=false
EOF EOF
#Add url environment variable
cat >> /home/kiosk/.bashrc << 'EOF'
export KIOSK_URL=http://`ip -br a | grep -oP 'br-ex\s+UNKNOWN\s+\K[0-9.]+'`:30000
EOF
#Configure the kiosk script to run firefox in kiosk mode and display our example URL #Configure the kiosk script to run firefox in kiosk mode and display our example URL
mkdir -p /home/kiosk/.local/bin/ mkdir -p /home/kiosk/.local/bin/
cat > /home/kiosk/.local/bin/gnome-kiosk-script << 'EOF' cat > /home/kiosk/.local/bin/gnome-kiosk-script << 'EOF'
#!/bin/sh #!/bin/sh
. ~/.bashrc
while true; do while true; do
firefox -kiosk https://voyage.kiosk.fr/ /usr/bin/google/chrome/chrome --password-store=basic --no-default-browser-check --no-first-run --ash-no-nudges --disable-search-engine-choice-screen -kiosk ${KIOSK_URL}
done done
EOF EOF
#Ensure the files are owned by our unprivileged user and the script is executable #Ensure the files are owned by our unprivileged user and the script is executable
chown -R 1000:1000 /home/kiosk chown -R 1001:1001 /home/kiosk
chmod 755 /home/kiosk/.local/bin/gnome-kiosk-script chmod 555 /home/kiosk/.local/bin/gnome-kiosk-script
/etc/crio/openshift-pull-secret
cat > /etc/crio/openshift-pull-secret << 'EOF'
<YOUR_PULL_SECRET>
EOF
%end %end

69
imagebuilder/kiosk.toml

@ -0,0 +1,69 @@
name = "kiosk"
description = "Example Kiosk"
version = "0.0.8"
modules = []
groups = []
[[packages]]
name = "gdm"
version = "*"
[[packages]]
name = "gnome-kiosk"
version = "*"
[[packages]]
name = "gnome-kiosk-script-session"
version = "*"
[[packages]]
name = "firefox"
version = "*"
[[packages]]
name = "google-chrome-stable-119.0.6045.199-1"
version = "*"
[[packages]]
name = "cockpit"
[[packages]]
name = "microshift"
version = "*"
[[packages]]
name = "cockpit-system"
[customizations]
hostname = "kiosk.local"
[customizations.services]
enabled = ["cockpit.socket", "sshd", "microshift"]
#disabled = ["postfix", "telnetd"]
[customizations.timezone]
timezone = "Europe/Paris"
ntpservers = ["0.fr.pool.ntp.org", "1.fr.pool.ntp.org"]
[customizations.locale]
languages = ["fr_FR.UTF-8"]
keyboard = "fr"
#22 ssh / 9090 cockpit / 6443 microshift
[customizations.firewall]
ports = ["22:tcp", "30000:tcp", "9090:tcp", "6443:tcp"]
[[customizations.user]]
name = "kiosk"
description = "kiosk"
password = '<password hash obatained with: python3 -c 'import crypt,getpass;pw=getpass.getpass();print(crypt.crypt(pw) if (pw==getpass.getpass("Confirm: ")) else exit())' >'
[[customizations.user]]
name = "admin"
description = "admin"
password = '<password hash obatained with: python3 -c 'import crypt,getpass;pw=getpass.getpass();print(crypt.crypt(pw) if (pw==getpass.getpass("Confirm: ")) else exit())' >'
key = "<ssh public key>"
home = "/home/admin/"
shell = "/usr/bin/bash"
groups = ["users", "wheel"]

46
kiosk.toml

@ -1,46 +0,0 @@
name = "kiosk"
description = "Kiosk blueprint"
version = "0.0.3"
modules = []
groups = []
[[packages]]
name = "gdm"
version = "*"
[[packages]]
name = "gnome-kiosk"
version = "*"
[[packages]]
name = "gnome-kiosk-script-session"
version = "*"
[[packages]]
name = "firefox"
version = "*"
[[packages]]
name = "cockpit-system"
[customizations]
[customizations.services]
enabled = ["cockpit.socket"]
hostname = "kiosk"
[customizations.firewall]
ports = ["22:tcp", "80:tcp", "443:tcp", "9090:tcp"]
[[customizations.user]]
name = "kiosk"
description = "kiosk"
#password hash obtained with:
# python3 -c 'import crypt,getpass;pw=getpass.getpass();print(crypt.crypt(pw) if (pw==getpass.getpass("Confirm: ")) else exit())'
password = ""
key = "<ssh public key>"
home = "/home/admin/"
shell = "/usr/bin/bash"
Loading…
Cancel
Save