Skip to content

Commit 626c2cc

Browse files
author
Oscar Nierstrasz
committed
Script cleanup
1 parent f077c56 commit 626c2cc

19 files changed

+189
-90
lines changed

PicoConfig/SYNC-CONFIG-LOCAL-ONLY.command

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#! /bin/sh
22
#
3-
# Sync the config files from the repo to the local and remote sites.
4-
#
5-
# NB: Won't be needed if these files are linked to the github repo -- pull instead.
3+
# Sync the config files from the repo to the local site.
64
#
75
# 2022-07-04
86

@@ -12,7 +10,6 @@ CONFIG=/Users/oscar/Documents/Projects/scgpico/PicoConfig
1210
SCGBIB=/Users/oscar/Documents/Projects/scgbib-NEW
1311

1412
LOCAL=/Users/oscar/Sites/Pico/
15-
[email protected]:/srv/testscg.unibe.ch/pico-release-v2/
1613

1714
rsync ${RSYNC} ${CONFIG}/config/ ${LOCAL}/config/
1815
rsync ${RSYNC} ${CONFIG}/themes/scg/ ${LOCAL}/themes/scg/

PicoConfig/SYNC-CONFIG.command

-28
This file was deleted.

PicoConfig/SYNC-scgbib.command

-20
This file was deleted.

