Ampache

From Bitpost wiki
Revision as of 23:02, 7 July 2016 by M (talk | contribs) (→‎CONFIG)

INSTALL

stand ampache up and see where it is (also use it for music)

   *   cdh  # -> HangTheDJ
       mkdir ampache-github && cd ampache-github
       # NOTE that there is an OLD github repo with our overlay here: ampache-gh-htdj
       # That one is REALLY IMPORTANT, it is our most recent plugin code at this time
       # get a fresh one for our latest standup
       git clone https://github.com/ampache/ampache.git
   * install composer on bitpost (to get php dependencies)
       # MDM from composer website:
       php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
       php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
       php composer-setup.php
       php -r "unlink('composer-setup.php');"
       ---
       # MDM following wiki notes, we configure composer for ampache and get all dependencies
       ./composer.phar install --prefer-source --no-interaction
       # holy hell it is OFF to the races... i see happyworm/jplayer in there!!!  :-)
       ---
       simply served this up from apache config and we are off:
           /home/m/development/thedigitalage/HangTheDJ/ampache-github
           i had to chown m:apache, then chmod g+w config, and apache can now write a config from the installer, whoop
           ---
           mysql db:   ampache-github
           mysql user: ampache-github / ***
           admin: m / ***
           edit .htaccess files:
               rest/.htaccess (copy from .htaccess.dist)
               play/
               channel/
           edit config/ampache.cfg.php
               ; update webpath
               webpath = "/music"
   and...
   https://bitpost.com/music/ is LIVE

CONFIG

log in as admin

  • Enable direct downloading: Admin->Server->Options->Allow Download->Enable+User

"use cases" and what they set - i chose "community" and auth is OFF, fix that:

   $trconfig = array(                                                                                                                                                                                              
       'use_auth' => 'true',                                                                                                                                                                                       
       'ratings' => 'true',                                                                                                                                                                                        
       'userflags' => 'true',                                                                                                                                                                                      
       'sociable' => 'true',                                                                                                                                                                                       
       'licensing' => 'false',                                                                                                                                                                                     
       'wanted' => 'true',                                                                                                                                                                                         
       'channel' => 'true',                                                                                                                                                                                        
       'live_stream' => 'true',                                                                                                                                                                                    
       'allow_public_registration' => 'false',                                                                                                                                                                     
       'cookie_disclaimer' => 'false',                                                                                                                                                                             
       'share' => 'false'                                                                                                                                                                                          
   );                                                                                                                                                                                                              
                                                                                                                                                                                                                   
   $dbconfig = array(                                                                                                                                                                                              
       'download' => '1',                                                                                                                                                                                          
       'share' => '0',                                                                                                                                                                                             
       'allow_video' => '1',                                                                                                                                                                                       
       'home_now_playing' => '1',                                                                                                                                                                                  
       'home_recently_played' => '1'                                                                                                                                                                               
   );                                                                                                                                                                                                              
                                                                                                                                                                                                                   
   switch ($case) {                                                                                                                                                                                                
       case 'minimalist':                                                                                                                                                                                          
           $trconfig['ratings']     = 'false';                                                                                                                                                                     
           $trconfig['userflags']   = 'false';                                                                                                                                                                     
           $trconfig['sociable']    = 'false';                                                                                                                                                                     
           $trconfig['wanted']      = 'false';                                                                                                                                                                     
           $trconfig['channel']     = 'false';                                                                                                                                                                     
           $trconfig['live_stream'] = 'false';                                                                                                                                                                     
                                                                                                                                                                                                                   
           $dbconfig['download']    = '0';                                                                                                                                                                         
           $dbconfig['allow_video'] = '0';                                                                                                                                                                         
                                                                                                                                                                                                                   
           // Default local UI preferences to have a better 'minimalist first look'.                                                                                                                               
           setcookie('sidebar_state', 'collapsed', time() + (30 * 24 * 60 * 60), '/');                                                                                                                             
           setcookie('browse_album_grid_view', 'false', time() + (30 * 24 * 60 * 60), '/');                                                                                                                        
           setcookie('browse_artist_grid_view', 'false', time() + (30 * 24 * 60 * 60), '/');                                                                                                                       
           break;                                                                                                                                                                                                  
       case 'community':                                                                                                                                                                                           
           $trconfig['use_auth']                  = 'false';                                                                                                                                                       
           $trconfig['licensing']                 = 'true';                                                                                                                                                        
           $trconfig['wanted']                    = 'false';                                                                                                                                                       
           $trconfig['live_stream']               = 'false';                                                                                                                                                       
           $trconfig['allow_public_registration'] = 'true';                                                                                                                                                        
           $trconfig['cookie_disclaimer']         = 'true';                                                                                                                                                        
           $trconfig['share']                     = 'true';                                                                                                                                                        
                                                                                                                                                                                                                   
           $dbconfig['download']             = '0';                                                                                                                                                                
           $dbconfig['share']                = '1';                                                                                                                                                                
           $dbconfig['home_now_playing']     = '0';                                                                                                                                                                
           $dbconfig['home_recently_played'] = '0';                                                                                                                                                                
           break;

The trconfig stuff ends up here i think: config/ampache.cfg.php