Skip to content

Commit f47a093

Browse files
authored
Permissions bugfix for guide design (#7)
* ensuring permissions for web access are set * slightly more helpful error message (fixes issue with tmp.fa not being written)
1 parent 1180e97 commit f47a093

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

Diff for: docker-compose.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ services:
1717
&& ./setup.sh
1818
&& python3 /var/www/html/src/setup/setup.py -r /var/www/html -g ${ORGANISM} -v ${ASSEMBLY} -fa2bit /var/www/html/bin/faToTwoBit -b /var/www/html/bin/ncbi-blast-2.7.1+/bin
1919
&& /var/www/html/src/setup/enable_dicey.sh ${ORGANISM} ${ASSEMBLY}
20+
&& cd /var/www/html/src/installation
21+
&& sudo ./setPermissions.sh
2022
&& sudo service apache2 start
2123
&& tail -f /dev/null"

Diff for: src/guide-finder/core/get_sequence.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def fetch_sequence(twobit_to_fa, chrom_coord, genome_twobit, output_fasta):
3333
except Exception as err:
3434
print(err)
3535

36-
if os.path.getsize(tmp_fasta) == 0:
36+
if not os.path.isfile(tmp_fasta) or os.path.getsize(tmp_fasta) == 0:
37+
print("twobitToFasta failed: "+" ".join([twobit_to_fa, seq_param, start_param, end_param, genome_twobit, tmp_fasta]))
3738
sys.exit("sequence is empty for given parameters. Please check your parameters again")
3839

3940
with open(tmp_fasta,"r") as inp_fa, open(output_fasta,"w") as out_fa:

Diff for: src/installation/setPermissions.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
# need to make sure these files and directories can be run from the web
2-
cd ../..
1+
#!/bin/bash
2+
# script to ensure these files and directories can be run from the web
3+
4+
curr_dir=${PWD##*/}
5+
if [ $curr_dir == "installation" ]; then
6+
cd ../..
7+
else
8+
echo "this script must be run from the installation folder"
9+
exit
10+
fi
311

412
sudo chgrp -R www-data config
513
sudo chmod -R 755 config

0 commit comments

Comments
 (0)