Coder Social home page Coder Social logo

freeyoung / aput Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 0.0 10 KB

Package upload tools for Aptly-managed debian repository, which can be used standalone or together with dput.

Home Page: http://www.aptly.info/

License: Do What The F*ck You Want To Public License

Shell 100.00%

aput's Introduction

aput

aput is a package upload tool for debian repository managed by aptly.

dput support? Yes! Please see dput2aptly.

howto

This howto assumes that you are starting from scratch.

If you are an experienced user, just pick what you need.

  • Install Aptly

    Follow the instructions here.

  • Install nginx package

    $ sudo apt-get install nginx
    
  • Add login shell for www-data (the user nginx runs as)

    $ sudo chsh -s /bin/bash www-data
    

    Then you are able to switch to www-data with bash shell.

    $ sudo su - www-data
    
  • Configure GPG for www-data

    Follow the manual of GnuPG here.

  • Create your aptly repo

    $ aptly repo create myrepo  # change "myrepo" to your own repo name
    
  • Create your config file for aput

    $ cat ~/.aput.cfg
    
    APUT_HOST=deb.yourdomain.com
    APUT_SSH_USER=username
    APUT_SSH_PORT=22
    APUT_REPO_OWNER=www-data
    APUT_REPO_NAME=myrepo
    APUT_REPO_DIST=trusty
    APUT_REPO_ARCH=i386,amd64,all,source
    
  • Add a new nginx config file for the repo

    $ cat /etc/nginx/conf.d/repo.conf
    
    server {
      listen 80;
      server_name deb.yourdomain.com;
    
      root /var/www/.aptly/public;
      autoindex on;
    
      location = /robots.txt {
          return 200 "User-agent: *\nDisallow: /\n";
      }
    }
    

    Remember to reload your nginx server.

  • Symlink aput to your PATH

    $ git clone https://github.com/freeyoung/aput
    $ cd aput
    $ sudo ln -sf aput /usr/local/bin/aput
    
  • Add your pubkey to trustedkeys.gpg

    $ gpg --no-default-keyring --keyring trustedkeys.gpg --recv-keys YOUR_KEY_ID
    
  • Build and upload your package

    $ dpkg-buidpackage -us -uc -sa -rfakeroot
    ...
    ...
    $ aput your_package_0.0.1_version_arch.changes
    

    Enjoy!


dput2aptly

dput2aptly is a script for dput as the post_upload_command, to upload your own packages to an aptly-managed debian repo.

howto

  • Copy dput2aptly to your aptly server, as it is going to be run remotely via SSH.

    • dput2aptly needs to be executable and in $PATH.
  • Add a new section in your dput.cf. For example:

    [myrepo]
    fqdn = deb.yourdomain.com
    method = rsync
    login = *
    incoming = /tmp/deb/incoming
    pre_upload_command = ssh %(fqdn)s mkdir -p %(incoming)s
    post_upload_command = ssh %(fqdn)s sudo dput2aptly repo_owner repo_name %(myrepo)s %(incoming)s
    
    • rsync is not mandatory. You can use scp if you like.
    • incoming should be a directory that can be written by your ssh user.
  • Use dput as you were used to before. Enjoy!

    dput myrepo:trusty your_package_0.0.1_version_arch.changes
    dput myrepo:trusty,xenial your_package_0.0.1_version_arch.changes
    

aput's People

Contributors

freeyoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aput's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.