Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Blengon Rapat Tatap 001

Requirements

  • Docker
  • Redis
  • gpg pbuilder debootstrap devscripts python-apt reprepro

Install

curl -o- https://raw.githubusercontent.com/BlankOn/irgsh-go/master/utils/scripts/install.sh | bash -s v0.0.21-alpha

Skrip di atas akan menambahkan pengguna spesial bernama irgsh ke sistem. Tambahkan hak akses ke Docker untuk pengguna irgsh,

sudo usermod -aG docker irgsh

Inisiasi awal

CLI

Mendaftarkan pengguna ke IRGSH

Dengan pengguna biasa yang akan bekerja dengan irgsh-cli, generate kunci GPG tanpa passphrase untuk pengguna tersebut,

gpg --generate-key

Kemudian ekspor kunci publiknya

gpg --armor --export 0D7D9A42E03ACFA2933227F7A13769F4DB99B6CD > /tmp/kunci-pengguna.pub

String 0D7D9A42E03ACFA2933227F7A13769F4DB99B6CD didapatkan dari perintah gpg -k. Contoh keluaran

$ gpg -K
/home/herpiko/.gnupg/pubring.kbx
--------------------------------
sec   rsa4096 2019-07-18 [SCEA] [expires: 2024-07-16]
      0D7D9A42E03ACFA2933227F7A13769F4DB99B6CD
uid           [ unknown] IRGSH <blankon-dev@googlegroups.com>
ssb   rsa4096 2019-07-18 [SEA] [expires: 2024-07-16]

Bawa berkas /tmp/kunci-pengguna.pub ini ke tempat yang dapat dijangkau user irgsh. Lalu masuk ke user irgsh dan impor kunci tersebut.

sudo su irgsh
gpg --import /tmp/kunci-pengguna.pub

Sampai di titik ini, kunci pengguna sudah terdaftar ke IRGSH dan pengguna nantinya berhak menyetor paket.

Menyetel irgsh-cli
irgsh-cli config --chief http://localhost:8080 --key 0D7D9A42E03ACFA2933227F7A13769F4DB99B6CD

Maksud dari perintah di atas adalah irgsh-cli diarahkan untuk berkomunikasi dengan server IRGSH yang hidup di localhost port 8080 dan kita menggunakan kunci 0D7D9A42E03ACFA2933227F7A13769F4DB99B6CD (lihat dengan gpg -k di masing-masing) sebagai otentikasi terhadap server tersebut.

Builder

base.tgz adalah berkas chroot yang akan digunakan sebagai lingkungan pembangunan paket. Perintah ini mungkin selesai agak lama karena akan mengunduh banyak paket untuk lingkungan pembangunan paket. Perintah untuk menginisiasi base.tgz (membutuhkan sudo atau root),

sudo irgsh-builder init-base

Kemudian masuk ke user irgsh , lalu persiapkan kontainer pbuilder dengan perintah,

sudo su irgsh
irgsh-builder init-builder

Repository

Masuk ke user irgsh, lalu inisiasi pembuatan lumbung,

sudo su irgsh
irgsh-repo init

Menghidupkan layanan IRGSH

Ada 3 layanan yang akan dihidupkan, yaitu,

  • irgsh-chief - sebagai induk
  • irgsh-builder - sebagai pekerja pembangun paket
  • irgsh-repo - sebagai lumbung paket

Layanan dapat dihidupkan dengan,

sudo /etc/init.d/irgsh-chief start
sudo /etc/init.d/irgsh-builder start
sudo /etc/init.d/irgsh-repo start

Setelah layanan hidup, irgsh-chief dapat dicek dengan mengakses http://localhost:8080 (atau hostname/alamat IP dari mesin) di peramban.

Ada pun log dari layanan-layanan tersebut dapat dicek di,

  • /var/log/irgsh/chief.log
  • /var/log/irgsh/builder.log
  • /var/log/irgsh/repo.log

Menyetor paket

Menyetor paket membutuhkan 2 bahan:

  • source - Sumber kode dari paket
  • package - Direktori debian yang mendefinisikan paket

