- Advanced code migrations now disable then re-enable triggers.
Brings run time down to < 15 seconds, no need to thread them.
- Changing ap_ids and actor_ids in migrations to a fake url,
so it doesn't break XsdAnyUri in activitystreams.
- lemmy_gamma
- pictrs_gamma
- iframely
- restart: "always"
lemmy_alpha:
image: lemmy-federation:latest
- LEMMY_SETUP__SITE_NAME=lemmy_alpha
- RUST_BACKTRACE=1
- RUST_LOG=debug
- restart: always
depends_on:
- postgres_alpha
postgres_alpha:
- POSTGRES_DB=lemmy
volumes:
- ./volumes/postgres_alpha:/var/lib/postgresql/data
- restart: always
pictrs_alpha:
image: asonix/pictrs:v0.1.13-r0
user: 991:991
volumes:
- ./volumes/pictrs_alpha:/mnt
- restart: always
lemmy_beta:
image: lemmy-federation:latest
- LEMMY_SETUP__SITE_NAME=lemmy_beta
- RUST_BACKTRACE=1
- RUST_LOG=debug
- restart: always
depends_on:
- postgres_beta
postgres_beta:
- POSTGRES_DB=lemmy
volumes:
- ./volumes/postgres_beta:/var/lib/postgresql/data
- restart: always
pictrs_beta:
image: asonix/pictrs:v0.1.13-r0
user: 991:991
volumes:
- ./volumes/pictrs_beta:/mnt
- restart: always
lemmy_gamma:
image: lemmy-federation:latest
- LEMMY_SETUP__SITE_NAME=lemmy_gamma
- RUST_BACKTRACE=1
- RUST_LOG=debug
- restart: always
depends_on:
- postgres_gamma
postgres_gamma:
- POSTGRES_DB=lemmy
volumes:
- ./volumes/postgres_gamma:/var/lib/postgresql/data
- restart: always
pictrs_gamma:
image: asonix/pictrs:v0.1.13-r0
user: 991:991
volumes:
- ./volumes/pictrs_gamma:/mnt
- restart: always
iframely:
image: dogbin/iframely:latest
volumes:
- ../iframely.config.local.js:/iframely/config.local.js:ro
- restart: always
-- Add federation columns to the two actor tables
alter table user_
-- TODO uniqueness constraints should be added on these 3 columns later
-add column actor_id character varying(255) not null default 'changeme', -- This needs to be checked and updated in code, building from the site url if local
+add column actor_id character varying(255) not null default 'http://fake.com', -- This needs to be checked and updated in code, building from the site url if local
add column bio text, -- not on community, already has description
add column local boolean not null default true,
add column private_key text, -- These need to be generated from code
-- Community
alter table community
-add column actor_id character varying(255) not null default 'changeme', -- This needs to be checked and updated in code, building from the site url if local
+add column actor_id character varying(255) not null default 'http://fake.com', -- This needs to be checked and updated in code, building from the site url if local
add column local boolean not null default true,
add column private_key text, -- These need to be generated from code
add column public_key text,
alter table post
-- TODO uniqueness constraints should be added on these 3 columns later
-add column ap_id character varying(255) not null default 'changeme', -- This needs to be checked and updated in code, building from the site url if local
+add column ap_id character varying(255) not null default 'http://fake.com', -- This needs to be checked and updated in code, building from the site url if local
add column local boolean not null default true
;
alter table comment
-- TODO uniqueness constraints should be added on these 3 columns later
-add column ap_id character varying(255) not null default 'changeme', -- This needs to be checked and updated in code, building from the site url if local
+add column ap_id character varying(255) not null default 'http://fake.com', -- This needs to be checked and updated in code, building from the site url if local
add column local boolean not null default true
;
drop view user_view cascade;
alter table user_
-add column fedi_name varchar(40) not null default 'changeme';
+add column fedi_name varchar(40) not null default 'http://fake.com';
alter table user_
add constraint user__name_fedi_name_key unique (name, fedi_name);
alter table private_message
-add column ap_id character varying(255) not null default 'changeme', -- This needs to be checked and updated in code, building from the site url if local
+add column ap_id character varying(255) not null default 'http://fake.com', -- This needs to be checked and updated in code, building from the site url if local
add column local boolean not null default true
;
read: None,
published: None,
updated: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
};
embed_description: iframely_description,
embed_html: iframely_html,
thumbnail_url: pictrs_thumbnail,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
published: None,
};
deleted: None,
read: None,
updated: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
published: None,
};
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
use log::info;
pub fn run_advanced_migrations(conn: &PgConnection) -> Result<(), Error> {
- user_updates_2020_04_02(conn)?;
- community_updates_2020_04_02(conn)?;
- post_updates_2020_04_03(conn)?;
- comment_updates_2020_04_03(conn)?;
- private_message_updates_2020_05_05(conn)?;
-
+ user_updates_2020_04_02(&conn)?;
+ community_updates_2020_04_02(&conn)?;
+ post_updates_2020_04_03(&conn)?;
+ comment_updates_2020_04_03(&conn)?;
+ private_message_updates_2020_05_05(&conn)?;
Ok(())
}
// Update the actor_id, private_key, and public_key, last_refreshed_at
let incorrect_users = user_
- .filter(actor_id.eq("changeme"))
+ .filter(actor_id.eq("http://fake.com"))
.filter(local.eq(true))
.load::<User_>(conn)?;
+ sql_query("alter table user_ disable trigger refresh_user").execute(conn)?;
+
for cuser in &incorrect_users {
let keypair = generate_actor_keypair()?;
User_::update(&conn, cuser.id, &form)?;
}
+ sql_query("alter table user_ enable trigger refresh_user").execute(conn)?;
+
info!("{} user rows updated.", incorrect_users.len());
Ok(())
// Update the actor_id, private_key, and public_key, last_refreshed_at
let incorrect_communities = community
- .filter(actor_id.eq("changeme"))
+ .filter(actor_id.eq("http://fake.com"))
.filter(local.eq(true))
.load::<Community>(conn)?;
+ sql_query("alter table community disable trigger refresh_community").execute(conn)?;
+
for ccommunity in &incorrect_communities {
let keypair = generate_actor_keypair()?;
Community::update(&conn, ccommunity.id, &form)?;
}
+ sql_query("alter table community enable trigger refresh_community").execute(conn)?;
+
info!("{} community rows updated.", incorrect_communities.len());
Ok(())
// Update the ap_id
let incorrect_posts = post
- .filter(ap_id.eq("changeme"))
+ .filter(ap_id.eq("http://fake.com"))
.filter(local.eq(true))
.load::<Post>(conn)?;
+ sql_query("alter table post disable trigger refresh_post").execute(conn)?;
+
for cpost in &incorrect_posts {
Post::update_ap_id(&conn, cpost.id)?;
}
info!("{} post rows updated.", incorrect_posts.len());
+ sql_query("alter table post enable trigger refresh_post").execute(conn)?;
+
Ok(())
}
// Update the ap_id
let incorrect_comments = comment
- .filter(ap_id.eq("changeme"))
+ .filter(ap_id.eq("http://fake.com"))
.filter(local.eq(true))
.load::<Comment>(conn)?;
+ sql_query("alter table comment disable trigger refresh_comment").execute(conn)?;
+
for ccomment in &incorrect_comments {
Comment::update_ap_id(&conn, ccomment.id)?;
}
+ sql_query("alter table comment enable trigger refresh_comment").execute(conn)?;
+
info!("{} comment rows updated.", incorrect_comments.len());
Ok(())
// Update the ap_id
let incorrect_pms = private_message
- .filter(ap_id.eq("changeme"))
+ .filter(ap_id.eq("http://fake.com"))
.filter(local.eq(true))
.load::<PrivateMessage>(conn)?;
+ sql_query("alter table private_message disable trigger refresh_private_message").execute(conn)?;
+
for cpm in &incorrect_pms {
PrivateMessage::update_ap_id(&conn, cpm.id)?;
}
+ sql_query("alter table private_message enable trigger refresh_private_message").execute(conn)?;
+
info!("{} private message rows updated.", incorrect_pms.len());
Ok(())
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
deleted: None,
updated: None,
nsfw: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
local: true,
private_key: None,
public_key: None,
embed_description: None,
embed_html: None,
thumbnail_url: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
published: None,
};
parent_id: None,
published: None,
updated: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
};
parent_id: None,
published: inserted_comment.published,
updated: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
};
read: None,
published: None,
updated: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
};
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
deleted: None,
updated: None,
nsfw: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
local: true,
private_key: None,
public_key: None,
embed_description: None,
embed_html: None,
thumbnail_url: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
published: None,
};
read: None,
published: None,
updated: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
};
my_vote: None,
subscribed: None,
saved: None,
- ap_id: "changeme".to_string(),
+ ap_id: "http://fake.com".to_string(),
local: true,
community_actor_id: inserted_community.actor_id.to_owned(),
community_local: true,
my_vote: Some(1),
subscribed: None,
saved: None,
- ap_id: "changeme".to_string(),
+ ap_id: "http://fake.com".to_string(),
local: true,
community_actor_id: inserted_community.actor_id.to_owned(),
community_local: true,
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
removed: None,
deleted: None,
updated: None,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
local: true,
private_key: None,
public_key: None,
deleted: false,
published: inserted_community.published,
updated: None,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
local: true,
private_key: None,
public_key: None,
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
deleted: None,
updated: None,
nsfw: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
local: true,
private_key: None,
public_key: None,
embed_description: None,
embed_html: None,
thumbnail_url: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
published: None,
};
parent_id: None,
published: None,
updated: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
};
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
deleted: None,
updated: None,
nsfw: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
local: true,
private_key: None,
public_key: None,
embed_description: None,
embed_html: None,
thumbnail_url: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
published: None,
};
embed_description: None,
embed_html: None,
thumbnail_url: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
};
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
deleted: None,
updated: None,
nsfw: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
local: true,
private_key: None,
public_key: None,
embed_description: None,
embed_html: None,
thumbnail_url: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
published: None,
};
embed_description: None,
embed_html: None,
thumbnail_url: None,
- ap_id: "changeme".to_string(),
+ ap_id: "http://fake.com".to_string(),
local: true,
creator_actor_id: inserted_user.actor_id.to_owned(),
creator_local: true,
embed_description: None,
embed_html: None,
thumbnail_url: None,
- ap_id: "changeme".to_string(),
+ ap_id: "http://fake.com".to_string(),
local: true,
creator_actor_id: inserted_user.actor_id.to_owned(),
creator_local: true,
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
read: None,
published: None,
updated: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
};
read: false,
updated: None,
published: inserted_private_message.published,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
};
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
lang: "browser".into(),
show_avatars: true,
send_notifications_to_email: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
bio: None,
local: true,
private_key: None,
deleted: None,
updated: None,
nsfw: false,
- actor_id: "changeme".into(),
+ actor_id: "http://fake.com".into(),
local: true,
private_key: None,
public_key: None,
embed_description: None,
embed_html: None,
thumbnail_url: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
published: None,
};
parent_id: None,
published: None,
updated: None,
- ap_id: "changeme".into(),
+ ap_id: "http://fake.com".into(),
local: true,
};