PicoConfig/apache/scg.unibe.ch

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# This is the apache file for the migrated scg.unibe.ch web server hosted with Pico.
2+
# It replaces the legacy Pier CMS-based server.
3+
# First installed 2022-07-17 by Oscar Nierstrasz
4+
5+
<VirtualHost *:80>
6+
7+
RewriteEngine On
8+
ProxyPreserveHost On
9+
10+
ServerName scg.unibe.ch
11+
ServerAlias yogi.inf.unibe.ch
12+
ServerAdmin scg@inf.unibe.ch
13+
14+
# error logs
15+
ErrorLog /var/log/apache2/scg-pico-error.log
16+
CustomLog /var/log/apache2/scg-pico-access.log vhost_combined
17+
18+
# normalize the domain
19+
RewriteCond %{HTTP_HOST} !^scg\.unibe\.ch [nocase]
20+
RewriteCond %{HTTP_HOST} !^$
21+
RewriteRule ^/(.*) http://scg.unibe.ch/$1 [last,R=permanent]
22+
23+
# Pico assets
24+
RewriteRule ^/scgbib(.*) /assets/scgbib$1 [proxy,last]
25+
RewriteRule ^/archive(.*) /assets/archive$1 [proxy,last]
26+
RewriteRule ^/download(.*) /assets/download$1 [proxy,last]
27+
RewriteRule ^/files(.*) /assets/files$1 [proxy,last]
28+
29+
# static files
30+
DocumentRoot /srv/scg.unibe.ch/pico-release-v2
31+
<Directory /srv/scg.unibe.ch/pico-release-v2>
32+
Order allow,deny
33+
Allow from all
34+
# Enable server side includes!
35+
Options Indexes +IncludesNoExec FollowSymLinks MultiViews ExecCGI
36+
AddHandler server-parsed .html
37+
AllowOverride All
38+
</Directory>
39+
40+
# Legacy moved pages
41+
RewriteRule ^/oscar(.*) /staff/oscar$1 [R=permanent]
42+
RewriteRule ^/research.html$ /research [R=permanent]
43+
RewriteRule ^/Resources/JExample$ /research/jexample [R=permanent]
44+
RewriteRule ^/wiki/((helvetia|changeboxes).*)$ /research/$1 [R=permanent]
45+
RewriteRule ^/wiki/oscarnierstrasz/commonwritingerrors.*$ /wiki/howtos/commonwritingerrors [R=permanent]
46+
RewriteRule ^/wiki/oscarnierstrasz/neversayallowtoagain.*$ /wiki/howtos/neversayallowtoagain [R=permanent]
47+
48+
RewriteRule ^/wiki/p2smallwiki.*$ /teaching/p2 [R=permanent]
49+
RewriteRule ^/wiki/((diesel).*) /research/helvetia [R=permanent]
50+
RewriteRule ^/wiki/((hermion).*) /research/$1 [R=permanent]
51+
52+
RewriteRule ^/wiki/codemap /research/softwarecartography [R=permanent]
53+
RewriteRule ^/wiki/((fame).*) /wiki/projects/$1 [R=permanent]
54+
RewriteRule ^/wiki/((spy).*) /wiki/projects/$1 [R=permanent]
55+
RewriteRule ^/wiki/((develect).*) /wiki/projects/$1 [R=permanent]
56+
RewriteRule ^/((jexample).*) /research/$1 [R=permanent]
57+
RewriteRule ^/wiki/((jexample).*) /research/$1 [R=permanent]
58+
RewriteRule ^/wiki/projects/((jexample).*) /research/$1 [R=permanent]
59+
RewriteRule ^/wiki/((rbcrawler).*) /wiki/projects/$1 [R=permanent]
60+
RewriteRule ^/wiki/((pimon).*) /wiki/projects/$1 [R=permanent]
61+
RewriteRule ^/wiki/((pygirl).*) /wiki/projects/$1 [R=permanent]
62+
RewriteRule ^/wiki/((schemetalk).*) /research/$1 [R=permanent]
63+
RewriteRule ^/wiki/projects/((schemetalk).*) /research/$1 [R=permanent]
64+
RewriteRule ^/wiki/((softwarecartography).*) /research/$1 [R=permanent]
65+
RewriteRule ^/wiki/((cells).*) /wiki/projects/$1 [R=permanent]
66+
RewriteRule ^/wiki/((codecrawler).*) http://www.inf.unisi.ch/faculty/lanza/codecrawler.html [R=permanent]
67+
68+
RewriteRule ^/wiki/moose/famoosr2007.* http://moose.unibe.ch/events/famoosr2007 [R=permanent]
69+
RewriteRule ^/wiki/famoosr2007.* http://moose.unibe.ch/events/famoosr2007 [R=permanent]
70+
RewriteRule ^/wiki/moose http://moose.unibe.ch/ [R=permanent]
71+
RewriteRule ^/wiki/((wasdett2008).*) /wiki/events/$1 [R=permanent]
72+
RewriteRule ^/wiki/((woor2007).*) /wiki/events/$1 [R=permanent]
73+
RewriteRule ^/wiki/((woor2006).*) /wiki/events/$1 [R=permanent]
74+
RewriteRule ^/wiki/((suite2009).*) /wiki/events/$1 [R=permanent]
75+
RewriteRule ^/wiki/((phdgipfeli).*) /wiki/events/$1 [R=permanent]
76+
77+
RewriteRule ^/wiki/faq/latexfaq(.*) /wiki/faq/latex$1 [R=permanent]
78+
RewriteRule ^/wiki/faq/mailmanfaq(.*) /wiki/faq/mailman$1 [R=permanent]
79+
RewriteRule ^/wiki/faq/pharofaq(.*) /wiki/faq/pharo$1 [R=permanent]
80+
RewriteRule ^/wiki/faq/pierfaq(.*) /wiki/faq/pier$1 [R=permanent]
81+
RewriteRule ^/wiki/faq/seasidefaq(.*) /wiki/faq/seaside$1 [R=permanent]
82+
83+
# link as published in the ERCIM News
84+
RewriteRule ^/bigsoftwaredata(.*)$ /research/bigsoftwaredata$1 [R=permanent]
85+
86+
# staff pages
87+
RewriteRule ^/wiki/((adriankuhn).*)$ /staff/$1 [R=permanent]
88+
RewriteRule ^/wiki/((oscarnierstrasz).*)$ /staff/oscar [R=permanent]
89+
RewriteRule ^/wiki/((adrianlienhard).*)$ http://www.adrian-lienhard.ch/ [R=permanent]
90+
RewriteRule ^/wiki/((davidroethlisberger).*)$ /staff/$1 [R=permanent]
91+
RewriteRule ^/wiki/((jorgeressia).*)$ /staff/$1 [R=permanent]
92+
RewriteRule ^/wiki/((lukasrenggli).*)$ http://www.lukas-renggli.ch/ [R=permanent]
93+
RewriteRule ^/wiki/((toonverwaest).*)$ /staff/$1 [R=permanent]
94+
RewriteRule ^/wiki/((tudorgirba).*)$ http://www.tudorgirba.com/ [R=permanent]
95+
RewriteRule ^/wiki/((marcusdenker).*)$ http://marcusdenker.de/ [R=permanent]
96+
RewriteRule ^/wiki/((markusglli).*)$ http://www.emergent.de/ [R=permanent]
97+
RewriteRule ^/wiki/((orlagreevy).*)$ /wiki/alumni/$1 [R=permanent]
98+
99+
# proxy to experts
100+
RewriteRule ^/softwarenaut(.*)$ http://localhost:8087/softwarenaut$1 [proxy,last]
101+
ProxyRequests Off
102+
103+
</VirtualHost>
104+
File renamed without changes.