Contoh yang akan digunakan di sini adalah paket bromo-theme (https://github.com/BlankOn/bromo-theme.git dan https://github.com/BlankOn-packages/bromo-theme.git)

Lakukan penyetoran dengan perintah,

irgsh-cli submit --source https://github.com/BlankOn/bromo-theme.git --package https://github.com/BlankOn-packages/bromo-theme.git --experimental

--experimental di sini menandakan paket tersebut akan masuk ke lumbung experimen.

ID dari build paket ada di baris terakhir dari keluaran,

$ irgsh-cli submit --source https://github.com/BlankOn/bromo-theme.git --package https://github.com/BlankOn-packages/bromo-theme.git --experimental
sourceUrl: https://github.com/BlankOn/bromo-theme.git
packageUrl: https://github.com/BlankOn-packages/bromo-theme.git
Enumerating objects: 520, done.
Total 520 (delta 0), reused 0 (delta 0), pack-reused 520
cd /home/herpiko/.irgsh/tmp/1cf00460-5859-4c99-9a43-4c4bce427cef/package && debuild -S -k0D7D9A42E03ACFA2933227F7A13769F4DB99B6CD
{"pipelineId":"2019-07-25-221102_a9f76c59-9715-4459-b654-60bcd464b19f"}
2019-07-25-221102_a9f76c59-9715-4459-b654-60bcd464b19f

Status paket dapat dicek dengan irgsh-cli status ID_PAKET

$ irgsh-cli 2019-07-25-221102_a9f76c59-9715-4459-b654-60bcd464b19f
Checking the status of 2019-07-25-221102_a9f76c59-9715-4459-b654-60bcd464b19f ...
SUCCESS
@samsulmaarif
Copy link

samsulmaarif commented Jul 25, 2019

pak @herpiko saya ada issue di sini :

irgsh@irgsh:~$ irgsh-repo init
Are you sure you want to initialize new repository? Any existing distribution will be flushed.y
##### Initializing new repository for verbeek
2019/07/25 14:55:26 Waiting for /var/lib/irgsh/repo/init.log to appear...

##### Preparing reprepro template
##### RUN mkdir -p /var/lib/irgsh/repo && rm -rf /var/lib/irgsh/repo/verbeek; cp -vR /usr/share/irgsh/reprepro-template /var/lib/irgsh/repo/verbeek
'/usr/share/irgsh/reprepro-template' -> '/var/lib/irgsh/repo/verbeek'
'/usr/share/irgsh/reprepro-template/conf' -> '/var/lib/irgsh/repo/verbeek/conf'
'/usr/share/irgsh/reprepro-template/conf/blacklist.pkg' -> '/var/lib/irgsh/repo/verbeek/conf/blacklist.pkg'
'/usr/share/irgsh/reprepro-template/conf/tiffany.py' -> '/var/lib/irgsh/repo/verbeek/conf/tiffany.py'
'/usr/share/irgsh/reprepro-template/conf/changelogs.sh' -> '/var/lib/irgsh/repo/verbeek/conf/changelogs.sh'
'/usr/share/irgsh/reprepro-template/conf/distributions.orig' -> '/var/lib/irgsh/repo/verbeek/conf/distributions.orig'
'/usr/share/irgsh/reprepro-template/conf/options.orig' -> '/var/lib/irgsh/repo/verbeek/conf/options.orig'
'/usr/share/irgsh/reprepro-template/conf/updates.orig' -> '/var/lib/irgsh/repo/verbeek/conf/updates.orig'

##### Populate the reprepro's updates config file with values from irgsh's config.yml
##### RUN cd /var/lib/irgsh/repo/verbeek/conf && cat updates.orig | 
		sed 's/UPSTREAM_NAME/merge.sid/g' | 
		sed 's/UPSTREAM_DIST_CODENAME/sid/g' | 
		sed 's/UPSTREAM_DIST_URL/http:\/\/kartolo.sby.datautama.net.id\/debian/g' | 
		sed 's/DIST_SUPPORTED_ARCHITECTURES/amd64 source/g' | 
		sed 's/UPSTREAM_DIST_COMPONENTS/main non-free>restricted contrib>extras/g' > updates && rm updates.orig

##### Populate the reprepro's distributions config file with values from irgsh's config.yml
##### RUN cd /var/lib/irgsh/repo/verbeek/conf && cat distributions.orig |
		sed 's/DIST_NAME/BlankOn/g' |
		sed 's/DIST_LABEL/BlankOn/g' |
		sed 's/DIST_CODENAME/verbeek/g' |
		sed 's/DIST_COMPONENTS/main restricted extras extras-restricted/g' |
		sed 's/DIST_SUPPORTED_ARCHITECTURES/amd64 source/g' |
		sed 's/DIST_VERSION_DESC/BlankOn Linux 12.0 Verbeek/g' |
		sed 's/DIST_VERSION/12.0/g' |
		sed 's/DIST_SIGNING_KEY/D40CB01CC5DBD57422ADE46A2CACADE0E01DB30F/g' |
		sed 's/UPSTREAM_NAME/merge.sid/g'> distributions && rm distributions.orig

##### Populate the reprepro's options config file with values from irgsh's config.yml
##### RUN cd /var/lib/irgsh/repo/verbeek/conf && \
	cat options.orig | sed 's/IRGSH_REPO_WORKDIR/\/var\/lib\/irgsh\/repo\/verbeek/g' > options && \
	rm options.orig

##### Initialize the reprepro repository for the first time
##### RUN cd /var/lib/irgsh/repo/verbeek/ && reprepro -v -v -v export
Could not find any key matching 'D40CB01CC5DBD57422ADE46A2CACADE0E01DB30F'!
ERROR: Could not finish exporting 'verbeek'!
There have been errors!
Created directory "/var/lib/irgsh/repo/verbeek/db"
Exporting verbeek...
Created directory "/var/lib/irgsh/repo/verbeek/www"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/main"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/main/binary-amd64"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/main/debian-installer"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/main/debian-installer/binary-amd64"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/main/source"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/restricted"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/restricted/binary-amd64"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/restricted/source"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/extras"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/extras/binary-amd64"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/extras/source"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/extras-restricted"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/extras-restricted/binary-amd64"
Created directory "/var/lib/irgsh/repo/verbeek/www/dists/verbeek/extras-restricted/source"
 generating main/Contents-amd64...
 generating restricted/Contents-amd64...
 generating extras/Contents-amd64...
 generating extras-restricted/Contents-amd64...
 generating main/Contents-udeb-amd64...
error: exit status 255
exit status 255

@herpiko
Copy link
Author

herpiko commented Jul 25, 2019

@samsulmaarif Ini perlu mastikan kunci gpg milik irgsh terdaftar di /etc/irgsh/config.yml. Galatnya kurang jelas yak?

@herpiko
Copy link
Author

herpiko commented Jul 25, 2019

Kunci privatnya ga masuk-masuk

irgsh@radnet:/home/spasi$ GNUPGHOME=/var/lib/irgsh/gnupg gpg -k
/var/lib/irgsh/gnupg/pubring.kbx
--------------------------------
pub   rsa4096 2019-07-25 [SCEA] [expires: 2024-07-23]
      59F6D135A169632B7C124607BE6247DD6393C405
uid           [ultimate] IRGSH <blankon-dev@googlegroups.com>
sub   rsa4096 2019-07-25 [SEA] [expires: 2024-07-23]

pub   rsa3072 2019-07-25 [SC] [expires: 2021-07-24]
      E51D134ACD524C034C78DE7D1B252E7DE2AFB472
uid           [ unknown] darian <kontak@darian.my.id>
sub   rsa3072 2019-07-25 [E] [expires: 2021-07-24]

pub   rsa4096 2019-07-25 [SCEA] [expires: 2024-07-23]
      D8277549A3EE536A35A2E1F91D60F58029FAE1BF
uid           [ unknown] IRGSH <blankon-dev@googlegroups.com>
sub   rsa4096 2019-07-25 [SEA] [expires: 2024-07-23]

irgsh@radnet:/home/spasi$ GNUPGHOME=/var/lib/irgsh/gnupg gpg -K
irgsh@radnet:/home/spasi$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment