-
Notifications
You must be signed in to change notification settings - Fork 18
Development Setup
On the dev server, each of you have a folder which contains a copy of the website. When you go to http://dev.jdarchive.org/YOURNAME/web/en/home, that website pulls in the contents of your folder on the dev server to create a copy of our main site.
Your folder on the dev server should be linked to your forked copy of the JDArchive repo. That is, the "origin" remote is linked to YOUR fork. However, the "upstream" remote is linked to the JDArchive repo.
You should clone your forked repository on your local machine. That way, on your computer, you have a code base that you can edit with your own text editor.
-
On Github, "fork" this repo to your own account: https://github.com/Japan-Digital-Archives/Japan-Digital-Archive
-
SSH into the dev server either from putty (PC) or terminal (MAC/Linux). On putty enter
dev.jdarchive.org
as the host, hit connect, then enter username and password emailed to you. On terminal, usessh [email protected]
from the terminal and it will prompt you for the password. -
Type in
passwd
and hit enter, this will prompt you to change your password to something secure that isn't the default password emailed to you. -
Once you're sshed in, you'll be in ~/home/USERNAME. From here, generate your ssh key and add it to your github account. [Instructions here] (https://help.github.com/articles/generating-ssh-keys/#platform-linux) - Start on step 2. In step 3, the xclip thing won't work, so use
cat ~/.ssh/id_rsa.pub
and copy the output, then continue with their instructions. -
Next,
cd /var/www/
. Then dols
and you should see a lot names - that means you're in the right spot. -
Get the HTTPS clone url of your forked repo (its on your forked repo's github page in the lower right, but click SSH to get the right URL): it should be like https://github.com/GITHUBUSERNAME/Japan-Digital-Archive.git
-
Run
sudo mkdir YOURUSERNAME
andsudo chown YOURUSERNAME YOURUSERNAME
- yes you should type your username twice in that second command. . -
In /var/www, do
git clone CLONE-URL YOURUSERNAME
- the username is important because that will make your repo clone into your directory. -
cd username
so that you are in your folder. -
Check
git remote -v
- it may have the origin and upstream remotes if you set them up on your local machine already, but I can't remember if those transfer. -
If you don't have the following remotes, add them with:
git remote add origin "[email protected]:YOUR-GITHUB-USERNAME/Japan-Digital-Archive.git"
andgit remote add upstream "https://github.com/Japan-Digital-Archives/Japan-Digital-Archive.git"
(yes, the URLs are supposed to be different formats) -
Do
mkdir app/cache
andmkdir app/logs
-
Type and enter the following:
cp ../corinne/app/config/parameters.ini app/config/
,cp ../corinne/web/.htaccess web/
,sudo setfacl -R -m u:www-data:rwx -m u:$1:rwx app/cache app/logs
,sudo setfacl -dR -m u:www-data:rwx -m u:$1:rwx app/cache app/logs
(yes it should say corinne in those instructions, keep the corinne there) -
Now you have to edit the parameters file, replacing 'corinne' with your username. Type
sudo vim app/config/parameters.ini
, then type in "I" (capital i) to get into insert mode, then use keyboard arrows to navigate to the "directory" line where it says "corinne/web", then change it to "username/web" with your username. The press ESC to get out of insert mode, and ":wq!" to save and quit. -
Run
composer install
-
Check if http://dev.jdarchive.org/USERNAME/web/en/home works! It should look like the regular jdarchive homepage.
- ssh into dev server
sudo adduser username
- Enter default password, enter default for everything else
- To give sudo access:
sudo usermod -a -G sudo username
New employees who will be doing work on the dev server need to have their account created from the steps above, and then sent the instructions for cloning their repo onto the server and installing composer. Also, employees should make an account on the JDA site itself, and then should be given Admin privileges through the Admin Dashboard's user list so that they will have access to the admin dashboard. If they will need access to the production server, they need to send the tech lead their public ssh-key (either the string starting with 'ssh-rsa' and probably ending with an email, or the file containing this string). The tech lead then needs to add that string to the list of authorized keys, by editing the authorized_keys file at /home/ubuntu/.ssh
on the prod server. Typically we've been replacing emails at the end with rsa-key-ydmdate for when the key was added. Once this happens, the employee should be able to ssh into [email protected] without a password (unless there is a password connected with their ssh key but they will know that).