restructure A

This commit is contained in:
6543 2018-02-20 22:15:23 +01:00
parent fddfbf27f8
commit 7330858422
8 changed files with 97 additions and 16 deletions

View File

@ -16,8 +16,9 @@ Copy the ipfs file from this repo to the directory for apt transport methods:
cd apt-transport-ipfs
sudo cp ipfs /usr/lib/apt/methods/ipfs

Install ipfs as daemon:
#-> server Install ipfs
https://github.com/6543/ipfs_daemon
su ipfs -c "ipfs config --json Experimental.FilestoreEnabled true"

# Configure


40
README_CLIENT.md Normal file
View File

@ -0,0 +1,40 @@
IPFS transport for apt

# Requirements

sudo apt install python-pip git gzip wget
sudo pip install ipfsapi

# Install

Copy the ipfs file from this repo to the directory for apt transport methods:

git clone https://github.com/6543/apt-transport-ipfs
cd apt-transport-ipfs/client
sudo cp ipfs /usr/lib/apt/methods/ipfs

Use the instruktions from https://github.com/6543/ipfs_daemon/blob/master/setup-ipfs-daemon to start ipfs on boot

# Configure

Add an IPFS mirror to your apt sources.list file.

Backup your /etc/apt/sources.list, remove all the lines that it has and leave it
just with:

#archive.ubuntu.com
deb ipfs:/ipns/QmXfAyjHThwksUyW9BwuqCDuzu1PM1XQkR1HVTbActvYDJ xenial main restricted universe multiverse
deb ipfs:/ipns/QmXfAyjHThwksUyW9BwuqCDuzu1PM1XQkR1HVTbActvYDJ xenial-security main restricted universe multiverse
deb ipfs:/ipns/QmXfAyjHThwksUyW9BwuqCDuzu1PM1XQkR1HVTbActvYDJ xenial-updates main restricted universe multiverse
deb-src ipfs:/ipns/QmXfAyjHThwksUyW9BwuqCDuzu1PM1XQkR1HVTbActvYDJ xenial main restricted universe multiverse
deb-src ipfs:/ipns/QmXfAyjHThwksUyW9BwuqCDuzu1PM1XQkR1HVTbActvYDJ xenial-security main restricted universe multiverse
deb-src ipfs:/ipns/QmXfAyjHThwksUyW9BwuqCDuzu1PM1XQkR1HVTbActvYDJ xenial-updates main restricted universe multiverse

#archive.canonical.com
deb ipfs:/ipns/QmUajtQCL6yHcBaYxsZKyD8QH7n977ZVxjU5yMXwYC183c xenial partner
deb-src ipfs:/ipns/QmUajtQCL6yHcBaYxsZKyD8QH7n977ZVxjU5yMXwYC183c xenial partner

# New archives:

if you like to add other archives to IPFS, i have ~ 100GB more ...
just open an issue and we can debate it.

27
README_MIRROR.md Normal file
View File

@ -0,0 +1,27 @@
IPFS apt-transport-ifs Mirror

# Requirements

sudo apt apt-mirror git gzip wget

to start ipfs on boot:
https://github.com/6543/ipfs_daemon/blob/master/setup-ipfs-daemon

# Install

Copy the ipfs file from this repo to the directory for apt transport methods:

git clone https://github.com/6543/apt-transport-ipfs
cd apt-transport-ipfs/mirror
... [WIP] ...

Use the instruktions from https://github.com/6543/ipfs_daemon/blob/master/setup-ipfs-daemon to start ipfs on boot

git clone https://github.com/6543/ipfs_daemon
... [WIP] ...
su ipfs -c "ipfs config --json Experimental.FilestoreEnabled true"

# Configure

# /etc/apt/mirror.list
... [WIP] ...

View File

28
mirror/sync_mirror_now.sh Normal file
View File

@ -0,0 +1,28 @@
#!/bin/bash

## start daemon if not started
ipfs daemon &

## prepare dirs ...
cd /home/maddl/.ipfs/mirror/
#sudo umount archive.ubuntu.com
#sudo umount archive.canonical.com
#sudo mount --bind /data/local/CryptoCurency/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ archive.ubuntu.com
#sudo mount --bind /data/local/CryptoCurency/apt-mirror/mirror/archive.canonical.com/ubuntu/ archive.canonical.com

## mirror
sudo -u apt-mirror -g apt-mirror apt-mirror

#ipfs key gen --type=rsa --size=2048 archive.canonical.com
# -> QmUajtQCL6yHcBaYxsZKyD8QH7n977ZVxjU5yMXwYC183c
hash_canonical="$(ipfs add --progress --local --nocopy --fscache --recursive /home/maddl/.ipfs/mirror/archive.canonical.com/ | tail -n1)"
name_canonical="$(ipfs name publish --key=archive.canonical.com `echo $hash_canonical | cut -d ' ' -f 2` | cut -d ' ' -f 3 | tr -d :)"
echo "archive.canonical.com/ubuntu -> $name_canonical"
echo 'done'

#ipfs key gen --type=rsa --size=2048 archive.ubuntu.com
# -> QmXfAyjHThwksUyW9BwuqCDuzu1PM1XQkR1HVTbActvYDJ
hash_ubuntu="$(ipfs add --progress --local --nocopy --fscache --recursive /home/maddl/.ipfs/mirror/archive.ubuntu.com/ | tail -n1)"
name_ubuntu="$(ipfs name publish --key=archive.ubuntu.com `echo $hash_ubuntu | cut -d ' ' -f 2` | cut -d ' ' -f 3 | tr -d :)"
echo "archive.utuntu.com/ubuntu -> $name_ubuntu"
echo 'done'

View File

@ -1,15 +0,0 @@
#!/bin/bash

mkdir --parents test-archive/dists/xenial/main/binary-amd64/by-hash/SHA256/
mkdir --parents test-archive/dists/xenial/main/i18n/
mkdir --parents test-archive/pool/main/h/hello/

wget --directory-prefix=test-archive/dists/xenial/ http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease
wget --directory-prefix=test-archive/dists/xenial/ http://archive.ubuntu.com/ubuntu/dists/xenial/Release
wget --directory-prefix=test-archive/dists/xenial/main/binary-amd64/by-hash/SHA256/ http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/by-hash/SHA256/76858a337b1665561a256cea6f7ef32515517754e3c5e54c1895cf29e1b41884
wget --directory-prefix=test-archive/dists/xenial/main/binary-amd64/ http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages.xz
wget --directory-prefix=test-archive/dists/xenial/main/i18n/ http://archive.ubuntu.com/ubuntu/dists/xenial/main/i18n/Translation-en.xz
wget --directory-prefix=test-archive/pool/main/h/hello/ http://archive.ubuntu.com/ubuntu/pool/main/h/hello/hello_2.10-1_amd64.deb

hash="$(ipfs add --quiet --recursive test-archive | tail -n1)"
ipfs name publish "$hash"