cmd/SYNC-scgbib.command

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#! /bin/sh
2+
#
3+
# Sync the scgbib repo to the server.
4+
#
5+
# 2022-07-17
6+
7+
RSYNC="-avz --delete -e ssh --stats --progress"
8+
9+
LOCAL=/Users/oscar/Documents/Projects/
10+
[email protected]:/srv/scg.unibe.ch/
11+
12+
rsync ${RSYNC} ${LOCAL}scgbib-NEW/ ${REMOTE}/scgbib/
13+
14+
open http://scg.unibe.ch/scgbib
15+

cmd/SYNC-scgpico.command

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#! /bin/sh
2+
#
3+
# Sync the scgpico repo to the server.
4+
#
5+
# 2022-07-17
6+
7+
RSYNC="-avz --delete -e ssh --stats --progress"
8+
9+
LOCAL=/Users/oscar/Documents/Projects/
10+
[email protected]:/srv/scg.unibe.ch/
11+
12+
rsync ${RSYNC} ${LOCAL}/scgpico/ ${REMOTE}/scgpico/
13+
14+
open http://scg.unibe.ch
15+

migration/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Description
22

3-
This folder contains various resources and experiments to migrate the SCG Pier installation to Pico, a lightweight markdown-based CMS.
3+
This folder contains various resources used to migrate the SCG Pier installation to Pico, a lightweight markdown-based CMS.
44

55
NOTES -- old notes
66
TODO-LOG -- tasks to do and done, and a brief FAQ

migration/TODO-LOG.md

+23-16
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,19 @@ This file lists pending migration todos, past todos (done) and a brief FAQ.
66
---
77
# Migration to do
88

9-
* Changed all explicit references to http://scg.unibe.ch/ to /
10-
* ... Run linkchecker to verify nothing is broken
11-
12-
* Clean up the testscg folder
13-
- Copy the assets folders from the old server to the root of the new server
14-
- Checkout (copy) the scgpico and scgbib folders to the root
15-
- Link the contents and assets folders to the server root folders
16-
- Clean up the downloads folder (remove large cruft)
17-
18-
* Fix Apache rewrites
19-
- set /scgbib etc as proxy rather than R=302
20-
21-
* Try to connect to snaut pier and export those pages too ...
9+
* Update the README files for the scgpico and scgbib repos
2210

23-
* Remove links to proxies
24-
- softwarenaut etc
11+
* Fix/disable the scripts
2512

26-
* Update the README files for the scgpico and scgbib repos
13+
* What to do about softwarenaut website?
14+
- Retire it? Export those pages too?
2715

2816
---
2917
# scgbib to do
3018

3119
* Fix handling of accents in scgbib
3220
* Fix the back-end js-conversion script in the new scgbib github repo
21+
* Alternatively adapt the old perl accent translation script to post-process the file
3322

3423
* Clean up scgbib repo
3524
* set up github actions to test for errors and generate JS
@@ -45,6 +34,24 @@ This file lists pending migration todos, past todos (done) and a brief FAQ.
4534
---
4635
## DONE
4736

37+
- Replace the scg pier service by the new pico service
38+
- Adapted the apache file from the test server to the new scg server
39+
- Shut down the scg server
40+
- Rename the scg and testscg service folders (backup the old scg service)
41+
- Restart apache
42+
43+
- Cleaned up the testscg folder
44+
- Copied the assets, downloads and files folders from the old server to the root of the new server
45+
- Copied the scgpico and scgbib folders to the root (can't checkout yet)
46+
- Linked the contents and assets folders to the server root folders
47+
- Cleaned up the downloads folder (removed large cruft)
48+
49+
- Fixed Apache rewrites
50+
- set /scgbib etc as proxy rather than R=302
51+
52+
- Changed all explicit references to http://scg.unibe.ch/ to /
53+
- Fixed (almost) all broken links
54+
4855
- Merged the sidebar css into the main style
4956

5057
- Added missing page title as a heading to each page

migration/bin/test-sidebar copy.md

-9
This file was deleted.

migration/bin/test-sidebar.md

-11
This file was deleted.

migration/bin/FIND-BAD-ACCENTS.command migration/cmd/FIND-BAD-ACCENTS.command

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#! /bin/sh
2+
#
3+
# Generate a file containing all strange non-ascii characters found in the migrated pages.
4+
# This has been used to identify characters to translate in post-processing using the fixAccents script.
25

36
REPO=/Users/oscar/Documents/Projects/scgpico
47
cd ${REPO}

migration/cmd/FIND-PAGES.command

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#! /bin/sh
2+
#
3+
# Generic script to search for pages with funny characters or particular incantations
4+
5+
# SEARCH='value:redirect'
6+
SEARCH='http://scg.unibe.ch/'
7+
8+
CONTENT=/Users/oscar/Documents/Projects/scgpico/content
9+
cd ${CONTENT}
10+
find . -type f -exec fgrep -H "${SEARCH}" {} \;
11+

migration/bin/SYNC-CINDY2LOCAL.command migration/cmd/SYNC-CINDY2LOCAL.command

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#
66
# 2022-07-04
77

8+
echo "Don't do this -- the files have been migrated."
9+
10+
exit
11+
812
RSYNC="-avz --delete -e ssh --stats --progress"
913
B=/Users/oscar/Documents/Projects/scgpico/migration/bin
1014

migration/bin/SYNC-CINDY2REPO2YOGI.command migration/cmd/SYNC-CINDY2REPO2YOGI.command

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#
55
# 2022-07-04
66

7+
echo "Don't do this -- the files have been migrated."
8+
9+
exit
10+
711
RSYNC="-avz --delete -e ssh --stats --progress"
812
B=/Users/oscar/Documents/Projects/scgpico/migration/bin
913

migration/bin/SYNC-FILEOUTS.command migration/cmd/SYNC-FILEOUTS.command

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#
55
# 2022-07-05
66

7+
echo "Don't do this -- the files have been migrated."
8+
9+
exit
10+
711
RSYNC="-avz --delete -e ssh --stats --progress"
812
B=/Users/oscar/Documents/Projects/project-scg-pier-migration/bin
913

migration/bin/SYNC-YOGI-image-2CINDY.command migration/cmd/SYNC-YOGI-image-2CINDY.command

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
#
66
# 2022-07-13
77

8-
RSYNC="-avz --delete -e ssh --stats --progress"
8+
echo "Don't do this -- the files have been migrated."
9+
10+
exit
911

12+
RSYNC="-avz --delete -e ssh --stats --progress"
1013
MIRROR="/Users/oscar/Mirrors/home/scg/scg.unibe.ch"
1114

1215
[email protected]:/srv/scg.unibe.ch
File renamed without changes.

0 commit comments

Comments
 (0)